All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SCSI: esas2r: Make structure default_sas_nvram constant
@ 2019-08-19  7:50 Nishka Dasgupta
  0 siblings, 0 replies; only message in thread
From: Nishka Dasgupta @ 2019-08-19  7:50 UTC (permalink / raw)
  To: linuxdrivers, jejb, martin.peterson, linux-scsi; +Cc: Nishka Dasgupta

Static structure default_sas_nvram, of type esas2r_sas_nvram, is used
only when copied to a local variable; it is never modified itself. Hence
make it constant to protect it from unintended modification.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/scsi/esas2r/esas2r_flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c
index 7bd376d95ed5..f8414b5a26fa 100644
--- a/drivers/scsi/esas2r/esas2r_flash.c
+++ b/drivers/scsi/esas2r/esas2r_flash.c
@@ -54,7 +54,7 @@
 
 #define ESAS2R_FS_DRVR_VER 2
 
-static struct esas2r_sas_nvram default_sas_nvram = {
+static const struct esas2r_sas_nvram default_sas_nvram = {
 	{ 'E',	'S',  'A',  'S'			     }, /* signature          */
 	SASNVR_VERSION,                                 /* version            */
 	0,                                              /* checksum           */
-- 
2.19.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-19  7:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19  7:50 [PATCH] SCSI: esas2r: Make structure default_sas_nvram constant Nishka Dasgupta

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.