* [PATCH 1/3] Fix ERROR: trailing statements should be on next line @ 2017-05-14 17:51 Maciek Fijalkowski 2017-05-14 17:51 ` [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses Maciek Fijalkowski ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Maciek Fijalkowski @ 2017-05-14 17:51 UTC (permalink / raw) To: mst; +Cc: jasonwang, virtualization, netdev, linux-kernel, Maciej Fijalkowski From: Maciej Fijalkowski <macfij7@wp.pl> Signed-off-by: Maciej Fijalkowski <macfij7@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 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses 2017-05-14 17:51 [PATCH 1/3] Fix ERROR: trailing statements should be on next line Maciek Fijalkowski @ 2017-05-14 17:51 ` Maciek Fijalkowski 2017-05-14 18:48 ` kbuild test robot ` (2 more replies) 2017-05-14 17:51 ` [PATCH 3/3] Fix ERROR: code indent should use tabs where possible Maciek Fijalkowski 2017-05-15 2:58 ` [PATCH 1/3] Fix ERROR: trailing statements should be on next line Michael S. Tsirkin 2 siblings, 3 replies; 10+ messages in thread From: Maciek Fijalkowski @ 2017-05-14 17:51 UTC (permalink / raw) To: mst; +Cc: jasonwang, virtualization, netdev, linux-kernel, Maciej Fijalkowski From: Maciej Fijalkowski <macfij7@wp.pl> Signed-off-by: Maciej Fijalkowski <macfij7@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 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses 2017-05-14 17:51 ` [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses Maciek Fijalkowski @ 2017-05-14 18:48 ` kbuild test robot 2017-05-15 0:25 ` Andrew Lunn 2017-05-15 2:56 ` Michael S. Tsirkin 2 siblings, 0 replies; 10+ messages in thread From: kbuild test robot @ 2017-05-14 18:48 UTC (permalink / raw) To: Maciek Fijalkowski Cc: mst, netdev, linux-kernel, virtualization, jasonwang, kbuild-all, Maciej Fijalkowski [-- Attachment #1: Type: text/plain, Size: 9598 bytes --] 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@redhat.com> :::::: CC: David S. Miller <davem@davemloft.net> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 31444 bytes --] [-- Attachment #3: Type: text/plain, Size: 183 bytes --] _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses 2017-05-14 17:51 ` [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses Maciek Fijalkowski 2017-05-14 18:48 ` kbuild test robot @ 2017-05-15 0:25 ` Andrew Lunn 2017-05-15 2:56 ` Michael S. Tsirkin 2 siblings, 0 replies; 10+ messages in thread From: Andrew Lunn @ 2017-05-15 0:25 UTC (permalink / raw) To: Maciek Fijalkowski; +Cc: mst, jasonwang, virtualization, netdev, linux-kernel On Sun, May 14, 2017 at 07:51:29PM +0200, Maciek Fijalkowski wrote: > From: Maciej Fijalkowski <macfij7@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses 2017-05-14 17:51 ` [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses Maciek Fijalkowski 2017-05-14 18:48 ` kbuild test robot 2017-05-15 0:25 ` Andrew Lunn @ 2017-05-15 2:56 ` Michael S. Tsirkin 2 siblings, 0 replies; 10+ messages in thread From: Michael S. Tsirkin @ 2017-05-15 2:56 UTC (permalink / raw) To: Maciek Fijalkowski; +Cc: netdev, linux-kernel, virtualization On Sun, May 14, 2017 at 07:51:29PM +0200, Maciek Fijalkowski wrote: > From: Maciej Fijalkowski <macfij7@wp.pl> > > Signed-off-by: Maciej Fijalkowski <macfij7@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] Fix ERROR: code indent should use tabs where possible 2017-05-14 17:51 [PATCH 1/3] Fix ERROR: trailing statements should be on next line Maciek Fijalkowski 2017-05-14 17:51 ` [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses Maciek Fijalkowski @ 2017-05-14 17:51 ` Maciek Fijalkowski 2017-05-15 3:00 ` Michael S. Tsirkin 2017-05-15 2:58 ` [PATCH 1/3] Fix ERROR: trailing statements should be on next line Michael S. Tsirkin 2 siblings, 1 reply; 10+ messages in thread From: Maciek Fijalkowski @ 2017-05-14 17:51 UTC (permalink / raw) To: mst; +Cc: jasonwang, virtualization, netdev, linux-kernel, Maciej Fijalkowski From: Maciej Fijalkowski <macfij7@wp.pl> Signed-off-by: Maciej Fijalkowski <macfij7@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 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] Fix ERROR: code indent should use tabs where possible 2017-05-14 17:51 ` [PATCH 3/3] Fix ERROR: code indent should use tabs where possible Maciek Fijalkowski @ 2017-05-15 3:00 ` Michael S. Tsirkin 0 siblings, 0 replies; 10+ messages in thread From: Michael S. Tsirkin @ 2017-05-15 3:00 UTC (permalink / raw) To: Maciek Fijalkowski; +Cc: netdev, linux-kernel, virtualization On Sun, May 14, 2017 at 07:51:30PM +0200, Maciek Fijalkowski wrote: > From: Maciej Fijalkowski <macfij7@wp.pl> > > Signed-off-by: Maciej Fijalkowski <macfij7@wp.pl> Acked-by: Michael S. Tsirkin <mst@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Fix ERROR: trailing statements should be on next line 2017-05-14 17:51 [PATCH 1/3] Fix ERROR: trailing statements should be on next line Maciek Fijalkowski 2017-05-14 17:51 ` [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses Maciek Fijalkowski 2017-05-14 17:51 ` [PATCH 3/3] Fix ERROR: code indent should use tabs where possible Maciek Fijalkowski @ 2017-05-15 2:58 ` Michael S. Tsirkin 2017-05-15 3:20 ` Alex Williamson 2 siblings, 1 reply; 10+ messages in thread From: Michael S. Tsirkin @ 2017-05-15 2:58 UTC (permalink / raw) To: Maciek Fijalkowski; +Cc: netdev, linux-kernel, virtualization On Sun, May 14, 2017 at 07:51:28PM +0200, Maciek Fijalkowski wrote: > From: Maciej Fijalkowski <macfij7@wp.pl> > > Signed-off-by: Maciej Fijalkowski <macfij7@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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Fix ERROR: trailing statements should be on next line 2017-05-15 2:58 ` [PATCH 1/3] Fix ERROR: trailing statements should be on next line Michael S. Tsirkin @ 2017-05-15 3:20 ` Alex Williamson 2017-05-15 14:25 ` David Laight 0 siblings, 1 reply; 10+ messages in thread From: Alex Williamson @ 2017-05-15 3:20 UTC (permalink / raw) To: Michael S. Tsirkin Cc: netdev, virtualization, linux-kernel, Maciek Fijalkowski On Mon, 15 May 2017 05:58:05 +0300 "Michael S. Tsirkin" <mst@redhat.com> wrote: > On Sun, May 14, 2017 at 07:51:28PM +0200, Maciek Fijalkowski wrote: > > From: Maciej Fijalkowski <macfij7@wp.pl> > > > > Signed-off-by: Maciej Fijalkowski <macfij7@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@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/virtualization ^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH 1/3] Fix ERROR: trailing statements should be on next line 2017-05-15 3:20 ` Alex Williamson @ 2017-05-15 14:25 ` David Laight 0 siblings, 0 replies; 10+ messages in thread From: David Laight @ 2017-05-15 14:25 UTC (permalink / raw) To: 'Alex Williamson', Michael S. Tsirkin Cc: Maciek Fijalkowski, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org From: Alex Williamson > Sent: 15 May 2017 04:21 ... > > > /* 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, My preference is to put 'continue;' on a line by itself. Or even move the termination condition into the loop: for (end = page;; end = (struct page *)end->private) if (!end->private) break; (oh, is that cast needed??) David ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-05-15 14:25 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-05-14 17:51 [PATCH 1/3] Fix ERROR: trailing statements should be on next line Maciek Fijalkowski 2017-05-14 17:51 ` [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses Maciek Fijalkowski 2017-05-14 18:48 ` kbuild test robot 2017-05-15 0:25 ` Andrew Lunn 2017-05-15 2:56 ` Michael S. Tsirkin 2017-05-14 17:51 ` [PATCH 3/3] Fix ERROR: code indent should use tabs where possible Maciek Fijalkowski 2017-05-15 3:00 ` Michael S. Tsirkin 2017-05-15 2:58 ` [PATCH 1/3] Fix ERROR: trailing statements should be on next line Michael S. Tsirkin 2017-05-15 3:20 ` Alex Williamson 2017-05-15 14:25 ` David Laight
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).