public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] certs/extract-cert: Fix checkpatch issues
@ 2023-06-01 19:05 Franziska Naepelt
  2023-06-02  2:27 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Franziska Naepelt @ 2023-06-01 19:05 UTC (permalink / raw)
  To: keyrings; +Cc: dhowells, dwmw2, linux-kernel, Franziska Naepelt

The following issues are fixed:
- WARNING: Missing or malformed SPDX-License-Identifier tag
- WARNING: Prefer __noreturn over __attribute__((noreturn))
- ERROR: trailing statements should be on next line
- WARNING: braces {} are not necessary for single statement blocks
- ERROR: space required before the open parenthesis '('
- ERROR: code indent should use tabs where possible
- WARNING: please, no spaces at the start of a line
- WARNING: Missing a blank line after declarations

Signed-off-by: Franziska Naepelt <franziska.naepelt@gmail.com>
---
 certs/extract-cert.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/certs/extract-cert.c b/certs/extract-cert.c
index 70e9ec89d87d..dd76fb0f7f8d 100644
--- a/certs/extract-cert.c
+++ b/certs/extract-cert.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: LGPL-2.1
 /* Extract X.509 certificate in DER form from PKCS#11 or PEM.
  *
  * Copyright © 2014-2015 Red Hat, Inc. All Rights Reserved.
@@ -32,7 +33,7 @@

 #define PKEY_ID_PKCS7 2

-static __attribute__((noreturn))
+static __noreturn
 void format(void)
 {
 	fprintf(stderr,
@@ -63,7 +64,8 @@ static void drain_openssl_errors(void)

 	if (ERR_peek_error() == 0)
 		return;
-	while (ERR_get_error_line(&file, &line)) {}
+	while (ERR_get_error_line(&file, &line))
+		;
 }

 #define ERR(cond, fmt, ...)				\
@@ -73,7 +75,7 @@ static void drain_openssl_errors(void)
 		if (__cond) {				\
 			err(1, fmt, ## __VA_ARGS__);	\
 		}					\
-	} while(0)
+	} while (0)

 static const char *key_pass;
 static BIO *wb;
@@ -107,7 +109,7 @@ int main(int argc, char **argv)
 	if (verbose_env && strchr(verbose_env, '1'))
 		verbose = true;

-        key_pass = getenv("KBUILD_SIGN_PIN");
+	key_pass = getenv("KBUILD_SIGN_PIN");

 	if (argc != 3)
 		format();
@@ -118,6 +120,7 @@ int main(int argc, char **argv)
 	if (!cert_src[0]) {
 		/* Invoked with no input; create empty file */
 		FILE *f = fopen(cert_dst, "wb");
+
 		ERR(!f, "%s", cert_dst);
 		fclose(f);
 		exit(0);
@@ -155,6 +158,7 @@ int main(int argc, char **argv)
 			x509 = PEM_read_bio_X509(b, NULL, NULL, NULL);
 			if (wb && !x509) {
 				unsigned long err = ERR_peek_last_error();
+
 				if (ERR_GET_LIB(err) == ERR_LIB_PEM &&
 				    ERR_GET_REASON(err) == PEM_R_NO_START_LINE) {
 					ERR_clear_error();

base-commit: 7877cb91f1081754a1487c144d85dc0d2e2e7fc4
--
2.39.2 (Apple Git-143)


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-06-09 15:44 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-01 19:05 [PATCH] certs/extract-cert: Fix checkpatch issues Franziska Naepelt
2023-06-02  2:27 ` kernel test robot
2023-06-02  3:09 ` kernel test robot
2023-06-02  8:59 ` [PATCH v2] " Franziska Naepelt
2023-06-06 12:28   ` Bagas Sanjaya
2023-06-06 13:38     ` Dan Carpenter
2023-06-06 14:51       ` Jarkko Sakkinen
2023-06-06 15:25         ` Dan Carpenter
2023-06-06 16:03           ` Jarkko Sakkinen
2023-06-06 17:59             ` Franziska Näpelt
2023-06-06 18:29               ` Dan Carpenter
2023-06-06 21:43           ` Ben Boeckel
2023-06-07 16:11             ` Jarkko Sakkinen
2023-06-09 14:01         ` Dan Carpenter
2023-06-09 15:37           ` Jarkko Sakkinen
2023-06-09 15:43             ` Jarkko Sakkinen
2023-06-06 12:38   ` Jarkko Sakkinen
2023-06-06 12:44     ` Jarkko Sakkinen
2023-06-06 12:47       ` Jarkko Sakkinen
2023-06-06 14:44     ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox