Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751624AbbL1JPx (ORCPT ); Mon, 28 Dec 2015 04:15:53 -0500 Received: from mout.web.de ([212.227.15.14]:57263 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbbL1JPu (ORCPT ); Mon, 28 Dec 2015 04:15:50 -0500 Subject: [PATCH] [media] tuners: One check less in m88rs6000t_get_rf_strength() after error detection References: <566ABCD9.1060404@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall To: linux-media@vger.kernel.org, Mauro Carvalho Chehab From: SF Markus Elfring Message-ID: <5680FDB3.7060305@users.sourceforge.net> Date: Mon, 28 Dec 2015 10:15:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <566ABCD9.1060404@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:LbXGfpIfas7orphrQYsZrdfYlGV9CaKWWRCD1Aj79leoz31wjDJ +3HFOhmqfIn1T+fBn4aXeDUBhhWJyjWMEtILsDRp0DCWGHJRoc0QmwW4csphQP9BDmjm1mY CY+rvv+hI4KOnMf+Y13pwiULEbKLvGi+RVTyy4d0lC9rE/0kG/uw2IXiUOGEqsYx67oQ21c VxGYOCk6tpLIDCHD2ltJw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Ejp+PmztvxQ=:wh4CN5nQdi9b3OEzyKO3zG CK7WvTW2URUrnjK0N/WzKBq591iTkK9wVMiWZaY/DXxBn5TbrsmokiJ3SEIlh5dsvNy5P6sZf gVpOLiOaRVROGMdgXhrSjkhpH6WYPGnEAjiDhDLbk6GK3DC6vSKFhS9GbOtPzpvYO5yAQVHp3 qrPurwI6yrAWt1FMX9A5Vyh+pKF6c8gLPbgHNIqJPGX6VJQw+7vvFDJvHnvWToS4K9hnZCjIh JsZeAxenM8NBWwshyC3E9OUoUsPHjmjh32SkOb5VQM2uWQa4c0WHqSUMOihIdcPSpmDutgyIS fMRBvyxgaIq/JqouRQ8cV1+yp0DByZUYSxgZRQH73hDQ/XsRNoPPhcivOOw8cfKrGSfeCobwU vFAau6h8u/1wc9FXK4yvD7jM3bGSBdybLCE4mjhAQpX4pqkQtwZid3mUm2BTsZqLB8yNh3reC 2ET9F0rVOUhfvA1gYYcy/kuUHDpjJysTzKfXMLOCuoKHDHxfcbWRUG3KjdOi0sc0NdYHg9nN8 qLIibAahWEn7pLFOoqNtnk6unW41caw3Trm0oVZcEIFxNsOjkrm3/8KJfFYbRgZm9fF8daCsm TpQuNGOAGrfnnazpcXQBcxv5wou5dzbL9q6YbYOfAHiVbuGLicP4bosxDtDzmTfdl8+8udxVk Zk0kRXaO04MsHf+DKWV//n4RbO58eYUC3UKYF4DoF1vZLe+xHfrhG5JhtXckUkEnWUrpckuKW 5x4VNmhExU56td9cTD9Ek4zEcVh9TVuz5iTpYG2qLeLLUisMoSAOoGKax6tRY+bXzxLaOHCQh TSXres2X4Je6gXA/t8YczuXDpjuig== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2065 Lines: 73 From: Markus Elfring Date: Mon, 28 Dec 2015 10:10:34 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "ret" will not be checked once more after it was determined that a function call failed. Signed-off-by: Markus Elfring --- drivers/media/tuners/m88rs6000t.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/media/tuners/m88rs6000t.c b/drivers/media/tuners/m88rs6000t.c index 504bfbc..b45594e 100644 --- a/drivers/media/tuners/m88rs6000t.c +++ b/drivers/media/tuners/m88rs6000t.c @@ -510,27 +510,27 @@ static int m88rs6000t_get_rf_strength(struct dvb_frontend *fe, u16 *strength) ret = regmap_read(dev->regmap, 0x5A, &val); if (ret) - goto err; + goto report_failure; RF_GC = val & 0x0f; ret = regmap_read(dev->regmap, 0x5F, &val); if (ret) - goto err; + goto report_failure; IF_GC = val & 0x0f; ret = regmap_read(dev->regmap, 0x3F, &val); if (ret) - goto err; + goto report_failure; TIA_GC = (val >> 4) & 0x07; ret = regmap_read(dev->regmap, 0x77, &val); if (ret) - goto err; + goto report_failure; BB_GC = (val >> 4) & 0x0f; ret = regmap_read(dev->regmap, 0x76, &val); if (ret) - goto err; + goto report_failure; PGA2_GC = val & 0x3f; PGA2_cri = PGA2_GC >> 2; PGA2_crf = PGA2_GC & 0x03; @@ -562,9 +562,11 @@ static int m88rs6000t_get_rf_strength(struct dvb_frontend *fe, u16 *strength) /* scale value to 0x0000-0xffff */ gain = clamp_val(gain, 1000U, 10500U); *strength = (10500 - gain) * 0xffff / (10500 - 1000); -err: - if (ret) + + if (ret) { +report_failure: dev_dbg(&dev->client->dev, "failed=%d\n", ret); + } return ret; } -- 2.6.3 -- 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/