Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] staging: iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0
@ 2024-06-06 15:54 Uwe Kleine-König
  2024-06-07  9:23 ` Nuno Sá
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2024-06-06 15:54 UTC (permalink / raw)
  To: Jonathan Cameron, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, linux-iio, linux-staging

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@baylibre.com>
---
 drivers/staging/iio/addac/adt7316-i2c.c         | 12 ++++++------
 drivers/staging/iio/impedance-analyzer/ad5933.c |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c
index 6c1f91c859ca..e6ad088636f6 100644
--- a/drivers/staging/iio/addac/adt7316-i2c.c
+++ b/drivers/staging/iio/addac/adt7316-i2c.c
@@ -109,12 +109,12 @@ static int adt7316_i2c_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id adt7316_i2c_id[] = {
-	{ "adt7316", 0 },
-	{ "adt7317", 0 },
-	{ "adt7318", 0 },
-	{ "adt7516", 0 },
-	{ "adt7517", 0 },
-	{ "adt7519", 0 },
+	{ "adt7316" },
+	{ "adt7317" },
+	{ "adt7318" },
+	{ "adt7516" },
+	{ "adt7517" },
+	{ "adt7519" },
 	{ }
 };
 
diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index b7af5fe63e09..cd00d9607565 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -721,8 +721,8 @@ static int ad5933_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id ad5933_id[] = {
-	{ "ad5933", 0 },
-	{ "ad5934", 0 },
+	{ "ad5933" },
+	{ "ad5934" },
 	{}
 };
 

base-commit: ee78a17615ad0cfdbbc27182b1047cd36c9d4d5f
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0
  2024-06-06 15:54 [PATCH] staging: iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0 Uwe Kleine-König
@ 2024-06-07  9:23 ` Nuno Sá
  2024-06-08 17:23   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Nuno Sá @ 2024-06-07  9:23 UTC (permalink / raw)
  To: Uwe Kleine-König, Jonathan Cameron, Greg Kroah-Hartman
  Cc: Lars-Peter Clausen, Michael Hennerich, linux-iio, linux-staging

On Thu, 2024-06-06 at 17:54 +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@baylibre.com>
> ---

Reviewed-by: Nuno Sa <nuno.sa@analog.com>

- Nuno Sá



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0
  2024-06-07  9:23 ` Nuno Sá
@ 2024-06-08 17:23   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2024-06-08 17:23 UTC (permalink / raw)
  To: Nuno Sá
  Cc: Uwe Kleine-König, Greg Kroah-Hartman, Lars-Peter Clausen,
	Michael Hennerich, linux-iio, linux-staging

On Fri, 07 Jun 2024 11:23:12 +0200
Nuno Sá <noname.nuno@gmail.com> wrote:

> On Thu, 2024-06-06 at 17:54 +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@baylibre.com>
> > ---  
> 
> Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> 
> - Nuno Sá
Applied
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-08 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 15:54 [PATCH] staging: iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0 Uwe Kleine-König
2024-06-07  9:23 ` Nuno Sá
2024-06-08 17:23   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox