From: Arnd Bergmann <arnd@arndb.de>
To: David Miller <davem@davemloft.net>
Cc: linux@roeck-us.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] net: hisilicon: Never build on SPARC
Date: Wed, 21 Oct 2015 17:57:24 +0200 [thread overview]
Message-ID: <4129407.LpDXnpSZOL@wuerfel> (raw)
In-Reply-To: <20151021.083311.2193871332944250588.davem@davemloft.net>
On Wednesday 21 October 2015 08:33:11 David Miller wrote:
> From: Guenter Roeck <linux@roeck-us.net>
> Date: Wed, 21 Oct 2015 07:56:18 -0700
>
> >> @@ -57,6 +57,11 @@ extern int of_dma_get_range(struct device_node *np,
> >> u64 *dma_addr,
> >> u64 *paddr, u64 *size);
> >> extern bool of_dma_is_coherent(struct device_node *np);
> >> #else /* CONFIG_OF_ADDRESS */
> >> +static inline u64 of_translate_address(struct device_node *np, const
> >> __be32 *addr)
> >> +{
> >> + return 0;
> >
> > Maybe return OF_BAD_ADDR ?
>
> The thing to really do on sparc, is just return the address raw untranslated
> because that just works.
>
We still need to check #address-cells, right?
Something like this?
static inline u64 of_translate_address(struct device_node *np, const __be32 *addr)
{
#if defined(CONFIG_SPARC) || defined(CONFIG_M68K)
int pna = of_n_addr_cells(np);
u64 ret = be32_to_cpu(addr[pna - 1]);
if (pna > 1)
ret += (u64)be32_to_cpu(addr[pna - 2]) << 32;
return ret;
#else
return OF_BAD_ADDR;
#endif
}
Arnd
next prev parent reply other threads:[~2015-10-21 15:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 14:29 [PATCH -next] net: hisilicon: Never build on SPARC Guenter Roeck
2015-10-21 14:39 ` Arnd Bergmann
2015-10-21 14:56 ` Guenter Roeck
2015-10-21 15:33 ` David Miller
2015-10-21 15:57 ` Arnd Bergmann [this message]
2015-10-21 17:03 ` Guenter Roeck
2015-10-21 19:11 ` Arnd Bergmann
2015-10-21 21:53 ` Guenter Roeck
2015-11-06 19:16 ` Guenter Roeck
2015-11-06 20:30 ` Arnd Bergmann
2015-11-07 1:24 ` Guenter Roeck
2015-10-22 1:24 ` David Miller
2015-10-21 15:30 ` David Miller
2015-10-21 15:27 ` David Miller
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=4129407.LpDXnpSZOL@wuerfel \
--to=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--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).