mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/solomon: remove unneeded variables in blit functions
@ 2026-07-09 10:53 Iker Pedrosa
  2026-07-16  8:05 ` Javier Martinez Canillas
  0 siblings, 1 reply; 2+ messages in thread
From: Iker Pedrosa @ 2026-07-09 10:53 UTC (permalink / raw)
  To: Javier Martinez Canillas, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, kernel test robot, Iker Pedrosa

Remove unneeded 'ret' variables in ssd130x_fb_blit_rect(),
ssd132x_fb_blit_rect(), and ssd133x_fb_blit_rect() functions.
These functions initialize ret to 0 and return it unchanged,
so return 0 directly instead.

Fixes: 2258f03989af ("drm/solomon: Move calls to drm_gem_fb_end_cpu*()")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606301409.I0ctsf41-lkp@intel.com/
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
Fix unneeded variable warnings reported by kernel test robot in the Solomon
SSD130x driver. Three blit functions were initializing 'ret' variables to 0,
never modifying them, and then returning the unchanged value.

The fix simplifies the code by returning 0 directly, addressing the static
analysis warnings while maintaining the same functionality.
---
 drivers/gpu/drm/solomon/ssd130x.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
index 4907be694aec..0940eae7a2e4 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -897,7 +897,6 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb,
 	struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev);
 	struct iosys_map dst;
 	unsigned int dst_pitch;
-	int ret = 0;
 
 	/* Align y to display page boundaries */
 	rect->y1 = round_down(rect->y1, SSD130X_PAGE_HEIGHT);
@@ -910,7 +909,7 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb,
 
 	ssd130x_update_rect(ssd130x, rect, buf, data_array);
 
-	return ret;
+	return 0;
 }
 
 static int ssd132x_fb_blit_rect(struct drm_framebuffer *fb,
@@ -922,7 +921,6 @@ static int ssd132x_fb_blit_rect(struct drm_framebuffer *fb,
 	struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev);
 	unsigned int dst_pitch;
 	struct iosys_map dst;
-	int ret = 0;
 
 	/* Align x to display segment boundaries */
 	rect->x1 = round_down(rect->x1, SSD132X_SEGMENT_WIDTH);
@@ -936,7 +934,7 @@ static int ssd132x_fb_blit_rect(struct drm_framebuffer *fb,
 
 	ssd132x_update_rect(ssd130x, rect, buf, data_array);
 
-	return ret;
+	return 0;
 }
 
 static int ssd133x_fb_blit_rect(struct drm_framebuffer *fb,
@@ -948,7 +946,6 @@ static int ssd133x_fb_blit_rect(struct drm_framebuffer *fb,
 	const struct drm_format_info *fi = drm_format_info(DRM_FORMAT_RGB332);
 	unsigned int dst_pitch;
 	struct iosys_map dst;
-	int ret = 0;
 
 	if (!fi)
 		return -EINVAL;
@@ -960,7 +957,7 @@ static int ssd133x_fb_blit_rect(struct drm_framebuffer *fb,
 
 	ssd133x_update_rect(ssd130x, rect, data_array, dst_pitch);
 
-	return ret;
+	return 0;
 }
 
 static int ssd130x_primary_plane_atomic_check(struct drm_plane *plane,

---
base-commit: 671b7825dbfe9ea6e3ad3001003aeee0df48d1b5
change-id: 20260709-fix-ssd130x-d7dc491af074

Best regards,
-- 
Iker Pedrosa <ikerpedrosam@gmail.com>


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

* Re: [PATCH] drm/solomon: remove unneeded variables in blit functions
  2026-07-09 10:53 [PATCH] drm/solomon: remove unneeded variables in blit functions Iker Pedrosa
@ 2026-07-16  8:05 ` Javier Martinez Canillas
  0 siblings, 0 replies; 2+ messages in thread
From: Javier Martinez Canillas @ 2026-07-16  8:05 UTC (permalink / raw)
  To: Iker Pedrosa, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, kernel test robot, Iker Pedrosa

Iker Pedrosa <ikerpedrosam@gmail.com> writes:

Hello Iker,

Thanks for the patch.

> Remove unneeded 'ret' variables in ssd130x_fb_blit_rect(),
> ssd132x_fb_blit_rect(), and ssd133x_fb_blit_rect() functions.
> These functions initialize ret to 0 and return it unchanged,
> so return 0 directly instead.
>
> Fixes: 2258f03989af ("drm/solomon: Move calls to drm_gem_fb_end_cpu*()")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202606301409.I0ctsf41-lkp@intel.com/
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
> ---
> Fix unneeded variable warnings reported by kernel test robot in the Solomon
> SSD130x driver. Three blit functions were initializing 'ret' variables to 0,
> never modifying them, and then returning the unchanged value.
>
> The fix simplifies the code by returning 0 directly, addressing the static
> analysis warnings while maintaining the same functionality.
> ---


>  drivers/gpu/drm/solomon/ssd130x.c | 9 +++------

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

I'll push it to drm-misc (drm-misc-next). Thanks!

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


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

end of thread, other threads:[~2026-07-16  8:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-09 10:53 [PATCH] drm/solomon: remove unneeded variables in blit functions Iker Pedrosa
2026-07-16  8:05 ` Javier Martinez Canillas

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