Re: [PATCH] ALSA sound driver for SEGA Dreamcast AICA (pcm)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15/05/07, Adrian McMenamin <[email protected]> wrote:
On 15/05/07, Heikki Orsila <[email protected]> wrote:
> I still noticed some type cleanups, and possibly a good debug message..
>
> On Mon, May 14, 2007 at 11:14:55PM +0100, Adrian McMenamin wrote:
> > +/* spu_memload - write to SPU address space */
> > +static void spu_memload(u32 toi, void __iomem * from, int length)
> > +{
> > +     u32 __iomem *froml = from;
> > +     u32 __iomem *to = (u32 __iomem *) (SPU_MEMORY_BASE + toi);
> > +     int i, val;
>
> You should use "void *from" because it's not IO memory. Also, use "u32 val"
> since that is the native type of "u32 *from".
>
> > +     length = DIV_ROUND_UP(length, 4);
> > +     spu_write_wait();
> > +     for (i = 0; i < length; i++) {
> > +             val = *froml;
> > +             writel(val, to);
> > +             froml++;
> > +             to++;
> > +             if (i && !(i % 8))
> > +                     spu_write_wait();
> > +     }
> > +}
>
> It seems a small simplification is possible:
>
>         /* remove first spu_write_wait(); */
>         for (i = 0; i < length; i++) {
>                 if (!(i % 8))
>                         spu_write_wait();
>                 val = *froml;
>                 ...
>         }
>

No, that would be dangerous because we don't know what state the FIFO
is in when this is called.



Sorry, should think before I post!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux