From nobody Wed Feb 11 08:40:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1490792437785690.6260763796331; Wed, 29 Mar 2017 06:00:37 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD5937572E; Wed, 29 Mar 2017 13:00:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88CB083863; Wed, 29 Mar 2017 13:00:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E123718523CA; Wed, 29 Mar 2017 13:00:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2TCpXqR010081 for ; Wed, 29 Mar 2017 08:51:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8522A962B7; Wed, 29 Mar 2017 12:51:33 +0000 (UTC) Received: from beluga.usersys.redhat.com (dhcp129-94.brq.redhat.com [10.34.129.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id D95D7173A8; Wed, 29 Mar 2017 12:51:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BD5937572E Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BD5937572E From: Erik Skultety To: libvir-list@redhat.com Date: Wed, 29 Mar 2017 14:51:14 +0200 Message-Id: <662ea539806f1d45010e770798541fb691eba678.1490791809.git.eskultet@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [RFC PATCH 04/11] nodedev: udevProcessPCI: Drop syspath variable X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 29 Mar 2017 13:00:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since we have that information provided by @def which is not a private object, there is really no need for the variable. Signed-off-by: Erik Skultety --- src/node_device/node_device_udev.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 976ccad710..36ed92f712 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -328,7 +328,6 @@ static int udevProcessPCI(struct udev_device *device, virNodeDeviceDefPtr def) { - const char *syspath =3D NULL; virNodeDevCapPCIDevPtr pci_dev =3D &def->caps->data.pci_dev; virPCIEDeviceInfoPtr pci_express =3D NULL; virPCIDevicePtr pciDev =3D NULL; @@ -336,19 +335,17 @@ udevProcessPCI(struct udev_device *device, int ret =3D -1; char *p; =20 - syspath =3D udev_device_get_syspath(device); - if (udevGetUintProperty(device, "PCI_CLASS", &pci_dev->class, 16) < 0) goto cleanup; =20 - if ((p =3D strrchr(syspath, '/')) =3D=3D NULL || + if ((p =3D strrchr(def->sysfs_path, '/')) =3D=3D NULL || virStrToLong_ui(p + 1, &p, 16, &pci_dev->domain) < 0 || p =3D=3D N= ULL || virStrToLong_ui(p + 1, &p, 16, &pci_dev->bus) < 0 || p =3D=3D NULL= || virStrToLong_ui(p + 1, &p, 16, &pci_dev->slot) < 0 || p =3D=3D NUL= L || virStrToLong_ui(p + 1, &p, 16, &pci_dev->function) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("failed to parse the PCI address from sysfs path:= '%s'"), - syspath); + def->sysfs_path); goto cleanup; } =20 @@ -375,8 +372,7 @@ udevProcessPCI(struct udev_device *device, &pci_dev->numa_node, 10) < 0) goto cleanup; =20 - if (nodeDeviceSysfsGetPCIRelatedDevCaps(syspath, - &def->caps->data.pci_dev) < 0) + if (nodeDeviceSysfsGetPCIRelatedDevCaps(def->sysfs_path, pci_dev) < 0) goto cleanup; =20 if (!(pciDev =3D virPCIDeviceNew(pci_dev->domain, --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list