All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] fsi: Constify fsi_device_ids
@ 2020-08-05 23:26 Rikard Falkeborn
  2020-08-05 23:26 ` [PATCH 1/3] fsi: master: Constify hub_master_ids Rikard Falkeborn
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rikard Falkeborn @ 2020-08-05 23:26 UTC (permalink / raw)
  To: linux-fsi; +Cc: linux-kernel, jk, joel, alistair, eajames, Rikard Falkeborn

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(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] fsi: master: Constify hub_master_ids
  2020-08-05 23:26 [PATCH 0/3] fsi: Constify fsi_device_ids Rikard Falkeborn
@ 2020-08-05 23:26 ` Rikard Falkeborn
  2020-08-05 23:26 ` [PATCH 2/3] fsi: sbefifo: Constify sbefifo_ids Rikard Falkeborn
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Rikard Falkeborn @ 2020-08-05 23:26 UTC (permalink / raw)
  To: linux-fsi; +Cc: linux-kernel, jk, joel, alistair, eajames, Rikard Falkeborn

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.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/fsi/fsi-master-hub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
index 3caa2da7838c..01f0a796111e 100644
--- a/drivers/fsi/fsi-master-hub.c
+++ b/drivers/fsi/fsi-master-hub.c
@@ -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,
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] fsi: sbefifo: Constify sbefifo_ids
  2020-08-05 23:26 [PATCH 0/3] fsi: Constify fsi_device_ids Rikard Falkeborn
  2020-08-05 23:26 ` [PATCH 1/3] fsi: master: Constify hub_master_ids Rikard Falkeborn
@ 2020-08-05 23:26 ` Rikard Falkeborn
  2020-08-05 23:26 ` [PATCH 3/3] fsi: scom: Constify scom_ids Rikard Falkeborn
  2020-08-05 23:56 ` [PATCH 0/3] fsi: Constify fsi_device_ids Joel Stanley
  3 siblings, 0 replies; 5+ messages in thread
From: Rikard Falkeborn @ 2020-08-05 23:26 UTC (permalink / raw)
  To: linux-fsi; +Cc: linux-kernel, jk, joel, alistair, eajames, Rikard Falkeborn

The 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

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/fsi/fsi-sbefifo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
index c8ccc99e214f..84cb965bfed5 100644
--- a/drivers/fsi/fsi-sbefifo.c
+++ b/drivers/fsi/fsi-sbefifo.c
@@ -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,
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] fsi: scom: Constify scom_ids
  2020-08-05 23:26 [PATCH 0/3] fsi: Constify fsi_device_ids Rikard Falkeborn
  2020-08-05 23:26 ` [PATCH 1/3] fsi: master: Constify hub_master_ids Rikard Falkeborn
  2020-08-05 23:26 ` [PATCH 2/3] fsi: sbefifo: Constify sbefifo_ids Rikard Falkeborn
@ 2020-08-05 23:26 ` Rikard Falkeborn
  2020-08-05 23:56 ` [PATCH 0/3] fsi: Constify fsi_device_ids Joel Stanley
  3 siblings, 0 replies; 5+ messages in thread
From: Rikard Falkeborn @ 2020-08-05 23:26 UTC (permalink / raw)
  To: linux-fsi; +Cc: linux-kernel, jk, joel, alistair, eajames, Rikard Falkeborn

The 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

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/fsi/fsi-scom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index 004dc03ccf09..b45bfab7b7f5 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -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,
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] fsi: Constify fsi_device_ids
  2020-08-05 23:26 [PATCH 0/3] fsi: Constify fsi_device_ids Rikard Falkeborn
                   ` (2 preceding siblings ...)
  2020-08-05 23:26 ` [PATCH 3/3] fsi: scom: Constify scom_ids Rikard Falkeborn
@ 2020-08-05 23:56 ` Joel Stanley
  3 siblings, 0 replies; 5+ messages in thread
From: Joel Stanley @ 2020-08-05 23:56 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: linux-fsi, Linux Kernel Mailing List, Jeremy Kerr,
	Alistair Popple, Eddie James

On Wed, 5 Aug 2020 at 23:27, Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
>
> 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.

Thanks, I have applied these to the fsi next tree.

Cheers,

Joel

>
> 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(-)
>
> --
> 2.28.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-05 23:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 23:26 [PATCH 0/3] fsi: Constify fsi_device_ids Rikard Falkeborn
2020-08-05 23:26 ` [PATCH 1/3] fsi: master: Constify hub_master_ids Rikard Falkeborn
2020-08-05 23:26 ` [PATCH 2/3] fsi: sbefifo: Constify sbefifo_ids Rikard Falkeborn
2020-08-05 23:26 ` [PATCH 3/3] fsi: scom: Constify scom_ids Rikard Falkeborn
2020-08-05 23:56 ` [PATCH 0/3] fsi: Constify fsi_device_ids Joel Stanley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.