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

[xen master] xen/ns16550: address violations of MISRA C:2012 Rule 13.1



commit 38ae4739d87c1025ad5d3b9282048b5311b8ef38
Author:     Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
AuthorDate: Wed Feb 7 13:47:32 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Feb 7 13:47:32 2024 +0100

    xen/ns16550: address violations of MISRA C:2012 Rule 13.1
    
    Rule 13.1: Initializer lists shall not contain persistent side effects
    
    The assignment operation in:
    
    .irq = rc = uart->irq,
    
    is a persistent side effect in a struct initializer list.
    
    This patch assigns rc separately outside the structure.
    
    No functional change.
    
    Signed-off-by: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
    Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@xxxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/drivers/char/ns16550.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index afe3d514b9..97bf098534 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -441,10 +441,12 @@ static void __init cf_check ns16550_init_postirq(struct 
serial_port *port)
             struct msi_info msi = {
                 .sbdf = PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1],
                                  uart->ps_bdf[2]),
-                .irq = rc = uart->irq,
+                .irq = uart->irq,
                 .entry_nr = 1
             };
 
+            rc = uart->irq;
+
             if ( rc > 0 )
             {
                 struct msi_desc *msi_desc = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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