Skip to contentSkip to conversation

mfd: constify properties in mfd_cell

PATCH In review Tomas Winkler 2 participants 6 messages Feb 8, 2020 – Feb 9, 2020 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 mfd: constify properties in mfd_cell

Constify 'struct property_entry *properties' in mfd_cell It is always passed
around as a pointer const struct.

---

V2: drop platform_device part

 include/linux/mfd/core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mfd/core.h +1 -1
index d01d1299e49d..7e5ac3c00891 100644
@@ -70,7 +70,7 @@ struct mfd_cell {
 	size_t			pdata_size;
 
 	/* device properties passed to the sub devices drivers */
-	struct property_entry *properties;
+	const struct property_entry *properties;
 
 	/*
 	 * Device Tree compatible string
Signature · 1 line
2.21.1
#1 lore raw

PATCH 2/2 platform: constify properties in platform_device

Constify 'struct property_entry *properties' in platform_device. It is always passed around as a pointer const struct.

---
 include/linux/platform_device.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/platform_device.h +1 -1
index 276a03c24691..8e83c6ff140d 100644
@@ -89,7 +89,7 @@ struct platform_device_info {
 		size_t size_data;
 		u64 dma_mask;
 
-		struct property_entry *properties;
+		const struct property_entry *properties;
 };
 extern struct platform_device *platform_device_register_full(
 		const struct platform_device_info *pdevinfo);
Signature · 1 line
2.21.1
#2 lore raw
In reply to Tomas Winkler
Quoted 4 lines · Tomas Winkler

Constify 'struct property_entry *properties' in mfd_cell It is always passed
around as a pointer const struct.

I guess this should be second patch in the split and it's actually dependent to the first one (won't we get a compiler warning when we drop const qualifier during assignment?).

Quoted 5 lines

---

V2: drop platform_device part

Btw, when you prepare series, you may use -vX command line parameter, where X is a version number. The scripts will put v2 in each Subject line uniformly.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 16 lines
Quoted 3 lines · Tomas Winkler

Constify 'struct property_entry *properties' in mfd_cell It is always passed around as a pointer const struct.

I guess this should be second patch in the split and it's actually dependent to the first one (won't we get a compiler warning when we drop const qualifier during assignment?).

Quoted 4 lines

---

Quoted 5 lines
Quoted 1 line

V2: drop platform_device part

Btw, when you prepare series, you may use -vX command line parameter, where X is a version number. The scripts will put v2 in each Subject line uniformly.

Right, just the second patch was a new one, so not sure I should mark it v2. Thanks
Tomas

#4 lore raw
Quoted 9 lines · Tomas
Quoted 8 lines
Quoted 1 line · Tomas Winkler

V2: drop platform_device part

Btw, when you prepare series, you may use -vX command line parameter, where X is a version number. The scripts will put v2 in each Subject line uniformly.

Right, just the second patch was a new one, so not sure I should mark it v2.

Yes, it evolved from the v1 of one patch. So, just mark both of them like
v2: per subsystem split from v1
or alike.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw
Quoted 10 lines
Quoted 6 lines · Tomas
Quoted 6 lines
Quoted 1 line · Tomas Winkler

V2: drop platform_device part

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

Btw, when you prepare series, you may use -vX command line parameter, where X is a version number. The scripts will put v2 in each Subject line uniformly.

Right, just the second patch was a new one, so not sure I should mark it v2.

Yes, it evolved from the v1 of one patch. So, just mark both of them like
v2: per subsystem split from v1
or alike.

Okay, we can look at that also this way.
Tomas