Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828AbbBSKZP (ORCPT ); Thu, 19 Feb 2015 05:25:15 -0500 Received: from mail-wi0-f173.google.com ([209.85.212.173]:34788 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379AbbBSKZN (ORCPT ); Thu, 19 Feb 2015 05:25:13 -0500 Date: Thu, 19 Feb 2015 11:25:09 +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: <20150219102509.GA2819@gmail.com> References: <201502191606.pTcFEBOs%fengguang.wu@intel.com> <20150219081432.GA21996@waimea> <54E5B6D6.6000308@nexus-software.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54E5B6D6.6000308@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: 1454 Lines: 55 * Bryan O'Donoghue wrote: > On 19/02/15 08:14, kbuild test robot wrote: > >arch/x86/platform/intel-quark/imr.c:129:1-4: WARNING: end returns can be simpified > > > > Simplify a trivial if-return sequence. Possibly combine with a > > preceding function call. > >Generated by: scripts/coccinelle/misc/simple_return.cocci > > > >CC: Bryan O'Donoghue > >Signed-off-by: Fengguang Wu > >--- > > > > imr.c | 6 +----- > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > >--- a/arch/x86/platform/intel-quark/imr.c > >+++ b/arch/x86/platform/intel-quark/imr.c > >@@ -126,12 +126,8 @@ static int imr_read(struct imr_device *i > > if (ret) > > return ret; > > > >- 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 -- 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/