* [PATCH] gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check
@ 2013-01-15 0:38 Cong Ding
2013-01-15 10:39 ` David Howells
0 siblings, 1 reply; 5+ messages in thread
From: Cong Ding @ 2013-01-15 0:38 UTC (permalink / raw)
To: David Airlie, Ben Skeggs, Dave Airlie, Paul E. McKenney,
David Howells, Thomas Gleixner, dri-devel, linux-kernel
Cc: Cong Ding
the variable sender is dereferenced in line 190, so it is no reason to check
null again in line 198.
Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
drivers/gpu/drm/nouveau/nouveau_fence.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 1d049be..b6b8e49 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -195,11 +195,9 @@ nouveau_fence_new(struct nouveau_channel *chan, struct nouveau_fence **pfence)
return -ENOMEM;
kref_init(&fence->kref);
- if (chan) {
- ret = nouveau_fence_emit(fence, chan);
- if (ret)
- nouveau_fence_unref(&fence);
- }
+ ret = nouveau_fence_emit(fence, chan);
+ if (ret)
+ nouveau_fence_unref(&fence);
*pfence = fence;
return ret;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check
2013-01-15 0:38 [PATCH] gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check Cong Ding
@ 2013-01-15 10:39 ` David Howells
2013-01-15 11:14 ` Cong Ding
2013-01-15 17:00 ` David Howells
0 siblings, 2 replies; 5+ messages in thread
From: David Howells @ 2013-01-15 10:39 UTC (permalink / raw)
To: Cong Ding
Cc: dhowells, David Airlie, Ben Skeggs, Dave Airlie, Paul E. McKenney,
Thomas Gleixner, dri-devel, linux-kernel
Cong Ding <dinggnu@gmail.com> wrote:
> the variable sender is dereferenced in line 190, so it is no reason to check
> null again in line 198.
Did you mean "The variable 'chan'"?
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check
2013-01-15 10:39 ` David Howells
@ 2013-01-15 11:14 ` Cong Ding
2013-01-15 17:00 ` David Howells
1 sibling, 0 replies; 5+ messages in thread
From: Cong Ding @ 2013-01-15 11:14 UTC (permalink / raw)
To: David Howells
Cc: David Airlie, Ben Skeggs, Dave Airlie, Paul E. McKenney,
Thomas Gleixner, dri-devel, linux-kernel
On Tue, Jan 15, 2013 at 10:39:23AM +0000, David Howells wrote:
> Cong Ding <dinggnu@gmail.com> wrote:
>
> > the variable sender is dereferenced in line 190, so it is no reason to check
> > null again in line 198.
>
> Did you mean "The variable 'chan'"?
sorry, my fault. so should I send a new version to correct the typo?
- cong
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check
2013-01-15 10:39 ` David Howells
2013-01-15 11:14 ` Cong Ding
@ 2013-01-15 17:00 ` David Howells
2013-01-15 17:19 ` [PATCH v2] " Cong Ding
1 sibling, 1 reply; 5+ messages in thread
From: David Howells @ 2013-01-15 17:00 UTC (permalink / raw)
To: Cong Ding
Cc: dhowells, David Airlie, Ben Skeggs, Dave Airlie, Paul E. McKenney,
Thomas Gleixner, dri-devel, linux-kernel
Cong Ding <dinggnu@gmail.com> wrote:
> > > the variable sender is dereferenced in line 190, so it is no reason to check
> > > null again in line 198.
> >
> > Did you mean "The variable 'chan'"?
> sorry, my fault. so should I send a new version to correct the typo?
Yep.
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check
2013-01-15 17:00 ` David Howells
@ 2013-01-15 17:19 ` Cong Ding
0 siblings, 0 replies; 5+ messages in thread
From: Cong Ding @ 2013-01-15 17:19 UTC (permalink / raw)
To: David Howells
Cc: David Airlie, Ben Skeggs, Dave Airlie, Paul E. McKenney,
Thomas Gleixner, dri-devel, linux-kernel
the variable chan is dereferenced in line 190, so it is no reason to check
null again in line 198.
Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
drivers/gpu/drm/nouveau/nouveau_fence.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 1d049be..b6b8e49 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -195,11 +195,9 @@ nouveau_fence_new(struct nouveau_channel *chan, struct nouveau_fence **pfence)
return -ENOMEM;
kref_init(&fence->kref);
- if (chan) {
- ret = nouveau_fence_emit(fence, chan);
- if (ret)
- nouveau_fence_unref(&fence);
- }
+ ret = nouveau_fence_emit(fence, chan);
+ if (ret)
+ nouveau_fence_unref(&fence);
*pfence = fence;
return ret;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-01-15 17:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 0:38 [PATCH] gpu: drm/nouveau/nouveau_fence.c: remove unnecessary null pointer check Cong Ding
2013-01-15 10:39 ` David Howells
2013-01-15 11:14 ` Cong Ding
2013-01-15 17:00 ` David Howells
2013-01-15 17:19 ` [PATCH v2] " Cong Ding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).