On 01/28/2016 10:38 AM, Xie, Huawei wrote: > On 1/28/2016 4:06 PM, Thomas Monjalon wrote: >> 2016-01-28 03:09, Xie, Huawei: >>> On 1/28/2016 2:17 AM, Thomas Monjalon wrote: >>>> 2016-01-27 01:26, Huawei Xie: >>>>> v2 changes: >>>>> add missed commit message in v1 >>>>> >>>>> fix the error reported by checkpatch: >>>>> "ERROR: return is not a function, parentheses are not required" >>>>> >>>>> also removed other extra parentheses like: >>>>> "return val == 0" >>>>> "return (rte_mempool_lookup(...))" >>>> How these examples are differents from above checkpatch error? >>> Don't get it. >> Me too ;) >> I don't understand which paren you removed in "return val == 0" >> and why you say "also removed other...", meaning it is different >> from the checkpatch error. > > Got you. I thought your example means DPDK examples. > I mean i also removed paren in "return (val == 0)". But checkpatch > doesn't report "return (logical expression)" as error. I think it is > also not necessary, so removed some of them. That is why i listed them > seperately. >
So perhaps there's a reason checkpatch doesn't report it as an error? At least I find the parentheses to increase readability in case of logical expressions, for example return val == 0; return (val == 0); The parentheses kinda force you to notice there's something special going on and its not val that's returned. This "note there's something special here" of course only works if parentheses are not sprinkled around everywhere. - Panu -