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

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 <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

+4 -4
+1 -1
arch/s390/kernel/cert_store.c
··· 138 138 * First 64 bytes of the key description is key name in EBCDIC CP 500. 139 139 * Convert it to ASCII for displaying in /proc/keys. 140 140 */ 141 - strscpy(ascii, key->description, sizeof(ascii)); 141 + strscpy(ascii, key->description); 142 142 EBCASC_500(ascii, VC_NAME_LEN_BYTES); 143 143 seq_puts(m, ascii); 144 144
+1 -1
arch/s390/kernel/debug.c
··· 251 251 rc->level = level; 252 252 rc->buf_size = buf_size; 253 253 rc->entry_size = sizeof(debug_entry_t) + buf_size; 254 - strscpy(rc->name, name, sizeof(rc->name)); 254 + strscpy(rc->name, name); 255 255 memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *)); 256 256 memset(rc->debugfs_entries, 0, DEBUG_MAX_VIEWS * sizeof(struct dentry *)); 257 257 refcount_set(&(rc->ref_count), 0);
+1 -1
arch/s390/kernel/ipl.c
··· 270 270 { \ 271 271 if (len >= sizeof(_value)) \ 272 272 return -E2BIG; \ 273 - len = strscpy(_value, buf, sizeof(_value)); \ 273 + len = strscpy(_value, buf); \ 274 274 if ((ssize_t)len < 0) \ 275 275 return len; \ 276 276 strim(_value); \
+1 -1
drivers/s390/char/diag_ftp.c
··· 159 159 goto out; 160 160 } 161 161 162 - len = strscpy(ldfpl->fident, ftp->fname, sizeof(ldfpl->fident)); 162 + len = strscpy(ldfpl->fident, ftp->fname); 163 163 if (len < 0) { 164 164 len = -EINVAL; 165 165 goto out_free;