Re: [PATCH] staging: sm750fb: add const to g_fbmode array

From: Chaitanya Sabnis

Date: Wed May 06 2026 - 06:46:21 EST


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@xxxxxxxxxxxxxxx> wrote:
>
> On 5/6/26 10:14 AM, Chaitanya Sabnis wrote:
> > On Wed, May 6, 2026 at 11:57 AM Ahmet Sezgin Duran ahmet@xxxxxxxxxxxxxxx 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