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

[xen staging] xen/pci: address a violation of MISRA C Rule 16.3



commit 7d83c392c7bfecdfcb7a91166cc75edd79e49a05
Author:     Federico Serafini <federico.serafini@xxxxxxxxxxx>
AuthorDate: Tue Oct 8 14:37:16 2024 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Oct 8 14:37:16 2024 +0200

    xen/pci: address a violation of MISRA C Rule 16.3
    
    Refactor the code to avoid an implicit fallthrough and address
    a violation of MISRA C:2012 Rule 16.3: "An unconditional `break'
    statement shall terminate every switch-clause".
    
    No functional change.
    
    Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/drivers/passthrough/pci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 5a446d3dce..74d3895e1e 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -170,8 +170,11 @@ static int __init cf_check parse_phantom_dev(const char 
*str)
     {
     case 1: case 2: case 4:
         if ( *s )
-    default:
             return -EINVAL;
+        break;
+
+    default:
+        return -EINVAL;
     }
 
     phantom_devs[nr_phantom_devs++] = phantom;
--
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®.