drm/arm: cleanup coding style in arm a bit
Subsystems (4)
PATCH 1/1 drm/arm: cleanup coding style in arm a bit
For the code logic, an alarm is thrown after failure, but the code continues to run and returns successfully, so to the caller the if check and return branch will never run.
The change is to make the code a bit more readable.
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +1 -3
@@ -160,9 +160,7 @@ static void hdlcd_crtc_mode_set_nofb(struct drm_crtc *crtc)hdlcd_write (hdlcd,HDLCD_REG_H_SYNC , vm.hsync_len -1 );hdlcd_write (hdlcd,HDLCD_REG_POLARITIES , polarities); - err =hdlcd_set_pxl_fmt (crtc); -if (err) -return ; +hdlcd_set_pxl_fmt (crtc);clk_set_rate (hdlcd->clk, m->crtc_clock *1000 ); }
Signature · 1 line
2.26.2
Liviu Dudau
maintainerHi Bernard,
Quoted 15 lines · Bernard Zhao
For the code logic, an alarm is thrown after failure, but the code continues to run and returns successfully, so to the caller the if check and return branch will never run.
The change is to make the code a bit more readable.Signed-off-by Bernard Zhao <[email protected]>--- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/drm/arm/hdlcd_crtc.c +0
-0
drivers/gpu/drm/arm/hdlcd_crtc.c static void hdlcd_crtc_mode_set_nofb(struct drm_crtc *crtc) · line 163
Quoted 7 lines
drivers/gpu/drm/arm/hdlcd_crtc.c +1
-3@@ -160,9 +160,7 @@ static void hdlcd_crtc_mode_set_nofb(struct drm_crtc *crtc)hdlcd_write (hdlcd,HDLCD_REG_H_SYNC , vm.hsync_len -1 );hdlcd_write (hdlcd,HDLCD_REG_POLARITIES , polarities); - err =hdlcd_set_pxl_fmt (crtc); -if (err) -return ; +hdlcd_set_pxl_fmt (crtc);
I think you found a real bug. hdlcd_set_pxl_fmt() is not supposed to return zero if the format is not supported and here we would stop enabling the pixel clock.
Do you care to send a patch for fixing the bug, rather than this one?
Best regards,
Liviu
Quoted 6 lines
drivers/gpu/drm/arm/hdlcd_crtc.c +0
-0clk_set_rate (hdlcd->clk, m->crtc_clock *1000 ); }Signature · 1 line
2.26.2
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯From: Liviu Dudau <[email protected]>
Date: 2020-04-23 20:50:07
To: Bernard Zhao <[email protected]>
Cc: Brian Starkey <[email protected]>,David Airlie <[email protected]>,Daniel Vetter <[email protected]>,[email protected],[email protected],[email protected]
Subject: Re: [PATCH] drm/arm: cleanup coding style in arm a bit>Hi Bernard,
Quoted 28 lines · Bernard Zhao
Quoted 15 lines
For the code logic, an alarm is thrown after failure, but the code continues to run and returns successfully, so to the caller the if check and return branch will never run.
The change is to make the code a bit more readable.Signed-off-by Bernard Zhao <[email protected]>--- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/drm/arm/hdlcd_crtc.c +0
-0drivers/gpu/drm/arm/hdlcd_crtc.c static void hdlcd_crtc_mode_set_nofb(struct drm_crtc *crtc) · line 163
Quoted 7 lines
drivers/gpu/drm/arm/hdlcd_crtc.c +1
-3@@ -160,9 +160,7 @@ static void hdlcd_crtc_mode_set_nofb(struct drm_crtc *crtc)hdlcd_write (hdlcd,HDLCD_REG_H_SYNC , vm.hsync_len -1 );hdlcd_write (hdlcd,HDLCD_REG_POLARITIES , polarities); - err =hdlcd_set_pxl_fmt (crtc); -if (err) -return ; +hdlcd_set_pxl_fmt (crtc);I think you found a real bug.
hdlcd_set_pxl_fmt()is not supposed to return zero if the format is not supported and here we would stop enabling the pixel clock.
Quoted 5 lines
Do you care to send a patch for fixing the bug, rather than this one?
Best regards,
Liviu
Sure, I do have a bit confusing about this code, I will resubmit a patch and try to fix it.
Regards,
Bernard
Quoted 16 lines
Quoted 6 lines
drivers/gpu/drm/arm/hdlcd_crtc.c +0
-0clk_set_rate (hdlcd->clk, m->crtc_clock *1000 ); }Signature · 1 line
2.26.2Signature · 8 lines
==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯