]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools:Change the case rules for ECC check pointer names
authorFan, ZhijuX <zhijux.fan@intel.com>
Fri, 10 Jan 2020 08:37:46 +0000 (16:37 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 13 Jan 2020 02:08:46 +0000 (02:08 +0000)
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2087

In CryptHkdf.c  line 42

  EVP_PKEY_CTX *pHkdfCtx;

Variable pHkdfCtx begins with lower case 'p',
which should be acceptable because it it is a pointer.
(Refer to CCS_2_1_Draft, 4.3.3.3)

So ECC tool should be improved to handle issues like this.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
BaseTools/Source/Python/Ecc/Check.py

index b68cecddfd486a546eee083a550274aaf020624a..0fdc7e35c18a17671d251e4bf55c0db5b02cff65 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define checkpoints used by ECC tool\r
 #\r
-# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>\r
 # SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 from __future__ import absolute_import\r
@@ -1469,13 +1469,14 @@ class Check(object):
             EdkLogger.quiet("Checking naming convention of variable name ...")\r
             Pattern = re.compile(r'^[A-Zgm]+\S*[a-z]\S*$')\r
 \r
-            SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)\r
+            SqlCommand = """select ID, Name, Modifier from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)\r
             RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)\r
             for Record in RecordSet:\r
                 Var = Record[1]\r
+                Modifier = Record[2]\r
                 if Var.startswith('CONST'):\r
                     Var = Var[5:].lstrip()\r
-                if not Pattern.match(Var):\r
+                if not Pattern.match(Var) and not (Modifier.endswith('*') and Var.startswith('p')):\r
                     if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Record[1]):\r
                         EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, OtherMsg="The variable name [%s] does not follow the rules" % (Record[1]), BelongsToTable=FileTable, BelongsToItem=Record[0])\r
 \r