Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: sm750fb: add const to g_fbmode array
@ 2026-05-06  3:56 Chaitanya Sabnis
  2026-05-06  6:27 ` Ahmet Sezgin Duran
  2026-05-11 20:42 ` kernel test robot
  0 siblings, 2 replies; 19+ messages in thread
From: Chaitanya Sabnis @ 2026-05-06  3:56 UTC (permalink / raw)
  To: sudipm.mukherjee, teddy.wang, gregkh
  Cc: linux-fbdev, linux-staging, linux-kernel, Chaitanya Sabnis

Fix a checkpatch warning by changing the `g_fbmode` array of
pointers to be `static const char * const`. This ensures that both
the strings and the array of pointers are placed in read-only memory,
preventing unintended modifications and improving security.

Signed-off-by: Chaitanya Sabnis <chaitanya.msabnis@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index dec1f6b88a7d..08d4979c6755 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-06  3:56 [PATCH] staging: sm750fb: add " Chaitanya Sabnis
@ 2026-05-06  6:27 ` Ahmet Sezgin Duran
  2026-05-06  7:14   ` Chaitanya Sabnis
  2026-05-11 20:42 ` kernel test robot
  1 sibling, 1 reply; 19+ messages in thread
From: Ahmet Sezgin Duran @ 2026-05-06  6:27 UTC (permalink / raw)
  To: Chaitanya Sabnis, sudipm.mukherjee, teddy.wang, gregkh
  Cc: linux-fbdev, linux-staging, linux-kernel

On 5/6/26 6:56 AM, Chaitanya Sabnis wrote:
> Fix a checkpatch warning by changing the `g_fbmode` array of
> pointers to be `static const char * const`. This ensures that both
> the strings and the array of pointers are placed in read-only memory,
> preventing unintended modifications and improving security.
> 
> Signed-off-by: Chaitanya Sabnis <chaitanya.msabnis@gmail.com>
> ---
>   drivers/staging/sm750fb/sm750.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index dec1f6b88a7d..08d4979c6755 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -33,7 +33,7 @@
>   static int g_hwcursor = 1;
>   static int g_noaccel;
>   static int g_nomtrr;
> -static const char *g_fbmode[] = {NULL, NULL};
> +static const char * const g_fbmode[] = {NULL, NULL};
>   static const char *g_def_fbmode = "1024x768-32@60";
>   static char *g_settings;
>   static int g_dualview;

Did you compile these changes?

Regards,
Ahmet Sezgin Duran

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-06  6:27 ` Ahmet Sezgin Duran
@ 2026-05-06  7:14   ` Chaitanya Sabnis
  2026-05-06 10:36     ` Ahmet Sezgin Duran
  0 siblings, 1 reply; 19+ messages in thread
From: Chaitanya Sabnis @ 2026-05-06  7:14 UTC (permalink / raw)
  To: Ahmet Sezgin Duran
  Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
	linux-kernel

On Wed, May 6, 2026 at 11:57 AM Ahmet Sezgin Duran ahmet@sezginduran.net wrote:

Did you compile these changes?

Yes, I have verified the changes by compiling the driver with: make
M=drivers/staging/sm750fb/

The build completed successfully without errors.

Regards,
Chaitanya

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-06  7:14   ` Chaitanya Sabnis
@ 2026-05-06 10:36     ` Ahmet Sezgin Duran
  2026-05-06 10:44       ` Chaitanya Sabnis
  0 siblings, 1 reply; 19+ messages in thread
From: Ahmet Sezgin Duran @ 2026-05-06 10:36 UTC (permalink / raw)
  To: Chaitanya Sabnis
  Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
	linux-kernel

On 5/6/26 10:14 AM, Chaitanya Sabnis wrote:
> On Wed, May 6, 2026 at 11:57 AM Ahmet Sezgin Duran ahmet@sezginduran.net wrote:
> 
> Did you compile these changes?
> 
> Yes, I have verified the changes by compiling the driver with: make
> M=drivers/staging/sm750fb/
> 
> The build completed successfully without errors.
> 
> Regards,
> Chaitanya

Are you sure that you had enabled the module? When I apply and try to 
compile your patch, I get these errors:

 >
 >   CC [M]  drivers/staging/sm750fb/sm750.o
 > drivers/staging/sm750fb/sm750.c: In function ‘lynxfb_set_fbinfo’:
 > drivers/staging/sm750fb/sm750.c:785:33: error: assignment of 
read-only location ‘g_fbmode[index]’
 >   785 |                 g_fbmode[index] = g_def_fbmode;
 >       |                                 ^
 > drivers/staging/sm750fb/sm750.c:787:41: error: assignment of 
read-only location ‘g_fbmode[index]’
 >   787 |                         g_fbmode[index] = g_fbmode[0];
 >       |                                         ^
 > drivers/staging/sm750fb/sm750.c: In function ‘sm750fb_setup’:
 > drivers/staging/sm750fb/sm750.c:896:45: error: assignment of 
read-only location ‘g_fbmode[0]’
 >   896 |                                 g_fbmode[0] = opt;
 >       |                                             ^
 > drivers/staging/sm750fb/sm750.c:900:45: error: assignment of 
read-only location ‘g_fbmode[1]’
 >   900 |                                 g_fbmode[1] = opt;
 >       |                                             ^

Regards,
Ahmet Sezgin Duran

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-06 10:36     ` Ahmet Sezgin Duran
@ 2026-05-06 10:44       ` Chaitanya Sabnis
  0 siblings, 0 replies; 19+ messages in thread
From: Chaitanya Sabnis @ 2026-05-06 10:44 UTC (permalink / raw)
  To: Ahmet Sezgin Duran
  Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
	linux-kernel

On Wed, May 6, 2026 Ahmet Sezgin Duran wrote:

Are you sure that you had enabled the module? When I apply and try to
compile your patch, I get these errors:

Hi Ahmet,

You are completely right, and I apologize. I fell into the trap of
running make M=drivers/staging/sm750fb/ without verifying that
CONFIG_FB_SM750 was actually enabled in my .config first. My local
build silently skipped the compilation, which led me to falsely
believe the syntax was valid.

Looking at the errors you provided, it is clear that g_fbmode is
dynamically assigned during module setup (lines 896, 900), meaning the
checkpatch suggestion to make it const conflicts with the driver's
logic.

Please drop this patch. I will ensure my .config is properly set to
build the specific modules I am touching before submitting in the
future.

Thank you for catching this and for your time reviewing it.

Regards,
Chaitanya

On Wed, May 6, 2026 at 4:06 PM Ahmet Sezgin Duran <ahmet@sezginduran.net> wrote:
>
> On 5/6/26 10:14 AM, Chaitanya Sabnis wrote:
> > On Wed, May 6, 2026 at 11:57 AM Ahmet Sezgin Duran ahmet@sezginduran.net wrote:
> >
> > Did you compile these changes?
> >
> > Yes, I have verified the changes by compiling the driver with: make
> > M=drivers/staging/sm750fb/
> >
> > The build completed successfully without errors.
> >
> > Regards,
> > Chaitanya
>
> Are you sure that you had enabled the module? When I apply and try to
> compile your patch, I get these errors:
>
>  >
>  >   CC [M]  drivers/staging/sm750fb/sm750.o
>  > drivers/staging/sm750fb/sm750.c: In function ‘lynxfb_set_fbinfo’:
>  > drivers/staging/sm750fb/sm750.c:785:33: error: assignment of
> read-only location ‘g_fbmode[index]’
>  >   785 |                 g_fbmode[index] = g_def_fbmode;
>  >       |                                 ^
>  > drivers/staging/sm750fb/sm750.c:787:41: error: assignment of
> read-only location ‘g_fbmode[index]’
>  >   787 |                         g_fbmode[index] = g_fbmode[0];
>  >       |                                         ^
>  > drivers/staging/sm750fb/sm750.c: In function ‘sm750fb_setup’:
>  > drivers/staging/sm750fb/sm750.c:896:45: error: assignment of
> read-only location ‘g_fbmode[0]’
>  >   896 |                                 g_fbmode[0] = opt;
>  >       |                                             ^
>  > drivers/staging/sm750fb/sm750.c:900:45: error: assignment of
> read-only location ‘g_fbmode[1]’
>  >   900 |                                 g_fbmode[1] = opt;
>  >       |                                             ^
>
> Regards,
> Ahmet Sezgin Duran

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH] staging: sm750fb: Add const to g_fbmode array
@ 2026-05-09 16:40 Alone
  2026-05-11  7:57 ` Greg Kroah-Hartman
  2026-05-11 15:37 ` kernel test robot
  0 siblings, 2 replies; 19+ messages in thread
From: Alone @ 2026-05-09 16:40 UTC (permalink / raw)
  To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: linux-fbdev, linux-staging, linux-kernel, Chhabilal Dangal

From: Chhabilal Dangal <yogeshdangal66@gmail.com>

Add const qualifier to g_fbmode array since the array
itself is not modified after initialization.

Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e..19c3da654 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview;
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
  2026-05-09 16:40 Alone
@ 2026-05-11  7:57 ` Greg Kroah-Hartman
       [not found]   ` <CAF9nfaDEys+8bcnFRVWWoAvyrvPgXmENbASABG+4dBjMinaP5A@mail.gmail.com>
  2026-05-11 15:37 ` kernel test robot
  1 sibling, 1 reply; 19+ messages in thread
From: Greg Kroah-Hartman @ 2026-05-11  7:57 UTC (permalink / raw)
  To: Alone; +Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
	linux-kernel

On Sat, May 09, 2026 at 10:25:57PM +0545, Alone wrote:
> From: Chhabilal Dangal <yogeshdangal66@gmail.com>
> 
> Add const qualifier to g_fbmode array since the array
> itself is not modified after initialization.
> 
> Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
> ---
>  drivers/staging/sm750fb/sm750.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 9f3e3d37e..19c3da654 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -33,7 +33,7 @@
>  static int g_hwcursor = 1;
>  static int g_noaccel;
>  static int g_nomtrr;
> -static const char *g_fbmode[] = {NULL, NULL};
> +static const char * const g_fbmode[] = {NULL, NULL};
>  static const char *g_def_fbmode = "1024x768-32@60";
>  static char *g_settings;
>  static int g_dualview;
> -- 
> 2.54.0
> 
> 

Please always test-build your patches :(

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
       [not found]   ` <CAF9nfaDEys+8bcnFRVWWoAvyrvPgXmENbASABG+4dBjMinaP5A@mail.gmail.com>
@ 2026-05-11 10:23     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 19+ messages in thread
From: Greg Kroah-Hartman @ 2026-05-11 10:23 UTC (permalink / raw)
  To: Alone; +Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
	linux-kernel

On Mon, May 11, 2026 at 04:04:40PM +0545, Alone wrote:
> Thanks for the feedback. I verified the patch with:
> 
> make M=drivers/staging/sm750fb
> 
> and it builds successfully. I’ll make sure to compile-test patches before
> submission next time.

I don't think you actually built the file you modified.  Be sure the
correct config option is also enabled.  Try it yourself and see!

Also, please don't top-post or send html email, the mailing lists reject
that.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
@ 2026-05-11 10:52 Chhabilal Dangal
  0 siblings, 0 replies; 19+ messages in thread
From: Chhabilal Dangal @ 2026-05-11 10:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
	linux-kernel

Thanks for catching that! I've now properly configured the kernel:

CONFIG_FB_SM750=m
CONFIG_STAGING=y
CONFIG_FB=y

Ran: make oldconfig
Verified configuration with: cat .config | grep CONFIG_FB_SM750

The patch should compile with these settings enabled. The changes are
minimal (adding const to g_fbmode array) and don't require additional
setup beyond proper kernel configuration.

Thanks for the guidance!

Chhabilal Dangal

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
  2026-05-09 16:40 Alone
  2026-05-11  7:57 ` Greg Kroah-Hartman
@ 2026-05-11 15:37 ` kernel test robot
  1 sibling, 0 replies; 19+ messages in thread
From: kernel test robot @ 2026-05-11 15:37 UTC (permalink / raw)
  To: Alone, Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
  Cc: llvm, oe-kbuild-all, linux-fbdev, linux-staging, linux-kernel,
	Chhabilal Dangal

Hi Alone,

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/Alone/staging-sm750fb-Add-const-to-g_fbmode-array/20260511-155715
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260509164057.71722-1-yogeshdangal66%40gmail.com
patch subject: [PATCH] staging: sm750fb: Add const to g_fbmode array
config: arm64-randconfig-003-20260511 (https://download.01.org/0day-ci/archive/20260511/202605112333.ORNyLXKe-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260511/202605112333.ORNyLXKe-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/202605112333.ORNyLXKe-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/staging/sm750fb/sm750.c:785:19: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
     785 |                 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:787:20: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
     787 |                         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:896:17: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
     896 |                                 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:900:17: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
     900 |                                 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 +785 drivers/staging/sm750fb/sm750.c

81dee67e215b23f Sudip Mukherjee      2015-03-03  719  
81dee67e215b23f Sudip Mukherjee      2015-03-03  720  static int lynxfb_set_fbinfo(struct fb_info *info, int index)
81dee67e215b23f Sudip Mukherjee      2015-03-03  721  {
81dee67e215b23f Sudip Mukherjee      2015-03-03  722  	int i;
81dee67e215b23f Sudip Mukherjee      2015-03-03  723  	struct lynxfb_par *par;
e359b6a863e19f2 Mike Rapoport        2015-10-26  724  	struct sm750_dev *sm750_dev;
81dee67e215b23f Sudip Mukherjee      2015-03-03  725  	struct lynxfb_crtc *crtc;
81dee67e215b23f Sudip Mukherjee      2015-03-03  726  	struct lynxfb_output *output;
81dee67e215b23f Sudip Mukherjee      2015-03-03  727  	struct fb_var_screeninfo *var;
81dee67e215b23f Sudip Mukherjee      2015-03-03  728  	struct fb_fix_screeninfo *fix;
81dee67e215b23f Sudip Mukherjee      2015-03-03  729  
81dee67e215b23f Sudip Mukherjee      2015-03-03  730  	const struct fb_videomode *pdb[] = {
81dee67e215b23f Sudip Mukherjee      2015-03-03  731  		lynx750_ext, NULL, vesa_modes,
81dee67e215b23f Sudip Mukherjee      2015-03-03  732  	};
81dee67e215b23f Sudip Mukherjee      2015-03-03  733  	int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
d0856045f0e9fc9 Hungyu Lin           2026-04-01  734  	static const char * const fix_id[2] = {
81dee67e215b23f Sudip Mukherjee      2015-03-03  735  		"sm750_fb1", "sm750_fb2",
81dee67e215b23f Sudip Mukherjee      2015-03-03  736  	};
81dee67e215b23f Sudip Mukherjee      2015-03-03  737  
81dee67e215b23f Sudip Mukherjee      2015-03-03  738  	int ret, line_length;
81dee67e215b23f Sudip Mukherjee      2015-03-03  739  
81dee67e215b23f Sudip Mukherjee      2015-03-03  740  	ret = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  741  	par = (struct lynxfb_par *)info->par;
e359b6a863e19f2 Mike Rapoport        2015-10-26  742  	sm750_dev = par->dev;
81dee67e215b23f Sudip Mukherjee      2015-03-03  743  	crtc = &par->crtc;
81dee67e215b23f Sudip Mukherjee      2015-03-03  744  	output = &par->output;
81dee67e215b23f Sudip Mukherjee      2015-03-03  745  	var = &info->var;
81dee67e215b23f Sudip Mukherjee      2015-03-03  746  	fix = &info->fix;
81dee67e215b23f Sudip Mukherjee      2015-03-03  747  
81dee67e215b23f Sudip Mukherjee      2015-03-03  748  	/* set index */
81dee67e215b23f Sudip Mukherjee      2015-03-03  749  	par->index = index;
81dee67e215b23f Sudip Mukherjee      2015-03-03  750  	output->channel = &crtc->channel;
81dee67e215b23f Sudip Mukherjee      2015-03-03  751  	sm750fb_set_drv(par);
81dee67e215b23f Sudip Mukherjee      2015-03-03  752  
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  753  	/*
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  754  	 * set current cursor variable and proc pointer,
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  755  	 * must be set after crtc member initialized
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  756  	 */
fdc234d85210d91 Benjamin Philip      2021-07-28  757  	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
e359b6a863e19f2 Mike Rapoport        2015-10-26  758  	crtc->cursor.mmio = sm750_dev->pvReg +
e359b6a863e19f2 Mike Rapoport        2015-10-26  759  		0x800f0 + (int)crtc->channel * 0x140;
81dee67e215b23f Sudip Mukherjee      2015-03-03  760  
cd33da26036ea54 Christopher Carbone  2022-08-23  761  	crtc->cursor.max_h = 64;
cd33da26036ea54 Christopher Carbone  2022-08-23  762  	crtc->cursor.max_w = 64;
39f9137268ee3df Benjamin Philip      2021-07-26  763  	crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
e359b6a863e19f2 Mike Rapoport        2015-10-26  764  	crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
81dee67e215b23f Sudip Mukherjee      2015-03-03  765  
3de08a2d14ff8c7 Lorenzo Stoakes      2015-03-20  766  	memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
f7c8a046577e09d Thomas Zimmermann    2023-11-27  767  	if (!g_hwcursor)
52d0744d751d8f1 Arnd Bergmann        2016-11-09  768  		sm750_hw_cursor_disable(&crtc->cursor);
81dee67e215b23f Sudip Mukherjee      2015-03-03  769  
81dee67e215b23f Sudip Mukherjee      2015-03-03  770  	/* set info->fbops, must be set before fb_find_mode */
e359b6a863e19f2 Mike Rapoport        2015-10-26  771  	if (!sm750_dev->accel_off) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  772  		/* use 2d acceleration */
f7c8a046577e09d Thomas Zimmermann    2023-11-27  773  		if (!g_hwcursor)
f7c8a046577e09d Thomas Zimmermann    2023-11-27  774  			info->fbops = &lynxfb_ops_accel;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  775  		else
f7c8a046577e09d Thomas Zimmermann    2023-11-27  776  			info->fbops = &lynxfb_ops_accel_with_cursor;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  777  	} else {
f7c8a046577e09d Thomas Zimmermann    2023-11-27  778  		if (!g_hwcursor)
81dee67e215b23f Sudip Mukherjee      2015-03-03  779  			info->fbops = &lynxfb_ops;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  780  		else
f7c8a046577e09d Thomas Zimmermann    2023-11-27  781  			info->fbops = &lynxfb_ops_with_cursor;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  782  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  783  
81dee67e215b23f Sudip Mukherjee      2015-03-03  784  	if (!g_fbmode[index]) {
81dee67e215b23f Sudip Mukherjee      2015-03-03 @785  		g_fbmode[index] = g_def_fbmode;
81dee67e215b23f Sudip Mukherjee      2015-03-03  786  		if (index)
81dee67e215b23f Sudip Mukherjee      2015-03-03  787  			g_fbmode[index] = g_fbmode[0];
81dee67e215b23f Sudip Mukherjee      2015-03-03  788  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  789  
81dee67e215b23f Sudip Mukherjee      2015-03-03  790  	for (i = 0; i < 3; i++) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  791  		ret = fb_find_mode(var, info, g_fbmode[index],
81dee67e215b23f Sudip Mukherjee      2015-03-03  792  				   pdb[i], cdb[i], NULL, 8);
81dee67e215b23f Sudip Mukherjee      2015-03-03  793  
db7fb3588ab4920 Artem Lytkin         2026-02-23  794  		if (ret == 1 || ret == 2)
81dee67e215b23f Sudip Mukherjee      2015-03-03  795  			break;
81dee67e215b23f Sudip Mukherjee      2015-03-03  796  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  797  
81dee67e215b23f Sudip Mukherjee      2015-03-03  798  	/* set par */
81dee67e215b23f Sudip Mukherjee      2015-03-03  799  	par->info = info;
81dee67e215b23f Sudip Mukherjee      2015-03-03  800  
81dee67e215b23f Sudip Mukherjee      2015-03-03  801  	/* set info */
e3a3f9f5123683b Mike Rapoport        2015-10-26  802  	line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
e3a3f9f5123683b Mike Rapoport        2015-10-26  803  			    crtc->line_pad);
81dee67e215b23f Sudip Mukherjee      2015-03-03  804  
81dee67e215b23f Sudip Mukherjee      2015-03-03  805  	info->pseudo_palette = &par->pseudo_palette[0];
cc59bde1c920ab6 Benjamin Philip      2021-07-28  806  	info->screen_base = crtc->v_screen;
81dee67e215b23f Sudip Mukherjee      2015-03-03  807  	info->screen_size = line_length * var->yres_virtual;
81dee67e215b23f Sudip Mukherjee      2015-03-03  808  
81dee67e215b23f Sudip Mukherjee      2015-03-03  809  	/* set info->fix */
81dee67e215b23f Sudip Mukherjee      2015-03-03  810  	fix->type = FB_TYPE_PACKED_PIXELS;
81dee67e215b23f Sudip Mukherjee      2015-03-03  811  	fix->type_aux = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  812  	fix->xpanstep = crtc->xpanstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  813  	fix->ypanstep = crtc->ypanstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  814  	fix->ywrapstep = crtc->ywrapstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  815  	fix->accel = FB_ACCEL_SMI;
81dee67e215b23f Sudip Mukherjee      2015-03-03  816  
8c475735085a7db Tim Wassink          2025-12-21  817  	strscpy(fix->id, fix_id[index], sizeof(fix->id));
81dee67e215b23f Sudip Mukherjee      2015-03-03  818  
fdc234d85210d91 Benjamin Philip      2021-07-28  819  	fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  820  	/*
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  821  	 * according to mmap experiment from user space application,
81dee67e215b23f Sudip Mukherjee      2015-03-03  822  	 * fix->mmio_len should not larger than virtual size
81dee67e215b23f Sudip Mukherjee      2015-03-03  823  	 * (xres_virtual x yres_virtual x ByPP)
81dee67e215b23f Sudip Mukherjee      2015-03-03  824  	 * Below line maybe buggy when user mmap fb dev node and write
81dee67e215b23f Sudip Mukherjee      2015-03-03  825  	 * data into the bound over virtual size
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  826  	 */
81dee67e215b23f Sudip Mukherjee      2015-03-03  827  	fix->smem_len = crtc->vidmem_size;
81dee67e215b23f Sudip Mukherjee      2015-03-03  828  	info->screen_size = fix->smem_len;
81dee67e215b23f Sudip Mukherjee      2015-03-03  829  	fix->line_length = line_length;
e359b6a863e19f2 Mike Rapoport        2015-10-26  830  	fix->mmio_start = sm750_dev->vidreg_start;
e359b6a863e19f2 Mike Rapoport        2015-10-26  831  	fix->mmio_len = sm750_dev->vidreg_size;
b610e1193a917f4 Matej Dujava         2020-04-30  832  
b610e1193a917f4 Matej Dujava         2020-04-30  833  	lynxfb_set_visual_mode(info);
81dee67e215b23f Sudip Mukherjee      2015-03-03  834  
81dee67e215b23f Sudip Mukherjee      2015-03-03  835  	/* set var */
81dee67e215b23f Sudip Mukherjee      2015-03-03  836  	var->activate = FB_ACTIVATE_NOW;
81dee67e215b23f Sudip Mukherjee      2015-03-03  837  	var->accel_flags = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  838  	var->vmode = FB_VMODE_NONINTERLACED;
81dee67e215b23f Sudip Mukherjee      2015-03-03  839  
61c507cf652da1b Michel von Czettritz 2015-03-26  840  	ret = fb_alloc_cmap(&info->cmap, 256, 0);
61c507cf652da1b Michel von Czettritz 2015-03-26  841  	if (ret < 0) {
fbab250eb51d6d6 Artem Lytkin         2026-02-07  842  		dev_err(info->device, "Could not allocate memory for cmap.\n");
81dee67e215b23f Sudip Mukherjee      2015-03-03  843  		goto exit;
81dee67e215b23f Sudip Mukherjee      2015-03-03  844  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  845  
81dee67e215b23f Sudip Mukherjee      2015-03-03  846  exit:
81dee67e215b23f Sudip Mukherjee      2015-03-03  847  	lynxfb_ops_check_var(var, info);
81dee67e215b23f Sudip Mukherjee      2015-03-03  848  	return ret;
81dee67e215b23f Sudip Mukherjee      2015-03-03  849  }
81dee67e215b23f Sudip Mukherjee      2015-03-03  850  

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-06  3:56 [PATCH] staging: sm750fb: add " Chaitanya Sabnis
  2026-05-06  6:27 ` Ahmet Sezgin Duran
@ 2026-05-11 20:42 ` kernel test robot
  1 sibling, 0 replies; 19+ messages in thread
From: kernel test robot @ 2026-05-11 20:42 UTC (permalink / raw)
  To: Chaitanya Sabnis, sudipm.mukherjee, teddy.wang, gregkh
  Cc: oe-kbuild-all, linux-fbdev, linux-staging, linux-kernel,
	Chaitanya Sabnis

Hi Chaitanya,

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/Chaitanya-Sabnis/staging-sm750fb-add-const-to-g_fbmode-array/20260509-141744
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260506035641.5060-1-chaitanya.msabnis%40gmail.com
patch subject: [PATCH] staging: sm750fb: add const to g_fbmode array
config: i386-randconfig-053-20260511 (https://download.01.org/0day-ci/archive/20260512/202605120426.9EKM6cs7-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260512/202605120426.9EKM6cs7-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/202605120426.9EKM6cs7-lkp@intel.com/

All errors (new ones prefixed by >>):

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


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

81dee67e215b23f Sudip Mukherjee      2015-03-03  719  
81dee67e215b23f Sudip Mukherjee      2015-03-03  720  static int lynxfb_set_fbinfo(struct fb_info *info, int index)
81dee67e215b23f Sudip Mukherjee      2015-03-03  721  {
81dee67e215b23f Sudip Mukherjee      2015-03-03  722  	int i;
81dee67e215b23f Sudip Mukherjee      2015-03-03  723  	struct lynxfb_par *par;
e359b6a863e19f2 Mike Rapoport        2015-10-26  724  	struct sm750_dev *sm750_dev;
81dee67e215b23f Sudip Mukherjee      2015-03-03  725  	struct lynxfb_crtc *crtc;
81dee67e215b23f Sudip Mukherjee      2015-03-03  726  	struct lynxfb_output *output;
81dee67e215b23f Sudip Mukherjee      2015-03-03  727  	struct fb_var_screeninfo *var;
81dee67e215b23f Sudip Mukherjee      2015-03-03  728  	struct fb_fix_screeninfo *fix;
81dee67e215b23f Sudip Mukherjee      2015-03-03  729  
81dee67e215b23f Sudip Mukherjee      2015-03-03  730  	const struct fb_videomode *pdb[] = {
81dee67e215b23f Sudip Mukherjee      2015-03-03  731  		lynx750_ext, NULL, vesa_modes,
81dee67e215b23f Sudip Mukherjee      2015-03-03  732  	};
81dee67e215b23f Sudip Mukherjee      2015-03-03  733  	int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
d0856045f0e9fc9 Hungyu Lin           2026-04-01  734  	static const char * const fix_id[2] = {
81dee67e215b23f Sudip Mukherjee      2015-03-03  735  		"sm750_fb1", "sm750_fb2",
81dee67e215b23f Sudip Mukherjee      2015-03-03  736  	};
81dee67e215b23f Sudip Mukherjee      2015-03-03  737  
81dee67e215b23f Sudip Mukherjee      2015-03-03  738  	int ret, line_length;
81dee67e215b23f Sudip Mukherjee      2015-03-03  739  
81dee67e215b23f Sudip Mukherjee      2015-03-03  740  	ret = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  741  	par = (struct lynxfb_par *)info->par;
e359b6a863e19f2 Mike Rapoport        2015-10-26  742  	sm750_dev = par->dev;
81dee67e215b23f Sudip Mukherjee      2015-03-03  743  	crtc = &par->crtc;
81dee67e215b23f Sudip Mukherjee      2015-03-03  744  	output = &par->output;
81dee67e215b23f Sudip Mukherjee      2015-03-03  745  	var = &info->var;
81dee67e215b23f Sudip Mukherjee      2015-03-03  746  	fix = &info->fix;
81dee67e215b23f Sudip Mukherjee      2015-03-03  747  
81dee67e215b23f Sudip Mukherjee      2015-03-03  748  	/* set index */
81dee67e215b23f Sudip Mukherjee      2015-03-03  749  	par->index = index;
81dee67e215b23f Sudip Mukherjee      2015-03-03  750  	output->channel = &crtc->channel;
81dee67e215b23f Sudip Mukherjee      2015-03-03  751  	sm750fb_set_drv(par);
81dee67e215b23f Sudip Mukherjee      2015-03-03  752  
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  753  	/*
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  754  	 * set current cursor variable and proc pointer,
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  755  	 * must be set after crtc member initialized
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  756  	 */
fdc234d85210d91 Benjamin Philip      2021-07-28  757  	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
e359b6a863e19f2 Mike Rapoport        2015-10-26  758  	crtc->cursor.mmio = sm750_dev->pvReg +
e359b6a863e19f2 Mike Rapoport        2015-10-26  759  		0x800f0 + (int)crtc->channel * 0x140;
81dee67e215b23f Sudip Mukherjee      2015-03-03  760  
cd33da26036ea54 Christopher Carbone  2022-08-23  761  	crtc->cursor.max_h = 64;
cd33da26036ea54 Christopher Carbone  2022-08-23  762  	crtc->cursor.max_w = 64;
39f9137268ee3df Benjamin Philip      2021-07-26  763  	crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
e359b6a863e19f2 Mike Rapoport        2015-10-26  764  	crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
81dee67e215b23f Sudip Mukherjee      2015-03-03  765  
3de08a2d14ff8c7 Lorenzo Stoakes      2015-03-20  766  	memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
f7c8a046577e09d Thomas Zimmermann    2023-11-27  767  	if (!g_hwcursor)
52d0744d751d8f1 Arnd Bergmann        2016-11-09  768  		sm750_hw_cursor_disable(&crtc->cursor);
81dee67e215b23f Sudip Mukherjee      2015-03-03  769  
81dee67e215b23f Sudip Mukherjee      2015-03-03  770  	/* set info->fbops, must be set before fb_find_mode */
e359b6a863e19f2 Mike Rapoport        2015-10-26  771  	if (!sm750_dev->accel_off) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  772  		/* use 2d acceleration */
f7c8a046577e09d Thomas Zimmermann    2023-11-27  773  		if (!g_hwcursor)
f7c8a046577e09d Thomas Zimmermann    2023-11-27  774  			info->fbops = &lynxfb_ops_accel;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  775  		else
f7c8a046577e09d Thomas Zimmermann    2023-11-27  776  			info->fbops = &lynxfb_ops_accel_with_cursor;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  777  	} else {
f7c8a046577e09d Thomas Zimmermann    2023-11-27  778  		if (!g_hwcursor)
81dee67e215b23f Sudip Mukherjee      2015-03-03  779  			info->fbops = &lynxfb_ops;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  780  		else
f7c8a046577e09d Thomas Zimmermann    2023-11-27  781  			info->fbops = &lynxfb_ops_with_cursor;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  782  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  783  
81dee67e215b23f Sudip Mukherjee      2015-03-03  784  	if (!g_fbmode[index]) {
81dee67e215b23f Sudip Mukherjee      2015-03-03 @785  		g_fbmode[index] = g_def_fbmode;
81dee67e215b23f Sudip Mukherjee      2015-03-03  786  		if (index)
81dee67e215b23f Sudip Mukherjee      2015-03-03  787  			g_fbmode[index] = g_fbmode[0];
81dee67e215b23f Sudip Mukherjee      2015-03-03  788  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  789  
81dee67e215b23f Sudip Mukherjee      2015-03-03  790  	for (i = 0; i < 3; i++) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  791  		ret = fb_find_mode(var, info, g_fbmode[index],
81dee67e215b23f Sudip Mukherjee      2015-03-03  792  				   pdb[i], cdb[i], NULL, 8);
81dee67e215b23f Sudip Mukherjee      2015-03-03  793  
db7fb3588ab4920 Artem Lytkin         2026-02-23  794  		if (ret == 1 || ret == 2)
81dee67e215b23f Sudip Mukherjee      2015-03-03  795  			break;
81dee67e215b23f Sudip Mukherjee      2015-03-03  796  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  797  
81dee67e215b23f Sudip Mukherjee      2015-03-03  798  	/* set par */
81dee67e215b23f Sudip Mukherjee      2015-03-03  799  	par->info = info;
81dee67e215b23f Sudip Mukherjee      2015-03-03  800  
81dee67e215b23f Sudip Mukherjee      2015-03-03  801  	/* set info */
e3a3f9f5123683b Mike Rapoport        2015-10-26  802  	line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
e3a3f9f5123683b Mike Rapoport        2015-10-26  803  			    crtc->line_pad);
81dee67e215b23f Sudip Mukherjee      2015-03-03  804  
81dee67e215b23f Sudip Mukherjee      2015-03-03  805  	info->pseudo_palette = &par->pseudo_palette[0];
cc59bde1c920ab6 Benjamin Philip      2021-07-28  806  	info->screen_base = crtc->v_screen;
81dee67e215b23f Sudip Mukherjee      2015-03-03  807  	info->screen_size = line_length * var->yres_virtual;
81dee67e215b23f Sudip Mukherjee      2015-03-03  808  
81dee67e215b23f Sudip Mukherjee      2015-03-03  809  	/* set info->fix */
81dee67e215b23f Sudip Mukherjee      2015-03-03  810  	fix->type = FB_TYPE_PACKED_PIXELS;
81dee67e215b23f Sudip Mukherjee      2015-03-03  811  	fix->type_aux = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  812  	fix->xpanstep = crtc->xpanstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  813  	fix->ypanstep = crtc->ypanstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  814  	fix->ywrapstep = crtc->ywrapstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  815  	fix->accel = FB_ACCEL_SMI;
81dee67e215b23f Sudip Mukherjee      2015-03-03  816  
8c475735085a7db Tim Wassink          2025-12-21  817  	strscpy(fix->id, fix_id[index], sizeof(fix->id));
81dee67e215b23f Sudip Mukherjee      2015-03-03  818  
fdc234d85210d91 Benjamin Philip      2021-07-28  819  	fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  820  	/*
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  821  	 * according to mmap experiment from user space application,
81dee67e215b23f Sudip Mukherjee      2015-03-03  822  	 * fix->mmio_len should not larger than virtual size
81dee67e215b23f Sudip Mukherjee      2015-03-03  823  	 * (xres_virtual x yres_virtual x ByPP)
81dee67e215b23f Sudip Mukherjee      2015-03-03  824  	 * Below line maybe buggy when user mmap fb dev node and write
81dee67e215b23f Sudip Mukherjee      2015-03-03  825  	 * data into the bound over virtual size
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  826  	 */
81dee67e215b23f Sudip Mukherjee      2015-03-03  827  	fix->smem_len = crtc->vidmem_size;
81dee67e215b23f Sudip Mukherjee      2015-03-03  828  	info->screen_size = fix->smem_len;
81dee67e215b23f Sudip Mukherjee      2015-03-03  829  	fix->line_length = line_length;
e359b6a863e19f2 Mike Rapoport        2015-10-26  830  	fix->mmio_start = sm750_dev->vidreg_start;
e359b6a863e19f2 Mike Rapoport        2015-10-26  831  	fix->mmio_len = sm750_dev->vidreg_size;
b610e1193a917f4 Matej Dujava         2020-04-30  832  
b610e1193a917f4 Matej Dujava         2020-04-30  833  	lynxfb_set_visual_mode(info);
81dee67e215b23f Sudip Mukherjee      2015-03-03  834  
81dee67e215b23f Sudip Mukherjee      2015-03-03  835  	/* set var */
81dee67e215b23f Sudip Mukherjee      2015-03-03  836  	var->activate = FB_ACTIVATE_NOW;
81dee67e215b23f Sudip Mukherjee      2015-03-03  837  	var->accel_flags = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  838  	var->vmode = FB_VMODE_NONINTERLACED;
81dee67e215b23f Sudip Mukherjee      2015-03-03  839  
61c507cf652da1b Michel von Czettritz 2015-03-26  840  	ret = fb_alloc_cmap(&info->cmap, 256, 0);
61c507cf652da1b Michel von Czettritz 2015-03-26  841  	if (ret < 0) {
fbab250eb51d6d6 Artem Lytkin         2026-02-07  842  		dev_err(info->device, "Could not allocate memory for cmap.\n");
81dee67e215b23f Sudip Mukherjee      2015-03-03  843  		goto exit;
81dee67e215b23f Sudip Mukherjee      2015-03-03  844  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  845  
81dee67e215b23f Sudip Mukherjee      2015-03-03  846  exit:
81dee67e215b23f Sudip Mukherjee      2015-03-03  847  	lynxfb_ops_check_var(var, info);
81dee67e215b23f Sudip Mukherjee      2015-03-03  848  	return ret;
81dee67e215b23f Sudip Mukherjee      2015-03-03  849  }
81dee67e215b23f Sudip Mukherjee      2015-03-03  850  
81dee67e215b23f Sudip Mukherjee      2015-03-03  851  /*	chip specific g_option configuration routine */
700591a9adc8b1b Mike Rapoport        2015-10-26  852  static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
81dee67e215b23f Sudip Mukherjee      2015-03-03  853  {
81dee67e215b23f Sudip Mukherjee      2015-03-03  854  	char *opt;
81dee67e215b23f Sudip Mukherjee      2015-03-03  855  	int swap;
81dee67e215b23f Sudip Mukherjee      2015-03-03  856  
81dee67e215b23f Sudip Mukherjee      2015-03-03  857  	swap = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  858  
cc34db609ff98c1 Madhumitha Sundar    2026-01-27  859  	sm750_dev->init_parm.chip_clk = 0;
cc34db609ff98c1 Madhumitha Sundar    2026-01-27  860  	sm750_dev->init_parm.mem_clk = 0;
cc34db609ff98c1 Madhumitha Sundar    2026-01-27  861  	sm750_dev->init_parm.master_clk = 0;
cc34db609ff98c1 Madhumitha Sundar    2026-01-27  862  	sm750_dev->init_parm.powerMode = 0;
cc34db609ff98c1 Madhumitha Sundar    2026-01-27  863  	sm750_dev->init_parm.setAllEngOff = 0;
cc34db609ff98c1 Madhumitha Sundar    2026-01-27  864  	sm750_dev->init_parm.resetMemory = 1;
81dee67e215b23f Sudip Mukherjee      2015-03-03  865  
81dee67e215b23f Sudip Mukherjee      2015-03-03  866  	/* defaultly turn g_hwcursor on for both view */
81dee67e215b23f Sudip Mukherjee      2015-03-03  867  	g_hwcursor = 3;
81dee67e215b23f Sudip Mukherjee      2015-03-03  868  
81dee67e215b23f Sudip Mukherjee      2015-03-03  869  	if (!src || !*src) {
c56de0967a658cb Elise Lennion        2016-10-31  870  		dev_warn(&sm750_dev->pdev->dev, "no specific g_option.\n");
81dee67e215b23f Sudip Mukherjee      2015-03-03  871  		goto NO_PARAM;
81dee67e215b23f Sudip Mukherjee      2015-03-03  872  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  873  
0fa96e39279988b Sudip Mukherjee      2015-03-10  874  	while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
c56de0967a658cb Elise Lennion        2016-10-31  875  		dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
c56de0967a658cb Elise Lennion        2016-10-31  876  		dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
81dee67e215b23f Sudip Mukherjee      2015-03-03  877  
144634a6b421468 Katie Dunne          2017-02-19  878  		if (!strncmp(opt, "swap", strlen("swap"))) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  879  			swap = 1;
144634a6b421468 Katie Dunne          2017-02-19  880  		} else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
1757d106a9ce8cc Mike Rapoport        2015-10-26  881  			sm750_dev->nocrt = 1;
144634a6b421468 Katie Dunne          2017-02-19  882  		} else if (!strncmp(opt, "36bit", strlen("36bit"))) {
94c938a0c158635 Shubham Chakraborty  2026-04-07  883  			sm750_dev->pnltype = SM750_DOUBLE_TFT;
144634a6b421468 Katie Dunne          2017-02-19  884  		} else if (!strncmp(opt, "18bit", strlen("18bit"))) {
94c938a0c158635 Shubham Chakraborty  2026-04-07  885  			sm750_dev->pnltype = SM750_DUAL_TFT;
144634a6b421468 Katie Dunne          2017-02-19  886  		} else if (!strncmp(opt, "24bit", strlen("24bit"))) {
94c938a0c158635 Shubham Chakraborty  2026-04-07  887  			sm750_dev->pnltype = SM750_24TFT;
144634a6b421468 Katie Dunne          2017-02-19  888  		} else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  889  			g_hwcursor &= ~0x1;
144634a6b421468 Katie Dunne          2017-02-19  890  		} else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  891  			g_hwcursor &= ~0x2;
144634a6b421468 Katie Dunne          2017-02-19  892  		} else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  893  			g_hwcursor = 0;
144634a6b421468 Katie Dunne          2017-02-19  894  		} else {
81dee67e215b23f Sudip Mukherjee      2015-03-03  895  			if (!g_fbmode[0]) {
81dee67e215b23f Sudip Mukherjee      2015-03-03 @896  				g_fbmode[0] = opt;
cee9ba1c30d0517 Abdul Rauf           2017-01-08  897  				dev_info(&sm750_dev->pdev->dev,
cee9ba1c30d0517 Abdul Rauf           2017-01-08  898  					 "find fbmode0 : %s\n", g_fbmode[0]);
81dee67e215b23f Sudip Mukherjee      2015-03-03  899  			} else if (!g_fbmode[1]) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  900  				g_fbmode[1] = opt;
cee9ba1c30d0517 Abdul Rauf           2017-01-08  901  				dev_info(&sm750_dev->pdev->dev,
cee9ba1c30d0517 Abdul Rauf           2017-01-08  902  					 "find fbmode1 : %s\n", g_fbmode[1]);
81dee67e215b23f Sudip Mukherjee      2015-03-03  903  			} else {
c56de0967a658cb Elise Lennion        2016-10-31  904  				dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
81dee67e215b23f Sudip Mukherjee      2015-03-03  905  			}
81dee67e215b23f Sudip Mukherjee      2015-03-03  906  		}
81dee67e215b23f Sudip Mukherjee      2015-03-03  907  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  908  
81dee67e215b23f Sudip Mukherjee      2015-03-03  909  NO_PARAM:
e359b6a863e19f2 Mike Rapoport        2015-10-26  910  	if (sm750_dev->revid != SM750LE_REVISION_ID) {
a3f92cc94c6126d Mike Rapoport        2016-01-17  911  		if (sm750_dev->fb_count > 1) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  912  			if (swap)
1757d106a9ce8cc Mike Rapoport        2015-10-26  913  				sm750_dev->dataflow = sm750_dual_swap;
81dee67e215b23f Sudip Mukherjee      2015-03-03  914  			else
1757d106a9ce8cc Mike Rapoport        2015-10-26  915  				sm750_dev->dataflow = sm750_dual_normal;
81dee67e215b23f Sudip Mukherjee      2015-03-03  916  		} else {
81dee67e215b23f Sudip Mukherjee      2015-03-03  917  			if (swap)
1757d106a9ce8cc Mike Rapoport        2015-10-26  918  				sm750_dev->dataflow = sm750_simul_sec;
81dee67e215b23f Sudip Mukherjee      2015-03-03  919  			else
1757d106a9ce8cc Mike Rapoport        2015-10-26  920  				sm750_dev->dataflow = sm750_simul_pri;
81dee67e215b23f Sudip Mukherjee      2015-03-03  921  		}
81dee67e215b23f Sudip Mukherjee      2015-03-03  922  	} else {
81dee67e215b23f Sudip Mukherjee      2015-03-03  923  		/* SM750LE only have one crt channel */
1757d106a9ce8cc Mike Rapoport        2015-10-26  924  		sm750_dev->dataflow = sm750_simul_sec;
81dee67e215b23f Sudip Mukherjee      2015-03-03  925  		/* sm750le do not have complex attributes */
1757d106a9ce8cc Mike Rapoport        2015-10-26  926  		sm750_dev->nocrt = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  927  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  928  }
81dee67e215b23f Sudip Mukherjee      2015-03-03  929  

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH] staging: sm750fb: add const to g_fbmode array
@ 2026-05-21 14:26 Diego Fernando Mancera Gómez
  2026-05-21 19:52 ` Ahmet Sezgin Duran
  2026-05-21 20:33 ` Ahmet Sezgin Duran
  0 siblings, 2 replies; 19+ messages in thread
From: Diego Fernando Mancera Gómez @ 2026-05-21 14:26 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-staging, Diego Fernando Mancera Gómez

Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c..8f533f3b1b42 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -21,7 +21,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel __ro_after_init;
 static int g_nomtrr __ro_after_init;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview __ro_after_init;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-21 14:26 [PATCH] staging: sm750fb: add const to g_fbmode array Diego Fernando Mancera Gómez
@ 2026-05-21 19:52 ` Ahmet Sezgin Duran
  2026-05-21 20:33 ` Ahmet Sezgin Duran
  1 sibling, 0 replies; 19+ messages in thread
From: Ahmet Sezgin Duran @ 2026-05-21 19:52 UTC (permalink / raw)
  To: Diego Fernando Mancera Gómez, Greg KH; +Cc: linux-staging

On 5/21/26 5:26 PM, Diego Fernando Mancera Gómez wrote:
> Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
> ---
>   drivers/staging/sm750fb/sm750.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 89c811e0806c..8f533f3b1b42 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -21,7 +21,7 @@
>   static int g_hwcursor = 1;
>   static int g_noaccel __ro_after_init;
>   static int g_nomtrr __ro_after_init;
> -static const char *g_fbmode[] = {NULL, NULL};
> +static const char * const g_fbmode[] = {NULL, NULL};
>   static const char *g_def_fbmode = "1024x768-32@60";
>   static char *g_settings;
>   static int g_dualview __ro_after_init;

Did you compile these changes?

Regards,
Ahmet Sezgin Duran

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-21 14:26 [PATCH] staging: sm750fb: add const to g_fbmode array Diego Fernando Mancera Gómez
  2026-05-21 19:52 ` Ahmet Sezgin Duran
@ 2026-05-21 20:33 ` Ahmet Sezgin Duran
  2026-05-21 20:47   ` Diego Fernando Mancera Gomez
  1 sibling, 1 reply; 19+ messages in thread
From: Ahmet Sezgin Duran @ 2026-05-21 20:33 UTC (permalink / raw)
  To: Diego Fernando Mancera Gómez, Greg KH; +Cc: linux-staging

Replying an off-list email:

> To: Ahmet Sezgin Duran Subject: Re: [PATCH] staging: sm750fb: add
> const to g_fbmode array
> 
> Hi Ahmet,
> 
> Yes, I have verified the changes. I compiled the module using make
> M=drivers/staging/sm750fb/ and it compiled successfully without any
> errors or warnings.
> 
> Regards, Diego Fernando Mancera Gómez
> 
> On Thu, May 21, 2026 at 1:52 PM Ahmet Sezgin Duran
> <ahmet@sezginduran.net> wrote:
>>
>> On 5/21/26 5:26 PM, Diego Fernando Mancera Gómez wrote:
>>> Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
>>> ---
>>>   drivers/staging/sm750fb/sm750.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
>>> index 89c811e0806c..8f533f3b1b42 100644
>>> --- a/drivers/staging/sm750fb/sm750.c
>>> +++ b/drivers/staging/sm750fb/sm750.c
>>> @@ -21,7 +21,7 @@
>>>   static int g_hwcursor = 1;
>>>   static int g_noaccel __ro_after_init;
>>>   static int g_nomtrr __ro_after_init;
>>> -static const char *g_fbmode[] = {NULL, NULL};
>>> +static const char * const g_fbmode[] = {NULL, NULL};
>>>   static const char *g_def_fbmode = "1024x768-32@60";
>>>   static char *g_settings;
>>>   static int g_dualview __ro_after_init;
>>
>> Did you compile these changes?
>>
>> Regards,
>> Ahmet Sezgin Duran

Please reply emails using `Reply All` and avoid top posting.

> Yes, I have verified the changes. I compiled the module using make
> M=drivers/staging/sm750fb/ and it compiled successfully without any
> errors or warnings.

Can you make sure that you had enabled the related module?

Regards,
Ahmet Sezgin Duran

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-21 20:33 ` Ahmet Sezgin Duran
@ 2026-05-21 20:47   ` Diego Fernando Mancera Gomez
  0 siblings, 0 replies; 19+ messages in thread
From: Diego Fernando Mancera Gomez @ 2026-05-21 20:47 UTC (permalink / raw)
  To: Ahmet Sezgin Duran; +Cc: Greg KH, linux-staging

On Thu, May 21, 2026 at 2:33 PM Ahmet Sezgin Duran
<ahmet@sezginduran.net> wrote:
>
> Can you make sure that you had enabled the related module?

Hi Ahmet,

You caught me. I sincerely apologize.

I forced the compilation by running `make
drivers/staging/sm750fb/sm750.o` and immediately saw the errors:
`error: assignment of read-only location ‘g_fbmode[index]’`

I realize now that adding the second `const` breaks the driver because
`g_fbmode` is dynamically assigned at runtime inside `sm750fb_setup`
and `lynxfb_set_fbinfo`. The `checkpatch.pl` warning was a false
positive in this specific context, and I failed to verify the build
properly before sending the patch.

Please drop this patch. Thank you very much for the lesson in C
semantics, build discipline, and mailing list etiquette. It won't
happen again.

Regards,
Diego Fernando Mancera Gómez


On Thu, May 21, 2026 at 2:33 PM Ahmet Sezgin Duran
<ahmet@sezginduran.net> wrote:
>
> Replying an off-list email:
>
> > To: Ahmet Sezgin Duran Subject: Re: [PATCH] staging: sm750fb: add
> > const to g_fbmode array
> >
> > Hi Ahmet,
> >
> > Yes, I have verified the changes. I compiled the module using make
> > M=drivers/staging/sm750fb/ and it compiled successfully without any
> > errors or warnings.
> >
> > Regards, Diego Fernando Mancera Gómez
> >
> > On Thu, May 21, 2026 at 1:52 PM Ahmet Sezgin Duran
> > <ahmet@sezginduran.net> wrote:
> >>
> >> On 5/21/26 5:26 PM, Diego Fernando Mancera Gómez wrote:
> >>> Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
> >>> ---
> >>>   drivers/staging/sm750fb/sm750.c | 2 +-
> >>>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> >>> index 89c811e0806c..8f533f3b1b42 100644
> >>> --- a/drivers/staging/sm750fb/sm750.c
> >>> +++ b/drivers/staging/sm750fb/sm750.c
> >>> @@ -21,7 +21,7 @@
> >>>   static int g_hwcursor = 1;
> >>>   static int g_noaccel __ro_after_init;
> >>>   static int g_nomtrr __ro_after_init;
> >>> -static const char *g_fbmode[] = {NULL, NULL};
> >>> +static const char * const g_fbmode[] = {NULL, NULL};
> >>>   static const char *g_def_fbmode = "1024x768-32@60";
> >>>   static char *g_settings;
> >>>   static int g_dualview __ro_after_init;
> >>
> >> Did you compile these changes?
> >>
> >> Regards,
> >> Ahmet Sezgin Duran
>
> Please reply emails using `Reply All` and avoid top posting.
>
> > Yes, I have verified the changes. I compiled the module using make
> > M=drivers/staging/sm750fb/ and it compiled successfully without any
> > errors or warnings.
>
> Can you make sure that you had enabled the related module?
>
> Regards,
> Ahmet Sezgin Duran

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-21 21:05 [PATCH] staging: rtl8723bs: clean up if-else logic in odm_HWConfig.c Diego Fernando Mancera Gómez
@ 2026-05-21 21:05 ` Diego Fernando Mancera Gómez
  2026-05-21 21:09   ` Diego Fernando Mancera Gomez
                     ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Diego Fernando Mancera Gómez @ 2026-05-21 21:05 UTC (permalink / raw)
  To: gregkh, linux-staging
  Cc: m.steinmoetzger, guojy.bj, straube.linux, error27, linux-kernel,
	Diego Fernando Mancera Gómez

Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c..8f533f3b1b42 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -21,7 +21,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel __ro_after_init;
 static int g_nomtrr __ro_after_init;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview __ro_after_init;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-21 21:05 ` [PATCH] staging: sm750fb: add const to g_fbmode array Diego Fernando Mancera Gómez
@ 2026-05-21 21:09   ` Diego Fernando Mancera Gomez
  2026-05-23 20:33   ` kernel test robot
  2026-05-23 21:26   ` kernel test robot
  2 siblings, 0 replies; 19+ messages in thread
From: Diego Fernando Mancera Gomez @ 2026-05-21 21:09 UTC (permalink / raw)
  To: gregkh, linux-staging
  Cc: m.steinmoetzger, guojy.bj, straube.linux, error27, linux-kernel

Hi Greg, please ignore this patch, as it was sent by mistake. I am
retracting it due to compilation errors I found earlier.

On Thu, May 21, 2026 at 3:06 PM Diego Fernando Mancera Gómez
<diegomancera.dev@gmail.com> wrote:
>
> Signed-off-by: Diego Fernando Mancera Gómez <diegomancera.dev@gmail.com>
> ---
>  drivers/staging/sm750fb/sm750.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 89c811e0806c..8f533f3b1b42 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -21,7 +21,7 @@
>  static int g_hwcursor = 1;
>  static int g_noaccel __ro_after_init;
>  static int g_nomtrr __ro_after_init;
> -static const char *g_fbmode[] = {NULL, NULL};
> +static const char * const g_fbmode[] = {NULL, NULL};
>  static const char *g_def_fbmode = "1024x768-32@60";
>  static char *g_settings;
>  static int g_dualview __ro_after_init;
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-21 21:05 ` [PATCH] staging: sm750fb: add const to g_fbmode array Diego Fernando Mancera Gómez
  2026-05-21 21:09   ` Diego Fernando Mancera Gomez
@ 2026-05-23 20:33   ` kernel test robot
  2026-05-23 21:26   ` kernel test robot
  2 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2026-05-23 20:33 UTC (permalink / raw)
  To: Diego Fernando Mancera Gómez, gregkh, linux-staging
  Cc: oe-kbuild-all, m.steinmoetzger, guojy.bj, straube.linux, error27,
	linux-kernel, Diego Fernando Mancera Gómez

Hi Diego,

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/Diego-Fernando-Mancera-G-mez/staging-sm750fb-add-const-to-g_fbmode-array/20260522-050816
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260521210523.133725-2-diegomancera.dev%40gmail.com
patch subject: [PATCH] staging: sm750fb: add const to g_fbmode array
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20260524/202605240427.G89TqT5r-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260524/202605240427.G89TqT5r-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/202605240427.G89TqT5r-lkp@intel.com/

All errors (new ones prefixed by >>):

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


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

81dee67e215b23 Sudip Mukherjee      2015-03-03  707  
81dee67e215b23 Sudip Mukherjee      2015-03-03  708  static int lynxfb_set_fbinfo(struct fb_info *info, int index)
81dee67e215b23 Sudip Mukherjee      2015-03-03  709  {
81dee67e215b23 Sudip Mukherjee      2015-03-03  710  	int i;
81dee67e215b23 Sudip Mukherjee      2015-03-03  711  	struct lynxfb_par *par;
e359b6a863e19f Mike Rapoport        2015-10-26  712  	struct sm750_dev *sm750_dev;
81dee67e215b23 Sudip Mukherjee      2015-03-03  713  	struct lynxfb_crtc *crtc;
81dee67e215b23 Sudip Mukherjee      2015-03-03  714  	struct lynxfb_output *output;
81dee67e215b23 Sudip Mukherjee      2015-03-03  715  	struct fb_var_screeninfo *var;
81dee67e215b23 Sudip Mukherjee      2015-03-03  716  	struct fb_fix_screeninfo *fix;
81dee67e215b23 Sudip Mukherjee      2015-03-03  717  
81dee67e215b23 Sudip Mukherjee      2015-03-03  718  	const struct fb_videomode *pdb[] = {
81dee67e215b23 Sudip Mukherjee      2015-03-03  719  		lynx750_ext, NULL, vesa_modes,
81dee67e215b23 Sudip Mukherjee      2015-03-03  720  	};
81dee67e215b23 Sudip Mukherjee      2015-03-03  721  	int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
d0856045f0e9fc Hungyu Lin           2026-04-01  722  	static const char * const fix_id[2] = {
81dee67e215b23 Sudip Mukherjee      2015-03-03  723  		"sm750_fb1", "sm750_fb2",
81dee67e215b23 Sudip Mukherjee      2015-03-03  724  	};
81dee67e215b23 Sudip Mukherjee      2015-03-03  725  
81dee67e215b23 Sudip Mukherjee      2015-03-03  726  	int ret, line_length;
81dee67e215b23 Sudip Mukherjee      2015-03-03  727  
81dee67e215b23 Sudip Mukherjee      2015-03-03  728  	ret = 0;
81dee67e215b23 Sudip Mukherjee      2015-03-03  729  	par = (struct lynxfb_par *)info->par;
e359b6a863e19f Mike Rapoport        2015-10-26  730  	sm750_dev = par->dev;
81dee67e215b23 Sudip Mukherjee      2015-03-03  731  	crtc = &par->crtc;
81dee67e215b23 Sudip Mukherjee      2015-03-03  732  	output = &par->output;
81dee67e215b23 Sudip Mukherjee      2015-03-03  733  	var = &info->var;
81dee67e215b23 Sudip Mukherjee      2015-03-03  734  	fix = &info->fix;
81dee67e215b23 Sudip Mukherjee      2015-03-03  735  
81dee67e215b23 Sudip Mukherjee      2015-03-03  736  	/* set index */
81dee67e215b23 Sudip Mukherjee      2015-03-03  737  	par->index = index;
81dee67e215b23 Sudip Mukherjee      2015-03-03  738  	output->channel = &crtc->channel;
81dee67e215b23 Sudip Mukherjee      2015-03-03  739  	sm750fb_set_drv(par);
81dee67e215b23 Sudip Mukherjee      2015-03-03  740  
d11ac7cbcc266c Sudip Mukherjee      2015-08-07  741  	/*
d11ac7cbcc266c Sudip Mukherjee      2015-08-07  742  	 * set current cursor variable and proc pointer,
d11ac7cbcc266c Sudip Mukherjee      2015-08-07  743  	 * must be set after crtc member initialized
d11ac7cbcc266c Sudip Mukherjee      2015-08-07  744  	 */
fdc234d85210d9 Benjamin Philip      2021-07-28  745  	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
e359b6a863e19f Mike Rapoport        2015-10-26  746  	crtc->cursor.mmio = sm750_dev->pvReg +
e359b6a863e19f Mike Rapoport        2015-10-26  747  		0x800f0 + (int)crtc->channel * 0x140;
81dee67e215b23 Sudip Mukherjee      2015-03-03  748  
cd33da26036ea5 Christopher Carbone  2022-08-23  749  	crtc->cursor.max_h = 64;
cd33da26036ea5 Christopher Carbone  2022-08-23  750  	crtc->cursor.max_w = 64;
39f9137268ee3d Benjamin Philip      2021-07-26  751  	crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
f50b4602fea62f Jennifer Guo         2026-05-09  752  	crtc->cursor.vstart = sm750_dev->vmem + crtc->cursor.offset;
81dee67e215b23 Sudip Mukherjee      2015-03-03  753  
3de08a2d14ff8c Lorenzo Stoakes      2015-03-20  754  	memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
f7c8a046577e09 Thomas Zimmermann    2023-11-27  755  	if (!g_hwcursor)
52d0744d751d8f Arnd Bergmann        2016-11-09  756  		sm750_hw_cursor_disable(&crtc->cursor);
81dee67e215b23 Sudip Mukherjee      2015-03-03  757  
81dee67e215b23 Sudip Mukherjee      2015-03-03  758  	/* set info->fbops, must be set before fb_find_mode */
e359b6a863e19f Mike Rapoport        2015-10-26  759  	if (!sm750_dev->accel_off) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  760  		/* use 2d acceleration */
f7c8a046577e09 Thomas Zimmermann    2023-11-27  761  		if (!g_hwcursor)
f7c8a046577e09 Thomas Zimmermann    2023-11-27  762  			info->fbops = &lynxfb_ops_accel;
f7c8a046577e09 Thomas Zimmermann    2023-11-27  763  		else
f7c8a046577e09 Thomas Zimmermann    2023-11-27  764  			info->fbops = &lynxfb_ops_accel_with_cursor;
f7c8a046577e09 Thomas Zimmermann    2023-11-27  765  	} else {
f7c8a046577e09 Thomas Zimmermann    2023-11-27  766  		if (!g_hwcursor)
81dee67e215b23 Sudip Mukherjee      2015-03-03  767  			info->fbops = &lynxfb_ops;
f7c8a046577e09 Thomas Zimmermann    2023-11-27  768  		else
f7c8a046577e09 Thomas Zimmermann    2023-11-27  769  			info->fbops = &lynxfb_ops_with_cursor;
f7c8a046577e09 Thomas Zimmermann    2023-11-27  770  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  771  
81dee67e215b23 Sudip Mukherjee      2015-03-03  772  	if (!g_fbmode[index]) {
81dee67e215b23 Sudip Mukherjee      2015-03-03 @773  		g_fbmode[index] = g_def_fbmode;
81dee67e215b23 Sudip Mukherjee      2015-03-03  774  		if (index)
81dee67e215b23 Sudip Mukherjee      2015-03-03  775  			g_fbmode[index] = g_fbmode[0];
81dee67e215b23 Sudip Mukherjee      2015-03-03  776  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  777  
81dee67e215b23 Sudip Mukherjee      2015-03-03  778  	for (i = 0; i < 3; i++) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  779  		ret = fb_find_mode(var, info, g_fbmode[index],
81dee67e215b23 Sudip Mukherjee      2015-03-03  780  				   pdb[i], cdb[i], NULL, 8);
81dee67e215b23 Sudip Mukherjee      2015-03-03  781  
db7fb3588ab492 Artem Lytkin         2026-02-23  782  		if (ret == 1 || ret == 2)
81dee67e215b23 Sudip Mukherjee      2015-03-03  783  			break;
81dee67e215b23 Sudip Mukherjee      2015-03-03  784  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  785  
81dee67e215b23 Sudip Mukherjee      2015-03-03  786  	/* set par */
81dee67e215b23 Sudip Mukherjee      2015-03-03  787  	par->info = info;
81dee67e215b23 Sudip Mukherjee      2015-03-03  788  
81dee67e215b23 Sudip Mukherjee      2015-03-03  789  	/* set info */
e3a3f9f5123683 Mike Rapoport        2015-10-26  790  	line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
e3a3f9f5123683 Mike Rapoport        2015-10-26  791  			    crtc->line_pad);
81dee67e215b23 Sudip Mukherjee      2015-03-03  792  
81dee67e215b23 Sudip Mukherjee      2015-03-03  793  	info->pseudo_palette = &par->pseudo_palette[0];
cc59bde1c920ab Benjamin Philip      2021-07-28  794  	info->screen_base = crtc->v_screen;
81dee67e215b23 Sudip Mukherjee      2015-03-03  795  	info->screen_size = line_length * var->yres_virtual;
81dee67e215b23 Sudip Mukherjee      2015-03-03  796  
81dee67e215b23 Sudip Mukherjee      2015-03-03  797  	/* set info->fix */
81dee67e215b23 Sudip Mukherjee      2015-03-03  798  	fix->type = FB_TYPE_PACKED_PIXELS;
81dee67e215b23 Sudip Mukherjee      2015-03-03  799  	fix->type_aux = 0;
81dee67e215b23 Sudip Mukherjee      2015-03-03  800  	fix->xpanstep = crtc->xpanstep;
81dee67e215b23 Sudip Mukherjee      2015-03-03  801  	fix->ypanstep = crtc->ypanstep;
81dee67e215b23 Sudip Mukherjee      2015-03-03  802  	fix->ywrapstep = crtc->ywrapstep;
81dee67e215b23 Sudip Mukherjee      2015-03-03  803  	fix->accel = FB_ACCEL_SMI;
81dee67e215b23 Sudip Mukherjee      2015-03-03  804  
8c475735085a7d Tim Wassink          2025-12-21  805  	strscpy(fix->id, fix_id[index], sizeof(fix->id));
81dee67e215b23 Sudip Mukherjee      2015-03-03  806  
fdc234d85210d9 Benjamin Philip      2021-07-28  807  	fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
d11ac7cbcc266c Sudip Mukherjee      2015-08-07  808  	/*
d11ac7cbcc266c Sudip Mukherjee      2015-08-07  809  	 * according to mmap experiment from user space application,
81dee67e215b23 Sudip Mukherjee      2015-03-03  810  	 * fix->mmio_len should not larger than virtual size
81dee67e215b23 Sudip Mukherjee      2015-03-03  811  	 * (xres_virtual x yres_virtual x ByPP)
81dee67e215b23 Sudip Mukherjee      2015-03-03  812  	 * Below line maybe buggy when user mmap fb dev node and write
81dee67e215b23 Sudip Mukherjee      2015-03-03  813  	 * data into the bound over virtual size
d11ac7cbcc266c Sudip Mukherjee      2015-08-07  814  	 */
81dee67e215b23 Sudip Mukherjee      2015-03-03  815  	fix->smem_len = crtc->vidmem_size;
81dee67e215b23 Sudip Mukherjee      2015-03-03  816  	info->screen_size = fix->smem_len;
81dee67e215b23 Sudip Mukherjee      2015-03-03  817  	fix->line_length = line_length;
e359b6a863e19f Mike Rapoport        2015-10-26  818  	fix->mmio_start = sm750_dev->vidreg_start;
e359b6a863e19f Mike Rapoport        2015-10-26  819  	fix->mmio_len = sm750_dev->vidreg_size;
b610e1193a917f Matej Dujava         2020-04-30  820  
b610e1193a917f Matej Dujava         2020-04-30  821  	lynxfb_set_visual_mode(info);
81dee67e215b23 Sudip Mukherjee      2015-03-03  822  
81dee67e215b23 Sudip Mukherjee      2015-03-03  823  	/* set var */
81dee67e215b23 Sudip Mukherjee      2015-03-03  824  	var->activate = FB_ACTIVATE_NOW;
81dee67e215b23 Sudip Mukherjee      2015-03-03  825  	var->accel_flags = 0;
81dee67e215b23 Sudip Mukherjee      2015-03-03  826  	var->vmode = FB_VMODE_NONINTERLACED;
81dee67e215b23 Sudip Mukherjee      2015-03-03  827  
61c507cf652da1 Michel von Czettritz 2015-03-26  828  	ret = fb_alloc_cmap(&info->cmap, 256, 0);
61c507cf652da1 Michel von Czettritz 2015-03-26  829  	if (ret < 0) {
fbab250eb51d6d Artem Lytkin         2026-02-07  830  		dev_err(info->device, "Could not allocate memory for cmap.\n");
81dee67e215b23 Sudip Mukherjee      2015-03-03  831  		goto exit;
81dee67e215b23 Sudip Mukherjee      2015-03-03  832  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  833  
81dee67e215b23 Sudip Mukherjee      2015-03-03  834  exit:
81dee67e215b23 Sudip Mukherjee      2015-03-03  835  	lynxfb_ops_check_var(var, info);
81dee67e215b23 Sudip Mukherjee      2015-03-03  836  	return ret;
81dee67e215b23 Sudip Mukherjee      2015-03-03  837  }
81dee67e215b23 Sudip Mukherjee      2015-03-03  838  
81dee67e215b23 Sudip Mukherjee      2015-03-03  839  /*	chip specific g_option configuration routine */
700591a9adc8b1 Mike Rapoport        2015-10-26  840  static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
81dee67e215b23 Sudip Mukherjee      2015-03-03  841  {
81dee67e215b23 Sudip Mukherjee      2015-03-03  842  	char *opt;
81dee67e215b23 Sudip Mukherjee      2015-03-03  843  	int swap;
81dee67e215b23 Sudip Mukherjee      2015-03-03  844  
81dee67e215b23 Sudip Mukherjee      2015-03-03  845  	swap = 0;
81dee67e215b23 Sudip Mukherjee      2015-03-03  846  
cc34db609ff98c Madhumitha Sundar    2026-01-27  847  	sm750_dev->init_parm.chip_clk = 0;
cc34db609ff98c Madhumitha Sundar    2026-01-27  848  	sm750_dev->init_parm.mem_clk = 0;
cc34db609ff98c Madhumitha Sundar    2026-01-27  849  	sm750_dev->init_parm.master_clk = 0;
45a337c12624fc Jennifer Guo         2026-05-09  850  	sm750_dev->init_parm.power_mode = 0;
cc34db609ff98c Madhumitha Sundar    2026-01-27  851  	sm750_dev->init_parm.setAllEngOff = 0;
45a337c12624fc Jennifer Guo         2026-05-09  852  	sm750_dev->init_parm.reset_memory = 1;
81dee67e215b23 Sudip Mukherjee      2015-03-03  853  
81dee67e215b23 Sudip Mukherjee      2015-03-03  854  	/* defaultly turn g_hwcursor on for both view */
81dee67e215b23 Sudip Mukherjee      2015-03-03  855  	g_hwcursor = 3;
81dee67e215b23 Sudip Mukherjee      2015-03-03  856  
81dee67e215b23 Sudip Mukherjee      2015-03-03  857  	if (!src || !*src) {
c56de0967a658c Elise Lennion        2016-10-31  858  		dev_warn(&sm750_dev->pdev->dev, "no specific g_option.\n");
81dee67e215b23 Sudip Mukherjee      2015-03-03  859  		goto NO_PARAM;
81dee67e215b23 Sudip Mukherjee      2015-03-03  860  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  861  
0fa96e39279988 Sudip Mukherjee      2015-03-10  862  	while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
c56de0967a658c Elise Lennion        2016-10-31  863  		dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
c56de0967a658c Elise Lennion        2016-10-31  864  		dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
81dee67e215b23 Sudip Mukherjee      2015-03-03  865  
144634a6b42146 Katie Dunne          2017-02-19  866  		if (!strncmp(opt, "swap", strlen("swap"))) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  867  			swap = 1;
144634a6b42146 Katie Dunne          2017-02-19  868  		} else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
1757d106a9ce8c Mike Rapoport        2015-10-26  869  			sm750_dev->nocrt = 1;
144634a6b42146 Katie Dunne          2017-02-19  870  		} else if (!strncmp(opt, "36bit", strlen("36bit"))) {
94c938a0c15863 Shubham Chakraborty  2026-04-07  871  			sm750_dev->pnltype = SM750_DOUBLE_TFT;
144634a6b42146 Katie Dunne          2017-02-19  872  		} else if (!strncmp(opt, "18bit", strlen("18bit"))) {
94c938a0c15863 Shubham Chakraborty  2026-04-07  873  			sm750_dev->pnltype = SM750_DUAL_TFT;
144634a6b42146 Katie Dunne          2017-02-19  874  		} else if (!strncmp(opt, "24bit", strlen("24bit"))) {
94c938a0c15863 Shubham Chakraborty  2026-04-07  875  			sm750_dev->pnltype = SM750_24TFT;
144634a6b42146 Katie Dunne          2017-02-19  876  		} else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  877  			g_hwcursor &= ~0x1;
144634a6b42146 Katie Dunne          2017-02-19  878  		} else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  879  			g_hwcursor &= ~0x2;
144634a6b42146 Katie Dunne          2017-02-19  880  		} else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  881  			g_hwcursor = 0;
144634a6b42146 Katie Dunne          2017-02-19  882  		} else {
81dee67e215b23 Sudip Mukherjee      2015-03-03  883  			if (!g_fbmode[0]) {
81dee67e215b23 Sudip Mukherjee      2015-03-03 @884  				g_fbmode[0] = opt;
cee9ba1c30d051 Abdul Rauf           2017-01-08  885  				dev_info(&sm750_dev->pdev->dev,
cee9ba1c30d051 Abdul Rauf           2017-01-08  886  					 "find fbmode0 : %s\n", g_fbmode[0]);
81dee67e215b23 Sudip Mukherjee      2015-03-03  887  			} else if (!g_fbmode[1]) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  888  				g_fbmode[1] = opt;
cee9ba1c30d051 Abdul Rauf           2017-01-08  889  				dev_info(&sm750_dev->pdev->dev,
cee9ba1c30d051 Abdul Rauf           2017-01-08  890  					 "find fbmode1 : %s\n", g_fbmode[1]);
81dee67e215b23 Sudip Mukherjee      2015-03-03  891  			} else {
c56de0967a658c Elise Lennion        2016-10-31  892  				dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
81dee67e215b23 Sudip Mukherjee      2015-03-03  893  			}
81dee67e215b23 Sudip Mukherjee      2015-03-03  894  		}
81dee67e215b23 Sudip Mukherjee      2015-03-03  895  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  896  
81dee67e215b23 Sudip Mukherjee      2015-03-03  897  NO_PARAM:
e359b6a863e19f Mike Rapoport        2015-10-26  898  	if (sm750_dev->revid != SM750LE_REVISION_ID) {
a3f92cc94c6126 Mike Rapoport        2016-01-17  899  		if (sm750_dev->fb_count > 1) {
81dee67e215b23 Sudip Mukherjee      2015-03-03  900  			if (swap)
1757d106a9ce8c Mike Rapoport        2015-10-26  901  				sm750_dev->dataflow = sm750_dual_swap;
81dee67e215b23 Sudip Mukherjee      2015-03-03  902  			else
1757d106a9ce8c Mike Rapoport        2015-10-26  903  				sm750_dev->dataflow = sm750_dual_normal;
81dee67e215b23 Sudip Mukherjee      2015-03-03  904  		} else {
81dee67e215b23 Sudip Mukherjee      2015-03-03  905  			if (swap)
1757d106a9ce8c Mike Rapoport        2015-10-26  906  				sm750_dev->dataflow = sm750_simul_sec;
81dee67e215b23 Sudip Mukherjee      2015-03-03  907  			else
1757d106a9ce8c Mike Rapoport        2015-10-26  908  				sm750_dev->dataflow = sm750_simul_pri;
81dee67e215b23 Sudip Mukherjee      2015-03-03  909  		}
81dee67e215b23 Sudip Mukherjee      2015-03-03  910  	} else {
81dee67e215b23 Sudip Mukherjee      2015-03-03  911  		/* SM750LE only have one crt channel */
1757d106a9ce8c Mike Rapoport        2015-10-26  912  		sm750_dev->dataflow = sm750_simul_sec;
81dee67e215b23 Sudip Mukherjee      2015-03-03  913  		/* sm750le do not have complex attributes */
1757d106a9ce8c Mike Rapoport        2015-10-26  914  		sm750_dev->nocrt = 0;
81dee67e215b23 Sudip Mukherjee      2015-03-03  915  	}
81dee67e215b23 Sudip Mukherjee      2015-03-03  916  }
81dee67e215b23 Sudip Mukherjee      2015-03-03  917  

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
  2026-05-21 21:05 ` [PATCH] staging: sm750fb: add const to g_fbmode array Diego Fernando Mancera Gómez
  2026-05-21 21:09   ` Diego Fernando Mancera Gomez
  2026-05-23 20:33   ` kernel test robot
@ 2026-05-23 21:26   ` kernel test robot
  2 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2026-05-23 21:26 UTC (permalink / raw)
  To: Diego Fernando Mancera Gómez, gregkh, linux-staging
  Cc: llvm, oe-kbuild-all, m.steinmoetzger, guojy.bj, straube.linux,
	error27, linux-kernel, Diego Fernando Mancera Gómez

Hi Diego,

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/Diego-Fernando-Mancera-G-mez/staging-sm750fb-add-const-to-g_fbmode-array/20260522-050816
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260521210523.133725-2-diegomancera.dev%40gmail.com
patch subject: [PATCH] staging: sm750fb: add const to g_fbmode array
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20260524/202605240543.MkxvjE7m-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260524/202605240543.MkxvjE7m-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/202605240543.MkxvjE7m-lkp@intel.com/

All errors (new ones prefixed by >>):

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


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

81dee67e215b23f Sudip Mukherjee      2015-03-03  707  
81dee67e215b23f Sudip Mukherjee      2015-03-03  708  static int lynxfb_set_fbinfo(struct fb_info *info, int index)
81dee67e215b23f Sudip Mukherjee      2015-03-03  709  {
81dee67e215b23f Sudip Mukherjee      2015-03-03  710  	int i;
81dee67e215b23f Sudip Mukherjee      2015-03-03  711  	struct lynxfb_par *par;
e359b6a863e19f2 Mike Rapoport        2015-10-26  712  	struct sm750_dev *sm750_dev;
81dee67e215b23f Sudip Mukherjee      2015-03-03  713  	struct lynxfb_crtc *crtc;
81dee67e215b23f Sudip Mukherjee      2015-03-03  714  	struct lynxfb_output *output;
81dee67e215b23f Sudip Mukherjee      2015-03-03  715  	struct fb_var_screeninfo *var;
81dee67e215b23f Sudip Mukherjee      2015-03-03  716  	struct fb_fix_screeninfo *fix;
81dee67e215b23f Sudip Mukherjee      2015-03-03  717  
81dee67e215b23f Sudip Mukherjee      2015-03-03  718  	const struct fb_videomode *pdb[] = {
81dee67e215b23f Sudip Mukherjee      2015-03-03  719  		lynx750_ext, NULL, vesa_modes,
81dee67e215b23f Sudip Mukherjee      2015-03-03  720  	};
81dee67e215b23f Sudip Mukherjee      2015-03-03  721  	int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
d0856045f0e9fc9 Hungyu Lin           2026-04-01  722  	static const char * const fix_id[2] = {
81dee67e215b23f Sudip Mukherjee      2015-03-03  723  		"sm750_fb1", "sm750_fb2",
81dee67e215b23f Sudip Mukherjee      2015-03-03  724  	};
81dee67e215b23f Sudip Mukherjee      2015-03-03  725  
81dee67e215b23f Sudip Mukherjee      2015-03-03  726  	int ret, line_length;
81dee67e215b23f Sudip Mukherjee      2015-03-03  727  
81dee67e215b23f Sudip Mukherjee      2015-03-03  728  	ret = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  729  	par = (struct lynxfb_par *)info->par;
e359b6a863e19f2 Mike Rapoport        2015-10-26  730  	sm750_dev = par->dev;
81dee67e215b23f Sudip Mukherjee      2015-03-03  731  	crtc = &par->crtc;
81dee67e215b23f Sudip Mukherjee      2015-03-03  732  	output = &par->output;
81dee67e215b23f Sudip Mukherjee      2015-03-03  733  	var = &info->var;
81dee67e215b23f Sudip Mukherjee      2015-03-03  734  	fix = &info->fix;
81dee67e215b23f Sudip Mukherjee      2015-03-03  735  
81dee67e215b23f Sudip Mukherjee      2015-03-03  736  	/* set index */
81dee67e215b23f Sudip Mukherjee      2015-03-03  737  	par->index = index;
81dee67e215b23f Sudip Mukherjee      2015-03-03  738  	output->channel = &crtc->channel;
81dee67e215b23f Sudip Mukherjee      2015-03-03  739  	sm750fb_set_drv(par);
81dee67e215b23f Sudip Mukherjee      2015-03-03  740  
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  741  	/*
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  742  	 * set current cursor variable and proc pointer,
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  743  	 * must be set after crtc member initialized
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  744  	 */
fdc234d85210d91 Benjamin Philip      2021-07-28  745  	crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
e359b6a863e19f2 Mike Rapoport        2015-10-26  746  	crtc->cursor.mmio = sm750_dev->pvReg +
e359b6a863e19f2 Mike Rapoport        2015-10-26  747  		0x800f0 + (int)crtc->channel * 0x140;
81dee67e215b23f Sudip Mukherjee      2015-03-03  748  
cd33da26036ea54 Christopher Carbone  2022-08-23  749  	crtc->cursor.max_h = 64;
cd33da26036ea54 Christopher Carbone  2022-08-23  750  	crtc->cursor.max_w = 64;
39f9137268ee3df Benjamin Philip      2021-07-26  751  	crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
f50b4602fea62fe Jennifer Guo         2026-05-09  752  	crtc->cursor.vstart = sm750_dev->vmem + crtc->cursor.offset;
81dee67e215b23f Sudip Mukherjee      2015-03-03  753  
3de08a2d14ff8c7 Lorenzo Stoakes      2015-03-20  754  	memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
f7c8a046577e09d Thomas Zimmermann    2023-11-27  755  	if (!g_hwcursor)
52d0744d751d8f1 Arnd Bergmann        2016-11-09  756  		sm750_hw_cursor_disable(&crtc->cursor);
81dee67e215b23f Sudip Mukherjee      2015-03-03  757  
81dee67e215b23f Sudip Mukherjee      2015-03-03  758  	/* set info->fbops, must be set before fb_find_mode */
e359b6a863e19f2 Mike Rapoport        2015-10-26  759  	if (!sm750_dev->accel_off) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  760  		/* use 2d acceleration */
f7c8a046577e09d Thomas Zimmermann    2023-11-27  761  		if (!g_hwcursor)
f7c8a046577e09d Thomas Zimmermann    2023-11-27  762  			info->fbops = &lynxfb_ops_accel;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  763  		else
f7c8a046577e09d Thomas Zimmermann    2023-11-27  764  			info->fbops = &lynxfb_ops_accel_with_cursor;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  765  	} else {
f7c8a046577e09d Thomas Zimmermann    2023-11-27  766  		if (!g_hwcursor)
81dee67e215b23f Sudip Mukherjee      2015-03-03  767  			info->fbops = &lynxfb_ops;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  768  		else
f7c8a046577e09d Thomas Zimmermann    2023-11-27  769  			info->fbops = &lynxfb_ops_with_cursor;
f7c8a046577e09d Thomas Zimmermann    2023-11-27  770  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  771  
81dee67e215b23f Sudip Mukherjee      2015-03-03  772  	if (!g_fbmode[index]) {
81dee67e215b23f Sudip Mukherjee      2015-03-03 @773  		g_fbmode[index] = g_def_fbmode;
81dee67e215b23f Sudip Mukherjee      2015-03-03  774  		if (index)
81dee67e215b23f Sudip Mukherjee      2015-03-03  775  			g_fbmode[index] = g_fbmode[0];
81dee67e215b23f Sudip Mukherjee      2015-03-03  776  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  777  
81dee67e215b23f Sudip Mukherjee      2015-03-03  778  	for (i = 0; i < 3; i++) {
81dee67e215b23f Sudip Mukherjee      2015-03-03  779  		ret = fb_find_mode(var, info, g_fbmode[index],
81dee67e215b23f Sudip Mukherjee      2015-03-03  780  				   pdb[i], cdb[i], NULL, 8);
81dee67e215b23f Sudip Mukherjee      2015-03-03  781  
db7fb3588ab4920 Artem Lytkin         2026-02-23  782  		if (ret == 1 || ret == 2)
81dee67e215b23f Sudip Mukherjee      2015-03-03  783  			break;
81dee67e215b23f Sudip Mukherjee      2015-03-03  784  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  785  
81dee67e215b23f Sudip Mukherjee      2015-03-03  786  	/* set par */
81dee67e215b23f Sudip Mukherjee      2015-03-03  787  	par->info = info;
81dee67e215b23f Sudip Mukherjee      2015-03-03  788  
81dee67e215b23f Sudip Mukherjee      2015-03-03  789  	/* set info */
e3a3f9f5123683b Mike Rapoport        2015-10-26  790  	line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
e3a3f9f5123683b Mike Rapoport        2015-10-26  791  			    crtc->line_pad);
81dee67e215b23f Sudip Mukherjee      2015-03-03  792  
81dee67e215b23f Sudip Mukherjee      2015-03-03  793  	info->pseudo_palette = &par->pseudo_palette[0];
cc59bde1c920ab6 Benjamin Philip      2021-07-28  794  	info->screen_base = crtc->v_screen;
81dee67e215b23f Sudip Mukherjee      2015-03-03  795  	info->screen_size = line_length * var->yres_virtual;
81dee67e215b23f Sudip Mukherjee      2015-03-03  796  
81dee67e215b23f Sudip Mukherjee      2015-03-03  797  	/* set info->fix */
81dee67e215b23f Sudip Mukherjee      2015-03-03  798  	fix->type = FB_TYPE_PACKED_PIXELS;
81dee67e215b23f Sudip Mukherjee      2015-03-03  799  	fix->type_aux = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  800  	fix->xpanstep = crtc->xpanstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  801  	fix->ypanstep = crtc->ypanstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  802  	fix->ywrapstep = crtc->ywrapstep;
81dee67e215b23f Sudip Mukherjee      2015-03-03  803  	fix->accel = FB_ACCEL_SMI;
81dee67e215b23f Sudip Mukherjee      2015-03-03  804  
8c475735085a7db Tim Wassink          2025-12-21  805  	strscpy(fix->id, fix_id[index], sizeof(fix->id));
81dee67e215b23f Sudip Mukherjee      2015-03-03  806  
fdc234d85210d91 Benjamin Philip      2021-07-28  807  	fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  808  	/*
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  809  	 * according to mmap experiment from user space application,
81dee67e215b23f Sudip Mukherjee      2015-03-03  810  	 * fix->mmio_len should not larger than virtual size
81dee67e215b23f Sudip Mukherjee      2015-03-03  811  	 * (xres_virtual x yres_virtual x ByPP)
81dee67e215b23f Sudip Mukherjee      2015-03-03  812  	 * Below line maybe buggy when user mmap fb dev node and write
81dee67e215b23f Sudip Mukherjee      2015-03-03  813  	 * data into the bound over virtual size
d11ac7cbcc266c6 Sudip Mukherjee      2015-08-07  814  	 */
81dee67e215b23f Sudip Mukherjee      2015-03-03  815  	fix->smem_len = crtc->vidmem_size;
81dee67e215b23f Sudip Mukherjee      2015-03-03  816  	info->screen_size = fix->smem_len;
81dee67e215b23f Sudip Mukherjee      2015-03-03  817  	fix->line_length = line_length;
e359b6a863e19f2 Mike Rapoport        2015-10-26  818  	fix->mmio_start = sm750_dev->vidreg_start;
e359b6a863e19f2 Mike Rapoport        2015-10-26  819  	fix->mmio_len = sm750_dev->vidreg_size;
b610e1193a917f4 Matej Dujava         2020-04-30  820  
b610e1193a917f4 Matej Dujava         2020-04-30  821  	lynxfb_set_visual_mode(info);
81dee67e215b23f Sudip Mukherjee      2015-03-03  822  
81dee67e215b23f Sudip Mukherjee      2015-03-03  823  	/* set var */
81dee67e215b23f Sudip Mukherjee      2015-03-03  824  	var->activate = FB_ACTIVATE_NOW;
81dee67e215b23f Sudip Mukherjee      2015-03-03  825  	var->accel_flags = 0;
81dee67e215b23f Sudip Mukherjee      2015-03-03  826  	var->vmode = FB_VMODE_NONINTERLACED;
81dee67e215b23f Sudip Mukherjee      2015-03-03  827  
61c507cf652da1b Michel von Czettritz 2015-03-26  828  	ret = fb_alloc_cmap(&info->cmap, 256, 0);
61c507cf652da1b Michel von Czettritz 2015-03-26  829  	if (ret < 0) {
fbab250eb51d6d6 Artem Lytkin         2026-02-07  830  		dev_err(info->device, "Could not allocate memory for cmap.\n");
81dee67e215b23f Sudip Mukherjee      2015-03-03  831  		goto exit;
81dee67e215b23f Sudip Mukherjee      2015-03-03  832  	}
81dee67e215b23f Sudip Mukherjee      2015-03-03  833  
81dee67e215b23f Sudip Mukherjee      2015-03-03  834  exit:
81dee67e215b23f Sudip Mukherjee      2015-03-03  835  	lynxfb_ops_check_var(var, info);
81dee67e215b23f Sudip Mukherjee      2015-03-03  836  	return ret;
81dee67e215b23f Sudip Mukherjee      2015-03-03  837  }
81dee67e215b23f Sudip Mukherjee      2015-03-03  838  

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-05-23 21:27 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 14:26 [PATCH] staging: sm750fb: add const to g_fbmode array Diego Fernando Mancera Gómez
2026-05-21 19:52 ` Ahmet Sezgin Duran
2026-05-21 20:33 ` Ahmet Sezgin Duran
2026-05-21 20:47   ` Diego Fernando Mancera Gomez
  -- strict thread matches above, loose matches on Subject: below --
2026-05-21 21:05 [PATCH] staging: rtl8723bs: clean up if-else logic in odm_HWConfig.c Diego Fernando Mancera Gómez
2026-05-21 21:05 ` [PATCH] staging: sm750fb: add const to g_fbmode array Diego Fernando Mancera Gómez
2026-05-21 21:09   ` Diego Fernando Mancera Gomez
2026-05-23 20:33   ` kernel test robot
2026-05-23 21:26   ` kernel test robot
2026-05-11 10:52 [PATCH] staging: sm750fb: Add " Chhabilal Dangal
2026-05-09 16:40 Alone
2026-05-11  7:57 ` Greg Kroah-Hartman
     [not found]   ` <CAF9nfaDEys+8bcnFRVWWoAvyrvPgXmENbASABG+4dBjMinaP5A@mail.gmail.com>
2026-05-11 10:23     ` Greg Kroah-Hartman
2026-05-11 15:37 ` kernel test robot
2026-05-06  3:56 [PATCH] staging: sm750fb: add " Chaitanya Sabnis
2026-05-06  6:27 ` Ahmet Sezgin Duran
2026-05-06  7:14   ` Chaitanya Sabnis
2026-05-06 10:36     ` Ahmet Sezgin Duran
2026-05-06 10:44       ` Chaitanya Sabnis
2026-05-11 20:42 ` kernel test robot

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