[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1612201006300.3436@nanos>
Date: Tue, 20 Dec 2016 10:18:03 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Ozgur Karatas <okaratas@...ber.fsf.org>
cc: dave@...olabs.net, dvhart@...ux.intel.com, bigeasy@...utronix.de,
mgorman@...e.de, dingel@...ux.vnet.ibm.com,
kirill.shutemov@...ux.intel.com,
linux-kernel <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
akpm@...ux-foundation.org
Subject: Re: [PATCH 1/1] kernel: futex: fixed to else and initcall
On Mon, 19 Dec 2016, Ozgur Karatas wrote:
> else doesn't need to be used, if should be enclosed in parentheses.
Really?
> - if (err < 0)
> + if (err < 0) {
> return err;
> - else
> err = 0;
> + }
So you change the code from
if (err < 0)
return err;
else
err = 0;
to
if (err < 0) {
return err;
err = 0;
}
How on earth is that equivivalent and how would that 'err = 0;' statement
be ever executed?
You clearly ran checkpatch.pl on this file and the output for this
construct is:
WARNING: else is not generally useful after a break or return
#550: FILE: kernel/futex.c:550:
+ return err;
+ else
So the proper change would have been:
if (err < 0)
return err;
err = 0;
and not the trainwreck you created.
checkpatch.pl does not substitute basic knowlegde of C.
Thanks,
tglx
Powered by blists - more mailing lists