From: Michal Privoznik Date: Tue, 13 Aug 2019 09:03:05 +0000 (+0200) Subject: virpcimock: Drop needless typecast X-Git-Tag: v5.7.0-rc1~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caf6cc4fd259487362f3bd4abb2f52673603da2f;p=thirdparty%2Flibvirt.git virpcimock: Drop needless typecast 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 Tested-by: Daniel Henrique Barboza Reviewed-by: Daniel Henrique Barboza --- diff --git a/tests/virpcimock.c b/tests/virpcimock.c index c9f704f2c7..3577d1bd41 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -121,7 +121,7 @@ struct pciDriver { }; struct pciDevice { - char *id; + const char *id; int vendor; int device; int klass; @@ -880,7 +880,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)