all: don't use NM_FLAGS_HAS() with non-constant argument

NM_FLAGS_HAS() uses a static-assert that the second argument is a
single flag (power of two). With a single flag, NM_FLAGS_HAS(),
NM_FLAGS_ANY() and NM_FLAGS_ALL() are all identical.

The second argument must be a compile time constant, and if that is
not the case, one must not use NM_FLAGS_HAS().

Use NM_FLAGS_ANY() in these cases.
This commit is contained in:
Thomas Haller
2017-12-11 16:38:42 +01:00
parent b2273ce3dd
commit c696a226ea
7 changed files with 9 additions and 9 deletions

View File

@@ -283,7 +283,7 @@ typedef enum {
#define FOR_EACH_DELAYED_ACTION(iflags, flags_all) \
for ((iflags) = (DelayedActionType) 0x1LL; (iflags) <= DELAYED_ACTION_TYPE_MAX; (iflags) <<= 1) \
if (NM_FLAGS_HAS (flags_all, iflags))
if (NM_FLAGS_ANY (flags_all, iflags))
typedef enum {
/* Negative values are errors from kernel. Add dummy member to