netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Carsten Jacobi <carsten@ccac.rwth-aachen.de>
Cc: Florian Fainelli <florian.fainelli@telecomint.eu>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] lne390 and Jensen Alphas
Date: Sun, 13 Apr 2008 23:11:44 +0100	[thread overview]
Message-ID: <20080413221144.GR9785@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20080413210646.GA8178@heisenberg.ccac.rwth-aachen.de>

On Sun, Apr 13, 2008 at 11:06:46PM +0200, Carsten Jacobi wrote:
> +	/* The mylex lne390 adapter requires 32bit access (see above) for every
> +	 * operation to the shared mem buffer. Since the block buffer is hardly
> +	 * aligned to a 32bit boundary memcpy_toio() will use 16bit
> +	 * operations to access the buffer ... we must use something else here. */
> +
> +	const void *from = buf;
> +	count -= 4;
> +	do {
> +		__raw_writel(*(const u16 *)from | (*(const u16 *)(from+2))<<16,
> +		(unsigned long) shmem);

The last argument of __raw_writel() is void __iomem *, not unsigned long.
WTF is that cast doing that?  Besides, it looks like misspelled
		const __le32 *from = buf;
		...
		__raw_writel(get_unaligned(from), shmem);

> +		(unsigned long) shmem += 4;

Write in C, please.  This isn't - you might as well write something like
	shmem * 2 -= 4;
since result of cast is not an l-value.

Finally, how much of that actually depends on Jensen and how much is
actually "oh, on x86 we use rep movsl in memcpy_toio(), so it ends up
with 32bit accesses"?

  reply	other threads:[~2008-04-13 22:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-29 14:48 [PATCH] lne390 and Jensen Alphas Carsten Jacobi
2008-03-29 18:32 ` Florian Fainelli
2008-04-13 21:06   ` Carsten Jacobi
2008-04-13 22:11     ` Al Viro [this message]
2008-04-20 12:54       ` Carsten Jacobi

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=20080413221144.GR9785@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=carsten@ccac.rwth-aachen.de \
    --cc=florian.fainelli@telecomint.eu \
    --cc=netdev@vger.kernel.org \
    /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).