* [PATCH] ipmi: Drop explicit initialization of struct i2c_device_id::driver_data to 0
@ 2024-07-08 15:09 Uwe Kleine-König
2024-07-08 20:06 ` Corey Minyard
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2024-07-08 15:09 UTC (permalink / raw)
To: Corey Minyard; +Cc: openipmi-developer, linux-kernel
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.
While at it, also remove commas after the sentinel entries.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/char/ipmi/ipmb_dev_int.c | 4 ++--
drivers/char/ipmi/ipmi_ipmb.c | 4 ++--
drivers/char/ipmi/ipmi_ssif.c | 2 +-
drivers/char/ipmi/ssif_bmc.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c
index 49100845fcb7..7296127181ec 100644
--- a/drivers/char/ipmi/ipmb_dev_int.c
+++ b/drivers/char/ipmi/ipmb_dev_int.c
@@ -350,8 +350,8 @@ static void ipmb_remove(struct i2c_client *client)
}
static const struct i2c_device_id ipmb_id[] = {
- { "ipmb-dev", 0 },
- {},
+ { "ipmb-dev" },
+ {}
};
MODULE_DEVICE_TABLE(i2c, ipmb_id);
diff --git a/drivers/char/ipmi/ipmi_ipmb.c b/drivers/char/ipmi/ipmi_ipmb.c
index 4e335832fc26..6a4f279c7c1f 100644
--- a/drivers/char/ipmi/ipmi_ipmb.c
+++ b/drivers/char/ipmi/ipmi_ipmb.c
@@ -561,8 +561,8 @@ MODULE_DEVICE_TABLE(of, of_ipmi_ipmb_match);
#endif
static const struct i2c_device_id ipmi_ipmb_id[] = {
- { DEVICE_NAME, 0 },
- {},
+ { DEVICE_NAME },
+ {}
};
MODULE_DEVICE_TABLE(i2c, ipmi_ipmb_id);
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 3f509a22217b..96ad571d041a 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -2049,7 +2049,7 @@ static int dmi_ipmi_probe(struct platform_device *pdev)
#endif
static const struct i2c_device_id ssif_id[] = {
- { DEVICE_NAME, 0 },
+ { DEVICE_NAME },
{ }
};
MODULE_DEVICE_TABLE(i2c, ssif_id);
diff --git a/drivers/char/ipmi/ssif_bmc.c b/drivers/char/ipmi/ssif_bmc.c
index ab4e87a99f08..a14fafc583d4 100644
--- a/drivers/char/ipmi/ssif_bmc.c
+++ b/drivers/char/ipmi/ssif_bmc.c
@@ -852,8 +852,8 @@ static const struct of_device_id ssif_bmc_match[] = {
MODULE_DEVICE_TABLE(of, ssif_bmc_match);
static const struct i2c_device_id ssif_bmc_id[] = {
- { DEVICE_NAME, 0 },
- { },
+ { DEVICE_NAME },
+ { }
};
MODULE_DEVICE_TABLE(i2c, ssif_bmc_id);
base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ipmi: Drop explicit initialization of struct i2c_device_id::driver_data to 0
2024-07-08 15:09 [PATCH] ipmi: Drop explicit initialization of struct i2c_device_id::driver_data to 0 Uwe Kleine-König
@ 2024-07-08 20:06 ` Corey Minyard
0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2024-07-08 20:06 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Corey Minyard, openipmi-developer, linux-kernel
On Mon, Jul 08, 2024 at 05:09:12PM +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.
>
> While at it, also remove commas after the sentinel entries.
I've pulled this into my tree.
Thanks,
-corey
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/char/ipmi/ipmb_dev_int.c | 4 ++--
> drivers/char/ipmi/ipmi_ipmb.c | 4 ++--
> drivers/char/ipmi/ipmi_ssif.c | 2 +-
> drivers/char/ipmi/ssif_bmc.c | 4 ++--
> 4 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c
> index 49100845fcb7..7296127181ec 100644
> --- a/drivers/char/ipmi/ipmb_dev_int.c
> +++ b/drivers/char/ipmi/ipmb_dev_int.c
> @@ -350,8 +350,8 @@ static void ipmb_remove(struct i2c_client *client)
> }
>
> static const struct i2c_device_id ipmb_id[] = {
> - { "ipmb-dev", 0 },
> - {},
> + { "ipmb-dev" },
> + {}
> };
> MODULE_DEVICE_TABLE(i2c, ipmb_id);
>
> diff --git a/drivers/char/ipmi/ipmi_ipmb.c b/drivers/char/ipmi/ipmi_ipmb.c
> index 4e335832fc26..6a4f279c7c1f 100644
> --- a/drivers/char/ipmi/ipmi_ipmb.c
> +++ b/drivers/char/ipmi/ipmi_ipmb.c
> @@ -561,8 +561,8 @@ MODULE_DEVICE_TABLE(of, of_ipmi_ipmb_match);
> #endif
>
> static const struct i2c_device_id ipmi_ipmb_id[] = {
> - { DEVICE_NAME, 0 },
> - {},
> + { DEVICE_NAME },
> + {}
> };
> MODULE_DEVICE_TABLE(i2c, ipmi_ipmb_id);
>
> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
> index 3f509a22217b..96ad571d041a 100644
> --- a/drivers/char/ipmi/ipmi_ssif.c
> +++ b/drivers/char/ipmi/ipmi_ssif.c
> @@ -2049,7 +2049,7 @@ static int dmi_ipmi_probe(struct platform_device *pdev)
> #endif
>
> static const struct i2c_device_id ssif_id[] = {
> - { DEVICE_NAME, 0 },
> + { DEVICE_NAME },
> { }
> };
> MODULE_DEVICE_TABLE(i2c, ssif_id);
> diff --git a/drivers/char/ipmi/ssif_bmc.c b/drivers/char/ipmi/ssif_bmc.c
> index ab4e87a99f08..a14fafc583d4 100644
> --- a/drivers/char/ipmi/ssif_bmc.c
> +++ b/drivers/char/ipmi/ssif_bmc.c
> @@ -852,8 +852,8 @@ static const struct of_device_id ssif_bmc_match[] = {
> MODULE_DEVICE_TABLE(of, ssif_bmc_match);
>
> static const struct i2c_device_id ssif_bmc_id[] = {
> - { DEVICE_NAME, 0 },
> - { },
> + { DEVICE_NAME },
> + { }
> };
> MODULE_DEVICE_TABLE(i2c, ssif_bmc_id);
>
>
> base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-08 20:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-08 15:09 [PATCH] ipmi: Drop explicit initialization of struct i2c_device_id::driver_data to 0 Uwe Kleine-König
2024-07-08 20:06 ` Corey Minyard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®