From patchwork Mon Dec 28 14:42:42 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: 7926251 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 83FEEBEEE5 for ; Mon, 28 Dec 2015 14:43:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9BF0200F2 for ; Mon, 28 Dec 2015 14:43:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE3C020108 for ; Mon, 28 Dec 2015 14:43:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752342AbbL1OnB (ORCPT ); Mon, 28 Dec 2015 09:43:01 -0500 Received: from mout.web.de ([212.227.17.12]:51076 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752430AbbL1Om6 (ORCPT ); Mon, 28 Dec 2015 09:42:58 -0500 Received: from [192.168.1.2] ([78.48.234.128]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MX0UC-1ajRrY46Uu-00Vzwi; Mon, 28 Dec 2015 15:42:49 +0100 Subject: [PATCH 2/2] [media] tuners: Refactoring for m88rs6000t_sleep() To: linux-media@vger.kernel.org, Mauro Carvalho Chehab References: <566ABCD9.1060404@users.sourceforge.net> <5680FDB3.7060305@users.sourceforge.net> <56810F56.4080306@users.sourceforge.net> <568148FD.7080209@users.sourceforge.net> Cc: Julia Lawall , LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <56814A62.7070309@users.sourceforge.net> Date: Mon, 28 Dec 2015 15:42:42 +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: <568148FD.7080209@users.sourceforge.net> X-Provags-ID: V03:K0:dMHkMpbwzCOgRpyVRwDiSty6eUDshV8kR3KnT1OAw6hmvoKUqjB KNL2PFD++r+NDGtKHM/fGQd9WmgcVLmxFT/U+qfmBJa/jqdO/+mto4bEelJ/aYBQGC6/sP1 /1n6XeiGcI3FUrz437Km0zi9TNW1iT3kJ6orSTwyTc2wGxYyV83CmomuwogjyljN8VN7Na8 tkx030w3XOvjNB9jaTrsQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:0UYfwgQMh64=:h/pTck0RQt86EM/r9qN13c lzirxvL9mF3fvYtWpw9KX37EtLPe1pI936PEB/Uv5vYfEziZNZGXkk5hApgUYiF2jSxRrZVMi MbRkEU+293v0c5ggrG2KRIf7IB6YFcnUMA2nm43+PPXSXKUgFb3GC0ataXvSbhrQMit9MebwI 7u2FwObWxdqrKw8mayyBG6V75slqJQVwDGHFQwCnd3MPgreQFtdzJgOL9Ok4B8JD1G7J6lzTJ TjMDudLSgRuWimXQBq0ho8e4ePUWyrL8bkKOPGQnsWeZIZDjXPg7BsxCtxfjxxW7e5jKQT0dv A87j4OyhryMeF8dEmKfg4BhIdF/waZf2JbXwlJPUzlQVUeTJtWbWYyBgZj1etdSQoiIdLWm0/ i+fKsfMX0JWJVdrXoS23AbS/B7rNFRRE0dFk7XLUPgJfqZ8xuxZwks4MwbGK++TwxDiNgAfLV ibSm5sNpJpM1PN+5o1jiLChIvS57ekVDjcyqU6Opt6KFv62B4AOkvt+0bdarworL3fP22smzm X+V4C2vt5hYfXvRiXyR+eU9YkJWxc/nz/88Nl4nS4siMR0UnMv6Kk6hLXArM1WWJTe/KVDn2j WmoIf+/ushZfxxobO9ec0zIYTFb18Urj0/n2FoR2kriApihU0yo9/jq9MomyzH+5RuW4/mLrZ /1KAhInoqC8ebiMUm3rcY1A0vCNkHiB9+RaY2WQc2fd1UOkiZ+iX6trwa5N6OHH67Fy/9Y0DM fCeyDq8O2p3vSqL3nUEdHT1yN0ecQP6UkLSHHyHAwmYUL3GUigOeKlbudq5zLIABe/99nloU3 0437Z3whwErCy9K7yHXyReaPJQNdQ== 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 15:20:45 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the regmap_write() function failed. 2. Delete the jump label "err" then. 3. Return zero as a constant at the end. Signed-off-by: Markus Elfring --- drivers/media/tuners/m88rs6000t.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/tuners/m88rs6000t.c b/drivers/media/tuners/m88rs6000t.c index 7e59a9f..8d10798 100644 --- a/drivers/media/tuners/m88rs6000t.c +++ b/drivers/media/tuners/m88rs6000t.c @@ -463,13 +463,12 @@ static int m88rs6000t_sleep(struct dvb_frontend *fe) dev_dbg(&dev->client->dev, "%s:\n", __func__); ret = regmap_write(dev->regmap, 0x07, 0x6d); - if (ret) - goto err; - usleep_range(5000, 10000); -err: - if (ret) + if (ret) { dev_dbg(&dev->client->dev, "failed=%d\n", ret); - return ret; + return ret; + } + usleep_range(5000, 10000); + return 0; } static int m88rs6000t_get_frequency(struct dvb_frontend *fe, u32 *frequency)