mirror of
https://github.com/torvalds/linux
synced 2024-09-20 11:07:02 +00:00
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>
This commit is contained in:
parent
ab0af755d4
commit
6bb79f5b4c
|
@ -1121,7 +1121,7 @@ static void scsiback_do_1lun_hotplug(struct vscsibk_info *info, int op,
|
||||||
"%s: writing %s", __func__, state);
|
"%s: writing %s", __func__, state);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
strlcpy(phy, val, VSCSI_NAMELEN);
|
strscpy(phy, val, VSCSI_NAMELEN);
|
||||||
kfree(val);
|
kfree(val);
|
||||||
|
|
||||||
/* virtual SCSI device */
|
/* virtual SCSI device */
|
||||||
|
|
|
@ -40,7 +40,7 @@ static int frontend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(bus_id, nodename + 1, XEN_BUS_ID_SIZE);
|
strscpy(bus_id, nodename + 1, XEN_BUS_ID_SIZE);
|
||||||
if (!strchr(bus_id, '/')) {
|
if (!strchr(bus_id, '/')) {
|
||||||
pr_warn("bus_id %s no slash\n", bus_id);
|
pr_warn("bus_id %s no slash\n", bus_id);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Reference in a new issue