Thread (2 messages) 2 messages, 2 authors, 2013-08-10

assert macro to check null

From: Saket Sinha <hidden>
Date: 2013-08-10 05:46:07

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

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

Regards,
Saket Sinha


On Sat, Aug 10, 2013 at 11:05 AM, [off-list ref] wrote:
On Sat, 10 Aug 2013 09:58:10 +0530, Saket Sinha said:
quoted
get_cred(new); where null is struct cred *new.

I think this new might be NULL.

Now I plan to add an assert in our macro that deals with creds, like for
asserting passed object isn't NULL.

Any suggestions as to how I can do that?
        WARN_ON(!new);

is probably your best bet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130810/8a981c5f/attachment-0001.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help