linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Elshad Mustafayev <elshadimo@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel: acctc.c: Fixed else if not generally userful after a break or return warning.
Date: Thu, 25 Sep 2014 04:22:15 +0100	[thread overview]
Message-ID: <20140925032215.GK7996@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20140925031345.GA5252@emustafa>

On Wed, Sep 24, 2014 at 11:13:45PM -0400, Elshad Mustafayev wrote:
> Fixed a coding style issue.
> 
> Signed-off-by: Elshad Mustafayev <elshadimo@gmail.com>
> ---
>  kernel/acct.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/acct.c b/kernel/acct.c
> index b4c667d..ed4cf00 100644
> --- 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...

  reply	other threads:[~2014-09-25  3:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [not found] <E1XX0bN-00032o-0x@feisty.vs19.net>
2014-09-25  4:31 ` Joe Perches
     [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

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=20140925032215.GK7996@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=elshadimo@gmail.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;
as well as URLs for NNTP newsgroup(s).