Search Linux Wireless

Re: [PATCH] brcmfmac: fix compilation error seen while building only brcmfmac sub-directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/15/2025 11:00 PM, Gokul Sivakumar wrote:
> The function prototypes of brcmf_debug_create_memdump(), brcmf_debugfs_get_devdir()
> and brcmf_debugfs_add_entry() are protected by the "DEBUG" config MACRO in debug.h,
> while the corresponding function definitions remains unprotected in debug.c, so add
> the missing MACRO definition check.
> 
> Compilation error seen while building brcmfmac sub-directory with CONFIG_BRCMDBG=y
> is captured below.
> 
> $ make M=drivers/net/wireless/broadcom/brcm80211/brcmfmac
> 
> make[1]: Entering directory '/root/wireless-next/drivers/net/wireless/broadcom/brcm80211/brcmfmac'
>   CC [M]  debug.o
> debug.c:17:5: error: redefinition of ‘brcmf_debug_create_memdump’
>    17 | int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
>       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from bus.h:12,
>                  from debug.c:13:
> debug.h:136:5: note: previous definition of ‘brcmf_debug_create_memdump’ with type
> ‘int(struct brcmf_bus *, const void *, size_t)’ {aka ‘int(struct brcmf_bus *, const void *, long unsigned int)’}
>   136 | int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
>       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
> debug.c:45:16: error: redefinition of ‘brcmf_debugfs_get_devdir’
>    45 | struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr)
>       |                ^~~~~~~~~~~~~~~~~~~~~~~~
> debug.h:127:30: note: previous definition of ‘brcmf_debugfs_get_devdir’ with type
> ‘struct dentry *(struct brcmf_pub *)’
>   127 | static inline struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr)
>       |                              ^~~~~~~~~~~~~~~~~~~~~~~~
> debug.c:50:6: error: redefinition of ‘brcmf_debugfs_add_entry’
>    50 | void brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
>       |      ^~~~~~~~~~~~~~~~~~~~~~~
> debug.h:132:6: note: previous definition of ‘brcmf_debugfs_add_entry’ with type
> ‘void(struct brcmf_pub *, const char *, int (*)(struct seq_file *, void *))’
>   132 | void brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
>       |      ^~~~~~~~~~~~~~~~~~~~~~~
> make[3]: *** [/root/wireless-next/scripts/Makefile.build:203: debug.o] Error 1
> make[2]: *** [/root/wireless/wireless-next/Makefile:2006: .] Error 2
> make[1]: *** [/root/wireless/wireless-next/Makefile:248: __sub-make] Error 2
> make[1]: Leaving directory '/root/wireless-next/drivers/net/wireless/broadcom/brcm80211/brcmfmac'
> make: *** [Makefile:248: __sub-make] Error 2
> 
> Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@xxxxxxxxxxxx>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> index eecf8a38d94a..3cb50140eb2f 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> @@ -14,6 +14,7 @@
>  #include "fweh.h"
>  #include "debug.h"
>  
> +#ifdef DEBUG
>  int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
>  			       size_t len)
>  {
> @@ -54,3 +55,4 @@ void brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
>  	debugfs_create_devm_seqfile(drvr->bus_if->dev, fn,
>  				    drvr->wiphy->debugfsdir, read_fn);
>  }
> +#endif

This does not seem to be the correct approach.

The compilation of debug.c is controlled by CONFIG_BRCMDBG:
brcmfmac-$(CONFIG_BRCMDBG) += \
		debug.o

Hence the definitions of the prototypes vs stubs functions in debug.h should
use the same config object.

So I'd expect a change to debug.h to consider CONFIG_BRCMDBG (either instead
of or in addition to DEBUG)






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux