Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Thorsten Blum and committed by
Herbert Xu
a4559a2b d240b079

+4 -4
+4 -4
drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
··· 10 10 11 11 #include <linux/ctype.h> 12 12 #include <linux/firmware.h> 13 + #include <linux/string.h> 13 14 #include <linux/string_choices.h> 14 15 #include "otx_cpt_common.h" 15 16 #include "otx_cptpf_ucode.h" ··· 510 509 static void print_ucode_info(struct otx_cpt_eng_grp_info *eng_grp, 511 510 char *buf, int size) 512 511 { 513 - if (eng_grp->mirror.is_ena) { 512 + if (eng_grp->mirror.is_ena) 514 513 scnprintf(buf, size, "%s (shared with engine_group%d)", 515 514 eng_grp->g->grp[eng_grp->mirror.idx].ucode[0].ver_str, 516 515 eng_grp->mirror.idx); 517 - } else { 518 - scnprintf(buf, size, "%s", eng_grp->ucode[0].ver_str); 519 - } 516 + else 517 + strscpy(buf, eng_grp->ucode[0].ver_str, size); 520 518 } 521 519 522 520 static void print_engs_info(struct otx_cpt_eng_grp_info *eng_grp,