From: Arnd Bergmann <arnd@arndb.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: David Miller <davem@davemloft.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 21:11:53 +0200 [thread overview]
Message-ID: <5243548.YbVhhU6W8t@wuerfel> (raw)
In-Reply-To: <5627C549.9080600@roeck-us.net>
On Wednesday 21 October 2015 10:03:05 Guenter Roeck wrote:
> >
> > 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;
>
> That suggests that sparc would need a translation after all, which
> seems to contradict what David said earlier.
No, not a translation: the value is used without any offset that
factors in the location of the bus, the above is just the shortest
possible way to read the 64-bit number from a big-endian property
of variable length.
> Anyway, if it gets that complicated, I think we should stick with
> just returning OF_BAD_ADDR. The above really suggests the need for
> an architecture specific solution.
Probably no harm in this really: the far more common
of_address_to_resource() and of_iomap() helpers are equally
broken on SPARC and we just return a runtime error for those
as well without CONFIG_OF_ADDRESS rather than breaking the build.
Arnd
next prev parent reply other threads:[~2015-10-21 19:12 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
2015-10-21 17:03 ` Guenter Roeck
2015-10-21 19:11 ` Arnd Bergmann [this message]
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=5243548.YbVhhU6W8t@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).