Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

build_bug.h: remove BUILD_BUG_ON_NULL()

This macro is only used by net/ipv6/mcast.c, but there is no reason
why it must be BUILD_BUG_ON_NULL().

Replace it with BUILD_BUG_ON_ZERO(), and remove BUILD_BUG_ON_NULL()
definition from <linux/build_bug.h>.

Link: http://lkml.kernel.org/r/1515121833-3174-3-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
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>

authored by

Masahiro Yamada and committed by
Linus Torvalds
32b395a1 075db40c

+4 -6
-2
include/linux/build_bug.h
··· 8 8 #define __BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) 9 9 #define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) 10 10 #define BUILD_BUG_ON_ZERO(e) (0) 11 - #define BUILD_BUG_ON_NULL(e) ((void *)0) 12 11 #define BUILD_BUG_ON_INVALID(e) (0) 13 12 #define BUILD_BUG_ON_MSG(cond, msg) (0) 14 13 #define BUILD_BUG_ON(condition) (0) ··· 27 28 * aren't permitted). 28 29 */ 29 30 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); })) 30 - #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:(-!!(e)); })) 31 31 32 32 /* 33 33 * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
+4 -4
net/ipv6/mcast.c
··· 65 65 #include <net/ip6_checksum.h> 66 66 67 67 /* Ensure that we have struct in6_addr aligned on 32bit word. */ 68 - static void *__mld2_query_bugs[] __attribute__((__unused__)) = { 69 - BUILD_BUG_ON_NULL(offsetof(struct mld2_query, mld2q_srcs) % 4), 70 - BUILD_BUG_ON_NULL(offsetof(struct mld2_report, mld2r_grec) % 4), 71 - BUILD_BUG_ON_NULL(offsetof(struct mld2_grec, grec_mca) % 4) 68 + static int __mld2_query_bugs[] __attribute__((__unused__)) = { 69 + BUILD_BUG_ON_ZERO(offsetof(struct mld2_query, mld2q_srcs) % 4), 70 + BUILD_BUG_ON_ZERO(offsetof(struct mld2_report, mld2r_grec) % 4), 71 + BUILD_BUG_ON_ZERO(offsetof(struct mld2_grec, grec_mca) % 4) 72 72 }; 73 73 74 74 static struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT;