Skip to content

Commit 6bb79f5

Browse files
Wolfram Sangjgross1
authored andcommitted
xen: 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 <wsa+renesas@sang-engineering.com> Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> Link: https://lore.kernel.org/r/20220818210122.7613-1-wsa+renesas@sang-engineering.com Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent ab0af75 commit 6bb79f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/xen/xen-scsiback.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ static void scsiback_do_1lun_hotplug(struct vscsibk_info *info, int op,
11211121
"%s: writing %s", __func__, state);
11221122
return;
11231123
}
1124-
strlcpy(phy, val, VSCSI_NAMELEN);
1124+
strscpy(phy, val, VSCSI_NAMELEN);
11251125
kfree(val);
11261126

11271127
/* virtual SCSI device */

drivers/xen/xenbus/xenbus_probe_frontend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static int frontend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename)
4040
return -EINVAL;
4141
}
4242

43-
strlcpy(bus_id, nodename + 1, XEN_BUS_ID_SIZE);
43+
strscpy(bus_id, nodename + 1, XEN_BUS_ID_SIZE);
4444
if (!strchr(bus_id, '/')) {
4545
pr_warn("bus_id %s no slash\n", bus_id);
4646
return -EINVAL;

0 commit comments

Comments
 (0)