[RFC PATCH 2/5] osinfo_loader: avoid multiple calls to OSINFO_ENTITY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Giuseppe Scrivano <gscrivan@xxxxxxxxxx>
---
 osinfo/osinfo_loader.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index aa5e48f..a767bb8 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1657,19 +1657,20 @@ osinfo_loader_process_file_reg_ids(OsinfoLoader *loader,
                                             baseURI, vendor_id, device_id);
 
                 OsinfoDevice *dev = osinfo_loader_get_device(loader, id);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                OsinfoEntity *entity = OSINFO_ENTITY(dev);
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_VENDOR_ID,
                                         vendor_id);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_VENDOR,
                                         vendor);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_PRODUCT_ID,
                                         device_id);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_PRODUCT,
                                         device);
-                osinfo_entity_set_param(OSINFO_ENTITY(dev),
+                osinfo_entity_set_param(entity,
                                         OSINFO_DEVICE_PROP_BUS_TYPE,
                                         busType);
                 g_free(id);
-- 
1.9.3

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux