diff options
| author | Hungyu Lin <dennylin0707@gmail.com> | 2026-04-01 11:50:24 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-04-27 05:01:51 -0600 |
| commit | d0856045f0e9fc96c97fd86e5936b55c6e4db247 (patch) | |
| tree | c8d15b7ab259fe1fd0dc94c81f0634cf4d013789 /drivers | |
| parent | 467716c1cc19bc7172b7ac23a1d8bf791f5c0c6b (diff) | |
| download | linux-d0856045f0e9fc96c97fd86e5936b55c6e4db247.tar.gz linux-d0856045f0e9fc96c97fd86e5936b55c6e4db247.zip | |
staging: sm750fb: constify fix_id array
Add the missing 'const' qualifier to the static fix_id array to ensure
the pointer array itself is immutable.
Originally:
static const char *fix_id[2];
The strings are constant, but the pointer array itself is writable.
With the change:
static const char * const fix_id[2];
Both the strings and the pointer array are immutable, allowing the
compiler to treat the object as read-only.
Verified by inspecting the generated object file with 'nm':
00000000000002b8 0000000000000010 r fix_id.3
The 'r' flag indicates the symbol is placed in a read-only section.
This does not change runtime behavior as fix_id is never modified.
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Link: https://patch.msgid.link/20260401115024.89-1-dennylin0707@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/staging/sm750fb/sm750.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 9f3e3d37e82a..c9fd73d2620d 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -731,7 +731,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) lynx750_ext, NULL, vesa_modes, }; int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE}; - static const char *fix_id[2] = { + static const char * const fix_id[2] = { "sm750_fb1", "sm750_fb2", }; |
