Skip to content

Commit e6e4d33

Browse files
Wolfram Sangrichardweinberger
authored andcommitted
um: move from strlcpy with unused retval to strscpy
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 0d644e9 commit e6e4d33

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

arch/um/drivers/net_kern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static void uml_net_poll_controller(struct net_device *dev)
265265
static void uml_net_get_drvinfo(struct net_device *dev,
266266
struct ethtool_drvinfo *info)
267267
{
268-
strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
268+
strscpy(info->driver, DRIVER_NAME, sizeof(info->driver));
269269
}
270270

271271
static const struct ethtool_ops uml_net_ethtool_ops = {

arch/um/drivers/vector_kern.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ static void vector_net_poll_controller(struct net_device *dev)
13721372
static void vector_net_get_drvinfo(struct net_device *dev,
13731373
struct ethtool_drvinfo *info)
13741374
{
1375-
strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
1375+
strscpy(info->driver, DRIVER_NAME, sizeof(info->driver));
13761376
}
13771377

13781378
static int vector_net_load_bpf_flash(struct net_device *dev,

arch/um/kernel/um_arch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ void __init setup_arch(char **cmdline_p)
416416
read_initrd();
417417

418418
paging_init();
419-
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
419+
strscpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
420420
*cmdline_p = command_line;
421421
setup_hostinfo(host_info, sizeof host_info);
422422

0 commit comments

Comments
 (0)