From: Nishanth Menon <nm@ti.com>
To: Joe Perches <joe@perches.com>, "Andrew F. Davis" <afd@ti.com>,
Andy Whitcroft <apw@canonical.com>
Cc: <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] checkpatch: Flag code that returns a negative number
Date: Fri, 3 Jun 2016 11:07:38 -0500 [thread overview]
Message-ID: <5751AB4A.7040805@ti.com> (raw)
In-Reply-To: <1464969664.11800.9.camel@perches.com>
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
next prev parent reply other threads:[~2016-06-03 16:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 15:25 [PATCH] checkpatch: Flag code that returns a negative number Nishanth Menon
2016-06-03 15:41 ` Joe Perches
2016-06-03 15:49 ` Andrew F. Davis
2016-06-03 16:01 ` Joe Perches
2016-06-03 16:07 ` Nishanth Menon [this message]
2016-06-03 16:16 ` Joe Perches
2016-06-03 20:02 ` [PATCH V2] checkpatch: Flag code that returns a negative number less than 1 Nishanth Menon
2016-06-03 20:42 ` Joe Perches
2016-06-03 20:46 ` Nishanth Menon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5751AB4A.7040805@ti.com \
--to=nm@ti.com \
--cc=afd@ti.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox