* [PATCH] drm/arm: cleanup coding style in arm a bit @ 2020-04-22 2:10 Bernard Zhao 2020-04-23 12:50 ` Liviu Dudau 0 siblings, 1 reply; 3+ messages in thread From: Bernard Zhao @ 2020-04-22 2:10 UTC (permalink / raw) To: Liviu Dudau, Brian Starkey, David Airlie, Daniel Vetter, dri-devel, linux-kernel Cc: opensource.kernel, 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 <bernard@vivo.com> --- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index af67fefed38d..32bda13250f5 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -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); } -- 2.26.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/arm: cleanup coding style in arm a bit 2020-04-22 2:10 [PATCH] drm/arm: cleanup coding style in arm a bit Bernard Zhao @ 2020-04-23 12:50 ` Liviu Dudau 2020-04-24 0:20 ` 赵军奎 0 siblings, 1 reply; 3+ messages in thread From: Liviu Dudau @ 2020-04-23 12:50 UTC (permalink / raw) To: Bernard Zhao Cc: Brian Starkey, David Airlie, Daniel Vetter, dri-devel, linux-kernel, opensource.kernel Hi Bernard, On Tue, Apr 21, 2020 at 07:10:46PM -0700, Bernard Zhao wrote: > 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 <bernard@vivo.com> > --- > drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c > index af67fefed38d..32bda13250f5 100644 > --- a/drivers/gpu/drm/arm/hdlcd_crtc.c > +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c > @@ -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 > > clk_set_rate(hdlcd->clk, m->crtc_clock * 1000); > } > -- > 2.26.2 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯ ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re:Re: [PATCH] drm/arm: cleanup coding style in arm a bit 2020-04-23 12:50 ` Liviu Dudau @ 2020-04-24 0:20 ` 赵军奎 0 siblings, 0 replies; 3+ messages in thread From: 赵军奎 @ 2020-04-24 0:20 UTC (permalink / raw) To: Liviu Dudau Cc: Brian Starkey, David Airlie, Daniel Vetter, dri-devel, linux-kernel, opensource.kernel From: Liviu Dudau <liviu.dudau@arm.com> Date: 2020-04-23 20:50:07 To: Bernard Zhao <bernard@vivo.com> Cc: Brian Starkey <brian.starkey@arm.com>,David Airlie <airlied@linux.ie>,Daniel Vetter <daniel@ffwll.ch>,dri-devel@lists.freedesktop.org,linux-kernel@vger.kernel.org,opensource.kernel@vivo.com Subject: Re: [PATCH] drm/arm: cleanup coding style in arm a bit>Hi Bernard, > >On Tue, Apr 21, 2020 at 07:10:46PM -0700, Bernard Zhao wrote: >> 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 <bernard@vivo.com> >> --- >> drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c >> index af67fefed38d..32bda13250f5 100644 >> --- a/drivers/gpu/drm/arm/hdlcd_crtc.c >> +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c >> @@ -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 > Sure, I do have a bit confusing about this code, I will resubmit a patch and try to fix it. Regards, Bernard >> >> clk_set_rate(hdlcd->clk, m->crtc_clock * 1000); >> } >> -- >> 2.26.2 >> > >-- >==================== >| I would like to | >| fix the world, | >| but they're not | >| giving me the | > \ source code! / > --------------- > ¯\_(ツ)_/¯ ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-24 0:26 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-04-22 2:10 [PATCH] drm/arm: cleanup coding style in arm a bit Bernard Zhao 2020-04-23 12:50 ` Liviu Dudau 2020-04-24 0:20 ` 赵军奎
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).