All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, Andrew Morton <akpm@linux-foundation.org>,
	David Howells <dhowells@redhat.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 5/5] linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly
Date: Mon, 26 Feb 2018 11:13:00 +0900	[thread overview]
Message-ID: <CAK7LNAQMEM5uVzHd78wPN1EdKp+k6UbA8-J=xo+_VZ1uhwy-LQ@mail.gmail.com> (raw)
In-Reply-To: <201802241211.z062884N%fengguang.wu@intel.com>

Hi test robot,


2018-02-24 14:00 GMT+09:00 kbuild test robot <lkp@intel.com>:
> Hi Masahiro,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on linus/master]
> [also build test WARNING on v4.16-rc2 next-20180223]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Masahiro-Yamada/linux-const-h-cleanups-of-macros-such-as-UL-_BITUL-BIT-etc/20180224-110702
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386


I think this is a false positive report
because I see the same warning in the mainline.


The cause of the problem is
  #define BNXT_RE_MAX_MR_SIZE_HIGH    BIT(39)
in drivers/infiniband/hw/bnxt_re/bnxt_re.h


This causes -Wshift-count-overflow warning
if you compile test it on 32 bit arches.


I did not change the BIT() definition,
so this is not my fault.



> All warnings (new ones prefixed by >>):
>
>    In file included from include/linux/const.h:4:0,
>                     from include/linux/bitops.h:4,
>                     from include/linux/kernel.h:11,
>                     from include/linux/interrupt.h:6,
>                     from drivers/infiniband/hw/bnxt_re/ib_verbs.c:39:
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c: In function 'bnxt_re_query_device':
>>> include/uapi/linux/const.h:28:27: warning: left shift count >= width of type [-Wshift-count-overflow]
>     #define _BITUL(x) (_UL(1) << (x))
>                               ^
>>> include/linux/const.h:9:18: note: in expansion of macro '_BITUL'
>     #define BIT(x)  (_BITUL(x))
>                      ^~~~~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:61:34: note: in expansion of macro 'BIT'
>     #define BNXT_RE_MAX_MR_SIZE_HIGH BIT(39)
>                                      ^~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:62:30: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE_HIGH'
>     #define BNXT_RE_MAX_MR_SIZE  BNXT_RE_MAX_MR_SIZE_HIGH
>                                  ^~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c:149:25: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE'
>      ib_attr->max_mr_size = BNXT_RE_MAX_MR_SIZE;
>                             ^~~~~~~~~~~~~~~~~~~
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c: In function 'bnxt_re_reg_user_mr':
>>> include/uapi/linux/const.h:28:27: warning: left shift count >= width of type [-Wshift-count-overflow]
>     #define _BITUL(x) (_UL(1) << (x))
>                               ^
>>> include/linux/const.h:9:18: note: in expansion of macro '_BITUL'
>     #define BIT(x)  (_BITUL(x))
>                      ^~~~~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:61:34: note: in expansion of macro 'BIT'
>     #define BNXT_RE_MAX_MR_SIZE_HIGH BIT(39)
>                                      ^~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:62:30: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE_HIGH'
>     #define BNXT_RE_MAX_MR_SIZE  BNXT_RE_MAX_MR_SIZE_HIGH
>                                  ^~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c:3588:15: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE'
>      if (length > BNXT_RE_MAX_MR_SIZE) {
>                   ^~~~~~~~~~~~~~~~~~~
>>> include/uapi/linux/const.h:28:27: warning: left shift count >= width of type [-Wshift-count-overflow]
>     #define _BITUL(x) (_UL(1) << (x))
>                               ^
>>> include/linux/const.h:9:18: note: in expansion of macro '_BITUL'
>     #define BIT(x)  (_BITUL(x))
>                      ^~~~~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:61:34: note: in expansion of macro 'BIT'
>     #define BNXT_RE_MAX_MR_SIZE_HIGH BIT(39)
>                                      ^~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:62:30: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE_HIGH'
>     #define BNXT_RE_MAX_MR_SIZE  BNXT_RE_MAX_MR_SIZE_HIGH
>                                  ^~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c:3590:12: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE'
>        length, BNXT_RE_MAX_MR_SIZE);
>                ^~~~~~~~~~~~~~~~~~~
>
> vim +28 include/uapi/linux/const.h
>
> 5289f87f3 Masahiro Yamada 2018-02-22  27
> 4fac4e1b2 Masahiro Yamada 2018-02-22 @28  #define _BITUL(x)     (_UL(1) << (x))
> 4fac4e1b2 Masahiro Yamada 2018-02-22  29  #define _BITULL(x)    (_ULL(1) << (x))
> 2fc016c5b H. Peter Anvin  2013-04-27  30
>
> :::::: The code at line 28 was first introduced by commit
> :::::: 4fac4e1b26bc6cfec630fb48920c391d99a44940 linux/const.h: refactor _BITUL and _BITULL a bit
>
> :::::: TO: Masahiro Yamada <yamada.masahiro@socionext.com>
> :::::: CC: 0day robot <fengguang.wu@intel.com>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



-- 
Best Regards
Masahiro Yamada

WARNING: multiple messages have this Message-ID (diff)
From: yamada.masahiro@socionext.com (Masahiro Yamada)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 5/5] linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly
Date: Mon, 26 Feb 2018 11:13:00 +0900	[thread overview]
Message-ID: <CAK7LNAQMEM5uVzHd78wPN1EdKp+k6UbA8-J=xo+_VZ1uhwy-LQ@mail.gmail.com> (raw)
In-Reply-To: <201802241211.z062884N%fengguang.wu@intel.com>

Hi test robot,


2018-02-24 14:00 GMT+09:00 kbuild test robot <lkp@intel.com>:
> Hi Masahiro,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on linus/master]
> [also build test WARNING on v4.16-rc2 next-20180223]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Masahiro-Yamada/linux-const-h-cleanups-of-macros-such-as-UL-_BITUL-BIT-etc/20180224-110702
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386


I think this is a false positive report
because I see the same warning in the mainline.


The cause of the problem is
  #define BNXT_RE_MAX_MR_SIZE_HIGH    BIT(39)
in drivers/infiniband/hw/bnxt_re/bnxt_re.h


This causes -Wshift-count-overflow warning
if you compile test it on 32 bit arches.


I did not change the BIT() definition,
so this is not my fault.



> All warnings (new ones prefixed by >>):
>
>    In file included from include/linux/const.h:4:0,
>                     from include/linux/bitops.h:4,
>                     from include/linux/kernel.h:11,
>                     from include/linux/interrupt.h:6,
>                     from drivers/infiniband/hw/bnxt_re/ib_verbs.c:39:
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c: In function 'bnxt_re_query_device':
>>> include/uapi/linux/const.h:28:27: warning: left shift count >= width of type [-Wshift-count-overflow]
>     #define _BITUL(x) (_UL(1) << (x))
>                               ^
>>> include/linux/const.h:9:18: note: in expansion of macro '_BITUL'
>     #define BIT(x)  (_BITUL(x))
>                      ^~~~~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:61:34: note: in expansion of macro 'BIT'
>     #define BNXT_RE_MAX_MR_SIZE_HIGH BIT(39)
>                                      ^~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:62:30: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE_HIGH'
>     #define BNXT_RE_MAX_MR_SIZE  BNXT_RE_MAX_MR_SIZE_HIGH
>                                  ^~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c:149:25: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE'
>      ib_attr->max_mr_size = BNXT_RE_MAX_MR_SIZE;
>                             ^~~~~~~~~~~~~~~~~~~
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c: In function 'bnxt_re_reg_user_mr':
>>> include/uapi/linux/const.h:28:27: warning: left shift count >= width of type [-Wshift-count-overflow]
>     #define _BITUL(x) (_UL(1) << (x))
>                               ^
>>> include/linux/const.h:9:18: note: in expansion of macro '_BITUL'
>     #define BIT(x)  (_BITUL(x))
>                      ^~~~~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:61:34: note: in expansion of macro 'BIT'
>     #define BNXT_RE_MAX_MR_SIZE_HIGH BIT(39)
>                                      ^~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:62:30: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE_HIGH'
>     #define BNXT_RE_MAX_MR_SIZE  BNXT_RE_MAX_MR_SIZE_HIGH
>                                  ^~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c:3588:15: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE'
>      if (length > BNXT_RE_MAX_MR_SIZE) {
>                   ^~~~~~~~~~~~~~~~~~~
>>> include/uapi/linux/const.h:28:27: warning: left shift count >= width of type [-Wshift-count-overflow]
>     #define _BITUL(x) (_UL(1) << (x))
>                               ^
>>> include/linux/const.h:9:18: note: in expansion of macro '_BITUL'
>     #define BIT(x)  (_BITUL(x))
>                      ^~~~~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:61:34: note: in expansion of macro 'BIT'
>     #define BNXT_RE_MAX_MR_SIZE_HIGH BIT(39)
>                                      ^~~
>    drivers/infiniband/hw/bnxt_re/bnxt_re.h:62:30: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE_HIGH'
>     #define BNXT_RE_MAX_MR_SIZE  BNXT_RE_MAX_MR_SIZE_HIGH
>                                  ^~~~~~~~~~~~~~~~~~~~~~~~
>    drivers/infiniband/hw/bnxt_re/ib_verbs.c:3590:12: note: in expansion of macro 'BNXT_RE_MAX_MR_SIZE'
>        length, BNXT_RE_MAX_MR_SIZE);
>                ^~~~~~~~~~~~~~~~~~~
>
> vim +28 include/uapi/linux/const.h
>
> 5289f87f3 Masahiro Yamada 2018-02-22  27
> 4fac4e1b2 Masahiro Yamada 2018-02-22 @28  #define _BITUL(x)     (_UL(1) << (x))
> 4fac4e1b2 Masahiro Yamada 2018-02-22  29  #define _BITULL(x)    (_ULL(1) << (x))
> 2fc016c5b H. Peter Anvin  2013-04-27  30
>
> :::::: The code at line 28 was first introduced by commit
> :::::: 4fac4e1b26bc6cfec630fb48920c391d99a44940 linux/const.h: refactor _BITUL and _BITULL a bit
>
> :::::: TO: Masahiro Yamada <yamada.masahiro@socionext.com>
> :::::: CC: 0day robot <fengguang.wu@intel.com>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2018-02-26  2:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 12:15 [PATCH v3 0/5] linux/const.h: cleanups of macros such as UL(), _BITUL(), BIT() etc Masahiro Yamada
2018-02-22 12:15 ` Masahiro Yamada
2018-02-22 12:15 ` [PATCH v3 1/5] linux/const.h: prefix include guard of uapi/linux/const.h with _UAPI Masahiro Yamada
2018-02-22 12:15   ` Masahiro Yamada
2018-02-22 12:15 ` [PATCH v3 2/5] m68k: rename UL() to TO_UL() Masahiro Yamada
2018-02-22 12:15   ` Masahiro Yamada
2018-02-22 13:20   ` Geert Uytterhoeven
2018-02-22 13:20     ` Geert Uytterhoeven
2018-02-22 16:58     ` Masahiro Yamada
2018-02-22 16:58       ` Masahiro Yamada
2018-02-26  9:49       ` Geert Uytterhoeven
2018-02-26  9:49         ` Geert Uytterhoeven
2018-02-22 12:15 ` [PATCH v3 3/5] linux/const.h: move UL() macro to include/linux/const.h Masahiro Yamada
2018-02-22 12:15   ` Masahiro Yamada
2018-02-22 12:15 ` [PATCH v3 4/5] linux/const.h: refactor _BITUL and _BITULL a bit Masahiro Yamada
2018-02-22 12:15   ` Masahiro Yamada
2018-02-22 12:15 ` [PATCH v3 5/5] linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly Masahiro Yamada
2018-02-22 12:15   ` Masahiro Yamada
2018-02-24  5:00   ` kbuild test robot
2018-02-24  5:00     ` kbuild test robot
2018-02-26  2:13     ` Masahiro Yamada [this message]
2018-02-26  2:13       ` Masahiro Yamada
2018-03-13  8:39   ` Masahiro Yamada
2018-03-13  8:39     ` Masahiro Yamada

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='CAK7LNAQMEM5uVzHd78wPN1EdKp+k6UbA8-J=xo+_VZ1uhwy-LQ@mail.gmail.com' \
    --to=yamada.masahiro@socionext.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=kbuild-all@01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.