lkml.org 
[lkml]   [2007]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Should io(read|write)(8|16|32)_rep take (const|) volatile u(8|16|32) __iomem *addr?
    Michael K. Edwards wrote:
    > Doubtless this is on purpose, but it's not clear to me why that should
    > be true for these particular functions/macros. I shouldn't have to
    > cast away the volatile on a pointer to hardware registers in order to
    > pass it into writel(), should I? And it shouldn't be forbidden for
    > the caller to declare the pointer volatile so that the compiler
    > catches attempts to pass it into non-volatile interfaces, should it?


    Therein lies your bug: you should not be annotating your __iomem
    pointers with volatile.

    That's why volatile is found in the implementation and not the
    prototypes of the accessor functions.

    Jeff


    -
    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: 2007-02-02 22:45    [W:0.038 / U:150.744 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site