mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rustad, Mark D" <mark.d.rustad@intel.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: Oleg Nesterov <oleg@redhat.com>,
	Richard Weinberger <richard@nod.at>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"sparse@chrisli.org" <sparse@chrisli.org>,
	"linux-sparse@vger.kernel.org" <linux-sparse@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Brian Norris <computersforpeace@gmail.com>
Subject: Re: [PATCH 5/7] signal: Silence nested-externs warnings
Date: Fri, 19 Sep 2014 21:26:20 +0000	[thread overview]
Message-ID: <DCC876B0-D2AC-44F0-A774-D8DFA6F17905@intel.com> (raw)
In-Reply-To: <20140919212128.GP26432@jtriplet-mobl1>

[-- Attachment #1: Type: text/plain, Size: 2895 bytes --]

On Sep 19, 2014, at 2:21 PM, Josh Triplett <josh@joshtriplett.org> wrote:

> On Fri, Sep 19, 2014 at 07:20:30PM +0200, Oleg Nesterov wrote:
>> On 09/19, Richard Weinberger wrote:
>>> 
>>> Am 19.09.2014 17:37, schrieb Jeff Kirsher:
>>>> 
>>>> See patch 1 of the series.
>>> 
>>> I was not CC'ed...
>> 
>> Me too, and thus I don't understand this patch.
>> 
>> 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?  Also, the indentation on the second of the three BUILD_BUG
> calls has some spaces in it, which it shouldn't.  With those fixed:
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>

I haven't tried this patch myself yet, but assuming that it works, it is a far better way to go.

>> diff --git a/include/linux/signal.h b/include/linux/signal.h
>> index 750196f..679c9b4 100644
>> --- a/include/linux/signal.h
>> +++ b/include/linux/signal.h
>> @@ -67,7 +67,6 @@ static inline int sigismember(sigset_t *set, int _sig)
>> 
>> static inline int sigisemptyset(sigset_t *set)
>> {
>> -	extern void _NSIG_WORDS_is_unsupported_size(void);
>> 	switch (_NSIG_WORDS) {
>> 	case 4:
>> 		return (set->sig[3] | set->sig[2] |
>> @@ -77,7 +76,7 @@ static inline int sigisemptyset(sigset_t *set)
>> 	case 1:
>> 		return set->sig[0] == 0;
>> 	default:
>> -		_NSIG_WORDS_is_unsupported_size();
>> +		BUILD_BUG();
>> 		return 0;
>> 	}
>> }
>> @@ -90,7 +89,6 @@ static inline int sigisemptyset(sigset_t *set)
>> #define _SIG_SET_BINOP(name, op)					\
>> static inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \
>> {									\
>> -	extern void _NSIG_WORDS_is_unsupported_size(void);		\
>> 	unsigned long a0, a1, a2, a3, b0, b1, b2, b3;			\
>> 									\
>> 	switch (_NSIG_WORDS) {						\
>> @@ -107,7 +105,7 @@ static inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \
>> 		r->sig[0] = op(a0, b0);					\
>> 		break;							\
>> 	    default:							\
>> -		_NSIG_WORDS_is_unsupported_size();			\
>> +	    	BUILD_BUG();						\
>> 	}								\
>> }
>> 
>> @@ -128,8 +126,6 @@ _SIG_SET_BINOP(sigandnsets, _sig_andn)
>> #define _SIG_SET_OP(name, op)						\
>> static inline void name(sigset_t *set)					\
>> {									\
>> -	extern void _NSIG_WORDS_is_unsupported_size(void);		\
>> -									\
>> 	switch (_NSIG_WORDS) {						\
>> 	    case 4: set->sig[3] = op(set->sig[3]);			\
>> 		    set->sig[2] = op(set->sig[2]);			\
>> @@ -137,7 +133,7 @@ static inline void name(sigset_t *set)					\
>> 	    case 1: set->sig[0] = op(set->sig[0]);			\
>> 		    break;						\
>> 	    default:							\
>> -		_NSIG_WORDS_is_unsupported_size();			\
>> +		BUILD_BUG();						\
>> 	}								\
>> }

-- 
Mark Rustad, Networking Division, Intel Corporation


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

  reply	other threads:[~2014-09-19 21:26 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 15:29 [PATCH 0/7] Silence even more W=2 warnings Jeff Kirsher
2014-09-19 15:29 ` [PATCH 1/7] compiler: Add diagnostic control macros Jeff Kirsher
2014-09-19 15:29 ` [PATCH 2/7] x86: Silence initializer-overrides warnings Jeff Kirsher
2014-09-19 15:29 ` [PATCH 3/7] atomic: Silence nested-externs warnings Jeff Kirsher
2014-09-19 20:43   ` Peter Zijlstra
2014-09-19 20:53     ` Jeff Kirsher
2014-09-19 15:29 ` [PATCH 4/7] bitops: " Jeff Kirsher
2014-09-19 15:29 ` [PATCH 5/7] signal: " Jeff Kirsher
2014-09-19 15:35   ` Richard Weinberger
2014-09-19 15:37     ` Jeff Kirsher
2014-09-19 15:39       ` Richard Weinberger
2014-09-19 17:20         ` Oleg Nesterov
2014-09-19 21:21           ` Josh Triplett
2014-09-19 21:26             ` Rustad, Mark D [this message]
2014-09-21 16:42             ` [PATCH 0/1] signal: use BUILD_BUG() instead of _NSIG_WORDS_is_unsupported_size() Oleg Nesterov
2014-09-21 16:43               ` [PATCH 1/1] " Oleg Nesterov
2014-09-22 17:26                 ` Josh Triplett
2014-09-19 15:29 ` [PATCH 6/7] mm: Silence nested-externs warnings Jeff Kirsher
2014-09-19 15:29 ` [PATCH 7/7] sched: " Jeff Kirsher
2014-09-19 19:34   ` Richard Weinberger
2014-09-19 20:34     ` Rustad, Mark D
2014-09-19 20:41       ` Richard Weinberger
2014-09-19 20:49         ` Rustad, Mark D
2014-09-22 17:55     ` [PATCH] sched: Remove nested extern Mark D Rustad
2014-09-22 18:25       ` Josh Triplett
2014-09-22 19:01       ` Peter Zijlstra
2014-09-22 19:32         ` Rustad, Mark D
2014-09-22 20:05           ` Peter Zijlstra
2014-09-22 20:59             ` Rustad, Mark D
2014-09-22 21:21               ` Peter Zijlstra
2014-09-22 21:50                 ` Rustad, Mark D
2014-09-24  7:41                   ` Ingo Molnar
2014-09-24  7:52                     ` Peter Zijlstra
2014-09-24  7:58                       ` Ingo Molnar
2014-09-19 22:54   ` [PATCH 7/7] sched: Silence nested-externs warnings Peter Zijlstra
2014-09-19 23:26     ` Rustad, Mark D
2014-09-22 15:33 ` [PATCH 0/7] Silence even more W=2 warnings Borislav Petkov
2014-09-22 17:06   ` Rustad, Mark D
2014-09-22 18:40     ` Borislav Petkov
2014-09-22 18:59       ` Rustad, Mark D
2014-09-22 19:21         ` Borislav Petkov
2014-09-22 19:44           ` Jeff Kirsher
2014-09-22 19:57             ` Borislav Petkov
2014-09-22 20:09               ` Jeff Kirsher
2014-09-22 20:33                 ` Borislav Petkov
2014-09-22 21:21                   ` Jeff Kirsher
2014-09-23  8:01                     ` Borislav Petkov
2014-09-23 14:49                       ` Josh Triplett
2014-09-23 16:08                         ` Borislav Petkov
2014-09-23 16:29                         ` Rustad, Mark D
2014-09-25  7:45                     ` Geert Uytterhoeven
2014-09-25 16:44                       ` Borislav Petkov
2014-09-26 19:37                       ` Rustad, Mark D
2014-09-26 19:58                         ` josh
2014-09-26 21:07                           ` Rustad, Mark D
2014-09-22 21:50                   ` Rustad, Mark D
2014-09-23  8:22                     ` Borislav Petkov
2014-09-23 17:24                       ` Rustad, Mark D
2014-09-23 18:44                         ` Borislav Petkov
2014-09-23 19:04                           ` Joe Perches
2014-09-23 20:43                           ` Rustad, Mark D
2014-09-25  8:27                             ` Borislav Petkov
2014-09-25  0:17                           ` Rustad, Mark D

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DCC876B0-D2AC-44F0-A774-D8DFA6F17905@intel.com \
    --to=mark.d.rustad@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=computersforpeace@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=richard@nod.at \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®