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

[xen master] xen/char: imx-lpuart: Fix MISRA C 2012 Rule 20.7 violation



commit 5b9eca17cb981a08738e9d9ec3d6b91113daeb0e
Author:     Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
AuthorDate: Tue Aug 2 10:54:33 2022 +0300
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Thu Aug 4 14:37:22 2022 -0700

    xen/char: imx-lpuart: Fix MISRA C 2012 Rule 20.7 violation
    
    The macro parameter 'off' is used as an expression and it is good to be
    enclosed in parentheses to prevent against unintended expansion.
    
    Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/drivers/char/imx-lpuart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/imx-lpuart.c b/xen/drivers/char/imx-lpuart.c
index 2709136081..9c1f3b71a3 100644
--- a/xen/drivers/char/imx-lpuart.c
+++ b/xen/drivers/char/imx-lpuart.c
@@ -26,8 +26,8 @@
 #include <asm/imx-lpuart.h>
 #include <asm/io.h>
 
-#define imx_lpuart_read(uart, off)       readl((uart)->regs + off)
-#define imx_lpuart_write(uart, off, val) writel((val), (uart)->regs + off)
+#define imx_lpuart_read(uart, off)       readl((uart)->regs + (off))
+#define imx_lpuart_write(uart, off, val) writel((val), (uart)->regs + (off))
 
 static struct imx_lpuart {
     uint32_t baud, clock_hz, data_bits, parity, stop_bits, fifo_size;
--
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®.