[PATCH] w1: ds2482: Drop explicit initialization of struct i2c_device_id::driver_data to 0

Uwe Kleine-König posted 1 patch 1 month, 2 weeks ago
There is a newer version of this series
drivers/w1/masters/ds2482.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] w1: ds2482: Drop explicit initialization of struct i2c_device_id::driver_data to 0
Posted by Uwe Kleine-König 1 month, 2 weeks ago
This driver doesn'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@baylibre.com>
---
 drivers/w1/masters/ds2482.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index b2d76c1784bd..a2ecbb863c57 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -541,8 +541,8 @@ static void ds2482_remove(struct i2c_client *client)
  * Driver data (common to all clients)
  */
 static const struct i2c_device_id ds2482_id[] = {
-	{ "ds2482", 0 },
-	{ "ds2484", 0 },
+	{ "ds2482" },
+	{ "ds2484" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ds2482_id);

base-commit: 864b1099d16fc7e332c3ad7823058c65f890486c
-- 
2.43.0

Re: [PATCH] w1: ds2482: Drop explicit initialization of struct i2c_device_id::driver_data to 0
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On Thu, 25 Jul 2024 18:09:07 +0200, Uwe Kleine-König wrote:
> This driver doesn'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.
> 
> [...]

Applied, thanks!

[1/1] w1: ds2482: Drop explicit initialization of struct i2c_device_id::driver_data to 0
      https://git.kernel.org/krzk/linux-w1/c/e940ff286ec47067cf5043fde41bea45d7ec4a5f

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Re: [PATCH] w1: ds2482: Drop explicit initialization of struct i2c_device_id::driver_data to 0
Posted by Wolfram Sang 1 month, 2 weeks ago
On Thu, Jul 25, 2024 at 06:09:07PM +0200, Uwe Kleine-König wrote:
> This driver doesn'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@baylibre.com>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>