mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
crypto: octeontx - use 2-arg strscpy where destination size is known
To simplify the code, drop explicit and hard-coded size arguments from strscpy() where the destination buffer has a fixed size and strscpy() can automatically determine it using sizeof(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
4525ac1411
commit
91181aa5c2
|
|
@ -99,7 +99,7 @@ static int dev_supports_eng_type(struct otx_cpt_eng_grps *eng_grps,
|
|||
static void set_ucode_filename(struct otx_cpt_ucode *ucode,
|
||||
const char *filename)
|
||||
{
|
||||
strscpy(ucode->filename, filename, OTX_CPT_UCODE_NAME_LENGTH);
|
||||
strscpy(ucode->filename, filename);
|
||||
}
|
||||
|
||||
static char *get_eng_type_str(int eng_type)
|
||||
|
|
@ -140,7 +140,7 @@ static int get_ucode_type(struct otx_cpt_ucode_hdr *ucode_hdr, int *ucode_type)
|
|||
u32 i, val = 0;
|
||||
u8 nn;
|
||||
|
||||
strscpy(tmp_ver_str, ucode_hdr->ver_str, OTX_CPT_UCODE_VER_STR_SZ);
|
||||
strscpy(tmp_ver_str, ucode_hdr->ver_str);
|
||||
for (i = 0; i < strlen(tmp_ver_str); i++)
|
||||
tmp_ver_str[i] = tolower(tmp_ver_str[i]);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ static int is_2nd_ucode_used(struct otx2_cpt_eng_grp_info *eng_grp)
|
|||
static void set_ucode_filename(struct otx2_cpt_ucode *ucode,
|
||||
const char *filename)
|
||||
{
|
||||
strscpy(ucode->filename, filename, OTX2_CPT_NAME_LENGTH);
|
||||
strscpy(ucode->filename, filename);
|
||||
}
|
||||
|
||||
static char *get_eng_type_str(int eng_type)
|
||||
|
|
@ -130,7 +130,7 @@ static int get_ucode_type(struct device *dev,
|
|||
int i, val = 0;
|
||||
u8 nn;
|
||||
|
||||
strscpy(tmp_ver_str, ucode_hdr->ver_str, OTX2_CPT_UCODE_VER_STR_SZ);
|
||||
strscpy(tmp_ver_str, ucode_hdr->ver_str);
|
||||
for (i = 0; i < strlen(tmp_ver_str); i++)
|
||||
tmp_ver_str[i] = tolower(tmp_ver_str[i]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user