* [PATCH] staging: sm750fb: constify g_fbmode array
@ 2026-03-09 9:49 dipesh chaudhary
0 siblings, 0 replies; 4+ messages in thread
From: dipesh chaudhary @ 2026-03-09 9:49 UTC (permalink / raw)
To: sudipm.mukherjee, teddy.wang, gregkh
Cc: linux-fbdev, linux-staging, linux-kernel, dipesh chaudhary
Fix checkpatch warning for static const char array. Make the array of pointers read-only to improve memory safety.
Signed-off-by: dipesh chaudhary <me@dipeshchaudhary.in>
---
Makefile | 6 +++---
drivers/staging/sm750fb/sm750.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index df471d4212cc..e944c6e71e81 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
-VERSION = 6
-PATCHLEVEL = 19
+VERSION = 7
+PATCHLEVEL = 0
SUBLEVEL = 0
-EXTRAVERSION =
+EXTRAVERSION = -rc1
NAME = Baby Opossum Posse
# *DOCUMENTATION*
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index dec1f6b88a7d..08d4979c6755 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.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: sm750fb: constify g_fbmode array
[not found] <9e566c42-8ec3-4d06-91be-0489de4e91c0@smtp-relay.sendinblue.com>
@ 2026-03-09 9:56 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2026-03-09 9:56 UTC (permalink / raw)
To: dipesh chaudhary
Cc: sudipm.mukherjee, teddy.wang, linux-fbdev, linux-staging,
linux-kernel
On Mon, Mar 09, 2026 at 09:49:57AM +0000, dipesh chaudhary wrote:
>
> Fix checkpatch warning for static const char array. Make the array of pointers read-only to improve memory safety.
>
> Signed-off-by: dipesh chaudhary <me@dipeshchaudhary.in>
> ---
> Makefile | 6 +++---
> drivers/staging/sm750fb/sm750.c | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index df471d4212cc..e944c6e71e81 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,8 +1,8 @@
> # SPDX-License-Identifier: GPL-2.0
> -VERSION = 6
> -PATCHLEVEL = 19
> +VERSION = 7
> +PATCHLEVEL = 0
> SUBLEVEL = 0
> -EXTRAVERSION =
> +EXTRAVERSION = -rc1
> NAME = Baby Opossum Posse
>
> # *DOCUMENTATION*
Why have you changed the Makefile?
And did you test-build your change?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: sm750fb: constify g_fbmode array
@ 2026-03-09 10:06 dipesh chaudhary
0 siblings, 0 replies; 4+ messages in thread
From: dipesh chaudhary @ 2026-03-09 10:06 UTC (permalink / raw)
To: gregkh
Cc: sudipm.mukherjee, teddy.wang, linux-fbdev, linux-staging,
linux-kernel
Hi Greg,
On Mon, Mar 09, 2026 at 09:49:57AM +0000, dipesh chaudhary wrote:
> --- a/Makefile
> +++ b/Makefile
> @@ -1,8 +1,8 @@
> # SPDX-License-Identifier: GPL-2.0
> -VERSION = 6
> -PATCHLEVEL = 19
> +VERSION = 7
> +PATCHLEVEL = 0
> SUBLEVEL = 0
> -EXTRAVERSION =
> +EXTRAVERSION = -rc1
> Why have you changed the Makefile?
I sincerely apologize for that. This is my very first kernel patch, and I was experimenting with the Makefile earlier on my local machine. I accidentally staged and included it in my commit alongside the driver fix without realizing it.
> And did you test-build your change?
To be completely honest, no. I only ran `checkpatch.pl` to verify the warning was resolved.
I will clean up my Git tree, figure out how to test-build the specific sm750 module locally, and then submit a clean v2 patch. Thank you for your patience with a beginner.
Best regards,
Dipesh Chaudhary
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: sm750fb: constify g_fbmode array
@ 2026-03-09 10:13 dipesh chaudhary
0 siblings, 0 replies; 4+ messages in thread
From: dipesh chaudhary @ 2026-03-09 10:13 UTC (permalink / raw)
To: gregkh
Cc: sudipm.mukherjee, teddy.wang, linux-fbdev, linux-staging,
linux-kernel
Hi Greg,
You were absolutely right. I just set up my local build environment and ran `make drivers/staging/sm750fb/sm750.o`, and it immediately threw `error: assignment of read-only location`.
I fell into the classic checkpatch trap. I blindly applied the `const` suggestion without checking the surrounding code, failing to realize the driver dynamically writes to `g_fbmode` during runtime in `sm750fb_setup` and `lynxfb_set_fbinfo`.
Thank you for pushing me to test-build. I will drop this patch entirely, as the checkpatch warning is a false positive here. I have learned a valuable lesson about not trusting static analysis scripts over actually reading the C code and compiling it.
Best regards,
Dipesh Chaudhary
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-09 10:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <9e566c42-8ec3-4d06-91be-0489de4e91c0@smtp-relay.sendinblue.com>
2026-03-09 9:56 ` [PATCH] staging: sm750fb: constify g_fbmode array Greg KH
2026-03-09 10:13 dipesh chaudhary
-- strict thread matches above, loose matches on Subject: below --
2026-03-09 10:06 dipesh chaudhary
2026-03-09 9:49 dipesh chaudhary
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox