From patchwork Wed Dec 9 20:42:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 11962547 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 0C4AEC4361B for ; Wed, 9 Dec 2020 20:51:29 +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 A359F23C90 for ; Wed, 9 Dec 2020 20:51:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A359F23C90 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=CJVAq75lW5zLiqjK45StnySzmdCiAlZRlXCYEhERwbU=; b=h32cWJt5SBkjHujE2qY3ImIR04 TEsC/8LuW3+CMMeVKFcojHPEvtrLBFlDfKvACnJVGmZm42x/CqK2mA/L1qMTOKz4vZF9skBygjz8e nuZM8An3Kc/iXWrQ1RGWe+gOw5tmkqas9BBLrYhSsVbxIHqUdJgTOx0LC4mCx1qF1V2oRwFcLRTid irllH/dDJEBCyitqjxFi+NzzKJwYxkZVRV/2kfTQK6hAyQ0g2UgSccKJML9953tAz2IMbYhriEK5h i0jjBuCp2PC/iFgmkE4a2X0faFKMGnSme7Tu4dpPVAPOaM0XyyYI2sOAscyW215KJFdY6la2rPl2P mulH+jAQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn6Pd-00007S-Ql; Wed, 09 Dec 2020 20:50:13 +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 1kn6Pa-00005g-FJ for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 20:50:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1607547007; bh=wWxu1Ey9d5aevX0k0xbvtd9wpGbkvMbUJgI9bOHRzgE=; h=X-UI-Sender-Class:To:Cc:From:Subject:Date; b=kJw+IcrKRS/ajNhXyz1yjg41DVigRp7BZeHW4Fiw68ZEfrsDgyGSmWYlXf5cRRJWE GxC0Rmah7GQcYhgcRteePp+IxGKg2lEHoYWv6SZGKuWEFL8rHAyiafTmUIyf/noQdH r367qvVqnZGOQ3LE+BVX9JCwh7eHpFE15vNDiA24= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([2.243.104.26]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M6pUK-1kmXGD48sA-008Txb; Wed, 09 Dec 2020 21:42:24 +0100 To: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Alexander Shishkin , Leo Yan , Mathieu Poirier , Mike Leach , "Suzuki K. Poulose" From: Markus Elfring Subject: =?utf-8?q?=5BPATCH=5D_coresight=3A_cti=3A_Reduce_scope_for_the_vari?= =?utf-8?q?able_=E2=80=9Ccs=5Ffwnode=E2=80=9D_in_cti=5Fplat=5Fcreate=5Fconne?= =?utf-8?q?ction=28=29?= Message-ID: Date: Wed, 9 Dec 2020 21:42:20 +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:tDe5Q5sgwsF999kCHi+zMDFopN8ynKfpaUpnZX0KgArUO+qocGl LZkOAiC1E4VoKM6RLNckFg+6VL6XGbzGyNO9xbUGbD0uZ4VkF6BwrW0XhWcIMWuLhoMwka0 n8QKbUmkrPAB//ILKgiE/pfen8K2ZS1Valc0dpBuastlwjmx1i9MHOnOxkNmKCX5gV63sG0 QhNx4qs8EcG+yViw6yVOg== X-UI-Out-Filterresults: notjunk:1;V03:K0:CUlBbGnMMok=:0ljtwOt2l2F4QJpSyl8U3v G15afTqd6tNAU1X9YrAj3hJaQjxo9wnWttx3PbBZxucxrI1zyN/I+u8cX6p8J4Sk++fqGXMa6 xUZ+8WWFq5ZSr/i9EDzpo/9D8MiQL/TdKQoDZT2FidT3fAHqUNB833i3nvpjBY6KmTCeui9xE AYdqTM5cMNLQJrkgM/fzrsCdk/cLnne58nrtdEFn0BpMdBFwBS2+ZcNuVE+OMw1/g85bZkB8K 51MVKATSJN6LKkLcVuUZFh5L/n97toFySukkbvZSQl5ibJI5l5yIZ+e1RYcUKcEu3b++PGAtV DinbQiK6P93euylzOeXgqxMjFQSZFDCrV9NVveNo58ldAZLzKSLkuxrpRde2yNyaTVkcX/81N 04zjdTVOlPv8Q5r0RAgIZeAIZTT58tWiGmjxHjwxUtaqlHOTkM/6fHc8lbYyHh+T6KVYWTOzo LOeQ066WPAGMz5J8oBOQP1qbM4no4E49pNt8zboo1KmhjYi4e4QO9pdu6JwQiT8VNMwDfRePa DfWQ0YLBzEVqUbiEQkZEpYZg1TjdPai8eE35uAx9sCWWpIMezBTvGZZuK7bEyuMoMqPPkI4oZ BpMGl3xYAL3TywKh/mPfF/oZ2m6tsnIRkEn9IxOKE6u66R+h2U08aFZNI3jIxYmpuBNU4Ke75 TGtDNw7N/cLGFESTX08N4cNqA/eTS7LIZ5TPDN0uaW3T9ZiEQnSKxr1BwgJWgSiJYqRzjvBxv CLvrDU5vI+0Ook9H/LEc9u82dq79quzwZUcPzFUR9R3bqjDvnnWHj3kPIyQEKVXNIubg+itrG 7yNFo8XNZxU/Ts943gcRZAEVt2vgBt426b92rMuVeJx+Cmbj0rP+Qp5IpnrCpUt2pfW+Fu5Mh CB1Z7tra7h5iykXqI6Kg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_155010_829615_1D33DD4F X-CRM114-Status: GOOD ( 11.97 ) 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: Wed, 9 Dec 2020 21:34:48 +0100 A local variable was used only within an else branch. Thus move the definition for the variable “cs_fwnode” into the corresponding code block. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/hwtracing/coresight/coresight-cti-platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.29.2 diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c index 98f830c6ed50..ccef04f27f12 100644 --- a/drivers/hwtracing/coresight/coresight-cti-platform.c +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c @@ -343,7 +343,6 @@ static int cti_plat_create_connection(struct device *dev, { struct cti_trig_con *tc = NULL; int cpuid = -1, err = 0; - struct fwnode_handle *cs_fwnode = NULL; struct coresight_device *csdev = NULL; const char *assoc_name = "unknown"; char cpu_name_str[16]; @@ -397,8 +396,9 @@ static int cti_plat_create_connection(struct device *dev, assoc_name = cpu_name_str; } else { /* associated device ? */ - cs_fwnode = fwnode_find_reference(fwnode, - CTI_DT_CSDEV_ASSOC, 0); + struct fwnode_handle *cs_fwnode = fwnode_find_reference(fwnode, + CTI_DT_CSDEV_ASSOC, + 0); if (!IS_ERR(cs_fwnode)) { assoc_name = cti_plat_get_csdev_or_node_name(cs_fwnode, &csdev);