From patchwork Mon Dec 28 09:15:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7925191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20D4ABEEE5 for ; Mon, 28 Dec 2015 09:15:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4871E20253 for ; Mon, 28 Dec 2015 09:15:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 678612024F for ; Mon, 28 Dec 2015 09:15:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751004AbbL1JPx (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 Received: from [192.168.1.2] ([78.48.234.128]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0LpfJW-1ZkAxO3gbG-00fPIT; Mon, 28 Dec 2015 10:15:41 +0100 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.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9TVuz5iTpYG2qLeLLUisMoSAOoGKax6tRY+bXzxLaOHCQh TSXres2X4Je6gXA/t8YczuXDpjuig== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }