[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] PCI/physdev: address Misra 2.1 rule violation



commit 2b434157fb69ed6fb617af763e0d89718461c5c8
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Sep 1 10:00:48 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Sep 1 10:00:48 2026 +0200

    PCI/physdev: address Misra 2.1 rule violation
    
    Cases 0..3 are handled, and a 2-bit mask is applied to the switch()
    expression. Therefore the default: case is reported unreachable by Eclair.
    Insert BUILD_ERROR() to annotate this for Eclair.
    
    No functional change.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/drivers/pci/physdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/pci/physdev.c b/xen/drivers/pci/physdev.c
index d46501b884..5695c300f7 100644
--- a/xen/drivers/pci/physdev.c
+++ b/xen/drivers/pci/physdev.c
@@ -114,7 +114,7 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
arg)
             break;
 
         default:
-            ret = -EINVAL;
+            BUILD_ERROR("PCI_DEVICE_RESET_* inconsistency");
             break;
         }
         write_unlock(&pdev->domain->pci_lock);
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.