diff options
author | Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | 2020-03-20 04:09:18 +0100 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2020-03-30 17:31:57 +0200 |
commit | 69086bd698574501a59073b07b629f2a00b82552 (patch) | |
tree | 89314189ab000e3192b1c12893bacd7f3a95ed1e /drivers/xen/xen-pciback/conf_space.c | |
parent | xen/xenbus: remove unused xenbus_map_ring() (diff) | |
download | wireguard-linux-69086bd698574501a59073b07b629f2a00b82552.tar.xz wireguard-linux-69086bd698574501a59073b07b629f2a00b82552.zip |
xen-pciback: fix INTERRUPT_TYPE_* defines
xen_pcibk_get_interrupt_type() assumes INTERRUPT_TYPE_NONE being 0
(initialize ret to 0 and return as INTERRUPT_TYPE_NONE).
Fix the definition to make INTERRUPT_TYPE_NONE really 0, and also shift
other values to not leave holes.
But also, do not assume INTERRUPT_TYPE_NONE being 0 anymore to avoid
similar confusions in the future.
Fixes: 476878e4b2be ("xen-pciback: optionally allow interrupt enable flag writes")
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/xen/xen-pciback/conf_space.c')
-rw-r--r-- | drivers/xen/xen-pciback/conf_space.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c index b20e43e148ce..da51a5d34e6e 100644 --- a/drivers/xen/xen-pciback/conf_space.c +++ b/drivers/xen/xen-pciback/conf_space.c @@ -320,7 +320,7 @@ int xen_pcibk_get_interrupt_type(struct pci_dev *dev) if (val & PCI_MSIX_FLAGS_ENABLE) ret |= INTERRUPT_TYPE_MSIX; } - return ret; + return ret ?: INTERRUPT_TYPE_NONE; } void xen_pcibk_config_free_dyn_fields(struct pci_dev *dev) |