* [PATCH] xen/pciback: fix cast to restricted pci_ers_result_t and pci_power_t
@ 2024-09-17 23:36 Min-Hua Chen
2024-09-25 9:03 ` Jürgen Groß
0 siblings, 1 reply; 2+ messages in thread
From: Min-Hua Chen @ 2024-09-17 23:36 UTC (permalink / raw)
To: Juergen Gross, Stefano Stabellini, Oleksandr Tyshchenko
Cc: Min-Hua Chen, xen-devel, linux-kernel
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>
---
drivers/xen/xen-pciback/conf_space_capability.c | 2 +-
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 4faebbb84999..368738312696 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -757,7 +757,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;
}
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] xen/pciback: fix cast to restricted pci_ers_result_t and pci_power_t
2024-09-17 23:36 [PATCH] xen/pciback: fix cast to restricted pci_ers_result_t and pci_power_t Min-Hua Chen
@ 2024-09-25 9:03 ` Jürgen Groß
0 siblings, 0 replies; 2+ messages in thread
From: Jürgen Groß @ 2024-09-25 9:03 UTC (permalink / raw)
To: Min-Hua Chen, Stefano Stabellini, Oleksandr Tyshchenko
Cc: xen-devel, linux-kernel
[-- Attachment #1.1.1: Type: text/plain, Size: 525 bytes --]
On 18.09.24 01:36, Min-Hua Chen wrote:
> 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>
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-25 9:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-17 23:36 [PATCH] xen/pciback: fix cast to restricted pci_ers_result_t and pci_power_t Min-Hua Chen
2024-09-25 9:03 ` Jürgen Groß
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®