Skip to content

BUILD_BUG_ON: error on none-const expressions

Boaz Harrosh lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
2/5net/niu: Fix none-const BUILD_BUG_ON usagedrivers/net/niu.c+3 -50 replies
3/5virtio: Fix none-const BUILD_BUG_ON usageinclude/linux/virtio_config.h+7 -50 replies
3/5virtio: Fix non-const BUILD_BUG_ON usageinclude/linux/virtio_config.h+7 -60 replies
4/5rt2x00: Compiler warning unmasked by fix of BUILD_BUG_ONdrivers/net/wireless/rt2x00/rt2x00reg.h+2 -22 replies
4/5rt2x00: Compiler warning unmasked by fix of BUILD_BUG_ONdrivers/net/wireless/rt2x00/rt2x00reg.h+2 -25 replies
4/5rt2x00: Compiler warning unmasked by fix of BUILD_BUG_ONdrivers/net/wireless/rt2x00/rt2x00reg.h+2 -30 replies
5/5debug: BUILD_BUG_ON: error on non-const expressionsinclude/linux/compiler.h+4 -19 replies
5/5debug: BUILD_BUG_ON: error on non-const expressionsinclude/linux/compiler.h+6 -57 replies

Reviews trailers per patch

3 of 8 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchIvo van DoornIngo Molnar
SeriesA-b
2/5
3/5
3/5
4/5A-b A-b
4/5A-b A-b
4/5A-b A-b
5/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCHSET 0/5] BUILD_BUG_ON: error on none-const expressions

Submitted a patchset to fix BUILD_BUG_ON to no longer let through none compile-time constant expressions. This was debated a few times on LKML. The final solution is as proposed by Rusty Russell, which produces all expected results in my tests.
[see: http://www.spinics.net/lists/kernel/msg772904.html]

[PATCH 1/5] debug, x86: move BUILD_BUG_ON() ARRAY_SIZE and __FUNCTION__
Ingo this is your patch. Please verify?

[PATCH 2/5] net/niu: Fix none-const BUILD_BUG_ON usage [PATCH 3/5] virtio: Fix none-const BUILD_BUG_ON usage [PATCH 4/5] rt2x00: Compiler warning unmasked by fix of BUILD_BUG_ON
These three need maintainers approval. I hope I did not forget anyone

[PATCH 5/5] debug: BUILD_BUG_ON: error on none-const expressions
Finally after all call sites are fixed this can go in. (Rusty this one is From: you)

I have only compiled ARCH=x86 (64/32) allmodconfig. So this might break on other ARCHs. It should spend a night in Linux-Next to expose these places.

Thanks
Boaz