* [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
@ 2013-11-06 7:53 Duan Jiong
2013-11-06 16:49 ` Stephen Warren
0 siblings, 1 reply; 7+ messages in thread
From: Duan Jiong @ 2013-11-06 7:53 UTC (permalink / raw)
To: kernel, linux, a.zummo, airlied
Cc: linux-kernel, rtc-linux, dri-devel, linux-tegra, Duan Jiong
This patch fixes coccinelle error regarding usage of IS_ERR and
PTR_ERR instead of PTR_ERR_OR_ZERO.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
drivers/gpu/drm/tegra/gem.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 28a9cbc..ba6a7ac 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -199,10 +199,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
&args->handle);
- if (IS_ERR(bo))
- return PTR_ERR(bo);
-
- return 0;
+ return PTR_ERR_OR_ZERO(bo);
}
int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
2013-11-06 7:53 [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO Duan Jiong
@ 2013-11-06 16:49 ` Stephen Warren
[not found] ` <527A7333.9090409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Warren @ 2013-11-06 16:49 UTC (permalink / raw)
To: Duan Jiong, kernel, linux, a.zummo, airlied
Cc: linux-kernel, rtc-linux, dri-devel, linux-tegra, Thierry Reding,
Terje Bergström
On 11/06/2013 12:53 AM, Duan Jiong wrote:
> This patch fixes coccinelle error regarding usage of IS_ERR and
> PTR_ERR instead of PTR_ERR_OR_ZERO.
> diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
> @@ -199,10 +199,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
>
> bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
> &args->handle);
> - if (IS_ERR(bo))
> - return PTR_ERR(bo);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(bo);
> }
I suppose that's fine, although I wonder if it'll cause churn should we
ever need to add code to the tail end of the function.
BTW, why were all the similar patches that had nothing to do with Tegra
sent to the linux-tegra@ mailing list? You also didn't CC the
maintainers of drivers/gpu/drm/tegra/ on this patch. Plus this patch has
nothing to do with the rtc-linux@ mailing list.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
[not found] ` <527A7333.9090409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-11-07 1:15 ` Duan Jiong
2013-11-11 6:23 ` Thierry Reding
1 sibling, 0 replies; 7+ messages in thread
From: Duan Jiong @ 2013-11-07 1:15 UTC (permalink / raw)
To: Stephen Warren, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
linux-lFZ/pmaqli7XmaaqVzeoHQ, a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
airlied-cv59FeDIM0c
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thierry Reding,
Terje Bergström
于 2013年11月07日 00:49, Stephen Warren 写道:
> On 11/06/2013 12:53 AM, Duan Jiong wrote:
>> This patch fixes coccinelle error regarding usage of IS_ERR and
>> PTR_ERR instead of PTR_ERR_OR_ZERO.
>
>> diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
>
>> @@ -199,10 +199,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
>>
>> bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
>> &args->handle);
>> - if (IS_ERR(bo))
>> - return PTR_ERR(bo);
>> -
>> - return 0;
>> + return PTR_ERR_OR_ZERO(bo);
>> }
>
> I suppose that's fine, although I wonder if it'll cause churn should we
> ever need to add code to the tail end of the function.
>
> BTW, why were all the similar patches that had nothing to do with Tegra
> sent to the linux-tegra@ mailing list? You also didn't CC the
> maintainers of drivers/gpu/drm/tegra/ on this patch. Plus this patch has
> nothing to do with the rtc-linux@ mailing list.
I'm sorry for that. i just get the maintainers and the mail lists by the script
get_maintainer.pl.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
[not found] ` <527A7333.9090409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-11-07 1:15 ` Duan Jiong
@ 2013-11-11 6:23 ` Thierry Reding
1 sibling, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2013-11-11 6:23 UTC (permalink / raw)
To: Stephen Warren
Cc: Duan Jiong, kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org,
airlied-cv59FeDIM0c@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Terje Bergstrom
[-- Attachment #1: Type: text/plain, Size: 941 bytes --]
On Wed, Nov 06, 2013 at 05:49:55PM +0100, Stephen Warren wrote:
> On 11/06/2013 12:53 AM, Duan Jiong wrote:
> > This patch fixes coccinelle error regarding usage of IS_ERR and
> > PTR_ERR instead of PTR_ERR_OR_ZERO.
>
> > diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
>
> > @@ -199,10 +199,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
> >
> > bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
> > &args->handle);
> > - if (IS_ERR(bo))
> > - return PTR_ERR(bo);
> > -
> > - return 0;
> > + return PTR_ERR_OR_ZERO(bo);
> > }
>
> I suppose that's fine, although I wonder if it'll cause churn should we
> ever need to add code to the tail end of the function.
It's unlikely that we'll ever need to add to this function. But I'm not
a big fan of PTR_ERR_OR_ZERO to be honest, so I'll let this sink in for
a bit before applying.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
@ 2014-04-11 8:36 Duan Jiong
[not found] ` <1397205401-24148-1-git-send-email-duanj.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Duan Jiong @ 2014-04-11 8:36 UTC (permalink / raw)
To: airlied-cv59FeDIM0c
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Duan Jiong
This patch fixes coccinelle error regarding usage of IS_ERR and
PTR_ERR instead of PTR_ERR_OR_ZERO.
Signed-off-by: Duan Jiong <duanj.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
---
drivers/gpu/drm/tegra/gem.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index bcf9895..89aebe2 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -268,10 +268,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
&args->handle);
- if (IS_ERR(bo))
- return PTR_ERR(bo);
-
- return 0;
+ return PTR_ERR_OR_ZERO(bo);
}
int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
[not found] ` <1397205401-24148-1-git-send-email-duanj.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
@ 2014-04-11 15:48 ` Stephen Warren
2014-04-16 19:49 ` Thierry Reding
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Warren @ 2014-04-11 15:48 UTC (permalink / raw)
To: Duan Jiong, airlied-cv59FeDIM0c
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 04/11/2014 02:36 AM, Duan Jiong wrote:
> This patch fixes coccinelle error regarding usage of IS_ERR and
> PTR_ERR instead of PTR_ERR_OR_ZERO.
Same comment as the other patch; I prefer the existing code (although
I'll defer to Thierry as maintainer of both these pieces of code).
It would help if the commit description quoted the coccinelle error.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
2014-04-11 15:48 ` Stephen Warren
@ 2014-04-16 19:49 ` Thierry Reding
0 siblings, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2014-04-16 19:49 UTC (permalink / raw)
To: Stephen Warren; +Cc: linux-tegra, dri-devel, Duan Jiong
[-- Attachment #1.1: Type: text/plain, Size: 636 bytes --]
On Fri, Apr 11, 2014 at 09:48:00AM -0600, Stephen Warren wrote:
> On 04/11/2014 02:36 AM, Duan Jiong wrote:
> > This patch fixes coccinelle error regarding usage of IS_ERR and
> > PTR_ERR instead of PTR_ERR_OR_ZERO.
>
> Same comment as the other patch; I prefer the existing code (although
> I'll defer to Thierry as maintainer of both these pieces of code).
I feel the same way. And in fact I believe we already rejected a similar
a while back for the same reason.
> It would help if the commit description quoted the coccinelle error.
"Suggestion" would probably be more accurate. There is no error here.
Thierry
[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-04-16 19:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 7:53 [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO Duan Jiong
2013-11-06 16:49 ` Stephen Warren
[not found] ` <527A7333.9090409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-11-07 1:15 ` Duan Jiong
2013-11-11 6:23 ` Thierry Reding
-- strict thread matches above, loose matches on Subject: below --
2014-04-11 8:36 Duan Jiong
[not found] ` <1397205401-24148-1-git-send-email-duanj.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2014-04-11 15:48 ` Stephen Warren
2014-04-16 19:49 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox