mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: sm750fb: remove unnecessary goto
@ 2026-10-25 13:02 Haasham Khan
  2026-10-25 13:58 ` Dan Carpenter
  2026-10-25 16:26 ` [PATCH v2] " Haasham Khan
  0 siblings, 2 replies; 5+ messages in thread
From: Haasham Khan @ 2026-10-25 13:02 UTC (permalink / raw)
  To: sudipm.mukherjee
  Cc: teddy.wang, gregkh, linux-fbdev, linux-staging, linux-kernel,
	Haasham Khan

The error path in hw_sm750_crtc_set_mode() jumps to a label that
immediately returns ret. Return directly and remove the unnecessary
label.

Signed-off-by: Haasham Khan <haasham93@gmail.com>
---
 drivers/staging/sm750fb/sm750_hw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index c4358d3e5091..22f93277e91b 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -272,7 +272,7 @@ int hw_sm750_crtc_set_mode(struct lynxfb_crtc *crtc,
 	ret = ddk750_set_mode_timing(&modparm, clock);
 	if (ret) {
 		dev_err(&sm750_dev->pdev->dev, "Set mode timing failed\n");
-		goto exit;
+		return ret;
 	}
 
 	if (crtc->channel != sm750_secondary) {
@@ -332,7 +332,6 @@ int hw_sm750_crtc_set_mode(struct lynxfb_crtc *crtc,
 		poke32(CRT_DISPLAY_CTRL, reg);
 	}
 
-exit:
 	return ret;
 }
 
-- 
2.53.0


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] staging: sm750fb: remove unnecessary goto
@ 2026-10-25 20:26 Haasham Khan
  0 siblings, 0 replies; 5+ messages in thread
From: Haasham Khan @ 2026-10-25 20:26 UTC (permalink / raw)
  To: sudipm.mukherjee
  Cc: teddy.wang, gregkh, linux-fbdev, linux-staging, linux-kernel,
	Haasham Khan

The goto exit statement jumps directly to the following label.
Remove the unnecessary jump and label, and simplify the conditional
block.

Signed-off-by: Haasham Khan <haasham93@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 21e310274330..66b015959963 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -815,12 +815,9 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 	var->vmode = FB_VMODE_NONINTERLACED;
 
 	ret = fb_alloc_cmap(&info->cmap, 256, 0);
-	if (ret < 0) {
+	if (ret < 0)
 		dev_err(info->device, "Could not allocate memory for cmap.\n");
-		goto exit;
-	}
 
-exit:
 	lynxfb_ops_check_var(var, info);
 	return ret;
 }
-- 
2.53.0


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

end of thread, other threads:[~2026-10-25 20:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 13:02 [PATCH] staging: sm750fb: remove unnecessary goto Haasham Khan
2026-10-25 13:58 ` Dan Carpenter
2026-10-25 16:26 ` [PATCH v2] " Haasham Khan
2026-10-25 18:19   ` Dan Carpenter
2026-10-25 20:26 [PATCH] " Haasham Khan

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

all inboxes | Powered by JetHome®