xen/char: mvebu-uart: Fix MISRA C 2012 Rule 20.7 violation
PATCH 1/1 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 <[email protected]>
--- xen/drivers/char/mvebu-uart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen/drivers/char/mvebu-uart.c +2 -2
@@ -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)
Signature · 1 line
2.34.1
Quoted 7 lines · Xenia Ragiadakou
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 <[email protected]>
Reviewed-by Stefano Stabellini <[email protected]>
Quoted 22 lines
--- xen/drivers/char/mvebu-uart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)xen/drivers/char/mvebu-uart.c +2
-2@@ -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)Signature · 1 line
2.34.1