summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Ecc
diff options
context:
space:
mode:
authorFan, ZhijuX <zhijux.fan@intel.com>2020-01-10 16:37:46 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-01-13 02:08:46 +0000
commit072b9c28393d191733187e701307cdab166a4c4d (patch)
tree58d77dfd16ece837a101c7410f3120d4959b6298 /BaseTools/Source/Python/Ecc
parent27f44ea1fb72beffbef0ef851d361a7550189d1b (diff)
downloadedk2-072b9c28393d191733187e701307cdab166a4c4d.tar.gz
edk2-072b9c28393d191733187e701307cdab166a4c4d.tar.bz2
edk2-072b9c28393d191733187e701307cdab166a4c4d.zip
BaseTools:Change the case rules for ECC check pointer names
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>
Diffstat (limited to 'BaseTools/Source/Python/Ecc')
-rw-r--r--BaseTools/Source/Python/Ecc/Check.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python/Ecc/Check.py
index b68cecddfd..0fdc7e35c1 100644
--- a/BaseTools/Source/Python/Ecc/Check.py
+++ b/BaseTools/Source/Python/Ecc/Check.py
@@ -1,7 +1,7 @@
## @file
# This file is used to define checkpoints used by ECC tool
#
-# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
from __future__ import absolute_import
@@ -1469,13 +1469,14 @@ class Check(object):
EdkLogger.quiet("Checking naming convention of variable name ...")
Pattern = re.compile(r'^[A-Zgm]+\S*[a-z]\S*$')
- SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)
+ SqlCommand = """select ID, Name, Modifier from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
for Record in RecordSet:
Var = Record[1]
+ Modifier = Record[2]
if Var.startswith('CONST'):
Var = Var[5:].lstrip()
- if not Pattern.match(Var):
+ if not Pattern.match(Var) and not (Modifier.endswith('*') and Var.startswith('p')):
if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Record[1]):
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])