Messages in this thread | | | Date | Fri, 20 Jan 2012 16:28:01 +0000 | From | Andy Whitcroft <> | Subject | Re: [PATCH 1/6] staging:android_pmem.h: Fixes the space and other formating issues pointed out by checkpatch.pl |
| |
On Fri, Jan 20, 2012 at 05:29:04AM -0800, Joe Perches wrote: > 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
I don't believe that makes any sense does it, those are pointer operations, and passing 0/1 to those is going to make the . very unhappy. But that is why I am only proposing to do the three which are non-sensicle on pointers.
-apw
| |