From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 2BE50211A960E for ; Tue, 1 Jan 2019 05:17:23 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jan 2019 05:17:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,426,1539673200"; d="scan'208";a="106142034" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga008.jf.intel.com with ESMTP; 01 Jan 2019 05:17:23 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 1 Jan 2019 05:17:23 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 1 Jan 2019 05:17:22 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.63]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.160]) with mapi id 14.03.0415.000; Tue, 1 Jan 2019 21:17:20 +0800 From: "Zeng, Star" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Wu, Hao A" , Vladimir Olovyannikov , Ard Biesheuvel , "Zeng, Star" Thread-Topic: [edk2] [patch] MdeModulePkg/NonDiscoverable: Use compare operator for comparison Thread-Index: AQHUnosfWKbLRhypOUWdXP9+ws1ZIaWaaj3A Date: Tue, 1 Jan 2019 13:17:20 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483104023A6FD@shsmsx102.ccr.corp.intel.com> References: <20181228085429.47056-1-dandan.bi@intel.com> <20181228085429.47056-2-dandan.bi@intel.com> In-Reply-To: <20181228085429.47056-2-dandan.bi@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmZjMTI5NzUtM2M2MS00Nzc0LTg2ZjgtZjJlNDllMjg4NDViIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZUxZTHZXQnNQTGtQR3R2SEpoZG5LOG5PUDdmTnkyN1JIYjlzbmxJbXVTdDNGZGFqbmhmeEVnU2FBRjF3aENWcSJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action 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: Tue, 01 Jan 2019 13:17:24 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable if (Attributes) { if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) !=3D 0) { return EFI_UNSUPPORTED; } } If ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) !=3D 0) is TRUE, the Attri= butes must be not 0. So " if (Attributes " could be removed. BTW: This code block has indentation problem. With them handled, Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dand= an 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 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1422 According to EDK II C Coding Standards Specification, Non-Boolean compariso= ns must use a compare operator. This patch is to update the code to follow EDKII coding style. 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(-) diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverab= lePciDeviceIo.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDisco= verablePciDeviceIo.c index f0d3472ea5..a0fe3b9ffa 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDe= viceIo.c +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePc +++ 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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel