[PATCH 1/4] Simplify logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are multiple return paths so this could be a valid goto use case,
but it seems like this could be simplified.

---
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index 3cb16f0..30b7439 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -61,11 +61,8 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var,
 	struct drm_fb_helper *helper = get_fb(fbi);
 	struct omap_fbdev *fbdev = to_omap_fbdev(helper);
 
-	if (!helper)
-		goto fallback;
-
-	if (!fbdev->ywrap_enabled)
-		goto fallback;
+	if (!(helper || fbdev->ywrap_enabled))
+		return drm_fb_helper_pan_display(var, fbi);
 
 	if (drm_can_sleep()) {
 		pan_worker(&fbdev->work);
@@ -75,9 +72,6 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var,
 	}
 
 	return 0;
-
-fallback:
-	return drm_fb_helper_pan_display(var, fbi);
 }
 
 static struct fb_ops omap_fb_ops = {
-- 
2.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux