Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Min-Hua Chen and committed by
Juergen Gross
8f2f74f2 2fae6bb7

+2 -2
+1 -1
drivers/xen/xen-pciback/conf_space_capability.c
··· 122 122 if (err) 123 123 goto out; 124 124 125 - new_state = (pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK); 125 + new_state = (__force pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK); 126 126 127 127 new_value &= PM_OK_BITS; 128 128 if ((old_value & PM_OK_BITS) != new_value) {
+1 -1
drivers/xen/xen-pciback/pci_stub.c
··· 821 821 } 822 822 clear_bit(_PCIB_op_pending, (unsigned long *)&pdev->flags); 823 823 824 - res = (pci_ers_result_t)aer_op->err; 824 + res = (__force pci_ers_result_t)aer_op->err; 825 825 return res; 826 826 } 827 827