Skip to content

Commit e7ae507

Browse files
committed
s390: Remove optional third argument of strscpy() if possible
The third argument of strscpy() is optional and can be left away iff the destination is an array and the maximum size of the copy is the size of destination. Remove the third argument for those cases where this is possible. Acked-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 2eba6f9 commit e7ae507

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

arch/s390/kernel/cert_store.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void cert_store_key_describe(const struct key *key, struct seq_file *m)
138138
* First 64 bytes of the key description is key name in EBCDIC CP 500.
139139
* Convert it to ASCII for displaying in /proc/keys.
140140
*/
141-
strscpy(ascii, key->description, sizeof(ascii));
141+
strscpy(ascii, key->description);
142142
EBCASC_500(ascii, VC_NAME_LEN_BYTES);
143143
seq_puts(m, ascii);
144144

arch/s390/kernel/debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static debug_info_t *debug_info_alloc(const char *name, int pages_per_area,
251251
rc->level = level;
252252
rc->buf_size = buf_size;
253253
rc->entry_size = sizeof(debug_entry_t) + buf_size;
254-
strscpy(rc->name, name, sizeof(rc->name));
254+
strscpy(rc->name, name);
255255
memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *));
256256
memset(rc->debugfs_entries, 0, DEBUG_MAX_VIEWS * sizeof(struct dentry *));
257257
refcount_set(&(rc->ref_count), 0);

arch/s390/kernel/ipl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \
270270
{ \
271271
if (len >= sizeof(_value)) \
272272
return -E2BIG; \
273-
len = strscpy(_value, buf, sizeof(_value)); \
273+
len = strscpy(_value, buf); \
274274
if ((ssize_t)len < 0) \
275275
return len; \
276276
strim(_value); \

drivers/s390/char/diag_ftp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ ssize_t diag_ftp_cmd(const struct hmcdrv_ftp_cmdspec *ftp, size_t *fsize)
159159
goto out;
160160
}
161161

162-
len = strscpy(ldfpl->fident, ftp->fname, sizeof(ldfpl->fident));
162+
len = strscpy(ldfpl->fident, ftp->fname);
163163
if (len < 0) {
164164
len = -EINVAL;
165165
goto out_free;

0 commit comments

Comments
 (0)