]> Git Repo - linux.git/commitdiff
xen/pciback: fix cast to restricted pci_ers_result_t and pci_power_t
authorMin-Hua Chen <[email protected]>
Tue, 17 Sep 2024 23:36:50 +0000 (07:36 +0800)
committerJuergen Gross <[email protected]>
Wed, 25 Sep 2024 09:31:09 +0000 (11:31 +0200)
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 <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Message-ID: <20240917233653[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
drivers/xen/xen-pciback/conf_space_capability.c
drivers/xen/xen-pciback/pci_stub.c

index 1948a9700c8fa6fb3bcfee4a2012f2765e41f9a3..cf568e899ee23b222d64f1177497254fa5850e5c 100644 (file)
@@ -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) {
index d003402ce66b4237526fdbba62a7cf53b63e22c3..2f3da5ac62cd888b60b1b5423f121196aa953d5a 100644 (file)
@@ -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;
 }
 
This page took 0.083091 seconds and 4 git commands to generate.