Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] crypto: octeontx - simplify get_{eng,ucode}_type_str helpers
@ 2026-07-23 16:33 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-07-23 16:33 UTC (permalink / raw)
  To: Srujana Challa, Bharat Bhushan, Herbert Xu, David S. Miller,
	Thorsten Blum, Kees Cook
  Cc: linux-crypto, linux-kernel

Remove the local variables, add default cases, and return the strings
directly.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 .../crypto/marvell/octeontx/otx_cptpf_ucode.c | 24 +++++++------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
index 417a48f41350..6b74b4737421 100644
--- a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
+++ b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
@@ -103,34 +103,26 @@ static void set_ucode_filename(struct otx_cpt_ucode *ucode,
 
 static char *get_eng_type_str(int eng_type)
 {
-	char *str = "unknown";
-
 	switch (eng_type) {
 	case OTX_CPT_SE_TYPES:
-		str = "SE";
-		break;
-
+		return "SE";
 	case OTX_CPT_AE_TYPES:
-		str = "AE";
-		break;
+		return "AE";
+	default:
+		return "unknown";
 	}
-	return str;
 }
 
 static char *get_ucode_type_str(int ucode_type)
 {
-	char *str = "unknown";
-
 	switch (ucode_type) {
 	case (1 << OTX_CPT_SE_TYPES):
-		str = "SE";
-		break;
-
+		return "SE";
 	case (1 << OTX_CPT_AE_TYPES):
-		str = "AE";
-		break;
+		return "AE";
+	default:
+		return "unknown";
 	}
-	return str;
 }
 
 static int get_ucode_type(struct otx_cpt_ucode_hdr *ucode_hdr, int *ucode_type)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-23 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 16:33 [PATCH] crypto: octeontx - simplify get_{eng,ucode}_type_str helpers Thorsten Blum

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