mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
udevProcessSCSIHost: use STRSKIP
Instead of separating it into STRPEFIX and str + strlen.
This commit is contained in:
parent
170c68c4a8
commit
3775a2e174
@ -712,16 +712,17 @@ static int udevProcessSCSIHost(struct udev_device *device ATTRIBUTE_UNUSED,
|
||||
int ret = -1;
|
||||
virNodeDevCapDataPtr data = &def->caps->data;
|
||||
char *filename = NULL;
|
||||
char *str;
|
||||
|
||||
filename = last_component(def->sysfs_path);
|
||||
|
||||
if (!STRPREFIX(filename, "host")) {
|
||||
if (!(str = STRSKIP(filename, "host"))) {
|
||||
VIR_ERROR(_("SCSI host found, but its udev name '%s' does "
|
||||
"not begin with 'host'"), filename);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (udevStrToLong_ui(filename + strlen("host"),
|
||||
if (udevStrToLong_ui(str,
|
||||
NULL,
|
||||
0,
|
||||
&data->scsi_host.host) == -1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user