* Re: [PATCH] staging: sm750fb: remove unnecessary parentheses in ddk750_swi2c.c
From: Greg Kroah-Hartman @ 2026-02-04 13:14 UTC (permalink / raw)
To: Zeeshan Ahmad
Cc: Sudip Mukherjee, Teddy Wang, linux-staging, linux-fbdev,
linux-kernel
In-Reply-To: <20260204125525.5498-1-zeeshanahmad022019@gmail.com>
On Wed, Feb 04, 2026 at 05:55:25PM +0500, Zeeshan Ahmad wrote:
> Checkpatch reported "Unnecessary parentheses around 'clk_gpio > 31'"
> and 'data_gpio > 31'.
>
> Remove the extra parentheses to clean up the code and satisfy the
> coding style guidelines.
>
> Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
> ---
> drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
> index 0ef8d4ff2ef9..50e51d730d86 100644
> --- a/drivers/staging/sm750fb/ddk750_swi2c.c
> +++ b/drivers/staging/sm750fb/ddk750_swi2c.c
> @@ -393,7 +393,7 @@ long sm750_sw_i2c_init(unsigned char clk_gpio, unsigned char data_gpio)
> * Return 0 if the GPIO pins to be used is out of range. The
> * range is only from [0..63]
> */
> - if ((clk_gpio > 31) || (data_gpio > 31))
> + if (clk_gpio > 31 || data_gpio > 31)
Now I have to remember which is a higher priority in C, > or ||
Please don't make changes like this, I thought checkpatch turned these
off for staging code, as I keep complaining about it on a weekly (or
more than that) basis :(
If you look at the mailing list, I think I just complained about this a
few hours before you sent this change as well...
thanks,
greg k-h
^ permalink raw reply
* [PATCH] staging: sm750fb: remove unnecessary parentheses in ddk750_swi2c.c
From: Zeeshan Ahmad @ 2026-02-04 12:55 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-staging, linux-fbdev, linux-kernel, Zeeshan Ahmad
Checkpatch reported "Unnecessary parentheses around 'clk_gpio > 31'"
and 'data_gpio > 31'.
Remove the extra parentheses to clean up the code and satisfy the
coding style guidelines.
Signed-off-by: Zeeshan Ahmad <zeeshanahmad022019@gmail.com>
---
drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index 0ef8d4ff2ef9..50e51d730d86 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -393,7 +393,7 @@ long sm750_sw_i2c_init(unsigned char clk_gpio, unsigned char data_gpio)
* Return 0 if the GPIO pins to be used is out of range. The
* range is only from [0..63]
*/
- if ((clk_gpio > 31) || (data_gpio > 31))
+ if (clk_gpio > 31 || data_gpio > 31)
return -1;
if (sm750_get_chip_type() == SM750LE)
--
2.43.0
^ permalink raw reply related
* [PATCH v3 5/5] staging: sm750fb: convert logging to device-based in sm750_hw.c
From: Artem Lytkin @ 2026-02-04 12:06 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
In-Reply-To: <20260204120602.6715-1-iprintercanon@gmail.com>
Convert pr_err calls to dev_err using &pdev->dev in hw_sm750_map()
where struct pci_dev *pdev is available as a function parameter.
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/sm750fb/sm750_hw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index e3e4b75d6..bf4c1585c 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -42,7 +42,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
*/
ret = pci_request_region(pdev, 1, "sm750fb");
if (ret) {
- pr_err("Can not request PCI regions.\n");
+ dev_err(&pdev->dev, "Can not request PCI regions.\n");
goto exit;
}
@@ -50,7 +50,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
sm750_dev->pvReg =
ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
if (!sm750_dev->pvReg) {
- pr_err("mmio failed\n");
+ dev_err(&pdev->dev, "mmio failed\n");
ret = -EFAULT;
goto exit;
}
@@ -75,7 +75,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
ioremap_wc(sm750_dev->vidmem_start, sm750_dev->vidmem_size);
if (!sm750_dev->pvMem) {
iounmap(sm750_dev->pvReg);
- pr_err("Map video memory failed\n");
+ dev_err(&pdev->dev, "Map video memory failed\n");
ret = -EFAULT;
goto exit;
}
--
2.43.0
^ permalink raw reply related
* [PATCH v3 4/5] staging: sm750fb: convert logging to device-based in sm750.c
From: Artem Lytkin @ 2026-02-04 12:06 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
In-Reply-To: <20260204120602.6715-1-iprintercanon@gmail.com>
Convert remaining pr_err and pr_warn calls to dev_err and dev_warn
using info->device where struct fb_info is available. This provides
proper device context in log messages.
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 050408af2..1561fa5fe 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -388,7 +388,8 @@ static int lynxfb_ops_set_par(struct fb_info *info)
var->accel_flags = 0;/*FB_ACCELF_TEXT;*/
if (ret) {
- pr_err("bpp %d not supported\n", var->bits_per_pixel);
+ dev_err(info->device, "bpp %d not supported\n",
+ var->bits_per_pixel);
return ret;
}
ret = hw_sm750_crtc_set_mode(crtc, var, fix);
@@ -487,7 +488,8 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
ret = lynxfb_set_color_offsets(info);
if (ret) {
- pr_err("bpp %d not supported\n", var->bits_per_pixel);
+ dev_err(info->device, "bpp %d not supported\n",
+ var->bits_per_pixel);
return ret;
}
@@ -502,7 +504,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
request = ALIGN(request, crtc->line_pad);
request = request * var->yres_virtual;
if (crtc->vidmem_size < request) {
- pr_err("not enough video memory for mode\n");
+ dev_err(info->device, "not enough video memory for mode\n");
return -ENOMEM;
}
@@ -527,7 +529,7 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
ret = 0;
if (regno > 256) {
- pr_err("regno = %d\n", regno);
+ dev_err(info->device, "regno = %d\n", regno);
return -EINVAL;
}
@@ -793,21 +795,23 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
pdb[i], cdb[i], NULL, 8);
if (ret == 1) {
- pr_info("success! use specified mode:%s in %s\n",
- g_fbmode[index],
- mdb_desc[i]);
+ dev_info(info->device,
+ "use specified mode:%s in %s\n",
+ g_fbmode[index],
+ mdb_desc[i]);
break;
} else if (ret == 2) {
- pr_warn("use specified mode:%s in %s,with an ignored refresh rate\n",
- g_fbmode[index],
- mdb_desc[i]);
+ dev_warn(info->device,
+ "use specified mode:%s in %s, with an ignored refresh rate\n",
+ g_fbmode[index],
+ mdb_desc[i]);
break;
} else if (ret == 3 || ret == 4) {
continue;
} else {
- pr_warn("ret = %d,fb_find_mode failed,with %s\n",
- ret,
- mdb_desc[i]);
+ dev_warn(info->device,
+ "fb_find_mode failed with %s (ret=%d)\n",
+ mdb_desc[i], ret);
}
}
@@ -855,7 +859,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
ret = fb_alloc_cmap(&info->cmap, 256, 0);
if (ret < 0) {
- pr_err("Could not allocate memory for cmap.\n");
+ dev_err(info->device, "Could not allocate memory for cmap.\n");
goto exit;
}
--
2.43.0
^ permalink raw reply related
* [PATCH v3 3/5] staging: sm750fb: remove debug and diagnostic prints
From: Artem Lytkin @ 2026-02-04 12:06 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
In-Reply-To: <20260204120602.6715-1-iprintercanon@gmail.com>
Remove pr_info, pr_debug, and pr_warn calls that dump internal
variable values, pointer addresses, structure contents, and
other diagnostic information not useful for production use.
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 53 ++----------------------------
drivers/staging/sm750fb/sm750_hw.c | 8 -----
2 files changed, 2 insertions(+), 59 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index bd2d4a290..050408af2 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -375,7 +375,6 @@ static int lynxfb_ops_set_par(struct fb_info *info)
line_length = var->xres_virtual * var->bits_per_pixel / 8;
line_length = ALIGN(line_length, crtc->line_pad);
fix->line_length = line_length;
- pr_info("fix->line_length = %d\n", fix->line_length);
/*
* var->red,green,blue,transp are need to be set by driver
@@ -485,11 +484,6 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
par = info->par;
crtc = &par->crtc;
- pr_debug("check var:%dx%d-%d\n",
- var->xres,
- var->yres,
- var->bits_per_pixel);
-
ret = lynxfb_set_color_offsets(info);
if (ret) {
@@ -580,7 +574,6 @@ static int lynxfb_ops_blank(int blank, struct fb_info *info)
struct lynxfb_par *par;
struct lynxfb_output *output;
- pr_debug("blank = %d.\n", blank);
par = info->par;
output = &par->output;
sm750_dev = par->dev;
@@ -625,7 +618,6 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
crtc->channel = sm750_primary;
crtc->o_screen = 0;
crtc->v_screen = sm750_dev->pvMem;
- pr_info("use simul primary mode\n");
break;
case sm750_simul_sec:
output->paths = sm750_pnc;
@@ -767,7 +759,6 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
crtc->cursor.mmio = sm750_dev->pvReg +
0x800f0 + (int)crtc->channel * 0x140;
- pr_info("crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
crtc->cursor.max_h = 64;
crtc->cursor.max_w = 64;
crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
@@ -811,11 +802,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
g_fbmode[index],
mdb_desc[i]);
break;
- } else if (ret == 3) {
- pr_warn("wanna use default mode\n");
- /*break;*/
- } else if (ret == 4) {
- pr_warn("fall back to any valid mode\n");
+ } else if (ret == 3 || ret == 4) {
+ continue;
} else {
pr_warn("ret = %d,fb_find_mode failed,with %s\n",
ret,
@@ -823,25 +811,6 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
}
}
- /* some member of info->var had been set by fb_find_mode */
-
- pr_info("Member of info->var is :\n"
- "xres=%d\n"
- "yres=%d\n"
- "xres_virtual=%d\n"
- "yres_virtual=%d\n"
- "xoffset=%d\n"
- "yoffset=%d\n"
- "bits_per_pixel=%d\n"
- " ...\n",
- var->xres,
- var->yres,
- var->xres_virtual,
- var->yres_virtual,
- var->xoffset,
- var->yoffset,
- var->bits_per_pixel);
-
/* set par */
par->info = info;
@@ -851,7 +820,6 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
info->pseudo_palette = &par->pseudo_palette[0];
info->screen_base = crtc->v_screen;
- pr_debug("screen_base vaddr = %p\n", info->screen_base);
info->screen_size = line_length * var->yres_virtual;
/* set info->fix */
@@ -865,7 +833,6 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
strscpy(fix->id, fixId[index], sizeof(fix->id));
fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
- pr_info("fix->smem_start = %lx\n", fix->smem_start);
/*
* according to mmap experiment from user space application,
* fix->mmio_len should not larger than virtual size
@@ -874,13 +841,10 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
* data into the bound over virtual size
*/
fix->smem_len = crtc->vidmem_size;
- pr_info("fix->smem_len = %x\n", fix->smem_len);
info->screen_size = fix->smem_len;
fix->line_length = line_length;
fix->mmio_start = sm750_dev->vidreg_start;
- pr_info("fix->mmio_start = %lx\n", fix->mmio_start);
fix->mmio_len = sm750_dev->vidreg_size;
- pr_info("fix->mmio_len = %x\n", fix->mmio_len);
lynxfb_set_visual_mode(info);
@@ -889,22 +853,12 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
var->accel_flags = 0;
var->vmode = FB_VMODE_NONINTERLACED;
- pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
- info->cmap.start, info->cmap.len,
- info->cmap.red, info->cmap.green, info->cmap.blue,
- info->cmap.transp);
-
ret = fb_alloc_cmap(&info->cmap, 256, 0);
if (ret < 0) {
pr_err("Could not allocate memory for cmap.\n");
goto exit;
}
- pr_debug("#2 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
- info->cmap.start, info->cmap.len,
- info->cmap.red, info->cmap.green, info->cmap.blue,
- info->cmap.transp);
-
exit:
lynxfb_ops_check_var(var, info);
return ret;
@@ -934,9 +888,6 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
}
while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
- dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
- dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
-
if (!strcmp(opt, "swap")) {
swap = 1;
} else if (!strcmp(opt, "nocrt")) {
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index ce46f240c..e3e4b75d6 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -34,8 +34,6 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
sm750_dev->vidreg_start = pci_resource_start(pdev, 1);
sm750_dev->vidreg_size = SZ_2M;
- pr_info("mmio phyAddr = %lx\n", sm750_dev->vidreg_start);
-
/*
* reserve the vidreg space of smi adaptor
* if you do this, you need to add release region code
@@ -56,7 +54,6 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
ret = -EFAULT;
goto exit;
}
- pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
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;
@@ -72,8 +69,6 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
* @ddk750_get_vm_size function can be safe.
*/
sm750_dev->vidmem_size = ddk750_get_vm_size();
- pr_info("video memory phyAddr = %lx, size = %u bytes\n",
- sm750_dev->vidmem_start, sm750_dev->vidmem_size);
/* reserve the vidmem space of smi adaptor */
sm750_dev->pvMem =
@@ -84,7 +79,6 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
ret = -EFAULT;
goto exit;
}
- pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);
exit:
return ret;
}
@@ -163,11 +157,9 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
* The following register values for CH7301 are from
* Chrontel app note and our experiment.
*/
- pr_info("yes,CH7301 DVI chip found\n");
sm750_sw_i2c_write_reg(0xec, 0x1d, 0x16);
sm750_sw_i2c_write_reg(0xec, 0x21, 0x9);
sm750_sw_i2c_write_reg(0xec, 0x49, 0xC0);
- pr_info("okay,CH7301 DVI chip setup done\n");
}
}
--
2.43.0
^ permalink raw reply related
* [PATCH v3 2/5] staging: sm750fb: use strcmp() for exact option matching
From: Artem Lytkin @ 2026-02-04 12:05 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
In-Reply-To: <20260204120602.6715-1-iprintercanon@gmail.com>
Replace strncmp(opt, "...", strlen("...")) with strcmp() in option
parsing functions. Options from strsep() are complete null-terminated
tokens, so prefix matching via strncmp() could cause false positives
for options like "noaccelXYZ" matching "noaccel".
Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging")
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 4c6e84c03..bd2d4a290 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -937,21 +937,21 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
- if (!strncmp(opt, "swap", strlen("swap"))) {
+ if (!strcmp(opt, "swap")) {
swap = 1;
- } else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
+ } else if (!strcmp(opt, "nocrt")) {
sm750_dev->nocrt = 1;
- } else if (!strncmp(opt, "36bit", strlen("36bit"))) {
+ } else if (!strcmp(opt, "36bit")) {
sm750_dev->pnltype = sm750_doubleTFT;
- } else if (!strncmp(opt, "18bit", strlen("18bit"))) {
+ } else if (!strcmp(opt, "18bit")) {
sm750_dev->pnltype = sm750_dualTFT;
- } else if (!strncmp(opt, "24bit", strlen("24bit"))) {
+ } else if (!strcmp(opt, "24bit")) {
sm750_dev->pnltype = sm750_24TFT;
- } else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
+ } else if (!strcmp(opt, "nohwc0")) {
g_hwcursor &= ~0x1;
- } else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
+ } else if (!strcmp(opt, "nohwc1")) {
g_hwcursor &= ~0x2;
- } else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
+ } else if (!strcmp(opt, "nohwc")) {
g_hwcursor = 0;
} else {
if (!g_fbmode[0]) {
@@ -1156,11 +1156,11 @@ static int __init lynxfb_setup(char *options)
*/
while ((opt = strsep(&options, ":")) != NULL) {
/* options that mean for any lynx chips are configured here */
- if (!strncmp(opt, "noaccel", strlen("noaccel"))) {
+ if (!strcmp(opt, "noaccel")) {
g_noaccel = 1;
- } else if (!strncmp(opt, "nomtrr", strlen("nomtrr"))) {
+ } else if (!strcmp(opt, "nomtrr")) {
g_nomtrr = 1;
- } else if (!strncmp(opt, "dual", strlen("dual"))) {
+ } else if (!strcmp(opt, "dual")) {
g_dualview = 1;
} else {
memcpy(tmp, opt, strlen(opt));
--
2.43.0
^ permalink raw reply related
* [PATCH v3 1/5] staging: sm750fb: replace strcat() with memcpy() in lynxfb_setup()
From: Artem Lytkin @ 2026-02-04 12:05 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
As part of kernel hardening, I am auditing calls to strcat(). This
code works but it is a bit ugly.
This function takes a string "options" and allocates "g_settings"
which is large enough to hold a copy of "options". It copies all the
options from "options" to "g_settings" except "noaccel", "nomtrr" and
"dual". The new buffer is large enough to fit all the options so
there is no buffer overflow in using strcat() here.
However, using strcat() is misleading because "tmp" always points
to the next unused character in the "g_settings" buffer and it's
always the NUL character. Use memcpy() instead to make the code
easier to read. This also removes an instance of strcat() which
is a #NiceBonus.
Signed-off-by: Artem Lytkin <iprintercanon@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 fecd7457e..4c6e84c03 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1163,7 +1163,7 @@ static int __init lynxfb_setup(char *options)
} else if (!strncmp(opt, "dual", strlen("dual"))) {
g_dualview = 1;
} else {
- strcat(tmp, opt);
+ memcpy(tmp, opt, strlen(opt));
tmp += strlen(opt);
if (options)
*tmp++ = ':';
--
2.43.0
^ permalink raw reply related
* Re: [PATCH v2 4/4] staging: sm750fb: remove debug prints and convert logging in sm750_hw.c
From: Dan Carpenter @ 2026-02-04 11:39 UTC (permalink / raw)
To: Artem Lytkin
Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <20260204101536.3311-4-iprintercanon@gmail.com>
On Wed, Feb 04, 2026 at 10:15:36AM +0000, Artem Lytkin wrote:
> @@ -163,11 +156,11 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
> * The following register values for CH7301 are from
> * Chrontel app note and our experiment.
> */
> - pr_info("yes,CH7301 DVI chip found\n");
> + dev_info(&pdev->dev, "CH7301 DVI chip found\n");
> sm750_sw_i2c_write_reg(0xec, 0x1d, 0x16);
> sm750_sw_i2c_write_reg(0xec, 0x21, 0x9);
> sm750_sw_i2c_write_reg(0xec, 0x49, 0xC0);
> - pr_info("okay,CH7301 DVI chip setup done\n");
> + dev_info(&pdev->dev, "CH7301 DVI chip setup done\n");
Delete at least one of these. Pretty sure that Greg will want you to
delete both actually.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v2 3/4] staging: sm750fb: remove debug prints and convert logging in sm750.c
From: Dan Carpenter @ 2026-02-04 11:17 UTC (permalink / raw)
To: Artem Lytkin
Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <20260204101536.3311-3-iprintercanon@gmail.com>
On Wed, Feb 04, 2026 at 10:15:35AM +0000, Artem Lytkin wrote:
> Remove debug prints disguised as pr_info that dump internal variable
> values, pointer addresses, and structure contents. Convert remaining
> meaningful pr_err and pr_warn calls to dev_err and dev_warn where
> device context is available.
I feel like you should delete things as a separate step. It makes it
slightly easier to think about.
It's really a no brainer to delete all the pr_info() stuff. I don't
really have a problem deleting the debug code as well, but that's a
slightly more involved question because it doesn't really hurt anyone.
I guess no one will complain. Greg tends to be a fan of deleting stuff
as well.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v2 2/4] staging: sm750fb: use strcmp() for exact option matching
From: Dan Carpenter @ 2026-02-04 11:11 UTC (permalink / raw)
To: Artem Lytkin
Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <20260204101536.3311-2-iprintercanon@gmail.com>
On Wed, Feb 04, 2026 at 10:15:34AM +0000, Artem Lytkin wrote:
> Replace strncmp(opt, "...", strlen("...")) with strcmp() in option
> parsing functions. Options from strsep() are complete null-terminated
> tokens, so prefix matching via strncmp() could cause false positives
> for options like "noaccelXYZ" matching "noaccel".
>
> Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
> ---
You've changed how the code works and this is a bugfix. It should have
a Fixes tag.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH v2 1/4] staging: sm750fb: add bounds checking to option parsing in lynxfb_setup()
From: Dan Carpenter @ 2026-02-04 11:10 UTC (permalink / raw)
To: Artem Lytkin
Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <20260204101536.3311-1-iprintercanon@gmail.com>
On Wed, Feb 04, 2026 at 10:15:33AM +0000, Artem Lytkin wrote:
> Replace strcat() with memcpy() and add explicit bounds checking on the
> remaining buffer space before each copy. The original code lacked any
> validation that the write position stays within the allocated buffer.
>
This implies that there is a buffer overflow. It's important to review
this sort of thing and add a Fixes tag if the buffer overflow is real.
In this case the code works ok as-is. My main problem with the
original code is what you explained in the v1 commit, the strcat() was
just doing a memcpy(). It wasn't concatenating two strings.
Just resend the v1 patch with the following commit message:
As part of kernel hardening, I am auditing calls to strcat(). This
code works but it is a bit ugly.
This function takes a string "options" and allocates "g_settings"
which is large enough to hold a copy of "options". It copies all the
options from "options" to "g_settings" except "noaccel", "nomtrr" and
"dual". The new buffer is large enough to fit all the options so
there is no buffer overflow in using strcat() here.
However, using strcat() is misleading because "tmp" always points
to the next unused character in the "g_settings" buffer and it's
always the NUL character. Use memcpy() instead to make the code
easier to read. This also removes an instance of strcat() which
is a #NiceBonus.
regards,
dan carpenter
^ permalink raw reply
* Re: (subset) [PATCH v6 2/2] mfd: cgbc: Add support for backlight
From: Lee Jones @ 2026-02-04 11:02 UTC (permalink / raw)
To: Thomas Richard, Lee Jones, Daniel Thompson, Jingoo Han,
Helge Deller, Petri Karhula
Cc: linux-kernel, dri-devel, linux-fbdev
In-Reply-To: <20251205-cgbc-backlight-v6-2-e4175b0bf406@novatron.fi>
On Fri, 05 Dec 2025 12:19:48 +0000, Petri Karhula wrote:
> The Board Controller has control for display backlight.
> Add backlight cell for the cgbc-backlight driver which
> adds support for backlight brightness control.
>
>
Applied, thanks!
[2/2] mfd: cgbc: Add support for backlight
commit: 7c5a0d97bb1bc1df127107bf46f6ae49d73094d4
--
Lee Jones [李琼斯]
^ permalink raw reply
* Re: (subset) [PATCH v3 0/7] Fix PMI8994 WLED ovp values and more
From: Lee Jones @ 2026-02-04 10:26 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Pavel Machek, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Kiran Gunda,
Helge Deller, Luca Weiss, Konrad Dybcio, Eugene Lepshy,
Gianluca Boiano, Alejandro Tafalla,
Barnabás Czémán
Cc: dri-devel, linux-leds, devicetree, linux-kernel, Daniel Thompson,
linux-arm-msm, linux-fbdev, Konrad Dybcio, Krzysztof Kozlowski
In-Reply-To: <20260116-pmi8950-wled-v3-0-e6c93de84079@mainlining.org>
On Fri, 16 Jan 2026 08:07:32 +0100, Barnabás Czémán wrote:
> This patch series fixes supported ovp values related to pmi8994 wled
> and set same configuration for pmi8950 wled.
> It also corrects wled related properties in xiaomi-daisy, xiaomi-land and
> in xiaomi-vince.
>
>
Applied, thanks!
[1/7] dt-bindings: backlight: qcom-wled: Document ovp values for PMI8994
commit: 02031064bb8f387d81988a8abb211f1366d87582
[2/7] backlight: qcom-wled: Support ovp values for PMI8994
commit: f29f972a6e7e3f187ea4d89b98a76c1981ca4d53
[3/7] dt-bindings: backlight: qcom-wled: Document ovp values for PMI8950
commit: b2df6cf10d5242bfef2cc957d83738ccb560ed9f
[4/7] backlight: qcom-wled: Change PM8950 WLED configurations
commit: 83333aa97441ba7ce32b91e8a007c72d316a1c67
--
Lee Jones [李琼斯]
^ permalink raw reply
* [PATCH v2 4/4] staging: sm750fb: remove debug prints and convert logging in sm750_hw.c
From: Artem Lytkin @ 2026-02-04 10:15 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
In-Reply-To: <20260204101536.3311-1-iprintercanon@gmail.com>
Remove diagnostic pr_info prints that dump physical and virtual
memory addresses. Convert remaining pr_err calls to dev_err in
hw_sm750_map() where struct pci_dev *pdev is available.
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/sm750fb/sm750_hw.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index ce46f240c..420ebe057 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -34,8 +34,6 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
sm750_dev->vidreg_start = pci_resource_start(pdev, 1);
sm750_dev->vidreg_size = SZ_2M;
- pr_info("mmio phyAddr = %lx\n", sm750_dev->vidreg_start);
-
/*
* reserve the vidreg space of smi adaptor
* if you do this, you need to add release region code
@@ -44,7 +42,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
*/
ret = pci_request_region(pdev, 1, "sm750fb");
if (ret) {
- pr_err("Can not request PCI regions.\n");
+ dev_err(&pdev->dev, "Can not request PCI regions.\n");
goto exit;
}
@@ -52,12 +50,10 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
sm750_dev->pvReg =
ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
if (!sm750_dev->pvReg) {
- pr_err("mmio failed\n");
+ dev_err(&pdev->dev, "mmio failed\n");
ret = -EFAULT;
goto exit;
}
- pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
-
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;
@@ -72,19 +68,16 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
* @ddk750_get_vm_size function can be safe.
*/
sm750_dev->vidmem_size = ddk750_get_vm_size();
- pr_info("video memory phyAddr = %lx, size = %u bytes\n",
- sm750_dev->vidmem_start, sm750_dev->vidmem_size);
/* reserve the vidmem space of smi adaptor */
sm750_dev->pvMem =
ioremap_wc(sm750_dev->vidmem_start, sm750_dev->vidmem_size);
if (!sm750_dev->pvMem) {
iounmap(sm750_dev->pvReg);
- pr_err("Map video memory failed\n");
+ dev_err(&pdev->dev, "Map video memory failed\n");
ret = -EFAULT;
goto exit;
}
- pr_info("video memory vaddr = %p\n", sm750_dev->pvMem);
exit:
return ret;
}
@@ -163,11 +156,11 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
* The following register values for CH7301 are from
* Chrontel app note and our experiment.
*/
- pr_info("yes,CH7301 DVI chip found\n");
+ dev_info(&pdev->dev, "CH7301 DVI chip found\n");
sm750_sw_i2c_write_reg(0xec, 0x1d, 0x16);
sm750_sw_i2c_write_reg(0xec, 0x21, 0x9);
sm750_sw_i2c_write_reg(0xec, 0x49, 0xC0);
- pr_info("okay,CH7301 DVI chip setup done\n");
+ dev_info(&pdev->dev, "CH7301 DVI chip setup done\n");
}
}
--
2.43.0
^ permalink raw reply related
* [PATCH v2 3/4] staging: sm750fb: remove debug prints and convert logging in sm750.c
From: Artem Lytkin @ 2026-02-04 10:15 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
In-Reply-To: <20260204101536.3311-1-iprintercanon@gmail.com>
Remove debug prints disguised as pr_info that dump internal variable
values, pointer addresses, and structure contents. Convert remaining
meaningful pr_err and pr_warn calls to dev_err and dev_warn where
device context is available.
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 85 ++++++++-------------------------
1 file changed, 20 insertions(+), 65 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 73d78f893..1feb97bee 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -375,7 +375,6 @@ static int lynxfb_ops_set_par(struct fb_info *info)
line_length = var->xres_virtual * var->bits_per_pixel / 8;
line_length = ALIGN(line_length, crtc->line_pad);
fix->line_length = line_length;
- pr_info("fix->line_length = %d\n", fix->line_length);
/*
* var->red,green,blue,transp are need to be set by driver
@@ -389,7 +388,8 @@ static int lynxfb_ops_set_par(struct fb_info *info)
var->accel_flags = 0;/*FB_ACCELF_TEXT;*/
if (ret) {
- pr_err("bpp %d not supported\n", var->bits_per_pixel);
+ dev_err(info->device, "bpp %d not supported\n",
+ var->bits_per_pixel);
return ret;
}
ret = hw_sm750_crtc_set_mode(crtc, var, fix);
@@ -485,15 +485,11 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
par = info->par;
crtc = &par->crtc;
- pr_debug("check var:%dx%d-%d\n",
- var->xres,
- var->yres,
- var->bits_per_pixel);
-
ret = lynxfb_set_color_offsets(info);
if (ret) {
- pr_err("bpp %d not supported\n", var->bits_per_pixel);
+ dev_err(info->device, "bpp %d not supported\n",
+ var->bits_per_pixel);
return ret;
}
@@ -508,7 +504,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
request = ALIGN(request, crtc->line_pad);
request = request * var->yres_virtual;
if (crtc->vidmem_size < request) {
- pr_err("not enough video memory for mode\n");
+ dev_err(info->device, "not enough video memory for mode\n");
return -ENOMEM;
}
@@ -533,7 +529,7 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
ret = 0;
if (regno > 256) {
- pr_err("regno = %d\n", regno);
+ dev_err(info->device, "regno = %d\n", regno);
return -EINVAL;
}
@@ -580,7 +576,6 @@ static int lynxfb_ops_blank(int blank, struct fb_info *info)
struct lynxfb_par *par;
struct lynxfb_output *output;
- pr_debug("blank = %d.\n", blank);
par = info->par;
output = &par->output;
sm750_dev = par->dev;
@@ -625,7 +620,6 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
crtc->channel = sm750_primary;
crtc->o_screen = 0;
crtc->v_screen = sm750_dev->pvMem;
- pr_info("use simul primary mode\n");
break;
case sm750_simul_sec:
output->paths = sm750_pnc;
@@ -767,7 +761,6 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
crtc->cursor.mmio = sm750_dev->pvReg +
0x800f0 + (int)crtc->channel * 0x140;
- pr_info("crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
crtc->cursor.max_h = 64;
crtc->cursor.max_w = 64;
crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
@@ -802,46 +795,26 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
pdb[i], cdb[i], NULL, 8);
if (ret == 1) {
- pr_info("success! use specified mode:%s in %s\n",
- g_fbmode[index],
- mdb_desc[i]);
+ dev_info(info->device,
+ "use specified mode:%s in %s\n",
+ g_fbmode[index],
+ mdb_desc[i]);
break;
} else if (ret == 2) {
- pr_warn("use specified mode:%s in %s,with an ignored refresh rate\n",
- g_fbmode[index],
- mdb_desc[i]);
+ dev_warn(info->device,
+ "use specified mode:%s in %s, with an ignored refresh rate\n",
+ g_fbmode[index],
+ mdb_desc[i]);
break;
- } else if (ret == 3) {
- pr_warn("wanna use default mode\n");
- /*break;*/
- } else if (ret == 4) {
- pr_warn("fall back to any valid mode\n");
+ } else if (ret == 3 || ret == 4) {
+ continue;
} else {
- pr_warn("ret = %d,fb_find_mode failed,with %s\n",
- ret,
- mdb_desc[i]);
+ dev_warn(info->device,
+ "fb_find_mode failed with %s (ret=%d)\n",
+ mdb_desc[i], ret);
}
}
- /* some member of info->var had been set by fb_find_mode */
-
- pr_info("Member of info->var is :\n"
- "xres=%d\n"
- "yres=%d\n"
- "xres_virtual=%d\n"
- "yres_virtual=%d\n"
- "xoffset=%d\n"
- "yoffset=%d\n"
- "bits_per_pixel=%d\n"
- " ...\n",
- var->xres,
- var->yres,
- var->xres_virtual,
- var->yres_virtual,
- var->xoffset,
- var->yoffset,
- var->bits_per_pixel);
-
/* set par */
par->info = info;
@@ -851,7 +824,6 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
info->pseudo_palette = &par->pseudo_palette[0];
info->screen_base = crtc->v_screen;
- pr_debug("screen_base vaddr = %p\n", info->screen_base);
info->screen_size = line_length * var->yres_virtual;
/* set info->fix */
@@ -865,7 +837,6 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
strscpy(fix->id, fixId[index], sizeof(fix->id));
fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
- pr_info("fix->smem_start = %lx\n", fix->smem_start);
/*
* according to mmap experiment from user space application,
* fix->mmio_len should not larger than virtual size
@@ -874,13 +845,10 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
* data into the bound over virtual size
*/
fix->smem_len = crtc->vidmem_size;
- pr_info("fix->smem_len = %x\n", fix->smem_len);
info->screen_size = fix->smem_len;
fix->line_length = line_length;
fix->mmio_start = sm750_dev->vidreg_start;
- pr_info("fix->mmio_start = %lx\n", fix->mmio_start);
fix->mmio_len = sm750_dev->vidreg_size;
- pr_info("fix->mmio_len = %x\n", fix->mmio_len);
lynxfb_set_visual_mode(info);
@@ -889,22 +857,12 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
var->accel_flags = 0;
var->vmode = FB_VMODE_NONINTERLACED;
- pr_debug("#1 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
- info->cmap.start, info->cmap.len,
- info->cmap.red, info->cmap.green, info->cmap.blue,
- info->cmap.transp);
-
ret = fb_alloc_cmap(&info->cmap, 256, 0);
if (ret < 0) {
- pr_err("Could not allocate memory for cmap.\n");
+ dev_err(info->device, "Could not allocate memory for cmap.\n");
goto exit;
}
- pr_debug("#2 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
- info->cmap.start, info->cmap.len,
- info->cmap.red, info->cmap.green, info->cmap.blue,
- info->cmap.transp);
-
exit:
lynxfb_ops_check_var(var, info);
return ret;
@@ -934,9 +892,6 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
}
while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
- dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
- dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
-
if (!strcmp(opt, "swap")) {
swap = 1;
} else if (!strcmp(opt, "nocrt")) {
--
2.43.0
^ permalink raw reply related
* [PATCH v2 2/4] staging: sm750fb: use strcmp() for exact option matching
From: Artem Lytkin @ 2026-02-04 10:15 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
In-Reply-To: <20260204101536.3311-1-iprintercanon@gmail.com>
Replace strncmp(opt, "...", strlen("...")) with strcmp() in option
parsing functions. Options from strsep() are complete null-terminated
tokens, so prefix matching via strncmp() could cause false positives
for options like "noaccelXYZ" matching "noaccel".
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 0eacb522d..73d78f893 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -937,21 +937,21 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt);
dev_info(&sm750_dev->pdev->dev, "src=%s\n", src);
- if (!strncmp(opt, "swap", strlen("swap"))) {
+ if (!strcmp(opt, "swap")) {
swap = 1;
- } else if (!strncmp(opt, "nocrt", strlen("nocrt"))) {
+ } else if (!strcmp(opt, "nocrt")) {
sm750_dev->nocrt = 1;
- } else if (!strncmp(opt, "36bit", strlen("36bit"))) {
+ } else if (!strcmp(opt, "36bit")) {
sm750_dev->pnltype = sm750_doubleTFT;
- } else if (!strncmp(opt, "18bit", strlen("18bit"))) {
+ } else if (!strcmp(opt, "18bit")) {
sm750_dev->pnltype = sm750_dualTFT;
- } else if (!strncmp(opt, "24bit", strlen("24bit"))) {
+ } else if (!strcmp(opt, "24bit")) {
sm750_dev->pnltype = sm750_24TFT;
- } else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) {
+ } else if (!strcmp(opt, "nohwc0")) {
g_hwcursor &= ~0x1;
- } else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) {
+ } else if (!strcmp(opt, "nohwc1")) {
g_hwcursor &= ~0x2;
- } else if (!strncmp(opt, "nohwc", strlen("nohwc"))) {
+ } else if (!strcmp(opt, "nohwc")) {
g_hwcursor = 0;
} else {
if (!g_fbmode[0]) {
@@ -1156,11 +1156,11 @@ static int __init lynxfb_setup(char *options)
*/
while ((opt = strsep(&options, ":")) != NULL) {
/* options that mean for any lynx chips are configured here */
- if (!strncmp(opt, "noaccel", strlen("noaccel"))) {
+ if (!strcmp(opt, "noaccel")) {
g_noaccel = 1;
- } else if (!strncmp(opt, "nomtrr", strlen("nomtrr"))) {
+ } else if (!strcmp(opt, "nomtrr")) {
g_nomtrr = 1;
- } else if (!strncmp(opt, "dual", strlen("dual"))) {
+ } else if (!strcmp(opt, "dual")) {
g_dualview = 1;
} else {
size_t opt_len = strlen(opt);
--
2.43.0
^ permalink raw reply related
* [PATCH v2 1/4] staging: sm750fb: add bounds checking to option parsing in lynxfb_setup()
From: Artem Lytkin @ 2026-02-04 10:15 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Artem Lytkin
Replace strcat() with memcpy() and add explicit bounds checking on the
remaining buffer space before each copy. The original code lacked any
validation that the write position stays within the allocated buffer.
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index fecd7457e..0eacb522d 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1163,8 +1163,15 @@ static int __init lynxfb_setup(char *options)
} else if (!strncmp(opt, "dual", strlen("dual"))) {
g_dualview = 1;
} else {
- strcat(tmp, opt);
- tmp += strlen(opt);
+ size_t opt_len = strlen(opt);
+ size_t remaining = len - (tmp - g_settings);
+
+ if (opt_len + 1 >= remaining) {
+ pr_warn("option string too long\n");
+ break;
+ }
+ memcpy(tmp, opt, opt_len);
+ tmp += opt_len;
if (options)
*tmp++ = ':';
else
--
2.43.0
^ permalink raw reply related
* Re: [PATCH 4/4] staging: sm750fb: convert pr_* to dev_* logging in sm750_hw.c
From: Dan Carpenter @ 2026-02-04 9:55 UTC (permalink / raw)
To: Artem Lytkin
Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <20260203230758.3056-4-iprintercanon@gmail.com>
On Tue, Feb 03, 2026 at 11:07:58PM +0000, Artem Lytkin wrote:
> Convert pr_info/pr_err calls to dev_info/dev_err in hw_sm750_map()
> and hw_sm750_inithw() where struct pci_dev *pdev is available as
> a function parameter. Functions without direct device pointer access
> are left unchanged to avoid unnecessary signature changes.
>
> Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
> ---
> drivers/staging/sm750fb/sm750_hw.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
> index ce46f240c..60f9f7135 100644
> --- a/drivers/staging/sm750fb/sm750_hw.c
> +++ b/drivers/staging/sm750fb/sm750_hw.c
> @@ -34,7 +34,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
> sm750_dev->vidreg_start = pci_resource_start(pdev, 1);
> sm750_dev->vidreg_size = SZ_2M;
>
> - pr_info("mmio phyAddr = %lx\n", sm750_dev->vidreg_start);
> + dev_info(&pdev->dev, "mmio phyAddr = %lx\n", sm750_dev->vidreg_start);
>
Same.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 3/4] staging: sm750fb: convert pr_* to dev_* logging in sm750.c
From: Dan Carpenter @ 2026-02-04 9:54 UTC (permalink / raw)
To: Artem Lytkin
Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <20260203230758.3056-3-iprintercanon@gmail.com>
On Tue, Feb 03, 2026 at 11:07:57PM +0000, Artem Lytkin wrote:
> Convert pr_info/pr_err/pr_debug/pr_warn calls to their dev_*
> equivalents in functions where device context is available via
> info->device or par->dev->pdev->dev. This adds device identification
> to log messages, improving debuggability in multi-device systems.
>
> Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 107 ++++++++++++++++----------------
> 1 file changed, 54 insertions(+), 53 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index bd2d4a290..247c58556 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -375,7 +375,7 @@ static int lynxfb_ops_set_par(struct fb_info *info)
> line_length = var->xres_virtual * var->bits_per_pixel / 8;
> line_length = ALIGN(line_length, crtc->line_pad);
> fix->line_length = line_length;
> - pr_info("fix->line_length = %d\n", fix->line_length);
> + dev_info(info->device, "fix->line_length = %d\n", fix->line_length);
Just delete this sort of thing.
>
> /*
> * var->red,green,blue,transp are need to be set by driver
> @@ -389,7 +389,8 @@ static int lynxfb_ops_set_par(struct fb_info *info)
> var->accel_flags = 0;/*FB_ACCELF_TEXT;*/
>
> if (ret) {
> - pr_err("bpp %d not supported\n", var->bits_per_pixel);
> + dev_err(info->device, "bpp %d not supported\n",
> + var->bits_per_pixel);
> return ret;
> }
> ret = hw_sm750_crtc_set_mode(crtc, var, fix);
> @@ -485,15 +486,16 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
> par = info->par;
> crtc = &par->crtc;
>
> - pr_debug("check var:%dx%d-%d\n",
> - var->xres,
> - var->yres,
> - var->bits_per_pixel);
> + dev_dbg(info->device, "check var:%dx%d-%d\n",
> + var->xres,
> + var->yres,
> + var->bits_per_pixel);
>
> ret = lynxfb_set_color_offsets(info);
>
> if (ret) {
> - pr_err("bpp %d not supported\n", var->bits_per_pixel);
> + dev_err(info->device, "bpp %d not supported\n",
> + var->bits_per_pixel);
> return ret;
> }
>
> @@ -508,7 +510,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
> request = ALIGN(request, crtc->line_pad);
> request = request * var->yres_virtual;
> if (crtc->vidmem_size < request) {
> - pr_err("not enough video memory for mode\n");
> + dev_err(info->device, "not enough video memory for mode\n");
> return -ENOMEM;
> }
>
> @@ -533,7 +535,7 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
> ret = 0;
>
> if (regno > 256) {
> - pr_err("regno = %d\n", regno);
> + dev_err(info->device, "regno = %d\n", regno);
> return -EINVAL;
> }
>
> @@ -580,10 +582,10 @@ static int lynxfb_ops_blank(int blank, struct fb_info *info)
> struct lynxfb_par *par;
> struct lynxfb_output *output;
>
> - pr_debug("blank = %d.\n", blank);
> par = info->par;
> output = &par->output;
> sm750_dev = par->dev;
> + dev_dbg(info->device, "blank = %d.\n", blank);
>
> if (sm750_dev->revid == SM750LE_REVISION_ID)
> return hw_sm750le_set_blank(output, blank);
> @@ -625,7 +627,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
> crtc->channel = sm750_primary;
> crtc->o_screen = 0;
> crtc->v_screen = sm750_dev->pvMem;
> - pr_info("use simul primary mode\n");
> + dev_info(&par->dev->pdev->dev, "use simul primary mode\n");
Is this useful?
> break;
> case sm750_simul_sec:
> output->paths = sm750_pnc;
> @@ -767,7 +769,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
> crtc->cursor.mmio = sm750_dev->pvReg +
> 0x800f0 + (int)crtc->channel * 0x140;
>
> - pr_info("crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
> + dev_info(info->device, "crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
Delete. Okay, follow the same pattern and delete the debug
code which is printed as _info.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 1/4] staging: sm750fb: replace strcat() with memcpy() in lynxfb_setup()
From: Dan Carpenter @ 2026-02-04 9:51 UTC (permalink / raw)
To: Artem Lytkin
Cc: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <20260203230758.3056-1-iprintercanon@gmail.com>
On Tue, Feb 03, 2026 at 11:07:55PM +0000, Artem Lytkin wrote:
> Replace deprecated strcat() with memcpy() in option parsing. The
> destination buffer is allocated with kzalloc (zero-filled) and the
> write position is tracked via pointer, making the null-terminator
> scan in strcat() redundant and potentially unsafe.
>
> Signed-off-by: Artem Lytkin <iprintercanon@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 fecd7457e..4c6e84c03 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -1163,7 +1163,7 @@ static int __init lynxfb_setup(char *options)
> } else if (!strncmp(opt, "dual", strlen("dual"))) {
> g_dualview = 1;
> } else {
> - strcat(tmp, opt);
> + memcpy(tmp, opt, strlen(opt));
This has exactly the same security issues as the original code.
regards,
dan carpenter
> tmp += strlen(opt);
> if (options)
> *tmp++ = ':';
> --
> 2.43.0
>
^ permalink raw reply
* Re: [PATCH] Revert "staging: fbtft: remove goto from define_fbtft_write_reg macro and clarify empty modifier fbtft-bus.c"
From: Dan Carpenter @ 2026-02-04 9:31 UTC (permalink / raw)
To: KrishnaAgarwal1308
Cc: Andy Shevchenko, Greg Kroah-Hartman, dri-devel, linux-fbdev,
linux-staging, linux-kernel
In-Reply-To: <20260203044728.23774-1-krishnaworkemail1308@gmail.com>
On Tue, Feb 03, 2026 at 10:17:27AM +0530, KrishnaAgarwal1308 wrote:
> Replace the goto-based error handling in the define_fbtft_write_reg macro with an
> early return while ensuring va_end() is called on all exit paths.
>
> Also add a short comment explaining the empty modifier argument used
> for native byte-order writes, instead of introducing an identity macro.
>
> No functional change intended.
>
> This reverts commit 6eec69e273e124dca8549fc52b0958b2953085ee. As per maintainer's feedback.
>
> Signed-off-by: Krishna Agarwal <krishnaworkemail1308@gmail.com>
> ---
There is no need to revert the commit because we weren't going to apply
it.
Also checkpatch is going to complain about return statements the same
way it complains about gotos. Actually, I'm surprised checkpatch
complains about gotos. Does it differentiate between local gotos?
I can't be bothered to check. #LazyWeb
regards,
dan carpenter
^ permalink raw reply
* [PATCH v1 3/3] fbdev: au1100fb: Don't store device specific data in global variables
From: Uwe Kleine-König @ 2026-02-04 9:15 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
In-Reply-To: <cover.1770196161.git.u.kleine-koenig@baylibre.com>
Using global data to store device specific data is a bad pattern that
breaks if there is more than one device. So expand driver data and drop
the global variables.
While there is probably no machine that has two or more au1100fb
devices, this makes the driver a better template for new drivers and
saves some memory if there is no such bound device.
bloat-o-meter reports (for ARCH=arm allmodconfig + CONFIG_FB_AU1100=y
and ignoring the rename of the init function):
add/remove: 1/4 grow/shrink: 2/2 up/down: 1360/-4800 (-3440)
Function old new delta
au1100fb_drv_probe 2648 3328 +680
$a 12808 13484 +676
au1100fb_drv_resume 404 400 -4
au1100fb_fix 68 - -68
au1100fb_var 160 - -160
fbregs 2048 - -2048
$d 9525 7009 -2516
Total: Before=38664, After=35224, chg -8.90%
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
I think this doesn't need a Fixes line, but if you want, it would be:
Fixes: 3b495f2bb749 ("Au1100 FB driver uplift for 2.6.")
Fixes: f77f50ca1a23 ("[PATCH] au1100fb: add power management support")
---
drivers/video/fbdev/au1100fb.c | 63 +++++++++++++++-------------------
drivers/video/fbdev/au1100fb.h | 5 +++
2 files changed, 33 insertions(+), 35 deletions(-)
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 94514625965b..6da532ba1d84 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -89,21 +89,6 @@ struct fb_bitfield rgb_bitfields[][4] =
{ { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } },
};
-static struct fb_fix_screeninfo au1100fb_fix = {
- .id = "AU1100 FB",
- .xpanstep = 1,
- .ypanstep = 1,
- .type = FB_TYPE_PACKED_PIXELS,
- .accel = FB_ACCEL_NONE,
-};
-
-static struct fb_var_screeninfo au1100fb_var = {
- .activate = FB_ACTIVATE_NOW,
- .height = -1,
- .width = -1,
- .vmode = FB_VMODE_NONINTERLACED,
-};
-
/* fb_blank
* Blank the screen. Depending on the mode, the screen will be
* activated with the backlight color, or desactivated
@@ -437,19 +422,26 @@ static int au1100fb_drv_probe(struct platform_device *dev)
return -EFAULT;
}
- au1100fb_fix.mmio_start = regs_res->start;
- au1100fb_fix.mmio_len = resource_size(regs_res);
+ fbdev->info.fix = (struct fb_fix_screeninfo) {
+ .mmio_start = regs_res->start,
+ .mmio_len = resource_size(regs_res),
+ .id = "AU1100 FB",
+ .xpanstep = 1,
+ .ypanstep = 1,
+ .type = FB_TYPE_PACKED_PIXELS,
+ .accel = FB_ACCEL_NONE,
+ };
if (!devm_request_mem_region(&dev->dev,
- au1100fb_fix.mmio_start,
- au1100fb_fix.mmio_len,
+ fbdev->info.fix.mmio_start,
+ fbdev->info.fix.mmio_len,
DRIVER_NAME)) {
print_err("fail to lock memory region at 0x%08lx",
- au1100fb_fix.mmio_start);
+ fbdev->info.fix.mmio_start);
return -EBUSY;
}
- fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(au1100fb_fix.mmio_start);
+ fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
print_dbg("Register memory map at %p", fbdev->regs);
print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len);
@@ -474,22 +466,27 @@ static int au1100fb_drv_probe(struct platform_device *dev)
return -ENOMEM;
}
- au1100fb_fix.smem_start = fbdev->fb_phys;
- au1100fb_fix.smem_len = fbdev->fb_len;
+ fbdev->info.fix.smem_start = fbdev->fb_phys;
+ fbdev->info.fix.smem_len = fbdev->fb_len;
print_dbg("Framebuffer memory map at %p", fbdev->fb_mem);
print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);
/* load the panel info into the var struct */
- au1100fb_var.bits_per_pixel = fbdev->panel->bpp;
- au1100fb_var.xres = fbdev->panel->xres;
- au1100fb_var.xres_virtual = au1100fb_var.xres;
- au1100fb_var.yres = fbdev->panel->yres;
- au1100fb_var.yres_virtual = au1100fb_var.yres;
+ fbdev->info.var = (struct fb_var_screeninfo) {
+ .activate = FB_ACTIVATE_NOW,
+ .height = -1,
+ .width = -1,
+ .vmode = FB_VMODE_NONINTERLACED,
+ .bits_per_pixel = fbdev->panel->bpp,
+ .xres = fbdev->panel->xres,
+ .xres_virtual = fbdev->panel->xres,
+ .yres = fbdev->panel->yres,
+ .yres_virtual = fbdev->panel->yres,
+ };
fbdev->info.screen_base = fbdev->fb_mem;
fbdev->info.fbops = &au1100fb_ops;
- fbdev->info.fix = au1100fb_fix;
fbdev->info.pseudo_palette =
devm_kcalloc(&dev->dev, 16, sizeof(u32), GFP_KERNEL);
@@ -502,8 +499,6 @@ static int au1100fb_drv_probe(struct platform_device *dev)
return -EFAULT;
}
- fbdev->info.var = au1100fb_var;
-
/* Set h/w registers */
au1100fb_setmode(fbdev);
@@ -550,8 +545,6 @@ static void au1100fb_drv_remove(struct platform_device *dev)
}
#ifdef CONFIG_PM
-static struct au1100fb_regs fbregs;
-
static int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
{
struct au1100fb_device *fbdev = platform_get_drvdata(dev);
@@ -564,7 +557,7 @@ static int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
clk_disable(fbdev->lcdclk);
- memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
+ memcpy(&fbdev->pm_regs, fbdev->regs, sizeof(struct au1100fb_regs));
return 0;
}
@@ -577,7 +570,7 @@ static int au1100fb_drv_resume(struct platform_device *dev)
if (!fbdev)
return 0;
- memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
+ memcpy(fbdev->regs, &fbdev->pm_regs, sizeof(struct au1100fb_regs));
ret = clk_enable(fbdev->lcdclk);
if (ret)
diff --git a/drivers/video/fbdev/au1100fb.h b/drivers/video/fbdev/au1100fb.h
index 8b29e424d017..998328cd16a2 100644
--- a/drivers/video/fbdev/au1100fb.h
+++ b/drivers/video/fbdev/au1100fb.h
@@ -103,6 +103,11 @@ struct au1100fb_device {
size_t regs_len;
unsigned int regs_phys;
+#ifdef CONFIG_PM
+ /* stores the register values during suspend */
+ struct au1100fb_regs pm_regs;
+#endif
+
unsigned char* fb_mem; /* FrameBuffer memory map */
size_t fb_len;
dma_addr_t fb_phys;
--
2.47.3
^ permalink raw reply related
* [PATCH v1 2/3] fbdev: au1100fb: Make driver compilable on non-mips platforms
From: Uwe Kleine-König @ 2026-02-04 9:15 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
In-Reply-To: <cover.1770196161.git.u.kleine-koenig@baylibre.com>
The header asm/mach-au1x00/au1000.h is unused apart from pulling in
<linux/delay.h> (for mdelay()) and <linux/io.h> (for KSEG1ADDR()). Then
the only platform specific part in the driver is the usage of the KSEG1ADDR
macro, which for the non-mips case can be stubbed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/video/fbdev/Kconfig | 3 ++-
drivers/video/fbdev/au1100fb.c | 9 +++++++--
drivers/video/fbdev/au1100fb.h | 2 --
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 45733522ff48..4514c42db9fa 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -1345,7 +1345,8 @@ endchoice
config FB_AU1100
bool "Au1100 LCD Driver"
- depends on (FB = y) && MIPS_ALCHEMY
+ depends on FB
+ depends on MIPS_ALCHEMY || COMPILE_TEST
select FB_IOMEM_HELPERS
help
This is the framebuffer driver for the AMD Au1100 SOC. It can drive
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 4df470878b42..94514625965b 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -42,6 +42,8 @@
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/io.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -55,12 +57,15 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
-#include <asm/mach-au1x00/au1000.h>
-
#define DEBUG 0
#include "au1100fb.h"
+#if defined(CONFIG_COMPILE_TEST) && !defined(CONFIG_MIPS)
+/* This is only defined to be able to compile this driver on non-mips platforms */
+#define KSEG1ADDR(x) (x)
+#endif
+
#define DRIVER_NAME "au1100fb"
#define DRIVER_DESC "LCD controller driver for AU1100 processors"
diff --git a/drivers/video/fbdev/au1100fb.h b/drivers/video/fbdev/au1100fb.h
index 79f4048726f1..8b29e424d017 100644
--- a/drivers/video/fbdev/au1100fb.h
+++ b/drivers/video/fbdev/au1100fb.h
@@ -30,8 +30,6 @@
#ifndef _AU1100LCD_H
#define _AU1100LCD_H
-#include <asm/mach-au1x00/au1000.h>
-
#define print_err(f, arg...) printk(KERN_ERR DRIVER_NAME ": " f "\n", ## arg)
#define print_warn(f, arg...) printk(KERN_WARNING DRIVER_NAME ": " f "\n", ## arg)
#define print_info(f, arg...) printk(KERN_INFO DRIVER_NAME ": " f "\n", ## arg)
--
2.47.3
^ permalink raw reply related
* [PATCH v1 1/3] fbdev: au1100fb: Mark several local functions as static
From: Uwe Kleine-König @ 2026-02-04 9:15 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
In-Reply-To: <cover.1770196161.git.u.kleine-koenig@baylibre.com>
This fixes several (fatal) compiler warnings à la
drivers/video/fbdev/au1100fb.c:530:6: error: no previous prototype for ‘au1100fb_drv_remove’ [-Werror=missing-prototypes]
523 | void au1100fb_drv_remove(struct platform_device *dev)
| ^~~~~~~~~~~~~~~~~~~
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/video/fbdev/au1100fb.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index feaa1061c436..4df470878b42 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -135,7 +135,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
* Set hardware with var settings. This will enable the controller with a specific
* mode, normally validated with the fb_check_var method
*/
-int au1100fb_setmode(struct au1100fb_device *fbdev)
+static int au1100fb_setmode(struct au1100fb_device *fbdev)
{
struct fb_info *info;
u32 words;
@@ -234,7 +234,7 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
/* fb_setcolreg
* Set color in LCD palette.
*/
-int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi)
+static int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fbi)
{
struct au1100fb_device *fbdev;
u32 *palette;
@@ -293,7 +293,7 @@ int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned
/* fb_pan_display
* Pan display in x and/or y as specified
*/
-int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
+static int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
{
struct au1100fb_device *fbdev;
int dy;
@@ -340,7 +340,7 @@ int au1100fb_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fbi)
* Map video memory in user space. We don't use the generic fb_mmap method mainly
* to allow the use of the TLB streaming flag (CCA=6)
*/
-int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
+static int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
{
struct au1100fb_device *fbdev = to_au1100fb_device(fbi);
@@ -522,7 +522,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
return -ENODEV;
}
-void au1100fb_drv_remove(struct platform_device *dev)
+static void au1100fb_drv_remove(struct platform_device *dev)
{
struct au1100fb_device *fbdev = NULL;
@@ -547,7 +547,7 @@ void au1100fb_drv_remove(struct platform_device *dev)
#ifdef CONFIG_PM
static struct au1100fb_regs fbregs;
-int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
+static int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
{
struct au1100fb_device *fbdev = platform_get_drvdata(dev);
@@ -564,7 +564,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
return 0;
}
-int au1100fb_drv_resume(struct platform_device *dev)
+static int au1100fb_drv_resume(struct platform_device *dev)
{
struct au1100fb_device *fbdev = platform_get_drvdata(dev);
int ret;
--
2.47.3
^ permalink raw reply related
* [PATCH v1 0/3] fbdev: au1100fb: support COMPILE_TEST and fix multi-device support
From: Uwe Kleine-König @ 2026-02-04 9:15 UTC (permalink / raw)
To: Helge Deller; +Cc: Chen Ni, linux-fbdev, dri-devel
Hello,
In reply to the patch that became commit 0636e6205bee ("fbdev: au1100fb:
Check return value of clk_enable() in .resume()") I pointed out that the
driver uses global data in .suspend() and .resume(). Helge asked Chen if
they want to address it, but up to now there was no reply. So to get
this thread out of my inbox I address the issue here. While working on
that I found another two variables affected and instead of installing a
mips compiler added COMPILE_TEST support (which revealed several
warnings fixed in patch #1 when compiled for ARCH=arm).
Uwe Kleine-König (3):
fbdev: au1100fb: Mark several local functions as static
fbdev: au1100fb: Make driver compilable on non-mips platforms
fbdev: au1100fb: Don't store device specific data in global variables
drivers/video/fbdev/Kconfig | 3 +-
drivers/video/fbdev/au1100fb.c | 86 +++++++++++++++++-----------------
drivers/video/fbdev/au1100fb.h | 7 ++-
3 files changed, 49 insertions(+), 47 deletions(-)
base-commit: 0636e6205beed850d985276dc56fd73d785bea5c
--
2.47.3
^ 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