Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f8cd002 authored by wadesong's avatar wadesong
Browse files

msm: wlan: Fix a corner case build error in CNSS platform driver



When the following conditions are met:

1) Client code includes both include/net/cnss.h and
include/net/cnss_prealloc.h
2) CONFIG_SLUB_DEBUG is not defined in the defconfig of a
perticular platform

function wcnss_prealloc_check_memory_leak will be declared as:

void wcnss_prealloc_check_memory_leak(void);

in include/net/cnss_prealloc.h, and implemented as:

static inline void wcnss_prealloc_check_memory_leak(void) {}

in include/net/cnss.h, which will result in a build error.

Move the inline implementation of wcnss_prealloc_check_memory_leak
into include/net/cnss_prealloc.h and make the same function's
declaration enclosed by some conditional macros to avoid this kind
of build errors.

Change-Id: I4a1922a6293eaa257ae9a764bdbff27dee7c22ac
Signed-off-by: default avatarWade Song <wadesong@codeaurora.org>
parent 5b154abb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/skbuff.h>
#endif
#include <linux/debugfs.h>
#include <net/cnss_prealloc.h>

static DEFINE_SPINLOCK(alloc_lock);

+0 −4
Original line number Diff line number Diff line
@@ -169,10 +169,6 @@ extern void cnss_set_driver_status(enum cnss_driver_status driver_status);
static inline int wcnss_pre_alloc_reset(void) { return 0; }
#endif

#if !defined(CONFIG_WCNSS_MEM_PRE_ALLOC) || !defined(CONFIG_SLUB_DEBUG)
static inline void wcnss_prealloc_check_memory_leak(void) {}
#endif

extern int msm_pcie_enumerate(u32 rc_idx);
extern int cnss_auto_suspend(void);
extern int cnss_auto_resume(void);
+6 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -21,7 +21,12 @@
extern void *wcnss_prealloc_get(unsigned int size);
extern int wcnss_prealloc_put(void *ptr);
extern int wcnss_pre_alloc_reset(void);

#if !defined(CONFIG_WCNSS_MEM_PRE_ALLOC) || !defined(CONFIG_SLUB_DEBUG)
static inline void wcnss_prealloc_check_memory_leak(void) {}
#else
void wcnss_prealloc_check_memory_leak(void);
#endif

extern void wcnss_skb_prealloc_check_memory_leak(void);
extern int wcnss_skb_pre_alloc_reset(void);