All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [mark:treewide/gnu99 1/1] net/netfilter/xt_hashlimit.c:608:40: warning: left shift of negative value
Date: Thu, 13 Jan 2022 06:59:14 +0800	[thread overview]
Message-ID: <202201130653.9pXG19yX-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git treewide/gnu99
head:   df0f3c59f076be0ab4a6d8de53fdeef871394594
commit: df0f3c59f076be0ab4a6d8de53fdeef871394594 [1/1] treewide: use -std=gnu99
config: m68k-defconfig (https://download.01.org/0day-ci/archive/20220113/202201130653.9pXG19yX-lkp(a)intel.com/config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?id=df0f3c59f076be0ab4a6d8de53fdeef871394594
        git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
        git fetch --no-tags mark treewide/gnu99
        git checkout df0f3c59f076be0ab4a6d8de53fdeef871394594
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/block/drbd/ net/netfilter/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/m68k/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:7,
                    from arch/m68k/include/asm/bitops.h:529,
                    from include/linux/bitops.h:33,
                    from include/linux/thread_info.h:27,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/m68k/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from arch/m68k/include/asm/irqflags.h:6,
                    from include/linux/irqflags.h:16,
                    from arch/m68k/include/asm/atomic.h:6,
                    from include/linux/atomic.h:7,
                    from include/linux/mm_types_task.h:13,
                    from include/linux/mm_types.h:5,
                    from include/linux/buildid.h:5,
                    from include/linux/module.h:14,
                    from net/netfilter/xt_hashlimit.c:13:
   net/netfilter/xt_hashlimit.c: In function 'maskl':
>> net/netfilter/xt_hashlimit.c:608:40: warning: left shift of negative value [-Wshift-negative-value]
     608 |         return l ? htonl(ntohl(a) & ~0 << (32 - l)) : 0;
         |                                        ^~
   include/uapi/linux/byteorder/big_endian.h:40:51: note: in definition of macro '__cpu_to_be32'
      40 | #define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
         |                                                   ^
   include/linux/byteorder/generic.h:139:18: note: in expansion of macro '___htonl'
     139 | #define htonl(x) ___htonl(x)
         |                  ^~~~~~~~
   net/netfilter/xt_hashlimit.c:608:20: note: in expansion of macro 'htonl'
     608 |         return l ? htonl(ntohl@ & ~0 << (32 - l)) : 0;
         |                    ^~~~~
--
   drivers/block/drbd/drbd_main.c: In function 'dcbp_set_pad_bits':
>> drivers/block/drbd/drbd_main.c:1095:44: warning: left shift of negative value [-Wshift-negative-value]
    1095 |         p->encoding = (p->encoding & (~0x7 << 4)) | (n << 4);
         |                                            ^~


vim +608 net/netfilter/xt_hashlimit.c

817e076f61bca3 Florian Westphal 2012-05-07  605  
09e410def64324 Jan Engelhardt   2008-01-31  606  static inline __be32 maskl(__be32 a, unsigned int l)
09e410def64324 Jan Engelhardt   2008-01-31  607  {
1b9b70ea2ebaab Patrick McHardy  2008-04-09 @608  	return l ? htonl(ntohl(a) & ~0 << (32 - l)) : 0;
09e410def64324 Jan Engelhardt   2008-01-31  609  }
09e410def64324 Jan Engelhardt   2008-01-31  610  

:::::: The code@line 608 was first introduced by commit
:::::: 1b9b70ea2ebaab26c3e4fed385dfab6fc16359ed [NETFILTER]: xt_hashlimit: fix mask calculation

:::::: TO: Patrick McHardy <kaber@trash.net>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [mark:treewide/gnu99 1/1] net/netfilter/xt_hashlimit.c:608:40: warning: left shift of negative value
Date: Thu, 13 Jan 2022 06:59:14 +0800	[thread overview]
Message-ID: <202201130653.9pXG19yX-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git treewide/gnu99
head:   df0f3c59f076be0ab4a6d8de53fdeef871394594
commit: df0f3c59f076be0ab4a6d8de53fdeef871394594 [1/1] treewide: use -std=gnu99
config: m68k-defconfig (https://download.01.org/0day-ci/archive/20220113/202201130653.9pXG19yX-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?id=df0f3c59f076be0ab4a6d8de53fdeef871394594
        git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
        git fetch --no-tags mark treewide/gnu99
        git checkout df0f3c59f076be0ab4a6d8de53fdeef871394594
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/block/drbd/ net/netfilter/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/byteorder/big_endian.h:5,
                    from arch/m68k/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:7,
                    from arch/m68k/include/asm/bitops.h:529,
                    from include/linux/bitops.h:33,
                    from include/linux/thread_info.h:27,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/m68k/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from arch/m68k/include/asm/irqflags.h:6,
                    from include/linux/irqflags.h:16,
                    from arch/m68k/include/asm/atomic.h:6,
                    from include/linux/atomic.h:7,
                    from include/linux/mm_types_task.h:13,
                    from include/linux/mm_types.h:5,
                    from include/linux/buildid.h:5,
                    from include/linux/module.h:14,
                    from net/netfilter/xt_hashlimit.c:13:
   net/netfilter/xt_hashlimit.c: In function 'maskl':
>> net/netfilter/xt_hashlimit.c:608:40: warning: left shift of negative value [-Wshift-negative-value]
     608 |         return l ? htonl(ntohl(a) & ~0 << (32 - l)) : 0;
         |                                        ^~
   include/uapi/linux/byteorder/big_endian.h:40:51: note: in definition of macro '__cpu_to_be32'
      40 | #define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
         |                                                   ^
   include/linux/byteorder/generic.h:139:18: note: in expansion of macro '___htonl'
     139 | #define htonl(x) ___htonl(x)
         |                  ^~~~~~~~
   net/netfilter/xt_hashlimit.c:608:20: note: in expansion of macro 'htonl'
     608 |         return l ? htonl(ntohl(a) & ~0 << (32 - l)) : 0;
         |                    ^~~~~
--
   drivers/block/drbd/drbd_main.c: In function 'dcbp_set_pad_bits':
>> drivers/block/drbd/drbd_main.c:1095:44: warning: left shift of negative value [-Wshift-negative-value]
    1095 |         p->encoding = (p->encoding & (~0x7 << 4)) | (n << 4);
         |                                            ^~


vim +608 net/netfilter/xt_hashlimit.c

817e076f61bca3 Florian Westphal 2012-05-07  605  
09e410def64324 Jan Engelhardt   2008-01-31  606  static inline __be32 maskl(__be32 a, unsigned int l)
09e410def64324 Jan Engelhardt   2008-01-31  607  {
1b9b70ea2ebaab Patrick McHardy  2008-04-09 @608  	return l ? htonl(ntohl(a) & ~0 << (32 - l)) : 0;
09e410def64324 Jan Engelhardt   2008-01-31  609  }
09e410def64324 Jan Engelhardt   2008-01-31  610  

:::::: The code at line 608 was first introduced by commit
:::::: 1b9b70ea2ebaab26c3e4fed385dfab6fc16359ed [NETFILTER]: xt_hashlimit: fix mask calculation

:::::: TO: Patrick McHardy <kaber@trash.net>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

             reply	other threads:[~2022-01-12 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 22:59 kernel test robot [this message]
2022-01-12 22:59 ` [mark:treewide/gnu99 1/1] net/netfilter/xt_hashlimit.c:608:40: warning: left shift of negative value kernel test robot

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=202201130653.9pXG19yX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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 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.