Skip to content

signal: use BUILD_BUG() instead of _NSIG_WORDS_is_unsupported_size()

Oleg Nesterov linux-mm linux-sparse lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1signal: use BUILD_BUG() instead of _NSIG_WORDS_is_unsupported_size()include/linux/signal.h+12 -161 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchJosh Triplett
1/1R-b

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

Read the v1 thread

Cover letter [PATCH 0/1] signal: use BUILD_BUG() instead of _NSIG_WORDS_is_unsupported_size()
Quoted 8 lines · Josh Triplett
Quoted 2 lines · Oleg Nesterov

But I have to admit it looks a bit ugly to me anyway. Can't we simply kill _NSIG_WORDS_is_unsupported_size ?

This looks quite preferable. Can you post that with a commit message and signoff?

OK, please see 1/1.

Quoted 2 lines

Also, the indentation on the second of the three BUILD_BUG calls has some spaces in it, which it shouldn't.

Yes, thanks, and it makes sense to also fix the indentation.

Quoted 2 lines

With those fixed:

Thanks. Could you ack it again?

I didn't preserve your ack because it seems that BUILD_BUG() and/or BUILD_BUG_ON_MSG() deserve some cleanups... For example,

	if (0)
		BUILD_BUG();

can't be compiled if __compiletime_error_fallback() falls back to a negative-size array (see the changelog).

But I think that the code above must be correct by definition, see the comment and the original changelog (1399ff86f2a2 "kernel.h: add BUILD_BUG() macro"). So if this patch breaks the compilation with some compiler/version we should update include/linux/compiler-xxx.h or fix BUILD_BUG().

Oleg.

 include/linux/signal.h |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)