linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] coresight: etm4x: return 0 instead of using local ret variable
@ 2022-04-22  2:02 Shile Zhang
  2022-04-22 15:45 ` Mathieu Poirier
  0 siblings, 1 reply; 4+ messages in thread
From: Shile Zhang @ 2022-04-22  2:02 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
  Cc: coresight, linux-arm-kernel, linux-kernel, Shile Zhang

The function etm4_remove_dev() always return 0, and the former function
etm4_remove has been changed to void in commit 3fd269e74f2fe ("amba: Make
the remove callback return void"). But now its changed back to int type
for some reason, which is different to the stable branch linux-5.10.y.

Just let it return void and return 0 directly in it's caller function
etm4_remove_platform_dev.

Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
---
v2: re-work the commit log from Mathieu's suggestion.
v1: https://lore.kernel.org/linux-arm-kernel/20220421164217.GB1596562@p14s/T/
---
 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 7f416a12000eb..141f8209a152a 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;
 }
 
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-25 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22  2:02 [PATCH v2] coresight: etm4x: return 0 instead of using local ret variable Shile Zhang
2022-04-22 15:45 ` Mathieu Poirier
2022-04-24  6:57   ` Shile Zhang
2022-04-25 16:10     ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).