[PATCH] staging: sm750fb: Fix const pointer declaration

Denis Arzubov posted 1 patch 1 month, 1 week ago
drivers/staging/sm750fb/sm750.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] staging: sm750fb: Fix const pointer declaration
Posted by Denis Arzubov 1 month, 1 week ago
Make g_fbmode array pointer const to follow kernel coding style.
This resolves the checkpatch warning:
WARNING: static const char * array should probably be static const char * const

Signed-off-by: Denis Arzubov <denisarzubov8@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 fadba95850be..8fc0d1c66991 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.43.0
Re: [PATCH] staging: sm750fb: Fix const pointer declaration
Posted by Greg KH 1 month ago
On Tue, May 05, 2026 at 01:36:27AM +0300, Denis Arzubov wrote:
> Make g_fbmode array pointer const to follow kernel coding style.
> This resolves the checkpatch warning:
> WARNING: static const char * array should probably be static const char * const
> 
> Signed-off-by: Denis Arzubov <denisarzubov8@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 fadba95850be..8fc0d1c66991 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.43.0
> 

Please always test-build your changes :(