* [PATCH] fbdev: Fix fb_new_modelist to prevent null-ptr-deref in fb_videomode_to_var
From: Ian Bridges @ 2026-06-25 4:13 UTC (permalink / raw)
To: Simona Vetter, Helge Deller, linux-fbdev, dri-devel, linux-kernel
info->var, a framebuffer's current mode, is expected to have a matching
entry in info->modelist. var_to_display() relies on this and treats a
failed fb_match_mode() as "This should not happen". fb_set_var() keeps it
true by adding the mode to the list on every change, and
do_register_framebuffer() does the same at registration.
store_modes() replaces the modelist from userspace. fb_new_modelist()
validates the new modes but does not check that info->var still has a
match. It relies on fbcon_new_modelist() to re-point consoles, but that
only handles consoles mapped to the framebuffer. With fbcon unbound there
are none, so info->var is left describing a mode that is no longer in the
list.
A later console takeover runs var_to_display(), where fb_match_mode()
returns NULL and leaves fb_display[i].mode NULL. fbcon_switch() passes it
to display_to_var(), and fb_videomode_to_var() dereferences the NULL mode.
Keep the current mode in the list in fb_new_modelist(), the same way
fb_set_var() does.
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Ian Bridges <icb@fastmail.org>
---
This patch fixes a NULL pointer dereference in fb_videomode_to_var(), reached
through the framebuffer console. The fix is in fb_new_modelist(). Sashiko
flagged this dereference while reviewing the fix for a separate NULL pointer
dereference in fbcon_new_modelist() [1].
The dereference happens when a framebuffer's current mode is dropped from its
modelist while fbcon is unbound, and a console is then taken over onto it, as
follows.
1. With fbcon unbound, a write to the modes attribute calls store_modes()
(fbsysfs.c:91), which replaces the modelist and calls fb_new_modelist()
(fbsysfs.c:108). fb_new_modelist() (fbmem.c:746) validates the new modes but
does not keep info->var in the list, and the fbcon_new_modelist() it calls
(fbmem.c:770) only re-points consoles mapped to the framebuffer. With fbcon
unbound there are none, so info->var is left describing a mode no longer in
the list.
2. Mapping a console with FBIOPUT_CON2FBMAP takes the framebuffer over,
set_con2fb_map() -> do_fbcon_takeover() (fbcon.c:930).
3. The takeover initialises the console, fbcon_init() -> var_to_display()
(fbcon.c:1113). fb_match_mode() finds no entry for info->var, so
var_to_display() leaves fb_display[i].mode NULL (fbcon.c:988).
4. The takeover switches to the console, fbcon_switch() -> display_to_var()
(fbcon.c:2181), and fb_videomode_to_var() reads the NULL mode
(modedb.c:905). This is a NULL pointer dereference.
The faulting line is not touched by this patch:
var->xres = mode->xres;
mode is the fb_display[i].mode passed by display_to_var(). Instead of guarding
this read, the patch keeps info->var in the modelist in fb_new_modelist(),
so the mode is never NULL here.
The same dereference, fb_videomode_to_var() on a NULL mode, was fixed twice
before, by CVE-2025-38214 in fb_set_var() and CVE-2025-38215 in
do_register_framebuffer(). Both keep info->var in the modelist, and both are
already in this base. This bug reaches the same line through a different
path, a modelist replacement, and this fix keeps info->var in the list
the same way.
It reproduces on a KASAN kernel with two framebuffers:
1. Unbind fbcon, so the store in step 3 does not re-sync the mode.
2. Set a video mode on fb0 with FBIOPUT_VSCREENINFO.
3. Write a different modelist to /sys/class/graphics/fb0/modes, so the mode
from step 2 is no longer in the modelist.
4. Map a console to fb0 with FBIOPUT_CON2FBMAP. With fbcon unbound this takes
fb0 over, sets the console mode to NULL (the mode is not in the modelist),
and switches to the console.
The reproducer was written with the help of a coding agent (Claude Code). The
patch is against commit 3726ce7f6cef on the for-next branch of
git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git. The
file offsets above are from that commit. The defect is present in the initial
2.6.12-rc2 import, so there is no Fixes tag.
[1] https://lore.kernel.org/all/20260624213027.6C1E01F000E9@smtp.kernel.org/
drivers/video/fbdev/core/fbmem.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index e5221653ec2b..2f1c56e5a7a2 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -767,6 +767,18 @@ int fb_new_modelist(struct fb_info *info)
if (list_empty(&info->modelist))
return 1;
+ /*
+ * The new modelist may not contain the current mode (info->var), and
+ * fbcon_new_modelist() below only re-points consoles mapped to this
+ * framebuffer. Add the current mode here so info->var keeps a match
+ * even when fbcon is unbound.
+ */
+ if (!fb_match_mode(&info->var, &info->modelist)) {
+ fb_var_to_videomode(&mode, &info->var);
+ if (fb_add_videomode(&mode, &info->modelist))
+ return 1;
+ }
+
fbcon_new_modelist(info);
return 0;
--
2.47.3
^ permalink raw reply related
* [PATCH] fbdev: goldfishfb: fail pan display on base-update timeout
From: Pengpeng Hou @ 2026-06-25 3:01 UTC (permalink / raw)
To: Helge Deller; +Cc: linux-fbdev, dri-devel, linux-kernel, pengpeng
goldfish_fb_pan_display() waits for the device to acknowledge the new
framebuffer base, but it only logs a timeout and still reports success.
The probe path also ignores the initial pan-display result before
registering the framebuffer.
Return -ETIMEDOUT when the base-update acknowledgment does not arrive,
and propagate that error from the initial probe-time base update before
the framebuffer is published.
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
drivers/video/fbdev/goldfishfb.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
index c9871281bc1d..e5d79886ea66 100644
--- a/drivers/video/fbdev/goldfishfb.c
+++ b/drivers/video/fbdev/goldfishfb.c
@@ -138,10 +138,12 @@ static int goldfish_fb_pan_display(struct fb_var_screeninfo *var,
writel(fb->fb.fix.smem_start + fb->fb.var.xres * 2 * var->yoffset,
fb->reg_base + FB_SET_BASE);
spin_unlock_irqrestore(&fb->lock, irq_flags);
- wait_event_timeout(fb->wait,
- fb->base_update_count != base_update_count, HZ / 15);
- if (fb->base_update_count == base_update_count)
+ if (!wait_event_timeout(fb->wait,
+ fb->base_update_count != base_update_count,
+ HZ / 15)) {
pr_err("%s: timeout waiting for base update\n", __func__);
+ return -ETIMEDOUT;
+ }
return 0;
}
@@ -251,7 +253,9 @@ static int goldfish_fb_probe(struct platform_device *pdev)
goto err_request_irq_failed;
writel(FB_INT_BASE_UPDATE_DONE, fb->reg_base + FB_INT_ENABLE);
- goldfish_fb_pan_display(&fb->fb.var, &fb->fb); /* updates base */
+ ret = goldfish_fb_pan_display(&fb->fb.var, &fb->fb); /* updates base */
+ if (ret)
+ goto err_pan_display_failed;
ret = register_framebuffer(&fb->fb);
if (ret)
@@ -259,6 +263,7 @@ static int goldfish_fb_probe(struct platform_device *pdev)
return 0;
err_register_framebuffer_failed:
+err_pan_display_failed:
free_irq(fb->irq, fb);
err_request_irq_failed:
err_fb_set_var_failed:
base-commit: 502d801f0ab03e4f32f9a33d203154ce84887921
--
2.50.1 (Apple Git-155)
^ permalink raw reply related
* [PATCH] staging: sm750fb: make g_fbmode array const pointer const
From: Shravya @ 2026-06-24 23:39 UTC (permalink / raw)
To: sudipm.mukherjee, teddy.wang, gregkh
Cc: linux-fbdev, linux-staging, linux-kernel, Shravya
Add the const qualifier to the g_fbmode array pointers to make
the entire structure read-only. This resolves a checkpatch warning
and allows the compiler to put the data into the read-only segment.
Signed-off-by: Shravya <shravy112@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
* Re: [PATCH] fbcon: fix NULL pointer dereference for a console without vc_data
From: Ian Bridges @ 2026-06-24 21:56 UTC (permalink / raw)
To: sashiko-reviews
Cc: Helge Deller, Thomas Zimmermann, Simona Vetter, dri-devel,
linux-fbdev, linux-kernel
In-Reply-To: <20260624213027.6C1E01F000E9@smtp.kernel.org>
On Wed, Jun 24, 2026 at 09:30:26PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
>
> Pre-existing issues:
> - [High] Pre-existing NULL pointer dereference via `font_data_get(NULL)` in `fbcon_set_disp()` if the foreground console's font is uninitialized.
> - [High] Pre-existing NULL pointer dereference in `fb_videomode_to_var()` when a console is switched to or resized while its `mode` is NULL.
> --
>
> commit 6f0719a9bd0a2231fe53bfe57ca1abf9ddec2785
> Author: Ian Bridges <icb@fastmail.org>
>
> fbcon: fix NULL pointer dereference for a console without vc_data
>
> This commit fixes a NULL pointer dereference in fbcon_new_modelist(). It
> does this by ensuring a console's mode is only set while it has a valid
> vc_data structure.
>
> Closes: https://syzkaller.appspot.com/bug?extid=42525d636f430fd5d983
>
> > diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> > index b0e3e765360d1..7187be0eea872 100644
> > --- a/drivers/video/fbdev/core/fbcon.c
> > +++ b/drivers/video/fbdev/core/fbcon.c
> > @@ -1274,6 +1274,7 @@ static void fbcon_deinit(struct vc_data *vc)
> > int idx;
> >
> > fbcon_free_font(p);
> > + p->mode = NULL;
>
> [Severity: High]
> This is a pre-existing issue, but does setting p->mode to NULL here expose
> us to a crash during a VT switch?
>
> If a subsequent fbcon_init() fails early (e.g. var_to_display() fails to find
> a matching mode), p->mode will remain NULL. Later, if a user switches to this
> VT, the VT layer calls fbcon_switch(), which unconditionally passes p to
> display_to_var():
This is a seperate bug that I'm also working on a patch for (although it
is proving a bit more difficult to find the correct place to make the
change). The NULL mode that fbcon_switch() reaches through
display_to_var() is set by var_to_display() at
drivers/video/fbdev/core/fbcon.c:988, which assigns disp->mode the result of
fb_match_mode(). On the no-match path that result is NULL, independent of
this patch. The p->mode = NULL added to fbcon_deinit() only applies to a
console that has been deinitialised and has no vc_data. fbcon_new_modelist()
skips such a console through its existing mode check, and the console cannot
be switched to without first being re-initialised, which re-runs
var_to_display() and overwrites the mode. So this patch does not add a path
that reaches display_to_var() with a NULL mode. The dereference is reached
when the modelist is replaced from userspace while fbcon is unbound.
>
> drivers/video/fbdev/core/fbcon.c:fbcon_switch() {
> ...
> memset(&var, 0, sizeof(struct fb_var_screeninfo));
> display_to_var(&var, p);
> ...
> }
>
> display_to_var() then calls fb_videomode_to_var():
>
> drivers/video/fbdev/core/fbcon.c:display_to_var() {
> ...
> fb_videomode_to_var(var, disp->mode);
> ...
> }
>
> And fb_videomode_to_var() immediately dereferences the pointer:
>
> drivers/video/fbdev/core/modedb.c:fb_videomode_to_var() {
> ...
> var->xres = mode->xres;
> ...
> }
>
> Can this lead to a NULL pointer dereference if the modelist is altered from
> userspace?
>
> > idx = con2fb_map[vc->vc_num];
> >
> > if (idx == -1)
>
> [ ... ]
>
> > @@ -1445,14 +1446,14 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
> >
> > p = &fb_display[unit];
> >
> > - if (var_to_display(p, var, info))
> > - return;
> > -
> > vc = vc_cons[unit].d;
> >
> > if (!vc)
> > return;
> >
> > + if (var_to_display(p, var, info))
> > + return;
> > +
> > default_mode = vc->vc_display_fg;
> > svc = *default_mode;
> > t = &fb_display[svc->vc_num];
>
> [Severity: High]
> This is a pre-existing issue, but can this lead to a NULL pointer dereference
> in font_data_get() if the foreground console's font is uninitialized?
>
The block quoted sits below the hunk, and this patch only moves the vc_data
check ahead of var_to_display(). That block is reached only after
var_to_display() succeeds and vc is non-NULL, which holds in both the old and
the new order, so its reachability is unchanged with this patch.
Ian
> Just below this hunk in fbcon_set_disp(), the code does:
>
> if (!p->fontdata) {
> ...
> p->fontdata = t->fontdata;
> font_data_get(p->fontdata);
> }
>
> If fbcon_init() previously failed early for the foreground console, its
> t->fontdata could be NULL. This assigns NULL to p->fontdata and then passes
> it to font_data_get():
>
> lib/fonts/fonts.c:font_data_get() {
> if (font_data_is_internal(fd))
> return; /* never ref static data */
>
> if (WARN_ON(!REFCOUNT(fd)))
> return; /* should never be 0 */
> ++REFCOUNT(fd);
> }
>
> The REFCOUNT() macro and font_data_is_internal() will unconditionally
> dereference fd, causing a crash if it is NULL. Does this need an extra NULL
> check?
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/ajxICA0v-_5NrqhS@dev?part=1
^ permalink raw reply
* [PATCH] fbcon: fix NULL pointer dereference for a console without vc_data
From: Ian Bridges @ 2026-06-24 21:11 UTC (permalink / raw)
To: Helge Deller, Thomas Zimmermann, Simona Vetter, dri-devel,
linux-fbdev, linux-kernel
fbcon_new_modelist() runs when a framebuffer's modelist changes. For each
console mapped to it with fb_display[i].mode set, it reads vc_cons[i].d and
passes the vc_num to fbcon_set_disp(). This assumes a console with a mode
set has a vc_data, but it can be NULL. fbcon_set_disp() sets
fb_display[i].mode before it checks vc_data, and fbcon_deinit() leaves the
mode set after the vc_data is freed. fbcon_new_modelist() then dereferences
the NULL vc_data.
Keep fb_display[i].mode set only while the console has a vc_data. Check
vc_data before setting the mode in fbcon_set_disp(), and clear the mode in
fbcon_deinit(). The existing mode check in fbcon_new_modelist() then skips
such consoles.
Reported-by: syzbot+42525d636f430fd5d983@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=42525d636f430fd5d983
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Ian Bridges <icb@fastmail.org>
---
This patch fixes a NULL pointer dereference in the framebuffer console code.
fbcon_new_modelist() dereferences a NULL vc_data. It was found while writing
a reproducer for a separate use-after-free in store_modes(). Sashiko
independently flagged the same dereference in its review of the fix for that
use-after-free [1].
The dereference happens when a console has fb_display[i].mode set but no
vc_data, and the modelist is then replaced, as follows.
1. A console ends up with fb_display[i].mode set while vc_cons[i].d is NULL.
Either fbcon_set_disp() sets the mode (fbcon.c:1446) before it checks
vc_data, so mapping an unused console with FBIOPUT_CON2FBMAP leaves the
mode set, or fbcon_deinit() (fbcon.c:1268) frees the vc_data but keeps the
mode.
2. A write to the modes attribute calls store_modes() (fbsysfs.c:91), which
replaces the modelist and calls fb_new_modelist() (fbsysfs.c:108).
3. fb_new_modelist() calls fbcon_new_modelist() (fbmem.c:770).
4. fbcon_new_modelist() walks the consoles mapped to the framebuffer, takes
vc = vc_cons[i].d for the one with the mode set, and reads vc->vc_num with
vc NULL (fbcon.c:3046). This is a NULL pointer dereference.
This patch does not change that line:
fbcon_set_disp(info, &var, vc->vc_num);
vc is vc_cons[i].d, which is NULL.
syzbot reported the same crash, with the call stack store_modes() ->
fb_new_modelist() -> fbcon_new_modelist() [2]. That report had no reproducer
and was closed as obsolete.
It reproduces on a KASAN kernel with two framebuffers, two ways:
1. Map an unused console to one framebuffer and back to the other with
FBIOPUT_CON2FBMAP, then write a modelist to that framebuffer's modes
attribute.
2. Open and close /dev/ttyN, then write a modelist to its framebuffer's
modes attribute.
The reproducer was written with the help of a coding agent (Claude Code). The
patch is against commit 3726ce7f6cef on the for-next branch of
git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git. The
file offsets above are from that commit. The dereference is present in the
initial 2.6.12-rc2 import, so there is no Fixes tag.
[1] https://lore.kernel.org/all/20260622080749.D7FC61F000E9@smtp.kernel.org/
[2] https://syzkaller.appspot.com/bug?extid=42525d636f430fd5d983
drivers/video/fbdev/core/fbcon.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 9077d3b99357..97d4b836b26a 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -1273,6 +1273,7 @@ static void fbcon_deinit(struct vc_data *vc)
int idx;
fbcon_free_font(p);
+ p->mode = NULL;
idx = con2fb_map[vc->vc_num];
if (idx == -1)
@@ -1443,14 +1444,14 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
p = &fb_display[unit];
- if (var_to_display(p, var, info))
- return;
-
vc = vc_cons[unit].d;
if (!vc)
return;
+ if (var_to_display(p, var, info))
+ return;
+
default_mode = vc->vc_display_fg;
svc = *default_mode;
t = &fb_display[svc->vc_num];
--
2.47.3
^ permalink raw reply related
* [PATCH] fbdev: via: return an error when DMA copy times out
From: Pengpeng Hou @ 2026-06-24 14:43 UTC (permalink / raw)
To: Florian Tobias Schandinat, Helge Deller
Cc: Pengpeng Hou, linux-fbdev, dri-devel, linux-kernel
viafb_dma_copy_out_sg() logs a VIA DMA timeout when the DONE bit is not
set after the completion wait and grace delay, but still returns success
to the caller.
Preserve the existing cleanup sequence and return -ETIMEDOUT when the DMA
engine did not report completion.
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
drivers/video/fbdev/via/via-core.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/via/via-core.c b/drivers/video/fbdev/via/via-core.c
index a8d4a3e2c..ff691f83e 100644
--- a/drivers/video/fbdev/via/via-core.c
+++ b/drivers/video/fbdev/via/via-core.c
@@ -234,6 +234,7 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg)
dma_addr_t descr_handle;
unsigned long flags;
int i;
+ int ret = 0;
struct scatterlist *sgentry;
dma_addr_t nextdesc;
@@ -290,8 +291,10 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg)
*/
wait_for_completion_timeout(&viafb_dma_completion, 1);
msleep(1);
- if ((viafb_mmio_read(VDMA_CSR0)&VDMA_C_DONE) == 0)
+ if ((viafb_mmio_read(VDMA_CSR0) & VDMA_C_DONE) == 0) {
printk(KERN_ERR "VIA DMA timeout!\n");
+ ret = -ETIMEDOUT;
+ }
/*
* Clean up and we're done.
*/
@@ -301,7 +304,7 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg)
dma_free_coherent(&global_dev.pdev->dev,
nsg*sizeof(struct viafb_vx855_dma_descr), descrpages,
descr_handle);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(viafb_dma_copy_out_sg);
#endif /* CONFIG_VIDEO_VIA_CAMERA */
--
2.50.1 (Apple Git-155)
^ permalink raw reply related
* Re: [PATCH] staging: fbtft: use ARRAY_SIZE() in NUMARGS macro
From: kernel test robot @ 2026-06-24 13:02 UTC (permalink / raw)
To: Joyeta Modak, andy, gregkh
Cc: llvm, oe-kbuild-all, dri-devel, linux-fbdev, linux-staging,
linux-kernel, Joyeta Modak
In-Reply-To: <20260624073804.4391-1-joyetamdk@gmail.com>
Hi Joyeta,
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/Joyeta-Modak/staging-fbtft-use-ARRAY_SIZE-in-NUMARGS-macro/20260624-153912
base: staging/staging-testing
patch link: https://lore.kernel.org/r/20260624073804.4391-1-joyetamdk%40gmail.com
patch subject: [PATCH] staging: fbtft: use ARRAY_SIZE() in NUMARGS macro
config: um-randconfig-002-20260624 (https://download.01.org/0day-ci/archive/20260624/202606242026.MmYHG2FZ-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/20260624/202606242026.MmYHG2FZ-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/202606242026.MmYHG2FZ-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/staging/fbtft/fb_ili9486.c:13:
In file included from drivers/staging/fbtft/fbtft.h:8:
In file included from include/linux/fb.h:5:
In file included from include/uapi/linux/fb.h:6:
In file included from include/linux/i2c.h:19:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:27:
In file included from include/linux/kernel_stat.h:8:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:24:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:12:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1209 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^
>> drivers/staging/fbtft/fb_ili9486.c:51:11: error: initializer element is not a compile-time constant
51 | 0x80 | (par->bgr << 3));
| ~~~~~^~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_ili9486.c:55:11: error: initializer element is not a compile-time constant
55 | 0x20 | (par->bgr << 3));
| ~~~~~^~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_ili9486.c:59:11: error: initializer element is not a compile-time constant
59 | 0x40 | (par->bgr << 3));
| ~~~~~^~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_ili9486.c:63:11: error: initializer element is not a compile-time constant
63 | 0xE0 | (par->bgr << 3));
| ~~~~~^~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
1 warning and 4 errors generated.
--
In file included from drivers/staging/fbtft/fbtft-core.c:18:
In file included from include/linux/fb.h:5:
In file included from include/uapi/linux/fb.h:6:
In file included from include/linux/i2c.h:19:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:27:
In file included from include/linux/kernel_stat.h:8:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:24:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:12:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1209 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^
>> drivers/staging/fbtft/fbtft-core.c:204:15: error: initializer element is not a compile-time constant
204 | (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF);
| ~~~~~~~~~~^~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fbtft-core.c:207:15: error: initializer element is not a compile-time constant
207 | (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF);
| ~~~~~~~~~~^~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
1 warning and 2 errors generated.
--
In file included from drivers/staging/fbtft/fb_upd161704.c:17:
In file included from drivers/staging/fbtft/fbtft.h:8:
In file included from include/linux/fb.h:5:
In file included from include/uapi/linux/fb.h:6:
In file included from include/linux/i2c.h:19:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:27:
In file included from include/linux/kernel_stat.h:8:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:24:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:12:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1209 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^
>> drivers/staging/fbtft/fb_upd161704.c:119:26: error: initializer element is not a compile-time constant
119 | write_reg(par, 0x0006, xs);
| ^~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_upd161704.c:120:26: error: initializer element is not a compile-time constant
120 | write_reg(par, 0x0007, ys);
| ^~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_upd161704.c:123:36: error: initializer element is not a compile-time constant
123 | write_reg(par, 0x0006, WIDTH - 1 - xs);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ~~~~~~~~^~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ~~~~~~~~~~~~~~~~^~~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_upd161704.c:124:37: error: initializer element is not a compile-time constant
124 | write_reg(par, 0x0007, HEIGHT - 1 - ys);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ~~~~~~~~^~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ~~~~~~~~~~~~~~~~^~~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_upd161704.c:127:36: error: initializer element is not a compile-time constant
127 | write_reg(par, 0x0006, WIDTH - 1 - ys);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ~~~~~~~~^~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ~~~~~~~~~~~~~~~~^~~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
--
In file included from drivers/staging/fbtft/fb_pcd8544.c:15:
In file included from include/linux/spi/spi.h:17:
In file included from include/linux/scatterlist.h:9:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1209 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^
>> drivers/staging/fbtft/fb_pcd8544.c:53:17: error: initializer element is not a compile-time constant
53 | write_reg(par, 0x04 | (tc & 0x3));
| ^~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_pcd8544.c:63:17: error: initializer element is not a compile-time constant
63 | write_reg(par, 0x10 | (bs & 0x7));
| ^~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
drivers/staging/fbtft/fb_pcd8544.c:137:17: error: initializer element is not a compile-time constant
137 | write_reg(par, 0x80 | curves[0]);
| ^~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:240:47: note: expanded from macro 'write_reg'
240 | ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:237:43: note: expanded from macro 'NUMARGS'
237 | #define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
| ^~~~~~~~~~~
include/linux/array_size.h:11:75: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler.h:204:39: note: expanded from macro '__is_array'
204 | #define __is_array(a) (!__same_type((a), &(a)[0]))
| ^
include/linux/compiler_types.h:610:63: note: expanded from macro '__same_type'
610 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/compiler.h:200:84: note: expanded from macro '__BUILD_BUG_ON_ZERO_MSG'
200 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
| ^
1 warning and 3 errors generated.
..
vim +51 drivers/staging/fbtft/fb_ili9486.c
8d64b032aa71963 Thomas Petazzoni 2014-12-31 45
8d64b032aa71963 Thomas Petazzoni 2014-12-31 46 static int set_var(struct fbtft_par *par)
8d64b032aa71963 Thomas Petazzoni 2014-12-31 47 {
8d64b032aa71963 Thomas Petazzoni 2014-12-31 48 switch (par->info->var.rotate) {
8d64b032aa71963 Thomas Petazzoni 2014-12-31 49 case 0:
49475ed0cbb5623 Priit Laes 2015-12-20 50 write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
49475ed0cbb5623 Priit Laes 2015-12-20 @51 0x80 | (par->bgr << 3));
8d64b032aa71963 Thomas Petazzoni 2014-12-31 52 break;
8d64b032aa71963 Thomas Petazzoni 2014-12-31 53 case 90:
49475ed0cbb5623 Priit Laes 2015-12-20 54 write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
49475ed0cbb5623 Priit Laes 2015-12-20 55 0x20 | (par->bgr << 3));
8d64b032aa71963 Thomas Petazzoni 2014-12-31 56 break;
8d64b032aa71963 Thomas Petazzoni 2014-12-31 57 case 180:
49475ed0cbb5623 Priit Laes 2015-12-20 58 write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
49475ed0cbb5623 Priit Laes 2015-12-20 59 0x40 | (par->bgr << 3));
8d64b032aa71963 Thomas Petazzoni 2014-12-31 60 break;
8d64b032aa71963 Thomas Petazzoni 2014-12-31 61 case 270:
49475ed0cbb5623 Priit Laes 2015-12-20 62 write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
49475ed0cbb5623 Priit Laes 2015-12-20 63 0xE0 | (par->bgr << 3));
8d64b032aa71963 Thomas Petazzoni 2014-12-31 64 break;
8d64b032aa71963 Thomas Petazzoni 2014-12-31 65 default:
8d64b032aa71963 Thomas Petazzoni 2014-12-31 66 break;
8d64b032aa71963 Thomas Petazzoni 2014-12-31 67 }
8d64b032aa71963 Thomas Petazzoni 2014-12-31 68
8d64b032aa71963 Thomas Petazzoni 2014-12-31 69 return 0;
8d64b032aa71963 Thomas Petazzoni 2014-12-31 70 }
8d64b032aa71963 Thomas Petazzoni 2014-12-31 71
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [PATCH] staging: fbtft: use ARRAY_SIZE() in NUMARGS macro
From: Andy Shevchenko @ 2026-06-24 11:31 UTC (permalink / raw)
To: Joyeta Modak
Cc: andy, gregkh, dri-devel, linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <20260624073804.4391-1-joyetamdk@gmail.com>
On Wed, Jun 24, 2026 at 01:08:04PM +0530, Joyeta Modak wrote:
> NUMARGS() computes the number of arguments by dividing the size of a
> temporary int array by sizeof(int). Using the standard ARRAY_SIZE()
> macro is the correct way to count array elements in the kernel, and
> ARRAY_SIZE() also provides a __must_be_array() compile time check. There
> are no functional changes.
...
> -#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__}) / sizeof(int))
> +#define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
>
> #define write_reg(par, ...) \
> ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
What is the maximum parameters .write_register() takes in practice in the
fbtft drivers? If it's less than or equal to 15, we may use args.h instead.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH v5 14/14] video: leds: backlight: lm3533: Support getting LED sources from DT
From: Daniel Thompson @ 2026-06-24 10:04 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Lee Jones, Jingoo Han, Pavel Machek, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, Helge Deller,
Johan Hovold, dri-devel, linux-leds, devicetree, linux-kernel,
linux-iio, linux-fbdev
In-Reply-To: <20260617080031.99156-15-clamor95@gmail.com>
On Wed, Jun 17, 2026 at 11:00:31AM +0300, Svyatoslav Ryhel wrote:
> Add Control Bank to HVLED/LVLED muxing support based on the led-sources
> defined in the device tree.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
Daniel.
^ permalink raw reply
* Re: [PATCH v5 2/2] backlight: Add SY7758 6-channel High Efficiency LED Driver support
From: Daniel Thompson @ 2026-06-24 10:00 UTC (permalink / raw)
To: Neil Armstrong
Cc: Lee Jones, Jingoo Han, Pavel Machek, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Helge Deller, dri-devel,
linux-leds, devicetree, linux-kernel, linux-fbdev, KancyJoe
In-Reply-To: <20260529-topic-sm8650-ayaneo-pocket-s2-sy7758-v5-2-03aacd49747c@linaro.org>
On Fri, May 29, 2026 at 09:23:09PM +0200, Neil Armstrong wrote:
> From: KancyJoe <kancy2333@outlook.com>
>
> Implement support for the Silergy SY7758 6-channel High Efficiency LED
> Driver used for backlight brightness control in the Ayaneo Pocket S2
> dual-DSI panel.
>
> Signed-off-by: KancyJoe <kancy2333@outlook.com>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
Daniel.
^ permalink raw reply
* Re: [PATCH v5 1/2] dt-bindings: leds: backlight: document the SY7758 6-channel High Efficiency LED Driver
From: Daniel Thompson @ 2026-06-24 10:00 UTC (permalink / raw)
To: Neil Armstrong
Cc: Lee Jones, Jingoo Han, Pavel Machek, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Helge Deller, dri-devel,
linux-leds, devicetree, linux-kernel, linux-fbdev, KancyJoe,
Krzysztof Kozlowski
In-Reply-To: <20260529-topic-sm8650-ayaneo-pocket-s2-sy7758-v5-1-03aacd49747c@linaro.org>
On Fri, May 29, 2026 at 09:23:08PM +0200, Neil Armstrong wrote:
> Document the Silergy SY7758 6-channel High Efficiency LED Driver
> used for backlight brightness control.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
Daniel.
^ permalink raw reply
* Re:Re: [PATCH] video: hpfb: Unregister DIO driver on init failure
From: haoxiang_li2024 @ 2026-06-24 9:18 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: deller, linux-fbdev, dri-devel, linux-kernel, Philip Blundell,
Kars de Jong, linux-m68k
In-Reply-To: <CAMuHMdUSVacMR2Lb-VwkeZMrS=wKz9y+XtF=nAOCuSLbDs-HdQ@mail.gmail.com>
At 2026-06-24 16:51:02, "Geert Uytterhoeven" <geert@linux-m68k.org> wrote:
>Hence if the detection or initialization on the internal bus fails,
>other devices on the DIO bus must not be force-unbound.
>
>This is also the reason why any error returned by
>copy_from_kernel_nofault() is not considered fatal.
>
Thanks for your guidance! Understand that now.
Thanks,
Haoxiang
^ permalink raw reply
* Re: [PATCH] video: hpfb: Unregister DIO driver on init failure
From: Geert Uytterhoeven @ 2026-06-24 8:51 UTC (permalink / raw)
To: Haoxiang Li
Cc: deller, linux-fbdev, dri-devel, linux-kernel, Philip Blundell,
Kars de Jong, linux-m68k
In-Reply-To: <20260622064915.767194-1-haoxiang_li2024@163.com>
Hi Haoxiang,
CC hp300
On Tue, 23 Jun 2026 at 06:41, Haoxiang Li <haoxiang_li2024@163.com> wrote:
> hpfb_init() registers the DIO driver via dio_register_driver().
> If a later error occurs, the function returns directly without
> unregistering the DIO driver. Unregister the DIO driver before
> returning from these error paths.
>
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Thanks for your patch, which is now commit d6c3e2402523ce01 ("fbdev:
hpfb: Unregister DIO driver on init failure") in fbdev/for-next
> --- a/drivers/video/fbdev/hpfb.c
> +++ b/drivers/video/fbdev/hpfb.c
> @@ -407,10 +407,13 @@ static int __init hpfb_init(void)
As per the comment out-of-context above, this driver supports devices
on two types of buses:
/* Topcats can be on the internal IO bus or real DIO devices.
* The internal variant sits at 0x560000; it has primary
* and secondary ID registers just like the DIO version.
* So we merge the two detection routines.
> err = copy_from_kernel_nofault(&i, (unsigned char *)INTFBVADDR + DIO_IDOFF, 1);
>
> if (!err && (i == DIO_ID_FBUFFER) && topcat_sid_ok(sid = DIO_SECID(INTFBVADDR))) {
> - if (!request_mem_region(INTFBPADDR, DIO_DEVSIZE, "Internal Topcat"))
> + if (!request_mem_region(INTFBPADDR, DIO_DEVSIZE, "Internal Topcat")) {
> + dio_unregister_driver(&hpfb_driver);
> return -EBUSY;
> + }
> printk(KERN_INFO "Internal Topcat found (secondary id %02x)\n", sid);
> if (hpfb_init_one(INTFBPADDR, INTFBVADDR)) {
> + dio_unregister_driver(&hpfb_driver);
> return -ENOMEM;
> }
> }
Hence if the detection or initialization on the internal bus fails,
other devices on the DIO bus must not be force-unbound.
This is also the reason why any error returned by
copy_from_kernel_nofault() is not considered fatal.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH] fbdev: fbcon: fix out-of-bounds read in err_out of fbcon_do_set_font()
From: w15303746062 @ 2026-06-24 8:33 UTC (permalink / raw)
To: deller, tzimmermann, simona
Cc: syoshida, dri-devel, linux-fbdev, linux-kernel, Mingyu Wang,
stable
From: Mingyu Wang <25181214217@stu.xidian.edu.cn>
When fbcon_do_set_font() fails (e.g., due to a memory allocation failure
inside vc_resize() under heavy memory pressure), it jumps to the `err_out`
label to roll back the console state. However, the current rollback logic
forgets to restore the `hi_font` state, leading to a severe state machine
corruption.
Earlier in the function, `set_vc_hi_font()` might be called to change
`vc->vc_hi_font_mask` and mutate the screen buffer. If `vc_resize()`
subsequently fails, the `err_out` path restores `vc_font.charcount`
but entirely skips rolling back the `vc_hi_font_mask` and the screen
buffer.
This mismatch leaves the terminal in a desynchronized state. Because
`vc_hi_font_mask` remains set, the VT subsystem will still accept
character indices greater than 255 from userspace and write them to the
screen buffer. Subsequent rendering calls (e.g., `fbcon_putcs()`) will
then use these inflated indices to access the reverted, 256-character
font array, leading to a deterministic out-of-bounds read and potential
kernel memory disclosure.
Fix this by adding the missing rollback logic for the `hi_font` mask
and screen buffer in the error path.
Fixes: a5a923038d70 ("fbdev: fbcon: Properly revert changes when vc_resize() failed")
Cc: stable@vger.kernel.org
Signed-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn>
---
drivers/video/fbdev/core/fbcon.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 9077d3b99357..5880ab9f3cde 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -2405,6 +2405,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,
int resize, ret, old_width, old_height, old_charcount;
font_data_t *old_fontdata = p->fontdata;
const u8 *old_data = vc->vc_font.data;
+ int old_hi_font_mask = vc->vc_hi_font_mask;
font_data_get(data);
@@ -2451,6 +2452,12 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,
vc->vc_font.height = old_height;
vc->vc_font.charcount = old_charcount;
+ /* Restore the hi_font state and screen buffer */
+ if (old_hi_font_mask && !vc->vc_hi_font_mask)
+ set_vc_hi_font(vc, true);
+ else if (!old_hi_font_mask && vc->vc_hi_font_mask)
+ set_vc_hi_font(vc, false);
+
font_data_put(data);
return ret;
--
2.34.1
^ permalink raw reply related
* [PATCH] staging: fbtft: use ARRAY_SIZE() in NUMARGS macro
From: Joyeta Modak @ 2026-06-24 7:38 UTC (permalink / raw)
To: andy, gregkh
Cc: dri-devel, linux-fbdev, linux-staging, linux-kernel, Joyeta Modak
NUMARGS() computes the number of arguments by dividing the size of a
temporary int array by sizeof(int). Using the standard ARRAY_SIZE()
macro is the correct way to count array elements in the kernel, and
ARRAY_SIZE() also provides a __must_be_array() compile time check. There
are no functional changes.
Found using make coccicheck (scripts/coccinelle/misc/array_size.cocci).
Signed-off-by: Joyeta Modak <joyetamdk@gmail.com>
---
drivers/staging/fbtft/fbtft.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index c7afb0fd3..48da1503f 100644
--- a/drivers/staging/fbtft/fbtft.h
+++ b/drivers/staging/fbtft/fbtft.h
@@ -4,6 +4,7 @@
#ifndef __LINUX_FBTFT_H
#define __LINUX_FBTFT_H
+#include <linux/array_size.h>
#include <linux/fb.h>
#include <linux/spinlock.h>
#include <linux/spi/spi.h>
@@ -233,7 +234,7 @@ struct fbtft_par {
bool polarity;
};
-#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__}) / sizeof(int))
+#define NUMARGS(...) ARRAY_SIZE(((int[]){__VA_ARGS__}))
#define write_reg(par, ...) \
((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
--
2.53.0
^ permalink raw reply related
* Re: [PATCH v2 3/4] drm/ssd130x: Add SSD135X_FAMILY and SSD1351 support
From: Markus Elfring @ 2026-06-24 6:27 UTC (permalink / raw)
To: Amit Barzilai, dri-devel, devicetree, linux-fbdev, linux-staging
Cc: LKML, Adam Azuddin, Andy Shevchenko, Chintan Patel, Conor Dooley,
David Airlie, Greg Kroah-Hartman, Helge Deller,
Javier Martinez Canillas, Krzysztof Kozlowski, Maarten Lankhorst,
Maxime Ripard, Rob Herring, Simona Vetter, Thomas Zimmermann
In-Reply-To: <20260623213447.30196-1-amit.barzilai22@gmail.com>
>>> +++ b/drivers/gpu/drm/solomon/ssd130x.c
>>> @@ -146,6 +146,33 @@
>>> #define SSD133X_COLOR_DEPTH_256 0x0
>>> #define SSD133X_COLOR_DEPTH_65K 0x1
>>>
>>> +/* ssd135x commands */
>>> +#define SSD135X_SET_COL_RANGE 0x15
>>> +#define SSD135X_WRITE_RAM 0x5c
>>> +#define SSD135X_SET_ROW_RANGE 0x75
>> [...]
>>
>> How do you think about to use an enumeration for such data?
>> https://en.wikipedia.org/wiki/Enumerated_type#C_and_syntactically_similar_languages
>
> Thank you for the suggestion.
>
> I used #define to stay consistent with the rest of ssd130x.c, where the
> command constants for the other families are all defined the same way.
Will any further adjustments become more interesting?
> In my opinion an enum could be a readable solution for these values,
This is nice.
> but I don't think the switch should be included in this series.
What does hinder you to take another design option better into account?
Regards,
Markus
^ permalink raw reply
* [PATCH v2] staging: sm750fb: rename CamelCase pvMem and pvReg
From: Arnav Kapoor @ 2026-06-24 4:46 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Arnav Kapoor,
kernel test robot
In-Reply-To: <20260621045050.63460-1-kapoorarnav43@gmail.com>
Rename the remaining CamelCase structure members
to follow kernel coding style.
Rename:
* pvMem -> vram
* pvReg -> reg
Fix build errors by renaming the corresponding
structure members in sm750.h as well.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606240823.hWXfYyPf-lkp@intel.com/
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 22 +++++++++++-----------
drivers/staging/sm750fb/sm750.h | 4 ++--
drivers/staging/sm750fb/sm750_hw.c | 16 ++++++++--------
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 858eda551..efadb9c73 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -622,26 +622,26 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output->paths = sm750_pnc;
crtc->channel = sm750_primary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->vram;
break;
case sm750_simul_sec:
output->paths = sm750_pnc;
crtc->channel = sm750_secondary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->vram;
break;
case sm750_dual_normal:
if (par->index == 0) {
output->paths = sm750_panel;
crtc->channel = sm750_primary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->vram;
} else {
output->paths = sm750_crt;
crtc->channel = sm750_secondary;
/* not consider of padding stuffs for o_screen,need fix */
crtc->o_screen = sm750_dev->vidmem_size >> 1;
- crtc->v_screen = sm750_dev->pvMem + crtc->o_screen;
+ crtc->v_screen = sm750_dev->vram + crtc->o_screen;
}
break;
case sm750_dual_swap:
@@ -649,7 +649,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output->paths = sm750_panel;
crtc->channel = sm750_secondary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->vram;
} else {
output->paths = sm750_crt;
crtc->channel = sm750_primary;
@@ -657,7 +657,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
* need fix
*/
crtc->o_screen = sm750_dev->vidmem_size >> 1;
- crtc->v_screen = sm750_dev->pvMem + crtc->o_screen;
+ crtc->v_screen = sm750_dev->vram + crtc->o_screen;
}
break;
default:
@@ -755,13 +755,13 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
* must be set after crtc member initialized
*/
crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
- crtc->cursor.mmio = sm750_dev->pvReg +
+ crtc->cursor.mmio = sm750_dev->reg +
0x800f0 + (int)crtc->channel * 0x140;
crtc->cursor.max_h = 64;
crtc->cursor.max_w = 64;
crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
- crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
+ crtc->cursor.vstart = sm750_dev->vram + crtc->cursor.offset;
memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
if (!g_hwcursor)
@@ -1028,7 +1028,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
sm750_dev->mtrr.vram = arch_phys_wc_add(sm750_dev->vidmem_start,
sm750_dev->vidmem_size);
- memset_io(sm750_dev->pvMem, 0, sm750_dev->vidmem_size);
+ memset_io(sm750_dev->vram, 0, sm750_dev->vidmem_size);
pci_set_drvdata(pdev, sm750_dev);
@@ -1059,8 +1059,8 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
sm750fb_framebuffer_release(sm750_dev);
arch_phys_wc_del(sm750_dev->mtrr.vram);
- iounmap(sm750_dev->pvReg);
- iounmap(sm750_dev->pvMem);
+ iounmap(sm750_dev->reg);
+ iounmap(sm750_dev->vram);
pci_release_region(pdev, 1);
kfree(g_settings);
}
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index 9da154f1a..dadf5874a 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -97,8 +97,8 @@ struct sm750_dev {
unsigned long vidreg_start;
__u32 vidmem_size;
__u32 vidreg_size;
- void __iomem *pvReg;
- unsigned char __iomem *pvMem;
+ void __iomem *reg;
+ unsigned char __iomem *vram;
/* locks*/
spinlock_t slock;
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 59fb3a207..1b768be20 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -42,18 +42,18 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
}
/* now map mmio and vidmem */
- sm750_dev->pvReg =
+ sm750_dev->reg =
ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
- if (!sm750_dev->pvReg) {
+ if (!sm750_dev->reg) {
dev_err(&pdev->dev, "mmio failed\n");
ret = -EFAULT;
goto err_release_region;
}
- sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
- sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
+ sm750_dev->accel.dpr_base = sm750_dev->reg + DE_BASE_ADDR_TYPE1;
+ sm750_dev->accel.dp_port_base = sm750_dev->reg + DE_PORT_ADDR_TYPE1;
- mmio750 = sm750_dev->pvReg;
+ mmio750 = sm750_dev->reg;
sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
sm750_dev->vidmem_start = pci_resource_start(pdev, 0);
@@ -66,9 +66,9 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
sm750_dev->vidmem_size = ddk750_get_vm_size();
/* reserve the vidmem space of smi adaptor */
- sm750_dev->pvMem =
+ sm750_dev->vram =
ioremap_wc(sm750_dev->vidmem_start, sm750_dev->vidmem_size);
- if (!sm750_dev->pvMem) {
+ if (!sm750_dev->vram) {
dev_err(&pdev->dev, "Map video memory failed\n");
ret = -EFAULT;
goto err_unmap_reg;
@@ -77,7 +77,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
return 0;
err_unmap_reg:
- iounmap(sm750_dev->pvReg);
+ iounmap(sm750_dev->reg);
err_release_region:
pci_release_region(pdev, 1);
return ret;
--
2.53.0
^ permalink raw reply related
* [PATCH v2] staging: sm750fb: rename CamelCase pvMem and pvReg
From: Arnav Kapoor @ 2026-06-24 4:44 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Arnav Kapoor,
kernel test robot
In-Reply-To: <MESSAGE-ID>
Rename the remaining CamelCase structure members
to follow kernel coding style.
Rename:
* pvMem -> vram
* pvReg -> reg
Fix build errors by renaming the corresponding
structure members in sm750.h as well.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606240823.hWXfYyPf-lkp@intel.com/
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 22 +++++++++++-----------
drivers/staging/sm750fb/sm750.h | 4 ++--
drivers/staging/sm750fb/sm750_hw.c | 16 ++++++++--------
3 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 858eda551..efadb9c73 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -622,26 +622,26 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output->paths = sm750_pnc;
crtc->channel = sm750_primary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->vram;
break;
case sm750_simul_sec:
output->paths = sm750_pnc;
crtc->channel = sm750_secondary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->vram;
break;
case sm750_dual_normal:
if (par->index == 0) {
output->paths = sm750_panel;
crtc->channel = sm750_primary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->vram;
} else {
output->paths = sm750_crt;
crtc->channel = sm750_secondary;
/* not consider of padding stuffs for o_screen,need fix */
crtc->o_screen = sm750_dev->vidmem_size >> 1;
- crtc->v_screen = sm750_dev->pvMem + crtc->o_screen;
+ crtc->v_screen = sm750_dev->vram + crtc->o_screen;
}
break;
case sm750_dual_swap:
@@ -649,7 +649,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output->paths = sm750_panel;
crtc->channel = sm750_secondary;
crtc->o_screen = 0;
- crtc->v_screen = sm750_dev->pvMem;
+ crtc->v_screen = sm750_dev->vram;
} else {
output->paths = sm750_crt;
crtc->channel = sm750_primary;
@@ -657,7 +657,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
* need fix
*/
crtc->o_screen = sm750_dev->vidmem_size >> 1;
- crtc->v_screen = sm750_dev->pvMem + crtc->o_screen;
+ crtc->v_screen = sm750_dev->vram + crtc->o_screen;
}
break;
default:
@@ -755,13 +755,13 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
* must be set after crtc member initialized
*/
crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
- crtc->cursor.mmio = sm750_dev->pvReg +
+ crtc->cursor.mmio = sm750_dev->reg +
0x800f0 + (int)crtc->channel * 0x140;
crtc->cursor.max_h = 64;
crtc->cursor.max_w = 64;
crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
- crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
+ crtc->cursor.vstart = sm750_dev->vram + crtc->cursor.offset;
memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
if (!g_hwcursor)
@@ -1028,7 +1028,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
sm750_dev->mtrr.vram = arch_phys_wc_add(sm750_dev->vidmem_start,
sm750_dev->vidmem_size);
- memset_io(sm750_dev->pvMem, 0, sm750_dev->vidmem_size);
+ memset_io(sm750_dev->vram, 0, sm750_dev->vidmem_size);
pci_set_drvdata(pdev, sm750_dev);
@@ -1059,8 +1059,8 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
sm750fb_framebuffer_release(sm750_dev);
arch_phys_wc_del(sm750_dev->mtrr.vram);
- iounmap(sm750_dev->pvReg);
- iounmap(sm750_dev->pvMem);
+ iounmap(sm750_dev->reg);
+ iounmap(sm750_dev->vram);
pci_release_region(pdev, 1);
kfree(g_settings);
}
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index 9da154f1a..dadf5874a 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -97,8 +97,8 @@ struct sm750_dev {
unsigned long vidreg_start;
__u32 vidmem_size;
__u32 vidreg_size;
- void __iomem *pvReg;
- unsigned char __iomem *pvMem;
+ void __iomem *reg;
+ unsigned char __iomem *vram;
/* locks*/
spinlock_t slock;
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 59fb3a207..1b768be20 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -42,18 +42,18 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
}
/* now map mmio and vidmem */
- sm750_dev->pvReg =
+ sm750_dev->reg =
ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
- if (!sm750_dev->pvReg) {
+ if (!sm750_dev->reg) {
dev_err(&pdev->dev, "mmio failed\n");
ret = -EFAULT;
goto err_release_region;
}
- sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
- sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
+ sm750_dev->accel.dpr_base = sm750_dev->reg + DE_BASE_ADDR_TYPE1;
+ sm750_dev->accel.dp_port_base = sm750_dev->reg + DE_PORT_ADDR_TYPE1;
- mmio750 = sm750_dev->pvReg;
+ mmio750 = sm750_dev->reg;
sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
sm750_dev->vidmem_start = pci_resource_start(pdev, 0);
@@ -66,9 +66,9 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
sm750_dev->vidmem_size = ddk750_get_vm_size();
/* reserve the vidmem space of smi adaptor */
- sm750_dev->pvMem =
+ sm750_dev->vram =
ioremap_wc(sm750_dev->vidmem_start, sm750_dev->vidmem_size);
- if (!sm750_dev->pvMem) {
+ if (!sm750_dev->vram) {
dev_err(&pdev->dev, "Map video memory failed\n");
ret = -EFAULT;
goto err_unmap_reg;
@@ -77,7 +77,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
return 0;
err_unmap_reg:
- iounmap(sm750_dev->pvReg);
+ iounmap(sm750_dev->reg);
err_release_region:
pci_release_region(pdev, 1);
return ret;
--
2.53.0
^ permalink raw reply related
* [PATCH v2] staging: sm750fb: fix remaining CamelCase issues
From: Arnav Kapoor @ 2026-06-24 4:25 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Arnav Kapoor
In-Reply-To: <20260621045340.65872-1-kapoorarnav43@gmail.com>
Rename the remaining CamelCase variables and constants
to follow kernel coding style.
Rename:
* powerMode -> power_mode
* setAllEngOff -> set_all_eng_off
* resetMemory -> reset_memory
* sm750_doubleTFT -> SM750_DOUBLE_TFT
* sm750_dualTFT -> SM750_DUAL_TFT
Fix build errors by renaming the corresponding
declarations and enum values as well.
Reported-by: kernel test robot [lkp@intel.com](mailto:lkp@intel.com)
Closes: https://lore.kernel.org/oe-kbuild-all/202606240916.wIIrdOzC-lkp@intel.com/
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 10 +++++-----
drivers/staging/sm750fb/sm750.h | 10 +++++-----
drivers/staging/sm750fb/sm750_hw.c | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e..858eda551 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -859,9 +859,9 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
sm750_dev->init_parm.chip_clk = 0;
sm750_dev->init_parm.mem_clk = 0;
sm750_dev->init_parm.master_clk = 0;
- sm750_dev->init_parm.powerMode = 0;
- sm750_dev->init_parm.setAllEngOff = 0;
- sm750_dev->init_parm.resetMemory = 1;
+ sm750_dev->init_parm.power_mode = 0;
+ sm750_dev->init_parm.set_all_eng_off = 0;
+ sm750_dev->init_parm.reset_memory = 1;
/* defaultly turn g_hwcursor on for both view */
g_hwcursor = 3;
@@ -880,9 +880,9 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
} else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
sm750_dev->nocrt = 1;
} else if (!strncmp(opt, "36bit", strlen("36bit"))) {
- sm750_dev->pnltype = sm750_doubleTFT;
+ sm750_dev->pnltype = SM750_DOUBLE_TFT;
} else if (!strncmp(opt, "18bit", strlen("18bit"))) {
- sm750_dev->pnltype = sm750_dualTFT;
+ sm750_dev->pnltype = SM750_DUAL_TFT;
} else if (!strncmp(opt, "24bit", strlen("24bit"))) {
sm750_dev->pnltype = sm750_24TFT;
} else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index 67b9bfa23..9da154f1a 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -14,8 +14,8 @@
enum sm750_pnltype {
sm750_24TFT = 0, /* 24bit tft */
- sm750_dualTFT = 2, /* dual 18 bit tft */
- sm750_doubleTFT = 1, /* 36 bit double pixel tft */
+ SM750_DUAL_TFT = 2, /* dual 18 bit tft */
+ SM750_DOUBLE_TFT = 1, /* 36 bit double pixel tft */
};
/* vga channel is not concerned */
@@ -39,13 +39,13 @@ enum sm750_path {
};
struct init_status {
- ushort powerMode;
+ ushort power_mode;
/* below three clocks are in unit of MHZ*/
ushort chip_clk;
ushort mem_clk;
ushort master_clk;
- ushort setAllEngOff;
- ushort resetMemory;
+ ushort set_all_eng_off;
+ ushort reset_memory;
};
struct lynx_accel {
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index a2798d428..59fb3a207 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -130,10 +130,10 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
switch (sm750_dev->pnltype) {
case sm750_24TFT:
break;
- case sm750_doubleTFT:
+ case SM750_DOUBLE_TFT:
val |= PANEL_DISPLAY_CTRL_DOUBLE_PIXEL;
break;
- case sm750_dualTFT:
+ case SM750_DUAL_TFT:
val |= PANEL_DISPLAY_CTRL_DUAL_DISPLAY;
break;
}
--
2.53.0
^ permalink raw reply related
* Re: [staging] staging: sm750fb: fix remaining CamelCase issues
From: kernel test robot @ 2026-06-24 3:26 UTC (permalink / raw)
To: Arnav Kapoor, Greg Kroah-Hartman, Sudip Mukherjee, Teddy Wang
Cc: oe-kbuild-all, linux-staging, linux-fbdev, linux-kernel,
Arnav Kapoor
In-Reply-To: <20260621045340.65872-1-kapoorarnav43@gmail.com>
Hi Arnav,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-linus]
[also build test ERROR on v7.1]
[cannot apply to staging/staging-testing staging/staging-next linus/master next-20260623]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Arnav-Kapoor/staging-sm750fb-fix-remaining-CamelCase-issues/20260622-235207
base: staging/staging-linus
patch link: https://lore.kernel.org/r/20260621045340.65872-1-kapoorarnav43%40gmail.com
patch subject: [staging] staging: sm750fb: fix remaining CamelCase issues
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20260624/202606241142.LlZq0AN1-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260624/202606241142.LlZq0AN1-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/202606241142.LlZq0AN1-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/staging/sm750fb/sm750.c: In function 'sm750fb_setup':
>> drivers/staging/sm750fb/sm750.c:862:30: error: 'struct init_status' has no member named 'power_mode'; did you mean 'powerMode'?
862 | sm750_dev->init_parm.power_mode = 0;
| ^~~~~~~~~~
| powerMode
>> drivers/staging/sm750fb/sm750.c:863:30: error: 'struct init_status' has no member named 'set_all_eng_off'; did you mean 'setAllEngOff'?
863 | sm750_dev->init_parm.set_all_eng_off = 0;
| ^~~~~~~~~~~~~~~
| setAllEngOff
>> drivers/staging/sm750fb/sm750.c:864:30: error: 'struct init_status' has no member named 'reset_memory'; did you mean 'resetMemory'?
864 | sm750_dev->init_parm.reset_memory = 1;
| ^~~~~~~~~~~~
| resetMemory
>> drivers/staging/sm750fb/sm750.c:883:46: error: 'SM750_DOUBLE_TFT' undeclared (first use in this function); did you mean 'sm750_doubleTFT'?
883 | sm750_dev->pnltype = SM750_DOUBLE_TFT;
| ^~~~~~~~~~~~~~~~
| sm750_doubleTFT
drivers/staging/sm750fb/sm750.c:883:46: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/staging/sm750fb/sm750.c:885:46: error: 'SM750_DUAL_TFT' undeclared (first use in this function); did you mean 'sm750_dualTFT'?
885 | sm750_dev->pnltype = SM750_DUAL_TFT;
| ^~~~~~~~~~~~~~
| sm750_dualTFT
vim +862 drivers/staging/sm750fb/sm750.c
850
851 /* chip specific g_option configuration routine */
852 static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
853 {
854 char *opt;
855 int swap;
856
857 swap = 0;
858
859 sm750_dev->init_parm.chip_clk = 0;
860 sm750_dev->init_parm.mem_clk = 0;
861 sm750_dev->init_parm.master_clk = 0;
> 862 sm750_dev->init_parm.power_mode = 0;
> 863 sm750_dev->init_parm.set_all_eng_off = 0;
> 864 sm750_dev->init_parm.reset_memory = 1;
865
866 /* defaultly turn g_hwcursor on for both view */
867 g_hwcursor = 3;
868
869 if (!src || !*src) {
870 dev_warn(&sm750_dev->pdev->dev, "no specific g_option.\n");
871 goto NO_PARAM;
872 }
873
874 while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
875 dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
876 dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
877
878 if (!strncmp(opt, "swap", strlen("swap"))) {
879 swap = 1;
880 } else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
881 sm750_dev->nocrt = 1;
882 } else if (!strncmp(opt, "36bit", strlen("36bit"))) {
> 883 sm750_dev->pnltype = SM750_DOUBLE_TFT;
884 } else if (!strncmp(opt, "18bit", strlen("18bit"))) {
> 885 sm750_dev->pnltype = SM750_DUAL_TFT;
886 } else if (!strncmp(opt, "24bit", strlen("24bit"))) {
887 sm750_dev->pnltype = sm750_24TFT;
888 } else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
889 g_hwcursor &= ~0x1;
890 } else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
891 g_hwcursor &= ~0x2;
892 } else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
893 g_hwcursor = 0;
894 } else {
895 if (!g_fbmode[0]) {
896 g_fbmode[0] = opt;
897 dev_info(&sm750_dev->pdev->dev,
898 "find fbmode0 : %s\n", g_fbmode[0]);
899 } else if (!g_fbmode[1]) {
900 g_fbmode[1] = opt;
901 dev_info(&sm750_dev->pdev->dev,
902 "find fbmode1 : %s\n", g_fbmode[1]);
903 } else {
904 dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
905 }
906 }
907 }
908
909 NO_PARAM:
910 if (sm750_dev->revid != SM750LE_REVISION_ID) {
911 if (sm750_dev->fb_count > 1) {
912 if (swap)
913 sm750_dev->dataflow = sm750_dual_swap;
914 else
915 sm750_dev->dataflow = sm750_dual_normal;
916 } else {
917 if (swap)
918 sm750_dev->dataflow = sm750_simul_sec;
919 else
920 sm750_dev->dataflow = sm750_simul_pri;
921 }
922 } else {
923 /* SM750LE only have one crt channel */
924 sm750_dev->dataflow = sm750_simul_sec;
925 /* sm750le do not have complex attributes */
926 sm750_dev->nocrt = 0;
927 }
928 }
929
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [staging] staging: sm750fb: fix remaining CamelCase issues
From: kernel test robot @ 2026-06-24 1:51 UTC (permalink / raw)
To: Arnav Kapoor, Greg Kroah-Hartman, Sudip Mukherjee, Teddy Wang
Cc: llvm, oe-kbuild-all, linux-staging, linux-fbdev, linux-kernel,
Arnav Kapoor
In-Reply-To: <20260621045340.65872-1-kapoorarnav43@gmail.com>
Hi Arnav,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-linus]
[also build test ERROR on v7.1]
[cannot apply to staging/staging-testing staging/staging-next linus/master next-20260623]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Arnav-Kapoor/staging-sm750fb-fix-remaining-CamelCase-issues/20260622-235207
base: staging/staging-linus
patch link: https://lore.kernel.org/r/20260621045340.65872-1-kapoorarnav43%40gmail.com
patch subject: [staging] staging: sm750fb: fix remaining CamelCase issues
config: sparc64-allmodconfig (https://download.01.org/0day-ci/archive/20260624/202606240916.wIIrdOzC-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260624/202606240916.wIIrdOzC-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/202606240916.wIIrdOzC-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/staging/sm750fb/sm750.c:862:23: error: no member named 'power_mode' in 'struct init_status'; did you mean 'powerMode'?
862 | sm750_dev->init_parm.power_mode = 0;
| ^~~~~~~~~~
| powerMode
drivers/staging/sm750fb/sm750.h:42:9: note: 'powerMode' declared here
42 | ushort powerMode;
| ^
>> drivers/staging/sm750fb/sm750.c:863:23: error: no member named 'set_all_eng_off' in 'struct init_status'
863 | sm750_dev->init_parm.set_all_eng_off = 0;
| ~~~~~~~~~~~~~~~~~~~~ ^
>> drivers/staging/sm750fb/sm750.c:864:23: error: no member named 'reset_memory' in 'struct init_status'; did you mean 'resetMemory'?
864 | sm750_dev->init_parm.reset_memory = 1;
| ^~~~~~~~~~~~
| resetMemory
drivers/staging/sm750fb/sm750.h:48:9: note: 'resetMemory' declared here
48 | ushort resetMemory;
| ^
>> drivers/staging/sm750fb/sm750.c:883:25: error: use of undeclared identifier 'SM750_DOUBLE_TFT'
883 | sm750_dev->pnltype = SM750_DOUBLE_TFT;
| ^
>> drivers/staging/sm750fb/sm750.c:885:25: error: use of undeclared identifier 'SM750_DUAL_TFT'
885 | sm750_dev->pnltype = SM750_DUAL_TFT;
| ^
5 errors generated.
vim +862 drivers/staging/sm750fb/sm750.c
850
851 /* chip specific g_option configuration routine */
852 static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
853 {
854 char *opt;
855 int swap;
856
857 swap = 0;
858
859 sm750_dev->init_parm.chip_clk = 0;
860 sm750_dev->init_parm.mem_clk = 0;
861 sm750_dev->init_parm.master_clk = 0;
> 862 sm750_dev->init_parm.power_mode = 0;
> 863 sm750_dev->init_parm.set_all_eng_off = 0;
> 864 sm750_dev->init_parm.reset_memory = 1;
865
866 /* defaultly turn g_hwcursor on for both view */
867 g_hwcursor = 3;
868
869 if (!src || !*src) {
870 dev_warn(&sm750_dev->pdev->dev, "no specific g_option.\n");
871 goto NO_PARAM;
872 }
873
874 while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
875 dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
876 dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
877
878 if (!strncmp(opt, "swap", strlen("swap"))) {
879 swap = 1;
880 } else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
881 sm750_dev->nocrt = 1;
882 } else if (!strncmp(opt, "36bit", strlen("36bit"))) {
> 883 sm750_dev->pnltype = SM750_DOUBLE_TFT;
884 } else if (!strncmp(opt, "18bit", strlen("18bit"))) {
> 885 sm750_dev->pnltype = SM750_DUAL_TFT;
886 } else if (!strncmp(opt, "24bit", strlen("24bit"))) {
887 sm750_dev->pnltype = sm750_24TFT;
888 } else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
889 g_hwcursor &= ~0x1;
890 } else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
891 g_hwcursor &= ~0x2;
892 } else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
893 g_hwcursor = 0;
894 } else {
895 if (!g_fbmode[0]) {
896 g_fbmode[0] = opt;
897 dev_info(&sm750_dev->pdev->dev,
898 "find fbmode0 : %s\n", g_fbmode[0]);
899 } else if (!g_fbmode[1]) {
900 g_fbmode[1] = opt;
901 dev_info(&sm750_dev->pdev->dev,
902 "find fbmode1 : %s\n", g_fbmode[1]);
903 } else {
904 dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
905 }
906 }
907 }
908
909 NO_PARAM:
910 if (sm750_dev->revid != SM750LE_REVISION_ID) {
911 if (sm750_dev->fb_count > 1) {
912 if (swap)
913 sm750_dev->dataflow = sm750_dual_swap;
914 else
915 sm750_dev->dataflow = sm750_dual_normal;
916 } else {
917 if (swap)
918 sm750_dev->dataflow = sm750_simul_sec;
919 else
920 sm750_dev->dataflow = sm750_simul_pri;
921 }
922 } else {
923 /* SM750LE only have one crt channel */
924 sm750_dev->dataflow = sm750_simul_sec;
925 /* sm750le do not have complex attributes */
926 sm750_dev->nocrt = 0;
927 }
928 }
929
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [staging] staging: sm750fb: rename pvMem to vram and pvReg to reg
From: kernel test robot @ 2026-06-24 1:27 UTC (permalink / raw)
To: Arnav Kapoor, Greg Kroah-Hartman, Sudip Mukherjee, Teddy Wang
Cc: oe-kbuild-all, linux-staging, linux-fbdev, linux-kernel,
Arnav Kapoor
In-Reply-To: <20260621045050.63460-1-kapoorarnav43@gmail.com>
Hi Arnav,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-linus]
[also build test ERROR on v7.1]
[cannot apply to staging/staging-testing staging/staging-next linus/master next-20260623]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Arnav-Kapoor/staging-sm750fb-rename-pvMem-to-vram-and-pvReg-to-reg/20260622-235607
base: staging/staging-linus
patch link: https://lore.kernel.org/r/20260621045050.63460-1-kapoorarnav43%40gmail.com
patch subject: [staging] staging: sm750fb: rename pvMem to vram and pvReg to reg
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20260624/202606240932.nfoefhT9-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260624/202606240932.nfoefhT9-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/202606240932.nfoefhT9-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/staging/sm750fb/sm750.c: In function 'sm750fb_set_drv':
>> drivers/staging/sm750fb/sm750.c:625:43: error: 'struct sm750_dev' has no member named 'vram'
625 | crtc->v_screen = sm750_dev->vram;
| ^~
drivers/staging/sm750fb/sm750.c:631:43: error: 'struct sm750_dev' has no member named 'vram'
631 | crtc->v_screen = sm750_dev->vram;
| ^~
drivers/staging/sm750fb/sm750.c:638:51: error: 'struct sm750_dev' has no member named 'vram'
638 | crtc->v_screen = sm750_dev->vram;
| ^~
drivers/staging/sm750fb/sm750.c:644:51: error: 'struct sm750_dev' has no member named 'vram'
644 | crtc->v_screen = sm750_dev->vram + crtc->o_screen;
| ^~
drivers/staging/sm750fb/sm750.c:652:51: error: 'struct sm750_dev' has no member named 'vram'
652 | crtc->v_screen = sm750_dev->vram;
| ^~
drivers/staging/sm750fb/sm750.c:660:51: error: 'struct sm750_dev' has no member named 'vram'
660 | crtc->v_screen = sm750_dev->vram + crtc->o_screen;
| ^~
drivers/staging/sm750fb/sm750.c: In function 'lynxfb_set_fbinfo':
>> drivers/staging/sm750fb/sm750.c:758:38: error: 'struct sm750_dev' has no member named 'reg'
758 | crtc->cursor.mmio = sm750_dev->reg +
| ^~
drivers/staging/sm750fb/sm750.c:764:40: error: 'struct sm750_dev' has no member named 'vram'
764 | crtc->cursor.vstart = sm750_dev->vram + crtc->cursor.offset;
| ^~
drivers/staging/sm750fb/sm750.c: In function 'lynxfb_pci_probe':
drivers/staging/sm750fb/sm750.c:1031:28: error: 'struct sm750_dev' has no member named 'vram'
1031 | memset_io(sm750_dev->vram, 0, sm750_dev->vidmem_size);
| ^~
drivers/staging/sm750fb/sm750.c: In function 'lynxfb_pci_remove':
drivers/staging/sm750fb/sm750.c:1062:26: error: 'struct sm750_dev' has no member named 'reg'
1062 | iounmap(sm750_dev->reg);
| ^~
drivers/staging/sm750fb/sm750.c:1063:26: error: 'struct sm750_dev' has no member named 'vram'
1063 | iounmap(sm750_dev->vram);
| ^~
vim +625 drivers/staging/sm750fb/sm750.c
591
592 static int sm750fb_set_drv(struct lynxfb_par *par)
593 {
594 int ret;
595 struct sm750_dev *sm750_dev;
596 struct lynxfb_output *output;
597 struct lynxfb_crtc *crtc;
598
599 ret = 0;
600
601 sm750_dev = par->dev;
602 output = &par->output;
603 crtc = &par->crtc;
604
605 crtc->vidmem_size = sm750_dev->vidmem_size;
606 if (sm750_dev->fb_count > 1)
607 crtc->vidmem_size >>= 1;
608
609 /* setup crtc and output member */
610 sm750_dev->hw_cursor = g_hwcursor;
611
612 crtc->line_pad = 16;
613 crtc->xpanstep = 8;
614 crtc->ypanstep = 1;
615 crtc->ywrapstep = 0;
616
617 /* chip specific phase */
618 sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ?
619 hw_sm750le_de_wait : hw_sm750_de_wait;
620 switch (sm750_dev->dataflow) {
621 case sm750_simul_pri:
622 output->paths = sm750_pnc;
623 crtc->channel = sm750_primary;
624 crtc->o_screen = 0;
> 625 crtc->v_screen = sm750_dev->vram;
626 break;
627 case sm750_simul_sec:
628 output->paths = sm750_pnc;
629 crtc->channel = sm750_secondary;
630 crtc->o_screen = 0;
631 crtc->v_screen = sm750_dev->vram;
632 break;
633 case sm750_dual_normal:
634 if (par->index == 0) {
635 output->paths = sm750_panel;
636 crtc->channel = sm750_primary;
637 crtc->o_screen = 0;
638 crtc->v_screen = sm750_dev->vram;
639 } else {
640 output->paths = sm750_crt;
641 crtc->channel = sm750_secondary;
642 /* not consider of padding stuffs for o_screen,need fix */
643 crtc->o_screen = sm750_dev->vidmem_size >> 1;
644 crtc->v_screen = sm750_dev->vram + crtc->o_screen;
645 }
646 break;
647 case sm750_dual_swap:
648 if (par->index == 0) {
649 output->paths = sm750_panel;
650 crtc->channel = sm750_secondary;
651 crtc->o_screen = 0;
> 652 crtc->v_screen = sm750_dev->vram;
653 } else {
654 output->paths = sm750_crt;
655 crtc->channel = sm750_primary;
656 /* not consider of padding stuffs for o_screen,
657 * need fix
658 */
659 crtc->o_screen = sm750_dev->vidmem_size >> 1;
660 crtc->v_screen = sm750_dev->vram + crtc->o_screen;
661 }
662 break;
663 default:
664 ret = -EINVAL;
665 }
666
667 return ret;
668 }
669
670 static const struct fb_ops lynxfb_ops = {
671 .owner = THIS_MODULE,
672 FB_DEFAULT_IOMEM_OPS,
673 .fb_check_var = lynxfb_ops_check_var,
674 .fb_set_par = lynxfb_ops_set_par,
675 .fb_setcolreg = lynxfb_ops_setcolreg,
676 .fb_blank = lynxfb_ops_blank,
677 .fb_pan_display = lynxfb_ops_pan_display,
678 };
679
680 static const struct fb_ops lynxfb_ops_with_cursor = {
681 .owner = THIS_MODULE,
682 FB_DEFAULT_IOMEM_OPS,
683 .fb_check_var = lynxfb_ops_check_var,
684 .fb_set_par = lynxfb_ops_set_par,
685 .fb_setcolreg = lynxfb_ops_setcolreg,
686 .fb_blank = lynxfb_ops_blank,
687 .fb_pan_display = lynxfb_ops_pan_display,
688 .fb_cursor = lynxfb_ops_cursor,
689 };
690
691 static const struct fb_ops lynxfb_ops_accel = {
692 .owner = THIS_MODULE,
693 __FB_DEFAULT_IOMEM_OPS_RDWR,
694 .fb_check_var = lynxfb_ops_check_var,
695 .fb_set_par = lynxfb_ops_set_par,
696 .fb_setcolreg = lynxfb_ops_setcolreg,
697 .fb_blank = lynxfb_ops_blank,
698 .fb_pan_display = lynxfb_ops_pan_display,
699 .fb_fillrect = lynxfb_ops_fillrect,
700 .fb_copyarea = lynxfb_ops_copyarea,
701 .fb_imageblit = lynxfb_ops_imageblit,
702 __FB_DEFAULT_IOMEM_OPS_MMAP,
703 };
704
705 static const struct fb_ops lynxfb_ops_accel_with_cursor = {
706 .owner = THIS_MODULE,
707 __FB_DEFAULT_IOMEM_OPS_RDWR,
708 .fb_check_var = lynxfb_ops_check_var,
709 .fb_set_par = lynxfb_ops_set_par,
710 .fb_setcolreg = lynxfb_ops_setcolreg,
711 .fb_blank = lynxfb_ops_blank,
712 .fb_pan_display = lynxfb_ops_pan_display,
713 .fb_fillrect = lynxfb_ops_fillrect,
714 .fb_copyarea = lynxfb_ops_copyarea,
715 .fb_imageblit = lynxfb_ops_imageblit,
716 .fb_cursor = lynxfb_ops_cursor,
717 __FB_DEFAULT_IOMEM_OPS_MMAP,
718 };
719
720 static int lynxfb_set_fbinfo(struct fb_info *info, int index)
721 {
722 int i;
723 struct lynxfb_par *par;
724 struct sm750_dev *sm750_dev;
725 struct lynxfb_crtc *crtc;
726 struct lynxfb_output *output;
727 struct fb_var_screeninfo *var;
728 struct fb_fix_screeninfo *fix;
729
730 const struct fb_videomode *pdb[] = {
731 lynx750_ext, NULL, vesa_modes,
732 };
733 int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
734 static const char *fix_id[2] = {
735 "sm750_fb1", "sm750_fb2",
736 };
737
738 int ret, line_length;
739
740 ret = 0;
741 par = (struct lynxfb_par *)info->par;
742 sm750_dev = par->dev;
743 crtc = &par->crtc;
744 output = &par->output;
745 var = &info->var;
746 fix = &info->fix;
747
748 /* set index */
749 par->index = index;
750 output->channel = &crtc->channel;
751 sm750fb_set_drv(par);
752
753 /*
754 * set current cursor variable and proc pointer,
755 * must be set after crtc member initialized
756 */
757 crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
> 758 crtc->cursor.mmio = sm750_dev->reg +
759 0x800f0 + (int)crtc->channel * 0x140;
760
761 crtc->cursor.max_h = 64;
762 crtc->cursor.max_w = 64;
763 crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
764 crtc->cursor.vstart = sm750_dev->vram + crtc->cursor.offset;
765
766 memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
767 if (!g_hwcursor)
768 sm750_hw_cursor_disable(&crtc->cursor);
769
770 /* set info->fbops, must be set before fb_find_mode */
771 if (!sm750_dev->accel_off) {
772 /* use 2d acceleration */
773 if (!g_hwcursor)
774 info->fbops = &lynxfb_ops_accel;
775 else
776 info->fbops = &lynxfb_ops_accel_with_cursor;
777 } else {
778 if (!g_hwcursor)
779 info->fbops = &lynxfb_ops;
780 else
781 info->fbops = &lynxfb_ops_with_cursor;
782 }
783
784 if (!g_fbmode[index]) {
785 g_fbmode[index] = g_def_fbmode;
786 if (index)
787 g_fbmode[index] = g_fbmode[0];
788 }
789
790 for (i = 0; i < 3; i++) {
791 ret = fb_find_mode(var, info, g_fbmode[index],
792 pdb[i], cdb[i], NULL, 8);
793
794 if (ret == 1 || ret == 2)
795 break;
796 }
797
798 /* set par */
799 par->info = info;
800
801 /* set info */
802 line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
803 crtc->line_pad);
804
805 info->pseudo_palette = &par->pseudo_palette[0];
806 info->screen_base = crtc->v_screen;
807 info->screen_size = line_length * var->yres_virtual;
808
809 /* set info->fix */
810 fix->type = FB_TYPE_PACKED_PIXELS;
811 fix->type_aux = 0;
812 fix->xpanstep = crtc->xpanstep;
813 fix->ypanstep = crtc->ypanstep;
814 fix->ywrapstep = crtc->ywrapstep;
815 fix->accel = FB_ACCEL_SMI;
816
817 strscpy(fix->id, fix_id[index], sizeof(fix->id));
818
819 fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
820 /*
821 * according to mmap experiment from user space application,
822 * fix->mmio_len should not larger than virtual size
823 * (xres_virtual x yres_virtual x ByPP)
824 * Below line maybe buggy when user mmap fb dev node and write
825 * data into the bound over virtual size
826 */
827 fix->smem_len = crtc->vidmem_size;
828 info->screen_size = fix->smem_len;
829 fix->line_length = line_length;
830 fix->mmio_start = sm750_dev->vidreg_start;
831 fix->mmio_len = sm750_dev->vidreg_size;
832
833 lynxfb_set_visual_mode(info);
834
835 /* set var */
836 var->activate = FB_ACTIVATE_NOW;
837 var->accel_flags = 0;
838 var->vmode = FB_VMODE_NONINTERLACED;
839
840 ret = fb_alloc_cmap(&info->cmap, 256, 0);
841 if (ret < 0) {
842 dev_err(info->device, "Could not allocate memory for cmap.\n");
843 goto exit;
844 }
845
846 exit:
847 lynxfb_ops_check_var(var, info);
848 return ret;
849 }
850
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [staging] staging: sm750fb: rename pvMem to vram and pvReg to reg
From: kernel test robot @ 2026-06-24 0:43 UTC (permalink / raw)
To: Arnav Kapoor, Greg Kroah-Hartman, Sudip Mukherjee, Teddy Wang
Cc: llvm, oe-kbuild-all, linux-staging, linux-fbdev, linux-kernel,
Arnav Kapoor
In-Reply-To: <20260621045050.63460-1-kapoorarnav43@gmail.com>
Hi Arnav,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-linus]
[also build test ERROR on v7.1]
[cannot apply to staging/staging-testing staging/staging-next linus/master next-20260623]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Arnav-Kapoor/staging-sm750fb-rename-pvMem-to-vram-and-pvReg-to-reg/20260622-235607
base: staging/staging-linus
patch link: https://lore.kernel.org/r/20260621045050.63460-1-kapoorarnav43%40gmail.com
patch subject: [staging] staging: sm750fb: rename pvMem to vram and pvReg to reg
config: sparc64-allmodconfig (https://download.01.org/0day-ci/archive/20260624/202606240823.hWXfYyPf-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260624/202606240823.hWXfYyPf-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/202606240823.hWXfYyPf-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/staging/sm750fb/sm750.c:625:31: error: no member named 'vram' in 'struct sm750_dev'
625 | crtc->v_screen = sm750_dev->vram;
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:631:31: error: no member named 'vram' in 'struct sm750_dev'
631 | crtc->v_screen = sm750_dev->vram;
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:638:32: error: no member named 'vram' in 'struct sm750_dev'
638 | crtc->v_screen = sm750_dev->vram;
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:644:32: error: no member named 'vram' in 'struct sm750_dev'
644 | crtc->v_screen = sm750_dev->vram + crtc->o_screen;
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:652:32: error: no member named 'vram' in 'struct sm750_dev'
652 | crtc->v_screen = sm750_dev->vram;
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:660:32: error: no member named 'vram' in 'struct sm750_dev'
660 | crtc->v_screen = sm750_dev->vram + crtc->o_screen;
| ~~~~~~~~~ ^
>> drivers/staging/sm750fb/sm750.c:758:33: error: no member named 'reg' in 'struct sm750_dev'
758 | crtc->cursor.mmio = sm750_dev->reg +
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:764:35: error: no member named 'vram' in 'struct sm750_dev'
764 | crtc->cursor.vstart = sm750_dev->vram + crtc->cursor.offset;
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:1031:23: error: no member named 'vram' in 'struct sm750_dev'
1031 | memset_io(sm750_dev->vram, 0, sm750_dev->vidmem_size);
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:1062:21: error: no member named 'reg' in 'struct sm750_dev'
1062 | iounmap(sm750_dev->reg);
| ~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:1063:21: error: no member named 'vram' in 'struct sm750_dev'
1063 | iounmap(sm750_dev->vram);
| ~~~~~~~~~ ^
11 errors generated.
vim +625 drivers/staging/sm750fb/sm750.c
591
592 static int sm750fb_set_drv(struct lynxfb_par *par)
593 {
594 int ret;
595 struct sm750_dev *sm750_dev;
596 struct lynxfb_output *output;
597 struct lynxfb_crtc *crtc;
598
599 ret = 0;
600
601 sm750_dev = par->dev;
602 output = &par->output;
603 crtc = &par->crtc;
604
605 crtc->vidmem_size = sm750_dev->vidmem_size;
606 if (sm750_dev->fb_count > 1)
607 crtc->vidmem_size >>= 1;
608
609 /* setup crtc and output member */
610 sm750_dev->hw_cursor = g_hwcursor;
611
612 crtc->line_pad = 16;
613 crtc->xpanstep = 8;
614 crtc->ypanstep = 1;
615 crtc->ywrapstep = 0;
616
617 /* chip specific phase */
618 sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ?
619 hw_sm750le_de_wait : hw_sm750_de_wait;
620 switch (sm750_dev->dataflow) {
621 case sm750_simul_pri:
622 output->paths = sm750_pnc;
623 crtc->channel = sm750_primary;
624 crtc->o_screen = 0;
> 625 crtc->v_screen = sm750_dev->vram;
626 break;
627 case sm750_simul_sec:
628 output->paths = sm750_pnc;
629 crtc->channel = sm750_secondary;
630 crtc->o_screen = 0;
631 crtc->v_screen = sm750_dev->vram;
632 break;
633 case sm750_dual_normal:
634 if (par->index == 0) {
635 output->paths = sm750_panel;
636 crtc->channel = sm750_primary;
637 crtc->o_screen = 0;
638 crtc->v_screen = sm750_dev->vram;
639 } else {
640 output->paths = sm750_crt;
641 crtc->channel = sm750_secondary;
642 /* not consider of padding stuffs for o_screen,need fix */
643 crtc->o_screen = sm750_dev->vidmem_size >> 1;
644 crtc->v_screen = sm750_dev->vram + crtc->o_screen;
645 }
646 break;
647 case sm750_dual_swap:
648 if (par->index == 0) {
649 output->paths = sm750_panel;
650 crtc->channel = sm750_secondary;
651 crtc->o_screen = 0;
652 crtc->v_screen = sm750_dev->vram;
653 } else {
654 output->paths = sm750_crt;
655 crtc->channel = sm750_primary;
656 /* not consider of padding stuffs for o_screen,
657 * need fix
658 */
659 crtc->o_screen = sm750_dev->vidmem_size >> 1;
660 crtc->v_screen = sm750_dev->vram + crtc->o_screen;
661 }
662 break;
663 default:
664 ret = -EINVAL;
665 }
666
667 return ret;
668 }
669
670 static const struct fb_ops lynxfb_ops = {
671 .owner = THIS_MODULE,
672 FB_DEFAULT_IOMEM_OPS,
673 .fb_check_var = lynxfb_ops_check_var,
674 .fb_set_par = lynxfb_ops_set_par,
675 .fb_setcolreg = lynxfb_ops_setcolreg,
676 .fb_blank = lynxfb_ops_blank,
677 .fb_pan_display = lynxfb_ops_pan_display,
678 };
679
680 static const struct fb_ops lynxfb_ops_with_cursor = {
681 .owner = THIS_MODULE,
682 FB_DEFAULT_IOMEM_OPS,
683 .fb_check_var = lynxfb_ops_check_var,
684 .fb_set_par = lynxfb_ops_set_par,
685 .fb_setcolreg = lynxfb_ops_setcolreg,
686 .fb_blank = lynxfb_ops_blank,
687 .fb_pan_display = lynxfb_ops_pan_display,
688 .fb_cursor = lynxfb_ops_cursor,
689 };
690
691 static const struct fb_ops lynxfb_ops_accel = {
692 .owner = THIS_MODULE,
693 __FB_DEFAULT_IOMEM_OPS_RDWR,
694 .fb_check_var = lynxfb_ops_check_var,
695 .fb_set_par = lynxfb_ops_set_par,
696 .fb_setcolreg = lynxfb_ops_setcolreg,
697 .fb_blank = lynxfb_ops_blank,
698 .fb_pan_display = lynxfb_ops_pan_display,
699 .fb_fillrect = lynxfb_ops_fillrect,
700 .fb_copyarea = lynxfb_ops_copyarea,
701 .fb_imageblit = lynxfb_ops_imageblit,
702 __FB_DEFAULT_IOMEM_OPS_MMAP,
703 };
704
705 static const struct fb_ops lynxfb_ops_accel_with_cursor = {
706 .owner = THIS_MODULE,
707 __FB_DEFAULT_IOMEM_OPS_RDWR,
708 .fb_check_var = lynxfb_ops_check_var,
709 .fb_set_par = lynxfb_ops_set_par,
710 .fb_setcolreg = lynxfb_ops_setcolreg,
711 .fb_blank = lynxfb_ops_blank,
712 .fb_pan_display = lynxfb_ops_pan_display,
713 .fb_fillrect = lynxfb_ops_fillrect,
714 .fb_copyarea = lynxfb_ops_copyarea,
715 .fb_imageblit = lynxfb_ops_imageblit,
716 .fb_cursor = lynxfb_ops_cursor,
717 __FB_DEFAULT_IOMEM_OPS_MMAP,
718 };
719
720 static int lynxfb_set_fbinfo(struct fb_info *info, int index)
721 {
722 int i;
723 struct lynxfb_par *par;
724 struct sm750_dev *sm750_dev;
725 struct lynxfb_crtc *crtc;
726 struct lynxfb_output *output;
727 struct fb_var_screeninfo *var;
728 struct fb_fix_screeninfo *fix;
729
730 const struct fb_videomode *pdb[] = {
731 lynx750_ext, NULL, vesa_modes,
732 };
733 int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
734 static const char *fix_id[2] = {
735 "sm750_fb1", "sm750_fb2",
736 };
737
738 int ret, line_length;
739
740 ret = 0;
741 par = (struct lynxfb_par *)info->par;
742 sm750_dev = par->dev;
743 crtc = &par->crtc;
744 output = &par->output;
745 var = &info->var;
746 fix = &info->fix;
747
748 /* set index */
749 par->index = index;
750 output->channel = &crtc->channel;
751 sm750fb_set_drv(par);
752
753 /*
754 * set current cursor variable and proc pointer,
755 * must be set after crtc member initialized
756 */
757 crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
> 758 crtc->cursor.mmio = sm750_dev->reg +
759 0x800f0 + (int)crtc->channel * 0x140;
760
761 crtc->cursor.max_h = 64;
762 crtc->cursor.max_w = 64;
763 crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
764 crtc->cursor.vstart = sm750_dev->vram + crtc->cursor.offset;
765
766 memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
767 if (!g_hwcursor)
768 sm750_hw_cursor_disable(&crtc->cursor);
769
770 /* set info->fbops, must be set before fb_find_mode */
771 if (!sm750_dev->accel_off) {
772 /* use 2d acceleration */
773 if (!g_hwcursor)
774 info->fbops = &lynxfb_ops_accel;
775 else
776 info->fbops = &lynxfb_ops_accel_with_cursor;
777 } else {
778 if (!g_hwcursor)
779 info->fbops = &lynxfb_ops;
780 else
781 info->fbops = &lynxfb_ops_with_cursor;
782 }
783
784 if (!g_fbmode[index]) {
785 g_fbmode[index] = g_def_fbmode;
786 if (index)
787 g_fbmode[index] = g_fbmode[0];
788 }
789
790 for (i = 0; i < 3; i++) {
791 ret = fb_find_mode(var, info, g_fbmode[index],
792 pdb[i], cdb[i], NULL, 8);
793
794 if (ret == 1 || ret == 2)
795 break;
796 }
797
798 /* set par */
799 par->info = info;
800
801 /* set info */
802 line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
803 crtc->line_pad);
804
805 info->pseudo_palette = &par->pseudo_palette[0];
806 info->screen_base = crtc->v_screen;
807 info->screen_size = line_length * var->yres_virtual;
808
809 /* set info->fix */
810 fix->type = FB_TYPE_PACKED_PIXELS;
811 fix->type_aux = 0;
812 fix->xpanstep = crtc->xpanstep;
813 fix->ypanstep = crtc->ypanstep;
814 fix->ywrapstep = crtc->ywrapstep;
815 fix->accel = FB_ACCEL_SMI;
816
817 strscpy(fix->id, fix_id[index], sizeof(fix->id));
818
819 fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
820 /*
821 * according to mmap experiment from user space application,
822 * fix->mmio_len should not larger than virtual size
823 * (xres_virtual x yres_virtual x ByPP)
824 * Below line maybe buggy when user mmap fb dev node and write
825 * data into the bound over virtual size
826 */
827 fix->smem_len = crtc->vidmem_size;
828 info->screen_size = fix->smem_len;
829 fix->line_length = line_length;
830 fix->mmio_start = sm750_dev->vidreg_start;
831 fix->mmio_len = sm750_dev->vidreg_size;
832
833 lynxfb_set_visual_mode(info);
834
835 /* set var */
836 var->activate = FB_ACTIVATE_NOW;
837 var->accel_flags = 0;
838 var->vmode = FB_VMODE_NONINTERLACED;
839
840 ret = fb_alloc_cmap(&info->cmap, 256, 0);
841 if (ret < 0) {
842 dev_err(info->device, "Could not allocate memory for cmap.\n");
843 goto exit;
844 }
845
846 exit:
847 lynxfb_ops_check_var(var, info);
848 return ret;
849 }
850
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* [PATCH] staging: sm750fb: rename variables to avoid CamelCase
From: André Moreira @ 2026-06-23 22:06 UTC (permalink / raw)
To: sudipm.mukherjee, teddy.wang, gregkh
Cc: linux-fbdev, linux-staging, linux-kernel, André Moreira
Rename 'pvReg' to 'pv_reg' and 'setAllEngOff' to 'set_all_eng_off'
throughout the driver to comply with the Linux kernel coding style.
Signed-off-by: André Moreira <andrem.33333@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 6 +++---
drivers/staging/sm750fb/sm750.h | 4 ++--
drivers/staging/sm750fb/sm750_hw.c | 12 ++++++------
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 89c811e0806c4..716a8935f58d1 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -743,7 +743,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
* must be set after crtc member initialized
*/
crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
- crtc->cursor.mmio = sm750_dev->pvReg +
+ crtc->cursor.mmio = sm750_dev->pv_reg +
0x800f0 + (int)crtc->channel * 0x140;
crtc->cursor.max_h = 64;
@@ -848,7 +848,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
sm750_dev->init_parm.mem_clk = 0;
sm750_dev->init_parm.master_clk = 0;
sm750_dev->init_parm.power_mode = 0;
- sm750_dev->init_parm.setAllEngOff = 0;
+ sm750_dev->init_parm.set_all_eng_off = 0;
sm750_dev->init_parm.reset_memory = 1;
/* defaultly turn g_hwcursor on for both view */
@@ -1047,7 +1047,7 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
sm750fb_framebuffer_release(sm750_dev);
arch_phys_wc_del(sm750_dev->mtrr.vram);
- iounmap(sm750_dev->pvReg);
+ iounmap(sm750_dev->pv_reg);
iounmap(sm750_dev->vmem);
pci_release_region(pdev, 1);
kfree(g_settings);
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index d2c522e67f26a..e8885133da2e1 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -44,7 +44,7 @@ struct init_status {
ushort chip_clk;
ushort mem_clk;
ushort master_clk;
- ushort setAllEngOff;
+ ushort set_all_eng_off;
ushort reset_memory;
};
@@ -97,7 +97,7 @@ struct sm750_dev {
unsigned long vidreg_start;
__u32 vidmem_size;
__u32 vidreg_size;
- void __iomem *pvReg;
+ void __iomem *pv_reg;
unsigned char __iomem *vmem;
/* locks*/
spinlock_t slock;
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 34a837fb4b649..95f797e5776a2 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -23,18 +23,18 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
}
/* now map mmio and vidmem */
- sm750_dev->pvReg =
+ sm750_dev->pv_reg =
ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
- if (!sm750_dev->pvReg) {
+ if (!sm750_dev->pv_reg) {
dev_err(&pdev->dev, "mmio failed\n");
ret = -EFAULT;
goto err_release_region;
}
- sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
- sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
+ sm750_dev->accel.dpr_base = sm750_dev->pv_reg + DE_BASE_ADDR_TYPE1;
+ sm750_dev->accel.dp_port_base = sm750_dev->pv_reg + DE_PORT_ADDR_TYPE1;
- mmio750 = sm750_dev->pvReg;
+ mmio750 = sm750_dev->pv_reg;
sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
sm750_dev->vidmem_start = pci_resource_start(pdev, 0);
@@ -58,7 +58,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
return 0;
err_unmap_reg:
- iounmap(sm750_dev->pvReg);
+ iounmap(sm750_dev->pv_reg);
err_release_region:
pci_release_region(pdev, 1);
return ret;
--
2.43.0
^ permalink raw reply related
* Re: [PATCH v2 3/4] drm/ssd130x: Add SSD135X_FAMILY and SSD1351 support
From: Amit Barzilai @ 2026-06-23 21:34 UTC (permalink / raw)
To: markus.elfring
Cc: airlied, amit.barzilai22, andy, azuddinadam, chintanlike,
conor+dt, deller, devicetree, dri-devel, gregkh, javierm, krzk+dt,
linux-fbdev, linux-kernel, linux-staging, maarten.lankhorst,
mripard, robh, simona, tzimmermann
In-Reply-To: <16a86f3d-caf0-46d0-97a4-c9585bdaa06c@web.de>
Markus Elfring <Markus.Elfring@web.de> writes:
>> +++ b/drivers/gpu/drm/solomon/ssd130x.c
>> @@ -146,6 +146,33 @@
>> #define SSD133X_COLOR_DEPTH_256 0x0
>> #define SSD133X_COLOR_DEPTH_65K 0x1
>>
>> +/* ssd135x commands */
>> +#define SSD135X_SET_COL_RANGE 0x15
>> +#define SSD135X_WRITE_RAM 0x5c
>> +#define SSD135X_SET_ROW_RANGE 0x75
> [...]
>
> How do you think about to use an enumeration for such data?
> https://en.wikipedia.org/wiki/Enumerated_type#C_and_syntactically_similar_languages
Thank you for the suggestion.
I used #define to stay consistent with the rest of ssd130x.c, where the
command constants for the other families are all defined the same way.
In my opinion an enum could be a readable solution for these values, but I
don't think the switch should be included in this series.
--
Thanks,
Amit
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox