From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=vU503vni; spf=pass (domain: arm.com, ip: 40.107.8.47, mailfrom: sami.mujawar@arm.com) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.47]) by groups.io with SMTP; Fri, 23 Aug 2019 03:58:25 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ip+TPsYZEdJq8oug2IJ4tOkAT5Zie8HUNiEH/wgC+Cw=; b=vU503vniMnW9wrk94BbQIg/KnrshXAESwkmzmcZ13toVgWi+xzp3j4qtgt546GJCwVscE4FWS+mmR0iTgi0iCUKEzFbh+wouw7Y8UfJ743Xd3TvUUjVuWKmENs/RXnt4q0xBQKUesoLMnVkL2w6IUnnpxraMRXLdDHssdJOnM9s= Received: from DB6PR0802CA0028.eurprd08.prod.outlook.com (2603:10a6:4:a3::14) by AM5PR0802MB2596.eurprd08.prod.outlook.com (2603:10a6:203:98::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.18; Fri, 23 Aug 2019 10:58:21 +0000 Received: from VE1EUR03FT004.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::200) by DB6PR0802CA0028.outlook.office365.com (2603:10a6:4:a3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.15 via Frontend Transport; Fri, 23 Aug 2019 10:58:20 +0000 Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT004.mail.protection.outlook.com (10.152.18.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:58:19 +0000 Received: ("Tessian outbound eba0b9aef687:v27"); Fri, 23 Aug 2019 10:58:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 23f6222d3728f4b2 X-CR-MTA-TID: 64aa7808 Received: from fc5461a84a52.1 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.13.53]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id E87A8A68-390F-4670-A5EE-3AFC9DF06DEF.1; Fri, 23 Aug 2019 10:58:19 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2053.outbound.protection.outlook.com [104.47.13.53]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fc5461a84a52.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 23 Aug 2019 10:58:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H3RMu3zkZVpDBfmnU3m8JkTq/qFZdPWke125ZuVZPL4+bFWCPzeZ1JYPDqCr1ox9LVzP2Dttl0yl6YObz+McC/DM4EJm2l2jS/xQ/CHoTBmijS3dFknpNoeRNPq3o3Sf87OWgwUM58wlbVh3X/a0Bb/XKhP0lSO3IJnkY7n1QYbqCnVttDP3JuTRDU19x8ISwtlf/nWrtYABSlLxYxH+gW8LBXipNUQ1sz6CScxKZZIQIF+plB2riBCQoiYoS0oU0v/H2Z0UEStxRNgUbKTJ0Hua+R9m9+4jvDG3sDeYbuw7FyxAZs415sO4zICNCJYmCQ+NHdQluGDoZlGOMU5w3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ip+TPsYZEdJq8oug2IJ4tOkAT5Zie8HUNiEH/wgC+Cw=; b=FKYKCTXVefhqzClM9W5XjHMfLGGrDuvCwrzU7w9jju1PWnT8mCSwdMo8CiRzQ2dFN3V7ud2dOl24+aazVqNPp3TGe3d6Cegd7LiMlTnmvGGmB3vYYHUhYN2z62aDouDPX+p+ecaSTfFAoH2Clhvzf1bidf1BloSThHI/7sLOPzFsxl9zpiCTp0LlmY8yY/jL5GZv76V3HqiQSM/542y30tQZsjUpV+tL1v+vffF6hdohnHrGFm1bs2TyKKjKPrd3cYmErE+/5McpTaK3/2vjpxtgp1LoAmpINZQaZnNgJbeOzwt2afRwC7lXoC1Y1VJsKfeMOQ0UgrY55SWgHExJgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=temperror action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ip+TPsYZEdJq8oug2IJ4tOkAT5Zie8HUNiEH/wgC+Cw=; b=vU503vniMnW9wrk94BbQIg/KnrshXAESwkmzmcZ13toVgWi+xzp3j4qtgt546GJCwVscE4FWS+mmR0iTgi0iCUKEzFbh+wouw7Y8UfJ743Xd3TvUUjVuWKmENs/RXnt4q0xBQKUesoLMnVkL2w6IUnnpxraMRXLdDHssdJOnM9s= Received: from AM4PR08CA0077.eurprd08.prod.outlook.com (2603:10a6:205:2::48) by AM5PR0802MB2596.eurprd08.prod.outlook.com (2603:10a6:203:98::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.18; Fri, 23 Aug 2019 10:58:16 +0000 Received: from AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::208) by AM4PR08CA0077.outlook.office365.com (2603:10a6:205:2::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2199.15 via Frontend Transport; Fri, 23 Aug 2019 10:58:16 +0000 Authentication-Results-Original: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT045.mail.protection.outlook.com (10.152.17.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:58:15 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Fri, 23 Aug 2019 10:56:27 +0000 Received: from E107187.Arm.com (10.1.195.55) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Fri, 23 Aug 2019 10:56:27 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , Subject: [PATCH v1 18/19] ArmPlatformPkg: Fix comparison of constants warning Date: Fri, 23 Aug 2019 11:55:38 +0100 Message-ID: <20190823105539.13260-19-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20190823105539.13260-1-sami.mujawar@arm.com> References: <20190823105539.13260-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;IPV:NLI;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(376002)(346002)(39860400002)(136003)(396003)(2980300002)(189003)(199004)(47776003)(305945005)(48376002)(81156014)(81166006)(70586007)(486006)(44832011)(2906002)(70206006)(16586007)(76176011)(26005)(476003)(426003)(126002)(51416003)(8676002)(50466002)(7696005)(1076003)(186003)(54906003)(63350400001)(8936002)(11346002)(2616005)(316002)(446003)(86362001)(336012)(63370400001)(19627235002)(36756003)(6666004)(356004)(53416004)(4326008)(50226002)(478600001)(6916009)(14444005)(53936002)(5660300002)(2351001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0802MB2596;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8d26423b-b8df-4599-abbf-08d727b8ceea X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328);SRVR:AM5PR0802MB2596; X-MS-TrafficTypeDiagnostic: AM5PR0802MB2596:|AM5PR0802MB2596: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true X-MS-Oob-TLC-OOBClassifiers: OLM:247;OLM:247; X-Forefront-PRVS: 0138CD935C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: X5K5aH3oBGL/wkxw5fAXTIHMb96Xfi41kz2lggS++oZR28E6B0/Krl0Iuo/ey6EOYPWMK4447ZN4qpBRNtr/sPk5SljkR0mNDKlhEUeGdU123oNqOvhDBqI/XGKo9KtFG0TcjxjNlfzb3VlXdcfeORiMIYJROIiW23MwbbzbECbitGfWbfvlRtI8lQviewzX95wvpV9mRgZZ0+YYUHV3Yp1m02JoeWIKC0h4LsODTPU2iNLCUV3mBiVKpHeVca0+6h3AtjgVyDTbuLVtY93/wg3liU+1NcA02WfxMdcEpb2zIfMSctcs5wHLAU4px6tQcIm11fgjaSG6bTgX2GPpIuKeKH2QWOoi+LKPLmPK3tB8HoDc9XVuNGSfm8EdRjh31lNInos+cd8CvmlFEx89XlNp588BnkbO4IxF55IXMNQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2596 Original-Authentication-Results: spf=temperror (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=temperror action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT004.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;IPV:CAL;SCL:-1;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(376002)(346002)(39860400002)(136003)(396003)(2980300002)(189003)(199004)(47776003)(305945005)(48376002)(81156014)(81166006)(70586007)(486006)(44832011)(2906002)(70206006)(16586007)(76176011)(26005)(476003)(426003)(126002)(51416003)(8676002)(50466002)(7696005)(1076003)(186003)(54906003)(63350400001)(8936002)(11346002)(2616005)(316002)(446003)(86362001)(336012)(36906005)(63370400001)(19627235002)(36756003)(6666004)(53416004)(4326008)(26826003)(50226002)(478600001)(6916009)(14444005)(22756006)(76130400001)(5660300002)(2351001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0802MB2596;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;MX:1;A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 5d74b7a7-3a41-4037-5752-08d727b8cc67 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(710020)(711020)(4605104)(1401327)(2017052603328);SRVR:AM5PR0802MB2596; NoDisclaimer: True X-Forefront-PRVS: 0138CD935C X-Microsoft-Antispam-Message-Info: R+NUhXr6gYBoYi+4vAXImeOKam2P6YcaKDoK+BGldGPApYbq4TAK8zr1+28dOnkTlROCr+IOM73uU9omSEzp4XzmuCGB71IQXQQoZMx3NhHA3r4JwDTUmvljuJ/tI1skDxYDTPHriTREvpdQcDE0XLncuGBc7aZhHNadde61L9YR0M7yEAJuNXGmPO3GAr0+tg/EglmX81Co1puBSNhTqxVV0/rHzlB8j1JVfWmqaP+d2Fy3UDK8FDh4l/4MVeAwSruzxHA5OzZNnlKO6tc8sC0mFl0uMsaslY7PSJTw01+zL126n4t/rRPdIKICiXwXolhEUcNox7RxDACzYw0GKqga9D0XmikaElPXZK9ewLLmqIZYA/T47P8vVkBb4lY2PBrF32gI8wGY8M+SY77jvelJHmVAtKmaKz6eXKBcpwU= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2019 10:58:19.3845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d26423b-b8df-4599-abbf-08d727b8ceea X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2596 Content-Type: text/plain The VS2017 compiler reports 'warning C6326: potential comparison of a constant with another constant' when a fixed PCD value is compared with a constant value. The faulting code is as marked by '-->' below: --> if (FixedPcdGet32 (PL011UartInteger) != 0) { Integer = FixedPcdGet32 (PL011UartInteger); Fractional = FixedPcdGet32 (PL011UartFractional); } else { ... The macro FixedPcdGet32 (PL011UartInteger) evaluates to a macro _PCD_VALUE_PL011UartInteger that is defined by the build system to represent the UART Integer value. Therefore, the VS2017 compiler reports the above warning. Fix this warning by enclosing the code in appropriate #if .. #else .. #endif directives. Signed-off-by: Sami Mujawar --- ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c index 2d3c279cce49304959953ec4a34b50e09a7d0045..dabf099b9bc82e1fb1bd5a2eae3fa4b5878a9e07 100644 --- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c +++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c @@ -174,10 +174,10 @@ PL011UartInitializePort ( // // If PL011 Integer value has been defined then always ignore the BAUD rate - if (FixedPcdGet32 (PL011UartInteger) != 0) { +#if (FixedPcdGet32 (PL011UartInteger) != 0) Integer = FixedPcdGet32 (PL011UartInteger); Fractional = FixedPcdGet32 (PL011UartFractional); - } else { +#else // If BAUD rate is zero then replace it with the system default value if (*BaudRate == 0) { *BaudRate = FixedPcdGet32 (PcdSerialBaudRate); @@ -197,7 +197,7 @@ PL011UartInitializePort ( Divisor = (UINT32)DivisorValue; Integer = Divisor >> FRACTION_PART_SIZE_IN_BITS; Fractional = Divisor & FRACTION_PART_MASK; - } +#endif // // If PL011 is already initialized, check the current settings -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'