lkml.org 
[lkml]   [2010]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] power: Fix typo in status comparison causing warning
On Fri, 29 Oct 2010, Rafael J. Wysocki wrote:

> On Friday, October 29, 2010, Kevin Winchester wrote:
> > 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.
> >
> > Signed-off-by: Kevin Winchester <kjwinchester@gmail.com>
> > ---
> > drivers/base/power/runtime.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
> > index 126ca49..02c652b 100644
> > --- a/drivers/base/power/runtime.c
> > +++ b/drivers/base/power/runtime.c
> > @@ -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.

Yes indeed. I should have caught it while reviewing the patch. A
quick check shows there are no other similar typos.

> Thanks a lot for the fix, will push to Linus shortly.
>
> Rafael

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-10-29 19:47    [W:0.048 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site