From: Arnd Bergmann <arnd@arndb.de>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: davem@davemloft.net, sparclinux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sparc: use asm-generic/scatterlist.h
Date: Mon, 1 Mar 2010 12:29:51 +0100 [thread overview]
Message-ID: <201003011229.51399.arnd@arndb.de> (raw)
In-Reply-To: <20100301150532R.fujita.tomonori@lab.ntt.co.jp>
On Monday 01 March 2010, FUJITA Tomonori wrote:
> On Fri, 26 Feb 2010 04:35:36 -0800 (PST)
> David Miller <davem@davemloft.net> wrote:
>
> You are referring to the following code (I guess that this hack came
> from x86)?
>
> #if __BITS_PER_LONG == 64
> #define sg_dma_len(sg) ((sg)->dma_length)
> #else
> #define sg_dma_len(sg) ((sg)->length)
> #endif /* 64 bit */
>
> if so, seems that you are right. we could simply have:
>
> #define sg_dma_len(sg) ((sg)->dma_length)
I did it the above way so it would work for any architecture that
wants it. IIRC, similar constructs were used in multiple architectures
before, using the __BITS_PER_LONG macro made this portable.
> The current users of asm-generic/scatterlist.h are microblaze, s390,
> score, sh, and x86.
>
> The first three users don't support DMA so sg_dma_len doesn't matter
> for them.
>
> sh and x86_32 use sg->length, x86_64 uses sg->dma_length. However, sh
> and x86_32 sets dma_length in dma_map_sg() so they can use
> sg->dma_length.
>
> I'll clean up this in the next merge window.
Ok, great. I think a good way to clean this up would be to convert
all architectures to use asm-generic/scatterlist.h first, and then
move it to linux/scatterlist once it is architecture intedepent.
Arnd
next prev parent reply other threads:[~2010-03-01 11:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 0:43 [PATCH] sparc: use asm-generic/scatterlist.h FUJITA Tomonori
2010-02-26 12:35 ` David Miller
2010-03-01 6:05 ` FUJITA Tomonori
2010-03-01 7:03 ` David Miller
2010-03-01 11:29 ` Arnd Bergmann [this message]
2010-03-02 3:33 ` FUJITA Tomonori
2010-03-02 12:03 ` Arnd Bergmann
2010-03-02 12:25 ` FUJITA Tomonori
2010-03-02 13:38 ` Arnd Bergmann
2010-03-02 13:49 ` FUJITA Tomonori
2010-03-02 13:54 ` Arnd Bergmann
2010-03-02 13:55 ` David Miller
2010-03-02 14:06 ` FUJITA Tomonori
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=201003011229.51399.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@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