[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5751AB4A.7040805@ti.com>
Date: Fri, 3 Jun 2016 11:07:38 -0500
From: Nishanth Menon <nm@...com>
To: Joe Perches <joe@...ches.com>, "Andrew F. Davis" <afd@...com>,
Andy Whitcroft <apw@...onical.com>
CC: <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] checkpatch: Flag code that returns a negative number
On 06/03/2016 11:01 AM, Joe Perches wrote:
[...]
> I did more or less the same grep, and that's somewhat true.
> -1 though is very common and doesn't need to be replaced.
OK,
>
> $ git grep -E "\breturn\s+\-\s*[0-9]+\s*;" * | grep -v "^tools" | grep -vP "return\s*\-1;" | wc -l
> 211
>
> Looking at some of the specific instances of negative return values
> instead of the line counts though may show otherwise.
>
> -EFOO errors aren't always better.
At least would'nt be a little more readable than obscure -val?
Would we like -[2-9][0-9]* flagged at all even as a check?
--
Regards,
Nishanth Menon
Powered by blists - more mailing lists