All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: sm750fb: make pointers in array const
@ 2021-10-18 16:44 Kushal Kothari
  2021-10-18 16:54 ` [Outreachy kernel] " Fabio M. De Francesco
  0 siblings, 1 reply; 13+ messages in thread
From: Kushal Kothari @ 2021-10-18 16:44 UTC (permalink / raw)
  To: sudipm.mukherjee, teddy.wang, gregkh, outreachy-kernel,
	mike.rapoport, kushalkothari2850
  Cc: Kushal Kothari

Change the parameters of functions from const char *g_fbmode[] to
const char * const g_fbmode[]. This additional const is needed to
allow us to fix  checkpatch warning, as well as being good
programming practice.

For the checkpatch warnings, if we have a set of command line
args that we want to check defined as:
	static const char * g_fbmode[] = {NULL, NULL};

checkpatch will complain:
	WARNING: static const char * array should probably be static const char * const

Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index dbd1159a2ef0..3d9b4b0efcb1 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview;
-- 
2.25.1



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

end of thread, other threads:[~2021-10-18 19:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 16:44 [PATCH] staging: sm750fb: make pointers in array const Kushal Kothari
2021-10-18 16:54 ` [Outreachy kernel] " Fabio M. De Francesco
2021-10-18 17:01   ` Julia Lawall
2021-10-18 17:18     ` Fabio M. De Francesco
2021-10-18 18:22       ` Joe Perches
2021-10-18 18:34         ` Fabio M. De Francesco
2021-10-18 18:43           ` Julia Lawall
2021-10-18 18:56             ` kushal kothari
2021-10-18 19:53               ` Alison Schofield
2021-10-18 18:56             ` Fabio M. De Francesco
2021-10-18 18:52           ` Joe Perches
2021-10-18 19:01             ` Fabio M. De Francesco
2021-10-18 18:18   ` Fabio M. De Francesco

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.