Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650532

Re: [PATCH v5 4/6] linux/bug.h: correct "space required before that '-'"

From Michal Nazarewicz <mina86@mina86.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 4/6] linux/bug.h: correct "space required before that '-'"
Date 2017-05-25 16:10 +0200
Message-ID <tL1CF-La-7@gated-at.bofh.it> (permalink)
References <tKZKx-81K-3@gated-at.bofh.it> <tKZKx-81K-5@gated-at.bofh.it>
Organization http://mina86.com/

Show all headers | View raw


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»

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/6] kernel.h: container_of() pointer checking Ian Abbott <abbotti@mev.co.uk> - 2017-05-25 14:10 +0200
  [PATCH v5 4/6] linux/bug.h: correct "space required before that '-'" Ian Abbott <abbotti@mev.co.uk> - 2017-05-25 14:10 +0200
    Re: [PATCH v5 4/6] linux/bug.h: correct "space required before that '-'" Michal Nazarewicz <mina86@mina86.com> - 2017-05-25 16:10 +0200
    Re: [PATCH v5 4/6] linux/bug.h: correct "space required before that '-'" Michal Nazarewicz <mina86@mina86.com> - 2017-05-25 16:10 +0200
  [PATCH v5 1/6] asm-generic/bug.h: declare struct pt_regs; before function prototype Ian Abbott <abbotti@mev.co.uk> - 2017-05-25 14:10 +0200
  [PATCH v5 2/6] linux/bug.h: correct formatting of block comment Ian Abbott <abbotti@mev.co.uk> - 2017-05-25 14:10 +0200
    Re: [PATCH v5 2/6] linux/bug.h: correct formatting of block comment Michal Nazarewicz <mina86@mina86.com> - 2017-05-25 16:00 +0200
  [PATCH v5 3/6] linux/bug.h: correct "(foo*)" should be "(foo *)" Ian Abbott <abbotti@mev.co.uk> - 2017-05-25 14:10 +0200
    Re: [PATCH v5 3/6] linux/bug.h: correct "(foo*)" should be "(foo *)" Michal Nazarewicz <mina86@mina86.com> - 2017-05-25 16:00 +0200
  [PATCH v5 5/6] bug: split BUILD_BUG stuff out into <linux/build_bug.h> Ian Abbott <abbotti@mev.co.uk> - 2017-05-25 14:10 +0200
    Re: [PATCH v5 5/6] bug: split BUILD_BUG stuff out into <linux/build_bug.h> Michal Nazarewicz <mina86@mina86.com> - 2017-05-25 16:10 +0200
    Re: [PATCH v5 5/6] bug: split BUILD_BUG stuff out into <linux/build_bug.h> Kees Cook <keescook@chromium.org> - 2017-05-25 20:40 +0200
  [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of() Ian Abbott <abbotti@mev.co.uk> - 2017-05-25 14:10 +0200
    Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of() Michal Nazarewicz <mina86@mina86.com> - 2017-05-25 16:10 +0200
    Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of() Kees Cook <keescook@chromium.org> - 2017-05-25 20:40 +0200
      Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in  container_of() Ian Abbott <abbotti@mev.co.uk> - 2017-05-26 16:00 +0200

csiph-web