* [PATCH] kernel: acctc.c: Fixed else if not generally userful after a break or return warning.
@ 2014-09-25 3:13 Elshad Mustafayev
2014-09-25 3:22 ` Al Viro
0 siblings, 1 reply; 5+ messages in thread
From: Elshad Mustafayev @ 2014-09-25 3:13 UTC (permalink / raw)
To: viro; +Cc: linux-kernel
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));
}
#endif
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel: acctc.c: Fixed else if not generally userful after a break or return warning.
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
0 siblings, 0 replies; 5+ messages in thread
From: Al Viro @ 2014-09-25 3:22 UTC (permalink / raw)
To: Elshad Mustafayev; +Cc: linux-kernel
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...
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <E1XX0bN-00032o-0x@feisty.vs19.net>]
* Re: [PATCH] kernel: acctc.c: Fixed else if not generally userful after a break or return warning
[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>
0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2014-09-25 4:31 UTC (permalink / raw)
To: Al Viro; +Cc: Elshad Mustafayev, LKML
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;
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-09-25 5:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
[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
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).