mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 15:10:14 +01:00
platform/netlink: cleanup NLA_PUT() macro
Add parentheses around macro arguments. Yes, it's not technically necessary when using macro arguments are surrounded by commas. Still do it, for consistency and for not having special exceptions to the rule.
This commit is contained in:
parent
1d614dbded
commit
77af18c67b
1 changed files with 13 additions and 13 deletions
|
|
@ -292,21 +292,21 @@ nla_put_uint32(struct nl_msg *msg, int attrtype, uint32_t val)
|
|||
return nla_put(msg, attrtype, sizeof(val), &val);
|
||||
}
|
||||
|
||||
#define NLA_PUT(msg, attrtype, attrlen, data) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
if (nla_put(msg, attrtype, attrlen, data) < 0) \
|
||||
goto nla_put_failure; \
|
||||
} \
|
||||
#define NLA_PUT(msg, attrtype, attrlen, data) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
if (nla_put((msg), (attrtype), (attrlen), (data)) < 0) \
|
||||
goto nla_put_failure; \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
||||
#define NLA_PUT_TYPE(msg, type, attrtype, value) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
type __nla_tmp = value; \
|
||||
\
|
||||
NLA_PUT(msg, attrtype, sizeof(type), &__nla_tmp); \
|
||||
} \
|
||||
#define NLA_PUT_TYPE(msg, type, attrtype, value) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
type const _nla_tmp = value; \
|
||||
\
|
||||
NLA_PUT((msg), (attrtype), sizeof(_nla_tmp), &_nla_tmp); \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
||||
#define NLA_PUT_U8(msg, attrtype, value) NLA_PUT_TYPE(msg, uint8_t, attrtype, value)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue