[PATCH] staging: rtl8712: Add parenthesis to Macro argument

Greg KH gregkh at linuxfoundation.org
Mon Jul 15 19:39:50 UTC 2019


On Sat, Jul 13, 2019 at 06:26:52PM -0300, christianluciano.m at gmail.com wrote:
> From: Christian Luciano Moreno <christianluciano.m at gmail.com>
> 
> Add parenthesis to Macro argument to avoid precedence issues.
> 
> Signed-off-by: Christian Luciano Moreno <christianluciano.m at gmail.com>
> ---
>  drivers/staging/rtl8712/basic_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8712/basic_types.h b/drivers/staging/rtl8712/basic_types.h
> index 4ad7f35b1644..3e6d4ff45a75 100644
> --- a/drivers/staging/rtl8712/basic_types.h
> +++ b/drivers/staging/rtl8712/basic_types.h
> @@ -21,7 +21,7 @@
>  
>  #define SIZE_T __kernel_size_t
>  #define sint signed int
> -#define FIELD_OFFSET(s, field)	((addr_t)&((s *)(0))->field)
> +#define FIELD_OFFSET(s, field)	((addr_t)&(((s) *)(0))->(field))
>  

This change makes no sense, and it breaks the build, which implies you
did not test it at all :(



More information about the devel mailing list