Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753325AbbBSKdu (ORCPT ); Thu, 19 Feb 2015 05:33:50 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:49043 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255AbbBSKdt (ORCPT ); Thu, 19 Feb 2015 05:33:49 -0500 Date: Thu, 19 Feb 2015 11:33:44 +0100 From: Ingo Molnar To: "Bryan O'Donoghue" Cc: kbuild test robot , kbuild-all@01.org, Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, Andy Shevchenko , "Ong, Boon Leong" , Darren Hart , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/intel/quark: fix simple_return.cocci warnings Message-ID: <20150219103344.GD2819@gmail.com> References: <201502191606.pTcFEBOs%fengguang.wu@intel.com> <20150219081432.GA21996@waimea> <54E5B6D6.6000308@nexus-software.ie> <20150219102509.GA2819@gmail.com> <54E5BB87.3020206@nexus-software.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54E5BB87.3020206@nexus-software.ie> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1190 Lines: 58 * Bryan O'Donoghue wrote: > On 19/02/15 10:25, Ingo Molnar wrote: > > >>>- ret = iosf_mbi_read(QRK_MBI_UNIT_MM, QRK_MBI_MM_READ, > >>>+ return iosf_mbi_read(QRK_MBI_UNIT_MM, QRK_MBI_MM_READ, > >>> reg++, &imr->wmask); > >>>- if (ret) > >>>- return ret; > >>>- > >>>- return 0; > >>> } > >>> > >>> /** > >>> > >> > >>This flow was a change asked for and supplied in review > >>feedback for Andy Shevchenko so NAK to this patch. > > > >But this pattern: > > > > if (ret) > > return ret; > > > > return 0; > > > >makes very little sense. Why is it done? > > > >Thanks, > > > > Ingo > > Feedback at review was that it's more consistent with the > code that comes before. But that feedback makes very little sense. In C we don't ever want to write: if (ret) return ret; return 0; Because we can return the fine value straight away: return ret; regardless of what comes before. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/