diff options
author | Min-Hua Chen <minhuadotchen@gmail.com> | 2024-09-18 07:36:50 +0800 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2024-09-25 11:31:09 +0200 |
commit | 8f2f74f2f3ebd9bb7159301cb7560db75d2e801a (patch) | |
tree | 5014ad2768703a83f35c7ae14f0ed590c2c1d12d /drivers | |
parent | 2fae6bb7be320270801b3c3b040189bd7daa8056 (diff) |
xen/pciback: fix cast to restricted pci_ers_result_t and pci_power_t
This patch fix the following sparse warning by applying
__force cast to pci_ers_result_t and pci_power_t.
drivers/xen/xen-pciback/pci_stub.c:760:16: sparse: warning: cast to restricted pci_ers_result_t
drivers/xen/xen-pciback/conf_space_capability.c:125:22: sparse: warning: cast to restricted pci_power_t
No functional changes intended.
Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Message-ID: <20240917233653.61630-1-minhuadotchen@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/xen/xen-pciback/conf_space_capability.c | 2 | ||||
-rw-r--r-- | drivers/xen/xen-pciback/pci_stub.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/xen/xen-pciback/conf_space_capability.c b/drivers/xen/xen-pciback/conf_space_capability.c index 1948a9700c8f..cf568e899ee2 100644 --- a/drivers/xen/xen-pciback/conf_space_capability.c +++ b/drivers/xen/xen-pciback/conf_space_capability.c @@ -122,7 +122,7 @@ static int pm_ctrl_write(struct pci_dev *dev, int offset, u16 new_value, if (err) goto out; - new_state = (pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK); + new_state = (__force pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK); new_value &= PM_OK_BITS; if ((old_value & PM_OK_BITS) != new_value) { diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index d003402ce66b..2f3da5ac62cd 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c @@ -821,7 +821,7 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev, } clear_bit(_PCIB_op_pending, (unsigned long *)&pdev->flags); - res = (pci_ers_result_t)aer_op->err; + res = (__force pci_ers_result_t)aer_op->err; return res; } |