Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1253135

Re: [PATCH -next] net: hisilicon: Never build on SPARC

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH -next] net: hisilicon: Never build on SPARC
Date 2015-10-21 21:20 +0200
Message-ID <qm75v-3ST-9@gated-at.bofh.it> (permalink)
References <qm2yT-5Ck-23@gated-at.bofh.it> <qm3XX-7C9-7@gated-at.bofh.it> <qm53H-ZN-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH -next] net: hisilicon: Never build on SPARC Guenter Roeck <linux@roeck-us.net> - 2015-10-21 16:30 +0200
  Re: [PATCH -next] net: hisilicon: Never build on SPARC Arnd Bergmann <arnd@arndb.de> - 2015-10-21 16:40 +0200
    Re: [PATCH -next] net: hisilicon: Never build on SPARC Guenter Roeck <linux@roeck-us.net> - 2015-10-21 17:00 +0200
      Re: [PATCH -next] net: hisilicon: Never build on SPARC David Miller <davem@davemloft.net> - 2015-10-21 17:20 +0200
        Re: [PATCH -next] net: hisilicon: Never build on SPARC Arnd Bergmann <arnd@arndb.de> - 2015-10-21 18:00 +0200
          Re: [PATCH -next] net: hisilicon: Never build on SPARC Guenter Roeck <linux@roeck-us.net> - 2015-10-21 19:10 +0200
            Re: [PATCH -next] net: hisilicon: Never build on SPARC Arnd Bergmann <arnd@arndb.de> - 2015-10-21 21:20 +0200
              Re: [PATCH -next] net: hisilicon: Never build on SPARC Guenter Roeck <linux@roeck-us.net> - 2015-10-22 00:00 +0200
            Re: [PATCH -next] net: hisilicon: Never build on SPARC David Miller <davem@davemloft.net> - 2015-10-22 03:10 +0200
    Re: [PATCH -next] net: hisilicon: Never build on SPARC David Miller <davem@davemloft.net> - 2015-10-21 17:20 +0200
  Re: [PATCH -next] net: hisilicon: Never build on SPARC David Miller <davem@davemloft.net> - 2015-10-21 17:20 +0200

csiph-web