From: Joe Perches <joe@perches.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Elshad Mustafayev <elshadimo@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel: acctc.c: Fixed else if not generally userful after a break or return warning
Date: Wed, 24 Sep 2014 21:31:06 -0700 [thread overview]
Message-ID: <1411619466.4026.2.camel@joe-AO725> (raw)
In-Reply-To: <E1XX0bN-00032o-0x@feisty.vs19.net>
On Wed, Sep 24, 2014 at 11:13:45PM -0400, Elshad Mustafayev wrote:
> > Fixed a coding style issue.
[]
> > diff --git a/kernel/acct.c b/kernel/acct.c
[]
> > @@ -376,9 +376,8 @@ static comp2_t encode_comp2_t(u64 value)
> > if (exp > MAXEXP2) {
> > /* Overflow. Return largest representable number instead. */
> > return (1ul << (MANTSIZE2+EXPSIZE2-1)) - 1;
> > - } else {
> > - return (value & (MAXFRACT2>>1)) | (exp << (MANTSIZE2-1));
> > }
> > + return (value & (MAXFRACT2>>1)) | (exp << (MANTSIZE2-1));
>
> Just what makes the replacement easier to follow?
> if (foo)
> return bar;
> else
> return baz;
> is no less idiomatic than
> if (foo)
> return bar;
> return baz;
>
> Al, really annoyed by how the words "coding style issue" are getting used as
> a magic incantation...
I agree.
I'll see about updating checkpatch to avoid warning on
if (foo)
return bar;
else
return baz;
next parent reply other threads:[~2014-09-25 4:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1XX0bN-00032o-0x@feisty.vs19.net>
2014-09-25 4:31 ` Joe Perches [this message]
[not found] ` <CAAm9=9QeO_VtdY+fJ5JbrBhN52z=JUeU09Nh3Mp04QWf+Qyygw@mail.gmail.com>
2014-09-25 5:00 ` Al Viro
2014-09-25 5:05 ` Joe Perches
2014-09-25 5:03 ` [PATCH] checkpatch: Add exception to return then else test Joe Perches
2014-09-25 3:13 [PATCH] kernel: acctc.c: Fixed else if not generally userful after a break or return warning Elshad Mustafayev
2014-09-25 3:22 ` Al Viro
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=1411619466.4026.2.camel@joe-AO725 \
--to=joe@perches.com \
--cc=elshadimo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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
all inboxes | Powered by JetHome®