From patchwork Thu Oct 26 19:23:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10028753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 02E4D601E8 for ; Thu, 26 Oct 2017 19:24:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5F4528E3F for ; Thu, 26 Oct 2017 19:24:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAC3728E72; Thu, 26 Oct 2017 19:24:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C12D28E3F for ; Thu, 26 Oct 2017 19:24:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932336AbdJZTYx (ORCPT ); Thu, 26 Oct 2017 15:24:53 -0400 Received: from mout.web.de ([217.72.192.78]:53524 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932174AbdJZTYw (ORCPT ); Thu, 26 Oct 2017 15:24:52 -0400 Received: from [192.168.1.2] ([78.48.35.118]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M5fwS-1dF0FF2mHA-00xXru; Thu, 26 Oct 2017 21:24:01 +0200 To: linux-input@vger.kernel.org, Akinobu Mita , Dmitry Torokhov , =?UTF-8?B?R8O8bnRlciBSw7Zjaw==?= , Zhang Jiejing Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] Input-mpr121: Use common error handling code in mpr_touchkey_interrupt() Message-ID: <38f2360b-5f45-b6e6-4e7d-a9cc1a43939a@users.sourceforge.net> Date: Thu, 26 Oct 2017 21:23:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:qscLCVO7RDZ+j2CEyoVVv7qskmxQ6L+HO0s0wWy1tgl6NflEidZ T65Gg6MhY8GTwCLlzYbo4Avyl3haRdAz2uR5UuDTNosyJblKCgPzFAuz6jzAIk6wxXr/bbd ZRT01cf405RK9phapbPuPMPEduseRirDawO8JsgpytLdR0C3nCYmKPRS3/NTKfi0uGuez2j hxuQ+KK9UHlgwEr/dwRKQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:JvMeJXzhymg=:WnVyTRbQZboJGCVv+RG+pT 7ix71EVLfs5Xr5jC6NL9U6EFtrIf31/kr9zEHnbGO717430a/7VpQxnPq0gYsYi2Vhqd+v2FV WLr0URfOhzNDXKTk8plsGjXd6MAN/uSzYPnDPk5Y8TMJUfqfv9+E3zspWdby2NxEpXYzabBET t83F6xsDHxSB2RPBx0qxzB1HqmdMAUbZvTtSyF0V1+A0055Dte5SECS2KMfqnfv8XSLM1c9Ik 0WfvfSeUSfkPJAt+KGjIzLKia7SQpOX8gJ31kAlRbD/eiPjI2uMnt2Otd7tLh+NAXwKGBlN/T eP9N6oFr430M0b/fZ9VR5t7o2FFvJ2q0ecqkug3pFJEpT097h25v+b/VjeRUnKz+Ta2dGMukE xBvaN7SCH7nVsSRm2x5xTWSMeEJxEHwS7lNSI602tmgf89b8oarPJSN0zvkzHeGsf0qVkHM20 m7Ls8zTxygqHLV2IirrVcauEVvQiBfii8NtsympQjr//QbHVNRbk68fomHFUs2WqAxaWZnvPt z/eU5ypqedQoG5fPmist7J6Pujs/XQz+hiBJL4ixG8ixzd4qW1wyYAxe4/U/3Y9PzNUvwvXEX muX0Dljb3FS4PQn+Mk787WPZYplmhaiUBEONw+lyJbeOVIigggI4on9cF5CFvSTLOrlQE8kts px5I8UBL3bnrY4Dplx1Jone0jflM0RACcHMYUO01gFDavXLh16yTAjtTSgRhJ/QGUn9sDNO8Y Ju1rq3QowhveCLXzkfjefT7gvGQ2anjLJwwCHe7BQZ6Ey/jCKLJa/WVLQ7W1Vg0wzQCeAcOl9 GJ7nkfLF3ytPFek1V6a/h1h6bmOUACWlEsr584g19Sqekz7QRA= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 26 Oct 2017 21:16:53 +0200 Add a jump target so that an error message can be better reused in an if branch of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/input/keyboard/mpr121_touchkey.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index 884a74d8a7ed..af840a842246 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c @@ -129,14 +129,13 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id) int reg; reg = i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_1_ADDR); - if (reg < 0) { - dev_err(&client->dev, "i2c read error [%d]\n", reg); - goto out; - } + if (reg < 0) + goto report_read_failure; reg <<= 8; reg |= i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_0_ADDR); if (reg < 0) { +report_read_failure: dev_err(&client->dev, "i2c read error [%d]\n", reg); goto out; }