From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bn3nam01on0104.outbound.protection.outlook.com ([104.47.33.104]:2368 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751390AbeCTSYw (ORCPT ); Tue, 20 Mar 2018 14:24:52 -0400 Date: Tue, 20 Mar 2018 11:24:32 -0700 From: Igor Pylypiv To: David Miller Cc: lkp@intel.com, kbuild-all@01.org, skhare@vmware.com, pv-drivers@vmware.com, netdev@vger.kernel.org Subject: Re: [PATCH] vmxnet3: fix LRO feature check Message-ID: <20180320182430.GA65@silver-peak.com> References: <20180317075852.11785-1-ipylypiv@silver-peak.com> <201803181411.VTfldbIf%fengguang.wu@intel.com> <20180320.105722.15146213885137044.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180320.105722.15146213885137044.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: The 03/20/2018 10:57, David Miller wrote: > From: kbuild test robot > Date: Sun, 18 Mar 2018 14:37:35 +0800 > > > All warnings (new ones prefixed by >>): > > > > drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_rx_complete': > >>> 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".