* [PATCH] atafb: avoid cast when assigning buffer address pointer
@ 2026-09-29 6:12 Helge Deller
2026-09-29 6:20 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Helge Deller @ 2026-09-29 6:12 UTC (permalink / raw)
To: linux-fbdev, dri-devel; +Cc: kernel test robot, Miro Kropáček
The sparse tool complains that the "cast removes the address space
'__iomem' of expression".
Avoid the cast by using the screen_buffer pointer instead of the
screen_base pointer from the union.
Fixes: d463633d63e6 ("fbdev: atafb: Add support for SuperVidel's SuperBlitter")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609261313.kgFtkz2t-lkp@intel.com/
Cc: Miro Kropáček <miro.kropacek@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
---
drivers/video/fbdev/atafb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index 5c3e5861543a..c32576cb1720 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -2454,7 +2454,7 @@ static void svblit_fillrect(struct fb_info *info,
((u32 *)info->pseudo_palette)[rect->color] : rect->color;
/* draw the first line with the CPU ... */
- line = (u8 *)info->screen_base + rect->dy * pitch +
+ line = info->screen_buffer + rect->dy * pitch +
rect->dx * bytespp;
switch (bytespp) {
case 1:
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] atafb: avoid cast when assigning buffer address pointer
2026-09-29 6:12 [PATCH] atafb: avoid cast when assigning buffer address pointer Helge Deller
@ 2026-09-29 6:20 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-09-29 6:20 UTC (permalink / raw)
To: Helge Deller; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] fbdev: incorrect sparse warning suppression via union alias
--
commit d3053bb9def82e951de5b1b68d5beb85bd502468
Author: Helge Deller <deller@gmx.de>
atafb: avoid cast when assigning buffer address pointer
This commit attempts to resolve a sparse warning about an __iomem address
space cast by switching to the screen_buffer alias from the fb_info union.
Closes: https://lore.kernel.org/oe-kbuild-all/202609261313.kgFtkz2t-lkp@intel.com/
> diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
> index 5c3e5861543a2..c32576cb17202 100644
> --- a/drivers/video/fbdev/atafb.c
> +++ b/drivers/video/fbdev/atafb.c
> @@ -2454,7 +2454,7 @@ static void svblit_fillrect(struct fb_info *info,
> ((u32 *)info->pseudo_palette)[rect->color] : rect->color;
>
> /* draw the first line with the CPU ... */
> - line = (u8 *)info->screen_base + rect->dy * pitch +
> + line = info->screen_buffer + rect->dy * pitch +
> rect->dx * bytespp;
[Severity: Low]
This isn't a runtime bug, but does this improperly suppress the sparse warning
by type-punning through the union alias?
By switching to screen_buffer in svblit_fillrect(), the code bypasses the
__iomem static analysis checks without making the memory access structurally
correct.
Shouldn't this use an explicit (__force) cast or proper I/O accessors rather
than hiding the access through a non-__iomem union member?
> switch (bytespp) {
> case 1:
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260929061223.55435-1-deller@gmx.de?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-29 6:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29 6:12 [PATCH] atafb: avoid cast when assigning buffer address pointer Helge Deller
2026-09-29 6:20 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox