From mboxrd@z Thu Jan 1 00:00:00 1970 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 D2CDAC433EF for ; Fri, 22 Apr 2022 01:45:34 +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-Type: Content-Transfer-Encoding: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=NG51D1L2IbtHjilUaiAIvEvtkUfYaNgtFL14FILUx/U=; b=XGcXn5eofQsTTq 6xZaTP4cqBmSfe5KXteyZYeITy6tJAhhECklJ15t7lm9LH1fjNAoed+PqrWh2bM2ldLlI+l0xOpBy wqJPZzjlX6aQMCMjHUCT6GfMWBdQKg4LWBjaZPnjlpxh7yV4WRDb34T+jvoS0kD33/AJZx4MM3sa+ I1bdVEbgsM8yrzNjGHqJf+UHFiV93qxGZOQsP0Wwm/65hGOKa+VT3VZRNtr1UUM7UidVmFOw7p3Il NDMVvpSN419XOAsuAUqRC4RVdgSeUNb8YK4FViaCS53vV324zQPv5/GWVK3tdcZeyrIBd9TNoGA0v uU03mUu0/+XOst6JpD0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhiKx-00Fbmj-D8; Fri, 22 Apr 2022 01:43:55 +0000 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhiKt-00FblP-A0 for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2022 01:43:53 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R171e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04407; MF=shile.zhang@linux.alibaba.com; NM=1; PH=DS; RN=6; SR=0; TI=SMTPD_---0VAjQwRe_1650591824; Received: from 30.225.28.226(mailfrom:shile.zhang@linux.alibaba.com fp:SMTPD_---0VAjQwRe_1650591824) by smtp.aliyun-inc.com(127.0.0.1); Fri, 22 Apr 2022 09:43:45 +0800 Message-ID: <39c304b4-517b-6433-767d-540407adfb08@linux.alibaba.com> Date: Fri, 22 Apr 2022 09:43:44 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] coresight: etm4x: return 0 instead of using local ret variable Content-Language: en-US To: Mathieu Poirier Cc: Suzuki K Poulose , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220420052831.78566-1-shile.zhang@linux.alibaba.com> <20220421164217.GB1596562@p14s> From: Shile Zhang In-Reply-To: <20220421164217.GB1596562@p14s> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220421_184351_569759_5C4567B7 X-CRM114-Status: GOOD ( 26.77 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022/4/22 00:42, Mathieu Poirier wrote: > Hi Shile, > > On Wed, Apr 20, 2022 at 01:28:31PM +0800, Shile Zhang wrote: >> The etm4_remove function (now it's rename to etm4_remove_dev) always >> return 0, and it has been changed to void in commit 4fd269e74f2f >> ("amba: Make the remove callback return void"). But its weird that the >> changes is gone in mainline. which is remained in 5.10.y branch. > > Commit 4fd269e74f2f is not valid upstream. Changes that don't have a critical > impact on user experience or fix a bug aren't backported to longterm kernels. > Sorry, I used wrong commit id, but this patch is merged in mainline with 3fd269e74f2fe ("amba: Make the remove callback return void") It can be checked from here: https://github.com/torvalds/linux/commit/3fd269e74f2fe#diff-937c525e02a9fea8fe99b3d91b9f87ca097b3392de5fea3d4ff56cec8b08c94aL1683 >> >> Just backport the changes of etm4_remove_dev and return 0 directly in it's >> caller function etm4_remove_platform_dev. > > I'm not sure why the work "backport" is used here since this patch is destine > for mainline. > Yes, maybe "backport" here is not OK, I'll re-work it in next version later. Thanks! >> >> Signed-off-by: Shile Zhang >> --- >> drivers/hwtracing/coresight/coresight-etm4x-core.c | 11 +++++------ >> 1 file changed, 5 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> index 7f416a12000e..141f8209a152 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> @@ -2104,7 +2104,7 @@ static void clear_etmdrvdata(void *info) >> etmdrvdata[cpu] = NULL; >> } >> >> -static int __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) >> +static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) >> { >> etm_perf_symlink(drvdata->csdev, false); >> /* >> @@ -2125,8 +2125,6 @@ static int __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) >> >> cscfg_unregister_csdev(drvdata->csdev); >> coresight_unregister(drvdata->csdev); >> - >> - return 0; >> } >> >> static void __exit etm4_remove_amba(struct amba_device *adev) >> @@ -2139,13 +2137,14 @@ static void __exit etm4_remove_amba(struct amba_device *adev) >> >> static int __exit etm4_remove_platform_dev(struct platform_device *pdev) >> { >> - int ret = 0; >> struct etmv4_drvdata *drvdata = dev_get_drvdata(&pdev->dev); >> >> if (drvdata) >> - ret = etm4_remove_dev(drvdata); >> + etm4_remove_dev(drvdata); >> + >> pm_runtime_disable(&pdev->dev); >> - return ret; >> + >> + return 0; > > I'm fine with the code but the changelog needs to be re-worked. The only > rational for this patch is that the return value for function etm4_remove_dev() > is never used and as such being removed. > Thanks for your comments, I'll send V2 later. > Thanks, > Mathieu > >> } >> >> static const struct amba_id etm4_ids[] = { >> -- >> 2.33.0.rc2 >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel