alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Adrian McMenamin" <adrianmcmenamin@gmail.com>
To: Heikki Orsila <shdl@zakalwe.fi>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	linuxsh-dev@lists.sourceforge.net
Subject: Re: [PATCH] ALSA sound driver for SEGA Dreamcast AICA (pcm)
Date: Tue, 15 May 2007 22:30:02 +0100	[thread overview]
Message-ID: <92a12cdb0705151430o66e11fc3m2ec0abd423dc4a6e@mail.gmail.com> (raw)
In-Reply-To: <20070515004751.GD10873@zakalwe.fi>

On 15/05/07, Heikki Orsila <shdl@zakalwe.fi> 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.

  parent reply	other threads:[~2007-05-15 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14 22:14 [PATCH] ALSA sound driver for SEGA Dreamcast AICA (pcm) Adrian McMenamin
2007-05-15  0:47 ` Heikki Orsila
2007-05-15 10:49   ` Adrian McMenamin
2007-05-15 21:30   ` Adrian McMenamin [this message]
2007-05-15 21:31     ` Adrian McMenamin
  -- strict thread matches above, loose matches on Subject: below --
2007-05-14 20:32 Adrian McMenamin
2007-05-14 21:13 ` Heikki Orsila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92a12cdb0705151430o66e11fc3m2ec0abd423dc4a6e@mail.gmail.com \
    --to=adrianmcmenamin@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxsh-dev@lists.sourceforge.net \
    --cc=shdl@zakalwe.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).