* [PATCH] coresight: etm4x: return 0 instead of using local ret variable
@ 2022-04-20 5:28 ` Shile Zhang
0 siblings, 0 replies; 6+ messages in thread
From: Shile Zhang @ 2022-04-20 5:28 UTC (permalink / raw)
To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
Cc: coresight, linux-arm-kernel, linux-kernel, Shile Zhang
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.
Just backport the changes of etm4_remove_dev and return 0 directly in it's
caller function etm4_remove_platform_dev.
Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
---
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;
}
static const struct amba_id etm4_ids[] = {
--
2.33.0.rc2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] coresight: etm4x: return 0 instead of using local ret variable
@ 2022-04-20 5:28 ` Shile Zhang
0 siblings, 0 replies; 6+ messages in thread
From: Shile Zhang @ 2022-04-20 5:28 UTC (permalink / raw)
To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
Cc: coresight, linux-arm-kernel, linux-kernel, Shile Zhang
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.
Just backport the changes of etm4_remove_dev and return 0 directly in it's
caller function etm4_remove_platform_dev.
Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
---
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;
}
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] 6+ messages in thread
* Re: [PATCH] coresight: etm4x: return 0 instead of using local ret variable
2022-04-20 5:28 ` Shile Zhang
@ 2022-04-21 16:42 ` Mathieu Poirier
-1 siblings, 0 replies; 6+ messages in thread
From: Mathieu Poirier @ 2022-04-21 16:42 UTC (permalink / raw)
To: Shile Zhang
Cc: Suzuki K Poulose, Alexander Shishkin, coresight,
linux-arm-kernel, linux-kernel
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.
>
> 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.
>
> Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
> ---
> 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,
Mathieu
> }
>
> static const struct amba_id etm4_ids[] = {
> --
> 2.33.0.rc2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] coresight: etm4x: return 0 instead of using local ret variable
@ 2022-04-21 16:42 ` Mathieu Poirier
0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Poirier @ 2022-04-21 16:42 UTC (permalink / raw)
To: Shile Zhang
Cc: Suzuki K Poulose, Alexander Shishkin, coresight,
linux-arm-kernel, linux-kernel
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.
>
> 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.
>
> Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
> ---
> 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,
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] coresight: etm4x: return 0 instead of using local ret variable
2022-04-21 16:42 ` Mathieu Poirier
@ 2022-04-22 1:43 ` Shile Zhang
-1 siblings, 0 replies; 6+ messages in thread
From: Shile Zhang @ 2022-04-22 1:43 UTC (permalink / raw)
To: Mathieu Poirier
Cc: Suzuki K Poulose, Alexander Shishkin, coresight,
linux-arm-kernel, linux-kernel
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 <shile.zhang@linux.alibaba.com>
>> ---
>> 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
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] coresight: etm4x: return 0 instead of using local ret variable
@ 2022-04-22 1:43 ` Shile Zhang
0 siblings, 0 replies; 6+ messages in thread
From: Shile Zhang @ 2022-04-22 1:43 UTC (permalink / raw)
To: Mathieu Poirier
Cc: Suzuki K Poulose, Alexander Shishkin, coresight,
linux-arm-kernel, linux-kernel
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 <shile.zhang@linux.alibaba.com>
>> ---
>> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-04-22 1:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 5:28 [PATCH] coresight: etm4x: return 0 instead of using local ret variable Shile Zhang
2022-04-20 5:28 ` Shile Zhang
2022-04-21 16:42 ` Mathieu Poirier
2022-04-21 16:42 ` Mathieu Poirier
2022-04-22 1:43 ` Shile Zhang
2022-04-22 1:43 ` Shile Zhang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.