All of lore.kernel.org
 help / color / mirror / Atom feed
* [char-misc:char-misc-testing 33/62] drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: warning: operator has lower precedence than '|'; '|' will be evaluated first
@ 2021-01-28  5:42 kernel test robot
  2021-01-28  8:06 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-01-28  5:42 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing
head:   296c6264d4b19554dc8367e3f409bd248f504c2d
commit: 111d746bb4767ad476f80fe49067e3df3d9a9375 [33/62] misc: bcm-vk: add VK messaging support
config: s390-randconfig-r035-20210128 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 48bdd676a1d1338c10541460bf5beb69ac17e451)
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
        # install s390 cross compiling tool for clang build
        # apt-get install binutils-s390x-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/commit/?id=111d746bb4767ad476f80fe49067e3df3d9a9375
        git remote add char-misc https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
        git fetch --no-tags char-misc char-misc-testing
        git checkout 111d746bb4767ad476f80fe49067e3df3d9a9375
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 

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 >>):

   include/uapi/linux/swab.h:19:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0x000000ffUL) << 24) |            \
                     ^
   In file included from drivers/misc/bcm-vk/bcm_vk_msg.c:17:
   In file included from drivers/misc/bcm-vk/bcm_vk.h:14:
   In file included from include/linux/pci.h:39:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) |            \
                     ^
   In file included from drivers/misc/bcm-vk/bcm_vk_msg.c:17:
   In file included from drivers/misc/bcm-vk/bcm_vk.h:14:
   In file included from include/linux/pci.h:39:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) |            \
                     ^
   In file included from drivers/misc/bcm-vk/bcm_vk_msg.c:17:
   In file included from drivers/misc/bcm-vk/bcm_vk.h:14:
   In file included from include/linux/pci.h:39:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
           ___constant_swab32(x) :                 \
                              ^
   include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
           (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
                     ^
   In file included from drivers/misc/bcm-vk/bcm_vk_msg.c:17:
   In file included from drivers/misc/bcm-vk/bcm_vk.h:14:
   In file included from include/linux/pci.h:39:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
           __fswab32(x))
                     ^
   In file included from drivers/misc/bcm-vk/bcm_vk_msg.c:17:
   In file included from drivers/misc/bcm-vk/bcm_vk.h:14:
   In file included from include/linux/pci.h:39:
   In file included from include/linux/io.h:13:
   In file included from arch/s390/include/asm/io.h:80:
   include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
>> drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
                   (q_num >= VK_MSGQ_PER_CHAN_MAX) ? VK_MSGQ_NUM_DEFAULT : q_num;
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
   drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: note: place parentheses around the '|' expression to silence this warning
                   (q_num >= VK_MSGQ_PER_CHAN_MAX) ? VK_MSGQ_NUM_DEFAULT : q_num;
                                                   ^
                                                  )
   drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: note: place parentheses around the '?:' expression to evaluate it first
                   (q_num >= VK_MSGQ_PER_CHAN_MAX) ? VK_MSGQ_NUM_DEFAULT : q_num;
                                                   ^
                   (                                                            )
   21 warnings generated.


vim +56 drivers/misc/bcm-vk/bcm_vk_msg.c

    52	
    53	static void set_q_num(struct vk_msg_blk *msg, u32 q_num)
    54	{
    55		msg->trans_id = (msg->trans_id & ~BCM_VK_MSG_Q_MASK) |
  > 56			(q_num >= VK_MSGQ_PER_CHAN_MAX) ? VK_MSGQ_NUM_DEFAULT : q_num;
    57	}
    58	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 24334 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [char-misc:char-misc-testing 33/62] drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: warning: operator has lower precedence than '|'; '|' will be evaluated first
  2021-01-28  5:42 [char-misc:char-misc-testing 33/62] drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: warning: operator has lower precedence than '|'; '|' will be evaluated first kernel test robot
@ 2021-01-28  8:06 ` Greg Kroah-Hartman
  2021-01-29  0:35   ` Scott Branden
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-01-28  8:06 UTC (permalink / raw)
  To: kbuild-all

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

On Thu, Jan 28, 2021 at 01:42:55PM +0800, kernel test robot wrote:
> vim +56 drivers/misc/bcm-vk/bcm_vk_msg.c
> 
>     52	
>     53	static void set_q_num(struct vk_msg_blk *msg, u32 q_num)
>     54	{
>     55		msg->trans_id = (msg->trans_id & ~BCM_VK_MSG_Q_MASK) |
>   > 56			(q_num >= VK_MSGQ_PER_CHAN_MAX) ? VK_MSGQ_NUM_DEFAULT : q_num;

That is a pretty horrible chunk of code, Scott, can you make this a
"real" if statement please so that we can read it?  :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [char-misc:char-misc-testing 33/62] drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: warning: operator has lower precedence than '|'; '|' will be evaluated first
  2021-01-28  8:06 ` Greg Kroah-Hartman
@ 2021-01-29  0:35   ` Scott Branden
  2021-01-29  6:07     ` Scott Branden
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Branden @ 2021-01-29  0:35 UTC (permalink / raw)
  To: kbuild-all

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



On 2021-01-28 12:06 a.m., Greg Kroah-Hartman wrote:
> On Thu, Jan 28, 2021 at 01:42:55PM +0800, kernel test robot wrote:
>> vim +56 drivers/misc/bcm-vk/bcm_vk_msg.c
>>
>>     52	
>>     53	static void set_q_num(struct vk_msg_blk *msg, u32 q_num)
>>     54	{
>>     55		msg->trans_id = (msg->trans_id & ~BCM_VK_MSG_Q_MASK) |
>>   > 56			(q_num >= VK_MSGQ_PER_CHAN_MAX) ? VK_MSGQ_NUM_DEFAULT : q_num;
> That is a pretty horrible chunk of code, Scott, can you make this a
> "real" if statement please so that we can read it?  :)
Changed to readable if statement and v10 patch series sent out.
Also fixed compile option if CONFIG_TTY is not set in series.
>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [char-misc:char-misc-testing 33/62] drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: warning: operator has lower precedence than '|'; '|' will be evaluated first
  2021-01-29  0:35   ` Scott Branden
@ 2021-01-29  6:07     ` Scott Branden
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Branden @ 2021-01-29  6:07 UTC (permalink / raw)
  To: kbuild-all

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

Hi Greg,

On 2021-01-28 4:35 p.m., Scott Branden wrote:
>
> On 2021-01-28 12:06 a.m., Greg Kroah-Hartman wrote:
>> On Thu, Jan 28, 2021 at 01:42:55PM +0800, kernel test robot wrote:
>>> vim +56 drivers/misc/bcm-vk/bcm_vk_msg.c
>>>
>>>     52	
>>>     53	static void set_q_num(struct vk_msg_blk *msg, u32 q_num)
>>>     54	{
>>>     55		msg->trans_id = (msg->trans_id & ~BCM_VK_MSG_Q_MASK) |
>>>   > 56			(q_num >= VK_MSGQ_PER_CHAN_MAX) ? VK_MSGQ_NUM_DEFAULT : q_num;
>> That is a pretty horrible chunk of code, Scott, can you make this a
>> "real" if statement please so that we can read it?  :)
> Changed to readable if statement and v10 patch series sent out.
> Also fixed compile option if CONFIG_TTY is not set in series.
Apologies for sending out a full v10 of the patches with the corrections.
Sent out individual patches that can be applied to linux-next to correct these issues.
>> thanks,
>>
>> greg k-h
Thanks,
 Scott

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-29  6:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-28  5:42 [char-misc:char-misc-testing 33/62] drivers/misc/bcm-vk/bcm_vk_msg.c:56:35: warning: operator has lower precedence than '|'; '|' will be evaluated first kernel test robot
2021-01-28  8:06 ` Greg Kroah-Hartman
2021-01-29  0:35   ` Scott Branden
2021-01-29  6:07     ` Scott Branden

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.