Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F84AC77B7F for ; Tue, 16 May 2023 11:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bIhvPWbfSAjxIjQXp5OftcqWbGYK1g961Lu4KY9Am+o=; b=W3100+PGGVKWmz EgYKJ8iZ9C/PpTK+fBfEABVAHVtaiDxB4/HAlx1HwRQcr/eT0ZX25ZB4OFj+3qDLHWNPENIxdjG/5 YWfqI2/yvkzhmcDgqJoMAgKRcvlK1BGzR+2ngOazA9v6zylvSfLFOZCF41B3o6Jy3bGgRIpylGF27 3IwLRdB4PFuDhy4jYa5W9YxzJXiJx0c5wnjW9GCjvSnc9R7TraChCww2W2NENvdHRKpd82rWw0VW+ 7921lA5RSbbl3QZ0r22RB8hD2+Y4hmBu3MXACFh3d0g6gU8IV15sZUj1IoqBWCaPsOLBdvj2DoFb2 0k+CnK+TULdhPjHJHv2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pysby-005XeN-2h; Tue, 16 May 2023 11:12:58 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pysbn-005XPO-2o for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 11:12:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B66C52F4; Tue, 16 May 2023 04:12:42 -0700 (PDT) Received: from [10.163.71.75] (unknown [10.163.71.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C1CC03F663; Tue, 16 May 2023 04:11:51 -0700 (PDT) Message-ID: Date: Tue, 16 May 2023 16:41:48 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH V2 2/5] coresight: etm4x: Drop iomem 'base' argument from etm4_probe() Content-Language: en-US To: James Clark , linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, suzuki.poulose@arm.com Cc: scclevenger@os.amperecomputing.com, Rob Herring , Frank Rowand , Russell King , Greg Kroah-Hartman , "Rafael J. Wysocki" , Len Brown , Sudeep Holla , Lorenzo Pieralisi , Mathieu Poirier , Mike Leach , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230327050537.30861-1-anshuman.khandual@arm.com> <20230327050537.30861-3-anshuman.khandual@arm.com> <60e86c22-ca05-81a0-da0a-73928e4b2c93@arm.com> From: Anshuman Khandual In-Reply-To: <60e86c22-ca05-81a0-da0a-73928e4b2c93@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_041248_002402_520C8EF6 X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 4/4/23 20:52, James Clark wrote: > > On 27/03/2023 06:05, Anshuman Khandual wrote: >> 'struct etm4_drvdata' itself can carry the base address before etm4_probe() >> gets called. Just drop that redundant argument from etm4_probe(). >> >> Cc: Mathieu Poirier >> Cc: Suzuki K Poulose >> Cc: Mike Leach >> Cc: Leo Yan >> Cc: coresight@lists.linaro.org >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual >> --- >> drivers/hwtracing/coresight/coresight-etm4x-core.c | 10 +++++----- >> 1 file changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> index 10119c223fbe..5d77571a8df9 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> @@ -2048,7 +2048,7 @@ static int etm4_add_coresight_dev(struct etm4_init_arg *init_arg) >> return 0; >> } >> >> -static int etm4_probe(struct device *dev, void __iomem *base, u32 etm_pid) >> +static int etm4_probe(struct device *dev, u32 etm_pid) >> { >> struct etmv4_drvdata *drvdata = dev_get_drvdata(dev); >> struct csdev_access access = { 0 }; >> @@ -2069,8 +2069,6 @@ static int etm4_probe(struct device *dev, void __iomem *base, u32 etm_pid) >> return -ENOMEM; >> } >> >> - drvdata->base = base; >> - >> spin_lock_init(&drvdata->spinlock); >> >> drvdata->cpu = coresight_get_cpu(dev); >> @@ -2124,8 +2122,9 @@ static int etm4_probe_amba(struct amba_device *adev, const struct amba_id *id) >> if (!drvdata) >> return -ENOMEM; >> >> + drvdata->base = base; >> dev_set_drvdata(dev, drvdata); >> - ret = etm4_probe(dev, base, id->id); >> + ret = etm4_probe(dev, id->id); >> if (!ret) >> pm_runtime_put(&adev->dev); >> >> @@ -2141,6 +2140,7 @@ static int etm4_probe_platform_dev(struct platform_device *pdev) >> if (!drvdata) >> return -ENOMEM; >> >> + drvdata->base = NULL; > Very minor point, drvdata is zero alloced so it doesn't make sense to > zero this field but not the others. It's harmless, but it might imply > something and confuse someone. Just to keep changes to both call sites of etm4_probe() similar i.e etm4_probe()'s 'base' argument being pre-assigned as drvdata->base, let's keep the NULL assignment above unchanged. > > Either way: > Reviewed-by: James Clark > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel