Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [syzbot] [fbdev?] KASAN: vmalloc-out-of-bounds Write in imageblit (6)
From: syzbot @ 2025-11-02 21:10 UTC (permalink / raw)
  To: deller, dri-devel, linux-fbdev, linux-kernel, simona, soci,
	syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    691d401c7e0e Merge tag 'spi-fix-v6.18-rc3' of git://git.ke..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14607932580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=19d831c6d0386a9c
dashboard link: https://syzkaller.appspot.com/bug?extid=5a40432dfe8f86ee657a
compiler:       gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5eaccda03e4f/disk-691d401c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0df5294a69bc/vmlinux-691d401c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f4f242731772/bzImage-691d401c.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+5a40432dfe8f86ee657a@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: vmalloc-out-of-bounds in fb_write_offset drivers/video/fbdev/core/sysmem.h:30 [inline]
BUG: KASAN: vmalloc-out-of-bounds in fb_bitmap_2ppw drivers/video/fbdev/core/fb_imageblit.h:364 [inline]
BUG: KASAN: vmalloc-out-of-bounds in fb_bitmap_imageblit drivers/video/fbdev/core/fb_imageblit.h:462 [inline]
BUG: KASAN: vmalloc-out-of-bounds in fb_imageblit drivers/video/fbdev/core/fb_imageblit.h:492 [inline]
BUG: KASAN: vmalloc-out-of-bounds in sys_imageblit+0x1a6f/0x1e60 drivers/video/fbdev/core/sysimgblt.c:24
Write of size 8 at addr ffffc90003e99280 by task kworker/0:2/781

CPU: 0 UID: 0 PID: 781 Comm: kworker/0:2 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Workqueue: events_power_efficient fb_flashcursor
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xcd/0x630 mm/kasan/report.c:482
 kasan_report+0xe0/0x110 mm/kasan/report.c:595
 fb_write_offset drivers/video/fbdev/core/sysmem.h:30 [inline]
 fb_bitmap_2ppw drivers/video/fbdev/core/fb_imageblit.h:364 [inline]
 fb_bitmap_imageblit drivers/video/fbdev/core/fb_imageblit.h:462 [inline]
 fb_imageblit drivers/video/fbdev/core/fb_imageblit.h:492 [inline]
 sys_imageblit+0x1a6f/0x1e60 drivers/video/fbdev/core/sysimgblt.c:24
 drm_fbdev_shmem_defio_imageblit+0x20/0x130 drivers/gpu/drm/drm_fbdev_shmem.c:38
 soft_cursor+0x524/0xa10 drivers/video/fbdev/core/softcursor.c:74
 bit_cursor+0xe8c/0x17e0 drivers/video/fbdev/core/bitblit.c:395
 fb_flashcursor drivers/video/fbdev/core/fbcon.c:401 [inline]
 fb_flashcursor+0x310/0x400 drivers/video/fbdev/core/fbcon.c:370
 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263
 process_scheduled_works kernel/workqueue.c:3346 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427
 kthread+0x3c5/0x780 kernel/kthread.c:463
 ret_from_fork+0x675/0x7d0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

The buggy address belongs to a vmalloc virtual mapping
Memory state around the buggy address:
 ffffc90003e99180: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc90003e99200: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc90003e99280: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
                   ^
 ffffc90003e99300: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc90003e99380: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply

* Re: [PATCH] staging: sm750fb: make g_fbmode0 an array of const pointers
From: kernel test robot @ 2025-11-01  8:17 UTC (permalink / raw)
  To: Cristian Del Gobbo, sudip.mukherjee
  Cc: oe-kbuild-all, teddy.wang, gregkh, linux-fbdev, linux-staging,
	linux-kernel, Cristian Del Gobbo
In-Reply-To: <20251026233432.1707-1-cristiandelgobbo87@gmail.com>

Hi Cristian,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Del-Gobbo/staging-sm750fb-make-g_fbmode0-an-array-of-const-pointers/20251027-073648
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20251026233432.1707-1-cristiandelgobbo87%40gmail.com
patch subject: [PATCH] staging: sm750fb: make g_fbmode0 an array of const pointers
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20251101/202511011552.WuM3PEPs-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251101/202511011552.WuM3PEPs-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511011552.WuM3PEPs-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/staging/sm750fb/sm750.c: In function 'lynxfb_set_fbinfo':
>> drivers/staging/sm750fb/sm750.c:790:33: error: assignment of read-only location 'g_fbmode[index]'
     790 |                 g_fbmode[index] = g_def_fbmode;
         |                                 ^
   drivers/staging/sm750fb/sm750.c:792:41: error: assignment of read-only location 'g_fbmode[index]'
     792 |                         g_fbmode[index] = g_fbmode[0];
         |                                         ^
   drivers/staging/sm750fb/sm750.c: In function 'sm750fb_setup':
>> drivers/staging/sm750fb/sm750.c:953:45: error: assignment of read-only location 'g_fbmode[0]'
     953 |                                 g_fbmode[0] = opt;
         |                                             ^
   drivers/staging/sm750fb/sm750.c:957:45: error: assignment of read-only location 'g_fbmode[1]'
     957 |                                 g_fbmode[1] = opt;
         |                                             ^


vim +790 drivers/staging/sm750fb/sm750.c

81dee67e215b23 Sudip Mukherjee         2015-03-03  717  
81dee67e215b23 Sudip Mukherjee         2015-03-03  718  static int lynxfb_set_fbinfo(struct fb_info *info, int index)
81dee67e215b23 Sudip Mukherjee         2015-03-03  719  {
81dee67e215b23 Sudip Mukherjee         2015-03-03  720  	int i;
81dee67e215b23 Sudip Mukherjee         2015-03-03  721  	struct lynxfb_par *par;
e359b6a863e19f Mike Rapoport           2015-10-26  722  	struct sm750_dev *sm750_dev;
81dee67e215b23 Sudip Mukherjee         2015-03-03  723  	struct lynxfb_crtc *crtc;
81dee67e215b23 Sudip Mukherjee         2015-03-03  724  	struct lynxfb_output *output;
81dee67e215b23 Sudip Mukherjee         2015-03-03  725  	struct fb_var_screeninfo *var;
81dee67e215b23 Sudip Mukherjee         2015-03-03  726  	struct fb_fix_screeninfo *fix;
81dee67e215b23 Sudip Mukherjee         2015-03-03  727  
81dee67e215b23 Sudip Mukherjee         2015-03-03  728  	const struct fb_videomode *pdb[] = {
81dee67e215b23 Sudip Mukherjee         2015-03-03  729  		lynx750_ext, NULL, vesa_modes,
81dee67e215b23 Sudip Mukherjee         2015-03-03  730  	};
81dee67e215b23 Sudip Mukherjee         2015-03-03  731  	int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
d5d66cfea2ca28 Kelsey Skunberg         2019-04-27  732  	static const char * const mdb_desc[] = {
81dee67e215b23 Sudip Mukherjee         2015-03-03  733  		"driver prepared modes",
81dee67e215b23 Sudip Mukherjee         2015-03-03  734  		"kernel prepared default modedb",
81dee67e215b23 Sudip Mukherjee         2015-03-03  735  		"kernel HELPERS prepared vesa_modes",
81dee67e215b23 Sudip Mukherjee         2015-03-03  736  	};
81dee67e215b23 Sudip Mukherjee         2015-03-03  737  
70407df77665c0 Michel von Czettritz    2015-03-26  738  	static const char *fixId[2] = {
81dee67e215b23 Sudip Mukherjee         2015-03-03  739  		"sm750_fb1", "sm750_fb2",
81dee67e215b23 Sudip Mukherjee         2015-03-03  740  	};
81dee67e215b23 Sudip Mukherjee         2015-03-03  741  
81dee67e215b23 Sudip Mukherjee         2015-03-03  742  	int ret, line_length;
81dee67e215b23 Sudip Mukherjee         2015-03-03  743  
81dee67e215b23 Sudip Mukherjee         2015-03-03  744  	ret = 0;
81dee67e215b23 Sudip Mukherjee         2015-03-03  745  	par = (struct lynxfb_par *)info->par;
e359b6a863e19f Mike Rapoport           2015-10-26  746  	sm750_dev = par->dev;
81dee67e215b23 Sudip Mukherjee         2015-03-03  747  	crtc = &par->crtc;
81dee67e215b23 Sudip Mukherjee         2015-03-03  748  	output = &par->output;
81dee67e215b23 Sudip Mukherjee         2015-03-03  749  	var = &info->var;
81dee67e215b23 Sudip Mukherjee         2015-03-03  750  	fix = &info->fix;
81dee67e215b23 Sudip Mukherjee         2015-03-03  751  
81dee67e215b23 Sudip Mukherjee         2015-03-03  752  	/* set index */
81dee67e215b23 Sudip Mukherjee         2015-03-03  753  	par->index = index;
81dee67e215b23 Sudip Mukherjee         2015-03-03  754  	output->channel = &crtc->channel;
81dee67e215b23 Sudip Mukherjee         2015-03-03  755  	sm750fb_set_drv(par);
81dee67e215b23 Sudip Mukherjee         2015-03-03  756  
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  757  	/*
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  758  	 * set current cursor variable and proc pointer,
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  759  	 * must be set after crtc member initialized
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  760  	 */
fdc234d85210d9 Benjamin Philip         2021-07-28  761  	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
e359b6a863e19f Mike Rapoport           2015-10-26  762  	crtc->cursor.mmio = sm750_dev->pvReg +
e359b6a863e19f Mike Rapoport           2015-10-26  763  		0x800f0 + (int)crtc->channel * 0x140;
81dee67e215b23 Sudip Mukherjee         2015-03-03  764  
81dee67e215b23 Sudip Mukherjee         2015-03-03  765  	pr_info("crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
cd33da26036ea5 Christopher Carbone     2022-08-23  766  	crtc->cursor.max_h = 64;
cd33da26036ea5 Christopher Carbone     2022-08-23  767  	crtc->cursor.max_w = 64;
39f9137268ee3d Benjamin Philip         2021-07-26  768  	crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
e359b6a863e19f Mike Rapoport           2015-10-26  769  	crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
81dee67e215b23 Sudip Mukherjee         2015-03-03  770  
3de08a2d14ff8c Lorenzo Stoakes         2015-03-20  771  	memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
f7c8a046577e09 Thomas Zimmermann       2023-11-27  772  	if (!g_hwcursor)
52d0744d751d8f Arnd Bergmann           2016-11-09  773  		sm750_hw_cursor_disable(&crtc->cursor);
81dee67e215b23 Sudip Mukherjee         2015-03-03  774  
81dee67e215b23 Sudip Mukherjee         2015-03-03  775  	/* set info->fbops, must be set before fb_find_mode */
e359b6a863e19f Mike Rapoport           2015-10-26  776  	if (!sm750_dev->accel_off) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  777  		/* use 2d acceleration */
f7c8a046577e09 Thomas Zimmermann       2023-11-27  778  		if (!g_hwcursor)
f7c8a046577e09 Thomas Zimmermann       2023-11-27  779  			info->fbops = &lynxfb_ops_accel;
f7c8a046577e09 Thomas Zimmermann       2023-11-27  780  		else
f7c8a046577e09 Thomas Zimmermann       2023-11-27  781  			info->fbops = &lynxfb_ops_accel_with_cursor;
f7c8a046577e09 Thomas Zimmermann       2023-11-27  782  	} else {
f7c8a046577e09 Thomas Zimmermann       2023-11-27  783  		if (!g_hwcursor)
81dee67e215b23 Sudip Mukherjee         2015-03-03  784  			info->fbops = &lynxfb_ops;
f7c8a046577e09 Thomas Zimmermann       2023-11-27  785  		else
f7c8a046577e09 Thomas Zimmermann       2023-11-27  786  			info->fbops = &lynxfb_ops_with_cursor;
f7c8a046577e09 Thomas Zimmermann       2023-11-27  787  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  788  
81dee67e215b23 Sudip Mukherjee         2015-03-03  789  	if (!g_fbmode[index]) {
81dee67e215b23 Sudip Mukherjee         2015-03-03 @790  		g_fbmode[index] = g_def_fbmode;
81dee67e215b23 Sudip Mukherjee         2015-03-03  791  		if (index)
81dee67e215b23 Sudip Mukherjee         2015-03-03  792  			g_fbmode[index] = g_fbmode[0];
81dee67e215b23 Sudip Mukherjee         2015-03-03  793  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  794  
81dee67e215b23 Sudip Mukherjee         2015-03-03  795  	for (i = 0; i < 3; i++) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  796  		ret = fb_find_mode(var, info, g_fbmode[index],
81dee67e215b23 Sudip Mukherjee         2015-03-03  797  				   pdb[i], cdb[i], NULL, 8);
81dee67e215b23 Sudip Mukherjee         2015-03-03  798  
81dee67e215b23 Sudip Mukherjee         2015-03-03  799  		if (ret == 1) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  800  			pr_info("success! use specified mode:%s in %s\n",
81dee67e215b23 Sudip Mukherjee         2015-03-03  801  				g_fbmode[index],
81dee67e215b23 Sudip Mukherjee         2015-03-03  802  				mdb_desc[i]);
81dee67e215b23 Sudip Mukherjee         2015-03-03  803  			break;
81dee67e215b23 Sudip Mukherjee         2015-03-03  804  		} else if (ret == 2) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  805  			pr_warn("use specified mode:%s in %s,with an ignored refresh rate\n",
81dee67e215b23 Sudip Mukherjee         2015-03-03  806  				g_fbmode[index],
81dee67e215b23 Sudip Mukherjee         2015-03-03  807  				mdb_desc[i]);
81dee67e215b23 Sudip Mukherjee         2015-03-03  808  			break;
81dee67e215b23 Sudip Mukherjee         2015-03-03  809  		} else if (ret == 3) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  810  			pr_warn("wanna use default mode\n");
4bd9503d0becdb Michel von Czettritz    2015-03-26  811  			/*break;*/
81dee67e215b23 Sudip Mukherjee         2015-03-03  812  		} else if (ret == 4) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  813  			pr_warn("fall back to any valid mode\n");
81dee67e215b23 Sudip Mukherjee         2015-03-03  814  		} else {
3318bb5e945f70 Michel von Czettritz    2015-03-26  815  			pr_warn("ret = %d,fb_find_mode failed,with %s\n",
3318bb5e945f70 Michel von Czettritz    2015-03-26  816  				ret,
3318bb5e945f70 Michel von Czettritz    2015-03-26  817  				mdb_desc[i]);
81dee67e215b23 Sudip Mukherjee         2015-03-03  818  		}
81dee67e215b23 Sudip Mukherjee         2015-03-03  819  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  820  
81dee67e215b23 Sudip Mukherjee         2015-03-03  821  	/* some member of info->var had been set by fb_find_mode */
81dee67e215b23 Sudip Mukherjee         2015-03-03  822  
271dbae3c6a1da Prasant Jalan           2017-04-01  823  	pr_info("Member of info->var is :\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  824  		"xres=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  825  		"yres=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  826  		"xres_virtual=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  827  		"yres_virtual=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  828  		"xoffset=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  829  		"yoffset=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  830  		"bits_per_pixel=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  831  		" ...\n",
3318bb5e945f70 Michel von Czettritz    2015-03-26  832  		var->xres,
3318bb5e945f70 Michel von Czettritz    2015-03-26  833  		var->yres,
3318bb5e945f70 Michel von Czettritz    2015-03-26  834  		var->xres_virtual,
3318bb5e945f70 Michel von Czettritz    2015-03-26  835  		var->yres_virtual,
3318bb5e945f70 Michel von Czettritz    2015-03-26  836  		var->xoffset,
3318bb5e945f70 Michel von Czettritz    2015-03-26  837  		var->yoffset,
3318bb5e945f70 Michel von Czettritz    2015-03-26  838  		var->bits_per_pixel);
81dee67e215b23 Sudip Mukherjee         2015-03-03  839  
81dee67e215b23 Sudip Mukherjee         2015-03-03  840  	/* set par */
81dee67e215b23 Sudip Mukherjee         2015-03-03  841  	par->info = info;
81dee67e215b23 Sudip Mukherjee         2015-03-03  842  
81dee67e215b23 Sudip Mukherjee         2015-03-03  843  	/* set info */
e3a3f9f5123683 Mike Rapoport           2015-10-26  844  	line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
e3a3f9f5123683 Mike Rapoport           2015-10-26  845  			    crtc->line_pad);
81dee67e215b23 Sudip Mukherjee         2015-03-03  846  
81dee67e215b23 Sudip Mukherjee         2015-03-03  847  	info->pseudo_palette = &par->pseudo_palette[0];
cc59bde1c920ab Benjamin Philip         2021-07-28  848  	info->screen_base = crtc->v_screen;
81dee67e215b23 Sudip Mukherjee         2015-03-03  849  	pr_debug("screen_base vaddr = %p\n", info->screen_base);
81dee67e215b23 Sudip Mukherjee         2015-03-03  850  	info->screen_size = line_length * var->yres_virtual;
81dee67e215b23 Sudip Mukherjee         2015-03-03  851  
81dee67e215b23 Sudip Mukherjee         2015-03-03  852  	/* set info->fix */
81dee67e215b23 Sudip Mukherjee         2015-03-03  853  	fix->type = FB_TYPE_PACKED_PIXELS;
81dee67e215b23 Sudip Mukherjee         2015-03-03  854  	fix->type_aux = 0;
81dee67e215b23 Sudip Mukherjee         2015-03-03  855  	fix->xpanstep = crtc->xpanstep;
81dee67e215b23 Sudip Mukherjee         2015-03-03  856  	fix->ypanstep = crtc->ypanstep;
81dee67e215b23 Sudip Mukherjee         2015-03-03  857  	fix->ywrapstep = crtc->ywrapstep;
81dee67e215b23 Sudip Mukherjee         2015-03-03  858  	fix->accel = FB_ACCEL_SMI;
81dee67e215b23 Sudip Mukherjee         2015-03-03  859  
9c15db83a86bf8 Kumar Kartikeya Dwivedi 2021-01-31  860  	strscpy(fix->id, fixId[index], sizeof(fix->id));
81dee67e215b23 Sudip Mukherjee         2015-03-03  861  
fdc234d85210d9 Benjamin Philip         2021-07-28  862  	fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
81dee67e215b23 Sudip Mukherjee         2015-03-03  863  	pr_info("fix->smem_start = %lx\n", fix->smem_start);
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  864  	/*
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  865  	 * according to mmap experiment from user space application,
81dee67e215b23 Sudip Mukherjee         2015-03-03  866  	 * fix->mmio_len should not larger than virtual size
81dee67e215b23 Sudip Mukherjee         2015-03-03  867  	 * (xres_virtual x yres_virtual x ByPP)
81dee67e215b23 Sudip Mukherjee         2015-03-03  868  	 * Below line maybe buggy when user mmap fb dev node and write
81dee67e215b23 Sudip Mukherjee         2015-03-03  869  	 * data into the bound over virtual size
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  870  	 */
81dee67e215b23 Sudip Mukherjee         2015-03-03  871  	fix->smem_len = crtc->vidmem_size;
81dee67e215b23 Sudip Mukherjee         2015-03-03  872  	pr_info("fix->smem_len = %x\n", fix->smem_len);
81dee67e215b23 Sudip Mukherjee         2015-03-03  873  	info->screen_size = fix->smem_len;
81dee67e215b23 Sudip Mukherjee         2015-03-03  874  	fix->line_length = line_length;
e359b6a863e19f Mike Rapoport           2015-10-26  875  	fix->mmio_start = sm750_dev->vidreg_start;
81dee67e215b23 Sudip Mukherjee         2015-03-03  876  	pr_info("fix->mmio_start = %lx\n", fix->mmio_start);
e359b6a863e19f Mike Rapoport           2015-10-26  877  	fix->mmio_len = sm750_dev->vidreg_size;
81dee67e215b23 Sudip Mukherjee         2015-03-03  878  	pr_info("fix->mmio_len = %x\n", fix->mmio_len);
b610e1193a917f Matej Dujava            2020-04-30  879  
b610e1193a917f Matej Dujava            2020-04-30  880  	lynxfb_set_visual_mode(info);
81dee67e215b23 Sudip Mukherjee         2015-03-03  881  
81dee67e215b23 Sudip Mukherjee         2015-03-03  882  	/* set var */
81dee67e215b23 Sudip Mukherjee         2015-03-03  883  	var->activate = FB_ACTIVATE_NOW;
81dee67e215b23 Sudip Mukherjee         2015-03-03  884  	var->accel_flags = 0;
81dee67e215b23 Sudip Mukherjee         2015-03-03  885  	var->vmode = FB_VMODE_NONINTERLACED;
81dee67e215b23 Sudip Mukherjee         2015-03-03  886  
81dee67e215b23 Sudip Mukherjee         2015-03-03  887  	pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
81dee67e215b23 Sudip Mukherjee         2015-03-03  888  		 info->cmap.start, info->cmap.len,
81dee67e215b23 Sudip Mukherjee         2015-03-03  889  		 info->cmap.red, info->cmap.green, info->cmap.blue,
81dee67e215b23 Sudip Mukherjee         2015-03-03  890  		 info->cmap.transp);
81dee67e215b23 Sudip Mukherjee         2015-03-03  891  
61c507cf652da1 Michel von Czettritz    2015-03-26  892  	ret = fb_alloc_cmap(&info->cmap, 256, 0);
61c507cf652da1 Michel von Czettritz    2015-03-26  893  	if (ret < 0) {
008272072d61a8 Masanari Iida           2015-05-28  894  		pr_err("Could not allocate memory for cmap.\n");
81dee67e215b23 Sudip Mukherjee         2015-03-03  895  		goto exit;
81dee67e215b23 Sudip Mukherjee         2015-03-03  896  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  897  
81dee67e215b23 Sudip Mukherjee         2015-03-03  898  	pr_debug("#2 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
81dee67e215b23 Sudip Mukherjee         2015-03-03  899  		 info->cmap.start, info->cmap.len,
81dee67e215b23 Sudip Mukherjee         2015-03-03  900  		 info->cmap.red, info->cmap.green, info->cmap.blue,
81dee67e215b23 Sudip Mukherjee         2015-03-03  901  		 info->cmap.transp);
81dee67e215b23 Sudip Mukherjee         2015-03-03  902  
81dee67e215b23 Sudip Mukherjee         2015-03-03  903  exit:
81dee67e215b23 Sudip Mukherjee         2015-03-03  904  	lynxfb_ops_check_var(var, info);
81dee67e215b23 Sudip Mukherjee         2015-03-03  905  	return ret;
81dee67e215b23 Sudip Mukherjee         2015-03-03  906  }
81dee67e215b23 Sudip Mukherjee         2015-03-03  907  
81dee67e215b23 Sudip Mukherjee         2015-03-03  908  /*	chip specific g_option configuration routine */
700591a9adc8b1 Mike Rapoport           2015-10-26  909  static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
81dee67e215b23 Sudip Mukherjee         2015-03-03  910  {
81dee67e215b23 Sudip Mukherjee         2015-03-03  911  	char *opt;
81dee67e215b23 Sudip Mukherjee         2015-03-03  912  	int swap;
81dee67e215b23 Sudip Mukherjee         2015-03-03  913  
81dee67e215b23 Sudip Mukherjee         2015-03-03  914  	swap = 0;
81dee67e215b23 Sudip Mukherjee         2015-03-03  915  
1757d106a9ce8c Mike Rapoport           2015-10-26  916  	sm750_dev->initParm.chip_clk = 0;
1757d106a9ce8c Mike Rapoport           2015-10-26  917  	sm750_dev->initParm.mem_clk = 0;
1757d106a9ce8c Mike Rapoport           2015-10-26  918  	sm750_dev->initParm.master_clk = 0;
1757d106a9ce8c Mike Rapoport           2015-10-26  919  	sm750_dev->initParm.powerMode = 0;
1757d106a9ce8c Mike Rapoport           2015-10-26  920  	sm750_dev->initParm.setAllEngOff = 0;
1757d106a9ce8c Mike Rapoport           2015-10-26  921  	sm750_dev->initParm.resetMemory = 1;
81dee67e215b23 Sudip Mukherjee         2015-03-03  922  
81dee67e215b23 Sudip Mukherjee         2015-03-03  923  	/* defaultly turn g_hwcursor on for both view */
81dee67e215b23 Sudip Mukherjee         2015-03-03  924  	g_hwcursor = 3;
81dee67e215b23 Sudip Mukherjee         2015-03-03  925  
81dee67e215b23 Sudip Mukherjee         2015-03-03  926  	if (!src || !*src) {
c56de0967a658c Elise Lennion           2016-10-31  927  		dev_warn(&sm750_dev->pdev->dev, "no specific g_option.\n");
81dee67e215b23 Sudip Mukherjee         2015-03-03  928  		goto NO_PARAM;
81dee67e215b23 Sudip Mukherjee         2015-03-03  929  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  930  
0fa96e39279988 Sudip Mukherjee         2015-03-10  931  	while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
c56de0967a658c Elise Lennion           2016-10-31  932  		dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
c56de0967a658c Elise Lennion           2016-10-31  933  		dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
81dee67e215b23 Sudip Mukherjee         2015-03-03  934  
144634a6b42146 Katie Dunne             2017-02-19  935  		if (!strncmp(opt, "swap", strlen("swap"))) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  936  			swap = 1;
144634a6b42146 Katie Dunne             2017-02-19  937  		} else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
1757d106a9ce8c Mike Rapoport           2015-10-26  938  			sm750_dev->nocrt = 1;
144634a6b42146 Katie Dunne             2017-02-19  939  		} else if (!strncmp(opt, "36bit", strlen("36bit"))) {
1757d106a9ce8c Mike Rapoport           2015-10-26  940  			sm750_dev->pnltype = sm750_doubleTFT;
144634a6b42146 Katie Dunne             2017-02-19  941  		} else if (!strncmp(opt, "18bit", strlen("18bit"))) {
1757d106a9ce8c Mike Rapoport           2015-10-26  942  			sm750_dev->pnltype = sm750_dualTFT;
144634a6b42146 Katie Dunne             2017-02-19  943  		} else if (!strncmp(opt, "24bit", strlen("24bit"))) {
1757d106a9ce8c Mike Rapoport           2015-10-26  944  			sm750_dev->pnltype = sm750_24TFT;
144634a6b42146 Katie Dunne             2017-02-19  945  		} else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  946  			g_hwcursor &= ~0x1;
144634a6b42146 Katie Dunne             2017-02-19  947  		} else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  948  			g_hwcursor &= ~0x2;
144634a6b42146 Katie Dunne             2017-02-19  949  		} else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  950  			g_hwcursor = 0;
144634a6b42146 Katie Dunne             2017-02-19  951  		} else {
81dee67e215b23 Sudip Mukherjee         2015-03-03  952  			if (!g_fbmode[0]) {
81dee67e215b23 Sudip Mukherjee         2015-03-03 @953  				g_fbmode[0] = opt;
cee9ba1c30d051 Abdul Rauf              2017-01-08  954  				dev_info(&sm750_dev->pdev->dev,
cee9ba1c30d051 Abdul Rauf              2017-01-08  955  					 "find fbmode0 : %s\n", g_fbmode[0]);
81dee67e215b23 Sudip Mukherjee         2015-03-03  956  			} else if (!g_fbmode[1]) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  957  				g_fbmode[1] = opt;
cee9ba1c30d051 Abdul Rauf              2017-01-08  958  				dev_info(&sm750_dev->pdev->dev,
cee9ba1c30d051 Abdul Rauf              2017-01-08  959  					 "find fbmode1 : %s\n", g_fbmode[1]);
81dee67e215b23 Sudip Mukherjee         2015-03-03  960  			} else {
c56de0967a658c Elise Lennion           2016-10-31  961  				dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
81dee67e215b23 Sudip Mukherjee         2015-03-03  962  			}
81dee67e215b23 Sudip Mukherjee         2015-03-03  963  		}
81dee67e215b23 Sudip Mukherjee         2015-03-03  964  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  965  
81dee67e215b23 Sudip Mukherjee         2015-03-03  966  NO_PARAM:
e359b6a863e19f Mike Rapoport           2015-10-26  967  	if (sm750_dev->revid != SM750LE_REVISION_ID) {
a3f92cc94c6126 Mike Rapoport           2016-01-17  968  		if (sm750_dev->fb_count > 1) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  969  			if (swap)
1757d106a9ce8c Mike Rapoport           2015-10-26  970  				sm750_dev->dataflow = sm750_dual_swap;
81dee67e215b23 Sudip Mukherjee         2015-03-03  971  			else
1757d106a9ce8c Mike Rapoport           2015-10-26  972  				sm750_dev->dataflow = sm750_dual_normal;
81dee67e215b23 Sudip Mukherjee         2015-03-03  973  		} else {
81dee67e215b23 Sudip Mukherjee         2015-03-03  974  			if (swap)
1757d106a9ce8c Mike Rapoport           2015-10-26  975  				sm750_dev->dataflow = sm750_simul_sec;
81dee67e215b23 Sudip Mukherjee         2015-03-03  976  			else
1757d106a9ce8c Mike Rapoport           2015-10-26  977  				sm750_dev->dataflow = sm750_simul_pri;
81dee67e215b23 Sudip Mukherjee         2015-03-03  978  		}
81dee67e215b23 Sudip Mukherjee         2015-03-03  979  	} else {
81dee67e215b23 Sudip Mukherjee         2015-03-03  980  		/* SM750LE only have one crt channel */
1757d106a9ce8c Mike Rapoport           2015-10-26  981  		sm750_dev->dataflow = sm750_simul_sec;
81dee67e215b23 Sudip Mukherjee         2015-03-03  982  		/* sm750le do not have complex attributes */
1757d106a9ce8c Mike Rapoport           2015-10-26  983  		sm750_dev->nocrt = 0;
81dee67e215b23 Sudip Mukherjee         2015-03-03  984  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  985  }
81dee67e215b23 Sudip Mukherjee         2015-03-03  986  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* Re: [PATCH] staging: sm750fb: make g_fbmode0 an array of const pointers
From: kernel test robot @ 2025-11-01  7:46 UTC (permalink / raw)
  To: Cristian Del Gobbo, sudip.mukherjee
  Cc: llvm, oe-kbuild-all, teddy.wang, gregkh, linux-fbdev,
	linux-staging, linux-kernel, Cristian Del Gobbo
In-Reply-To: <20251026233432.1707-1-cristiandelgobbo87@gmail.com>

Hi Cristian,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Del-Gobbo/staging-sm750fb-make-g_fbmode0-an-array-of-const-pointers/20251027-073648
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20251026233432.1707-1-cristiandelgobbo87%40gmail.com
patch subject: [PATCH] staging: sm750fb: make g_fbmode0 an array of const pointers
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20251101/202511011532.LFS4SZtE-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251101/202511011532.LFS4SZtE-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511011532.LFS4SZtE-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/staging/sm750fb/sm750.c:790:19: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
     790 |                 g_fbmode[index] = g_def_fbmode;
         |                 ~~~~~~~~~~~~~~~ ^
   drivers/staging/sm750fb/sm750.c:36:27: note: variable 'g_fbmode' declared const here
      36 | static const char * const g_fbmode[] = {NULL, NULL};
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/sm750fb/sm750.c:792:20: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
     792 |                         g_fbmode[index] = g_fbmode[0];
         |                         ~~~~~~~~~~~~~~~ ^
   drivers/staging/sm750fb/sm750.c:36:27: note: variable 'g_fbmode' declared const here
      36 | static const char * const g_fbmode[] = {NULL, NULL};
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/sm750fb/sm750.c:953:17: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
     953 |                                 g_fbmode[0] = opt;
         |                                 ~~~~~~~~~~~ ^
   drivers/staging/sm750fb/sm750.c:36:27: note: variable 'g_fbmode' declared const here
      36 | static const char * const g_fbmode[] = {NULL, NULL};
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/sm750fb/sm750.c:957:17: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
     957 |                                 g_fbmode[1] = opt;
         |                                 ~~~~~~~~~~~ ^
   drivers/staging/sm750fb/sm750.c:36:27: note: variable 'g_fbmode' declared const here
      36 | static const char * const g_fbmode[] = {NULL, NULL};
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
   4 errors generated.


vim +790 drivers/staging/sm750fb/sm750.c

81dee67e215b23 Sudip Mukherjee         2015-03-03  717  
81dee67e215b23 Sudip Mukherjee         2015-03-03  718  static int lynxfb_set_fbinfo(struct fb_info *info, int index)
81dee67e215b23 Sudip Mukherjee         2015-03-03  719  {
81dee67e215b23 Sudip Mukherjee         2015-03-03  720  	int i;
81dee67e215b23 Sudip Mukherjee         2015-03-03  721  	struct lynxfb_par *par;
e359b6a863e19f Mike Rapoport           2015-10-26  722  	struct sm750_dev *sm750_dev;
81dee67e215b23 Sudip Mukherjee         2015-03-03  723  	struct lynxfb_crtc *crtc;
81dee67e215b23 Sudip Mukherjee         2015-03-03  724  	struct lynxfb_output *output;
81dee67e215b23 Sudip Mukherjee         2015-03-03  725  	struct fb_var_screeninfo *var;
81dee67e215b23 Sudip Mukherjee         2015-03-03  726  	struct fb_fix_screeninfo *fix;
81dee67e215b23 Sudip Mukherjee         2015-03-03  727  
81dee67e215b23 Sudip Mukherjee         2015-03-03  728  	const struct fb_videomode *pdb[] = {
81dee67e215b23 Sudip Mukherjee         2015-03-03  729  		lynx750_ext, NULL, vesa_modes,
81dee67e215b23 Sudip Mukherjee         2015-03-03  730  	};
81dee67e215b23 Sudip Mukherjee         2015-03-03  731  	int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
d5d66cfea2ca28 Kelsey Skunberg         2019-04-27  732  	static const char * const mdb_desc[] = {
81dee67e215b23 Sudip Mukherjee         2015-03-03  733  		"driver prepared modes",
81dee67e215b23 Sudip Mukherjee         2015-03-03  734  		"kernel prepared default modedb",
81dee67e215b23 Sudip Mukherjee         2015-03-03  735  		"kernel HELPERS prepared vesa_modes",
81dee67e215b23 Sudip Mukherjee         2015-03-03  736  	};
81dee67e215b23 Sudip Mukherjee         2015-03-03  737  
70407df77665c0 Michel von Czettritz    2015-03-26  738  	static const char *fixId[2] = {
81dee67e215b23 Sudip Mukherjee         2015-03-03  739  		"sm750_fb1", "sm750_fb2",
81dee67e215b23 Sudip Mukherjee         2015-03-03  740  	};
81dee67e215b23 Sudip Mukherjee         2015-03-03  741  
81dee67e215b23 Sudip Mukherjee         2015-03-03  742  	int ret, line_length;
81dee67e215b23 Sudip Mukherjee         2015-03-03  743  
81dee67e215b23 Sudip Mukherjee         2015-03-03  744  	ret = 0;
81dee67e215b23 Sudip Mukherjee         2015-03-03  745  	par = (struct lynxfb_par *)info->par;
e359b6a863e19f Mike Rapoport           2015-10-26  746  	sm750_dev = par->dev;
81dee67e215b23 Sudip Mukherjee         2015-03-03  747  	crtc = &par->crtc;
81dee67e215b23 Sudip Mukherjee         2015-03-03  748  	output = &par->output;
81dee67e215b23 Sudip Mukherjee         2015-03-03  749  	var = &info->var;
81dee67e215b23 Sudip Mukherjee         2015-03-03  750  	fix = &info->fix;
81dee67e215b23 Sudip Mukherjee         2015-03-03  751  
81dee67e215b23 Sudip Mukherjee         2015-03-03  752  	/* set index */
81dee67e215b23 Sudip Mukherjee         2015-03-03  753  	par->index = index;
81dee67e215b23 Sudip Mukherjee         2015-03-03  754  	output->channel = &crtc->channel;
81dee67e215b23 Sudip Mukherjee         2015-03-03  755  	sm750fb_set_drv(par);
81dee67e215b23 Sudip Mukherjee         2015-03-03  756  
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  757  	/*
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  758  	 * set current cursor variable and proc pointer,
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  759  	 * must be set after crtc member initialized
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  760  	 */
fdc234d85210d9 Benjamin Philip         2021-07-28  761  	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
e359b6a863e19f Mike Rapoport           2015-10-26  762  	crtc->cursor.mmio = sm750_dev->pvReg +
e359b6a863e19f Mike Rapoport           2015-10-26  763  		0x800f0 + (int)crtc->channel * 0x140;
81dee67e215b23 Sudip Mukherjee         2015-03-03  764  
81dee67e215b23 Sudip Mukherjee         2015-03-03  765  	pr_info("crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
cd33da26036ea5 Christopher Carbone     2022-08-23  766  	crtc->cursor.max_h = 64;
cd33da26036ea5 Christopher Carbone     2022-08-23  767  	crtc->cursor.max_w = 64;
39f9137268ee3d Benjamin Philip         2021-07-26  768  	crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
e359b6a863e19f Mike Rapoport           2015-10-26  769  	crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
81dee67e215b23 Sudip Mukherjee         2015-03-03  770  
3de08a2d14ff8c Lorenzo Stoakes         2015-03-20  771  	memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
f7c8a046577e09 Thomas Zimmermann       2023-11-27  772  	if (!g_hwcursor)
52d0744d751d8f Arnd Bergmann           2016-11-09  773  		sm750_hw_cursor_disable(&crtc->cursor);
81dee67e215b23 Sudip Mukherjee         2015-03-03  774  
81dee67e215b23 Sudip Mukherjee         2015-03-03  775  	/* set info->fbops, must be set before fb_find_mode */
e359b6a863e19f Mike Rapoport           2015-10-26  776  	if (!sm750_dev->accel_off) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  777  		/* use 2d acceleration */
f7c8a046577e09 Thomas Zimmermann       2023-11-27  778  		if (!g_hwcursor)
f7c8a046577e09 Thomas Zimmermann       2023-11-27  779  			info->fbops = &lynxfb_ops_accel;
f7c8a046577e09 Thomas Zimmermann       2023-11-27  780  		else
f7c8a046577e09 Thomas Zimmermann       2023-11-27  781  			info->fbops = &lynxfb_ops_accel_with_cursor;
f7c8a046577e09 Thomas Zimmermann       2023-11-27  782  	} else {
f7c8a046577e09 Thomas Zimmermann       2023-11-27  783  		if (!g_hwcursor)
81dee67e215b23 Sudip Mukherjee         2015-03-03  784  			info->fbops = &lynxfb_ops;
f7c8a046577e09 Thomas Zimmermann       2023-11-27  785  		else
f7c8a046577e09 Thomas Zimmermann       2023-11-27  786  			info->fbops = &lynxfb_ops_with_cursor;
f7c8a046577e09 Thomas Zimmermann       2023-11-27  787  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  788  
81dee67e215b23 Sudip Mukherjee         2015-03-03  789  	if (!g_fbmode[index]) {
81dee67e215b23 Sudip Mukherjee         2015-03-03 @790  		g_fbmode[index] = g_def_fbmode;
81dee67e215b23 Sudip Mukherjee         2015-03-03  791  		if (index)
81dee67e215b23 Sudip Mukherjee         2015-03-03  792  			g_fbmode[index] = g_fbmode[0];
81dee67e215b23 Sudip Mukherjee         2015-03-03  793  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  794  
81dee67e215b23 Sudip Mukherjee         2015-03-03  795  	for (i = 0; i < 3; i++) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  796  		ret = fb_find_mode(var, info, g_fbmode[index],
81dee67e215b23 Sudip Mukherjee         2015-03-03  797  				   pdb[i], cdb[i], NULL, 8);
81dee67e215b23 Sudip Mukherjee         2015-03-03  798  
81dee67e215b23 Sudip Mukherjee         2015-03-03  799  		if (ret == 1) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  800  			pr_info("success! use specified mode:%s in %s\n",
81dee67e215b23 Sudip Mukherjee         2015-03-03  801  				g_fbmode[index],
81dee67e215b23 Sudip Mukherjee         2015-03-03  802  				mdb_desc[i]);
81dee67e215b23 Sudip Mukherjee         2015-03-03  803  			break;
81dee67e215b23 Sudip Mukherjee         2015-03-03  804  		} else if (ret == 2) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  805  			pr_warn("use specified mode:%s in %s,with an ignored refresh rate\n",
81dee67e215b23 Sudip Mukherjee         2015-03-03  806  				g_fbmode[index],
81dee67e215b23 Sudip Mukherjee         2015-03-03  807  				mdb_desc[i]);
81dee67e215b23 Sudip Mukherjee         2015-03-03  808  			break;
81dee67e215b23 Sudip Mukherjee         2015-03-03  809  		} else if (ret == 3) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  810  			pr_warn("wanna use default mode\n");
4bd9503d0becdb Michel von Czettritz    2015-03-26  811  			/*break;*/
81dee67e215b23 Sudip Mukherjee         2015-03-03  812  		} else if (ret == 4) {
81dee67e215b23 Sudip Mukherjee         2015-03-03  813  			pr_warn("fall back to any valid mode\n");
81dee67e215b23 Sudip Mukherjee         2015-03-03  814  		} else {
3318bb5e945f70 Michel von Czettritz    2015-03-26  815  			pr_warn("ret = %d,fb_find_mode failed,with %s\n",
3318bb5e945f70 Michel von Czettritz    2015-03-26  816  				ret,
3318bb5e945f70 Michel von Czettritz    2015-03-26  817  				mdb_desc[i]);
81dee67e215b23 Sudip Mukherjee         2015-03-03  818  		}
81dee67e215b23 Sudip Mukherjee         2015-03-03  819  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  820  
81dee67e215b23 Sudip Mukherjee         2015-03-03  821  	/* some member of info->var had been set by fb_find_mode */
81dee67e215b23 Sudip Mukherjee         2015-03-03  822  
271dbae3c6a1da Prasant Jalan           2017-04-01  823  	pr_info("Member of info->var is :\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  824  		"xres=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  825  		"yres=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  826  		"xres_virtual=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  827  		"yres_virtual=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  828  		"xoffset=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  829  		"yoffset=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  830  		"bits_per_pixel=%d\n"
271dbae3c6a1da Prasant Jalan           2017-04-01  831  		" ...\n",
3318bb5e945f70 Michel von Czettritz    2015-03-26  832  		var->xres,
3318bb5e945f70 Michel von Czettritz    2015-03-26  833  		var->yres,
3318bb5e945f70 Michel von Czettritz    2015-03-26  834  		var->xres_virtual,
3318bb5e945f70 Michel von Czettritz    2015-03-26  835  		var->yres_virtual,
3318bb5e945f70 Michel von Czettritz    2015-03-26  836  		var->xoffset,
3318bb5e945f70 Michel von Czettritz    2015-03-26  837  		var->yoffset,
3318bb5e945f70 Michel von Czettritz    2015-03-26  838  		var->bits_per_pixel);
81dee67e215b23 Sudip Mukherjee         2015-03-03  839  
81dee67e215b23 Sudip Mukherjee         2015-03-03  840  	/* set par */
81dee67e215b23 Sudip Mukherjee         2015-03-03  841  	par->info = info;
81dee67e215b23 Sudip Mukherjee         2015-03-03  842  
81dee67e215b23 Sudip Mukherjee         2015-03-03  843  	/* set info */
e3a3f9f5123683 Mike Rapoport           2015-10-26  844  	line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
e3a3f9f5123683 Mike Rapoport           2015-10-26  845  			    crtc->line_pad);
81dee67e215b23 Sudip Mukherjee         2015-03-03  846  
81dee67e215b23 Sudip Mukherjee         2015-03-03  847  	info->pseudo_palette = &par->pseudo_palette[0];
cc59bde1c920ab Benjamin Philip         2021-07-28  848  	info->screen_base = crtc->v_screen;
81dee67e215b23 Sudip Mukherjee         2015-03-03  849  	pr_debug("screen_base vaddr = %p\n", info->screen_base);
81dee67e215b23 Sudip Mukherjee         2015-03-03  850  	info->screen_size = line_length * var->yres_virtual;
81dee67e215b23 Sudip Mukherjee         2015-03-03  851  
81dee67e215b23 Sudip Mukherjee         2015-03-03  852  	/* set info->fix */
81dee67e215b23 Sudip Mukherjee         2015-03-03  853  	fix->type = FB_TYPE_PACKED_PIXELS;
81dee67e215b23 Sudip Mukherjee         2015-03-03  854  	fix->type_aux = 0;
81dee67e215b23 Sudip Mukherjee         2015-03-03  855  	fix->xpanstep = crtc->xpanstep;
81dee67e215b23 Sudip Mukherjee         2015-03-03  856  	fix->ypanstep = crtc->ypanstep;
81dee67e215b23 Sudip Mukherjee         2015-03-03  857  	fix->ywrapstep = crtc->ywrapstep;
81dee67e215b23 Sudip Mukherjee         2015-03-03  858  	fix->accel = FB_ACCEL_SMI;
81dee67e215b23 Sudip Mukherjee         2015-03-03  859  
9c15db83a86bf8 Kumar Kartikeya Dwivedi 2021-01-31  860  	strscpy(fix->id, fixId[index], sizeof(fix->id));
81dee67e215b23 Sudip Mukherjee         2015-03-03  861  
fdc234d85210d9 Benjamin Philip         2021-07-28  862  	fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
81dee67e215b23 Sudip Mukherjee         2015-03-03  863  	pr_info("fix->smem_start = %lx\n", fix->smem_start);
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  864  	/*
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  865  	 * according to mmap experiment from user space application,
81dee67e215b23 Sudip Mukherjee         2015-03-03  866  	 * fix->mmio_len should not larger than virtual size
81dee67e215b23 Sudip Mukherjee         2015-03-03  867  	 * (xres_virtual x yres_virtual x ByPP)
81dee67e215b23 Sudip Mukherjee         2015-03-03  868  	 * Below line maybe buggy when user mmap fb dev node and write
81dee67e215b23 Sudip Mukherjee         2015-03-03  869  	 * data into the bound over virtual size
d11ac7cbcc266c Sudip Mukherjee         2015-08-07  870  	 */
81dee67e215b23 Sudip Mukherjee         2015-03-03  871  	fix->smem_len = crtc->vidmem_size;
81dee67e215b23 Sudip Mukherjee         2015-03-03  872  	pr_info("fix->smem_len = %x\n", fix->smem_len);
81dee67e215b23 Sudip Mukherjee         2015-03-03  873  	info->screen_size = fix->smem_len;
81dee67e215b23 Sudip Mukherjee         2015-03-03  874  	fix->line_length = line_length;
e359b6a863e19f Mike Rapoport           2015-10-26  875  	fix->mmio_start = sm750_dev->vidreg_start;
81dee67e215b23 Sudip Mukherjee         2015-03-03  876  	pr_info("fix->mmio_start = %lx\n", fix->mmio_start);
e359b6a863e19f Mike Rapoport           2015-10-26  877  	fix->mmio_len = sm750_dev->vidreg_size;
81dee67e215b23 Sudip Mukherjee         2015-03-03  878  	pr_info("fix->mmio_len = %x\n", fix->mmio_len);
b610e1193a917f Matej Dujava            2020-04-30  879  
b610e1193a917f Matej Dujava            2020-04-30  880  	lynxfb_set_visual_mode(info);
81dee67e215b23 Sudip Mukherjee         2015-03-03  881  
81dee67e215b23 Sudip Mukherjee         2015-03-03  882  	/* set var */
81dee67e215b23 Sudip Mukherjee         2015-03-03  883  	var->activate = FB_ACTIVATE_NOW;
81dee67e215b23 Sudip Mukherjee         2015-03-03  884  	var->accel_flags = 0;
81dee67e215b23 Sudip Mukherjee         2015-03-03  885  	var->vmode = FB_VMODE_NONINTERLACED;
81dee67e215b23 Sudip Mukherjee         2015-03-03  886  
81dee67e215b23 Sudip Mukherjee         2015-03-03  887  	pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
81dee67e215b23 Sudip Mukherjee         2015-03-03  888  		 info->cmap.start, info->cmap.len,
81dee67e215b23 Sudip Mukherjee         2015-03-03  889  		 info->cmap.red, info->cmap.green, info->cmap.blue,
81dee67e215b23 Sudip Mukherjee         2015-03-03  890  		 info->cmap.transp);
81dee67e215b23 Sudip Mukherjee         2015-03-03  891  
61c507cf652da1 Michel von Czettritz    2015-03-26  892  	ret = fb_alloc_cmap(&info->cmap, 256, 0);
61c507cf652da1 Michel von Czettritz    2015-03-26  893  	if (ret < 0) {
008272072d61a8 Masanari Iida           2015-05-28  894  		pr_err("Could not allocate memory for cmap.\n");
81dee67e215b23 Sudip Mukherjee         2015-03-03  895  		goto exit;
81dee67e215b23 Sudip Mukherjee         2015-03-03  896  	}
81dee67e215b23 Sudip Mukherjee         2015-03-03  897  
81dee67e215b23 Sudip Mukherjee         2015-03-03  898  	pr_debug("#2 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
81dee67e215b23 Sudip Mukherjee         2015-03-03  899  		 info->cmap.start, info->cmap.len,
81dee67e215b23 Sudip Mukherjee         2015-03-03  900  		 info->cmap.red, info->cmap.green, info->cmap.blue,
81dee67e215b23 Sudip Mukherjee         2015-03-03  901  		 info->cmap.transp);
81dee67e215b23 Sudip Mukherjee         2015-03-03  902  
81dee67e215b23 Sudip Mukherjee         2015-03-03  903  exit:
81dee67e215b23 Sudip Mukherjee         2015-03-03  904  	lynxfb_ops_check_var(var, info);
81dee67e215b23 Sudip Mukherjee         2015-03-03  905  	return ret;
81dee67e215b23 Sudip Mukherjee         2015-03-03  906  }
81dee67e215b23 Sudip Mukherjee         2015-03-03  907  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* [PATCH] fbdev: i810: use appopriate log interface dev_info
From: Shi Hao @ 2025-10-31  8:09 UTC (permalink / raw)
  To: linux-fbdev; +Cc: dri-devel, deller, linux-kernel, adaplas, i.shihao.999

There were many printk log interfaces which do no had
any KERN_INFO with them and they can be replaced with
dev_info which will allow better log level handling
making messages clear and manageable.

No functional changes to the driver behavior are introduced.
Only the logging method has been replaced as per modern
kernel coding guidelines.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
---
 drivers/video/fbdev/i810/i810_main.c | 46 ++++++++++++++--------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/video/fbdev/i810/i810_main.c b/drivers/video/fbdev/i810/i810_main.c
index d73a795fe1be..cc5d09e3bd2b 100644
--- a/drivers/video/fbdev/i810/i810_main.c
+++ b/drivers/video/fbdev/i810/i810_main.c
@@ -1012,7 +1012,7 @@ static int i810_check_params(struct fb_var_screeninfo *var,
 						      var->bits_per_pixel);
 			vidmem = line_length * info->var.yres;
 			if (vxres < var->xres) {
-				printk("i810fb: required video memory, "
+				dev_info(&par->dev->dev, "i810fb: required video memory, "
 				       "%d bytes, for %dx%d-%d (virtual) "
 				       "is out of range\n",
 				       vidmem, vxres, vyres,
@@ -1067,9 +1067,9 @@ static int i810_check_params(struct fb_var_screeninfo *var,
 				|(info->monspecs.hfmax-HFMAX)
 				|(info->monspecs.vfmin-VFMIN)
 				|(info->monspecs.vfmax-VFMAX);
-			printk("i810fb: invalid video mode%s\n",
-			       default_sync ? "" : ". Specifying "
-			       "vsyncN/hsyncN parameters may help");
+			dev_err(&par->dev->dev, "i810fb: invalid video mode%s\n",
+				default_sync ? "" : ". Specifying "
+				"vsyncN/hsyncN parameters may help");
 			retval = -EINVAL;
 		}
 	}
@@ -1674,19 +1674,19 @@ static int i810_alloc_agp_mem(struct fb_info *info)
 	size = par->fb.size + par->iring.size;

 	if (!(bridge = agp_backend_acquire(par->dev))) {
-		printk("i810fb_alloc_fbmem: cannot acquire agpgart\n");
+		dev_warn(&par->dev->dev, "i810fb_alloc_fbmem: cannot acquire agpgart\n");
 		return -ENODEV;
 	}
 	if (!(par->i810_gtt.i810_fb_memory =
 	      agp_allocate_memory(bridge, size >> 12, AGP_NORMAL_MEMORY))) {
-		printk("i810fb_alloc_fbmem: can't allocate framebuffer "
+		dev_warn(&par->dev->dev, "i810fb_alloc_fbmem: can't allocate framebuffer "
 		       "memory\n");
 		agp_backend_release(bridge);
 		return -ENOMEM;
 	}
 	if (agp_bind_memory(par->i810_gtt.i810_fb_memory,
 			    par->fb.offset)) {
-		printk("i810fb_alloc_fbmem: can't bind framebuffer memory\n");
+		dev_warn(&par->dev->dev, "i810fb_alloc_fbmem: can't bind framebuffer memory\n");
 		agp_backend_release(bridge);
 		return -EBUSY;
 	}
@@ -1694,14 +1694,14 @@ static int i810_alloc_agp_mem(struct fb_info *info)
 	if (!(par->i810_gtt.i810_cursor_memory =
 	      agp_allocate_memory(bridge, par->cursor_heap.size >> 12,
 				  AGP_PHYSICAL_MEMORY))) {
-		printk("i810fb_alloc_cursormem:  can't allocate "
+		dev_warn(&par->dev->dev, "i810fb_alloc_cursormem:  can't allocate "
 		       "cursor memory\n");
 		agp_backend_release(bridge);
 		return -ENOMEM;
 	}
 	if (agp_bind_memory(par->i810_gtt.i810_cursor_memory,
 			    par->cursor_heap.offset)) {
-		printk("i810fb_alloc_cursormem: cannot bind cursor memory\n");
+		dev_warn(&par->dev->dev, "i810fb_alloc_cursormem: cannot bind cursor memory\n");
 		agp_backend_release(bridge);
 		return -EBUSY;
 	}
@@ -1844,7 +1844,7 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
 	int err;

 	if ((err = pci_enable_device(par->dev))) {
-		printk("i810fb_init: cannot enable device\n");
+		dev_err(&par->dev->dev, "i810fb_init: cannot enable device\n");
 		return err;
 	}
 	par->res_flags |= PCI_DEVICE_ENABLED;
@@ -1859,14 +1859,14 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
 		par->mmio_start_phys = pci_resource_start(par->dev, 0);
 	}
 	if (!par->aperture.size) {
-		printk("i810fb_init: device is disabled\n");
+		dev_warn(&par->dev->dev, "i810fb_init: device is disabled\n");
 		return -ENOMEM;
 	}

 	if (!request_mem_region(par->aperture.physical,
 				par->aperture.size,
 				i810_pci_list[entry->driver_data])) {
-		printk("i810fb_init: cannot request framebuffer region\n");
+		dev_warn(&par->dev->dev, "i810fb_init: cannot request framebuffer region\n");
 		return -ENODEV;
 	}
 	par->res_flags |= FRAMEBUFFER_REQ;
@@ -1874,14 +1874,14 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
 	par->aperture.virtual = ioremap_wc(par->aperture.physical,
 					   par->aperture.size);
 	if (!par->aperture.virtual) {
-		printk("i810fb_init: cannot remap framebuffer region\n");
+		dev_warn(&par->dev->dev, "i810fb_init: cannot remap framebuffer region\n");
 		return -ENODEV;
 	}

 	if (!request_mem_region(par->mmio_start_phys,
 				MMIO_SIZE,
 				i810_pci_list[entry->driver_data])) {
-		printk("i810fb_init: cannot request mmio region\n");
+		dev_warn(&par->dev->dev, "i810fb_init: cannot request mmio region\n");
 		return -ENODEV;
 	}
 	par->res_flags |= MMIO_REQ;
@@ -1889,7 +1889,7 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
 	par->mmio_start_virtual = ioremap(par->mmio_start_phys,
 						  MMIO_SIZE);
 	if (!par->mmio_start_virtual) {
-		printk("i810fb_init: cannot remap mmio region\n");
+		dev_warn(&par->dev->dev, "i810fb_init: cannot remap mmio region\n");
 		return -ENODEV;
 	}

@@ -1921,12 +1921,12 @@ static void i810fb_find_init_mode(struct fb_info *info)
 	}

 	if (!err)
-		printk("i810fb_init_pci: DDC probe successful\n");
+		dev_info(&par->dev->dev, "i810fb_init_pci: DDC probe successful\n");

 	fb_edid_to_monspecs(par->edid, specs);

 	if (specs->modedb == NULL)
-		printk("i810fb_init_pci: Unable to get Mode Database\n");
+		dev_info(&par->dev->dev, "i810fb_init_pci: Unable to get Mode Database\n");

 	fb_videomode_to_modelist(specs->modedb, specs->modedb_len,
 				 &info->modelist);
@@ -2072,7 +2072,7 @@ static int i810fb_init_pci(struct pci_dev *dev,

 	if (err < 0) {
     		i810fb_release_resource(info, par);
-		printk("i810fb_init: cannot register framebuffer device\n");
+		dev_warn(&par->dev->dev, "i810fb_init: cannot register framebuffer device\n");
     		return err;
     	}

@@ -2084,10 +2084,10 @@ static int i810fb_init_pci(struct pci_dev *dev,
 	vfreq = hfreq/(info->var.yres + info->var.upper_margin +
 		       info->var.vsync_len + info->var.lower_margin);

-      	printk("I810FB: fb%d         : %s v%d.%d.%d%s\n"
-      	       "I810FB: Video RAM   : %dK\n"
-	       "I810FB: Monitor     : H: %d-%d KHz V: %d-%d Hz\n"
-	       "I810FB: Mode        : %dx%d-%dbpp@%dHz\n",
+	dev_info(&par->dev->dev, "I810FB: fb%d         : %s v%d.%d.%d%s\n"
+		"I810FB: Video RAM   : %dK\n"
+		"I810FB: Monitor     : H: %d-%d KHz V: %d-%d Hz\n"
+		"I810FB: Mode        : %dx%d-%dbpp@%dHz\n",
 	       info->node,
 	       i810_pci_list[entry->driver_data],
 	       VERSION_MAJOR, VERSION_MINOR, VERSION_TEENIE, BRANCH_VERSION,
@@ -2137,7 +2137,7 @@ static void i810fb_remove_pci(struct pci_dev *dev)

 	unregister_framebuffer(info);
 	i810fb_release_resource(info, par);
-	printk("cleanup_module:  unloaded i810 framebuffer device\n");
+	dev_info(&par->dev->dev, "cleanup_module:  unloaded i810 framebuffer device\n");
 }

 #ifndef MODULE
--
2.51.0


^ permalink raw reply related

* Re: [PATCH] dt-bindings: Remove extra blank lines
From: Hal Feng @ 2025-10-31  6:46 UTC (permalink / raw)
  To: Rob Herring (Arm), Krzysztof Kozlowski, Conor Dooley,
	Stephen Boyd, David Airlie, Simona Vetter, Maarten Lankhorst,
	Thomas Zimmermann, Andrzej Hajda, Robert Foss, Vinod Koul,
	Moritz Fischer, Xu Yilun, Bartosz Golaszewski, Guenter Roeck,
	Andi Shyti, Jonathan Cameron, Dmitry Torokhov, Georgi Djakov,
	Thomas Gleixner, Joerg Roedel, Jassi Brar, Mauro Carvalho Chehab,
	Lee Jones, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Johannes Berg, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Bjorn Helgaas, Kishon Vijay Abraham I,
	Sebastian Reichel, Uwe Kleine-König, Mark Brown,
	Mathieu Poirier, Philipp Zabel, Olivia Mackall, Herbert Xu,
	Daniel Lezcano, Greg Kroah-Hartman
  Cc: devicetree, linux-kernel, linux-clk, dri-devel, linux-fbdev,
	dmaengine, linux-fpga, linux-gpio, linux-hwmon, linux-i2c,
	linux-iio, linux-input, linux-pm, iommu, linux-media, linux-mtd,
	netdev, linux-wireless, linux-pci, linux-phy, linux-pwm,
	linux-remoteproc, linux-crypto, linux-sound, linux-usb
In-Reply-To: <20251023143957.2899600-1-robh@kernel.org>

On 10/23/2025 10:37 PM, Rob Herring (Arm) wrote:
> Generally at most 1 blank line is the standard style for DT schema
> files. Remove the few cases with more than 1 so that the yamllint check
> for this can be enabled.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
>  Documentation/devicetree/bindings/.yamllint                  | 2 +-
>  Documentation/devicetree/bindings/arm/psci.yaml              | 1 -
>  .../bindings/clock/allwinner,sun4i-a10-gates-clk.yaml        | 1 -
>  .../devicetree/bindings/clock/renesas,cpg-mssr.yaml          | 1 -
>  .../devicetree/bindings/clock/xlnx,clocking-wizard.yaml      | 1 -
>  .../display/allwinner,sun4i-a10-display-frontend.yaml        | 1 -
>  .../devicetree/bindings/display/allwinner,sun6i-a31-drc.yaml | 1 -
>  .../bindings/display/allwinner,sun8i-a83t-dw-hdmi.yaml       | 1 -
>  .../devicetree/bindings/display/amlogic,meson-vpu.yaml       | 1 -
>  .../devicetree/bindings/display/bridge/adi,adv7511.yaml      | 1 -
>  .../devicetree/bindings/display/bridge/lvds-codec.yaml       | 1 -
>  .../devicetree/bindings/display/bridge/toshiba,tc358767.yaml | 1 -
>  .../devicetree/bindings/display/ilitek,ili9486.yaml          | 1 -
>  Documentation/devicetree/bindings/display/msm/gpu.yaml       | 1 -
>  .../devicetree/bindings/display/panel/panel-timing.yaml      | 1 -
>  .../devicetree/bindings/display/panel/tpo,tpg110.yaml        | 1 -
>  .../devicetree/bindings/display/rockchip/rockchip,dw-dp.yaml | 1 -
>  .../devicetree/bindings/display/simple-framebuffer.yaml      | 1 -
>  .../devicetree/bindings/dma/snps,dma-spear1340.yaml          | 1 -
>  Documentation/devicetree/bindings/dma/stericsson,dma40.yaml  | 1 -
>  .../devicetree/bindings/dma/stm32/st,stm32-dma.yaml          | 1 -
>  Documentation/devicetree/bindings/edac/apm,xgene-edac.yaml   | 1 -
>  .../devicetree/bindings/firmware/qemu,fw-cfg-mmio.yaml       | 1 -
>  Documentation/devicetree/bindings/fpga/fpga-region.yaml      | 5 -----
>  .../devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml        | 1 -
>  .../devicetree/bindings/gpio/fairchild,74hc595.yaml          | 1 -
>  Documentation/devicetree/bindings/hwmon/adi,ltc2947.yaml     | 1 -
>  Documentation/devicetree/bindings/hwmon/adi,max31827.yaml    | 1 -
>  Documentation/devicetree/bindings/hwmon/national,lm90.yaml   | 1 -
>  Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml       | 1 -
>  Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml     | 1 -
>  Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.yaml     | 1 -
>  .../devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml         | 1 -
>  Documentation/devicetree/bindings/i2c/tsd,mule-i2c-mux.yaml  | 2 --
>  Documentation/devicetree/bindings/iio/adc/adi,ad7380.yaml    | 1 -
>  Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml    | 1 -
>  Documentation/devicetree/bindings/iio/adc/adi,ad7949.yaml    | 1 -
>  Documentation/devicetree/bindings/iio/adc/adi,ade9000.yaml   | 1 -
>  .../devicetree/bindings/iio/adc/cosmic,10001-adc.yaml        | 1 -
>  Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml  | 1 -
>  .../devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml     | 1 -
>  .../devicetree/bindings/iio/afe/voltage-divider.yaml         | 1 -
>  .../devicetree/bindings/iio/frequency/adi,admv4420.yaml      | 1 -
>  .../devicetree/bindings/iio/pressure/murata,zpa2326.yaml     | 1 -
>  .../devicetree/bindings/iio/proximity/semtech,sx9324.yaml    | 1 -
>  .../devicetree/bindings/iio/temperature/adi,ltc2983.yaml     | 1 -
>  Documentation/devicetree/bindings/input/ti,drv266x.yaml      | 1 -
>  .../devicetree/bindings/interconnect/qcom,rpmh.yaml          | 1 -
>  .../devicetree/bindings/interrupt-controller/arm,gic-v3.yaml | 1 -
>  .../bindings/interrupt-controller/aspeed,ast2700-intc.yaml   | 1 -
>  .../bindings/interrupt-controller/fsl,vf610-mscm-ir.yaml     | 1 -
>  .../bindings/interrupt-controller/loongson,liointc.yaml      | 1 -
>  .../bindings/interrupt-controller/mediatek,mtk-cirq.yaml     | 1 -
>  .../bindings/interrupt-controller/mscc,ocelot-icpu-intr.yaml | 1 -
>  Documentation/devicetree/bindings/iommu/arm,smmu.yaml        | 4 ----
>  Documentation/devicetree/bindings/mailbox/arm,mhu.yaml       | 1 -
>  Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml     | 1 -
>  Documentation/devicetree/bindings/mailbox/mtk,adsp-mbox.yaml | 1 -
>  Documentation/devicetree/bindings/media/amphion,vpu.yaml     | 1 -
>  Documentation/devicetree/bindings/media/i2c/adi,adv7604.yaml | 2 --
>  .../devicetree/bindings/media/i2c/techwell,tw9900.yaml       | 1 -
>  Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml   | 1 -
>  .../devicetree/bindings/media/qcom,sc8280xp-camss.yaml       | 1 -
>  .../bindings/media/samsung,exynos4212-fimc-is.yaml           | 1 -
>  .../devicetree/bindings/media/samsung,s5pv210-jpeg.yaml      | 1 -
>  Documentation/devicetree/bindings/media/st,stm32-dma2d.yaml  | 1 -
>  .../devicetree/bindings/media/video-interface-devices.yaml   | 4 ----
>  .../memory-controllers/qcom,ebi2-peripheral-props.yaml       | 1 -
>  Documentation/devicetree/bindings/mfd/stericsson,ab8500.yaml | 1 -
>  .../devicetree/bindings/mtd/amlogic,meson-nand.yaml          | 1 -
>  .../devicetree/bindings/mtd/marvell,nand-controller.yaml     | 1 -
>  Documentation/devicetree/bindings/mux/mux-controller.yaml    | 1 -
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml   | 2 --
>  Documentation/devicetree/bindings/net/brcm,bcmgenet.yaml     | 1 -
>  .../devicetree/bindings/net/brcm,mdio-mux-iproc.yaml         | 1 -
>  .../devicetree/bindings/net/cortina,gemini-ethernet.yaml     | 1 -
>  Documentation/devicetree/bindings/net/fsl,gianfar.yaml       | 2 --
>  .../devicetree/bindings/net/mdio-mux-multiplexer.yaml        | 1 -
>  Documentation/devicetree/bindings/net/qcom,ipa.yaml          | 1 -
>  Documentation/devicetree/bindings/net/ti,cpsw-switch.yaml    | 1 -
>  .../devicetree/bindings/net/wireless/ti,wlcore.yaml          | 1 -
>  .../devicetree/bindings/pci/altr,pcie-root-port.yaml         | 1 -
>  Documentation/devicetree/bindings/pci/loongson.yaml          | 1 -
>  Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml  | 1 -
>  .../devicetree/bindings/pci/starfive,jh7110-pcie.yaml        | 1 -
>  Documentation/devicetree/bindings/pci/versatile.yaml         | 1 -
>  .../bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml         | 1 -
>  .../devicetree/bindings/pinctrl/brcm,bcm21664-pinctrl.yaml   | 1 -
>  .../devicetree/bindings/pinctrl/fsl,imx9-pinctrl.yaml        | 1 -
>  .../devicetree/bindings/pinctrl/qcom,qcs404-pinctrl.yaml     | 1 -
>  .../bindings/pinctrl/qcom,sm6115-lpass-lpi-pinctrl.yaml      | 1 -
>  .../devicetree/bindings/pinctrl/qcom,sm6125-tlmm.yaml        | 1 -
>  .../devicetree/bindings/pinctrl/renesas,rza1-ports.yaml      | 3 ---
>  .../devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml | 1 -
>  .../devicetree/bindings/power/supply/mt6360_charger.yaml     | 1 -
>  .../bindings/power/supply/stericsson,ab8500-charger.yaml     | 1 -
>  .../devicetree/bindings/pwm/allwinner,sun4i-a10-pwm.yaml     | 1 -
>  .../bindings/regulator/richtek,rt6245-regulator.yaml         | 1 -
>  .../devicetree/bindings/remoteproc/ti,k3-r5f-rproc.yaml      | 2 --
>  Documentation/devicetree/bindings/reset/ti,sci-reset.yaml    | 1 -
>  .../bindings/rng/inside-secure,safexcel-eip76.yaml           | 2 --
>  .../devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-muram.yaml     | 1 -
>  .../devicetree/bindings/soc/mediatek/mediatek,mutex.yaml     | 1 -
>  .../bindings/soc/microchip/atmel,at91rm9200-tcb.yaml         | 1 -
>  Documentation/devicetree/bindings/soc/rockchip/grf.yaml      | 1 -
>  Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml       | 3 ---
>  Documentation/devicetree/bindings/sound/adi,adau1372.yaml    | 1 -
>  Documentation/devicetree/bindings/sound/adi,adau7118.yaml    | 1 -
>  .../devicetree/bindings/sound/rockchip,i2s-tdm.yaml          | 1 -
>  .../devicetree/bindings/sound/rockchip,rk3328-codec.yaml     | 2 +-
>  Documentation/devicetree/bindings/sound/samsung,tm2.yaml     | 1 -
>  .../devicetree/bindings/sound/ti,tlv320dac3100.yaml          | 1 -
>  Documentation/devicetree/bindings/sound/wlf,wm8903.yaml      | 1 -
>  .../devicetree/bindings/timer/nvidia,tegra-timer.yaml        | 1 -
>  .../devicetree/bindings/timer/nvidia,tegra186-timer.yaml     | 1 -
>  Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml   | 1 -
>  116 files changed, 2 insertions(+), 136 deletions(-)
> 

...

> diff --git a/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml
> index 5f432452c815..33c80626e8ec 100644
> --- a/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml
> +++ b/Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml
> @@ -16,7 +16,6 @@ properties:
>    compatible:
>      const: starfive,jh7110-pcie
>  
> -
>    reg:
>      maxItems: 2
>  

...

> diff --git a/Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
> index f3258f2fd3a4..3f14eab01c54 100644
> --- a/Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
> @@ -32,7 +32,6 @@ description: |
>      | | |     |   |   |          -------
>      UART0     UART1 --
>  
> -
>    The big MUX in the diagram only has 7 different ways of mapping peripherals
>    on the left to pins on the right. StarFive calls the 7 configurations "signal
>    groups".

Reviewed-by: Hal Feng <hal.feng@starfivetech.com>

Best regards,
Hal

^ permalink raw reply

* Re: [GIT PULL] fbdev fixes for v6.18-rc4
From: pr-tracker-bot @ 2025-10-31  2:51 UTC (permalink / raw)
  To: Helge Deller; +Cc: Linus Torvalds, linux-kernel, linux-fbdev, dri-devel
In-Reply-To: <aQOOz7Q27BbUo-_4@carbonx1>

The pull request you sent on Thu, 30 Oct 2025 17:14:07 +0100:

> http://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git tags/fbdev-for-6.18-rc4

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/a4819ac1913e78e41c8406df481a661d9469c350

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply

* Re: [PATCH v2] fbdev/vesafb: Use dev_* fn's instead printk.
From: Helge Deller @ 2025-10-30 23:20 UTC (permalink / raw)
  To: Javier Garcia; +Cc: linux-fbdev, dri-devel, linux-kernel, shuah
In-Reply-To: <20251030200723.2788931-1-rampxxxx@gmail.com>

On 10/30/25 21:07, Javier Garcia wrote:
> - Family dev_* fn's will show device name, giving extra info to logs.
> - Delete the prefix `vesafb:` from msg strings, not needed now.
> 
> [    0.981825] vesa-framebuffer vesa-framebuffer.0: scrolling: redraw
> 
> Signed-off-by: Javier Garcia <rampxxxx@gmail.com>
> ---
> v1 -> v2:
>        * Fix checkpatch.pl messages, thanks Helge Deller.
>        * v1 https://lore.kernel.org/lkml/20251028185021.2758401-1-rampxxxx@gmail.com/
> 
>   drivers/video/fbdev/vesafb.c | 29 +++++++++++++++--------------
>   1 file changed, 15 insertions(+), 14 deletions(-)

applied.

Thanks!
Helge

^ permalink raw reply

* [PATCH v2] fbdev/vesafb: Use dev_* fn's instead printk.
From: Javier Garcia @ 2025-10-30 20:07 UTC (permalink / raw)
  To: deller; +Cc: linux-fbdev, dri-devel, linux-kernel, shuah, Javier Garcia
In-Reply-To: <20251028185021.2758401-1-rampxxxx@gmail.com>

- Family dev_* fn's will show device name, giving extra info to logs.
- Delete the prefix `vesafb:` from msg strings, not needed now.

[    0.981825] vesa-framebuffer vesa-framebuffer.0: scrolling: redraw

Signed-off-by: Javier Garcia <rampxxxx@gmail.com>
---
v1 -> v2:
      * Fix checkpatch.pl messages, thanks Helge Deller.
      * v1 https://lore.kernel.org/lkml/20251028185021.2758401-1-rampxxxx@gmail.com/

 drivers/video/fbdev/vesafb.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c
index a81df8865143..f135033c22fb 100644
--- a/drivers/video/fbdev/vesafb.c
+++ b/drivers/video/fbdev/vesafb.c
@@ -314,8 +314,8 @@ static int vesafb_probe(struct platform_device *dev)
 #endif
 
 	if (!request_mem_region(vesafb_fix.smem_start, size_total, "vesafb")) {
-		printk(KERN_WARNING
-		       "vesafb: cannot reserve video memory at 0x%lx\n",
+		dev_warn(&dev->dev,
+		       "cannot reserve video memory at 0x%lx\n",
 			vesafb_fix.smem_start);
 		/* We cannot make this fatal. Sometimes this comes from magic
 		   spaces our resource handlers simply don't know about */
@@ -333,12 +333,12 @@ static int vesafb_probe(struct platform_device *dev)
 	par->base = si->lfb_base;
 	par->size = size_total;
 
-	printk(KERN_INFO "vesafb: mode is %dx%dx%d, linelength=%d, pages=%d\n",
+	dev_info(&dev->dev, "mode is %dx%dx%d, linelength=%d, pages=%d\n",
 	       vesafb_defined.xres, vesafb_defined.yres, vesafb_defined.bits_per_pixel,
 	       vesafb_fix.line_length, si->pages);
 
 	if (si->vesapm_seg) {
-		printk(KERN_INFO "vesafb: protected mode interface info at %04x:%04x\n",
+		dev_info(&dev->dev, "protected mode interface info at %04x:%04x\n",
 		       si->vesapm_seg, si->vesapm_off);
 	}
 
@@ -352,9 +352,10 @@ static int vesafb_probe(struct platform_device *dev)
 		pmi_base  = (unsigned short *)phys_to_virt(pmi_phys);
 		pmi_start = (void*)((char*)pmi_base + pmi_base[1]);
 		pmi_pal   = (void*)((char*)pmi_base + pmi_base[2]);
-		printk(KERN_INFO "vesafb: pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
+		dev_info(&dev->dev, "pmi: set display start = %p, set palette = %p\n",
+			 pmi_start, pmi_pal);
 		if (pmi_base[3]) {
-			printk(KERN_INFO "vesafb: pmi: ports = ");
+			dev_info(&dev->dev, "pmi: ports = ");
 			for (i = pmi_base[3]/2; pmi_base[i] != 0xffff; i++)
 				printk("%x ", pmi_base[i]);
 			printk("\n");
@@ -365,14 +366,14 @@ static int vesafb_probe(struct platform_device *dev)
 				 * Rules are: we have to set up a descriptor for the requested
 				 * memory area and pass it in the ES register to the BIOS function.
 				 */
-				printk(KERN_INFO "vesafb: can't handle memory requests, pmi disabled\n");
+				dev_info(&dev->dev, "can't handle memory requests, pmi disabled\n");
 				ypan = pmi_setpal = 0;
 			}
 		}
 	}
 
 	if (vesafb_defined.bits_per_pixel == 8 && !pmi_setpal && !vga_compat) {
-		printk(KERN_WARNING "vesafb: hardware palette is unchangeable,\n"
+		dev_warn(&dev->dev, "hardware palette is unchangeable,\n"
 		                    "        colors may be incorrect\n");
 		vesafb_fix.visual = FB_VISUAL_STATIC_PSEUDOCOLOR;
 	}
@@ -380,10 +381,10 @@ static int vesafb_probe(struct platform_device *dev)
 	vesafb_defined.xres_virtual = vesafb_defined.xres;
 	vesafb_defined.yres_virtual = vesafb_fix.smem_len / vesafb_fix.line_length;
 	if (ypan && vesafb_defined.yres_virtual > vesafb_defined.yres) {
-		printk(KERN_INFO "vesafb: scrolling: %s using protected mode interface, yres_virtual=%d\n",
+		dev_info(&dev->dev, "scrolling: %s using protected mode interface, yres_virtual=%d\n",
 		       (ypan > 1) ? "ywrap" : "ypan",vesafb_defined.yres_virtual);
 	} else {
-		printk(KERN_INFO "vesafb: scrolling: redraw\n");
+		dev_info(&dev->dev, "scrolling: redraw\n");
 		vesafb_defined.yres_virtual = vesafb_defined.yres;
 		ypan = 0;
 	}
@@ -410,7 +411,7 @@ static int vesafb_probe(struct platform_device *dev)
 		vesafb_defined.bits_per_pixel;
 	}
 
-	printk(KERN_INFO "vesafb: %s: "
+	dev_info(&dev->dev, "%s: "
 	       "size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n",
 	       (vesafb_defined.bits_per_pixel > 8) ?
 	       "Truecolor" : (vga_compat || pmi_setpal) ?
@@ -453,14 +454,14 @@ static int vesafb_probe(struct platform_device *dev)
 	}
 
 	if (!info->screen_base) {
-		printk(KERN_ERR
-		       "vesafb: abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
+		dev_err(&dev->dev,
+		       "abort, cannot ioremap video memory 0x%x @ 0x%lx\n",
 			vesafb_fix.smem_len, vesafb_fix.smem_start);
 		err = -EIO;
 		goto err_release_region;
 	}
 
-	printk(KERN_INFO "vesafb: framebuffer at 0x%lx, mapped to 0x%p, "
+	dev_info(&dev->dev, "framebuffer at 0x%lx, mapped to 0x%p, "
 	       "using %dk, total %dk\n",
 	       vesafb_fix.smem_start, info->screen_base,
 	       size_remap/1024, size_total/1024);
-- 
2.50.1


^ permalink raw reply related

* Re: [PATCH] fbdev/vesafb: Use dev_* fn's instead printk.
From: Helge Deller @ 2025-10-30 18:33 UTC (permalink / raw)
  To: Javier Garcia; +Cc: linux-fbdev, dri-devel
In-Reply-To: <20251028185021.2758401-1-rampxxxx@gmail.com>

On 10/28/25 19:50, Javier Garcia wrote:
> - Family dev_* fn's will show device name, giving extra info to logs.
> - Delete the prefix `vesafb:` from msg strings, not needed now.
> 
> [    0.981825] vesa-framebuffer vesa-framebuffer.0: scrolling: redraw
> 
> Signed-off-by: Javier Garcia <rampxxxx@gmail.com>
> ---
>   drivers/video/fbdev/vesafb.c | 28 ++++++++++++++--------------
>   1 file changed, 14 insertions(+), 14 deletions(-)

Thanks for your patch!
But please run "./scripts/checkpatch.pl" on it before sending...:


ERROR: space required after that ',' (ctx:VxV)
#33: FILE: drivers/video/fbdev/vesafb.c:336:
+       dev_info(&dev->dev,"mode is %dx%dx%d, linelength=%d, pages=%d\n",
                           ^

WARNING: line length of 105 exceeds 100 columns
#48: FILE: drivers/video/fbdev/vesafb.c:355:
+               dev_info(&dev->dev, "pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);

ERROR: space required after that ',' (ctx:VxV)
#48: FILE: drivers/video/fbdev/vesafb.c:355:
+               dev_info(&dev->dev, "pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
                                                                                      ^

ERROR: space required after that ',' (ctx:VxV)
#48: FILE: drivers/video/fbdev/vesafb.c:355:
+               dev_info(&dev->dev, "pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
                                                                                                ^

total: 3 errors, 1 warnings, 88 lines checked

^ permalink raw reply

* Re: [PATCH] fbdev: vga16fb: replace printk() with dev_*() in probe
From: Helge Deller @ 2025-10-30 18:20 UTC (permalink / raw)
  To: Vivek BalachandharTN; +Cc: dri-devel, linux-fbdev
In-Reply-To: <20251016105446.3646544-1-vivek.balachandhar@gmail.com>

On 10/16/25 12:54, Vivek BalachandharTN wrote:
> Use dev_*() with &dev->dev and drop the hard-coded prefix. Keep
> original severities. No functional change.
> 
> Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
> ---
>   drivers/video/fbdev/vga16fb.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)

applied.

Thanks!
Helge

^ permalink raw reply

* Re: [RFC PATCH] fdev: i810: use appropriate log interface pr_info
From: Helge Deller @ 2025-10-30 18:13 UTC (permalink / raw)
  To: Shi Hao, linux-fbdev; +Cc: dri-devel, adaplas
In-Reply-To: <20251015140845.31671-1-i.shihao.999@gmail.com>

On 10/15/25 16:08, Shi Hao wrote:
> use appropriate logging interface pr_info instead of printk
> without KERN_INFO with it. It could be updated with proper
> logging interfaces.
> 
> Legacy printk() calls in the i810 fbdev driver can be replaced
> with the standard kernel logging interface pr_info() which will
> help to allow proper log level handling, making messages easier
> to filter and manage.
> 
> No functional changes to the driver behavior are introduced.
> Only the logging method has been updated to follow modern
> kernel coding guidelines.
> 
> Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
> ---
>   drivers/video/fbdev/i810/i810_main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/i810/i810_main.c b/drivers/video/fbdev/i810/i810_main.c
> index d73a795fe1be..8c4b9eae151d 100644
> --- a/drivers/video/fbdev/i810/i810_main.c
> +++ b/drivers/video/fbdev/i810/i810_main.c
> @@ -2137,7 +2137,7 @@ static void i810fb_remove_pci(struct pci_dev *dev)
> 
>   	unregister_framebuffer(info);
>   	i810fb_release_resource(info, par);
> -	printk("cleanup_module:  unloaded i810 framebuffer device\n");
> +	pr_info("cleanup_module: unloaded i810 framebuffer device\n");

Thanks for your patch!
It's possible to change it like this, but I wonder:
Why did you choose to change that specific line?
What about the other printk() in this file ?
Ideally we then should use dev_info() or dev_warn() [...] instead.
and most important:
There is no actual reason to change it. Usually we touch such lines
and clean then up when we anyway change code in this area.

So, your patch is appreciated, but I'm a little hesitant to take it
(although it's basically correct!).

Helge

^ permalink raw reply

* [GIT PULL] fbdev fixes for v6.18-rc4
From: Helge Deller @ 2025-10-30 16:14 UTC (permalink / raw)
  To: Linus Torvalds, linux-kernel, linux-fbdev, dri-devel

Hi Linus,

please pull a few important bugfixes for various fbdev drivers for 6.18-rc4.

All patches are tagged for stable series.
Includes a trivial typo fix for the fb.h header as well.

Thanks!
Helge

----------------------------------------------------------------
The following changes since commit dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa:

  Linux 6.18-rc3 (2025-10-26 15:59:49 -0700)

are available in the Git repository at:

  http://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git tags/fbdev-for-6.18-rc4

for you to fetch changes up to 7073c7fc8d8ba47194e5fc58fcafc0efe7586e9b:

  fbdev: atyfb: Check if pll_ops->init_pll failed (2025-10-28 22:59:19 +0100)

----------------------------------------------------------------
fbdev fixes for 6.18-rc4:

- atyfb: Avoid hard lock up when PLL not initialized (Daniel Palmer)
- pvr2fb: Fix build error when CONFIG_PVR2_DMA enabled (Florian Fuchs)
- bitblit: Fix out-of-bounds read in bit_putcs* (Junjie Cao)
- valkyriefb: Fix reference count leak (Miaoqian Lin)
- fbcon: Fix slab-use-after-free in fb_mode_is_equal (Quanmin Yan)
- fb.h: Fix typo in "vertical" (Piyush Choudhary)

----------------------------------------------------------------
Daniel Palmer (1):
      fbdev: atyfb: Check if pll_ops->init_pll failed

Florian Fuchs (1):
      fbdev: pvr2fb: Fix leftover reference to ONCHIP_NR_DMA_CHANNELS

Junjie Cao (1):
      fbdev: bitblit: bound-check glyph index in bit_putcs*

Miaoqian Lin (1):
      fbdev: valkyriefb: Fix reference count leak in valkyriefb_init

PIYUSH CHOUDHARY (1):
      video: fb: Fix typo in comment in fb.h

Quanmin Yan (1):
      fbcon: Set fb_display[i]->mode to NULL when the mode is released

 drivers/video/fbdev/aty/atyfb_base.c |  8 ++++++--
 drivers/video/fbdev/core/bitblit.c   | 16 ++++++++++++----
 drivers/video/fbdev/core/fbcon.c     | 19 +++++++++++++++++++
 drivers/video/fbdev/core/fbmem.c     |  1 +
 drivers/video/fbdev/pvr2fb.c         |  2 +-
 drivers/video/fbdev/valkyriefb.c     |  2 ++
 include/linux/fbcon.h                |  2 ++
 include/uapi/linux/fb.h              |  2 +-
 8 files changed, 44 insertions(+), 8 deletions(-)

^ permalink raw reply

* Re: [PATCH v6] backlight: led-backlight: add devlink to supplier LEDs
From: Luca Ceresoli @ 2025-10-30 12:54 UTC (permalink / raw)
  To: Daniel Thompson, Sverdlin, Alexander
  Cc: jingoohan1@gmail.com, tomi.valkeinen@ti.com, lee@kernel.org,
	tony@atomide.com, pavel@ucw.cz, deller@gmx.de, jjhiblot@ti.com,
	linux-fbdev@vger.kernel.org, thomas.petazzoni@bootlin.com,
	saravanak@google.com, herve.codina@bootlin.com,
	dri-devel@lists.freedesktop.org, alexander.sverdlin@gmail.com,
	linux-kernel@vger.kernel.org, daniel.thompson@linaro.org
In-Reply-To: <aQJSqJOrtETMKt8x@aspen.lan>

Hello,

On Wed Oct 29, 2025 at 6:45 PM CET, Daniel Thompson wrote:
> On Thu, Oct 23, 2025 at 12:41:30PM +0000, Sverdlin, Alexander wrote:
>> Hi Lee, Daniel, Jingoo,
>>
>> On Mon, 2025-05-19 at 22:19 +0200, Luca Ceresoli wrote:
>> > led-backlight is a consumer of one or multiple LED class devices, but
>> > devlink is currently unable to create correct supplier-producer links when
>> > the supplier is a class device. It creates instead a link where the
>> > supplier is the parent of the expected device.
>> > <snip>
>> > Fixes: ae232e45acf9 ("backlight: add led-backlight driver")
>> > Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>> > Reviewed-by: Herve Codina <herve.codina@bootlin.com>
>>
>> I've noticed that the patch in archived in the patchwork [1] but I wasn't
>> able to find it in any branch of the backlight tree [2].
>>
>> Could it be that the patch somehow slipped through?
>> It does solve a real-world crash, could you please consider to apply it?
>
> Sorry folks. I overlooked this in my backlog and never posted the R-b
> (which helps Lee figure out what to hoover up).
>
> Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>

Thanks Alexander for pinging and Daniel for reviewing!

I double checked right now and can confirm:

 * the bug is still present on v6.18-rc3
 * the patch applies cleanly on v6.18-rc3
 * the patch is still fixing the bug

Best regards,
Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply

* Re: [PATCH] backlight: pwm_bl: apply the initial backlight state with sane defaults
From: Daniel Thompson @ 2025-10-30 11:51 UTC (permalink / raw)
  To: Michael Grzeschik
  Cc: Uwe Kleine-König, Lee Jones, Jingoo Han, Helge Deller,
	Pengutronix, linux-pwm, dri-devel, linux-fbdev, linux-kernel
In-Reply-To: <20250731-blpwm-v1-1-0171fd31bff9@pengutronix.de>

On Thu, Jul 31, 2025 at 10:47:18AM +0200, Michael Grzeschik wrote:
> Currently when calling pwm_apply_might_sleep in the probe routine
> the pwm will be configured with an not fully defined state.
>
> The duty_cycle is not yet set in that moment. There is a final
> backlight_update_status call that will have a properly setup state.
> However this change in the backlight can create a short flicker if the
> backlight was already preinitialised.
>
> We fix the flicker by moving the pwm_apply after the default duty_cycle
> can be calculated.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>


Daniel.

^ permalink raw reply

* Re: [PATCH 2/2] backlight: ktd2801: Depend on GPIOLIB
From: Daniel Thompson @ 2025-10-30 11:48 UTC (permalink / raw)
  To: Duje Mihanović
  Cc: Lee Jones, Pavel Machek, Jingoo Han, Helge Deller, Randy Dunlap,
	linux-leds, linux-kernel, dri-devel, linux-fbdev
In-Reply-To: <20250729-expresswire-dep-fix-v1-2-635cd4cc746b@dujemihanovic.xyz>

On Tue, Jul 29, 2025 at 07:18:30PM +0200, Duje Mihanović wrote:
> The LEDS_EXPRESSWIRE library used by the driver requires GPIOLIB. Make
> sure this dependency is not left unsatisfied.
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Link: https://lore.kernel.org/all/b6c481bb-e854-405e-a428-90301789fe20@infradead.org/
> Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>

Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>


Daniel.

^ permalink raw reply

* Re: [PATCH 1/2] leds: Drop duplicate LEDS_EXPRESSWIRE config
From: Daniel Thompson @ 2025-10-30 11:47 UTC (permalink / raw)
  To: Duje Mihanović
  Cc: Lee Jones, Pavel Machek, Jingoo Han, Helge Deller, Randy Dunlap,
	linux-leds, linux-kernel, dri-devel, linux-fbdev
In-Reply-To: <20250729-expresswire-dep-fix-v1-1-635cd4cc746b@dujemihanovic.xyz>

On Tue, Jul 29, 2025 at 07:18:29PM +0200, Duje Mihanović wrote:
> While moving said config symbol out of the "if NEW_LEDS" block, I
> accidentally left a copy inside that block. Remove it.
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Link: https://lore.kernel.org/all/b6c481bb-e854-405e-a428-90301789fe20@infradead.org/
> Fixes: 2cd0d1db31e7 ("leds: expresswire: Don't depend on NEW_LEDS")
> Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>

Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>


Daniel.

^ permalink raw reply

* Re: [PATCH 2/2] backlight: aw99706: Add support for Awinic AW99706 backlight
From: Daniel Thompson @ 2025-10-29 17:53 UTC (permalink / raw)
  To: Junjie Cao
  Cc: Lee Jones, Jingoo Han, Pavel Machek, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Helge Deller, dri-devel,
	linux-leds, devicetree, linux-kernel, linux-fbdev, Pengyu Luo
In-Reply-To: <CAK6c68h3Mc0=JbbbVAmo_cYeOR_T-_rRy5EacgYQh7HgQZOPBg@mail.gmail.com>

On Wed, Oct 29, 2025 at 07:49:35PM +0800, Junjie Cao wrote:
> On Tue, Oct 28, 2025 at 9:21 PM Daniel Thompson <danielt@kernel.org> wrote:
> >
> > On Sun, Oct 26, 2025 at 08:39:23PM +0800, Junjie Cao wrote:
> > > Add support for Awinic AW99706 backlight, which can be found in
> > > tablet and notebook backlight, one case is the Lenovo Legion Y700
> > > Gen4. This driver refers to the official datasheets and android
> > > driver, they can be found in [1].
> > >
> > > [1] https://www.awinic.com/en/productDetail/AW99706QNR
> > >
> > > Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
> > > Signed-off-by: Junjie Cao <caojunjie650@gmail.com>
> > > ---
> > > diff --git a/drivers/video/backlight/aw99706.c b/drivers/video/backlight/aw99706.c
> > > <snip>
> > > +static void aw99706_dt_parse(struct aw99706_device *aw)
> > > +{
> > > +     struct aw99706_dt_prop *prop;
> > > +     int ret, i;
> > > +
> > > +     for (i = 0; i < ARRAY_SIZE(aw99706_dt_props); i++) {
> > > +             prop = &aw99706_dt_props[i];
> > > +             ret = device_property_read_u32(aw->dev, prop->name,
> > > +                                            &prop->raw_val);
> > > +             if (ret < 0) {
> > > +                     dev_warn(aw->dev, "Missing property %s: %d\n",
> > > +                              prop->name, ret);
> >
> > Why is there a warning when an optional property is not present. A DT
> > not including an optional property needs no message at all.
> >
>
> They are mandatory in the downstream, and providing all properties is
> difficult sometimes, so I set a default value if one is missing. But
> one device may use a configuration different from the component
> vendor's. These default values may be not optimal, so I issue a
> warning for property missing. (I forgot to address it)

All sensible but to be clear...

From my point-of-view the driver should match the upstream bindings.
Either the properties are required (in which case missing them can be
dev_err() and/or fail to probe) or they are optional (in which case
there should be no warnings).

Similarly if missing values is likely to lead to very sub-optimal
behavior (or something that has a risk of over-current or component
failure) then consider making the options mandatory.


Daniel.

^ permalink raw reply

* Re: [PATCH v6] backlight: led-backlight: add devlink to supplier LEDs
From: Daniel Thompson @ 2025-10-29 17:45 UTC (permalink / raw)
  To: Sverdlin, Alexander
  Cc: jingoohan1@gmail.com, tomi.valkeinen@ti.com, lee@kernel.org,
	luca.ceresoli@bootlin.com, tony@atomide.com, pavel@ucw.cz,
	deller@gmx.de, jjhiblot@ti.com, linux-fbdev@vger.kernel.org,
	thomas.petazzoni@bootlin.com, saravanak@google.com,
	herve.codina@bootlin.com, dri-devel@lists.freedesktop.org,
	alexander.sverdlin@gmail.com, linux-kernel@vger.kernel.org,
	daniel.thompson@linaro.org
In-Reply-To: <6e6039c815c7125e35b43ca2f8d32a0fa3103fea.camel@siemens.com>

On Thu, Oct 23, 2025 at 12:41:30PM +0000, Sverdlin, Alexander wrote:
> Hi Lee, Daniel, Jingoo,
>
> On Mon, 2025-05-19 at 22:19 +0200, Luca Ceresoli wrote:
> > led-backlight is a consumer of one or multiple LED class devices, but
> > devlink is currently unable to create correct supplier-producer links when
> > the supplier is a class device. It creates instead a link where the
> > supplier is the parent of the expected device.
> > <snip>
> > Fixes: ae232e45acf9 ("backlight: add led-backlight driver")
> > Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > Reviewed-by: Herve Codina <herve.codina@bootlin.com>
>
> I've noticed that the patch in archived in the patchwork [1] but I wasn't
> able to find it in any branch of the backlight tree [2].
>
> Could it be that the patch somehow slipped through?
> It does solve a real-world crash, could you please consider to apply it?

Sorry folks. I overlooked this in my backlog and never posted the R-b
(which helps Lee figure out what to hoover up).

Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>


Daniel.

^ permalink raw reply

* Re: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
From: kernel test robot @ 2025-10-29 15:46 UTC (permalink / raw)
  To: Cristian Del Gobbo, sudip.mukherjee
  Cc: oe-kbuild-all, teddy.wang, gregkh, linux-fbdev, linux-staging,
	linux-kernel, Cristian Del Gobbo, Dan Carpenter
In-Reply-To: <20251029022002.5812-1-cristiandelgobbo87@gmail.com>

Hi Cristian,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Del-Gobbo/staging-sm750fb-style-fixes-align-call-and-split-chained-assignment/20251029-102311
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20251029022002.5812-1-cristiandelgobbo87%40gmail.com
patch subject: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
config: sparc-randconfig-001-20251029 (https://download.01.org/0day-ci/archive/20251029/202510292220.5YKTkjfH-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251029/202510292220.5YKTkjfH-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510292220.5YKTkjfH-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/staging/sm750fb/sm750.c: In function 'lynxfb_ops_setcolreg':
   drivers/staging/sm750fb/sm750.c:541:3: error: expected expression before 'int'
      int y = (red * 77 + green * 151 + blue * 28) >> 8;
      ^~~
   drivers/staging/sm750fb/sm750.c:540:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (info->var.grayscale)
     ^~
   drivers/staging/sm750fb/sm750.c:543:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
      red = y;
      ^~~
>> drivers/staging/sm750fb/sm750.c:543:9: error: 'y' undeclared (first use in this function)
      red = y;
            ^
   drivers/staging/sm750fb/sm750.c:543:9: note: each undeclared identifier is reported only once for each function it appears in


vim +/y +543 drivers/staging/sm750fb/sm750.c

   517	
   518	static int lynxfb_ops_setcolreg(unsigned int regno,
   519					unsigned int red,
   520					unsigned int green,
   521					unsigned int blue,
   522					unsigned int transp,
   523					struct fb_info *info)
   524	{
   525		struct lynxfb_par *par;
   526		struct lynxfb_crtc *crtc;
   527		struct fb_var_screeninfo *var;
   528		int ret;
   529	
   530		par = info->par;
   531		crtc = &par->crtc;
   532		var = &info->var;
   533		ret = 0;
   534	
   535		if (regno > 256) {
   536			pr_err("regno = %d\n", regno);
   537			return -EINVAL;
   538		}
   539	
   540		if (info->var.grayscale)
   541			int y = (red * 77 + green * 151 + blue * 28) >> 8;
   542	
 > 543			red = y;
   544			green = y;
   545			blue = y;
   546	
   547		if (var->bits_per_pixel == 8 &&
   548		    info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
   549			red >>= 8;
   550			green >>= 8;
   551			blue >>= 8;
   552			ret = hw_sm750_set_col_reg(crtc, regno, red, green, blue);
   553			goto exit;
   554		}
   555	
   556		if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 256) {
   557			u32 val;
   558	
   559			if (var->bits_per_pixel == 16 ||
   560			    var->bits_per_pixel == 32 ||
   561			    var->bits_per_pixel == 24) {
   562				val = chan_to_field(red, &var->red);
   563				val |= chan_to_field(green, &var->green);
   564				val |= chan_to_field(blue, &var->blue);
   565				par->pseudo_palette[regno] = val;
   566				goto exit;
   567			}
   568		}
   569	
   570		ret = -EINVAL;
   571	
   572	exit:
   573		return ret;
   574	}
   575	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* Re: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
From: kernel test robot @ 2025-10-29 12:49 UTC (permalink / raw)
  To: Cristian Del Gobbo, sudip.mukherjee
  Cc: llvm, oe-kbuild-all, teddy.wang, gregkh, linux-fbdev,
	linux-staging, linux-kernel, Cristian Del Gobbo, Dan Carpenter
In-Reply-To: <20251029022002.5812-1-cristiandelgobbo87@gmail.com>

Hi Cristian,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Cristian-Del-Gobbo/staging-sm750fb-style-fixes-align-call-and-split-chained-assignment/20251029-102311
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20251029022002.5812-1-cristiandelgobbo87%40gmail.com
patch subject: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
config: powerpc64-randconfig-002-20251029 (https://download.01.org/0day-ci/archive/20251029/202510292010.GP8WnOne-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d1c086e82af239b245fe8d7832f2753436634990)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251029/202510292010.GP8WnOne-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510292010.GP8WnOne-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/staging/sm750fb/sm750.c:541:3: error: expected expression
     541 |                 int y = (red * 77 + green * 151 + blue * 28) >> 8;
         |                 ^
   drivers/staging/sm750fb/sm750.c:543:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
     543 |                 red = y;
         |                 ^
   drivers/staging/sm750fb/sm750.c:540:2: note: previous statement is here
     540 |         if (info->var.grayscale)
         |         ^
>> drivers/staging/sm750fb/sm750.c:543:9: error: use of undeclared identifier 'y'
     543 |                 red = y;
         |                       ^
   drivers/staging/sm750fb/sm750.c:544:11: error: use of undeclared identifier 'y'
     544 |                 green = y;
         |                         ^
   drivers/staging/sm750fb/sm750.c:545:10: error: use of undeclared identifier 'y'
     545 |                 blue = y;
         |                        ^
   1 warning and 4 errors generated.


vim +/y +543 drivers/staging/sm750fb/sm750.c

   517	
   518	static int lynxfb_ops_setcolreg(unsigned int regno,
   519					unsigned int red,
   520					unsigned int green,
   521					unsigned int blue,
   522					unsigned int transp,
   523					struct fb_info *info)
   524	{
   525		struct lynxfb_par *par;
   526		struct lynxfb_crtc *crtc;
   527		struct fb_var_screeninfo *var;
   528		int ret;
   529	
   530		par = info->par;
   531		crtc = &par->crtc;
   532		var = &info->var;
   533		ret = 0;
   534	
   535		if (regno > 256) {
   536			pr_err("regno = %d\n", regno);
   537			return -EINVAL;
   538		}
   539	
   540		if (info->var.grayscale)
   541			int y = (red * 77 + green * 151 + blue * 28) >> 8;
   542	
 > 543			red = y;
   544			green = y;
   545			blue = y;
   546	
   547		if (var->bits_per_pixel == 8 &&
   548		    info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
   549			red >>= 8;
   550			green >>= 8;
   551			blue >>= 8;
   552			ret = hw_sm750_set_col_reg(crtc, regno, red, green, blue);
   553			goto exit;
   554		}
   555	
   556		if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 256) {
   557			u32 val;
   558	
   559			if (var->bits_per_pixel == 16 ||
   560			    var->bits_per_pixel == 32 ||
   561			    var->bits_per_pixel == 24) {
   562				val = chan_to_field(red, &var->red);
   563				val |= chan_to_field(green, &var->green);
   564				val |= chan_to_field(blue, &var->blue);
   565				par->pseudo_palette[regno] = val;
   566				goto exit;
   567			}
   568		}
   569	
   570		ret = -EINVAL;
   571	
   572	exit:
   573		return ret;
   574	}
   575	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* Re: [PATCH 2/2] backlight: aw99706: Add support for Awinic AW99706 backlight
From: Junjie Cao @ 2025-10-29 11:49 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: Lee Jones, Jingoo Han, Pavel Machek, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Helge Deller, dri-devel,
	linux-leds, devicetree, linux-kernel, linux-fbdev, Pengyu Luo
In-Reply-To: <aQDDjzl65dMZEnwM@aspen.lan>

On Tue, Oct 28, 2025 at 9:21 PM Daniel Thompson <danielt@kernel.org> wrote:
>
> On Sun, Oct 26, 2025 at 08:39:23PM +0800, Junjie Cao wrote:
> > Add support for Awinic AW99706 backlight, which can be found in
> > tablet and notebook backlight, one case is the Lenovo Legion Y700
> > Gen4. This driver refers to the official datasheets and android
> > driver, they can be found in [1].
> >
> > [1] https://www.awinic.com/en/productDetail/AW99706QNR
> >
> > Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
> > Signed-off-by: Junjie Cao <caojunjie650@gmail.com>
> > ---
> > diff --git a/drivers/video/backlight/aw99706.c b/drivers/video/backlight/aw99706.c
> > new file mode 100644
> > index 000000000..8dafdea45
> > --- /dev/null
> > +++ b/drivers/video/backlight/aw99706.c
> > @@ -0,0 +1,503 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * aw99706 - Backlight driver for the AWINIC AW99706
> > + *
> > + * Copyright (C) 2025 Junjie Cao <caojunjie650@gmail.com>
> > + * Copyright (C) 2025 Pengyu Luo <mitltlatltl@gmail.com>
> > + *
> > + * Based on vendor driver:
> > + * Copyright (c) 2023 AWINIC Technology CO., LTD
> > + */
> > +
> > +#include <linux/backlight.h>
> > +#include <linux/bitfield.h>
> > +#include <linux/delay.h>
> > +#include <linux/gpio.h>
> > +#include <linux/i2c.h>
> > +#include <linux/kernel.h>
> > +#include <linux/module.h>
> > +#include <linux/regmap.h>
> > +
> > +#define AW99706_MAX_BRT_LVL          4095
> > +#define AW99706_REG_MAX                      0x1F
> > +#define AW99706_ID                   0x07
> > +
> > +/* registers list */
> > +#define AW99706_CFG0_REG                     0x00
> > +#define AW99706_DIM_MODE_MASK                        GENMASK(1, 0)
> > +
> > +#define AW99706_CFG1_REG                     0x01
> > +#define AW99706_SW_FREQ_MASK                 GENMASK(3, 0)
> > +#define AW99706_SW_ILMT_MASK                 GENMASK(5, 4)
> > +
> > +#define AW99706_CFG2_REG                     0x02
> > +#define AW99706_ILED_MAX_MASK                        GENMASK(6, 0)
> > +#define AW99706_UVLOSEL_MASK                 BIT(7)
> > +
> > +#define AW99706_CFG3_REG                     0x03
> > +#define AW99706_CFG4_REG                     0x04
> > +#define AW99706_BRT_MSB_MASK                 GENMASK(3, 0)
> > +
> > +#define AW99706_CFG5_REG                     0x05
> > +#define AW99706_BRT_LSB_MASK                 GENMASK(7, 0)
> > +
> > +#define AW99706_CFG6_REG                     0x06
> > +#define AW99706_FADE_TIME_MASK                       GENMASK(2, 0)
> > +#define AW99706_SLOPE_TIME_MASK                      GENMASK(5, 3)
> > +#define AW99706_RAMP_CTL_MASK                        GENMASK(7, 6)
> > +
> > +#define AW99706_CFG7_REG                     0x07
> > +#define AW99706_BRT_MODE_MASK                        GENMASK(1, 0)
> > +
> > +#define AW99706_CFG8_REG                     0x08
> > +#define AW99706_ONOFF_TIME_MASK                      GENMASK(2, 0)
> > +
> > +#define AW99706_CFG9_REG                     0x09
> > +#define AW99706_CFGA_REG                     0x0A
> > +#define AW99706_CFGB_REG                     0x0B
> > +#define AW99706_CFGC_REG                     0x0C
> > +#define AW99706_CFGD_REG                     0x0D
> > +#define AW99706_FLAG_REG                     0x10
> > +#define AW99706_BACKLIGHT_EN_MASK            BIT(7)
> > +
> > +#define AW99706_CHIPID_REG                   0x11
> > +#define AW99706_LED_OPEN_FLAG_REG            0x12
> > +#define AW99706_LED_SHORT_FLAG_REG           0x13
> > +#define AW99706_MTPLDOSEL_REG                        0x1E
> > +#define AW99706_MTPRUN_REG                   0x1F
> > +
> > +#define RESV 0
> > +
> > +/* Boost switching frequency table, in kHz */
> > +static const u32 aw99706_sw_freq_tbl[] = {
> > +     RESV, RESV, RESV, RESV, 300, 400, 500, 600,
> > +     660, 750, 850, 1000, 1200, 1330, 1500, 1700
> > +};
> > +
> > +/* Switching current limitation table, in mA */
> > +static const u32 aw99706_sw_ilmt_tbl[] = {
> > +     1500, 2000, 2500, 3000
> > +};
> > +
> > +/* ULVO threshold table, in mV */
> > +static const u32 aw99706_ulvo_thres_tbl[] = {
> > +     2200, 5000
> > +};
> > +
> > +/* Fade In/Out time table, in us */
> > +static const u32 aw99706_fade_time_tbl[] = {
> > +     8, 16, 32, 64, 128, 256, 512, 1024
> > +};
> > +
> > +/* Slope time table, in ms */
> > +static const u32 aw99706_slopetime_tbl[] = {
> > +     8, 24, 48, 96, 200, 300, 400, 500
> > +};
> > +
> > +/* Turn on/off time table, in ns */
> > +static const u32 aw99706_onoff_time_tbl[] = {
> > +     RESV, 250, 500, 1000, 2000, 4000, 8000, 16000
> > +};
> > +
> > +struct aw99706_device {
> > +     struct i2c_client *client;
> > +     struct device *dev;
> > +     struct regmap *regmap;
> > +     struct backlight_device *bl_dev;
> > +     struct gpio_desc *hwen_gpio;
> > +     bool bl_enable;
> > +};
> > +
> > +enum reg_access {
> > +     REG_NONE_ACCESS = 0,
> > +     REG_RD_ACCESS   = 1,
> > +     REG_WR_ACCESS   = 2,
> > +};
> > +
> > +struct aw99706_reg {
> > +     u8 defval;
> > +     u8 access;
> > +};
> > +
> > +const struct aw99706_reg aw99706_regs[AW99706_REG_MAX + 1] = {
> > +     [AW99706_CFG0_REG]              = {0x65, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG1_REG]              = {0x39, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG2_REG]              = {0x1e, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG3_REG]              = {0x04, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG4_REG]              = {0x00, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG5_REG]              = {0x00, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG6_REG]              = {0xa9, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG7_REG]              = {0x04, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG8_REG]              = {0x0c, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFG9_REG]              = {0x4b, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFGA_REG]              = {0x72, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFGB_REG]              = {0x01, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFGC_REG]              = {0x6c, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_CFGD_REG]              = {0xfe, REG_RD_ACCESS | REG_WR_ACCESS},
> > +     [AW99706_FLAG_REG]              = {0x00, REG_RD_ACCESS},
> > +     [AW99706_CHIPID_REG]            = {AW99706_ID, REG_RD_ACCESS},
> > +     [AW99706_LED_OPEN_FLAG_REG]     = {0x00, REG_RD_ACCESS},
> > +     [AW99706_LED_SHORT_FLAG_REG]    = {0x00, REG_RD_ACCESS},
> > +
> > +     /*
> > +      * Write bit is dropped here, writing BIT(0) to MTPLDOSEL will unlock
> > +      * Multi-time Programmable (MTP).
> > +      */
> > +     [AW99706_MTPLDOSEL_REG]         = {0x00, REG_RD_ACCESS},
> > +     [AW99706_MTPRUN_REG]            = {0x00, REG_NONE_ACCESS},
> > +};
> > +
> > +static bool aw99706_readable_reg(struct device *dev, unsigned int reg)
> > +{
> > +     return aw99706_regs[reg].access & REG_RD_ACCESS;
> > +}
> > +
> > +static bool aw99706_writeable_reg(struct device *dev, unsigned int reg)
> > +{
> > +     return aw99706_regs[reg].access & REG_WR_ACCESS;
> > +}
> > +
> > +static inline int aw99706_i2c_read(struct aw99706_device *aw, u8 reg,
> > +                                unsigned int *val)
> > +{
> > +     return regmap_read(aw->regmap, reg, val);
> > +}
> > +
> > +static inline int aw99706_i2c_write(struct aw99706_device *aw, u8 reg, u8 val)
> > +{
> > +     return regmap_write(aw->regmap, reg, val);
> > +}
> > +
> > +static inline int aw99706_i2c_update_bits(struct aw99706_device *aw, u8 reg,
> > +                                       u8 mask, u8 val)
> > +{
> > +     return regmap_update_bits(aw->regmap, reg, mask, val);
> > +}
> > +
> > +struct aw99706_dt_prop {
> > +     const char * const name;
> > +     const u32 * const lookup_tbl;
> > +     u8 tbl_size;
> > +     u8 reg;
> > +     u8 mask;
> > +     u8 val;
> > +     u32 raw_val;
> > +};
> > +
> > +static struct aw99706_dt_prop aw99706_dt_props[] = {
> > +     {
> > +             "awinic,dim-mode", NULL,
> > +             0,
> > +             AW99706_CFG0_REG, AW99706_DIM_MODE_MASK
> > +     },
> > +     {
> > +             "awinic,sw-freq", aw99706_sw_freq_tbl,
> > +             ARRAY_SIZE(aw99706_sw_freq_tbl),
> > +             AW99706_CFG1_REG, AW99706_SW_FREQ_MASK
> > +     },
> > +     {
> > +             "awinic,sw-ilmt", aw99706_sw_ilmt_tbl,
> > +             ARRAY_SIZE(aw99706_sw_ilmt_tbl),
> > +             AW99706_CFG1_REG, AW99706_SW_ILMT_MASK
> > +     },
> > +     {
> > +             "awinic,iled-max", NULL,
> > +             0,
> > +             AW99706_CFG2_REG, AW99706_ILED_MAX_MASK
> > +
> > +     },
> > +     {
> > +             "awinic,uvlo-thres", aw99706_ulvo_thres_tbl,
> > +             ARRAY_SIZE(aw99706_ulvo_thres_tbl),
> > +             AW99706_CFG2_REG, AW99706_UVLOSEL_MASK
> > +     },
> > +     {
> > +             "awinic,fade-time", aw99706_fade_time_tbl,
> > +             ARRAY_SIZE(aw99706_fade_time_tbl),
> > +             AW99706_CFG6_REG, AW99706_FADE_TIME_MASK
> > +     },
> > +     {
> > +             "awinic,slope-time", aw99706_slopetime_tbl,
> > +             ARRAY_SIZE(aw99706_slopetime_tbl),
> > +             AW99706_CFG6_REG, AW99706_SLOPE_TIME_MASK
> > +     },
> > +     {
> > +             "awinic,ramp-ctl", NULL,
> > +             0,
> > +             AW99706_CFG6_REG, AW99706_RAMP_CTL_MASK
> > +     },
> > +     {
> > +             "awinic,brt-mode", NULL,
> > +             0,
> > +             AW99706_CFG7_REG, AW99706_BRT_MODE_MASK
> > +     },
> > +     {
> > +             "awinic,onoff-time", aw99706_onoff_time_tbl,
> > +             ARRAY_SIZE(aw99706_onoff_time_tbl),
> > +             AW99706_CFG8_REG, AW99706_ONOFF_TIME_MASK
> > +     },
> > +};
> > +
> > +static int aw99706_lookup(const u32 * const tbl, int size, u32 val)
> > +{
> > +     int i;
> > +
> > +     for (i = 0; i < size; i++)
> > +             if (tbl[i] == val)
> > +                     return i;
> > +
> > +     return -1;
> > +}
> > +
> > +static inline void aw99706_prop_set_default(struct aw99706_dt_prop *prop)
> > +{
> > +     prop->val = prop->mask & aw99706_regs[prop->reg].defval;
>
> Why included the default value in the register descriptions?
>
> defval is only used to provide values for missing DT properties so using
> the raw register values is cryptic and hard to read.
>
> Including a default value in the aw99706_dt_props table instead would be
> much more readable (because the defaults could use the same units at the
> device tree).
>

Agree, I will include the default values in the aw99706_dt_props table.

>
> > +}
> > +
> > +static void aw99706_dt_property_convert(struct aw99706_dt_prop *prop)
> > +{
> > +     unsigned int val, shift;
> > +
> > +     if (prop->lookup_tbl) {
> > +             val = aw99706_lookup(prop->lookup_tbl, prop->tbl_size,
> > +                                  prop->raw_val);
> > +             if (val < 0) {
> > +                     aw99706_prop_set_default(prop);
>
> This should not happen silently.
>
> If the DT has provided an invalid value then we be issuing *at minimum*
> a message at warning level or above. Many drivers will simply refuse to
> probe when the DT is broken.
>

Indeed, I missed it.

>
> > +                     return;
> > +             }
> > +
> > +     } else {
> > +             val = prop->raw_val;
> > +     }
> > +
> > +     shift = ffs(prop->mask) - 1;
> > +     val <<= shift;
> > +     prop->val = prop->mask & val;
> > +}
> > +
> > +static void aw99706_dt_parse(struct aw99706_device *aw)
> > +{
> > +     struct aw99706_dt_prop *prop;
> > +     int ret, i;
> > +
> > +     for (i = 0; i < ARRAY_SIZE(aw99706_dt_props); i++) {
> > +             prop = &aw99706_dt_props[i];
> > +             ret = device_property_read_u32(aw->dev, prop->name,
> > +                                            &prop->raw_val);
> > +             if (ret < 0) {
> > +                     dev_warn(aw->dev, "Missing property %s: %d\n",
> > +                              prop->name, ret);
>
> Why is there a warning when an optional property is not present. A DT
> not including an optional property needs no message at all.
>

They are mandatory in the downstream, and providing all properties is
difficult sometimes, so I set a default value if one is missing. But
one device may use a configuration different from the component
vendor's. These default values may be not optimal, so I issue a
warning for property missing. (I forgot to address it)

>
> > +
> > +                     aw99706_prop_set_default(prop);
> > +             } else {
> > +                     aw99706_dt_property_convert(prop);
> > +             }
> > +     }
> > +
> > +     /* This property requires a long linear array, using formula for now */
> > +     aw99706_dt_props[3].val = (aw99706_dt_props[3].raw_val - 5000) / 500;
>
> Using a formula is fine, but I don't like doing it retrospectively.
> Hard coding the 3 makes maintenance difficult and we end up making the
> whole of aw99706_dt_props writeable just so we can store raw_val once!
>
> Much better, IMHO, to embed a function pointer into the table and make
> the whole table const. The function pointer can be
> aw99706_dt_property_convert() in most cases (although rename it
> `aw99706_dt_property_lookup_from_table() ) and can implement any
> formula you need.
>

Helpful opinion. I will do this in next version.

>
> > +}
> > +
> > +static int aw99706_hw_init(struct aw99706_device *aw)
> > +{
> > +     int ret, i;
> > +
> > +     gpiod_set_value_cansleep(aw->hwen_gpio, 1);
> > +
> > +     for (i = 0; i < ARRAY_SIZE(aw99706_dt_props); i++) {
> > +             ret = aw99706_i2c_update_bits(aw, aw99706_dt_props[i].reg,
> > +                                           aw99706_dt_props[i].mask,
> > +                                           aw99706_dt_props[i].val);
> > +             if (ret < 0) {
> > +                     dev_err(aw->dev, "Failed to write init data %d\n", ret);
> > +                     return ret;
> > +             }
> > +     }
> > +
> > +     return 0;
> > +}
> > +
> > +static int aw99706_bl_enable(struct aw99706_device *aw, bool en)
> > +{
> > +     int ret;
> > +     u8 val;
> > +
> > +     FIELD_MODIFY(AW99706_BACKLIGHT_EN_MASK, &val, en);
> > +     ret = aw99706_i2c_update_bits(aw, AW99706_CFGD_REG,
> > +                                   AW99706_BACKLIGHT_EN_MASK, val);
> > +     if (ret)
> > +             dev_err(aw->dev, "Failed to enable backlight!\n");
> > +
> > +     return ret;
> > +}
> > +
> > +static int aw99706_backlight_switch(struct aw99706_device *aw, u32 brt_lvl)
> > +{
> > +     bool bl_enable_now = !!brt_lvl;
> > +     int ret = 0;
> > +
> > +     if (aw->bl_enable != bl_enable_now) {
> > +             aw->bl_enable = bl_enable_now;
> > +             ret = aw99706_bl_enable(aw, bl_enable_now);
> > +     }
> > +
> > +     return ret;
> > +}
> > +
> > +static int aw99706_update_brightness(struct aw99706_device *aw, u32 brt_lvl)
> > +{
> > +     int ret;
> > +
> > +     ret = aw99706_i2c_write(aw, AW99706_CFG4_REG,
> > +                             (brt_lvl >> 8) & AW99706_BRT_MSB_MASK);
> > +     if (ret < 0)
> > +             return ret;
> > +
> > +     ret = aw99706_i2c_write(aw, AW99706_CFG5_REG,
> > +                             brt_lvl & AW99706_BRT_LSB_MASK);
> > +     if (ret < 0)
> > +             return ret;
> > +
> > +     return aw99706_backlight_switch(aw, brt_lvl);
>
> I'm not sure there is much benefit pushing this out into a seperate
> function. Merge this inline.
>
> > +}
>

I see.

Regards,
Junjie

^ permalink raw reply

* Re: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
From: Greg KH @ 2025-10-29 10:16 UTC (permalink / raw)
  To: Cristian Del Gobbo
  Cc: sudip.mukherjee, teddy.wang, linux-fbdev, linux-staging,
	linux-kernel, Dan Carpenter
In-Reply-To: <20251029021449.5420-1-cristiandelgobbo87@gmail.com>

On Wed, Oct 29, 2025 at 03:14:49AM +0100, Cristian Del Gobbo wrote:
> - Drop previous change that made g_fbmode[] elements const (broke build).
> - Align the continued arguments of sm750_hw_cursor_set_size() with the
>   opening parenthesis.
> - Replace a chained assignment of red/green/blue with a temporary
>   variable to satisfy checkpatch and improve readability.
> 
> No functional change intended.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
> ---
>  drivers/staging/sm750fb/sm750.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

On top of what Dan said, I see 4 different copies of this patch in my
inbox, which one is the correct one?  Please make it easy for
maintainers to know what patch to review, we get 1000+ emails a day to
deal with and have no short term memory :)

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
From: Dan Carpenter @ 2025-10-29  5:29 UTC (permalink / raw)
  To: Cristian Del Gobbo
  Cc: sudip.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
	linux-kernel
In-Reply-To: <20251029022123.5829-1-cristiandelgobbo87@gmail.com>

This patch was really confusing because I had no idea what I reported.
Just remove my reported by tag...

This is not a v2 patch, it's a whole new patch.  Don't call it a v2.

On Wed, Oct 29, 2025 at 03:21:23AM +0100, Cristian Del Gobbo wrote:
> - Drop previous change that made g_fbmode[] elements const (broke build).

But if it were a v2, this isn't the right way to send a v2.  In a v2 this
would go under the --- cut off line.

https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

> - Align the continued arguments of sm750_hw_cursor_set_size() with the
>   opening parenthesis.
> - Replace a chained assignment of red/green/blue with a temporary
>   variable to satisfy checkpatch and improve readability.

These are unrelated changes.  Do them as separate patches.

> 
> No functional change intended.
> 
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> 
> Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>

Also run your patch through checkpatch.pl.

> ---
>  drivers/staging/sm750fb/sm750.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 3659af7e519d..94a99af4320e 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -121,8 +121,8 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
>  	sm750_hw_cursor_disable(cursor);
>  	if (fbcursor->set & FB_CUR_SETSIZE)
>  		sm750_hw_cursor_set_size(cursor,
> -					fbcursor->image.width,
> -					fbcursor->image.height);
> +					 fbcursor->image.width,
> +					 fbcursor->image.height);
>  
>  	if (fbcursor->set & FB_CUR_SETPOS)
>  		sm750_hw_cursor_set_pos(cursor,
> @@ -538,7 +538,11 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
>  	}
>  
>  	if (info->var.grayscale)
> -		red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
> +		int y = (red * 77 + green * 151 + blue * 28) >> 8;

y is a strange variable name.  It has nothing to do with the y axis.

regards,
dan carpenter



^ permalink raw reply

* [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
From: Cristian Del Gobbo @ 2025-10-29  2:21 UTC (permalink / raw)
  To: sudip.mukherjee
  Cc: teddy.wang, gregkh, linux-fbdev, linux-staging, linux-kernel,
	Cristian Del Gobbo, Dan Carpenter

- Drop previous change that made g_fbmode[] elements const (broke build).
- Align the continued arguments of sm750_hw_cursor_set_size() with the
  opening parenthesis.
- Replace a chained assignment of red/green/blue with a temporary
  variable to satisfy checkpatch and improve readability.

No functional change intended.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>

Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 3659af7e519d..94a99af4320e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -121,8 +121,8 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
 	sm750_hw_cursor_disable(cursor);
 	if (fbcursor->set & FB_CUR_SETSIZE)
 		sm750_hw_cursor_set_size(cursor,
-					fbcursor->image.width,
-					fbcursor->image.height);
+					 fbcursor->image.width,
+					 fbcursor->image.height);
 
 	if (fbcursor->set & FB_CUR_SETPOS)
 		sm750_hw_cursor_set_pos(cursor,
@@ -538,7 +538,11 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
 	}
 
 	if (info->var.grayscale)
-		red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+		int y = (red * 77 + green * 151 + blue * 28) >> 8;
+
+		red = y;
+		green = y;
+		blue = y;
 
 	if (var->bits_per_pixel == 8 &&
 	    info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
-- 
2.34.1


^ permalink raw reply related

* [PATCH v2] staging: sm750fb: style fixes: align call and split chained assignment
From: Cristian Del Gobbo @ 2025-10-29  2:20 UTC (permalink / raw)
  To: sudip.mukherjee
  Cc: teddy.wang, gregkh, linux-fbdev, linux-staging, linux-kernel,
	Cristian Del Gobbo, Dan Carpenter

- Drop previous change that made g_fbmode[] elements const (broke build).
- Align the continued arguments of sm750_hw_cursor_set_size() with the
  opening parenthesis.
- Replace a chained assignment of red/green/blue with a temporary
  variable to satisfy checkpatch and improve readability.

No functional change intended.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

Signed-off-by: Cristian Del Gobbo <cristiandelgobbo87@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 3659af7e519d..94a99af4320e 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -121,8 +121,8 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
 	sm750_hw_cursor_disable(cursor);
 	if (fbcursor->set & FB_CUR_SETSIZE)
 		sm750_hw_cursor_set_size(cursor,
-					fbcursor->image.width,
-					fbcursor->image.height);
+					 fbcursor->image.width,
+					 fbcursor->image.height);
 
 	if (fbcursor->set & FB_CUR_SETPOS)
 		sm750_hw_cursor_set_pos(cursor,
@@ -538,7 +538,11 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
 	}
 
 	if (info->var.grayscale)
-		red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+		int y = (red * 77 + green * 151 + blue * 28) >> 8;
+
+		red = y;
+		green = y;
+		blue = y;
 
 	if (var->bits_per_pixel == 8 &&
 	    info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
-- 
2.34.1


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox