mirror of https://gitee.com/openkylin/qemu.git
pci: Add missing 'const' in argument to pci_get_xxx
pci_get_byte, pci_get_word, pci_get_long and pci_get_quad all take a const uint8_t pointer, because they only read the configuration data. Their prototypes should reflect this fact. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
938a632402
commit
cb95c2e44e
14
hw/pci.h
14
hw/pci.h
|
@ -246,7 +246,7 @@ pci_set_byte(uint8_t *config, uint8_t val)
|
|||
}
|
||||
|
||||
static inline uint8_t
|
||||
pci_get_byte(uint8_t *config)
|
||||
pci_get_byte(const uint8_t *config)
|
||||
{
|
||||
return *config;
|
||||
}
|
||||
|
@ -258,9 +258,9 @@ pci_set_word(uint8_t *config, uint16_t val)
|
|||
}
|
||||
|
||||
static inline uint16_t
|
||||
pci_get_word(uint8_t *config)
|
||||
pci_get_word(const uint8_t *config)
|
||||
{
|
||||
return le16_to_cpupu((uint16_t *)config);
|
||||
return le16_to_cpupu((const uint16_t *)config);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -270,9 +270,9 @@ pci_set_long(uint8_t *config, uint32_t val)
|
|||
}
|
||||
|
||||
static inline uint32_t
|
||||
pci_get_long(uint8_t *config)
|
||||
pci_get_long(const uint8_t *config)
|
||||
{
|
||||
return le32_to_cpupu((uint32_t *)config);
|
||||
return le32_to_cpupu((const uint32_t *)config);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -282,9 +282,9 @@ pci_set_quad(uint8_t *config, uint64_t val)
|
|||
}
|
||||
|
||||
static inline uint64_t
|
||||
pci_get_quad(uint8_t *config)
|
||||
pci_get_quad(const uint8_t *config)
|
||||
{
|
||||
return le64_to_cpup((uint64_t *)config);
|
||||
return le64_to_cpup((const uint64_t *)config);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
Loading…
Reference in New Issue