diff mbox series

drm/vkms: Fix vmap_count increment position

Message ID 20180801090807.GA4611@haneenDRM (mailing list archive)
State New, archived
Headers show
Series drm/vkms: Fix vmap_count increment position | expand

Commit Message

Haneen Mohammed Aug. 1, 2018, 9:08 a.m. UTC
Move vmap_count out of the conditional statement since it needs
to be updated for every successful call to vkms_gem_vmap.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
 drivers/gpu/drm/vkms/vkms_gem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Haneen Mohammed Aug. 8, 2018, 3:59 a.m. UTC | #1
On Wed, Aug 01, 2018 at 12:08:07PM +0300, Haneen Mohammed wrote:
> Move vmap_count out of the conditional statement since it needs
> to be updated for every successful call to vkms_gem_vmap.
> 
> Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> ---
>  drivers/gpu/drm/vkms/vkms_gem.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c
> index a52e88338c05..5c51dfde7c1e 100644
> --- a/drivers/gpu/drm/vkms/vkms_gem.c
> +++ b/drivers/gpu/drm/vkms/vkms_gem.c
> @@ -240,10 +240,9 @@ int vkms_gem_vmap(struct drm_gem_object *obj)
>  		vkms_obj->vaddr = vmap(pages, n_pages, VM_MAP, PAGE_KERNEL);
>  		if (!vkms_obj->vaddr)
>  			goto err_vmap;
> -
> -		vkms_obj->vmap_count++;
>  	}
>  
> +	vkms_obj->vmap_count++;
>  	goto out;
>  
>  err_vmap:
> -- 
> 2.17.1
> 

Hi Sean,

This is a fix to bb112b14af8d ("drm/vkms: Add functions to map/unmap GEM
backing storage"), should I add this to the commit message?

Thank you,
Haneen
Daniel Vetter Aug. 8, 2018, 8:20 a.m. UTC | #2
On Wed, Aug 08, 2018 at 06:59:26AM +0300, Haneen Mohammed wrote:
> On Wed, Aug 01, 2018 at 12:08:07PM +0300, Haneen Mohammed wrote:
> > Move vmap_count out of the conditional statement since it needs
> > to be updated for every successful call to vkms_gem_vmap.
> > 
> > Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> > ---
> >  drivers/gpu/drm/vkms/vkms_gem.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c
> > index a52e88338c05..5c51dfde7c1e 100644
> > --- a/drivers/gpu/drm/vkms/vkms_gem.c
> > +++ b/drivers/gpu/drm/vkms/vkms_gem.c
> > @@ -240,10 +240,9 @@ int vkms_gem_vmap(struct drm_gem_object *obj)
> >  		vkms_obj->vaddr = vmap(pages, n_pages, VM_MAP, PAGE_KERNEL);
> >  		if (!vkms_obj->vaddr)
> >  			goto err_vmap;
> > -
> > -		vkms_obj->vmap_count++;
> >  	}
> >  
> > +	vkms_obj->vmap_count++;
> >  	goto out;
> >  
> >  err_vmap:
> > -- 
> > 2.17.1
> > 
> 
> Hi Sean,
> 
> This is a fix to bb112b14af8d ("drm/vkms: Add functions to map/unmap GEM
> backing storage"), should I add this to the commit message?

Yup, usually we include that in a Fixes: tag at the bottom. I've done that
while applying, thanks for your patch.

Cheers, Daniel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c
index a52e88338c05..5c51dfde7c1e 100644
--- a/drivers/gpu/drm/vkms/vkms_gem.c
+++ b/drivers/gpu/drm/vkms/vkms_gem.c
@@ -240,10 +240,9 @@  int vkms_gem_vmap(struct drm_gem_object *obj)
 		vkms_obj->vaddr = vmap(pages, n_pages, VM_MAP, PAGE_KERNEL);
 		if (!vkms_obj->vaddr)
 			goto err_vmap;
-
-		vkms_obj->vmap_count++;
 	}
 
+	vkms_obj->vmap_count++;
 	goto out;
 
 err_vmap: