lkml.org 
[lkml]   [2006]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH, RFC] [1/3] Generic in-kernel AC status
    Hi!

    On Wed, Feb 08, 2006 at 01:04:22PM +0000, Matthew Garrett wrote:
    > diff --git a/include/linux/pm.h b/include/linux/pm.h
    ...
    > +void pm_set_ac_status(int (*ac_status_function)(void))
    > +{
    > + down(&pm_sem);
    > + get_ac_status = ac_status_function;
    > + up(&pm_sem);
    > +}

    Why do you need a semaphore/mutex, when you only do one assignment,
    which is atomic by itself?

    BYtE
    Philipp
    --
    / / (_)__ __ ____ __ Philipp Hahn
    / /__/ / _ \/ // /\ \/ /
    /____/_/_//_/\_,_/ /_/\_\ pmhahn@titan.lahn.de
    -
    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: 2006-02-08 23:28    [W:3.363 / U:0.840 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site