mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/stm: ltdc: fix warning in ltdc_crtc_update_clut()
@ 2018-04-10 13:53 Philippe Cornu
  2018-04-16  9:18 ` Yannick FERTRE
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Cornu @ 2018-04-10 13:53 UTC (permalink / raw)
  To: Yannick Fertre, Philippe Cornu, Benjamin Gaignard,
	Vincent Abriou, Dan Carpenter, David Airlie, dri-devel,
	linux-kernel
  Cc: Alexandre Torgue

Fix the warning
"warn: variable dereferenced before check 'crtc' (see line 390)"
by removing unnecessary checks as ltdc_crtc_update_clut() is
only called from ltdc_crtc_atomic_flush() where crtc and
crtc->state are not NULL.

Many thanks to Dan Carpenter for the bug report
https://lists.freedesktop.org/archives/dri-devel/2018-February/166918.html

Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/stm/ltdc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 061d2b6e5157..e3121d9e4230 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -392,9 +392,6 @@ static void ltdc_crtc_update_clut(struct drm_crtc *crtc)
 	u32 val;
 	int i;
 
-	if (!crtc || !crtc->state)
-		return;
-
 	if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut)
 		return;
 
-- 
2.15.1

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

* Re: [PATCH] drm/stm: ltdc: fix warning in ltdc_crtc_update_clut()
  2018-04-10 13:53 [PATCH] drm/stm: ltdc: fix warning in ltdc_crtc_update_clut() Philippe Cornu
@ 2018-04-16  9:18 ` Yannick FERTRE
  2018-04-19 10:39   ` Philippe CORNU
  0 siblings, 1 reply; 3+ messages in thread
From: Yannick FERTRE @ 2018-04-16  9:18 UTC (permalink / raw)
  To: Philippe CORNU, Benjamin Gaignard, Vincent ABRIOU, Dan Carpenter,
	David Airlie, dri-devel, linux-kernel
  Cc: Alexandre TORGUE

Reviewed-by: yannick fertre <yannick.fertre@st.com>


On 04/10/2018 03:53 PM, Philippe Cornu wrote:
> Fix the warning
> "warn: variable dereferenced before check 'crtc' (see line 390)"
> by removing unnecessary checks as ltdc_crtc_update_clut() is
> only called from ltdc_crtc_atomic_flush() where crtc and
> crtc->state are not NULL.
>
> Many thanks to Dan Carpenter for the bug report
> https://lists.freedesktop.org/archives/dri-devel/2018-February/166918.html
>
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   drivers/gpu/drm/stm/ltdc.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 061d2b6e5157..e3121d9e4230 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -392,9 +392,6 @@ static void ltdc_crtc_update_clut(struct drm_crtc *crtc)
>   	u32 val;
>   	int i;
>   
> -	if (!crtc || !crtc->state)
> -		return;
> -
>   	if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut)
>   		return;
>   

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

* Re: [PATCH] drm/stm: ltdc: fix warning in ltdc_crtc_update_clut()
  2018-04-16  9:18 ` Yannick FERTRE
@ 2018-04-19 10:39   ` Philippe CORNU
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe CORNU @ 2018-04-19 10:39 UTC (permalink / raw)
  To: Yannick FERTRE, Benjamin Gaignard, Vincent ABRIOU, Dan Carpenter,
	David Airlie, dri-devel, linux-kernel
  Cc: Alexandre TORGUE

Applied on drm-misc-next.
Many thanks,
Philippe :-)

On 04/16/2018 11:18 AM, Yannick FERTRE wrote:
> Reviewed-by: yannick fertre <yannick.fertre@st.com>
> 
> 
> On 04/10/2018 03:53 PM, Philippe Cornu wrote:
>> Fix the warning
>> "warn: variable dereferenced before check 'crtc' (see line 390)"
>> by removing unnecessary checks as ltdc_crtc_update_clut() is
>> only called from ltdc_crtc_atomic_flush() where crtc and
>> crtc->state are not NULL.
>>
>> Many thanks to Dan Carpenter for the bug report
>> https://lists.freedesktop.org/archives/dri-devel/2018-February/166918.html
>>
>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>> ---
>>    drivers/gpu/drm/stm/ltdc.c | 3 ---
>>    1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
>> index 061d2b6e5157..e3121d9e4230 100644
>> --- a/drivers/gpu/drm/stm/ltdc.c
>> +++ b/drivers/gpu/drm/stm/ltdc.c
>> @@ -392,9 +392,6 @@ static void ltdc_crtc_update_clut(struct drm_crtc *crtc)
>>    	u32 val;
>>    	int i;
>>    
>> -	if (!crtc || !crtc->state)
>> -		return;
>> -
>>    	if (!crtc->state->color_mgmt_changed || !crtc->state->gamma_lut)
>>    		return;
>>    

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

end of thread, other threads:[~2018-04-19 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 13:53 [PATCH] drm/stm: ltdc: fix warning in ltdc_crtc_update_clut() Philippe Cornu
2018-04-16  9:18 ` Yannick FERTRE
2018-04-19 10:39   ` Philippe CORNU

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®