diff mbox series

drm/i915: delete shadow "ret" variable

Message ID 20220127085115.GD25644@kili (mailing list archive)
State New, archived
Headers show
Series drm/i915: delete shadow "ret" variable | expand

Commit Message

Dan Carpenter Jan. 27, 2022, 8:51 a.m. UTC
This "ret" declaration shadows an existing "ret" variable at the top of
the function.  Delete it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Rodrigo Vivi Jan. 27, 2022, 10:26 p.m. UTC | #1
On Thu, Jan 27, 2022 at 11:51:15AM +0300, Dan Carpenter wrote:
> This "ret" declaration shadows an existing "ret" variable at the top of
> the function.  Delete it.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

and pushing right now

> ---
>  drivers/gpu/drm/i915/i915_vma.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 0026e85a0a0d..b66591d6e436 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -505,8 +505,6 @@ int i915_vma_bind(struct i915_vma *vma,
>  			work->pinned = i915_gem_object_get(vma->obj);
>  	} else {
>  		if (vma->obj) {
> -			int ret;
> -
>  			ret = i915_gem_object_wait_moving_fence(vma->obj, true);
>  			if (ret) {
>  				i915_vma_resource_free(vma->resource);
> -- 
> 2.20.1
>
Thomas Hellström Jan. 28, 2022, 6:20 a.m. UTC | #2
On Thu, 2022-01-27 at 17:26 -0500, Rodrigo Vivi wrote:
> On Thu, Jan 27, 2022 at 11:51:15AM +0300, Dan Carpenter wrote:
> > This "ret" declaration shadows an existing "ret" variable at the
> > top of
> > the function.  Delete it.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> 
> and pushing right now

Should probably have had a Fixes: tag on this one. I'm not 100% sure
whether the faulty patch is already upstream. In that case we might
need to manually include it in a -fixes pull.

/Thomas


> 
> > ---
> >  drivers/gpu/drm/i915/i915_vma.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_vma.c
> > b/drivers/gpu/drm/i915/i915_vma.c
> > index 0026e85a0a0d..b66591d6e436 100644
> > --- a/drivers/gpu/drm/i915/i915_vma.c
> > +++ b/drivers/gpu/drm/i915/i915_vma.c
> > @@ -505,8 +505,6 @@ int i915_vma_bind(struct i915_vma *vma,
> >                         work->pinned = i915_gem_object_get(vma-
> > >obj);
> >         } else {
> >                 if (vma->obj) {
> > -                       int ret;
> > -
> >                         ret =
> > i915_gem_object_wait_moving_fence(vma->obj, true);
> >                         if (ret) {
> >                                 i915_vma_resource_free(vma-
> > >resource);
> > -- 
> > 2.20.1
> >
Dan Carpenter Jan. 28, 2022, 6:36 a.m. UTC | #3
On Fri, Jan 28, 2022 at 07:20:02AM +0100, Thomas Hellström wrote:
> On Thu, 2022-01-27 at 17:26 -0500, Rodrigo Vivi wrote:
> > On Thu, Jan 27, 2022 at 11:51:15AM +0300, Dan Carpenter wrote:
> > > This "ret" declaration shadows an existing "ret" variable at the
> > > top of
> > > the function.  Delete it.
> > > 
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > 
> > and pushing right now
> 
> Should probably have had a Fixes: tag on this one. I'm not 100% sure
> whether the faulty patch is already upstream. In that case we might
> need to manually include it in a -fixes pull.
> 

It's not really a bug.  It's just a Sparse warning which is disabled
by default (-Wshadow).  The patch is in linux-next.

Fixes: 2f6b90da9192 ("drm/i915: Use vma resources for async unbinding")

regards,
dan carpenter
Rodrigo Vivi Jan. 28, 2022, 1:50 p.m. UTC | #4
On Fri, 2022-01-28 at 09:36 +0300, Dan Carpenter wrote:
> On Fri, Jan 28, 2022 at 07:20:02AM +0100, Thomas Hellström wrote:
> > On Thu, 2022-01-27 at 17:26 -0500, Rodrigo Vivi wrote:
> > > On Thu, Jan 27, 2022 at 11:51:15AM +0300, Dan Carpenter wrote:
> > > > This "ret" declaration shadows an existing "ret" variable at
> > > > the
> > > > top of
> > > > the function.  Delete it.
> > > > 
> > > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > 
> > > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > 
> > > and pushing right now
> > 
> > Should probably have had a Fixes: tag on this one. I'm not 100%

Well, I had added while pushing yesterday... but...

> > sure
> > whether the faulty patch is already upstream. In that case we might
> > need to manually include it in a -fixes pull.
> > 
> 
> It's not really a bug.  It's just a Sparse warning which is disabled
> by default (-Wshadow).  The patch is in linux-next.

Yeap, but it is good to add Fixes so if anyone is backporting the other
patch it is clear that this patch is a good addition on top.

> 
> Fixes: 2f6b90da9192 ("drm/i915: Use vma resources for async
> unbinding")

hmm... you are right... this one was the one...

I had added

Fixes: f6c466b84cfa ("drm/i915: Add support for moving fence waiting")

pointing to the original patch that introduced this int ret 
instead of the one that created the duplication...

so my Fixes addition can actually break some backport out there...
But luckily I believe that these 2 patches will be backported together
anyway...

Sorry about the confusion,
Rodrigo.


> 
> regards,
> dan carpenter
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 0026e85a0a0d..b66591d6e436 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -505,8 +505,6 @@  int i915_vma_bind(struct i915_vma *vma,
 			work->pinned = i915_gem_object_get(vma->obj);
 	} else {
 		if (vma->obj) {
-			int ret;
-
 			ret = i915_gem_object_wait_moving_fence(vma->obj, true);
 			if (ret) {
 				i915_vma_resource_free(vma->resource);