Thread (9 messages) 9 messages, 4 authors, 2018-03-20

Re: [PATCH] vmxnet3: fix LRO feature check

flat view

From: Igor Pylypiv <hidden>
Date: 2018-03-20 18:24:52

The 03/20/2018 10:57, David Miller wrote:
From: kbuild test robot <redacted>
Date: Sun, 18 Mar 2018 14:37:35 +0800
quoted
All warnings (new ones prefixed by >>):

   drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_rx_complete':
quoted
quoted
drivers/net/vmxnet3/vmxnet3_drv.c:1474:8: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
           !adapter->netdev->features & NETIF_F_LRO) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
Igor, I will fix this up for you.  But it is clear that this patch wasn't tested
very well.

Because !adapter->netdev->features evaluates wholly before the "& NETIF_F_LRO",
the flags aren't being tested properly at all.
My bad.

I have even been looking at C operator precedence table:

----------------------------
| Operator | Associativity |
|--------------------------|
| ++ --    | right-to-left |
| + -      |               |
| ! ~      |               |
| (type)   |               |
| *        |               |
| &        |               |
| sizeof   |               |
----------------------------

According to this table '&' will be evaluated first, because it is on the right side.

But yeah, that was "Address of", not "Bitwise AND".
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help