Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
tools/lguest: Fix redefinition of struct virtio_pci_cfg_cap
Browse files Browse the repository at this point in the history
Ours uses a u32 for the data, since we ensure it's always
aligned and it's x86 so it doesn't matter anyway.

  lguest.c:128:8: error: redefinition of ‘struct virtio_pci_cfg_cap’

Signed-off-by: Rusty Russell <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Michael S. Tsirkin <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Fixes: 3121bb0 ("virtio: define virtio_pci_cfg_cap in header.")
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
rustyrussell authored and Ingo Molnar committed Aug 26, 2015
1 parent a782a7e commit e523caa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ struct device_list {
/* The list of Guest devices, based on command line arguments. */
static struct device_list devices;

struct virtio_pci_cfg_cap {
/*
* Just like struct virtio_pci_cfg_cap in uapi/linux/virtio_pci.h,
* but uses a u32 explicitly for the data.
*/
struct virtio_pci_cfg_cap_u32 {
struct virtio_pci_cap cap;
u32 pci_cfg_data; /* Data for BAR access. */
};
Expand Down Expand Up @@ -157,7 +161,7 @@ struct pci_config {
struct virtio_pci_notify_cap notify;
struct virtio_pci_cap isr;
struct virtio_pci_cap device;
struct virtio_pci_cfg_cap cfg_access;
struct virtio_pci_cfg_cap_u32 cfg_access;
};

/* The device structure describes a single device. */
Expand Down Expand Up @@ -1291,7 +1295,7 @@ static struct device *dev_and_reg(u32 *reg)
* only fault if they try to write with some invalid bar/offset/length.
*/
static bool valid_bar_access(struct device *d,
struct virtio_pci_cfg_cap *cfg_access)
struct virtio_pci_cfg_cap_u32 *cfg_access)
{
/* We only have 1 bar (BAR0) */
if (cfg_access->cap.bar != 0)
Expand Down

0 comments on commit e523caa

Please sign in to comment.