From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932305AbbJUTME (ORCPT ); Wed, 21 Oct 2015 15:12:04 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:54576 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755291AbbJUTMB (ORCPT ); Wed, 21 Oct 2015 15:12:01 -0400 From: Arnd Bergmann To: Guenter Roeck Cc: David Miller , 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 Message-ID: <5243548.YbVhhU6W8t@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <5627C549.9080600@roeck-us.net> References: <1445437773-23261-1-git-send-email-linux@roeck-us.net> <4129407.LpDXnpSZOL@wuerfel> <5627C549.9080600@roeck-us.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:NMjlUvID5QpEWqNsKKy2I9M4rLMSxN83vQhkimE/MVi/lrEJSLD oiOyoRLP5MmVHZ7W14MM/gwjiltRlKxypIAm1zGvxsnPkd//jO3STkwRkt+8FCcDWBvParh 9cSZDTXxOo4NFjDc9o9i/IRDM/JReWwEktxKMuhURaDnCihph9of1Oe4Y1iGhLA0vvhf3un WUXUULV0pZ0hKDyU3DBGg== X-UI-Out-Filterresults: notjunk:1;V01:K0:2ydByvWh7z4=:4wgXJ6aWCyI5TjsITe5smV UT+RwP4sd867XnVukbgX3eSHrXOJWbIZgYge2PXt758SohfPqS8s3cZvXMxlaxhh2DAdL3PNL toev2hyaNnI7dnRe3RpHMaxeLItidtq5Q6kq7yBCeFtypszDNnzmHCV1e3MKVmxYy5ra5PJBx VtezlvZqwd2hJV7FnXBSiqwq8u3p5ZHXdc4dFBU6YrJTmzcCUpY9dovpMkFOUybkoCsN9FP1A YZ0U9vtiJzwSAQZmwv9bjsLS2X0MYh2jNAfGdTZzRbFiry5uguvJzTFXWzFa9wOtcmfnGYMBC xCvXg5df6oNX2j50W8ERShX6Cbfo/qijKTsnNt9pfgf+mS0adepRqrCtu4xZVW6t824zp2tIS EY8KrPdlGEcz4ALByxxv2i/8yE3aSLaiqrcWCQJuj1xId3IrepnLwpQTT1NBb2mT5a1YG2jrW /dX5V2VIQCvEkKgb6BQ3Bs3aR1Rt7ibhCdHXb+uAgUBHGOFOkenasnxzPcKkg2a4R2DXxq6D1 0Z1NGl9+KVCEzWXA2GicHkbniy9mFGmf3I2ANPzNpNN8/zI+ywK0azYHWsZsaA8RIInSL4Uob xnRCFuG8oRnDrW596uwauVB3m3OLzD3I8OPjdtXDofgF63b3qJe2De2JYcDGdIQqDwydZ/tV2 xZGbGqwEc5XrhdrgQYHNuvHpGIAnZsPZ1XWM1ekUyVGj5mnTDDl/aVhAgod4sg1miuTeFCMaY MEyB2QZSJT1mWbED Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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