All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
@ 2018-10-18 20:48 ` Mamta Shukla
  0 siblings, 0 replies; 12+ messages in thread
From: Mamta Shukla @ 2018-10-18 20:48 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: airlied, daniel.vetter, dri-devel

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
better to have inlined function rather than code-opened implementation.

Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 6a68493..b751b76 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
 		SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
 		&dumper->bo, &dumper->iova);
 
-	if (IS_ERR(dumper->ptr))
-		return PTR_ERR(dumper->ptr);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(dumper->ptr);
 }
 
 static void a5xx_crashdumper_free(struct msm_gpu *gpu,
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
@ 2018-10-18 20:48 ` Mamta Shukla
  0 siblings, 0 replies; 12+ messages in thread
From: Mamta Shukla @ 2018-10-18 20:48 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: dri-devel, daniel.vetter, robdclark, airlied

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
better to have inlined function rather than code-opened implementation.

Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 6a68493..b751b76 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
 		SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
 		&dumper->bo, &dumper->iova);
 
-	if (IS_ERR(dumper->ptr))
-		return PTR_ERR(dumper->ptr);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(dumper->ptr);
 }
 
 static void a5xx_crashdumper_free(struct msm_gpu *gpu,
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Outreachy kernel] [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
  2018-10-18 20:48 ` Mamta Shukla
@ 2018-10-19  6:18   ` Julia Lawall
  -1 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2018-10-19  6:18 UTC (permalink / raw)
  To: Mamta Shukla; +Cc: airlied, outreachy-kernel, dri-devel, daniel.vetter



On Fri, 19 Oct 2018, Mamta Shukla wrote:

> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> better to have inlined function rather than code-opened implementation.


Just for your information, people have mixed feelings about this.  In your
case, it's probably fine, because this is the only if in the function.
But when there is a series of if (...) return; followed by a return 0; at
the end, people ofen prefer to keep it as it is, so the last case doesn't
look different than the others.

julia

>
> Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> ---
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 6a68493..b751b76 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
>  		SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
>  		&dumper->bo, &dumper->iova);
>
> -	if (IS_ERR(dumper->ptr))
> -		return PTR_ERR(dumper->ptr);
> -
> -	return 0;
> +	return PTR_ERR_OR_ZERO(dumper->ptr);
>  }
>
>  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181018204815.GA23390%40armorer.
> For more options, visit https://groups.google.com/d/optout.
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Outreachy kernel] [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
@ 2018-10-19  6:18   ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2018-10-19  6:18 UTC (permalink / raw)
  To: Mamta Shukla
  Cc: outreachy-kernel, dri-devel, daniel.vetter, robdclark, airlied



On Fri, 19 Oct 2018, Mamta Shukla wrote:

> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> better to have inlined function rather than code-opened implementation.


Just for your information, people have mixed feelings about this.  In your
case, it's probably fine, because this is the only if in the function.
But when there is a series of if (...) return; followed by a return 0; at
the end, people ofen prefer to keep it as it is, so the last case doesn't
look different than the others.

julia

>
> Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> ---
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 6a68493..b751b76 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
>  		SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
>  		&dumper->bo, &dumper->iova);
>
> -	if (IS_ERR(dumper->ptr))
> -		return PTR_ERR(dumper->ptr);
> -
> -	return 0;
> +	return PTR_ERR_OR_ZERO(dumper->ptr);
>  }
>
>  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181018204815.GA23390%40armorer.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Outreachy kernel] [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
  2018-10-19  6:18   ` Julia Lawall
@ 2018-10-19  7:19     ` Daniel Vetter
  -1 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2018-10-19  7:19 UTC (permalink / raw)
  To: Julia Lawall
  Cc: airlied, daniel.vetter, dri-devel, outreachy-kernel, Mamta Shukla

On Fri, Oct 19, 2018 at 08:18:52AM +0200, Julia Lawall wrote:
> On Fri, 19 Oct 2018, Mamta Shukla wrote:
> > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> > better to have inlined function rather than code-opened implementation.
> 
> 
> Just for your information, people have mixed feelings about this.  In your
> case, it's probably fine, because this is the only if in the function.
> But when there is a series of if (...) return; followed by a return 0; at
> the end, people ofen prefer to keep it as it is, so the last case doesn't
> look different than the others.

Yeah I asked the maintainer for this driver for an ack, the other patches
look good, will merged them as soon as I have the answer for this one
here.

Mamta, since you'll have a few things merged already with these I think
it's a good time to start looking into bigger tasks and figuring out what
you might want to do in your internship:

https://dri.freedesktop.org/docs/drm/gpu/todo.html

Since this todo list is very unstructured it's best to discuss a bit over
irc what you would want to, and what makes sense as an internship.

Thanks, Daniel
> 
> julia
> 
> >
> > Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> > ---
> >  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > index 6a68493..b751b76 100644
> > --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
> >  		SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
> >  		&dumper->bo, &dumper->iova);
> >
> > -	if (IS_ERR(dumper->ptr))
> > -		return PTR_ERR(dumper->ptr);
> > -
> > -	return 0;
> > +	return PTR_ERR_OR_ZERO(dumper->ptr);
> >  }
> >
> >  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181018204815.GA23390%40armorer.
> > For more options, visit https://groups.google.com/d/optout.
> >

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Outreachy kernel] [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
@ 2018-10-19  7:19     ` Daniel Vetter
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2018-10-19  7:19 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Mamta Shukla, outreachy-kernel, dri-devel, daniel.vetter,
	robdclark, airlied

On Fri, Oct 19, 2018 at 08:18:52AM +0200, Julia Lawall wrote:
> On Fri, 19 Oct 2018, Mamta Shukla wrote:
> > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> > better to have inlined function rather than code-opened implementation.
> 
> 
> Just for your information, people have mixed feelings about this.  In your
> case, it's probably fine, because this is the only if in the function.
> But when there is a series of if (...) return; followed by a return 0; at
> the end, people ofen prefer to keep it as it is, so the last case doesn't
> look different than the others.

Yeah I asked the maintainer for this driver for an ack, the other patches
look good, will merged them as soon as I have the answer for this one
here.

Mamta, since you'll have a few things merged already with these I think
it's a good time to start looking into bigger tasks and figuring out what
you might want to do in your internship:

https://dri.freedesktop.org/docs/drm/gpu/todo.html

Since this todo list is very unstructured it's best to discuss a bit over
irc what you would want to, and what makes sense as an internship.

Thanks, Daniel
> 
> julia
> 
> >
> > Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> > ---
> >  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > index 6a68493..b751b76 100644
> > --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
> >  		SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
> >  		&dumper->bo, &dumper->iova);
> >
> > -	if (IS_ERR(dumper->ptr))
> > -		return PTR_ERR(dumper->ptr);
> > -
> > -	return 0;
> > +	return PTR_ERR_OR_ZERO(dumper->ptr);
> >  }
> >
> >  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181018204815.GA23390%40armorer.
> > For more options, visit https://groups.google.com/d/optout.
> >

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Outreachy kernel] [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
  2018-10-19  7:19     ` Daniel Vetter
@ 2018-10-19 16:57       ` Jordan Crouse
  -1 siblings, 0 replies; 12+ messages in thread
From: Jordan Crouse @ 2018-10-19 16:57 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: outreachy-kernel, airlied, daniel.vetter, Mamta Shukla,
	Julia Lawall, dri-devel

On Fri, Oct 19, 2018 at 09:19:32AM +0200, Daniel Vetter wrote:
> On Fri, Oct 19, 2018 at 08:18:52AM +0200, Julia Lawall wrote:
> > On Fri, 19 Oct 2018, Mamta Shukla wrote:
> > > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> > > better to have inlined function rather than code-opened implementation.
> > 
> > 
> > Just for your information, people have mixed feelings about this.  In your
> > case, it's probably fine, because this is the only if in the function.
> > But when there is a series of if (...) return; followed by a return 0; at
> > the end, people ofen prefer to keep it as it is, so the last case doesn't
> > look different than the others.
> 
> Yeah I asked the maintainer for this driver for an ack, the other patches
> look good, will merged them as soon as I have the answer for this one
> here.
> 
> Mamta, since you'll have a few things merged already with these I think
> it's a good time to start looking into bigger tasks and figuring out what
> you might want to do in your internship:
> 
> https://dri.freedesktop.org/docs/drm/gpu/todo.html
> 
> Since this todo list is very unstructured it's best to discuss a bit over
> irc what you would want to, and what makes sense as an internship.

> Thanks, Daniel
> > 
> > julia
> > 

I'm not the maintainer but this seems reasonable to me. Yay negative lines.

Jordan

> > >
> > > Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> > > ---
> > >  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
> > >  1 file changed, 1 insertion(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > > index 6a68493..b751b76 100644
> > > --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > > +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > > @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
> > >  		SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
> > >  		&dumper->bo, &dumper->iova);
> > >
> > > -	if (IS_ERR(dumper->ptr))
> > > -		return PTR_ERR(dumper->ptr);
> > > -
> > > -	return 0;
> > > +	return PTR_ERR_OR_ZERO(dumper->ptr);
> > >  }
> > >
> > >  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> > > --
> > > 1.9.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181018204815.GA23390%40armorer.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Outreachy kernel] [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
@ 2018-10-19 16:57       ` Jordan Crouse
  0 siblings, 0 replies; 12+ messages in thread
From: Jordan Crouse @ 2018-10-19 16:57 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Julia Lawall, airlied, daniel.vetter, dri-devel,
	outreachy-kernel, Mamta Shukla

On Fri, Oct 19, 2018 at 09:19:32AM +0200, Daniel Vetter wrote:
> On Fri, Oct 19, 2018 at 08:18:52AM +0200, Julia Lawall wrote:
> > On Fri, 19 Oct 2018, Mamta Shukla wrote:
> > > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> > > better to have inlined function rather than code-opened implementation.
> > 
> > 
> > Just for your information, people have mixed feelings about this.  In your
> > case, it's probably fine, because this is the only if in the function.
> > But when there is a series of if (...) return; followed by a return 0; at
> > the end, people ofen prefer to keep it as it is, so the last case doesn't
> > look different than the others.
> 
> Yeah I asked the maintainer for this driver for an ack, the other patches
> look good, will merged them as soon as I have the answer for this one
> here.
> 
> Mamta, since you'll have a few things merged already with these I think
> it's a good time to start looking into bigger tasks and figuring out what
> you might want to do in your internship:
> 
> https://dri.freedesktop.org/docs/drm/gpu/todo.html
> 
> Since this todo list is very unstructured it's best to discuss a bit over
> irc what you would want to, and what makes sense as an internship.

> Thanks, Daniel
> > 
> > julia
> > 

I'm not the maintainer but this seems reasonable to me. Yay negative lines.

Jordan

> > >
> > > Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> > > ---
> > >  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
> > >  1 file changed, 1 insertion(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > > index 6a68493..b751b76 100644
> > > --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > > +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > > @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
> > >  		SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
> > >  		&dumper->bo, &dumper->iova);
> > >
> > > -	if (IS_ERR(dumper->ptr))
> > > -		return PTR_ERR(dumper->ptr);
> > > -
> > > -	return 0;
> > > +	return PTR_ERR_OR_ZERO(dumper->ptr);
> > >  }
> > >
> > >  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> > > --
> > > 1.9.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181018204815.GA23390%40armorer.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
  2018-10-18 20:48 ` Mamta Shukla
@ 2018-10-23 12:54   ` Sean Paul
  -1 siblings, 0 replies; 12+ messages in thread
From: Sean Paul @ 2018-10-23 12:54 UTC (permalink / raw)
  To: Mamta Shukla; +Cc: Dave Airlie, outreachy-kernel, dri-devel, Daniel Vetter

On Thu, Oct 18, 2018 at 7:11 PM Mamta Shukla <mamtashukla555@gmail.com> wrote:
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> better to have inlined function rather than code-opened implementation.
>
> Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 6a68493..b751b76 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
>                 SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
>                 &dumper->bo, &dumper->iova);
>
> -       if (IS_ERR(dumper->ptr))
> -               return PTR_ERR(dumper->ptr);
> -
> -       return 0;
> +       return PTR_ERR_OR_ZERO(dumper->ptr);
>  }
>
>  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
@ 2018-10-23 12:54   ` Sean Paul
  0 siblings, 0 replies; 12+ messages in thread
From: Sean Paul @ 2018-10-23 12:54 UTC (permalink / raw)
  To: Mamta Shukla; +Cc: outreachy-kernel, Dave Airlie, Daniel Vetter, dri-devel

On Thu, Oct 18, 2018 at 7:11 PM Mamta Shukla <mamtashukla555@gmail.com> wrote:
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> better to have inlined function rather than code-opened implementation.
>
> Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>

Reviewed-by: Sean Paul <sean@poorly.run>

> ---
>  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 6a68493..b751b76 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
>                 SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
>                 &dumper->bo, &dumper->iova);
>
> -       if (IS_ERR(dumper->ptr))
> -               return PTR_ERR(dumper->ptr);
> -
> -       return 0;
> +       return PTR_ERR_OR_ZERO(dumper->ptr);
>  }
>
>  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
  2018-10-23 12:54   ` Sean Paul
@ 2018-10-23 13:59     ` Daniel Vetter
  -1 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2018-10-23 13:59 UTC (permalink / raw)
  To: Sean Paul
  Cc: Dave Airlie, outreachy-kernel, dri-devel, Mamta Shukla, Daniel Vetter

On Tue, Oct 23, 2018 at 08:54:36AM -0400, Sean Paul wrote:
> On Thu, Oct 18, 2018 at 7:11 PM Mamta Shukla <mamtashukla555@gmail.com> wrote:
> >
> > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> > better to have inlined function rather than code-opened implementation.
> >
> > Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> 
> Reviewed-by: Sean Paul <sean@poorly.run>

Applied to drm-misc-next so Julia can easily spot them all. Thanks for
patch&review.
-Daniel
> 
> > ---
> >  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > index 6a68493..b751b76 100644
> > --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
> >                 SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
> >                 &dumper->bo, &dumper->iova);
> >
> > -       if (IS_ERR(dumper->ptr))
> > -               return PTR_ERR(dumper->ptr);
> > -
> > -       return 0;
> > +       return PTR_ERR_OR_ZERO(dumper->ptr);
> >  }
> >
> >  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> > --
> > 1.9.1
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR
@ 2018-10-23 13:59     ` Daniel Vetter
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2018-10-23 13:59 UTC (permalink / raw)
  To: Sean Paul
  Cc: Mamta Shukla, outreachy-kernel, Dave Airlie, Daniel Vetter, dri-devel

On Tue, Oct 23, 2018 at 08:54:36AM -0400, Sean Paul wrote:
> On Thu, Oct 18, 2018 at 7:11 PM Mamta Shukla <mamtashukla555@gmail.com> wrote:
> >
> > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR because its
> > better to have inlined function rather than code-opened implementation.
> >
> > Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> 
> Reviewed-by: Sean Paul <sean@poorly.run>

Applied to drm-misc-next so Julia can easily spot them all. Thanks for
patch&review.
-Daniel
> 
> > ---
> >  drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +----
> >  1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > index 6a68493..b751b76 100644
> > --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> > @@ -1222,10 +1222,7 @@ static int a5xx_crashdumper_init(struct msm_gpu *gpu,
> >                 SZ_1M, MSM_BO_UNCACHED, gpu->aspace,
> >                 &dumper->bo, &dumper->iova);
> >
> > -       if (IS_ERR(dumper->ptr))
> > -               return PTR_ERR(dumper->ptr);
> > -
> > -       return 0;
> > +       return PTR_ERR_OR_ZERO(dumper->ptr);
> >  }
> >
> >  static void a5xx_crashdumper_free(struct msm_gpu *gpu,
> > --
> > 1.9.1
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-10-23 14:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18 20:48 [PATCH DRM] drm: msm: adreno: Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) +PTR_ERR Mamta Shukla
2018-10-18 20:48 ` Mamta Shukla
2018-10-19  6:18 ` [Outreachy kernel] " Julia Lawall
2018-10-19  6:18   ` Julia Lawall
2018-10-19  7:19   ` Daniel Vetter
2018-10-19  7:19     ` Daniel Vetter
2018-10-19 16:57     ` Jordan Crouse
2018-10-19 16:57       ` Jordan Crouse
2018-10-23 12:54 ` Sean Paul
2018-10-23 12:54   ` Sean Paul
2018-10-23 13:59   ` Daniel Vetter
2018-10-23 13:59     ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.