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

[xen staging] xen/char: mvebu-uart: Fix MISRA C 2012 Rule 20.7 violation



commit 1f7543c039f6b9eb182f0395965b9d414ac774c4
Author:     Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
AuthorDate: Wed Aug 3 10:09:58 2022 +0300
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Thu Aug 4 14:38:09 2022 -0700

    xen/char: mvebu-uart: Fix MISRA C 2012 Rule 20.7 violation
    
    The macro parameters 'off' and 'uart' are used as expressions and it is
    good to be enclosed in parentheses to prevent against unintended expansion.
    
    For the 'uart' case, in mvebu3700_write(), correct the second parentheses
    that seems to have been accidently misplaced.
    
    Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/drivers/char/mvebu-uart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/mvebu-uart.c b/xen/drivers/char/mvebu-uart.c
index 835d1ace3c..a00618b96f 100644
--- a/xen/drivers/char/mvebu-uart.c
+++ b/xen/drivers/char/mvebu-uart.c
@@ -64,8 +64,8 @@ static struct mvebu3700_uart {
     struct vuart_info vuart;
 } mvebu3700_com = {0};
 
-#define mvebu3700_read(uart, off)           readl((uart)->regs + off)
-#define mvebu3700_write(uart, off, val)     writel(val, (uart->regs) + off)
+#define mvebu3700_read(uart, off)           readl((uart)->regs + (off))
+#define mvebu3700_write(uart, off, val)     writel(val, (uart)->regs + (off))
 
 static void mvebu3700_uart_interrupt(int irq, void *data,
                                      struct cpu_user_regs *regs)
--
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®.