Skip to contentSkip to conversation

w1 drivers patches

PATCH In review Krzysztof Kozlowski 2 participants 4 messages Jun 4 – Jun 8 W1 dallas's 1-wire bus

lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

cover w1 drivers patches

Hi Greg,

I have only one patch for this cycle.

Best regards,
Krzysztof

Uwe Kleine-König (The Capable Hub) (1):
w1: ds2482: Use named initializers for arrays of i2c_device_data

 drivers/w1/masters/ds2482.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 1/1 w1: ds2482: Use named initializers for arrays of i2c_device_data

From: Uwe Kleine-König (The Capable Hub) <[email protected]>

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds.

---
 drivers/w1/masters/ds2482.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/w1/masters/ds2482.c +2 -2
index e2a568c9a43a..0069e6f854d7 100644
@@ -539,8 +539,8 @@ static void ds2482_remove(struct i2c_client *client)
  * Driver data (common to all clients)
  */
 static const struct i2c_device_id ds2482_id[] = {
-	{ "ds2482" },
-	{ "ds2484" },
+	{ .name = "ds2482" },
+	{ .name = "ds2484" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ds2482_id);
Signature · 1 line
2.53.0
#2 lore raw

Re: [PATCH 1/1] w1: ds2482: Use named initializers for arrays of i2c_device_data

Hello,

Quoted 10 lines · Krzysztof Kozlowski

From: Uwe Kleine-König (The Capable Hub) <[email protected]>

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union.

Quoted 7 lines

This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds.

I wonder about this patch because it was included in next as 10cc9de3d4fc between next-20260526 and next-20260604 (inclusive) but isn't included any more in next-20260605.

I assume this mail is part of the submit path of w1 to mainline and Krzysztof dropped it from his tree to not create a conflict in next when Greg adds a slightly modified variant?

If so, the expectation that this patch makes it into 7.2-rc1 is still justified, right?

Best regards
Uwe

author maintainer
#3 lore raw

Re: [PATCH 1/1] w1: ds2482: Use named initializers for arrays of i2c_device_data

Quoted 21 lines · Uwe Kleine-König (The Capable Hub)

Hello,

Quoted 10 lines · Krzysztof Kozlowski

From: Uwe Kleine-König (The Capable Hub) <[email protected]>

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union.

Quoted 7 lines

This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds.

Quoted 7 lines

I wonder about this patch because it was included in next as 10cc9de3d4fc between next-20260526 and next-20260604 (inclusive) but isn't included any more in next-20260605.

I assume this mail is part of the submit path of w1 to mainline and Krzysztof dropped it from his tree to not create a conflict in next when Greg adds a slightly modified variant?

This was sent as patch, not pull-req, so to avoid duplicate patch message from Mark.

Quoted 3 lines

If so, the expectation that this patch makes it into 7.2-rc1 is still justified, right?

Yes.

Best regards,
Krzysztof