Skip to contentSkip to conversation

drivers: make i2c_algorithm const

PATCH Applied Bhumika Goyal 3 participants 5 messages Aug 18, 2017 – Aug 29, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover drivers: make i2c_algorithm const

Make these const.

Bhumika Goyal (2):
i2c: busses: make i2c_algorithm const
[media] usb: make i2c_algorithm const

 drivers/i2c/busses/i2c-pnx.c                 | 2 +-
 drivers/i2c/busses/i2c-puv3.c                | 2 +-
 drivers/media/usb/au0828/au0828-i2c.c        | 2 +-
 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 i2c: busses: make i2c_algorithm const

Make these const as they are only stored in the algo field of i2c_adapter structure, which is const.

---
 drivers/i2c/busses/i2c-pnx.c  | 2 +-
 drivers/i2c/busses/i2c-puv3.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-pnx.c +1 -1
index fd5f9d2..42d6b3a 100644
@@ -590,7 +590,7 @@ static u32 i2c_pnx_func(struct i2c_adapter *adapter)
 	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 }
 
-static struct i2c_algorithm pnx_algorithm = {
+static const struct i2c_algorithm pnx_algorithm = {
 	.master_xfer = i2c_pnx_xfer,
 	.functionality = i2c_pnx_func,
 };
drivers/i2c/busses/i2c-puv3.c +1 -1
index 0c8b157..287088b 100644
@@ -175,7 +175,7 @@ static u32 puv3_i2c_func(struct i2c_adapter *adapter)
 	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 }
 
-static struct i2c_algorithm puv3_i2c_algorithm = {
+static const struct i2c_algorithm puv3_i2c_algorithm = {
 	.master_xfer	= puv3_i2c_xfer,
 	.functionality	= puv3_i2c_func,
 };
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/2 usb: make i2c_algorithm const

In reply to Bhumika Goyal

Make these const as they are only used in a copy operation or are stored in the algo field of i2c_adapter structure, which is const.

---
 drivers/media/usb/au0828/au0828-i2c.c        | 2 +-
 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/au0828/au0828-i2c.c +1 -1
index 42b352b..a028e36 100644
@@ -329,7 +329,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap)
 	return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
 }
 
-static struct i2c_algorithm au0828_i2c_algo_template = {
+static const struct i2c_algorithm au0828_i2c_algo_template = {
 	.master_xfer	= i2c_xfer,
 	.functionality	= au0828_functionality,
 };
drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c +1 -1
index 20a52b7..cfa8fbe 100644
@@ -514,7 +514,7 @@ static u32 pvr2_i2c_functionality(struct i2c_adapter *adap)
 	return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
 }
 
-static struct i2c_algorithm pvr2_i2c_algo_template = {
+static const struct i2c_algorithm pvr2_i2c_algo_template = {
 	.master_xfer   = pvr2_i2c_xfer,
 	.functionality = pvr2_i2c_functionality,
 };
Signature · 1 line
1.9.1
Acked-by Mike Isely on v1 2/2
#4 lore raw

Re: [PATCH 2/2] [media] usb: make i2c_algorithm const

Quoted 36 lines · Bhumika Goyal

Make these const as they are only used in a copy operation or are stored in the algo field of i2c_adapter structure, which is const.

---
 drivers/media/usb/au0828/au0828-i2c.c        | 2 +-
 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/au0828/au0828-i2c.c +1 -1
index 42b352b..a028e36 100644
@@ -329,7 +329,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap)
 	return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
 }
 
-static struct i2c_algorithm au0828_i2c_algo_template = {
+static const struct i2c_algorithm au0828_i2c_algo_template = {
 	.master_xfer	= i2c_xfer,
 	.functionality	= au0828_functionality,
 };
drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c +1 -1
index 20a52b7..cfa8fbe 100644
@@ -514,7 +514,7 @@ static u32 pvr2_i2c_functionality(struct i2c_adapter *adap)
 	return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C;
 }
 
-static struct i2c_algorithm pvr2_i2c_algo_template = {
+static const struct i2c_algorithm pvr2_i2c_algo_template = {
 	.master_xfer   = pvr2_i2c_xfer,
 	.functionality = pvr2_i2c_functionality,
 };
Signature · 3 lines
Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
Applied
#2 lore raw

Re: [PATCH 1/2] i2c: busses: make i2c_algorithm const

In reply to Bhumika Goyal
Quoted 4 lines · Bhumika Goyal

Make these const as they are only stored in the algo field of i2c_adapter structure, which is const.

Applied to for-next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170829/58a3028d/attachment.sig>