RE: Re: [PATCH] extcon: Drop explicit initialization of struct i2c_device_id::driver_data to 0
From: MyungJoo Ham
Date: Sat Dec 07 2024 - 00:13:23 EST
>Hello MyungJoo,
>
>On Thu, Dec 05, 2024 at 12:58:14PM +0900, MyungJoo Ham wrote:
>> >On Wed, Sep 18, 2024 at 02:31:48PM +0200, Uwe Kleine-König wrote:
>> >> These drivers don't use the driver_data member of struct i2c_device_id,
>> >> so don't explicitly initialize this member.
>> >>
>> >> This prepares putting driver_data in an anonymous union which requires
>> >> either no initialization or named designators. But it's also a nice
>> >> cleanup on its own.
>> >>
>> >> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
>> >
>> >That patch got some positive feedback by Krzysztof but wasn't applied.
>> >Is this still on someone's radar for application?
>>
>> Can you provide a link to a commit that requires this change?
>>
>> For now, I don't see any benefit from this change.
>
>So the explicit initialisation of .driver_data that then isn't used
>doesn't look strange enough to you to drop it?
>
>Would you prefer
>
>--- a/drivers/extcon/extcon-fsa9480.c
>+++ b/drivers/extcon/extcon-fsa9480.c
>@@ -350,7 +350,7 @@ static const struct dev_pm_ops fsa9480_pm_ops = {
> };
>
> static const struct i2c_device_id fsa9480_id[] = {
>- { "fsa9480", 0 },
>+ { .name = "fsa9480", .driver_data = 0, },
> {}
> };
> MODULE_DEVICE_TABLE(i2c, fsa9480_id);
>
>then?
>
>Anyhow: The most recent presentation of the quest is at
>https://lore.kernel.org/linux-iio/20241204150036.1695824-2-u.kleine-koenig@xxxxxxxxxxxx.
Hi,
That link explains it.
It'd have been easier to see if that link or the pending changes on i2c_device_id
were mentioned.
Chanwoo: please take a look.
Cheers,
MyungJoo
(For the original "extcon: Drop explicit initialization of struct i2c_device_id::driver_data to 0")
Acked-by: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx>