mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 15:20:08 +01:00
platform: fix warning initializing static array freq_policy
Since kernel commit 8fe02e167efa8ed4a4503a5eedc0f49fcb7e3eb9,
the value NL80211_FREQUENCY_ATTR_NO_IR replaces PASSIVE_SCAN
and NO_IBSS. Hence their numerical values are identical and
cause the following compiler warning.
clang warns:
make[4]: Entering directory `./NetworkManager/src'
CC wifi-utils-nl80211.lo
platform/wifi/wifi-utils-nl80211.c:683:48: error: initializer overrides prior initialization of this subobject [-Werror,-Winitializer-overrides]
[NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
^~~~~~~~
platform/wifi/wifi-utils-nl80211.c:682:53: note: previous initialization is here
[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN] = { .type = NLA_FLAG },
^~~~~~~~
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
971dfc773f
commit
e31474f5d4
1 changed files with 9 additions and 0 deletions
|
|
@ -679,11 +679,20 @@ static int nl80211_wiphy_info_handler (struct nl_msg *msg, void *arg)
|
|||
static struct nla_policy freq_policy[NL80211_FREQUENCY_ATTR_MAX + 1] = {
|
||||
[NL80211_FREQUENCY_ATTR_FREQ] = { .type = NLA_U32 },
|
||||
[NL80211_FREQUENCY_ATTR_DISABLED] = { .type = NLA_FLAG },
|
||||
#ifdef NL80211_FREQUENCY_ATTR_NO_IR
|
||||
[NL80211_FREQUENCY_ATTR_NO_IR] = { .type = NLA_FLAG },
|
||||
#else
|
||||
[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN] = { .type = NLA_FLAG },
|
||||
[NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
|
||||
#endif
|
||||
[NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
|
||||
[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
|
||||
};
|
||||
#ifdef NL80211_FREQUENCY_ATTR_NO_IR
|
||||
G_STATIC_ASSERT (NL80211_FREQUENCY_ATTR_PASSIVE_SCAN == NL80211_FREQUENCY_ATTR_NO_IR && NL80211_FREQUENCY_ATTR_NO_IBSS == NL80211_FREQUENCY_ATTR_NO_IR);
|
||||
#else
|
||||
G_STATIC_ASSERT (NL80211_FREQUENCY_ATTR_PASSIVE_SCAN != NL80211_FREQUENCY_ATTR_NO_IBSS);
|
||||
#endif
|
||||
|
||||
if (nla_parse (tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
|
||||
genlmsg_attrlen (gnlh, 0), NULL) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue