lkml.org 
[lkml]   [2012]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/8] PM / Sleep: Initialize wakeup source locks in wakeup_source_add()
Date
On Tuesday, February 07, 2012, John Stultz wrote:
> On Tue, 2012-02-07 at 02:01 +0100, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> >
> > Initialize wakeup source locks in wakeup_source_add() instead of
> > wakeup_source_create(), because otherwise the locks of the wakeup
> > sources that haven't been allocated with wakeup_source_create()
> > aren't initialized and handled properly.
> >
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
>
> Ah, I've shot myself in the foot before, forgetting to init the wakeup
> source, so this should be good. Although, would a WARN_ON be better then
> just initializing the lock in add? That way bad behavior is more likely
> to be corrected, rather then just ignored.

Well, that's not bad behavior, since users are not supposed to open code
wakeup source initialization. _add() is supposed to do the job (that's
why I regard this one as a fix).

Thanks,
Rafael


\
 
 \ /
  Last update: 2012-02-07 23:41    [W:1.781 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site