Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp287278pxu; Fri, 11 Dec 2020 02:19:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJz42wSmeAqnP2mp4EC15E+bkolhM6MlwBVIBdaK299cUu1KwCeCMuPKfn6f2+g9CYqN4Hjk X-Received: by 2002:aa7:dc0d:: with SMTP id b13mr11209153edu.170.1607681941799; Fri, 11 Dec 2020 02:19:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607681941; cv=none; d=google.com; s=arc-20160816; b=Oxse/LJXG0dKMZZr/1Qug50fKIaOavuy/rxgawVTMZRgvRez6gX2coLdi+lP9F91a2 vl6GYvzpk0zsoA7b0YIAWG0I9vuQiWm+dzJpYOHN4tzMcUyEyvTUIJGTKokSaSWvSxDA AkXX0aqX0+IBkhcQ03yerRoog4jsR+eyt9OXTfTsNlPb9DhUK073l9n9nLHvurBKICwP e1BQQFQJRA+MKtrud3KfCTUVqgF8f8NRn5mDqSTbZ+sTYt21Bg/3OhFOfs+KA9exBmEw HqwR3hyM+xdoK6Rkm/yjKFOBR8tLGyRZcg5NNVs3xH7dFlcKVxoAr4bl58q4fLhXLVvk RHgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+ZVJHFSrcvg/rM3/coktBI0ATZzEEYOYnQ3lqpo3zPA=; b=dz5sc1YUGJ0v7mvY7VjUFZOWUxLXxPo4c5F/mAWj56DLeDS9N/kSQe8Ni4STlpOCvE cPNuZGl4jvzL9ma7SJ2lcq14Dnl098P3xsd2yH3udpJrBh3pvnkdrZF01k8LjqAcacnx RwvgBhWwdrq5SpNnotZzRMFXPQxl6tuZb7A4S+K2BeU/HNJJYCI+Hz0C7qSsZ5UZE8j8 6Q5ELmYQ4ganLvBjx5mGqsLaYblntqCuOVPk+9trmLL9XL2/1NPEVYnYSXkt8syMtpA3 mFf2PYXfKNAI6AZRqTpsuGkAtkfeH1NoTNXmLWS6da51DajfdxchvAsHYZ620tXpfeiV hDyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hqUoJ4fB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a27si4549026edb.498.2020.12.11.02.18.39; Fri, 11 Dec 2020 02:19:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hqUoJ4fB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392947AbgLJXNz (ORCPT + 99 others); Thu, 10 Dec 2020 18:13:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391866AbgLJXNR (ORCPT ); Thu, 10 Dec 2020 18:13:17 -0500 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7BBEC0611CC for ; Thu, 10 Dec 2020 14:37:20 -0800 (PST) Received: by mail-oi1-x243.google.com with SMTP id d27so7638159oic.0 for ; Thu, 10 Dec 2020 14:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=+ZVJHFSrcvg/rM3/coktBI0ATZzEEYOYnQ3lqpo3zPA=; b=hqUoJ4fB1Go3B36ZXoSqCONvRMX3UglfC0KFpIREBDUqSWlcaJ1Fm51MG+zW7WCsaB t5XbdNuLFtPEIXQT0X0ZxGOtWF6Nef85e39e5KDbKVh6mzlonrCXEkMLk25rYa/hQsKv L1h8KGq/nzTDSQpUfRZyKWFuOU+G5Xukb3vBB3x5KBw3oLNh1hV6eDrJXgvUPMZ4y3TV F5ry2bcvkM767TUXw9gdlLo9jmrX/Orp6n1CD+DL+YBtVb74nA2j8b/p/zZcZsSpxaxN l9ZCYWlZArdz5YXxdg9flTbNqQ7E8IkaM6BMFSxcOjMimBwn5fA+DF0RQjPmAFhrMkST EG6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=+ZVJHFSrcvg/rM3/coktBI0ATZzEEYOYnQ3lqpo3zPA=; b=MYoK69occj2szltuVLFKkDbBqyjO23OGVg7YMFYwUcGKnfbvu+WFyqmMM8trW9QWa2 8mDV4Sb5T013n8bWbFW5cT7ze2wWBdM68J8OO/8Gij0ynbL4XqLwdXJkuV1zS9VoGduP akLMH7UefbDN0Mjv5aYFPRO7Q8tuhAK7N9pievGEsitzSaeXzTDghMChkaUX8F1wvTTS n5C8bhkWlhTvb/+ZK2L4hmf2NifHzTfzQ8jKfhVhpF2KxEhzUCoMdCFsk41zSXpHfVCe RfimdeoeE+8e1Sg7LQun18n6lQBDkTigsniSYUPJQZbTQByIxjms6x9YDXm3fFw8PTO5 Lzsg== X-Gm-Message-State: AOAM532TQPtDHMH62Ac2l/ydSmrmV9lTwGB3QZiUdAma4aFO+ih8tm1O tl0iFo+QPMGkm8qLtB/0KI+jeIHQm7mZubZ7 X-Received: by 2002:a17:90a:d194:: with SMTP id fu20mr6126132pjb.111.1607637343315; Thu, 10 Dec 2020 13:55:43 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id 77sm6915281pfx.156.2020.12.10.13.55.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 13:55:42 -0800 (PST) Date: Thu, 10 Dec 2020 14:55:40 -0700 From: Mathieu Poirier To: Markus Elfring Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Alexander Shishkin , Leo Yan , Mike Leach , "Suzuki K. Poulose" , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH] coresight: cti: =?utf-8?Q?Redu?= =?utf-8?Q?ce_scope_for_the_variable_=E2=80=9Ccs=5Ffwnode?= =?utf-8?B?4oCd?= in cti_plat_create_connection() Message-ID: <20201210215540.GA1860012@xps15> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 09:42:20PM +0100, Markus Elfring wrote: > 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(-) > > 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); I have applied your patch. Thanks, Mathieu > if (!IS_ERR(cs_fwnode)) { > assoc_name = cti_plat_get_csdev_or_node_name(cs_fwnode, > &csdev); > -- > 2.29.2 >