diff mbox series

[-next] drm/komeda: remove set but not used variable 'old'

Message ID 20190709135808.56388-1-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] drm/komeda: remove set but not used variable 'old' | expand

Commit Message

Yue Haibing July 9, 2019, 1:58 p.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/arm/display/komeda/komeda_plane.c:
 In function komeda_plane_atomic_duplicate_state:
drivers/gpu/drm/arm/display/komeda/komeda_plane.c:161:35:
 warning: variable old set but not used [-Wunused-but-set-variable

It is not used since commit 990dee3aa456 ("drm/komeda:
Computing image enhancer internally")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Daniel Vetter July 18, 2019, 6:51 p.m. UTC | #1
On Tue, Jul 09, 2019 at 09:58:08PM +0800, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/gpu/drm/arm/display/komeda/komeda_plane.c:
>  In function komeda_plane_atomic_duplicate_state:
> drivers/gpu/drm/arm/display/komeda/komeda_plane.c:161:35:
>  warning: variable old set but not used [-Wunused-but-set-variable
> 
> It is not used since commit 990dee3aa456 ("drm/komeda:
> Computing image enhancer internally")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Queued for 5.3, thanks for your patch.
-Daniel

> ---
>  drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> index c095af1..c1381ac 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> @@ -158,8 +158,6 @@ static void komeda_plane_reset(struct drm_plane *plane)
>  static struct drm_plane_state *
>  komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
>  {
> -	struct komeda_plane_state *new, *old;
> -
>  	if (WARN_ON(!plane->state))
>  		return NULL;
>  
> @@ -169,8 +167,6 @@ komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
>  
>  	__drm_atomic_helper_plane_duplicate_state(plane, &new->base);
>  
> -	old = to_kplane_st(plane->state);
> -
>  	return &new->base;
>  }
>  
> -- 
> 2.7.4
> 
>
Daniel Vetter July 19, 2019, 1:04 p.m. UTC | #2
On Thu, Jul 18, 2019 at 08:51:50PM +0200, Daniel Vetter wrote:
> On Tue, Jul 09, 2019 at 09:58:08PM +0800, YueHaibing wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > drivers/gpu/drm/arm/display/komeda/komeda_plane.c:
> >  In function komeda_plane_atomic_duplicate_state:
> > drivers/gpu/drm/arm/display/komeda/komeda_plane.c:161:35:
> >  warning: variable old set but not used [-Wunused-but-set-variable
> > 
> > It is not used since commit 990dee3aa456 ("drm/komeda:
> > Computing image enhancer internally")
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Queued for 5.3, thanks for your patch.

Correction, this doesn't even compile. Please compile-test patches before
submitting.

Thanks, Daniel

> -Daniel
> 
> > ---
> >  drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 4 ----
> >  1 file changed, 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> > index c095af1..c1381ac 100644
> > --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
> > @@ -158,8 +158,6 @@ static void komeda_plane_reset(struct drm_plane *plane)
> >  static struct drm_plane_state *
> >  komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
> >  {
> > -	struct komeda_plane_state *new, *old;
> > -
> >  	if (WARN_ON(!plane->state))
> >  		return NULL;
> >  
> > @@ -169,8 +167,6 @@ komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
> >  
> >  	__drm_atomic_helper_plane_duplicate_state(plane, &new->base);
> >  
> > -	old = to_kplane_st(plane->state);
> > -
> >  	return &new->base;
> >  }
> >  
> > -- 
> > 2.7.4
> > 
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
Yue Haibing July 22, 2019, 1:44 a.m. UTC | #3
On 2019/7/19 21:04, Daniel Vetter wrote:
> On Thu, Jul 18, 2019 at 08:51:50PM +0200, Daniel Vetter wrote:
>> On Tue, Jul 09, 2019 at 09:58:08PM +0800, YueHaibing wrote:
>>> Fixes gcc '-Wunused-but-set-variable' warning:
>>>
>>> drivers/gpu/drm/arm/display/komeda/komeda_plane.c:
>>>  In function komeda_plane_atomic_duplicate_state:
>>> drivers/gpu/drm/arm/display/komeda/komeda_plane.c:161:35:
>>>  warning: variable old set but not used [-Wunused-but-set-variable
>>>
>>> It is not used since commit 990dee3aa456 ("drm/komeda:
>>> Computing image enhancer internally")
>>>
>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>
>> Queued for 5.3, thanks for your patch.
> 
> Correction, this doesn't even compile. Please compile-test patches before
> submitting.
> 

Oops, sorry for this, I'll be more carefully.

> Thanks, Daniel
> 
>> -Daniel
>>
>>> ---
>>>  drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 4 ----
>>>  1 file changed, 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
>>> index c095af1..c1381ac 100644
>>> --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
>>> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
>>> @@ -158,8 +158,6 @@ static void komeda_plane_reset(struct drm_plane *plane)
>>>  static struct drm_plane_state *
>>>  komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
>>>  {
>>> -	struct komeda_plane_state *new, *old;
>>> -
>>>  	if (WARN_ON(!plane->state))
>>>  		return NULL;
>>>  
>>> @@ -169,8 +167,6 @@ komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
>>>  
>>>  	__drm_atomic_helper_plane_duplicate_state(plane, &new->base);
>>>  
>>> -	old = to_kplane_st(plane->state);
>>> -
>>>  	return &new->base;
>>>  }
>>>  
>>> -- 
>>> 2.7.4
>>>
>>>
>>
>> -- 
>> Daniel Vetter
>> Software Engineer, Intel Corporation
>> http://blog.ffwll.ch
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
index c095af1..c1381ac 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
@@ -158,8 +158,6 @@  static void komeda_plane_reset(struct drm_plane *plane)
 static struct drm_plane_state *
 komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
 {
-	struct komeda_plane_state *new, *old;
-
 	if (WARN_ON(!plane->state))
 		return NULL;
 
@@ -169,8 +167,6 @@  komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
 
 	__drm_atomic_helper_plane_duplicate_state(plane, &new->base);
 
-	old = to_kplane_st(plane->state);
-
 	return &new->base;
 }