Skip to contentSkip to conversation

i2c: designware: constify abort_sources

PATCH In review Raag Jadav 3 participants 7 messages Jan 22, 2024 – Oct 3, 2024

Subsystems (3)
lore
Share & tools
lore

Raag Jadav

author
#0 lore raw

PATCH 1/2 i2c: designware: constify abort_sources

We never modify abort_sources, mark it as const.

---
 drivers/i2c/busses/i2c-designware-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-common.c +1 -1
index affcfb243f0f..39c956b0a72d 100644
@@ -28,7 +28,7 @@
 
 #include "i2c-designware-core.h"
 
-static char *abort_sources[] = {
+static const char *const abort_sources[] = {
 	[ABRT_7B_ADDR_NOACK] =
 		"slave address not acknowledged (7bit mode)",
 	[ABRT_10ADDR1_NOACK] =
Signature · 1 line
2.35.3
author
#1 lore raw

PATCH 2/2 i2c: designware: constify regmap_config

We never modify regmap_config, mark it as const.

---
 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-platdrv.c +1 -1
index 855b698e99c0..d122ef349b1c 100644
@@ -100,7 +100,7 @@ static int bt1_i2c_write(void *context, unsigned int reg, unsigned int val)
 		BT1_I2C_CTL_GO | BT1_I2C_CTL_WR | (reg & BT1_I2C_CTL_ADDR_MASK));
 }
 
-static struct regmap_config bt1_i2c_cfg = {
+static const struct regmap_config bt1_i2c_cfg = {
 	.reg_bits = 32,
 	.val_bits = 32,
 	.reg_stride = 4,
Signature · 1 line
2.35.3
author
#3 lore raw

Re: [PATCH v1 2/2] i2c: designware: constify regmap_config

Quoted 11 lines · Jarkko Nikula
Quoted 7 lines · Raag Jadav

We never modify regmap_config, mark it as const.

---
  drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Both:

Bump.

Anything I can do to move these forward?

Raag

author
#4 lore raw

Re: [PATCH v1 2/2] i2c: designware: constify regmap_config

Quoted 9 lines · Raag Jadav
Quoted 8 lines · Jarkko Nikula
Quoted 7 lines · Raag Jadav

We never modify regmap_config, mark it as const.

---
  drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Quoted 3 lines

Both:

Bump.

Anything I can do to move these forward?

Hi Andi,

Are these worth moving forward?

Raag

maintainer
#5 lore raw
In reply to Raag Jadav

Hi Raag,

Quoted 3 lines · Raag Jadav

We never modify abort_sources, mark it as const.

we meet in a different context :-)

Sorry I have missed this patch. I applied it to i2c/i2c-host. The second patch was already sent here 21ac0359f72a90.

Thanks,
Andi

author
#6 lore raw
Quoted 8 lines · Andi Shyti

Hi Raag,

Quoted 3 lines · Raag Jadav

We never modify abort_sources, mark it as const.

we meet in a different context :-)

Small world :)

Quoted 2 lines

Sorry I have missed this patch. I applied it to i2c/i2c-host. The second patch was already sent here 21ac0359f72a90.

Awesome.

Raag