assert macro to check null

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Sat Aug 10 02:34:46 EDT 2013


On Sat, 10 Aug 2013 11:16:07 +0530, Saket Sinha said:

> Actually  WARN_ON macro has been defined slightly differently for each
> Acrhitecture in kernel.

And that matters for the *caller*, why, exactly?  (Hint - the vast majority
of calls to WARN_ON() are in non-arch code, so it pretty much has to have
the same semantics on all architectures, even if the actual macro is
different)

> Can you specifically point out the definition of macro you have suggested
>  and where it is defined in kernel.

cd /usr/src/linux &&  find include arch -type f -name '*.h' | xargs egrep 'define.*WARN_ON'

If you're on parisc, avr32, s390, powerpc, sh, or blackfin, you'll
get the appropriate version in arch/.  If you're on anything else, you'll
get the version from include/asm-generic/bug.h

Not that it matters - you end up using it exactly the same no matter what arch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130810/a3b0cbe1/attachment.bin 


More information about the Kernelnewbies mailing list