Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbdHKN0u (ORCPT ); Fri, 11 Aug 2017 09:26:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23156 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752883AbdHKN0t (ORCPT ); Fri, 11 Aug 2017 09:26:49 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D9A216D856 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=hdegoede@redhat.com Subject: Re: [PATCH v3 28/28] drm: vboxvideo: switch to drm_*_get(), drm_*_put() helpers To: Cihangir Akturk Cc: daniel@ffwll.ch, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Greg Kroah-Hartman , Daniel Vetter , Peter Rosin , Michael Thayer , devel@driverdev.osuosl.org References: <1502454794-28558-1-git-send-email-cakturk@gmail.com> <1502454794-28558-29-git-send-email-cakturk@gmail.com> From: Hans de Goede Message-ID: <27c2b794-73b0-641f-6dcd-6cb7eeb47dff@redhat.com> Date: Fri, 11 Aug 2017 15:26:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1502454794-28558-29-git-send-email-cakturk@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 11 Aug 2017 13:26:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3173 Lines: 98 Hi, On 11-08-17 14:33, Cihangir Akturk wrote: > Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() > and drm_*_unreference() helpers. > > drm_*_reference() and drm_*_unreference() functions are just > compatibility alias for drm_*_get() and drm_*_put() and should not be > used by new code. So convert all users of compatibility functions to > use the new APIs. > > Generated by: scripts/coccinelle/api/drm-get-put.cocci > > Signed-off-by: Cihangir Akturk Thank you for doing this, looks good to me: Reviewed-by: Hans de Goede Regards, Hans > --- > drivers/staging/vboxvideo/vbox_fb.c | 2 +- > drivers/staging/vboxvideo/vbox_main.c | 8 ++++---- > drivers/staging/vboxvideo/vbox_mode.c | 2 +- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c > index bf66358..c157284 100644 > --- a/drivers/staging/vboxvideo/vbox_fb.c > +++ b/drivers/staging/vboxvideo/vbox_fb.c > @@ -343,7 +343,7 @@ void vbox_fbdev_fini(struct drm_device *dev) > vbox_bo_unpin(bo); > vbox_bo_unreserve(bo); > } > - drm_gem_object_unreference_unlocked(afb->obj); > + drm_gem_object_put_unlocked(afb->obj); > afb->obj = NULL; > } > drm_fb_helper_fini(&fbdev->helper); > diff --git a/drivers/staging/vboxvideo/vbox_main.c b/drivers/staging/vboxvideo/vbox_main.c > index d0c6ec7..80bd039 100644 > --- a/drivers/staging/vboxvideo/vbox_main.c > +++ b/drivers/staging/vboxvideo/vbox_main.c > @@ -40,7 +40,7 @@ static void vbox_user_framebuffer_destroy(struct drm_framebuffer *fb) > struct vbox_framebuffer *vbox_fb = to_vbox_framebuffer(fb); > > if (vbox_fb->obj) > - drm_gem_object_unreference_unlocked(vbox_fb->obj); > + drm_gem_object_put_unlocked(vbox_fb->obj); > > drm_framebuffer_cleanup(fb); > kfree(fb); > @@ -198,7 +198,7 @@ static struct drm_framebuffer *vbox_user_framebuffer_create( > err_free_vbox_fb: > kfree(vbox_fb); > err_unref_obj: > - drm_gem_object_unreference_unlocked(obj); > + drm_gem_object_put_unlocked(obj); > return ERR_PTR(ret); > } > > @@ -472,7 +472,7 @@ int vbox_dumb_create(struct drm_file *file, > return ret; > > ret = drm_gem_handle_create(file, gobj, &handle); > - drm_gem_object_unreference_unlocked(gobj); > + drm_gem_object_put_unlocked(gobj); > if (ret) > return ret; > > @@ -525,7 +525,7 @@ vbox_dumb_mmap_offset(struct drm_file *file, > bo = gem_to_vbox_bo(obj); > *offset = vbox_bo_mmap_offset(bo); > > - drm_gem_object_unreference(obj); > + drm_gem_object_put(obj); > ret = 0; > > out_unlock: > diff --git a/drivers/staging/vboxvideo/vbox_mode.c b/drivers/staging/vboxvideo/vbox_mode.c > index 996da1c..e5b6383 100644 > --- a/drivers/staging/vboxvideo/vbox_mode.c > +++ b/drivers/staging/vboxvideo/vbox_mode.c > @@ -812,7 +812,7 @@ static int vbox_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv, > out_unreserve_bo: > vbox_bo_unreserve(bo); > out_unref_obj: > - drm_gem_object_unreference_unlocked(obj); > + drm_gem_object_put_unlocked(obj); > > return ret; > } >