lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 26 Jun 2015 21:53:04 -0700
From:	Joe Perches <joe@...ches.com>
To:	Vasiliy Korchagin <vasiliy.korchagin@...il.com>
Cc:	oleg.drokin@...el.com, andreas.dilger@...el.com,
	HPDD-discuss@...ts.01.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: lustre: obdclass: fix macro coding style issue
 in uuid.c

On Sat, 2015-06-27 at 05:44 +0100, Vasiliy Korchagin wrote:
> This patch fixes the checkpatch.pl error:
> 
> ERROR: Macros with complex values should be enclosed in parentheses
> +#define CONSUME(val, ptr) (val) = consume(sizeof(val), (ptr))
> 
> Signed-off-by: Vasiliy Korchagin <vasiliy.korchagin@...il.com>
> ---
>  drivers/staging/lustre/lustre/obdclass/uuid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/obdclass/uuid.c b/drivers/staging/lustre/lustre/obdclass/uuid.c
> index ff0a01b..8d00882 100644
> --- a/drivers/staging/lustre/lustre/obdclass/uuid.c
> +++ b/drivers/staging/lustre/lustre/obdclass/uuid.c
> @@ -55,7 +55,7 @@ static inline __u32 consume(int nob, __u8 **ptr)
>  	return value;
>  }
>  
> -#define CONSUME(val, ptr) (val) = consume(sizeof(val), (ptr))
> +#define CONSUME(val, ptr) ((val) = consume(sizeof(val), (ptr)))

CONSUME is used exactly once.

It'd be likely be simpler to remove it and expand it
in-place instead.

The static inline __u32 consume() function is also used
once and might as well be expanded in-place too.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ