lkml.org 
[lkml]   [2004]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] HPET driver
    Andrew Morton wrote:
    > +static inline u64 readq(void *addr)
    > +{
    > + return readl(addr) | (((u64)readl(addr + 4)) << 32);
    > +}
    > +
    > +static inline void writeq(u64 v, void *addr)
    > +{
    > + writel(v & 0xffffffff, addr);
    > + writel(v >> 32, addr + 4);
    > +}


    Seems sane, though I wonder about two things:

    * better home is probably asm-generic

    * It seems to me that a poorly-written writel() macro might prefer some
    guarantee that it's argument is pre-cast to u32. I dunno if this is
    just paranoia or not.


    -
    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: 2005-03-22 14:03    [W:0.021 / U:0.444 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site