[Skiboot] [PATCH] edk2-compat-process.c: Remove repetitive debug print statements

Nick Child nnac123 at gmail.com
Thu Apr 15 09:40:33 AEST 2021


Functions `get_esl_cert`, `validate_esl_list` and
`get_esl_signature_list_size` all contain the same debug print
statement. This statement prints the size of the ESL.
`validate_esl_list` calls `get_esl_cert` so the same debug information
prints twice when validating the newly submitted ESL. Additionally,
the same debug prints twice when validating the current ESL since
`get_esl_cert` and `get_esl_signature_list_size` are both called by
the function `verify_signature`. Since `get_esl_cert` is the common
factor, this commit removes the other two print statements (and adds
some information to an error message to maintain clarity, in case
`validate_esl_list` fails before calling `validate_esl_cert`). After
double checking that these functions are not being called anywhere
else, the only real change is to reduce the number of redundant print
statements for the secvar update process.

Signed-off-by: Nick Child <nick.child at ibm.com>
---
 libstb/secvar/backend/edk2-compat-process.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libstb/secvar/backend/edk2-compat-process.c b/libstb/secvar/backend/edk2-compat-process.c
index dfaec137..244f2340 100644
--- a/libstb/secvar/backend/edk2-compat-process.c
+++ b/libstb/secvar/backend/edk2-compat-process.c
@@ -105,9 +105,6 @@ static int32_t get_esl_signature_list_size(const char *buf, const size_t buflen)
 	if (!list)
 		return OPAL_PARAMETER;
 
-	prlog(PR_DEBUG, "size of signature list size is %u\n",
-			le32_to_cpu(list->SignatureListSize));
-
 	return le32_to_cpu(list->SignatureListSize);
 }
 
@@ -275,15 +272,13 @@ int validate_esl_list(const char *key, const char *esl, const size_t size)
 		if (!list)
 			return OPAL_PARAMETER;
 
-		prlog(PR_DEBUG, "size of signature list size is %u\n",
-				le32_to_cpu(list->SignatureListSize));
-
 		/* Calculate the size of the ESL */
 		eslsize = le32_to_cpu(list->SignatureListSize);
 
 		/* If could not extract the size */
 		if (eslsize <= 0) {
-			prlog(PR_ERR, "Invalid size of the ESL\n");
+			prlog(PR_ERR, "Invalid size of the ESL: %u\n",
+					le32_to_cpu(list->SignatureListSize));
 			rc = OPAL_PARAMETER;
 			break;
 		}
-- 
2.17.1



More information about the Skiboot mailing list