summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2026-02-02 20:33:21 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2026-02-28 06:53:58 +0300
commita4559a2b37ebbbd3c23041125624f55ef36905d1 (patch)
treedcce9a0c3b3bc1b8987b51a408f8667258c17a96
parentd240b079a37e90af03fd7dfec94930eb6c83936e (diff)
downloadlinux-a4559a2b37ebbbd3c23041125624f55ef36905d1.tar.xz
crypto: octeontx - Replace scnprintf with strscpy in print_ucode_info
Replace scnprintf("%s", ...) with the faster and more direct strscpy(). Remove the parentheses while we're at it. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
index 09e6a8474d1a..e0f38d32bc93 100644
--- a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
+++ b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
@@ -10,6 +10,7 @@
#include <linux/ctype.h>
#include <linux/firmware.h>
+#include <linux/string.h>
#include <linux/string_choices.h>
#include "otx_cpt_common.h"
#include "otx_cptpf_ucode.h"
@@ -509,13 +510,12 @@ EXPORT_SYMBOL_GPL(otx_cpt_uc_supports_eng_type);
static void print_ucode_info(struct otx_cpt_eng_grp_info *eng_grp,
char *buf, int size)
{
- if (eng_grp->mirror.is_ena) {
+ if (eng_grp->mirror.is_ena)
scnprintf(buf, size, "%s (shared with engine_group%d)",
eng_grp->g->grp[eng_grp->mirror.idx].ucode[0].ver_str,
eng_grp->mirror.idx);
- } else {
- scnprintf(buf, size, "%s", eng_grp->ucode[0].ver_str);
- }
+ else
+ strscpy(buf, eng_grp->ucode[0].ver_str, size);
}
static void print_engs_info(struct otx_cpt_eng_grp_info *eng_grp,