lkml.org 
[lkml]   [2009]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 05/27] asm-generic: add generic io.h
    Date
    io.h is more or less a straight copy from the mn10300 code,
    so maybe David Howells is interested in this as well.

    On Monday 04 May 2009, Geert Uytterhoeven wrote:
    > On Thu, Nov 6, 2008 at 15:38, Arnd Bergmann <arnd@arndb.de> wrote:
    > > +static inline void outsw(unsigned long addr, const void *buffer, int count)
    > > +{
    > > +       if (count) {
    > > +               const u16 *buf = buffer;
    > > +               do {
    > > +                       outw(*buf++, addr);
    > > +               } while (--count);
    > > +       }
    > > +}
    > > +
    > > +static inline void outsl(unsigned long addr, const void *buffer, int count)
    > > +{
    > > +       if (count) {
    > > +               const u32 *buf = buffer;
    > > +               do {
    > > +                       outl(*buf++, addr);
    > > +               } while (--count);
    > > +       }
    > > +}
    >
    > Do we ever call these with count == 0?

    I don't think it can, but code is still more correct if it can handle it.
    It could of course be written as

    const u32 *buf;
    for (buf = buffer; count; count--)
    outl(*buf++, addr);


    > > +/*
    > > + * Change "struct page" to physical address.
    > > + */
    >
    > Which `struct page'?

    I can change the comment to what avr32 and m32r have:

    arch/avr32/include/asm/io.h-/*
    arch/avr32/include/asm/io.h: * ioremap - map bus memory into CPU space
    arch/avr32/include/asm/io.h- * @offset bus address of the memory
    arch/avr32/include/asm/io.h- * @size size of the resource to map
    arch/avr32/include/asm/io.h- *
    arch/avr32/include/asm/io.h: * ioremap performs a platform specific sequence of operations to make
    arch/avr32/include/asm/io.h- * bus memory CPU accessible via the readb/.../writel functions and
    arch/avr32/include/asm/io.h- * the other mmio helpers. The returned address is not guaranteed to
    arch/avr32/include/asm/io.h- * be usable directly as a virtual address.
    arch/avr32/include/asm/io.h- */


    Arnd <><
    --
    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: 2009-05-04 12:51    [W:0.024 / U:29.708 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site