2017-08-21 17:04:17

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/8] constify nfc i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Arvind Yadav (8):
[PATCH 1/8] nfc: microread: constify i2c_device_id
[PATCH 2/8] nfc: nfcmrvl: constify i2c_device_id
[PATCH 3/8] nfc: nxp-nci: constify i2c_device_id
[PATCH 4/8] nfc: pn533: constify i2c_device_id
[PATCH 5/8] nfc: pn544: constify i2c_device_id
[PATCH 6/8] nfc: s3fwrn5: constify i2c_device_id
[PATCH 7/8] nfc: st-nci: constify i2c_device_id
[PATCH 8/8] nfc: st21nfca: constify i2c_device_id

drivers/nfc/microread/i2c.c | 2 +-
drivers/nfc/nfcmrvl/i2c.c | 2 +-
drivers/nfc/nxp-nci/i2c.c | 2 +-
drivers/nfc/pn533/i2c.c | 2 +-
drivers/nfc/pn544/i2c.c | 2 +-
drivers/nfc/s3fwrn5/i2c.c | 2 +-
drivers/nfc/st-nci/i2c.c | 2 +-
drivers/nfc/st21nfca/i2c.c | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)

--
2.7.4


2017-08-21 17:04:22

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/8] nfc: microread: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/nfc/microread/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/microread/i2c.c b/drivers/nfc/microread/i2c.c
index b668b7b..1806d20 100644
--- a/drivers/nfc/microread/i2c.c
+++ b/drivers/nfc/microread/i2c.c
@@ -294,7 +294,7 @@ static int microread_i2c_remove(struct i2c_client *client)
return 0;
}

-static struct i2c_device_id microread_i2c_id[] = {
+static const struct i2c_device_id microread_i2c_id[] = {
{ MICROREAD_I2C_DRIVER_NAME, 0},
{ }
};
--
2.7.4

2017-08-21 17:04:33

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 4/8] nfc: pn533: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/nfc/pn533/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c
index 8f60ce0..4389eb4 100644
--- a/drivers/nfc/pn533/i2c.c
+++ b/drivers/nfc/pn533/i2c.c
@@ -264,7 +264,7 @@ static const struct of_device_id of_pn533_i2c_match[] = {
};
MODULE_DEVICE_TABLE(of, of_pn533_i2c_match);

-static struct i2c_device_id pn533_i2c_id_table[] = {
+static const struct i2c_device_id pn533_i2c_id_table[] = {
{ PN533_I2C_DRIVER_NAME, 0 },
{}
};
--
2.7.4

2017-08-21 17:04:39

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 6/8] nfc: s3fwrn5: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/nfc/s3fwrn5/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c
index 3f09d7f..4da409e 100644
--- a/drivers/nfc/s3fwrn5/i2c.c
+++ b/drivers/nfc/s3fwrn5/i2c.c
@@ -276,7 +276,7 @@ static int s3fwrn5_i2c_remove(struct i2c_client *client)
return 0;
}

-static struct i2c_device_id s3fwrn5_i2c_id_table[] = {
+static const struct i2c_device_id s3fwrn5_i2c_id_table[] = {
{S3FWRN5_I2C_DRIVER_NAME, 0},
{}
};
--
2.7.4

2017-08-21 17:04:45

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 8/8] nfc: st21nfca: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/nfc/st21nfca/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index cd1f7bf..1b34709 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -589,7 +589,7 @@ static int st21nfca_hci_i2c_remove(struct i2c_client *client)
return 0;
}

-static struct i2c_device_id st21nfca_hci_i2c_id_table[] = {
+static const struct i2c_device_id st21nfca_hci_i2c_id_table[] = {
{ST21NFCA_HCI_DRIVER_NAME, 0},
{}
};
--
2.7.4

2017-08-21 17:05:10

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 7/8] nfc: st-nci: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/nfc/st-nci/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index 515f08d..f9525ef 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -279,7 +279,7 @@ static int st_nci_i2c_remove(struct i2c_client *client)
return 0;
}

-static struct i2c_device_id st_nci_i2c_id_table[] = {
+static const struct i2c_device_id st_nci_i2c_id_table[] = {
{ST_NCI_DRIVER_NAME, 0},
{}
};
--
2.7.4

2017-08-21 17:05:27

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 5/8] nfc: pn544: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/nfc/pn544/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index 4b14740..d0207f8 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -54,7 +54,7 @@
#define PN544_HCI_I2C_LLC_MAX_SIZE (PN544_HCI_I2C_LLC_LEN_CRC + 1 + \
PN544_HCI_I2C_LLC_MAX_PAYLOAD)

-static struct i2c_device_id pn544_hci_i2c_id_table[] = {
+static const struct i2c_device_id pn544_hci_i2c_id_table[] = {
{"pn544", 0},
{}
};
--
2.7.4

2017-08-21 17:06:00

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/8] nfc: nxp-nci: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/nfc/nxp-nci/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 198585b..ba695e3 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -393,7 +393,7 @@ static int nxp_nci_i2c_remove(struct i2c_client *client)
return 0;
}

-static struct i2c_device_id nxp_nci_i2c_id_table[] = {
+static const struct i2c_device_id nxp_nci_i2c_id_table[] = {
{"nxp-nci_i2c", 0},
{}
};
--
2.7.4

2017-08-21 17:06:16

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/8] nfc: nfcmrvl: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/nfc/nfcmrvl/i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c
index ffec103..0f22379 100644
--- a/drivers/nfc/nfcmrvl/i2c.c
+++ b/drivers/nfc/nfcmrvl/i2c.c
@@ -266,7 +266,7 @@ static const struct of_device_id of_nfcmrvl_i2c_match[] = {
};
MODULE_DEVICE_TABLE(of, of_nfcmrvl_i2c_match);

-static struct i2c_device_id nfcmrvl_i2c_id_table[] = {
+static const struct i2c_device_id nfcmrvl_i2c_id_table[] = {
{ "nfcmrvl_i2c", 0 },
{}
};
--
2.7.4

2017-11-06 00:03:08

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH 0/8] constify nfc i2c_device_id

Hi Arvind,

On Mon, Aug 21, 2017 at 10:33:52PM +0530, Arvind Yadav wrote:
> i2c_device_id are not supposed to change at runtime. All functions
> working with i2c_device_id provided by <linux/i2c.h> work with
> const i2c_device_id. So mark the non-const structs as const.
>
> Arvind Yadav (8):
> [PATCH 1/8] nfc: microread: constify i2c_device_id
> [PATCH 2/8] nfc: nfcmrvl: constify i2c_device_id
> [PATCH 3/8] nfc: nxp-nci: constify i2c_device_id
> [PATCH 4/8] nfc: pn533: constify i2c_device_id
> [PATCH 5/8] nfc: pn544: constify i2c_device_id
> [PATCH 6/8] nfc: s3fwrn5: constify i2c_device_id
> [PATCH 7/8] nfc: st-nci: constify i2c_device_id
> [PATCH 8/8] nfc: st21nfca: constify i2c_device_id
All 8 patches applied, thanks.

Cheers,
Samuel.

From 1576361141849228748@xxx Mon Aug 21 17:05:34 +0000 2017
X-GM-THRID: 1576361141849228748
X-Gmail-Labels: Inbox,Category Forums