From patchwork Thu Dec 10 15:01:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 11965105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C593C433FE for ; Thu, 10 Dec 2020 15:03:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E172622D02 for ; Thu, 10 Dec 2020 15:03:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E172622D02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:To: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Nbh14nAYAE5bQayJnnw4QcsbgEoAUByWWDtQZcbeggI=; b=MJvVL0EnyRTv7hcTlYmEaKtttB T/mSUubHsKDerRAEDBy4sV8wqdHg1beOTOxfDpGAUSRZfURYPHL//rm0ejxPH/DeJqwRhrH3qKaoC v85/rNqDPl8lH+PCSUM+fIGL7S7MIwkqfz80kRcKcdaHJxok3EzFgzxLkFEVEcbKq73FIfTd+bsMw 9wYJ2T1ibE00wkhSdVpsLGanohne09xGdMmwFxAb5mEU4fh49DWHrXV22+pSkXYyPUJKYrGhtqHwI ZSKvFMkC8e7k8hVcE0cng69KlXaiLVBXh7zAlGI/1f4T8z6ZlVATQxIMUQt1eDp4dkSQIEsfYjbtF 6RuQybHA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1knNSD-0000zu-E3; Thu, 10 Dec 2020 15:02:01 +0000 Received: from mout.web.de ([217.72.192.78]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1knNS9-0000xv-Lp for linux-arm-kernel@lists.infradead.org; Thu, 10 Dec 2020 15:01:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1607612505; bh=99wv7sE/HTWyAv1HbH2Mwc/Qt95r6SAFn2WX2+U5hHU=; h=X-UI-Sender-Class:To:Cc:From:Subject:Date; b=N3V8OodLu6AYLpLP0nwoass3lH2/EBnkSHZGO/u4FdFly9catJA4tge+7n9AgmFf2 C47qb5KlAXmF7BsHnW5ORmJtpAM5jaaDWQCfdEz09JiogGuIU/xhHdBsOUUcrem1/K s55wUu6pgb/tsOYZNoU3sYzzte2utMXDwPYTtlwY= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([78.48.143.229]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MXoYQ-1kdUTV3LcC-00YI40; Thu, 10 Dec 2020 16:01:45 +0100 To: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Alexandre Belloni , Ludovic Desroches , Nicolas Ferre , Ulf Hansson From: Markus Elfring Subject: =?utf-8?q?=5BPATCH=5D_mmc=3A_atmel-mci=3A_Reduce_scope_for_the_vari?= =?utf-8?q?able_=E2=80=9Cslot=E2=80=9D_in_atmci=5Frequest=5Fend=28=29?= Message-ID: <466b4c6d-032f-fbcc-58ac-75f6f39d734f@web.de> Date: Thu, 10 Dec 2020 16:01:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K1:39DClp1oc9iKtEmQRDvypN2+agaq42DfZPLXLGGWp0Bib/RcFXz 0+B5eCiTZVkvOYTHQlqXceMPa78Ir5052N3SSE7Fy1/MoDt6YSVzDf/A6zk1c8R4tE6JOXB hEU5IQdVHlo/gFEoEHjzpq5dVpDCYRmYiFK/Y3CIZpnBD+sgjhVPgy+jjBnZFhkGvQR+iQi AnefEGiYqFfDdc5JQY8/Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:JUj7Rpc769o=:qxnuZSYT5rLiFiwkUpQeOU 2+yVieHgQYEcU3BJINY5jAko/BfY9qqelwjqyJ4yvzY/gLq3tXR34mqjDpFUVANXOLUXk1B9X YvKRY9HlYnFjynIDBH4QMfuvbLKsUfH4E9R0taJEP8SaiQ24ZGUmlwY0yzhQWDCrm0EwdCp9J aCDMwerXt99IBQTqAG+tbHCgW9YsRJDfL+Y17maXMtj3zjXsQBH6qvCsdMT0JG+HT8jQbF9uM gWBLUPfJU2m/l3+OpjaGB5CwX23LvK2ooTKChLSJhQ2V8s85Rcf/cDlbkIf82fGZK4T5m5iRE PW+4O41+riU+JNvffmLg0KpkGuMi3xPzNo7xN6vWY8vicbuQoh0BGnrG/yp6Qi5f30CeVhN04 QvkUnyTsaDRu1CZa3XzJ+hVPyfDleH3LO8Xsg3YNutM47UXCCz31VzsUtP/5qDv12Mr9z1gmJ WLFtyl4NCUBiOzcqUAPLk5944NP3OUjR3yAtPyXetdvNSHZda5N6jaTOt5ktQ5LMMYVP2Rm7z slHhkB4BI+sSqA/IFC9vPYAO1IWoiR0cbHBhn0L1hRxXxfaabrSe4eyJAGZ5xx3xFGT/4Zhvh 1ScwZ5cUEjVMv5EAE0AkzBnOnqKTUugGMV3h2yBKLPelyChCOApHMqf03MUexcwwoFGQuFZSE ryo2Wx32tO0dAHAXCmaPsm7VXngb3AZIFl1Ic5q7bkRCEpv+RjZ1+kdCbeQIyx6QuL7rUKd8S yj6+2QaxiuynfXhVqNN/7SH5CKiInCgOR0INujh6HMKfPT9vTP/uK4AG4T9YboRrlAlyeDnS8 c7Fj3zO+4z6cX7E2e6cg4naxPEt8h5k5GCkwpTfdm9y2W3TETMmXg1XQX+KOEo2um45fBvoQc 7JQtq1vPEEQA+W0aqzVQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201210_100158_081159_6807F456 X-CRM114-Status: GOOD ( 12.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Markus Elfring Date: Thu, 10 Dec 2020 15:56:13 +0100 A local variable was used only within an if branch. Thus move the definition for the variable “slot” into the corresponding code block. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/mmc/host/atmel-mci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.29.2 diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 444bd3a0a922..6a0d999ee82e 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -1558,7 +1558,6 @@ static void atmci_request_end(struct atmel_mci *host, struct mmc_request *mrq) __releases(&host->lock) __acquires(&host->lock) { - struct atmel_mci_slot *slot = NULL; struct mmc_host *prev_mmc = host->cur_slot->mmc; WARN_ON(host->cmd || host->data); @@ -1579,8 +1578,9 @@ static void atmci_request_end(struct atmel_mci *host, struct mmc_request *mrq) host->cur_slot->mrq = NULL; host->mrq = NULL; if (!list_empty(&host->queue)) { - slot = list_entry(host->queue.next, - struct atmel_mci_slot, queue_node); + struct atmel_mci_slot *slot = list_entry(host->queue.next, + struct atmel_mci_slot, + queue_node); list_del(&slot->queue_node); dev_vdbg(&host->pdev->dev, "list not empty: %s is next\n", mmc_hostname(slot->mmc));