[dpdk-dev] [PATCH v2] fix checkpatch errors

Xie, Huawei huawei.xie at intel.com
Thu Jan 28 09:38:46 CET 2016

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

>>> Please add Fixes: 6307b909b8e0 ("lib: remove extra parenthesis after return")
>>> This is the second run after above commit but I still see a lot of them.
>>> Please check git grep 'return *('
>> Not a lot of them, just 44 including the document, and all of them are
>> "return (logical expressions)", which check patch doesn't report as
>> errors, so i chose to ignor them in the previous patch. I can send new
>> one which also fixes those code styles.
>> Btw, is there any reason using this style?
>>     return (a*d < b*c)
> I think there is no reason. Yes you can remove the parens here.
> Thanks

More information about the dev mailing list