linux/net
Andrey Ryabinin 68920c9732 net/mac80211/debugfs.c: prevent build failure with CONFIG_UBSAN=y
With upcoming CONFIG_UBSAN the following BUILD_BUG_ON in
net/mac80211/debugfs.c starts to trigger:

  BUILD_BUG_ON(hw_flag_names[NUM_IEEE80211_HW_FLAGS] != (void *)0x1);

It seems, that compiler instrumentation causes some code
deoptimizations.  Because of that GCC is not being able to resolve
condition in BUILD_BUG_ON() at compile time.

We could make size of hw_flag_names array unspecified and replace the
condition in BUILD_BUG_ON() with following:

  ARRAY_SIZE(hw_flag_names) != NUM_IEEE80211_HW_FLAGS

That will have the same effect as before (adding new flag without
updating array will trigger build failure) except it doesn't fail with
CONFIG_UBSAN.  As a bonus this patch slightly decreases size of
hw_flag_names array.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-20 17:09:18 -08:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv batman-adv: Drop immediate orig_node free function 2016-01-16 22:50:00 +08:00
bluetooth
bridge bridge: fix lockdep addr_list_lock false positive splat 2016-01-15 15:40:45 -05:00
caif
can
ceph
core Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-15 13:33:12 -08:00
dcb
dccp
decnet
dns_resolver
dsa
ethernet
hsr
ieee802154
ipv4 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-15 13:33:12 -08:00
ipv6 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-15 13:33:12 -08:00
ipx
irda
iucv
key
l2tp
l3mdev
lapb
llc
mac80211 net/mac80211/debugfs.c: prevent build failure with CONFIG_UBSAN=y 2016-01-20 17:09:18 -08:00
mac802154
mpls
netfilter
netlabel
netlink
netrom
nfc
openvswitch ovs: limit ovs recursions in ovs_execute_actions to not corrupt stack 2016-01-18 12:09:45 -05:00
packet
phonet
rds
rfkill
rose
rxrpc
sched
sctp sctp: the temp asoc's transports should not be hashed/unhashed 2016-01-17 19:11:44 -05:00
sunrpc Smaller bugfixes and cleanup, including a fix for a failures of 2016-01-15 12:49:44 -08:00
switchdev
tipc
unix
vmw_vsock
wimax
wireless
x25
xfrm
compat.c
Kconfig
Makefile
socket.c
sysctl_net.c