power: Fix typo in status comparison causing warning
Subsystems (4)
PATCH 1/1 power: Fix typo in status comparison causing warning
GCC version 4.5.1 gives the following warning:
drivers/base/power/runtime.c: In function ‘rpm_check_suspend_allowed’:
drivers/base/power/runtime.c:146:25: warning: comparison between ‘enum dpm_state’ and ‘enum rpm_status’
which seems to be a typo in that dev->power.runtime_status should be compared instead of dev->power.status.
--- drivers/base/power/runtime.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/power/runtime.c +1 -1
@@ -143,7 +143,7 @@ static int rpm_check_suspend_allowed(struct device *dev)/* Pending resume requests take precedence over suspends. */ else if ((dev->power.deferred_resume - && dev->power.status == RPM_SUSPENDING) + && dev->power.runtime_status == RPM_SUSPENDING) || (dev->power.request_pending && dev->power.request == RPM_REQ_RESUME)) retval = -EAGAIN ;
Signature · 1 line
1.7.3.2
Quoted 18 lines · Kevin Winchester
GCC version 4.5.1 gives the following warning:
drivers/base/power/runtime.c: In function ‘rpm_check_suspend_allowed’:
drivers/base/power/runtime.c:146:25: warning: comparison between ‘enum dpm_state’ and ‘enum rpm_status’which seems to be a typo in that
dev->power.runtime_statusshould be compared instead ofdev->power.status.Signed-off-by Kevin Winchester <[email protected]>--- drivers/base/power/runtime.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/base/power/runtime.c +0
-0
drivers/base/power/runtime.c static int rpm_check_suspend_allowed(struct device *dev) · line 149
Quoted 8 lines
drivers/base/power/runtime.c +1
-1@@ -143,7 +143,7 @@ static int rpm_check_suspend_allowed(struct device *dev)/* Pending resume requests take precedence over suspends. */ else if ((dev->power.deferred_resume - && dev->power.status == RPM_SUSPENDING) + && dev->power.runtime_status == RPM_SUSPENDING) || (dev->power.request_pending && dev->power.request == RPM_REQ_RESUME)) retval = -EAGAIN ;
Ouch, this actually is a serious bug.
Thanks a lot for the fix, will push to Linus shortly.
Rafael
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm
Quoted 18 lines · Kevin Winchester
GCC version 4.5.1 gives the following warning:
drivers/base/power/runtime.c: In function ‘rpm_check_suspend_allowed’:
drivers/base/power/runtime.c:146:25: warning: comparison between ‘enum dpm_state’ and ‘enum rpm_status’which seems to be a typo in that
dev->power.runtime_statusshould be compared instead ofdev->power.status.Signed-off-by Kevin Winchester <[email protected]>--- drivers/base/power/runtime.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/base/power/runtime.c +0
-0
drivers/base/power/runtime.c static int rpm_check_suspend_allowed(struct device *dev) · line 149
Quoted 8 lines
drivers/base/power/runtime.c +1
-1@@ -143,7 +143,7 @@ static int rpm_check_suspend_allowed(struct device *dev)/* Pending resume requests take precedence over suspends. */ else if ((dev->power.deferred_resume - && dev->power.status == RPM_SUSPENDING) + && dev->power.runtime_status == RPM_SUSPENDING) || (dev->power.request_pending && dev->power.request == RPM_REQ_RESUME)) retval = -EAGAIN ;
Ouch, this actually is a serious bug.
Thanks a lot for the fix, will push to Linus shortly.
Rafael
Quoted 20 lines · Rafael J. Wysocki
Quoted 19 lines · Kevin Winchester
GCC version 4.5.1 gives the following warning:
drivers/base/power/runtime.c: In function ‘rpm_check_suspend_allowed’:
drivers/base/power/runtime.c:146:25: warning: comparison between ‘enum dpm_state’ and ‘enum rpm_status’which seems to be a typo in that
dev->power.runtime_statusshould be compared instead ofdev->power.status.Signed-off-by Kevin Winchester <[email protected]>--- drivers/base/power/runtime.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/base/power/runtime.c +0
-0@@ -143,7 +143,7 @@ static int rpm_check_suspend_allowed(struct device *dev)
Quoted 9 lines
drivers/base/power/runtime.c static int rpm_check_suspend_allowed(struct device *dev) · line 149
Quoted 7 lines
drivers/base/power/runtime.c +1
-1/* Pending resume requests take precedence over suspends. */ else if ((dev->power.deferred_resume - && dev->power.status == RPM_SUSPENDING) + && dev->power.runtime_status == RPM_SUSPENDING) || (dev->power.request_pending && dev->power.request == RPM_REQ_RESUME)) retval = -EAGAIN ;Ouch, this actually is a serious bug.
Yes indeed. I should have caught it while reviewing the patch. A quick check shows there are no other similar typos.
Quoted 3 lines
Thanks a lot for the fix, will push to Linus shortly.
Rafael
Alan Stern
Quoted 20 lines · Rafael J. Wysocki
Quoted 19 lines · Kevin Winchester
GCC version 4.5.1 gives the following warning:
drivers/base/power/runtime.c: In function ‘rpm_check_suspend_allowed’:
drivers/base/power/runtime.c:146:25: warning: comparison between ‘enum dpm_state’ and ‘enum rpm_status’which seems to be a typo in that
dev->power.runtime_statusshould be compared instead ofdev->power.status.Signed-off-by Kevin Winchester <[email protected]>--- drivers/base/power/runtime.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/base/power/runtime.c +0
-0@@ -143,7 +143,7 @@ static int rpm_check_suspend_allowed(struct device *dev)
Quoted 9 lines
drivers/base/power/runtime.c static int rpm_check_suspend_allowed(struct device *dev) · line 149
Quoted 7 lines
drivers/base/power/runtime.c +1
-1/* Pending resume requests take precedence over suspends. */ else if ((dev->power.deferred_resume - && dev->power.status == RPM_SUSPENDING) + && dev->power.runtime_status == RPM_SUSPENDING) || (dev->power.request_pending && dev->power.request == RPM_REQ_RESUME)) retval = -EAGAIN ;Ouch, this actually is a serious bug.
Yes indeed. I should have caught it while reviewing the patch. A quick check shows there are no other similar typos.
Quoted 3 lines
Thanks a lot for the fix, will push to Linus shortly.
Rafael
Alan Stern