diff mbox

fix drm-get-put.cocci warnings

Message ID alpine.DEB.2.20.1801151344170.3305@hadrien (mailing list archive)
State New, archived
Headers show

Commit Message

Julia Lawall Jan. 15, 2018, 12:47 p.m. UTC
From: Fengguang Wu <fengguang.wu@intel.com>

Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and
drm_*_unreference() helpers.

Generated by: scripts/coccinelle/api/drm-get-put.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

tree:   https://github.com/thierryreding/linux for-4.16/work
head:   6c86494bb2f670293f6137b0a4b3c53c8886eba4
commit: 34f022b2d11f91a323d3e7d15893d480646f3fad [149/161] WIP

 nouveau_gem.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Thierry Reding Jan. 15, 2018, 1:51 p.m. UTC | #1
On Mon, Jan 15, 2018 at 01:47:07PM +0100, Julia Lawall wrote:
> From: Fengguang Wu <fengguang.wu@intel.com>
> 
> Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and
> drm_*_unreference() helpers.
> 
> Generated by: scripts/coccinelle/api/drm-get-put.cocci
> 
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> ---
> 
> tree:   https://github.com/thierryreding/linux for-4.16/work
> head:   6c86494bb2f670293f6137b0a4b3c53c8886eba4
> commit: 34f022b2d11f91a323d3e7d15893d480646f3fad [149/161] WIP
> 
>  nouveau_gem.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

Hi Julia,

thanks for the patch. However, the tree that you generated it against is
a personal development tree and it happens to have a bunch of commits in
it that are very experimental and some of which are very unlikely to go
upstream. There's an IOCTL addition patch (touched by hunk 7 in this
patch) that is used only for testing purposes. All of the other hunks do
pply properly to linux-next, so I think those can be posted. Nouveau is
maintained by Ben Skeggs, though, so they should be addressed to him.

I don't personally mind getting these patches, and I don't mind people
seeing the personal development tree (it's publicly available, after
all) but I think patches against this tree will be confusing to anyone
but me because they are likely not going to apply anywhere other than
that tree.

Thanks,
Thierry
Julia Lawall Jan. 15, 2018, 1:58 p.m. UTC | #2
On Mon, 15 Jan 2018, Thierry Reding wrote:

> On Mon, Jan 15, 2018 at 01:47:07PM +0100, Julia Lawall wrote:
> > From: Fengguang Wu <fengguang.wu@intel.com>
> >
> > Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and
> > drm_*_unreference() helpers.
> >
> > Generated by: scripts/coccinelle/api/drm-get-put.cocci
> >
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> > Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> > ---
> >
> > tree:   https://github.com/thierryreding/linux for-4.16/work
> > head:   6c86494bb2f670293f6137b0a4b3c53c8886eba4
> > commit: 34f022b2d11f91a323d3e7d15893d480646f3fad [149/161] WIP
> >
> >  nouveau_gem.c |   16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
>
> Hi Julia,
>
> thanks for the patch. However, the tree that you generated it against is
> a personal development tree and it happens to have a bunch of commits in
> it that are very experimental and some of which are very unlikely to go
> upstream. There's an IOCTL addition patch (touched by hunk 7 in this
> patch) that is used only for testing purposes. All of the other hunks do
> pply properly to linux-next, so I think those can be posted. Nouveau is
> maintained by Ben Skeggs, though, so they should be addressed to him.
>
> I don't personally mind getting these patches, and I don't mind people
> seeing the personal development tree (it's publicly available, after
> all) but I think patches against this tree will be confusing to anyone
> but me because they are likely not going to apply anywhere other than
> that tree.

OK, I'm just forwarding what kbuild sends me for approval.  No problem if
you toss it, apply it, or do whatever seems reasonable :)

julia

>
> Thanks,
> Thierry
>
diff mbox

Patch

--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -296,7 +296,7 @@  nouveau_gem_ioctl_new(struct drm_device
 	}

 	/* drop reference from allocate - handle holds it now */
-	drm_gem_object_unreference_unlocked(&nvbo->gem);
+	drm_gem_object_put_unlocked(&nvbo->gem);
 	return ret;
 }

@@ -365,7 +365,7 @@  validate_fini_no_ticket(struct validate_
 		list_del(&nvbo->entry);
 		nvbo->reserved_by = NULL;
 		ttm_bo_unreserve(&nvbo->bo);
-		drm_gem_object_unreference_unlocked(&nvbo->gem);
+		drm_gem_object_put_unlocked(&nvbo->gem);
 	}
 }

@@ -411,14 +411,14 @@  retry:
 		nvbo = nouveau_gem_object(gem);
 		if (nvbo == res_bo) {
 			res_bo = NULL;
-			drm_gem_object_unreference_unlocked(gem);
+			drm_gem_object_put_unlocked(gem);
 			continue;
 		}

 		if (nvbo->reserved_by && nvbo->reserved_by == file_priv) {
 			NV_PRINTK(err, cli, "multiple instances of buffer %d on "
 				      "validation list\n", b->handle);
-			drm_gem_object_unreference_unlocked(gem);
+			drm_gem_object_put_unlocked(gem);
 			ret = -EINVAL;
 			break;
 		}
@@ -969,7 +969,7 @@  nouveau_gem_ioctl_cpu_prep(struct drm_de
 		ret = lret;

 	nouveau_bo_sync_for_cpu(nvbo);
-	drm_gem_object_unreference_unlocked(gem);
+	drm_gem_object_put_unlocked(gem);

 	return ret;
 }
@@ -988,7 +988,7 @@  nouveau_gem_ioctl_cpu_fini(struct drm_de
 	nvbo = nouveau_gem_object(gem);

 	nouveau_bo_sync_for_device(nvbo);
-	drm_gem_object_unreference_unlocked(gem);
+	drm_gem_object_put_unlocked(gem);
 	return 0;
 }

@@ -1005,7 +1005,7 @@  nouveau_gem_ioctl_info(struct drm_device
 		return -ENOENT;

 	ret = nouveau_gem_info(file_priv, gem, req);
-	drm_gem_object_unreference_unlocked(gem);
+	drm_gem_object_put_unlocked(gem);
 	return ret;
 }

@@ -1153,7 +1153,7 @@  out:
 	return err;

 unref:
-	drm_gem_object_unreference(&nvbo->gem);
+	drm_gem_object_put(&nvbo->gem);
 unref_bo:
 	nouveau_bo_ref(NULL, &nvbo);
 free_sgt: