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
..
2015-01-27 11:07:35 +01:00
2015-01-27 11:09:13 +01:00
2014-11-04 13:18:21 +01:00
2014-04-09 14:49:43 +02:00
2015-03-30 10:48:26 +02:00
2015-08-14 17:49:53 +02:00
2015-07-17 15:38:01 +02:00
2015-05-11 19:16:04 +02:00
2015-10-14 18:40:26 +02:00
2015-11-03 10:42:47 +01:00
2014-04-09 14:49:43 +02:00
2015-11-03 10:42:47 +01:00
2013-12-18 10:33:06 +01:00
2015-05-11 14:51:29 +02:00
2012-03-13 14:54:16 -04:00
2015-10-14 18:40:26 +02:00