From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.3094.1615965097345667083 for ; Wed, 17 Mar 2021 00:11:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=yaTC6d+x; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: bob.c.feng@intel.com) IronPort-SDR: vcsOyhWME6ECuiolI0Z++5LGs3anpHFZYBk9p0clW346o6Kmq/eXVYe4LivGU0u/yRt2TULSjx /FV9AQFAxKBg== X-IronPort-AV: E=McAfee;i="6000,8403,9925"; a="250767982" X-IronPort-AV: E=Sophos;i="5.81,255,1610438400"; d="scan'208";a="250767982" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2021 00:11:36 -0700 IronPort-SDR: 3NxufyxI6LGZ5gRWXyPXPaQsPMLTjaSlLSlmRhKI/4URAwZ3cHHmZKA3q3DoxgYblCBHzCKQ2f FVWoDwwIVHFQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,255,1610438400"; d="scan'208";a="433298405" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 17 Mar 2021 00:11:36 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 17 Mar 2021 00:11:35 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 17 Mar 2021 00:11:35 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.108) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Wed, 17 Mar 2021 00:11:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AO6mL1xxhdWmMBPLUzJO3Kt7SrNV1cOZ/CtPV7BjDwn3FzBvjREqwRnWJpKyFFhU5rHSykVoeN40zA1Cwb+OVzL1SfANTlXZ5Pd/uEucTKyd/aZMdgjCflhsE6FvzV9U90AbQP9gBwUDtd0gaCJG+02yCj+rXRcoWATof02xQU/3AjYgai0vQOxMqCRPqtOedjbYOFJ23y81DtDA5c1bkO1tEVsGllB9HsQncgUFqyIFmLORECyGdzC9fZhuCqgQPWk+NFoIuzhvG1zpuH4POdFVMbd6yj+2QSgLsBjrRzWA2IJXAKoQh59mvJG9UA2E5W3CaY1bdgRwqRF4ToRHVA== 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=N+fOJ0I+yBroYKLTSfj4HE0KO07xApWeXmRHl4dtn/c=; b=Klrq6MACZpQmsz00YoxECeWdFSuJNdKe5Kx+KP0o3eLJgf5Foem5anoScIzT4wNyoJc2kM/om1BZ7AWIqvakPzykwaCQ7MbReTxypi3rgXbBTTDA0XBL9u/Er01BenuUejFsPUsjTYg332O+6I8a7WwC+Y42H4tfO3YQDdZ6QMYc2cZK4euauJZbHHK33gcNVQMCL/nmIUfiv2kuiheAvuAszjijZwRtYaTZOTOPTX0Ru0pAeFqc97MnTO2C4pz7LZS+z5fVSnOzdhMQtOIkeDioUcTW5kvuHaKoHnrOmRQZK4xmEyKE8iYBLMPqES2oEFyd0FBOuI4NarxWY5ibNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N+fOJ0I+yBroYKLTSfj4HE0KO07xApWeXmRHl4dtn/c=; b=yaTC6d+xUuSOA2BB3fWf6aoGLTo/JHLJXQNCSEzkuP0nHU9l3WJLAg6VrmLX3AWY94MMO9vgx1+Gg1A9tdogMo70OytwYvuEQ/MGE8UBt3IKp12xi5huJwDG9LX9VmYOUVQNQqJRlj17iuuXbIKKEVc7gYE+QR/hNiF4TFJMDco= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB3596.namprd11.prod.outlook.com (2603:10b6:5:13a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Wed, 17 Mar 2021 07:11:33 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::10db:5760:d7f5:d0e0]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::10db:5760:d7f5:d0e0%3]) with mapi id 15.20.3955.018; Wed, 17 Mar 2021 07:11:33 +0000 From: "Bob Feng" To: "Pierre.Gondois@arm.com" , "devel@edk2.groups.io" , "gaoliming@byosoft.com.cn" , "Chen, Christine" Subject: Re: [PATCH v2-resend 1/1] BaseTools/Ecc: Make Ecc only check first include guard Thread-Topic: [PATCH v2-resend 1/1] BaseTools/Ecc: Make Ecc only check first include guard Thread-Index: AQHXGdqabbwLD+HUS0CqMKevuk4tTqqHxNmg Date: Wed, 17 Mar 2021 07:11:33 +0000 Message-ID: References: <20210315203341.15525-1-Pierre.Gondois@arm.com> In-Reply-To: <20210315203341.15525-1-Pierre.Gondois@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.54] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3c973ae4-6d75-46b5-bd34-08d8e913e55f x-ms-traffictypediagnostic: DM6PR11MB3596: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:257; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vk6c8vDZZ1sJhMGcJtkHKSmgw7jDZxF34ozAEBure3wuQt79z1BVDkt1HSAE2BJaWKRCf7V+bvHQLvRUutprS2QW+bo0Cf+7fJ7ljm9UT27zM0/tojI+7xxTEU6/pyYZyOp7eXk5J7rp9p/BkYzhwXDHfkBXGHfUutr6sT3P13GyvGIY5NIvIl7Cho+hyqBfaMluleriOII/O/GepAG3YRKMUykds8Q/ZIueV0R2keWtKkLZORW+edHjbt/QWjEafa+BRzX50Zq12ehBhg3B56C9zaEc2MtKV2FXm85a/hVtBoUuaAuYLFni9rYArbEAhWK/0Wk3ZsfVOH8T+jejuD0TXS4GtLZLDQD0PIROmDgwHiGPenkZ+R9oTcjn7TClzxtlV2Tn57hpR87i+f574QasS3WNpblUFRE0QdQxOOiW2m14T4e9ns3/nPV4Mak8txqBqebLLuyKVxdbjx1fohAF+Zx21kx4i1Xmxn1DlzTMeDNNrD0huVT4IZ8zvqL1T0TREpeAznsXnVI15kbPiFmo0Phjgcvyuh8zBiRST3ZOXeEEQdXx+AQlvAhS23+w+MLxe9zjOpIy5QF8R+dyOO7fVcdKUJ9jh7BoBiDlEnUs4kp6Zlw+X+VqQSwf5fnmA/Gl7hz0X9CRA6jIfnbaDQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(376002)(346002)(366004)(396003)(136003)(6636002)(26005)(186003)(86362001)(71200400001)(966005)(478600001)(110136005)(316002)(55016002)(9686003)(52536014)(5660300002)(76116006)(53546011)(66446008)(64756008)(6506007)(66556008)(66946007)(66476007)(8936002)(7696005)(8676002)(83380400001)(33656002)(2906002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?F/nvLozMHXCXMZyOSA5Kp2nhjq2XViUCoUrMtiZ7rr05WvLSPxq29PIprg+R?= =?us-ascii?Q?NCSfqHpnucxcH2TLPPScq9NPvJ9EiKBo61Luw6CS65pfFRjtdEm+azJ59qrM?= =?us-ascii?Q?QrES06igMzTuBjrD1fCaL6rLtNH8PPar++/u8pt3Zp9X4oAuuj0nXyCJDcve?= =?us-ascii?Q?TDhb/KS8MT4s6VxkJaVKdrnVcK1rg8DDHzoesSPgnGG00ZgRFmU/30ojbT0o?= =?us-ascii?Q?AXXjBvEh6YeouJgQWqR9AbFYA5FxEdDpt99vueZB9bv+JGkcN3BQhhHrx2Ps?= =?us-ascii?Q?lt8yKDS+zok6otlK4ZW0zjrz3ZmzgDLzcc03TgYcE3kvTATujqCnt3UnTrw+?= =?us-ascii?Q?6jzRXsP7pfGDSR4V1lh0A7wIBOMAHvsbuMHlTA77FJ4tkbqIbxqSTNhe8J0k?= =?us-ascii?Q?JlmGQL/5S5lV1k6wQHFNtMb7NQIMyjt8Bo4HbDCGnoPCcBev/g+/iwVQbxI4?= =?us-ascii?Q?WPku8NlRA9Pm+9vOOQxaF2Cczug0w77eBDez62j5eWFgas5d4XAqkC4GsKPC?= =?us-ascii?Q?0YiMyE5orJfxadlnIu6tIv9KoacH6eOeKDSUWH6PPCxm8JLiN7VsGG0N44oN?= =?us-ascii?Q?4qs3UeYcrN04ECy7jST5NF9NSaAOppYIZp10btJDVVPTfr1U4BxgiMGCj8sp?= =?us-ascii?Q?QXW0xzBL3tVYfEeS+p5uGuBbIobW9fpAeeG4Kj48N/SRNmNQDGP2f+UB5wT+?= =?us-ascii?Q?OmLgEU/ZsshrMilh1U8gyHPlawxd3TR8GT35RLYl+o4jNi4NibRRDCxTzRQ9?= =?us-ascii?Q?PTX7XpgNHuAWSY2kNEPa7ERSF+YMCNyjk+vX/CjbCqM+F6Ax7YENHjh0awF4?= =?us-ascii?Q?b0hjvJjig23e5e6/i7QFammA7Ie3GOXR32KRnkjjx2QbfCG76oWYU/PBB1Oh?= =?us-ascii?Q?luSULrKX3quYYlNdnUniE6Bh1Lxf05jP5WJ3tQX9TB9sXMaVzBHG6g+7BBB0?= =?us-ascii?Q?Hv/HCpmOMV/4Y/h8/w/TR9g6vY4LpeUFKldzo8zEeRU6kwba+SbzydwvG34x?= =?us-ascii?Q?dkO0CGQFAQATwMYKRGX1RfnUCftYilTxabdBE/J3vUdkc2D//ZDXkEbvgHIH?= =?us-ascii?Q?z8rEHyocWK2+9uR8fwZeh0Jc6lmTNigPXA9juTcEU/8texn7C3+Suet+dL/8?= =?us-ascii?Q?iefN7xr2weBTLxhEPZvFJYKsqr7yxQxxu4UZSYyXfcn2qT9FQaK9FXwzTADd?= =?us-ascii?Q?K5tbaaR9X2mfA2G7GxWOxq+dWhLO6UNO2krUCC3BNaF36fwqGsmCc6qlzBQS?= =?us-ascii?Q?xfUkZZqFtyxYHpNY8i4jlVh9tpjJUf61olBt/ecZPx/Op1PrCPkx8EAOXHbS?= =?us-ascii?Q?geI=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c973ae4-6d75-46b5-bd34-08d8e913e55f X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Mar 2021 07:11:33.3882 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +1s2FzF0xwaDGd8N/WhS2/wmJb3y+YVcjSSHUoMnKdjK8XlzJ4/3H5U40RVXRtbCDK9MY9bjv5tsvBcH93eYKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3596 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Pierre, Could you recreate your patch and send again. On my machine, I can't apply = this patch. error: corrupt patch at line 33 error: could not build fake ancestor hint: Use 'git am --show-current-patch=3Ddiff' to see the failed patch Thanks, Bob -----Original Message----- From: Pierre.Gondois@arm.com =20 Sent: Tuesday, March 16, 2021 4:34 AM To: devel@edk2.groups.io; Feng, Bob C ; gaoliming@byo= soft.com.cn; Chen, Christine Subject: [PATCH v2-resend 1/1] BaseTools/Ecc: Make Ecc only check first inc= lude guard From: Pierre Gondois The Ecc tool checks the format of the include guard. This check is currentl= y done on all the names following the '#ifndef' statement. It should only be done on the first include guard. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3252 Signed-off-by: Pierre Gondois Reviewed-by: Liming Gao Reviewed-by: Bob Feng --- The changes can be seen at: https://github.com/PierreARM/edk2/tree/1640_Ecc= _tool_corrections_v2 Notes: v2: - Remove duplicated copyright. - Add Bob Feng's reviewed-by. - Add Liming Gao's reviewed-by (resend). BaseTools/Source/Python/Ecc/Check.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python= /Ecc/Check.py index 7a012617fd35..33060db5f27a 100644 --- a/BaseTools/Source/Python/Ecc/Check.py +++ b/BaseTools/Source/Python/Ecc/Check.py @@ -1437,11 +1437,13 @@ class Check(object): SqlCommand =3D """select ID, Value from %s where Model =3D %s"= "" % (FileTable, MODEL_IDENTIFIER_MACRO_IFNDEF) RecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand) - for Record in RecordSet: - Name =3D Record[1].replace('#ifndef', '').strip() + if RecordSet: + # Only check the first ifndef statement of the file + FirstDefine =3D sorted(RecordSet, key=3Dlambda Record: Rec= ord[0])[0] + Name =3D FirstDefine[1].replace('#ifndef', '').strip() if Name[0] =3D=3D '_' or Name[-1] !=3D '_' or Name[-2] =3D= =3D '_': if not EccGlobalData.gException.IsException(ERROR_NAMI= NG_CONVENTION_CHECK_IFNDEF_STATEMENT, Name): - EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_IFNDEF_STATEMENT, OtherMsg=3D"The #ifndef name [%s] does not= follow the rules" % (Name), BelongsToTable=3DFileTable, BelongsToItem=3DRe= cord[0]) + =20 + EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_IFNDE + F_STATEMENT, OtherMsg=3D"The #ifndef name [%s] does not follow the=20 + rules" % (Name), BelongsToTable=3DFileTable,=20 + BelongsToItem=3DFirstDefine[0]) # Rule for path name, variable name and function name # 1. First character should be upper case -- 2.17.1