Re: [PATCH] staging: sm750fb: Enclose macro arguments in parentheses

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

 



On Tue, Feb 07, 2017 at 11:11:22AM -0800, Matthieu Simon wrote:
> checkpatch noticed possible precedence issues resulting in the definition
> of PEEK32 and POKE32. So, these arguments should be enclosed in
> parentheses.
> 
> Signed-off-by: Matthieu Simon <gmatthsim@xxxxxxxxx>
> ---
>  drivers/staging/sm750fb/ddk750_chip.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
> index e63b8b293816..a5f910344373 100644
> --- a/drivers/staging/sm750fb/ddk750_chip.h
> +++ b/drivers/staging/sm750fb/ddk750_chip.h
> @@ -10,8 +10,8 @@
>  #include <linux/uaccess.h>
>  
>  /* software control endianness */
> -#define PEEK32(addr) readl(addr + mmio750)
> -#define POKE32(addr, data) writel(data, addr + mmio750)
> +#define PEEK32(addr) readl((addr) + mmio750)
> +#define POKE32(addr, data) writel((data), (addr) + mmio750)

Those are funny macros, how about just making them an inline function so
that we get the correct type-checking and better documentation as to
what is going on with them?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux