lkml.org 
[lkml]   [2014]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH 20/20] arch: Rewrite generic atomic support
    On Thu, May 08, 2014 at 05:24:01PM +0200, Sam Ravnborg wrote:
    > >
    > > -/**
    > > - * atomic_add_return - add integer to atomic variable
    > > - * @i: integer value to add
    > > - * @v: pointer of type atomic_t
    > > - *
    > > - * Atomically adds @i to @v and returns the result
    > > - */
    > For people not starign at kernel code every days these sparse comments
    > is a help. If anything they should be improved rather than deleted.

    Does something like this help? Its a bit tedious to have to repeat the
    comment while we just collapsed all the implementations.


    --- a/include/asm-generic/atomic.h
    +++ b/include/asm-generic/atomic.h
    @@ -18,6 +18,23 @@
    #include <asm/cmpxchg.h>
    #include <asm/barrier.h>

    +/*
    + * atomic_$op() - $op integer to atomic variable
    + * @i: integer value to $op
    + * @v: pointer to the atomic variable
    + *
    + * Atomically $ops @i to @v. Does not strictly guarantee a memory-barrier, use
    + * smp_mb__{before,after}_atomic().
    + */
    +
    +/*
    + * atomic_$op_return() - $op interer to atomic variable and returns the result
    + * @i: integer value to $op
    + * @v: pointer to the atomic variable
    + *
    + * Atomically $ops @i to @v. Does imply a full memory barrier.
    + */
    +
    #ifdef CONFIG_SMP

    /* we can build all atomic primitives from cmpxchg */

    \
     
     \ /
      Last update: 2014-05-08 21:01    [W:4.446 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site