From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754043AbbJBNrF (ORCPT ); Fri, 2 Oct 2015 09:47:05 -0400 Received: from svenfoo.org ([82.94.215.22]:60909 "EHLO mail.zonque.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752976AbbJBNrB (ORCPT ); Fri, 2 Oct 2015 09:47:01 -0400 X-Greylist: delayed 311 seconds by postgrey-1.27 at vger.kernel.org; Fri, 02 Oct 2015 09:47:00 EDT Subject: Re: [PATCH 07/18] Input: cap11xx - simplify function return logic To: Javier Martinez Canillas , linux-kernel@vger.kernel.org References: <1443793229-22363-1-git-send-email-javier@osg.samsung.com> <1443793229-22363-8-git-send-email-javier@osg.samsung.com> Cc: Axel Lin , Krzysztof Kozlowski , Daniel Mack , Dmitry Torokhov , linux-input@vger.kernel.org, Matt Ranostay From: Daniel Mack Message-ID: <560E899B.8070603@zonque.org> Date: Fri, 2 Oct 2015 15:41:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1443793229-22363-8-git-send-email-javier@osg.samsung.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/02/2015 03:40 PM, Javier Martinez Canillas wrote: > The invoked function already returns zero on success or a negative > errno code so there is no need to open code the logic in the caller. > > This also fixes the following make coccicheck warning: > > drivers/input/keyboard/cap11xx.c:475:1-6: WARNING: end returns can be simplified > > Signed-off-by: Javier Martinez Canillas Acked-by: Daniel Mack > --- > > drivers/input/keyboard/cap11xx.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c > index 378db10001df..7240316ddfe3 100644 > --- a/drivers/input/keyboard/cap11xx.c > +++ b/drivers/input/keyboard/cap11xx.c > @@ -472,12 +472,8 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client, > return -ENXIO; > } > > - 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); > } > > static const struct of_device_id cap11xx_dt_ids[] = { >