History

Merge tag 'fbdev-for-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes and updates from Helge Deller: "Mostly just small patches, with the exception of the bigger indenting cleanups in the sisfb and radeonfb drivers. Two patches should be mentioned though: A fix-up for fbdev if the screen resize fails (by Shigeru Yoshida), and a potential divide by zero fix in fb_pm2fb (by Letu Ren). Summary: Major fixes: - Revert the changes for fbcon console when vc_resize() fails [Shigeru Yoshida] - Avoid a potential divide by zero error in fb_pm2fb [Letu Ren] Minor fixes: - Add missing pci_disable_device() in chipsfb_pci_init() [Yang Yingliang] - Fix tests for platform_get_irq() failure in omapfb [Yu Zhe] - Destroy mutex on freeing struct fb_info in fbsysfs [Shigeru Yoshida] Cleanups: - Move fbdev drivers from strlcpy to strscpy [Wolfram Sang] - Indenting fixes, comment fixes, ... [Jiapeng Chong & Jilin Yuan]" * tag 'fbdev-for-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: fbcon: Properly revert changes when vc_resize() failed fbdev: Move fbdev drivers from strlcpy to strscpy fbdev: omap: Remove unnecessary print function dev_err() fbdev: chipsfb: Add missing pci_disable_device() in chipsfb_pci_init() fbdev: fbcon: Destroy mutex on freeing struct fb_info fbdev: radeon: Clean up some inconsistent indenting fbdev: sisfb: Clean up some inconsistent indenting fbdev: fb_pm2fb: Avoid potential divide by zero error fbdev: ssd1307fb: Fix repeated words in comments fbdev: omapfb: Fix tests for platform_get_irq() failure

Linus Torvalds committed 4 years ago

Commit 89b749d2 parents d6ffe60 a5a923034 files · +240 −201Browse files

Unified · Split

34 files
  1. drivers/video/console/sticore.c +1 −1
  2. drivers/video/fbdev/aty/atyfb_base.c +1 −1
  3. drivers/video/fbdev/aty/radeon_base.c +24 −24
  4. drivers/video/fbdev/bw2.c +1 −1
  5. drivers/video/fbdev/chipsfb.c +1 −0
  6. drivers/video/fbdev/cirrusfb.c +1 −1
  7. drivers/video/fbdev/clps711x-fb.c +1 −1
  8. drivers/video/fbdev/core/fbcon.c +26 −3
  9. drivers/video/fbdev/core/fbsysfs.c +4 −0
  10. drivers/video/fbdev/cyber2000fb.c +4 −4
  11. drivers/video/fbdev/ffb.c +1 −1
  12. drivers/video/fbdev/geode/gx1fb_core.c +3 −3
  13. drivers/video/fbdev/gxt4500.c +1 −1
  14. drivers/video/fbdev/i740fb.c +1 −1
  15. drivers/video/fbdev/imxfb.c +1 −1
  16. drivers/video/fbdev/matrox/matroxfb_base.c +3 −3
  17. drivers/video/fbdev/omap/omapfb_main.c +2 −4
  18. drivers/video/fbdev/omap2/omapfb/omapfb-main.c +1 −1
  19. drivers/video/fbdev/pm2fb.c +5 −0
  20. drivers/video/fbdev/pxa168fb.c +1 −1
  21. drivers/video/fbdev/pxafb.c +1 −1
  22. drivers/video/fbdev/s3fb.c +1 −1
  23. drivers/video/fbdev/simplefb.c +1 −1
  24. drivers/video/fbdev/sis/sis_main.c +143 −135
  25. drivers/video/fbdev/sm501fb.c +1 −1
  26. drivers/video/fbdev/ssd1307fb.c +1 −1
  27. drivers/video/fbdev/sstfb.c +1 −1
  28. drivers/video/fbdev/sunxvr1000.c +1 −1
  29. drivers/video/fbdev/sunxvr2500.c +1 −1
  30. drivers/video/fbdev/sunxvr500.c +1 −1
  31. drivers/video/fbdev/tcx.c +1 −1
  32. drivers/video/fbdev/tdfxfb.c +2 −2
  33. drivers/video/fbdev/tgafb.c +1 −1
  34. drivers/video/fbdev/tridentfb.c +1 −1
drivers/video/console/sticore.c+1−1
@@ -290,7 +290,7 @@ static char default_sti_path[21] __read_mostly; · 289 unmodified lines
290290 static int __init sti_setup(char *str)
291291 {
292292 if (str)
293− strlcpy (default_sti_path, str, sizeof (default_sti_path));
293+ strscpy(default_sti_path, str, sizeof(default_sti_path));
294294
295295 return 1;
296296 }
drivers/video/fbdev/aty/atyfb_base.c+1−1
@@ -3891,7 +3891,7 @@ static int __init atyfb_setup(char *options) · 3890 unmodified lines
38913891 && (!strncmp(this_opt, "Mach64:", 7))) {
38923892 static unsigned char m64_num;
38933893 static char mach64_str[80];
3894− strlcpy(mach64_str, this_opt + 7, sizeof(mach64_str));
3894+ strscpy(mach64_str, this_opt + 7, sizeof(mach64_str));
38953895 if (!store_video_par(mach64_str, m64_num)) {
38963896 m64_num++;
38973897 mach64_count = m64_num;
drivers/video/fbdev/aty/radeon_base.c+24−24
@@ -1980,7 +1980,7 @@ static int radeon_set_fbinfo(struct radeonfb_info *rinfo) · 1979 unmodified lines
19801980 info->screen_base = rinfo->fb_base;
19811981 info->screen_size = rinfo->mapped_vram;
19821982 /* Fill fix common fields */
1983− strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
1983+ strscpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
19841984 info->fix.smem_start = rinfo->fb_base_phys;
19851985 info->fix.smem_len = rinfo->video_ram;
19861986 info->fix.type = FB_TYPE_PACKED_PIXELS;
@@ -2094,34 +2094,34 @@ static void radeon_identify_vram(struct radeonfb_info *rinfo) · 107 unmodified lines
20942094 u32 tmp;
20952095
20962096 /* framebuffer size */
2097− if ((rinfo->family == CHIP_FAMILY_RS100) ||
2097+ if ((rinfo->family == CHIP_FAMILY_RS100) ||
20982098 (rinfo->family == CHIP_FAMILY_RS200) ||
20992099 (rinfo->family == CHIP_FAMILY_RS300) ||
21002100 (rinfo->family == CHIP_FAMILY_RC410) ||
21012101 (rinfo->family == CHIP_FAMILY_RS400) ||
21022102 (rinfo->family == CHIP_FAMILY_RS480) ) {
2103− u32 tom = INREG(NB_TOM);
2104− tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024);
2105−
2106− radeon_fifo_wait(6);
2107− OUTREG(MC_FB_LOCATION, tom);
2108− OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
2109− OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
2110− OUTREG(OV0_BASE_ADDR, (tom & 0xffff) << 16);
2111−
2112− /* This is supposed to fix the crtc2 noise problem. */
2113− OUTREG(GRPH2_BUFFER_CNTL, INREG(GRPH2_BUFFER_CNTL) & ~0x7f0000);
2114−
2115− if ((rinfo->family == CHIP_FAMILY_RS100) ||
2116− (rinfo->family == CHIP_FAMILY_RS200)) {
2117− /* This is to workaround the asic bug for RMX, some versions
2118− of BIOS doesn't have this register initialized correctly.
2119− */
2120− OUTREGP(CRTC_MORE_CNTL, CRTC_H_CUTOFF_ACTIVE_EN,
2121− ~CRTC_H_CUTOFF_ACTIVE_EN);
2122− }
2123− } else {
2124− tmp = INREG(CNFG_MEMSIZE);
2103+ u32 tom = INREG(NB_TOM);
2104+
2105+ tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024);
2106+ radeon_fifo_wait(6);
2107+ OUTREG(MC_FB_LOCATION, tom);
2108+ OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
2109+ OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
2110+ OUTREG(OV0_BASE_ADDR, (tom & 0xffff) << 16);
2111+
2112+ /* This is supposed to fix the crtc2 noise problem. */
2113+ OUTREG(GRPH2_BUFFER_CNTL, INREG(GRPH2_BUFFER_CNTL) & ~0x7f0000);
2114+
2115+ if ((rinfo->family == CHIP_FAMILY_RS100) ||
2116+ (rinfo->family == CHIP_FAMILY_RS200)) {
2117+ /* This is to workaround the asic bug for RMX, some versions
2118+ * of BIOS doesn't have this register initialized correctly.
2119+ */
2120+ OUTREGP(CRTC_MORE_CNTL, CRTC_H_CUTOFF_ACTIVE_EN,
2121+ ~CRTC_H_CUTOFF_ACTIVE_EN);
2122+ }
2123+ } else {
2124+ tmp = INREG(CNFG_MEMSIZE);
21252125 }
21262126
21272127 /* mem size is bits [28:0], mask off the rest */
drivers/video/fbdev/bw2.c+1−1
@@ -182,7 +182,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) · 181 unmodified lines
182182
183183 static void bw2_init_fix(struct fb_info *info, int linebytes)
184184 {
185− strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id));
185+ strscpy(info->fix.id, "bwtwo", sizeof(info->fix.id));
186186
187187 info->fix.type = FB_TYPE_PACKED_PIXELS;
188188 info->fix.visual = FB_VISUAL_MONO01;
drivers/video/fbdev/chipsfb.c+1−0
@@ -430,6 +430,7 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent) · 429 unmodified lines
430430 err_release_fb:
431431 framebuffer_release(p);
432432 err_disable:
433+ pci_disable_device(dp);
433434 err_out:
434435 return rc;
435436 }
drivers/video/fbdev/cirrusfb.c+1−1
@@ -1999,7 +1999,7 @@ static int cirrusfb_set_fbinfo(struct fb_info *info) · 1998 unmodified lines
19991999 }
20002000
20012001 /* Fill fix common fields */
2002− strlcpy(info->fix.id, cirrusfb_board_info[cinfo->btype].name,
2002+ strscpy(info->fix.id, cirrusfb_board_info[cinfo->btype].name,
20032003 sizeof(info->fix.id));
20042004
20052005 /* monochrome: only 1 memory plane */
drivers/video/fbdev/clps711x-fb.c+1−1
@@ -326,7 +326,7 @@ static int clps711x_fb_probe(struct platform_device *pdev) · 325 unmodified lines
326326 info->var.vmode = FB_VMODE_NONINTERLACED;
327327 info->fix.type = FB_TYPE_PACKED_PIXELS;
328328 info->fix.accel = FB_ACCEL_NONE;
329− strlcpy(info->fix.id, CLPS711X_FB_NAME, sizeof(info->fix.id));
329+ strscpy(info->fix.id, CLPS711X_FB_NAME, sizeof(info->fix.id));
330330 fb_videomode_to_var(&info->var, &cfb->mode);
331331
332332 ret = fb_alloc_cmap(&info->cmap, BIT(CLPS711X_FB_BPP_MAX), 0);
drivers/video/fbdev/core/fbcon.c+26−3
@@ -412,7 +412,7 @@ static int __init fb_console_setup(char *this_opt) · 411 unmodified lines
412412
413413 while ((options = strsep(&this_opt, ",")) != NULL) {
414414 if (!strncmp(options, "font:", 5)) {
415− strlcpy(fontname, options + 5, sizeof(fontname));
415+ strscpy(fontname, options + 5, sizeof(fontname));
416416 continue;
417417 }
418418
@@ -2401,15 +2401,21 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount, · 1982 unmodified lines
24012401 struct fb_info *info = fbcon_info_from_console(vc->vc_num);
24022402 struct fbcon_ops *ops = info->fbcon_par;
24032403 struct fbcon_display *p = &fb_display[vc->vc_num];
2404− int resize;
2404+ int resize, ret, old_userfont, old_width, old_height, old_charcount;
24052405 char *old_data = NULL;
24062406
24072407 resize = (w != vc->vc_font.width) || (h != vc->vc_font.height);
24082408 if (p->userfont)
24092409 old_data = vc->vc_font.data;
24102410 vc->vc_font.data = (void *)(p->fontdata = data);
2411+ old_userfont = p->userfont;
24112412 if ((p->userfont = userfont))
24122413 REFCOUNT(data)++;
2414+
2415+ old_width = vc->vc_font.width;
2416+ old_height = vc->vc_font.height;
2417+ old_charcount = vc->vc_font.charcount;
2418+
24132419 vc->vc_font.width = w;
24142420 vc->vc_font.height = h;
24152421 vc->vc_font.charcount = charcount;
@@ -2425,7 +2431,9 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount, · 9 unmodified lines
24252431 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
24262432 cols /= w;
24272433 rows /= h;
2428− vc_resize(vc, cols, rows);
2434+ ret = vc_resize(vc, cols, rows);
2435+ if (ret)
2436+ goto err_out;
24292437 } else if (con_is_visible(vc)
24302438 && vc->vc_mode == KD_TEXT) {
24312439 fbcon_clear_margins(vc, 0);
@@ -2435,6 +2443,21 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount, · 3 unmodified lines
24352443 if (old_data && (--REFCOUNT(old_data) == 0))
24362444 kfree(old_data - FONT_EXTRA_WORDS * sizeof(int));
24372445 return 0;
2446+
2447+err_out:
2448+ p->fontdata = old_data;
2449+ vc->vc_font.data = (void *)old_data;
2450+
2451+ if (userfont) {
2452+ p->userfont = old_userfont;
2453+ REFCOUNT(data)--;
2454+ }
2455+
2456+ vc->vc_font.width = old_width;
2457+ vc->vc_font.height = old_height;
2458+ vc->vc_font.charcount = old_charcount;
2459+
2460+ return ret;
24382461 }
24392462
24402463 /*
drivers/video/fbdev/core/fbsysfs.c+4−0
@@ -84,6 +84,10 @@ void framebuffer_release(struct fb_info *info) · 83 unmodified lines
8484 if (WARN_ON(refcount_read(&info->count)))
8585 return;
8686
87+#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
88+ mutex_destroy(&info->bl_curve_mutex);
89+#endif
90+
8791 kfree(info->apertures);
8892 kfree(info);
8993 }
drivers/video/fbdev/cyber2000fb.c+4−4
@@ -1134,7 +1134,7 @@ int cyber2000fb_attach(struct cyberpro_info *info, int idx) · 1133 unmodified lines
11341134 info->fb_size = int_cfb_info->fb.fix.smem_len;
11351135 info->info = int_cfb_info;
11361136
1137− strlcpy(info->dev_name, int_cfb_info->fb.fix.id,
1137+ strscpy(info->dev_name, int_cfb_info->fb.fix.id,
11381138 sizeof(info->dev_name));
11391139 }
11401140
@@ -1229,7 +1229,7 @@ static int cyber2000fb_ddc_getsda(void *data) · 88 unmodified lines
12291229
12301230 static int cyber2000fb_setup_ddc_bus(struct cfb_info *cfb)
12311231 {
1232− strlcpy(cfb->ddc_adapter.name, cfb->fb.fix.id,
1232+ strscpy(cfb->ddc_adapter.name, cfb->fb.fix.id,
12331233 sizeof(cfb->ddc_adapter.name));
12341234 cfb->ddc_adapter.owner = THIS_MODULE;
12351235 cfb->ddc_adapter.class = I2C_CLASS_DDC;
@@ -1304,7 +1304,7 @@ static int cyber2000fb_i2c_getscl(void *data) · 68 unmodified lines
13041304
13051305 static int cyber2000fb_i2c_register(struct cfb_info *cfb)
13061306 {
1307− strlcpy(cfb->i2c_adapter.name, cfb->fb.fix.id,
1307+ strscpy(cfb->i2c_adapter.name, cfb->fb.fix.id,
13081308 sizeof(cfb->i2c_adapter.name));
13091309 cfb->i2c_adapter.owner = THIS_MODULE;
13101310 cfb->i2c_adapter.algo_data = &cfb->i2c_algo;
@@ -1500,7 +1500,7 @@ static int cyber2000fb_setup(char *options) · 189 unmodified lines
15001500 if (strncmp(opt, "font:", 5) == 0) {
15011501 static char default_font_storage[40];
15021502
1503− strlcpy(default_font_storage, opt + 5,
1503+ strscpy(default_font_storage, opt + 5,
15041504 sizeof(default_font_storage));
15051505 default_font = default_font_storage;
15061506 continue;
drivers/video/fbdev/ffb.c+1−1
@@ -883,7 +883,7 @@ static void ffb_init_fix(struct fb_info *info) · 882 unmodified lines
883883 } else
884884 ffb_type_name = "Elite 3D";
885885
886− strlcpy(info->fix.id, ffb_type_name, sizeof(info->fix.id));
886+ strscpy(info->fix.id, ffb_type_name, sizeof(info->fix.id));
887887
888888 info->fix.type = FB_TYPE_PACKED_PIXELS;
889889 info->fix.visual = FB_VISUAL_TRUECOLOR;
drivers/video/fbdev/geode/gx1fb_core.c+3−3
@@ -410,13 +410,13 @@ static void __init gx1fb_setup(char *options) · 409 unmodified lines
410410 continue;
411411
412412 if (!strncmp(this_opt, "mode:", 5))
413− strlcpy(mode_option, this_opt + 5, sizeof(mode_option));
413+ strscpy(mode_option, this_opt + 5, sizeof(mode_option));
414414 else if (!strncmp(this_opt, "crt:", 4))
415415 crt_option = !!simple_strtoul(this_opt + 4, NULL, 0);
416416 else if (!strncmp(this_opt, "panel:", 6))
417− strlcpy(panel_option, this_opt + 6, sizeof(panel_option));
417+ strscpy(panel_option, this_opt + 6, sizeof(panel_option));
418418 else
419− strlcpy(mode_option, this_opt, sizeof(mode_option));
419+ strscpy(mode_option, this_opt, sizeof(mode_option));
420420 }
421421 }
422422 #endif
drivers/video/fbdev/gxt4500.c+1−1
@@ -650,7 +650,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 649 unmodified lines
650650 cardtype = ent->driver_data;
651651 par->refclk_ps = cardinfo[cardtype].refclk_ps;
652652 info->fix = gxt4500_fix;
653− strlcpy(info->fix.id, cardinfo[cardtype].cardname,
653+ strscpy(info->fix.id, cardinfo[cardtype].cardname,
654654 sizeof(info->fix.id));
655655 info->pseudo_palette = par->pseudo_palette;
656656
drivers/video/fbdev/i740fb.c+1−1
@@ -159,7 +159,7 @@ static int i740fb_setup_ddc_bus(struct fb_info *info) · 158 unmodified lines
159159 {
160160 struct i740fb_par *par = info->par;
161161
162− strlcpy(par->ddc_adapter.name, info->fix.id,
162+ strscpy(par->ddc_adapter.name, info->fix.id,
163163 sizeof(par->ddc_adapter.name));
164164 par->ddc_adapter.owner = THIS_MODULE;
165165 par->ddc_adapter.class = I2C_CLASS_DDC;
drivers/video/fbdev/imxfb.c+1−1
@@ -681,7 +681,7 @@ static int imxfb_init_fbinfo(struct platform_device *pdev) · 680 unmodified lines
681681
682682 fbi->devtype = pdev->id_entry->driver_data;
683683
684− strlcpy(info->fix.id, IMX_NAME, sizeof(info->fix.id));
684+ strscpy(info->fix.id, IMX_NAME, sizeof(info->fix.id));
685685
686686 info->fix.type = FB_TYPE_PACKED_PIXELS;
687687 info->fix.type_aux = 0;
drivers/video/fbdev/matrox/matroxfb_base.c+3−3
@@ -2383,9 +2383,9 @@ static int __init matroxfb_setup(char *options) { · 2382 unmodified lines
23832383 else if (!strncmp(this_opt, "mem:", 4))
23842384 mem = simple_strtoul(this_opt+4, NULL, 0);
23852385 else if (!strncmp(this_opt, "mode:", 5))
2386− strlcpy(videomode, this_opt+5, sizeof(videomode));
2386+ strscpy(videomode, this_opt + 5, sizeof(videomode));
23872387 else if (!strncmp(this_opt, "outputs:", 8))
2388− strlcpy(outputs, this_opt+8, sizeof(outputs));
2388+ strscpy(outputs, this_opt + 8, sizeof(outputs));
23892389 else if (!strncmp(this_opt, "dfp:", 4)) {
23902390 dfp_type = simple_strtoul(this_opt+4, NULL, 0);
23912391 dfp = 1;
@@ -2455,7 +2455,7 @@ static int __init matroxfb_setup(char *options) { · 63 unmodified lines
24552455 else if (!strcmp(this_opt, "dfp"))
24562456 dfp = value;
24572457 else {
2458− strlcpy(videomode, this_opt, sizeof(videomode));
2458+ strscpy(videomode, this_opt, sizeof(videomode));
24592459 }
24602460 }
24612461 }
drivers/video/fbdev/omap/omapfb_main.c+2−4
@@ -1642,15 +1642,13 @@ static int omapfb_do_probe(struct platform_device *pdev, · 1641 unmodified lines
16421642 goto cleanup;
16431643 }
16441644 fbdev->int_irq = platform_get_irq(pdev, 0);
1645− if (!fbdev->int_irq) {
1646− dev_err(&pdev->dev, "unable to get irq\n");
1645+ if (fbdev->int_irq < 0) {
16471646 r = ENXIO;
16481647 goto cleanup;
16491648 }
16501649
16511650 fbdev->ext_irq = platform_get_irq(pdev, 1);
1652− if (!fbdev->ext_irq) {
1653− dev_err(&pdev->dev, "unable to get irq\n");
1651+ if (fbdev->ext_irq < 0) {
16541652 r = ENXIO;
16551653 goto cleanup;
16561654 }
drivers/video/fbdev/omap2/omapfb/omapfb-main.c+1−1
@@ -1331,7 +1331,7 @@ static void clear_fb_info(struct fb_info *fbi) · 1330 unmodified lines
13311331 {
13321332 memset(&fbi->var, 0, sizeof(fbi->var));
13331333 memset(&fbi->fix, 0, sizeof(fbi->fix));
1334− strlcpy(fbi->fix.id, MODULE_NAME, sizeof(fbi->fix.id));
1334+ strscpy(fbi->fix.id, MODULE_NAME, sizeof(fbi->fix.id));
13351335 }
13361336
13371337 static int omapfb_free_all_fbmem(struct omapfb2_device *fbdev)
drivers/video/fbdev/pm2fb.c+5−0
@@ -617,6 +617,11 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) · 616 unmodified lines
617617 return -EINVAL;
618618 }
619619
620+ if (!var->pixclock) {
621+ DPRINTK("pixclock is zero\n");
622+ return -EINVAL;
623+ }
624+
620625 if (PICOS2KHZ(var->pixclock) > PM2_MAX_PIXCLOCK) {
621626 DPRINTK("pixclock too high (%ldKHz)\n",
622627 PICOS2KHZ(var->pixclock));
drivers/video/fbdev/pxa168fb.c+1−1
@@ -640,7 +640,7 @@ static int pxa168fb_probe(struct platform_device *pdev) · 639 unmodified lines
640640 info->flags = FBINFO_DEFAULT | FBINFO_PARTIAL_PAN_OK |
641641 FBINFO_HWACCEL_XPAN | FBINFO_HWACCEL_YPAN;
642642 info->node = -1;
643− strlcpy(info->fix.id, mi->id, 16);
643+ strscpy(info->fix.id, mi->id, 16);
644644 info->fix.type = FB_TYPE_PACKED_PIXELS;
645645 info->fix.type_aux = 0;
646646 info->fix.xpanstep = 0;
drivers/video/fbdev/pxafb.c+1−1
@@ -2042,7 +2042,7 @@ static int __init pxafb_setup_options(void) · 2041 unmodified lines
20422042 return -ENODEV;
20432043
20442044 if (options)
2045− strlcpy(g_options, options, sizeof(g_options));
2045+ strscpy(g_options, options, sizeof(g_options));
20462046
20472047 return 0;
20482048 }
drivers/video/fbdev/s3fb.c+1−1
@@ -248,7 +248,7 @@ static int s3fb_setup_ddc_bus(struct fb_info *info) · 247 unmodified lines
248248 {
249249 struct s3fb_info *par = info->par;
250250
251− strlcpy(par->ddc_adapter.name, info->fix.id,
251+ strscpy(par->ddc_adapter.name, info->fix.id,
252252 sizeof(par->ddc_adapter.name));
253253 par->ddc_adapter.owner = THIS_MODULE;
254254 par->ddc_adapter.class = I2C_CLASS_DDC;
drivers/video/fbdev/simplefb.c+1−1
@@ -355,7 +355,7 @@ static int simplefb_regulators_get(struct simplefb_par *par, · 354 unmodified lines
355355 if (!p || p == prop->name)
356356 continue;
357357
358− strlcpy(name, prop->name,
358+ strscpy(name, prop->name,
359359 strlen(prop->name) - strlen(SUPPLY_SUFFIX) + 1);
360360 regulator = devm_regulator_get_optional(&pdev->dev, name);
361361 if (IS_ERR(regulator)) {
drivers/video/fbdev/sis/sis_main.c+143−135
@@ -649,37 +649,37 @@ sisfb_validate_mode(struct sis_video_info *ivideo, int myindex, u32 vbflags) · 648 unmodified lines
649649 u16 xres=0, yres, myres;
650650
651651 #ifdef CONFIG_FB_SIS_300
652− if(ivideo->sisvga_engine == SIS_300_VGA) {
653− if(!(sisbios_mode[myindex].chipset & MD_SIS300))
652+ if (ivideo->sisvga_engine == SIS_300_VGA) {
653+ if (!(sisbios_mode[myindex].chipset & MD_SIS300))
654654 return -1 ;
655655 }
656656 #endif
657657 #ifdef CONFIG_FB_SIS_315
658− if(ivideo->sisvga_engine == SIS_315_VGA) {
659− if(!(sisbios_mode[myindex].chipset & MD_SIS315))
658+ if (ivideo->sisvga_engine == SIS_315_VGA) {
659+ if (!(sisbios_mode[myindex].chipset & MD_SIS315))
660660 return -1;
661661 }
662662 #endif
663663
664664 myres = sisbios_mode[myindex].yres;
665665
666− switch(vbflags & VB_DISPTYPE_DISP2) {
666+ switch (vbflags & VB_DISPTYPE_DISP2) {
667667
668668 case CRT2_LCD:
669669 xres = ivideo->lcdxres; yres = ivideo->lcdyres;
670670
671− if((ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL848) &&
672− (ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL856)) {
673− if(sisbios_mode[myindex].xres > xres)
671+ if ((ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL848) &&
672+ (ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL856)) {
673+ if (sisbios_mode[myindex].xres > xres)
674674 return -1;
675− if(myres > yres)
675+ if (myres > yres)
676676 return -1;
677677 }
678678
679− if(ivideo->sisfb_fstn) {
680− if(sisbios_mode[myindex].xres == 320) {
681− if(myres == 240) {
682− switch(sisbios_mode[myindex].mode_no[1]) {
679+ if (ivideo->sisfb_fstn) {
680+ if (sisbios_mode[myindex].xres == 320) {
681+ if (myres == 240) {
682+ switch (sisbios_mode[myindex].mode_no[1]) {
683683 case 0x50: myindex = MODE_FSTN_8; break;
684684 case 0x56: myindex = MODE_FSTN_16; break;
685685 case 0x53: return -1;
@@ -688,7 +688,7 @@ sisfb_validate_mode(struct sis_video_info *ivideo, int myindex, u32 vbflags) · 2 unmodified lines
688688 }
689689 }
690690
691− if(SiS_GetModeID_LCD(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
691+ if (SiS_GetModeID_LCD(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
692692 sisbios_mode[myindex].yres, 0, ivideo->sisfb_fstn,
693693 ivideo->SiS_Pr.SiS_CustomT, xres, yres, ivideo->vbflags2) < 0x14) {
694694 return -1;
@@ -696,14 +696,14 @@ sisfb_validate_mode(struct sis_video_info *ivideo, int myindex, u32 vbflags) · 1 unmodified line
696696 break;
697697
698698 case CRT2_TV:
699− if(SiS_GetModeID_TV(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
699+ if (SiS_GetModeID_TV(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
700700 sisbios_mode[myindex].yres, 0, ivideo->vbflags2) < 0x14) {
701701 return -1;
702702 }
703703 break;
704704
705705 case CRT2_VGA:
706− if(SiS_GetModeID_VGA2(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
706+ if (SiS_GetModeID_VGA2(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
707707 sisbios_mode[myindex].yres, 0, ivideo->vbflags2) < 0x14) {
708708 return -1;
709709 }
@@ -1872,7 +1872,7 @@ sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info) · 1162 unmodified lines
18721872
18731873 memset(fix, 0, sizeof(struct fb_fix_screeninfo));
18741874
1875− strlcpy(fix->id, ivideo->myid, sizeof(fix->id));
1875+ strscpy(fix->id, ivideo->myid, sizeof(fix->id));
18761876
18771877 mutex_lock(&info->mm_lock);
18781878 fix->smem_start = ivideo->video_base + ivideo->video_offset;
@@ -2204,82 +2204,88 @@ static bool sisfb_test_DDC1(struct sis_video_info *ivideo) · 325 unmodified lines
22042204
22052205 static void sisfb_sense_crt1(struct sis_video_info *ivideo)
22062206 {
2207− bool mustwait = false;
2208− u8 sr1F, cr17;
2207+ bool mustwait = false;
2208+ u8 sr1F, cr17;
22092209 #ifdef CONFIG_FB_SIS_315
2210− u8 cr63=0;
2210+ u8 cr63 = 0;
22112211 #endif
2212− u16 temp = 0xffff;
2213− int i;
2212+ u16 temp = 0xffff;
2213+ int i;
2214+
2215+ sr1F = SiS_GetReg(SISSR, 0x1F);
2216+ SiS_SetRegOR(SISSR, 0x1F, 0x04);
2217+ SiS_SetRegAND(SISSR, 0x1F, 0x3F);
22142218
2215− sr1F = SiS_GetReg(SISSR, 0x1F);
2216− SiS_SetRegOR(SISSR, 0x1F, 0x04);
2217− SiS_SetRegAND(SISSR, 0x1F, 0x3F);
2218− if(sr1F & 0xc0) mustwait = true;
2219+ if (sr1F & 0xc0)
2220+ mustwait = true;
22192221
22202222 #ifdef CONFIG_FB_SIS_315
2221− if(ivideo->sisvga_engine == SIS_315_VGA) {
2222− cr63 = SiS_GetReg(SISCR, ivideo->SiS_Pr.SiS_MyCR63);
2223− cr63 &= 0x40;
2224− SiS_SetRegAND(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xBF);
2225− }
2223+ if (ivideo->sisvga_engine == SIS_315_VGA) {
2224+ cr63 = SiS_GetReg(SISCR, ivideo->SiS_Pr.SiS_MyCR63);
2225+ cr63 &= 0x40;
2226+ SiS_SetRegAND(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xBF);
2227+ }
22262228 #endif
22272229
2228− cr17 = SiS_GetReg(SISCR, 0x17);
2229− cr17 &= 0x80;
2230− if(!cr17) {
2231− SiS_SetRegOR(SISCR, 0x17, 0x80);
2232− mustwait = true;
2233− SiS_SetReg(SISSR, 0x00, 0x01);
2234− SiS_SetReg(SISSR, 0x00, 0x03);
2235− }
2230+ cr17 = SiS_GetReg(SISCR, 0x17);
2231+ cr17 &= 0x80;
22362232
2237− if(mustwait) {
2238− for(i=0; i < 10; i++) sisfbwaitretracecrt1(ivideo);
2239− }
2233+ if (!cr17) {
2234+ SiS_SetRegOR(SISCR, 0x17, 0x80);
2235+ mustwait = true;
2236+ SiS_SetReg(SISSR, 0x00, 0x01);
2237+ SiS_SetReg(SISSR, 0x00, 0x03);
2238+ }
22402239
2240+ if (mustwait) {
2241+ for (i = 0; i < 10; i++)
2242+ sisfbwaitretracecrt1(ivideo);
2243+ }
22412244 #ifdef CONFIG_FB_SIS_315
2242− if(ivideo->chip >= SIS_330) {
2243− SiS_SetRegAND(SISCR, 0x32, ~0x20);
2244− if(ivideo->chip >= SIS_340) {
2245− SiS_SetReg(SISCR, 0x57, 0x4a);
2246− } else {
2247− SiS_SetReg(SISCR, 0x57, 0x5f);
2248− }
2249− SiS_SetRegOR(SISCR, 0x53, 0x02);
2250− while ((SiS_GetRegByte(SISINPSTAT)) & 0x01) break;
2251− while (!((SiS_GetRegByte(SISINPSTAT)) & 0x01)) break;
2252− if ((SiS_GetRegByte(SISMISCW)) & 0x10) temp = 1;
2253− SiS_SetRegAND(SISCR, 0x53, 0xfd);
2254− SiS_SetRegAND(SISCR, 0x57, 0x00);
2255− }
2245+ if (ivideo->chip >= SIS_330) {
2246+ SiS_SetRegAND(SISCR, 0x32, ~0x20);
2247+ if (ivideo->chip >= SIS_340)
2248+ SiS_SetReg(SISCR, 0x57, 0x4a);
2249+ else
2250+ SiS_SetReg(SISCR, 0x57, 0x5f);
2251+
2252+ SiS_SetRegOR(SISCR, 0x53, 0x02);
2253+ while ((SiS_GetRegByte(SISINPSTAT)) & 0x01)
2254+ break;
2255+ while (!((SiS_GetRegByte(SISINPSTAT)) & 0x01))
2256+ break;
2257+ if ((SiS_GetRegByte(SISMISCW)) & 0x10)
2258+ temp = 1;
2259+
2260+ SiS_SetRegAND(SISCR, 0x53, 0xfd);
2261+ SiS_SetRegAND(SISCR, 0x57, 0x00);
2262+ }
22562263 #endif
22572264
2258− if(temp == 0xffff) {
2259− i = 3;
2260− do {
2261− temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags,
2262− ivideo->sisvga_engine, 0, 0, NULL, ivideo->vbflags2);
2263− } while(((temp == 0) || (temp == 0xffff)) && i--);
2265+ if (temp == 0xffff) {
2266+ i = 3;
22642267
2265− if((temp == 0) || (temp == 0xffff)) {
2266− if(sisfb_test_DDC1(ivideo)) temp = 1;
2267− }
2268− }
2268+ do {
2269+ temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags,
2270+ ivideo->sisvga_engine, 0, 0, NULL, ivideo->vbflags2);
2271+ } while (((temp == 0) || (temp == 0xffff)) && i--);
22692272
2270− if((temp) && (temp != 0xffff)) {
2271− SiS_SetRegOR(SISCR, 0x32, 0x20);
2272− }
2273+ if ((temp == 0) || (temp == 0xffff)) {
2274+ if (sisfb_test_DDC1(ivideo))
2275+ temp = 1;
2276+ }
2277+ }
2278+
2279+ if ((temp) && (temp != 0xffff))
2280+ SiS_SetRegOR(SISCR, 0x32, 0x20);
22732281
22742282 #ifdef CONFIG_FB_SIS_315
2275− if(ivideo->sisvga_engine == SIS_315_VGA) {
2276− SiS_SetRegANDOR(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xBF, cr63);
2277− }
2283+ if (ivideo->sisvga_engine == SIS_315_VGA)
2284+ SiS_SetRegANDOR(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xBF, cr63);
22782285 #endif
22792286
2280− SiS_SetRegANDOR(SISCR, 0x17, 0x7F, cr17);
2281−
2282− SiS_SetReg(SISSR, 0x1F, sr1F);
2287+ SiS_SetRegANDOR(SISCR, 0x17, 0x7F, cr17);
2288+ SiS_SetReg(SISSR, 0x1F, sr1F);
22832289 }
22842290
22852291 /* Determine and detect attached devices on SiS30x */
@@ -2293,25 +2299,25 @@ static void SiS_SenseLCD(struct sis_video_info *ivideo) · 7 unmodified lines
22932299 ivideo->SiS_Pr.PanelSelfDetected = false;
22942300
22952301 /* LCD detection only for TMDS bridges */
2296− if(!(ivideo->vbflags2 & VB2_SISTMDSBRIDGE))
2302+ if (!(ivideo->vbflags2 & VB2_SISTMDSBRIDGE))
22972303 return;
2298− if(ivideo->vbflags2 & VB2_30xBDH)
2304+ if (ivideo->vbflags2 & VB2_30xBDH)
22992305 return;
23002306
23012307 /* If LCD already set up by BIOS, skip it */
23022308 reg = SiS_GetReg(SISCR, 0x32);
2303− if(reg & 0x08)
2309+ if (reg & 0x08)
23042310 return;
23052311
23062312 realcrtno = 1;
2307− if(ivideo->SiS_Pr.DDCPortMixup)
2313+ if (ivideo->SiS_Pr.DDCPortMixup)
23082314 realcrtno = 0;
23092315
23102316 /* Check DDC capabilities */
23112317 temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, ivideo->sisvga_engine,
23122318 realcrtno, 0, &buffer[0], ivideo->vbflags2);
23132319
2314− if((!temp) || (temp == 0xffff) || (!(temp & 0x02)))
2320+ if ((!temp) || (temp == 0xffff) || (!(temp & 0x02)))
23152321 return;
23162322
23172323 /* Read DDC data */
@@ -2320,17 +2326,17 @@ static void SiS_SenseLCD(struct sis_video_info *ivideo) · 2 unmodified lines
23202326 temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags,
23212327 ivideo->sisvga_engine, realcrtno, 1,
23222328 &buffer[0], ivideo->vbflags2);
2323− } while((temp) && i--);
2329+ } while ((temp) && i--);
23242330
2325− if(temp)
2331+ if (temp)
23262332 return;
23272333
23282334 /* No digital device */
2329− if(!(buffer[0x14] & 0x80))
2335+ if (!(buffer[0x14] & 0x80))
23302336 return;
23312337
23322338 /* First detailed timing preferred timing? */
2333− if(!(buffer[0x18] & 0x02))
2339+ if (!(buffer[0x18] & 0x02))
23342340 return;
23352341
23362342 xres = buffer[0x38] | ((buffer[0x3a] & 0xf0) << 4);
@@ -2338,26 +2344,26 @@ static void SiS_SenseLCD(struct sis_video_info *ivideo) · 1 unmodified line
23382344
23392345 switch(xres) {
23402346 case 1024:
2341− if(yres == 768)
2347+ if (yres == 768)
23422348 paneltype = 0x02;
23432349 break;
23442350 case 1280:
2345− if(yres == 1024)
2351+ if (yres == 1024)
23462352 paneltype = 0x03;
23472353 break;
23482354 case 1600:
2349− if((yres == 1200) && (ivideo->vbflags2 & VB2_30xC))
2355+ if ((yres == 1200) && (ivideo->vbflags2 & VB2_30xC))
23502356 paneltype = 0x0b;
23512357 break;
23522358 }
23532359
2354− if(!paneltype)
2360+ if (!paneltype)
23552361 return;
23562362
2357− if(buffer[0x23])
2363+ if (buffer[0x23])
23582364 cr37 |= 0x10;
23592365
2360− if((buffer[0x47] & 0x18) == 0x18)
2366+ if ((buffer[0x47] & 0x18) == 0x18)
23612367 cr37 |= ((((buffer[0x47] & 0x06) ^ 0x06) << 5) | 0x20);
23622368 else
23632369 cr37 |= 0xc0;
@@ -2372,31 +2378,34 @@ static void SiS_SenseLCD(struct sis_video_info *ivideo) · 8 unmodified lines
23722378
23732379 static int SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
23742380 {
2375− int temp, mytest, result, i, j;
2376−
2377− for(j = 0; j < 10; j++) {
2378− result = 0;
2379− for(i = 0; i < 3; i++) {
2380− mytest = test;
2381− SiS_SetReg(SISPART4, 0x11, (type & 0x00ff));
2382− temp = (type >> 8) | (mytest & 0x00ff);
2383− SiS_SetRegANDOR(SISPART4, 0x10, 0xe0, temp);
2384− SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1500);
2385− mytest >>= 8;
2386− mytest &= 0x7f;
2387− temp = SiS_GetReg(SISPART4, 0x03);
2388− temp ^= 0x0e;
2389− temp &= mytest;
2390− if(temp == mytest) result++;
2381+ int temp, mytest, result, i, j;
2382+
2383+ for (j = 0; j < 10; j++) {
2384+ result = 0;
2385+ for (i = 0; i < 3; i++) {
2386+ mytest = test;
2387+ SiS_SetReg(SISPART4, 0x11, (type & 0x00ff));
2388+ temp = (type >> 8) | (mytest & 0x00ff);
2389+ SiS_SetRegANDOR(SISPART4, 0x10, 0xe0, temp);
2390+ SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1500);
2391+ mytest >>= 8;
2392+ mytest &= 0x7f;
2393+ temp = SiS_GetReg(SISPART4, 0x03);
2394+ temp ^= 0x0e;
2395+ temp &= mytest;
2396+ if (temp == mytest)
2397+ result++;
23912398 #if 1
2392− SiS_SetReg(SISPART4, 0x11, 0x00);
2393− SiS_SetRegAND(SISPART4, 0x10, 0xe0);
2394− SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1000);
2399+ SiS_SetReg(SISPART4, 0x11, 0x00);
2400+ SiS_SetRegAND(SISPART4, 0x10, 0xe0);
2401+ SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1000);
23952402 #endif
2396− }
2397− if((result == 0) || (result >= 2)) break;
2398− }
2399− return result;
2403+ }
2404+
2405+ if ((result == 0) || (result >= 2))
2406+ break;
2407+ }
2408+ return result;
24002409 }
24012410
24022411 static void SiS_Sense30x(struct sis_video_info *ivideo)
@@ -4262,18 +4271,17 @@ static int sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, · 1859 unmodified lines
42624271 unsigned int k, RankCapacity, PageCapacity, BankNumHigh, BankNumMid;
42634272 unsigned int PhysicalAdrOtherPage, PhysicalAdrHigh, PhysicalAdrHalfPage;
42644273
4265− for(k = 0; k < ARRAY_SIZE(SiS_DRAMType); k++) {
4266−
4274+ for (k = 0; k < ARRAY_SIZE(SiS_DRAMType); k++) {
42674275 RankCapacity = buswidth * SiS_DRAMType[k][3];
42684276
4269− if(RankCapacity != PseudoRankCapacity)
4277+ if (RankCapacity != PseudoRankCapacity)
42704278 continue;
42714279
4272− if((SiS_DRAMType[k][2] + SiS_DRAMType[k][0]) > PseudoAdrPinCount)
4280+ if ((SiS_DRAMType[k][2] + SiS_DRAMType[k][0]) > PseudoAdrPinCount)
42734281 continue;
42744282
42754283 BankNumHigh = RankCapacity * 16 * iteration - 1;
4276− if(iteration == 3) { /* Rank No */
4284+ if (iteration == 3) { /* Rank No */
42774285 BankNumMid = RankCapacity * 16 - 1;
42784286 } else {
42794287 BankNumMid = RankCapacity * 16 * iteration / 2 - 1;
@@ -4287,18 +4295,22 @@ static int sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, · 7 unmodified lines
42874295 SiS_SetRegAND(SISSR, 0x15, 0xFB); /* Test */
42884296 SiS_SetRegOR(SISSR, 0x15, 0x04); /* Test */
42894297 sr14 = (SiS_DRAMType[k][3] * buswidth) - 1;
4290− if(buswidth == 4) sr14 |= 0x80;
4291− else if(buswidth == 2) sr14 |= 0x40;
4298+
4299+ if (buswidth == 4)
4300+ sr14 |= 0x80;
4301+ else if (buswidth == 2)
4302+ sr14 |= 0x40;
4303+
42924304 SiS_SetReg(SISSR, 0x13, SiS_DRAMType[k][4]);
42934305 SiS_SetReg(SISSR, 0x14, sr14);
42944306
42954307 BankNumHigh <<= 16;
42964308 BankNumMid <<= 16;
42974309
4298− if((BankNumHigh + PhysicalAdrHigh >= mapsize) ||
4299− (BankNumMid + PhysicalAdrHigh >= mapsize) ||
4300− (BankNumHigh + PhysicalAdrHalfPage >= mapsize) ||
4301− (BankNumHigh + PhysicalAdrOtherPage >= mapsize))
4310+ if ((BankNumHigh + PhysicalAdrHigh >= mapsize) ||
4311+ (BankNumMid + PhysicalAdrHigh >= mapsize) ||
4312+ (BankNumHigh + PhysicalAdrHalfPage >= mapsize) ||
4313+ (BankNumHigh + PhysicalAdrOtherPage >= mapsize))
43024314 continue;
43034315
43044316 /* Write data */
@@ -4312,7 +4324,7 @@ static int sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, · 7 unmodified lines
43124324 (FBAddr + BankNumHigh + PhysicalAdrOtherPage));
43134325
43144326 /* Read data */
4315− if(readw(FBAddr + BankNumHigh + PhysicalAdrHigh) == PhysicalAdrHigh)
4327+ if (readw(FBAddr + BankNumHigh + PhysicalAdrHigh) == PhysicalAdrHigh)
43164328 return 1;
43174329 }
43184330
@@ -5867,7 +5879,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 1548 unmodified lines
58675879 ivideo->cardnumber++;
58685880 }
58695881
5870− strlcpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid));
5882+ strscpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid));
58715883
58725884 ivideo->warncount = 0;
58735885 ivideo->chip_id = pdev->device;
@@ -6150,24 +6162,20 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 276 unmodified lines
61506162 #endif
61516163
61526164 #ifdef CONFIG_FB_SIS_315
6153− if(ivideo->sisvga_engine == SIS_315_VGA) {
6165+ if (ivideo->sisvga_engine == SIS_315_VGA) {
61546166 int result = 1;
6155− /* if((ivideo->chip == SIS_315H) ||
6156− (ivideo->chip == SIS_315) ||
6157− (ivideo->chip == SIS_315PRO) ||
6158− (ivideo->chip == SIS_330)) {
6159− sisfb_post_sis315330(pdev);
6160− } else */ if(ivideo->chip == XGI_20) {
6167+
6168+ if (ivideo->chip == XGI_20) {
61616169 result = sisfb_post_xgi(pdev);
61626170 ivideo->sisfb_can_post = 1;
6163− } else if((ivideo->chip == XGI_40) && ivideo->haveXGIROM) {
6171+ } else if ((ivideo->chip == XGI_40) && ivideo->haveXGIROM) {
61646172 result = sisfb_post_xgi(pdev);
61656173 ivideo->sisfb_can_post = 1;
61666174 } else {
61676175 printk(KERN_INFO "sisfb: Card is not "
61686176 "POSTed and sisfb can't do this either.\n");
61696177 }
6170− if(!result) {
6178+ if (!result) {
61716179 printk(KERN_ERR "sisfb: Failed to POST card\n");
61726180 ret = -ENODEV;
61736181 goto error_3;
drivers/video/fbdev/sm501fb.c+1−1
@@ -1719,7 +1719,7 @@ static int sm501fb_init_fb(struct fb_info *fb, enum sm501_controller head, · 1718 unmodified lines
17191719 enable = 0;
17201720 }
17211721
1722− strlcpy(fb->fix.id, fbname, sizeof(fb->fix.id));
1722+ strscpy(fb->fix.id, fbname, sizeof(fb->fix.id));
17231723
17241724 memcpy(&par->ops,
17251725 (head == HEAD_CRT) ? &sm501fb_ops_crt : &sm501fb_ops_pnl,
drivers/video/fbdev/ssd1307fb.c+1−1
@@ -450,7 +450,7 @@ static int ssd1307fb_init(struct ssd1307fb_par *par) · 449 unmodified lines
450450 if (ret < 0)
451451 return ret;
452452
453− /* Set Set Area Color Mode ON/OFF & Low Power Display Mode */
453+ /* Set Area Color Mode ON/OFF & Low Power Display Mode */
454454 if (par->area_color_enable || par->low_power) {
455455 u32 mode;
456456
drivers/video/fbdev/sstfb.c+1−1
@@ -1382,7 +1382,7 @@ static int sstfb_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 1381 unmodified lines
13821382 goto fail;
13831383 }
13841384 sst_get_memsize(info, &fix->smem_len);
1385− strlcpy(fix->id, spec->name, sizeof(fix->id));
1385+ strscpy(fix->id, spec->name, sizeof(fix->id));
13861386
13871387 printk(KERN_INFO "%s (revision %d) with %s dac\n",
13881388 fix->id, par->revision, par->dac_sw.name);
drivers/video/fbdev/sunxvr1000.c+1−1
@@ -80,7 +80,7 @@ static int gfb_set_fbinfo(struct gfb_info *gp) · 79 unmodified lines
8080 info->pseudo_palette = gp->pseudo_palette;
8181
8282 /* Fill fix common fields */
83− strlcpy(info->fix.id, "gfb", sizeof(info->fix.id));
83+ strscpy(info->fix.id, "gfb", sizeof(info->fix.id));
8484 info->fix.smem_start = gp->fb_base_phys;
8585 info->fix.smem_len = gp->fb_size;
8686 info->fix.type = FB_TYPE_PACKED_PIXELS;
drivers/video/fbdev/sunxvr2500.c+1−1
@@ -84,7 +84,7 @@ static int s3d_set_fbinfo(struct s3d_info *sp) · 83 unmodified lines
8484 info->pseudo_palette = sp->pseudo_palette;
8585
8686 /* Fill fix common fields */
87− strlcpy(info->fix.id, "s3d", sizeof(info->fix.id));
87+ strscpy(info->fix.id, "s3d", sizeof(info->fix.id));
8888 info->fix.smem_start = sp->fb_base_phys;
8989 info->fix.smem_len = sp->fb_size;
9090 info->fix.type = FB_TYPE_PACKED_PIXELS;
drivers/video/fbdev/sunxvr500.c+1−1
@@ -207,7 +207,7 @@ static int e3d_set_fbinfo(struct e3d_info *ep) · 206 unmodified lines
207207 info->pseudo_palette = ep->pseudo_palette;
208208
209209 /* Fill fix common fields */
210− strlcpy(info->fix.id, "e3d", sizeof(info->fix.id));
210+ strscpy(info->fix.id, "e3d", sizeof(info->fix.id));
211211 info->fix.smem_start = ep->fb_base_phys;
212212 info->fix.smem_len = ep->fb_size;
213213 info->fix.type = FB_TYPE_PACKED_PIXELS;
drivers/video/fbdev/tcx.c+1−1
@@ -333,7 +333,7 @@ tcx_init_fix(struct fb_info *info, int linebytes) · 332 unmodified lines
333333 else
334334 tcx_name = "TCX24";
335335
336− strlcpy(info->fix.id, tcx_name, sizeof(info->fix.id));
336+ strscpy(info->fix.id, tcx_name, sizeof(info->fix.id));
337337
338338 info->fix.type = FB_TYPE_PACKED_PIXELS;
339339 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
drivers/video/fbdev/tdfxfb.c+2−2
@@ -1264,7 +1264,7 @@ static int tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan, const char *name, · 1263 unmodified lines
12641264 {
12651265 int rc;
12661266
1267− strlcpy(chan->adapter.name, name, sizeof(chan->adapter.name));
1267+ strscpy(chan->adapter.name, name, sizeof(chan->adapter.name));
12681268 chan->adapter.owner = THIS_MODULE;
12691269 chan->adapter.class = I2C_CLASS_DDC;
12701270 chan->adapter.algo_data = &chan->algo;
@@ -1293,7 +1293,7 @@ static int tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan, const char *name, · 22 unmodified lines
12931293 {
12941294 int rc;
12951295
1296− strlcpy(chan->adapter.name, name, sizeof(chan->adapter.name));
1296+ strscpy(chan->adapter.name, name, sizeof(chan->adapter.name));
12971297 chan->adapter.owner = THIS_MODULE;
12981298 chan->adapter.algo_data = &chan->algo;
12991299 chan->adapter.dev.parent = dev;
drivers/video/fbdev/tgafb.c+1−1
@@ -1344,7 +1344,7 @@ tgafb_init_fix(struct fb_info *info) · 1343 unmodified lines
13441344 memory_size = 16777216;
13451345 }
13461346
1347− strlcpy(info->fix.id, tga_type_name, sizeof(info->fix.id));
1347+ strscpy(info->fix.id, tga_type_name, sizeof(info->fix.id));
13481348
13491349 info->fix.type = FB_TYPE_PACKED_PIXELS;
13501350 info->fix.type_aux = 0;
drivers/video/fbdev/tridentfb.c+1−1
@@ -270,7 +270,7 @@ static int tridentfb_setup_ddc_bus(struct fb_info *info) · 269 unmodified lines
270270 {
271271 struct tridentfb_par *par = info->par;
272272
273− strlcpy(par->ddc_adapter.name, info->fix.id,
273+ strscpy(par->ddc_adapter.name, info->fix.id,
274274 sizeof(par->ddc_adapter.name));
275275 par->ddc_adapter.owner = THIS_MODULE;
276276 par->ddc_adapter.class = I2C_CLASS_DDC;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t