From: Thomas Gleixner <tglx@linutronix.de>
To: Ozgur Karatas <okaratas@member.fsf.org>
Cc: dave@stgolabs.net, dvhart@linux.intel.com, bigeasy@linutronix.de,
mgorman@suse.de, dingel@linux.vnet.ibm.com,
kirill.shutemov@linux.intel.com,
linux-kernel <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
akpm@linux-foundation.org
Subject: Re: [PATCH 1/1] kernel: futex: fixed to else and initcall
Date: Tue, 20 Dec 2016 10:18:03 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1612201006300.3436@nanos> (raw)
In-Reply-To: <263091482180789@web35j.yandex.ru>
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
next prev parent reply other threads:[~2016-12-20 9:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-19 20:53 Ozgur Karatas
2016-12-20 9:18 ` Thomas Gleixner [this message]
2016-12-20 9:39 ` Ozgur Karatas
2016-12-20 10:36 ` Thomas Gleixner
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=alpine.DEB.2.20.1612201006300.3436@nanos \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=dave@stgolabs.net \
--cc=dingel@linux.vnet.ibm.com \
--cc=dvhart@linux.intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=okaratas@member.fsf.org \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®