]> git.baikalelectronics.ru Git - kernel.git/commit
wimax: fix duplicate initializer warning
authorArnd Bergmann <arnd@arndb.de>
Sun, 18 Oct 2020 18:00:13 +0000 (20:00 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 29 Oct 2020 18:27:37 +0000 (19:27 +0100)
commit39c66f2034d1ea021066c2f1662c1e8e2b8c9927
tree6d78b1a9b9f6b34dd343ad49acf87e6cfe378707
parent68ed2672b8fdb9454c449f573990714135c93adc
wimax: fix duplicate initializer warning

gcc -Wextra points out multiple fields that use the same index '1'
in the wimax_gnl_policy definition:

net/wimax/stack.c:393:29: warning: initialized field overwritten [-Woverride-init]
net/wimax/stack.c:397:28: warning: initialized field overwritten [-Woverride-init]
net/wimax/stack.c:398:26: warning: initialized field overwritten [-Woverride-init]

This seems to work since all four use the same NLA_U32 value, but it
still appears to be wrong. In addition, there is no intializer for
WIMAX_GNL_MSG_PIPE_NAME, which uses the same index '2' as
WIMAX_GNL_RFKILL_STATE.

Johannes already changed this twice to improve it, but I don't think
there is a good solution, so try to work around it by using a
numeric index and adding comments.

Fixes: 225708e56c99 ("genetlink: make policy common to family")
Fixes: f90804227514 ("wimax: use genl_register_family_with_ops()")
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
net/wimax/stack.c