From f98bc10e0eb90075665516c6ddc81761d42b3525 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 21 Aug 2017 22:33:53 +0530 Subject: 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 work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Samuel Ortiz --- drivers/nfc/microread/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/microread/i2c.c b/drivers/nfc/microread/i2c.c index b668b7b9a61e7..1806d20a5e298 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}, { } }; -- cgit v1.2.3 From ab1df981574bdb06c2d7f8b6817d5007c2f4a10d Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 21 Aug 2017 22:33:54 +0530 Subject: 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 work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Samuel Ortiz --- drivers/nfc/nfcmrvl/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/nfcmrvl/i2c.c b/drivers/nfc/nfcmrvl/i2c.c index ffec103702f14..0f22379887ca8 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 }, {} }; -- cgit v1.2.3 From 01e682ad085d0e7d253c3bad557a2a4b08bbf5fe Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 21 Aug 2017 22:33:55 +0530 Subject: 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 work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Samuel Ortiz --- drivers/nfc/nxp-nci/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c index 198585bbc7711..ba695e392c3b7 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}, {} }; -- cgit v1.2.3 From f98786da9d18ee1ecfac4a68e532b1859cf7d1c0 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 21 Aug 2017 22:33:56 +0530 Subject: 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 work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Samuel Ortiz --- drivers/nfc/pn533/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c index 8f60ce039b0d4..4389eb4c8d0b3 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 }, {} }; -- cgit v1.2.3 From 3737ff15b0e88fd9d4942118c2c9ece917ddc68f Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 21 Aug 2017 22:33:57 +0530 Subject: 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 work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Samuel Ortiz --- drivers/nfc/pn544/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index 4b14740edb672..d0207f8e68b7c 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}, {} }; -- cgit v1.2.3 From 81251cc599acfac63d68caa69c6284b546c66fe0 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 21 Aug 2017 22:33:58 +0530 Subject: 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 work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Samuel Ortiz --- drivers/nfc/s3fwrn5/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c index 3f09d7fd2285f..4da409e77a72e 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}, {} }; -- cgit v1.2.3 From 984553078497082008b8a2bd681facdc789b5acf Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 21 Aug 2017 22:33:59 +0530 Subject: 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 work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Samuel Ortiz --- drivers/nfc/st-nci/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c index 515f08d037fb4..f9525ef87d57a 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}, {} }; -- cgit v1.2.3 From a122ffd0911d563f4b5e95120259ec5d2e8e3c4f Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 21 Aug 2017 22:34:00 +0530 Subject: 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 work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Samuel Ortiz --- drivers/nfc/st21nfca/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index cd1f7bfa75ebe..1b347096422ff 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}, {} }; -- cgit v1.2.3 From 5057f6647b3286eee2d9a7eff7f3c072ea7573d9 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 19 Sep 2017 15:25:15 +0100 Subject: nfc: s3fwrn5: make array match static const Don't populate the read-only array match on the stack, instead make it static const. Makes the object code smaller by over 310 bytes: Before: text data bss dec hex filename 8304 1084 128 9516 252c drivers/nfc/s3fwrn5/firmware.o After: text data bss dec hex filename 7894 1180 128 9202 23f2 drivers/nfc/s3fwrn5/firmware.o Signed-off-by: Colin Ian King Signed-off-by: Samuel Ortiz --- drivers/nfc/s3fwrn5/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c index 38548bd970cd2..b7828fb252f27 100644 --- a/drivers/nfc/s3fwrn5/firmware.c +++ b/drivers/nfc/s3fwrn5/firmware.c @@ -336,7 +336,7 @@ static int s3fwrn5_fw_get_base_addr( struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo, u32 *base_addr) { int i; - struct { + static const struct { u8 version[4]; u32 base_addr; } match[] = { -- cgit v1.2.3 From 81ade1cd6761e791904801ca9bfc960de4b94916 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 5 Oct 2017 10:47:12 +0100 Subject: NFC: fdp: make struct nci_ops static The structure nci_ops is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'nci_ops' was not declared. Should it be static? Signed-off-by: Colin Ian King Signed-off-by: Samuel Ortiz --- drivers/nfc/fdp/fdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/nfc') diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index ec50027b0d8ba..d5784a47fc130 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -726,7 +726,7 @@ static struct nci_driver_ops fdp_prop_ops[] = { }, }; -struct nci_ops nci_ops = { +static struct nci_ops nci_ops = { .open = fdp_nci_open, .close = fdp_nci_close, .send = fdp_nci_send, -- cgit v1.2.3