Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call "wakeup_source_unregister"

2014-11-19 Thread walter harms
Am 19.11.2014 14:05, schrieb Dan Carpenter: > On Wed, Nov 19, 2014 at 01:54:49PM +0100, walter harms wrote: >> device_wakeup_detach returns dev->power.wakeup what is never NULL in this >> case. >> (not visible here but a few line before exactly this is checked) > > Huh? I don't see a NULL

Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call "wakeup_source_unregister"

2014-11-19 Thread Dan Carpenter
On Wed, Nov 19, 2014 at 01:54:49PM +0100, walter harms wrote: > device_wakeup_detach returns dev->power.wakeup what is never NULL in this > case. > (not visible here but a few line before exactly this is checked) Huh? I don't see a NULL check. I think you may be confusing

Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call "wakeup_source_unregister"

2014-11-19 Thread walter harms
Am 19.11.2014 13:09, schrieb Dan Carpenter: > On Wed, Nov 19, 2014 at 12:26:45PM +0100, SF Markus Elfring wrote: >> --- a/drivers/base/power/wakeup.c >> +++ b/drivers/base/power/wakeup.c >> @@ -267,8 +267,7 @@ int device_wakeup_disable(struct device *dev) >> return -EINVAL; >> >>

Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call "wakeup_source_unregister"

2014-11-19 Thread Dan Carpenter
On Wed, Nov 19, 2014 at 12:26:45PM +0100, SF Markus Elfring wrote: > --- a/drivers/base/power/wakeup.c > +++ b/drivers/base/power/wakeup.c > @@ -267,8 +267,7 @@ int device_wakeup_disable(struct device *dev) > return -EINVAL; > > ws = device_wakeup_detach(dev); > - if (ws)

[PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call "wakeup_source_unregister"

2014-11-19 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 19 Nov 2014 12:21:24 +0100 The wakeup_source_unregister() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus

[PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call wakeup_source_unregister

2014-11-19 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Wed, 19 Nov 2014 12:21:24 +0100 The wakeup_source_unregister() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call wakeup_source_unregister

2014-11-19 Thread Dan Carpenter
On Wed, Nov 19, 2014 at 12:26:45PM +0100, SF Markus Elfring wrote: --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -267,8 +267,7 @@ int device_wakeup_disable(struct device *dev) return -EINVAL; ws = device_wakeup_detach(dev); - if (ws) -

Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call wakeup_source_unregister

2014-11-19 Thread walter harms
Am 19.11.2014 13:09, schrieb Dan Carpenter: On Wed, Nov 19, 2014 at 12:26:45PM +0100, SF Markus Elfring wrote: --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -267,8 +267,7 @@ int device_wakeup_disable(struct device *dev) return -EINVAL; ws =

Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call wakeup_source_unregister

2014-11-19 Thread Dan Carpenter
On Wed, Nov 19, 2014 at 01:54:49PM +0100, walter harms wrote: device_wakeup_detach returns dev-power.wakeup what is never NULL in this case. (not visible here but a few line before exactly this is checked) Huh? I don't see a NULL check. I think you may be confusing dev-power.can_wakeup with

Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call wakeup_source_unregister

2014-11-19 Thread walter harms
Am 19.11.2014 14:05, schrieb Dan Carpenter: On Wed, Nov 19, 2014 at 01:54:49PM +0100, walter harms wrote: device_wakeup_detach returns dev-power.wakeup what is never NULL in this case. (not visible here but a few line before exactly this is checked) Huh? I don't see a NULL check. I