From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbbJBSRv (ORCPT ); Fri, 2 Oct 2015 14:17:51 -0400 Received: from lists.s-osg.org ([54.187.51.154]:47090 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752671AbbJBSRt (ORCPT ); Fri, 2 Oct 2015 14:17:49 -0400 Subject: Re: [PATCH 07/18] Input: cap11xx - simplify function return logic To: Dmitry Torokhov References: <1443793229-22363-1-git-send-email-javier@osg.samsung.com> <1443793229-22363-8-git-send-email-javier@osg.samsung.com> <20151002180926.GH8437@dtor-ws> Cc: linux-kernel@vger.kernel.org, Axel Lin , Krzysztof Kozlowski , Daniel Mack , linux-input@vger.kernel.org, Matt Ranostay From: Javier Martinez Canillas Message-ID: <560ECA45.30700@osg.samsung.com> Date: Fri, 2 Oct 2015 20:17:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <20151002180926.GH8437@dtor-ws> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Dmitry, On 10/02/2015 08:09 PM, Dmitry Torokhov wrote: [snip] >> >> - error = devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func, >> - IRQF_ONESHOT, dev_name(dev), priv); >> - if (error) >> - return error; >> - >> - return 0; >> + return devm_request_threaded_irq(dev, irq, NULL, cap11xx_thread_func, >> + IRQF_ONESHOT, dev_name(dev), priv); >> } > > For cases where we have multiple of potentially failing actions: > > error = action1(); > if (error) > return error; > > error = action2(); > if (error) > return error; > > error = action3(); > if (error) > return error; > > return 0; > > I prefer not to compress the last action check to "return action3()". > Fair enough, I don't mind if you drop those patches then. Thanks a lot for your feedback. > Thanks. > Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America