[PATCH 04/18] virpcimock: Drop needless typecast

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

 



When creating a PCI device, the pciDevice structure contains @id
member which holds device address (DDDD.BB:DD.F) and is type of
'char *'. But the structure is initialized from a const char and
in fact we never modify or free the @id.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 tests/virpcimock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index 1c21e4e045..853ac588e9 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -120,7 +120,7 @@ struct pciDriver {
 };
 
 struct pciDevice {
-    char *id;
+    const char *id;
     int vendor;
     int device;
     int klass;
@@ -878,7 +878,7 @@ init_env(void)
 
 # define MAKE_PCI_DEVICE(Id, Vendor, Device, ...) \
     do { \
-        struct pciDevice dev = {.id = (char *)Id, .vendor = Vendor, \
+        struct pciDevice dev = {.id = Id, .vendor = Vendor, \
                                 .device = Device, __VA_ARGS__}; \
         pci_device_new_from_stub(&dev); \
     } while (0)
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



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

  Powered by Linux