From 83f11e115207fecd03b1ac5fe57b614ef9e09d6c Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Thu, 23 Jul 2026 18:33:25 +0200 Subject: [PATCH] crypto: octeontx - simplify get_{eng,ucode}_type_str helpers Remove the local variables, add default cases, and return the strings directly. Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu --- .../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 58dd996c7f3a..c66cd322994f 100644 --- a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c +++ b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c @@ -104,34 +104,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)