2023-11-16 17:22:18

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
drivers/hwtracing/intel_th/acpi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/hwtracing/intel_th/acpi.c b/drivers/hwtracing/intel_th/acpi.c
index 87f9024e4bbb..503620e9fd10 100644
--- a/drivers/hwtracing/intel_th/acpi.c
+++ b/drivers/hwtracing/intel_th/acpi.c
@@ -60,18 +60,16 @@ static int intel_th_acpi_probe(struct platform_device *pdev)
return 0;
}

-static int intel_th_acpi_remove(struct platform_device *pdev)
+static void intel_th_acpi_remove(struct platform_device *pdev)
{
struct intel_th *th = platform_get_drvdata(pdev);

intel_th_free(th);
-
- return 0;
}

static struct platform_driver intel_th_acpi_driver = {
.probe = intel_th_acpi_probe,
- .remove = intel_th_acpi_remove,
+ .remove_new = intel_th_acpi_remove,
.driver = {
.name = DRIVER_NAME,
.acpi_match_table = intel_th_acpi_ids,
--
2.42.0


2024-01-10 08:42:06

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Hello,

On Tue, Nov 07, 2023 at 09:28:26PM +0100, Uwe Kleine-K?nig wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
>
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-K?nig <[email protected]>

I didn't get any feedback to this patch and it didn't make it into next
up to now.

Is this still on someone's radar?

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |


Attachments:
(No filename) (1.13 kB)
signature.asc (499.00 B)
Download all attachments

2024-02-15 21:16:54

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Hello Alexander,

On Wed, Jan 10, 2024 at 09:41:54AM +0100, Uwe Kleine-K?nig wrote:
> Hello,
>
> On Tue, Nov 07, 2023 at 09:28:26PM +0100, Uwe Kleine-K?nig wrote:
> > The .remove() callback for a platform driver returns an int which makes
> > many driver authors wrongly assume it's possible to do error handling by
> > returning an error code. However the value returned is ignored (apart
> > from emitting a warning) and this typically results in resource leaks.
> >
> > To improve here there is a quest to make the remove callback return
> > void. In the first step of this quest all drivers are converted to
> > .remove_new(), which already returns void. Eventually after all drivers
> > are converted, .remove_new() will be renamed to .remove().
> >
> > Trivially convert this driver from always returning zero in the remove
> > callback to the void returning variant.
> >
> > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
>
> I didn't get any feedback to this patch and it didn't make it into next
> up to now.
>
> Is this still on someone's radar?

Is there a chance to get this patch into v6.9-rc1? Are you the right one
to talk to about this patch? (According to MAINTAINERS you are.)

The patch was sent during the 6.7 merge window and now already missed
the 6.8 one :-\

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |


Attachments:
(No filename) (1.48 kB)
signature.asc (499.00 B)
Download all attachments

2024-02-21 07:19:35

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Hello Greg,

On Thu, Feb 15, 2024 at 10:16:41PM +0100, Uwe Kleine-K?nig wrote:
> On Wed, Jan 10, 2024 at 09:41:54AM +0100, Uwe Kleine-K?nig wrote:
> > On Tue, Nov 07, 2023 at 09:28:26PM +0100, Uwe Kleine-K?nig wrote:
> > > The .remove() callback for a platform driver returns an int which makes
> > > many driver authors wrongly assume it's possible to do error handling by
> > > returning an error code. However the value returned is ignored (apart
> > > from emitting a warning) and this typically results in resource leaks.
> > >
> > > To improve here there is a quest to make the remove callback return
> > > void. In the first step of this quest all drivers are converted to
> > > .remove_new(), which already returns void. Eventually after all drivers
> > > are converted, .remove_new() will be renamed to .remove().
> > >
> > > Trivially convert this driver from always returning zero in the remove
> > > callback to the void returning variant.
> > >
> > > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> >
> > I didn't get any feedback to this patch and it didn't make it into next
> > up to now.
> >
> > Is this still on someone's radar?
>
> Is there a chance to get this patch into v6.9-rc1? Are you the right one
> to talk to about this patch? (According to MAINTAINERS you are.)
>
> The patch was sent during the 6.7 merge window and now already missed
> the 6.8 one :-\

I failed in several attempts to get feedback on this patch. You applied
the last two patches for this driver (that is all patches since the
driver was born). Would you care for that one, too? Tell me if you want
a resend. Note that the other 7 patches from this series are already
cared for, so if you're using b4 am or shazam, make use of -P7.

Thanks
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |


Attachments:
(No filename) (1.92 kB)
signature.asc (499.00 B)
Download all attachments

2024-02-21 22:09:01

by Alexander Shishkin

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Uwe Kleine-König <[email protected]> writes:

> Hello Greg,
>
> On Thu, Feb 15, 2024 at 10:16:41PM +0100, Uwe Kleine-König wrote:
>> On Wed, Jan 10, 2024 at 09:41:54AM +0100, Uwe Kleine-König wrote:
>> > On Tue, Nov 07, 2023 at 09:28:26PM +0100, Uwe Kleine-König wrote:
>> > > The .remove() callback for a platform driver returns an int which makes
>> > > many driver authors wrongly assume it's possible to do error handling by
>> > > returning an error code. However the value returned is ignored (apart
>> > > from emitting a warning) and this typically results in resource leaks.
>> > >
>> > > To improve here there is a quest to make the remove callback return
>> > > void. In the first step of this quest all drivers are converted to
>> > > .remove_new(), which already returns void. Eventually after all drivers
>> > > are converted, .remove_new() will be renamed to .remove().
>> > >
>> > > Trivially convert this driver from always returning zero in the remove
>> > > callback to the void returning variant.
>> > >
>> > > Signed-off-by: Uwe Kleine-König <[email protected]>
>> >
>> > I didn't get any feedback to this patch and it didn't make it into next
>> > up to now.
>> >
>> > Is this still on someone's radar?
>>
>> Is there a chance to get this patch into v6.9-rc1? Are you the right one
>> to talk to about this patch? (According to MAINTAINERS you are.)
>>
>> The patch was sent during the 6.7 merge window and now already missed
>> the 6.8 one :-\
>
> I failed in several attempts to get feedback on this patch. You applied
> the last two patches for this driver (that is all patches since the
> driver was born). Would you care for that one, too? Tell me if you want
> a resend. Note that the other 7 patches from this series are already
> cared for, so if you're using b4 am or shazam, make use of -P7.

Apologies. This looks good to me, I will pick it up for my next
submission to Greg unless somebody objects.

Regards,
--
Alex

2024-04-11 07:22:56

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Hello Alex,

On Wed, Feb 21, 2024 at 08:50:32PM +0200, Alexander Shishkin wrote:
> Uwe Kleine-K?nig <[email protected]> writes:
> > On Thu, Feb 15, 2024 at 10:16:41PM +0100, Uwe Kleine-K?nig wrote:
> >> On Wed, Jan 10, 2024 at 09:41:54AM +0100, Uwe Kleine-K?nig wrote:
> >> > On Tue, Nov 07, 2023 at 09:28:26PM +0100, Uwe Kleine-K?nig wrote:
> >> > > The .remove() callback for a platform driver returns an int which makes
> >> > > many driver authors wrongly assume it's possible to do error handling by
> >> > > returning an error code. However the value returned is ignored (apart
> >> > > from emitting a warning) and this typically results in resource leaks.
> >> > >
> >> > > To improve here there is a quest to make the remove callback return
> >> > > void. In the first step of this quest all drivers are converted to
> >> > > .remove_new(), which already returns void. Eventually after all drivers
> >> > > are converted, .remove_new() will be renamed to .remove().
> >> > >
> >> > > Trivially convert this driver from always returning zero in the remove
> >> > > callback to the void returning variant.
> >> > >
> >> > > Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> >> >
> >> > I didn't get any feedback to this patch and it didn't make it into next
> >> > up to now.
> >> >
> >> > Is this still on someone's radar?
> >>
> >> Is there a chance to get this patch into v6.9-rc1? Are you the right one
> >> to talk to about this patch? (According to MAINTAINERS you are.)
> >>
> >> The patch was sent during the 6.7 merge window and now already missed
> >> the 6.8 one :-\
> >
> > I failed in several attempts to get feedback on this patch. You applied
> > the last two patches for this driver (that is all patches since the
> > driver was born). Would you care for that one, too? Tell me if you want
> > a resend. Note that the other 7 patches from this series are already
> > cared for, so if you're using b4 am or shazam, make use of -P7.
>
> Apologies. This looks good to me, I will pick it up for my next
> submission to Greg unless somebody objects.

Given there are not that many patches left (~50) as of today's next, I'd
like to see this patch going in during the next merge window, that I can
finalize the (next step of the) quest around platform_driver::remove.

Is sending this patch to Greg still on your todo list?

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |


Attachments:
(No filename) (2.54 kB)
signature.asc (499.00 B)
Download all attachments

2024-04-15 10:32:00

by Alexander Shishkin

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Uwe Kleine-König <[email protected]> writes:

> Hello Alex,

Hi Uwe,

> Given there are not that many patches left (~50) as of today's next, I'd
> like to see this patch going in during the next merge window, that I can
> finalize the (next step of the) quest around platform_driver::remove.
>
> Is sending this patch to Greg still on your todo list?

Yes, as soon as I finalize other patches on my series. Should be soon.

Regards,
--
Alex

2024-04-29 07:13:45

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Hello Alex,

On Mon, Apr 15, 2024 at 09:48:27AM +0300, Alexander Shishkin wrote:
> Uwe Kleine-K?nig <[email protected]> writes:
> > Given there are not that many patches left (~50) as of today's next, I'd
> > like to see this patch going in during the next merge window, that I can
> > finalize the (next step of the) quest around platform_driver::remove.
> >
> > Is sending this patch to Greg still on your todo list?
>
> Yes, as soon as I finalize other patches on my series. Should be soon.

I know neither your nor Greg's plans, but I wonder if this patch will
make it into v6.10-rc1 given that it still didn't land in next yet.

I intend to change the prototype of platform_driver::remove() after the
merge window leading to v6.10-rc1 closes to cook in next for some time.
If this patch doesn't make it into the mainline before, I'll send it
together with the change adapting the remove callback. That will go in
via Greg's tree, too.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |


Attachments:
(No filename) (1.13 kB)
signature.asc (499.00 B)
Download all attachments

2024-04-29 12:24:34

by Alexander Shishkin

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Uwe Kleine-König <[email protected]> writes:

> Hello Alex,

Hi Uwe,

> On Mon, Apr 15, 2024 at 09:48:27AM +0300, Alexander Shishkin wrote:
>> Uwe Kleine-König <[email protected]> writes:
>> > Given there are not that many patches left (~50) as of today's next, I'd
>> > like to see this patch going in during the next merge window, that I can
>> > finalize the (next step of the) quest around platform_driver::remove.
>> >
>> > Is sending this patch to Greg still on your todo list?
>>
>> Yes, as soon as I finalize other patches on my series. Should be soon.
>
> I know neither your nor Greg's plans, but I wonder if this patch will
> make it into v6.10-rc1 given that it still didn't land in next yet.

I've just sent my series [0].

> I intend to change the prototype of platform_driver::remove() after the
> merge window leading to v6.10-rc1 closes to cook in next for some time.
> If this patch doesn't make it into the mainline before, I'll send it
> together with the change adapting the remove callback. That will go in
> via Greg's tree, too.

I saw that you included this patch with your series earlier today, so I
dropped it from my series [0]. FWIW, you can add

Acked-by: Alexander Shishkin <[email protected]>

to that patch if it helps. If you want me to pick it up again, let me
know. Apologies for the repeated tardiness in handling this.

[0] https://lore.kernel.org/all/[email protected]/

Regards,
--
Alex

2024-04-29 12:30:17

by Alexander Shishkin

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Alexander Shishkin <[email protected]> writes:

> Uwe Kleine-König <[email protected]> writes:
>> I intend to change the prototype of platform_driver::remove() after the
>> merge window leading to v6.10-rc1 closes to cook in next for some time.
>> If this patch doesn't make it into the mainline before, I'll send it
>> together with the change adapting the remove callback. That will go in
>> via Greg's tree, too.
>
> I saw that you included this patch with your series earlier today, so I

Wait, did I hallucinate this? I can't find your new series now. Ugh.
If so, I'll put your patch back in and re-send my series right away.

Regards,
--
Alex

2024-04-29 16:29:20

by Alexander Shishkin

[permalink] [raw]
Subject: Re: [PATCH 7/8] intel_th: Convert to platform remove callback returning void

Alexander Shishkin <[email protected]> writes:

> Alexander Shishkin <[email protected]> writes:
>
>> Uwe Kleine-König <[email protected]> writes:
>>> I intend to change the prototype of platform_driver::remove() after the
>>> merge window leading to v6.10-rc1 closes to cook in next for some time.
>>> If this patch doesn't make it into the mainline before, I'll send it
>>> together with the change adapting the remove callback. That will go in
>>> via Greg's tree, too.
>>
>> I saw that you included this patch with your series earlier today, so I
>
> Wait, did I hallucinate this? I can't find your new series now. Ugh.
> If so, I'll put your patch back in and re-send my series right away.

Series re-sent [0]. Sorry for the mess.

[0] https://lore.kernel.org/all/[email protected]/

Regards,
--
Alex