Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754931AbcLTJVX (ORCPT ); Tue, 20 Dec 2016 04:21:23 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:55862 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754925AbcLTJVU (ORCPT ); Tue, 20 Dec 2016 04:21:20 -0500 Date: Tue, 20 Dec 2016 10:18:03 +0100 (CET) From: Thomas Gleixner To: Ozgur Karatas 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 , Linus Torvalds , akpm@linux-foundation.org Subject: Re: [PATCH 1/1] kernel: futex: fixed to else and initcall In-Reply-To: <263091482180789@web35j.yandex.ru> Message-ID: References: <263091482180789@web35j.yandex.ru> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 814 Lines: 52 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