Maciek Fijalkowski
2017-May-14 17:51 UTC
[PATCH 1/3] Fix ERROR: trailing statements should be on next line
From: Maciej Fijalkowski <macfij7 at wp.pl> Signed-off-by: Maciej Fijalkowski <macfij7 at wp.pl> --- drivers/net/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 9320d96..f20dfb8 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -217,7 +217,8 @@ static void give_pages(struct receive_queue *rq, struct page *page) struct page *end; /* Find end of list, sew whole thing into vi->rq.pages. */ - for (end = page; end->private; end = (struct page *)end->private); + for (end = page; end->private; end = (struct page *)end->private) + ; end->private = (unsigned long)rq->pages; rq->pages = page; } -- 2.4.11
Maciek Fijalkowski
2017-May-14 17:51 UTC
[PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
From: Maciej Fijalkowski <macfij7 at wp.pl> Signed-off-by: Maciej Fijalkowski <macfij7 at wp.pl> --- drivers/net/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index f20dfb8..6c8170c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2663,7 +2663,7 @@ static struct virtio_device_id id_table[] = { }; #define VIRTNET_FEATURES \ - VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \ + (VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \ VIRTIO_NET_F_MAC, \ VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \ VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \ @@ -2672,7 +2672,7 @@ static struct virtio_device_id id_table[] = { VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \ VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \ VIRTIO_NET_F_CTRL_MAC_ADDR, \ - VIRTIO_NET_F_MTU + VIRTIO_NET_F_MTU) static unsigned int features[] = { VIRTNET_FEATURES, -- 2.4.11
Maciek Fijalkowski
2017-May-14 17:51 UTC
[PATCH 3/3] Fix ERROR: code indent should use tabs where possible
From: Maciej Fijalkowski <macfij7 at wp.pl> Signed-off-by: Maciej Fijalkowski <macfij7 at wp.pl> --- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 6c8170c..5d71e9f 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2717,7 +2717,7 @@ static __init int virtio_net_driver_init(void) if (ret) goto err_dead; - ret = register_virtio_driver(&virtio_net_driver); + ret = register_virtio_driver(&virtio_net_driver); if (ret) goto err_virtio; return 0; -- 2.4.11
kbuild test robot
2017-May-14 18:48 UTC
[PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
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>
Andrew Lunn
2017-May-15 00:25 UTC
[PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
On Sun, May 14, 2017 at 07:51:29PM +0200, Maciek Fijalkowski wrote:> From: Maciej Fijalkowski <macfij7 at wp.pl>Hi Maciek Please include some commit message, even if it is just the checkpatch error you are fixing. Please include the subsystem/driver you are patch in the subject line. Also, your subject of Fix ERROR: makes it sound a lot worse than it is. net: virtio: Fix checkpatch error Complex macros should use () Also, you should at least compile test your change. It is clearly wrong, as shown by 0-day. Andrew
Michael S. Tsirkin
2017-May-15 02:56 UTC
[PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
On Sun, May 14, 2017 at 07:51:29PM +0200, Maciek Fijalkowski wrote:> From: Maciej Fijalkowski <macfij7 at wp.pl> > > Signed-off-by: Maciej Fijalkowski <macfij7 at wp.pl>This is not a complex value.> --- > drivers/net/virtio_net.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index f20dfb8..6c8170c 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -2663,7 +2663,7 @@ static struct virtio_device_id id_table[] = { > }; > > #define VIRTNET_FEATURES \ > - VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \ > + (VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \ > VIRTIO_NET_F_MAC, \ > VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \ > VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \ > @@ -2672,7 +2672,7 @@ static struct virtio_device_id id_table[] = { > VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \ > VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \ > VIRTIO_NET_F_CTRL_MAC_ADDR, \ > - VIRTIO_NET_F_MTU > + VIRTIO_NET_F_MTU) > > static unsigned int features[] = { > VIRTNET_FEATURES, > -- > 2.4.11
Michael S. Tsirkin
2017-May-15 02:58 UTC
[PATCH 1/3] Fix ERROR: trailing statements should be on next line
On Sun, May 14, 2017 at 07:51:28PM +0200, Maciek Fijalkowski wrote:> From: Maciej Fijalkowski <macfij7 at wp.pl> > > Signed-off-by: Maciej Fijalkowski <macfij7 at wp.pl>I prefer the original form - ; isn't a full statement.> --- > drivers/net/virtio_net.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 9320d96..f20dfb8 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -217,7 +217,8 @@ static void give_pages(struct receive_queue *rq, struct page *page) > struct page *end; > > /* Find end of list, sew whole thing into vi->rq.pages. */ > - for (end = page; end->private; end = (struct page *)end->private); > + for (end = page; end->private; end = (struct page *)end->private) > + ; > end->private = (unsigned long)rq->pages; > rq->pages = page; > } > -- > 2.4.11
Michael S. Tsirkin
2017-May-15 03:00 UTC
[PATCH 3/3] Fix ERROR: code indent should use tabs where possible
On Sun, May 14, 2017 at 07:51:30PM +0200, Maciek Fijalkowski wrote:> From: Maciej Fijalkowski <macfij7 at wp.pl> > > Signed-off-by: Maciej Fijalkowski <macfij7 at wp.pl>Acked-by: Michael S. Tsirkin <mst at redhat.com> But you really want to fix the subject. Make it less verbose drop upper case and add info about module. Something like: virtio_net: coding style fix: use tabs for indent Also, you misspelled Jason's email.> --- > drivers/net/virtio_net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 6c8170c..5d71e9f 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -2717,7 +2717,7 @@ static __init int virtio_net_driver_init(void) > if (ret) > goto err_dead; > > - ret = register_virtio_driver(&virtio_net_driver); > + ret = register_virtio_driver(&virtio_net_driver); > if (ret) > goto err_virtio; > return 0; > -- > 2.4.11
Alex Williamson
2017-May-15 03:20 UTC
[PATCH 1/3] Fix ERROR: trailing statements should be on next line
On Mon, 15 May 2017 05:58:05 +0300 "Michael S. Tsirkin" <mst at redhat.com> wrote:> On Sun, May 14, 2017 at 07:51:28PM +0200, Maciek Fijalkowski wrote: > > From: Maciej Fijalkowski <macfij7 at wp.pl> > > > > Signed-off-by: Maciej Fijalkowski <macfij7 at wp.pl> > > I prefer the original form - ; isn't a full statement. > > > --- > > drivers/net/virtio_net.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > index 9320d96..f20dfb8 100644 > > --- a/drivers/net/virtio_net.c > > +++ b/drivers/net/virtio_net.c > > @@ -217,7 +217,8 @@ static void give_pages(struct receive_queue *rq, struct page *page) > > struct page *end; > > > > /* Find end of list, sew whole thing into vi->rq.pages. */ > > - for (end = page; end->private; end = (struct page *)end->private); > > + for (end = page; end->private; end = (struct page *)end->private) > > + ;FWIW, I generally like to put a comment on the next line to make it abundantly clear that there's nothing in the body of the loop, it's also more aesthetically pleasing than a semi-colon on the line by itself, ex. /* Nothing */; It's just too easy to misinterpret the loop otherwise, especially without gratuitous white space. Thanks, Alex> > end->private = (unsigned long)rq->pages; > > rq->pages = page; > > } > > -- > > 2.4.11 > _______________________________________________ > Virtualization mailing list > Virtualization at lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Reasonably Related Threads
- [PATCH 1/3] Fix ERROR: trailing statements should be on next line
- [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
- [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
- [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
- [PATCH 1/3] Fix ERROR: trailing statements should be on next line