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]
Message-ID: <1327066144.6176.27.camel@joe2Laptop>
Date:	Fri, 20 Jan 2012 05:29:04 -0800
From:	Joe Perches <joe@...ches.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Andy Whitcroft <apw@...onical.com>,
	Pradheep Shrinivasan <pradheep.sh@...il.com>, greg@...ah.com,
	devel@...uxdriverproject.org, swetland@...gle.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] staging:android_pmem.h: Fixes the space and other
 formating issues pointed out by checkpatch.pl

On Fri, 2012-01-20 at 14:54 +0300, Dan Carpenter wrote:
> It still complains about the following macros where parenthesis are
> not needed.
> 
> ERROR: Macros with complex values should be enclosed in parenthesis
> #156: FILE: staging/android/pmem.c:156:
> +#define PMEM_IS_FREE(id, index) !(pmem[id].bitmap[index].allocated)
> 
> Let's just make the check look for an operator with a low
> precedence.
> http://en.wikipedia.org/wiki/Order_of_operations#Programming_languages
> 
> Otherwise the submitters are going to change it to:
> 
> #define PMEM_IS_FREE(id, index) (!(pmem[id].bitmap[index].allocated))
> 
> That has two pairs of unneeded paranthesis and we run the risk of
> reprogramming the kernel in lisp, by mistake.

I think the outer parens are necessary.
Imagine PMEM_IS_FREE(foo, bar).another_dereference


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