mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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 <mprivozn@redhat.com> Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
84f9358b18
commit
caf6cc4fd2
@ -121,7 +121,7 @@ struct pciDriver {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct pciDevice {
|
struct pciDevice {
|
||||||
char *id;
|
const char *id;
|
||||||
int vendor;
|
int vendor;
|
||||||
int device;
|
int device;
|
||||||
int klass;
|
int klass;
|
||||||
@ -880,7 +880,7 @@ init_env(void)
|
|||||||
|
|
||||||
# define MAKE_PCI_DEVICE(Id, Vendor, Device, ...) \
|
# define MAKE_PCI_DEVICE(Id, Vendor, Device, ...) \
|
||||||
do { \
|
do { \
|
||||||
struct pciDevice dev = {.id = (char *)Id, .vendor = Vendor, \
|
struct pciDevice dev = {.id = Id, .vendor = Vendor, \
|
||||||
.device = Device, __VA_ARGS__}; \
|
.device = Device, __VA_ARGS__}; \
|
||||||
pci_device_new_from_stub(&dev); \
|
pci_device_new_from_stub(&dev); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
Loading…
Reference in New Issue
Block a user