summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-09-01 00:14:18 +0300
committerHelge Deller <deller@gmx.de>2023-09-01 01:29:33 +0300
commita9415b03f0213fdf8194e128980445a0d692cd5d (patch)
tree47cd8e8dd1b022404cac8e62e6e9d2ddb27e1218 /drivers/video
parentbfac19e239a7d3e98946fa7df362fcbfd40da4cf (diff)
downloadlinux-a9415b03f0213fdf8194e128980445a0d692cd5d.tar.xz
fbdev: neofb: Shorten Neomagic product name in info struct
Avoid those compiler warnings: neofb.c:1959:3: warning: 'snprintf' will always be truncated; specified size is 16, but format string expands to at least 17 [-Wfortify-source] Signed-off-by: Helge Deller <deller@gmx.de> Reported-by: Nathan Chancellor <nathan@kernel.org> Reported-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/all/CAKwvOdn0xoVWjQ6ufM_rojtKb0f1i1hW-J_xYGfKDNFdHwaeHQ@mail.gmail.com/ Link: https://github.com/ClangBuiltLinux/linux/issues/1923
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/neofb.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/video/fbdev/neofb.c b/drivers/video/fbdev/neofb.c
index d2f622b4c372..b58b11015c0c 100644
--- a/drivers/video/fbdev/neofb.c
+++ b/drivers/video/fbdev/neofb.c
@@ -1948,49 +1948,40 @@ static struct fb_info *neo_alloc_fb_info(struct pci_dev *dev,
switch (info->fix.accel) {
case FB_ACCEL_NEOMAGIC_NM2070:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 128");
+ strscpy(info->fix.id, "MagicGraph128", sizeof(info->fix.id));
break;
case FB_ACCEL_NEOMAGIC_NM2090:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 128V");
+ strscpy(info->fix.id, "MagicGraph128V", sizeof(info->fix.id));
break;
case FB_ACCEL_NEOMAGIC_NM2093:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 128ZV");
+ strscpy(info->fix.id, "MagicGraph128ZV", sizeof(info->fix.id));
break;
case FB_ACCEL_NEOMAGIC_NM2097:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 128ZV+");
+ strscpy(info->fix.id, "Mag.Graph128ZV+", sizeof(info->fix.id));
break;
case FB_ACCEL_NEOMAGIC_NM2160:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 128XD");
+ strscpy(info->fix.id, "MagicGraph128XD", sizeof(info->fix.id));
break;
case FB_ACCEL_NEOMAGIC_NM2200:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 256AV");
+ strscpy(info->fix.id, "MagicGraph256AV", sizeof(info->fix.id));
info->flags |= FBINFO_HWACCEL_IMAGEBLIT |
FBINFO_HWACCEL_COPYAREA |
FBINFO_HWACCEL_FILLRECT;
break;
case FB_ACCEL_NEOMAGIC_NM2230:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 256AV+");
+ strscpy(info->fix.id, "Mag.Graph256AV+", sizeof(info->fix.id));
info->flags |= FBINFO_HWACCEL_IMAGEBLIT |
FBINFO_HWACCEL_COPYAREA |
FBINFO_HWACCEL_FILLRECT;
break;
case FB_ACCEL_NEOMAGIC_NM2360:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 256ZX");
+ strscpy(info->fix.id, "MagicGraph256ZX", sizeof(info->fix.id));
info->flags |= FBINFO_HWACCEL_IMAGEBLIT |
FBINFO_HWACCEL_COPYAREA |
FBINFO_HWACCEL_FILLRECT;
break;
case FB_ACCEL_NEOMAGIC_NM2380:
- snprintf(info->fix.id, sizeof(info->fix.id),
- "MagicGraph 256XL+");
+ strscpy(info->fix.id, "Mag.Graph256XL+", sizeof(info->fix.id));
info->flags |= FBINFO_HWACCEL_IMAGEBLIT |
FBINFO_HWACCEL_COPYAREA |
FBINFO_HWACCEL_FILLRECT;