From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 44A39211A1E3D for ; Tue, 1 Jan 2019 17:42:14 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jan 2019 17:42:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,429,1539673200"; d="scan'208";a="113482026" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 01 Jan 2019 17:42:13 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 1 Jan 2019 17:42:13 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 1 Jan 2019 17:42:13 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.63]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.44]) with mapi id 14.03.0415.000; Wed, 2 Jan 2019 09:42:11 +0800 From: "Bi, Dandan" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Wu, Hao A" , Vladimir Olovyannikov , Ard Biesheuvel Thread-Topic: [edk2] [patch] MdeModulePkg/NonDiscoverable: Use compare operator for comparison Thread-Index: AQHUnosikrmfBnUnREK+KESmyXH8SqWZ5XMAgAFVHpA= Date: Wed, 2 Jan 2019 01:42:10 +0000 Message-ID: <3C0D5C461C9E904E8F62152F6274C0BB401BFD76@shsmsx102.ccr.corp.intel.com> References: <20181228085429.47056-1-dandan.bi@intel.com> <20181228085429.47056-2-dandan.bi@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483104023A6FD@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483104023A6FD@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] MdeModulePkg/NonDiscoverable: Use compare operator for comparison X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 01:42:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Star, Thank you for your suggestion.=20 I will send a new patch with your suggestion. Thanks, Dandan > -----Original Message----- > From: Zeng, Star > Sent: Tuesday, January 1, 2019 9:17 PM > To: Bi, Dandan ; edk2-devel@lists.01.org > Cc: Wu, Hao A ; Vladimir Olovyannikov > ; Ard Biesheuvel > ; Zeng, Star > Subject: RE: [edk2] [patch] MdeModulePkg/NonDiscoverable: Use compare > operator for comparison >=20 > if (Attributes) { > if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) !=3D 0) { > return EFI_UNSUPPORTED; > } > } >=20 > If ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) !=3D 0) is TRUE, the > Attributes must be not 0. > So " if (Attributes " could be removed. >=20 > BTW: This code block has indentation problem. >=20 >=20 > With them handled, Reviewed-by: Star Zeng >=20 >=20 > Thanks, > Star > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Dandan Bi > Sent: Friday, December 28, 2018 4:54 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A > Subject: [edk2] [patch] MdeModulePkg/NonDiscoverable: Use compare > operator for comparison >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1422 >=20 > According to EDK II C Coding Standards Specification, Non-Boolean > comparisons must use a compare operator. > This patch is to update the code to follow EDKII coding style. >=20 > Cc: Jian J Wang > Cc: Hao Wu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dandan Bi > --- > .../NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > PciDeviceIo.c > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > PciDeviceIo.c > index f0d3472ea5..a0fe3b9ffa 100644 > --- > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > PciDeviceIo.c > +++ > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > Pc > +++ iDeviceIo.c > @@ -1274,11 +1274,11 @@ PciIoAttributes ( > #define DEV_SUPPORTED_ATTRIBUTES \ > (EFI_PCI_DEVICE_ENABLE | > EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) >=20 > Dev =3D NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This); >=20 > - if (Attributes) { > + if (Attributes !=3D 0) { > if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) !=3D 0) { > return EFI_UNSUPPORTED; > } > } >=20 > -- > 2.18.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel