fbdev: viafb: refactor strcpy and viafb_name

Eliminate the single-use file-scope variable `viafb_name` and pass the
"Via" string literal directly to strcpy().

Since "Via" is a literal constant, the compiler safely executes
compile-time bounds checking during fortify verification. This satisfies
the security initiative requirements while minimizing code complexity.

Signed-off-by: Ajith P V <ajithpv.linux@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
Ajith P V
2026-08-18 11:17:22 +00:00
committed by Helge Deller
parent ba13226fc9
commit f74cf70e5e

View File

@@ -16,7 +16,6 @@
#define _MASTER_FILE
#include "global.h"
static char *viafb_name = "Via";
static u32 pseudo_pal[17];
/* video mode */
@@ -144,7 +143,7 @@ static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix,
struct viafb_par *viaparinfo)
{
memset(fix, 0, sizeof(struct fb_fix_screeninfo));
strcpy(fix->id, viafb_name);
strcpy(fix->id, "Via");
fix->smem_start = viaparinfo->fbmem;
fix->smem_len = viaparinfo->fbmem_free;