From: Michal Nazarewicz <mina86@mina86.com>
To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Cc: Alexander Potapenko <glider@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>, Borislav Petkov <bp@suse.de>,
Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
Ian Abbott <abbotti@mev.co.uk>,
Jakub Kicinski <jakub.kicinski@netronome.com>,
Johannes Berg <johannes.berg@intel.com>,
Kees Cook <keescook@chromium.org>,
Peter Zijlstra <peterz@infradead.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v5 4/6] linux/bug.h: correct "space required before that '-'"
Date: Thu, 25 May 2017 16:01:21 +0200 [thread overview]
Message-ID: <xa1t7f15hw7i.fsf@mina86.com> (raw)
In-Reply-To: <20170525120316.24473-5-abbotti@mev.co.uk>
On Thu, May 25 2017, Ian Abbott wrote:
> Correct these checkpatch.pl errors:
>
> |ERROR: space required before that '-' (ctx:OxO)
> |#37: FILE: include/linux/bug.h:37:
> |+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
>
> |ERROR: space required before that '-' (ctx:OxO)
> |#38: FILE: include/linux/bug.h:38:
> |+#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
>
> I decided to wrap the bitfield expressions that begin with minus signs
> in parentheses rather than insert spaces before the minus signs.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
> ---
> v5: Actually, there was no v1 thru v4. I called this v5 to match the
> series.
> ---
> include/linux/bug.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/bug.h b/include/linux/bug.h
> index 216a1b79653d..483207cb99fb 100644
> --- a/include/linux/bug.h
> +++ b/include/linux/bug.h
> @@ -36,8 +36,8 @@ struct pt_regs;
> * e.g. in a structure initializer (or where-ever else comma expressions
> * aren't permitted).
> */
> -#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
> -#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
> +#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
> +#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:(-!!(e)); }))
>
> /*
> * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
--
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»
WARNING: multiple messages have this Message-ID (diff)
From: Michal Nazarewicz <mina86@mina86.com>
To: Ian Abbott <abbotti@mev.co.uk>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Cc: Alexander Potapenko <glider@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>, Borislav Petkov <bp@suse.de>,
Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
Jakub Kicinski <jakub.kicinski@netronome.com>,
Johannes Berg <johannes.berg@intel.com>,
Kees Cook <keescook@chromium.org>,
Peter Zijlstra <peterz@infradead.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v5 4/6] linux/bug.h: correct "space required before that '-'"
Date: Thu, 25 May 2017 16:01:21 +0200 [thread overview]
Message-ID: <xa1t7f15hw7i.fsf@mina86.com> (raw)
Message-ID: <20170525140121.YL7Y3QnX04PNawXahpjOUQJ4-gMA3G7OIZQA4-MaY4k@z> (raw)
In-Reply-To: <20170525120316.24473-5-abbotti@mev.co.uk>
On Thu, May 25 2017, Ian Abbott wrote:
> Correct these checkpatch.pl errors:
>
> |ERROR: space required before that '-' (ctx:OxO)
> |#37: FILE: include/linux/bug.h:37:
> |+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
>
> |ERROR: space required before that '-' (ctx:OxO)
> |#38: FILE: include/linux/bug.h:38:
> |+#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
>
> I decided to wrap the bitfield expressions that begin with minus signs
> in parentheses rather than insert spaces before the minus signs.
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
> ---
> v5: Actually, there was no v1 thru v4. I called this v5 to match the
> series.
> ---
> include/linux/bug.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/bug.h b/include/linux/bug.h
> index 216a1b79653d..483207cb99fb 100644
> --- a/include/linux/bug.h
> +++ b/include/linux/bug.h
> @@ -36,8 +36,8 @@ struct pt_regs;
> * e.g. in a structure initializer (or where-ever else comma expressions
> * aren't permitted).
> */
> -#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
> -#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
> +#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
> +#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:(-!!(e)); }))
>
> /*
> * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
--
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»
next prev parent reply other threads:[~2017-05-25 14:01 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-25 12:03 [PATCH v5 0/6] kernel.h: container_of() pointer checking Ian Abbott
2017-05-25 12:03 ` [PATCH v5 1/6] asm-generic/bug.h: declare struct pt_regs; before function prototype Ian Abbott
2017-05-25 12:03 ` Ian Abbott
2017-06-08 14:07 ` Steven Rostedt
2017-06-12 14:13 ` Ian Abbott
2017-06-12 14:15 ` Steven Rostedt
2017-06-12 14:15 ` Steven Rostedt
2017-05-25 12:03 ` [PATCH v5 2/6] linux/bug.h: correct formatting of block comment Ian Abbott
2017-05-25 13:58 ` Michal Nazarewicz
2017-05-25 13:58 ` Michal Nazarewicz
2017-05-25 12:03 ` [PATCH v5 3/6] linux/bug.h: correct "(foo*)" should be "(foo *)" Ian Abbott
2017-05-25 12:03 ` Ian Abbott
2017-05-25 13:59 ` Michal Nazarewicz
2017-05-25 13:59 ` Michal Nazarewicz
2017-05-25 12:03 ` [PATCH v5 4/6] linux/bug.h: correct "space required before that '-'" Ian Abbott
2017-05-25 14:01 ` Michal Nazarewicz [this message]
2017-05-25 14:01 ` Michal Nazarewicz
2017-05-25 14:02 ` Michal Nazarewicz
2017-05-25 14:02 ` Michal Nazarewicz
2017-05-25 12:03 ` [PATCH v5 5/6] bug: split BUILD_BUG stuff out into <linux/build_bug.h> Ian Abbott
2017-05-25 14:06 ` Michal Nazarewicz
2017-05-25 14:06 ` Michal Nazarewicz
2017-05-25 18:30 ` Kees Cook
2017-05-25 12:03 ` [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of() Ian Abbott
2017-05-25 12:03 ` Ian Abbott
2017-05-25 14:07 ` Michal Nazarewicz
2017-05-25 14:07 ` Michal Nazarewicz
2017-05-25 18:35 ` Kees Cook
2017-05-25 18:35 ` Kees Cook
2017-05-26 13:57 ` Ian Abbott
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=xa1t7f15hw7i.fsf@mina86.com \
--to=mina86@mina86.com \
--cc=abbotti@mev.co.uk \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bp@suse.de \
--cc=glider@google.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=jakub.kicinski@netronome.com \
--cc=johannes.berg@intel.com \
--cc=keescook@chromium.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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