1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-04-01 20:05:19 +00:00

node_device: udevTranslatePCIIds() to void

udevTranslatePCIIds() return value is invariant, so change it
type and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Artem Chernyshev 2024-01-04 03:17:02 +03:00 committed by Michal Privoznik
parent d05cdd1879
commit 0e37f55bb1

View File

@ -332,7 +332,7 @@ udevGenerateDeviceName(struct udev_device *device,
static virMutex pciaccessMutex = VIR_MUTEX_INITIALIZER;
static int
static void
udevTranslatePCIIds(unsigned int vendor,
unsigned int product,
char **vendor_string,
@ -356,8 +356,6 @@ udevTranslatePCIIds(unsigned int vendor,
*vendor_string = g_strdup(vendor_name);
*product_string = g_strdup(device_name);
return 0;
}
@ -398,12 +396,10 @@ udevProcessPCI(struct udev_device *device,
if (udevGetUintSysfsAttr(device, "device", &pci_dev->product, 16) < 0)
goto cleanup;
if (udevTranslatePCIIds(pci_dev->vendor,
pci_dev->product,
&pci_dev->vendor_name,
&pci_dev->product_name) != 0) {
goto cleanup;
}
udevTranslatePCIIds(pci_dev->vendor,
pci_dev->product,
&pci_dev->vendor_name,
&pci_dev->product_name);
udevGenerateDeviceName(device, def, NULL);