Thread (7 messages) flat view 7 messages, 2 authors, 2018-10-11

Re: Question on FIELD_PREP() for static array

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2018-10-11 19:22:58
Also in: lkml

On Thu, 2018-10-11 at 21:13 +0200, Johannes Berg wrote:
However, I have another trick:

#define __NLA_ENSURE(condition) (0 * sizeof(struct { unsigned int x:1 - 2*!(condition);}))

or, in this context,

#define BUILD_BUG_ON_RET_ZERO(cond) (0 * sizeof(struct { unsigned int x:1 - 2*!(condition);}))
Oops, I forgot to insert the second !, it must be

#define BUILD_BUG_ON_RET_ZERO(cond) (0 * sizeof(struct { unsigned int x:1 - 2*!!(condition);}))

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help