fsi: Constify fsi_device_ids
cover fsi: Constify fsi_device_ids
fsi_device_id is never modified (and it's a const pointer in the fsi_driver struct), so make the static variables const to allow the compiler to put them in read-only memory.
Rikard Falkeborn (3):
fsi: master: Constify hub_master_ids
fsi: sbefifo: Constify sbefifo_ids
fsi: scom: Constify scom_ids
drivers/fsi/fsi-master-hub.c | 2 +- drivers/fsi/fsi-sbefifo.c | 2 +- drivers/fsi/fsi-scom.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.28.0
PATCH 1/3 fsi: master: Constify hub_master_ids
The only usage of hub_master_ids is to assign its address to the id_table field in the fsi_driver struct, which is a const pointer, so make it const to allow the compiler to put it in read-only memory.
--- drivers/fsi/fsi-master-hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-master-hub.c +1 -1
@@ -276,7 +276,7 @@ static int hub_master_remove(struct device *dev)return 0 ; } -static struct fsi_device_id hub_master_ids[] = { +static const struct fsi_device_id hub_master_ids[] = { { .engine_type =FSI_ENGID_HUB_MASTER , .version =FSI_VERSION_ANY ,
Signature · 1 line
2.28.0
PATCH 2/3 fsi: sbefifo: Constify sbefifo_ids
In reply to Rikard FalkebornThe only usage of sbefifo_ids is to assign its address to the id_table field in the fsi_driver struct, which is a const pointer, so make it const to allow the compiler to put it in read-only memory
--- drivers/fsi/fsi-sbefifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-sbefifo.c +1 -1
@@ -1030,7 +1030,7 @@ static int sbefifo_remove(struct device *dev)return 0 ; } -static struct fsi_device_id sbefifo_ids[] = { +static const struct fsi_device_id sbefifo_ids[] = { { .engine_type =FSI_ENGID_SBE , .version =FSI_VERSION_ANY ,
Signature · 1 line
2.28.0
PATCH 3/3 fsi: scom: Constify scom_ids
In reply to Rikard FalkebornThe only usage of scom_ids is to assign its address to the id_table field in the fsi_driver struct, which is a const pointer, so make it const to allow the compiler to put it in read-only memory
--- drivers/fsi/fsi-scom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-scom.c +1 -1
@@ -627,7 +627,7 @@ static int scom_remove(struct device *dev)return 0 ; } -static struct fsi_device_id scom_ids[] = { +static const struct fsi_device_id scom_ids[] = { { .engine_type =FSI_ENGID_SCOM , .version =FSI_VERSION_ANY ,
Signature · 1 line
2.28.0
Quoted 4 lines · Rikard Falkeborn
fsi_device_idis never modified (and it's a const pointer in thefsi_driverstruct), so make the static variables const to allow the compiler to put them in read-only memory.
Thanks, I have applied these to the fsi next tree.
Cheers,
Joel
Quoted 14 lines
Rikard Falkeborn (3):
fsi: master: Constifyhub_master_ids
fsi: sbefifo: Constifysbefifo_ids
fsi: scom: Constifyscom_idsdrivers/fsi/fsi-master-hub.c | 2 +- drivers/fsi/fsi-sbefifo.c | 2 +- drivers/fsi/fsi-scom.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)--
2.28.0