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:	Mon, 17 Jun 2013 09:35:21 -0700
From:	Joe Perches <joe@...ches.com>
To:	Lorenz Haspel <lorenz@...gers.com>
Cc:	devel@...uxdriverproject.org, gregkh@...uxfoundation.org,
	puff65537@...sheeslibrary.com, viro@...iv.linux.org.uk,
	michael.banken@...he.stud.uni-erlangen.de,
	dan.carpenter@...cle.com, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org,
	linux-kernel@...informatik.uni-erlangen.de
Subject: Re: [PATCH 4/4] solicom: checkpatch: added parenthesis to macros

On Mon, 2013-06-17 at 18:26 +0200, Lorenz Haspel wrote:
> fixed checkpatch error:
> added parenthesis around complex macros.
[]
> diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c
[]
> @@ -44,9 +44,11 @@ MODULE_VERSION(BP_MOD_VER);
>  spinlock_t bpvm_lock;
>  
>  #define lock_bpctl()					\
> -if (down_interruptible(&bpctl_sema)) {			\
> -	return -ERESTARTSYS;				\
> -}							\
> +do {							\
> +	if (down_interruptible(&bpctl_sema)) {		\
> +		return -ERESTARTSYS;			\
> +	}						\
> +} while (0)

Macros with goto or return are also poor style.
Probably better to expand these in-place instead.

--
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