[PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses

kbuild test robot
2017-05-14T18:48:19Z

Hi Maciej,

[auto build test ERROR on net-next/master]
[also build test ERROR on v4.12-rc1 next-20170512]
[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/Maciek-Fijalkowski/Fix-ERROR-trailing-statements-should-be-on-next-line/20170515-021304
config: x86_64-acpi-redef (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64

All error/warnings (new ones prefixed by >>):

   drivers//net/virtio_net.c:2647:20: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     (VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
                       ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2647:45: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     (VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
                                                ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2648:18: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_MAC, \
                     ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2649:24: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
                           ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2649:47: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
                                                  ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2649:71: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \

^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2650:23: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
                          ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2650:48: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
                                                   ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2650:73: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \

^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2651:24: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, \
                           ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2651:48: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, \
                                                   ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2652:24: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
                           ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2652:45: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
                                                ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2652:67: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \

^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2653:22: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
                         ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2653:46: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
                                                 ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2654:29: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
                                ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2654:46: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
                                                 ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
   drivers//net/virtio_net.c:2655:28: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
     VIRTIO_NET_F_CTRL_MAC_ADDR, \
                               ^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro
'VIRTNET_FEATURES'
     VIRTNET_FEATURES,
     ^~~~~~~~~~~~~~~~
>> drivers//net/virtio_net.c:2647:2: error: initializer element is not
constant
     (VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
     ^

vim +/VIRTNET_FEATURES +2659 drivers//net/virtio_net.c

296f96fc Rusty Russell      2007-10-22  2641  static struct virtio_device_id
id_table[] = {
296f96fc Rusty Russell      2007-10-22  2642  	{ VIRTIO_ID_NET,
VIRTIO_DEV_ANY_ID },
296f96fc Rusty Russell      2007-10-22  2643  	{ 0 },
296f96fc Rusty Russell      2007-10-22  2644  };
296f96fc Rusty Russell      2007-10-22  2645
f3358507 Michael S. Tsirkin 2016-11-04  2646  #define VIRTNET_FEATURES \
d66a5bc5 Maciej Fijalkowski 2017-05-14 @2647  	(VIRTIO_NET_F_CSUM,
VIRTIO_NET_F_GUEST_CSUM, \
f3358507 Michael S. Tsirkin 2016-11-04  2648  	VIRTIO_NET_F_MAC, \
f3358507 Michael S. Tsirkin 2016-11-04  2649  	VIRTIO_NET_F_HOST_TSO4,
VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
f3358507 Michael S. Tsirkin 2016-11-04  2650  	VIRTIO_NET_F_HOST_ECN,
VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
f3358507 Michael S. Tsirkin 2016-11-04  2651  	VIRTIO_NET_F_GUEST_ECN,
VIRTIO_NET_F_GUEST_UFO, \
f3358507 Michael S. Tsirkin 2016-11-04  2652  	VIRTIO_NET_F_MRG_RXBUF,
VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
f3358507 Michael S. Tsirkin 2016-11-04  2653  	VIRTIO_NET_F_CTRL_RX,
VIRTIO_NET_F_CTRL_VLAN, \
f3358507 Michael S. Tsirkin 2016-11-04  2654  	VIRTIO_NET_F_GUEST_ANNOUNCE,
VIRTIO_NET_F_MQ, \
f3358507 Michael S. Tsirkin 2016-11-04  2655  	VIRTIO_NET_F_CTRL_MAC_ADDR, \
d66a5bc5 Maciej Fijalkowski 2017-05-14  2656  	VIRTIO_NET_F_MTU)
f3358507 Michael S. Tsirkin 2016-11-04  2657
c45a6816 Rusty Russell      2008-05-02  2658  static unsigned int features[] = {
f3358507 Michael S. Tsirkin 2016-11-04 @2659  	VIRTNET_FEATURES,
f3358507 Michael S. Tsirkin 2016-11-04  2660  };
f3358507 Michael S. Tsirkin 2016-11-04  2661
f3358507 Michael S. Tsirkin 2016-11-04  2662  static unsigned int
features_legacy[] = {

:::::: The code at line 2659 was first introduced by commit
:::::: f3358507c11999c91abf54744658bccd49b5879c virtio-net: drop legacy features
in virtio 1 mode

:::::: TO: Michael S. Tsirkin <mst at redhat.com>
:::::: CC: David S. Miller <davem at davemloft.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 31444 bytes
Desc: not available
URL:
<http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20170515/ef278d00/attachment-0001.bin>