Re: What is "#define alloc_ieee80211 alloc_ieee80211_rsl"?

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

 



On Tue, 09 Oct 2018 20:07:08 +0100, John Whitmore said:

> #define alloc_ieee80211			alloc_ieee80211_rsl
>
> So what am I missing or why are a number of functions being redefined
> as another name, which doesn't exist?

There's areas in the kernel which use the preprocessor ## to glue stuff
together. see include/asm-generic/atomic-long.h  and ATOMIC_LONG_FETCH_OP for
an example. It's also use in some code to generate function names to initialize
a structure of function pointers.  This can make grepping for a function name
troublesome if you don't realize there's ## abuse going on to create a function
name on the fly.

However, in this particular case, it looks like they're redirecting an
allocator so that for rtl8192u, when common/copypasted code calls
alloc_ieee80211 it gets redirected to their own version...

[/usr/src/linux-next] git grep alloc_ieee80211
drivers/staging/rtl8192u/ieee80211/ieee80211.h:#define alloc_ieee80211                  alloc_ieee80211_rsl
drivers/staging/rtl8192u/ieee80211/ieee80211.h:  * allocated beyond this structure by alloc_ieee80211
drivers/staging/rtl8192u/ieee80211/ieee80211.h:struct net_device *alloc_ieee80211(int sizeof_priv);
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c:struct net_device *alloc_ieee80211(int sizeof_priv)
drivers/staging/rtl8192u/r8192U_core.c: dev = alloc_ieee80211(sizeof(struct r8192_priv));


Attachment: pgpL7qQr6MHjd.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux