Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbbBSKbj (ORCPT ); Thu, 19 Feb 2015 05:31:39 -0500 Received: from outbound-smtp01.blacknight.com ([81.17.249.7]:36498 "EHLO outbound-smtp01.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752749AbbBSKbh (ORCPT ); Thu, 19 Feb 2015 05:31:37 -0500 Message-ID: <54E5BB87.3020206@nexus-software.ie> Date: Thu, 19 Feb 2015 10:31:35 +0000 From: "Bryan O'Donoghue" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ingo Molnar 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 References: <201502191606.pTcFEBOs%fengguang.wu@intel.com> <20150219081432.GA21996@waimea> <54E5B6D6.6000308@nexus-software.ie> <20150219102509.GA2819@gmail.com> In-Reply-To: <20150219102509.GA2819@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1065 Lines: 55 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. So I changed it from return iosf_mbi_read to ret = iosf_mbi_read if (ret) return ret; return 0; as a result. I'm OK with the change suggested by the script if Andy (who requested the change) is. -- Bryan -- 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/