From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753186AbbJVBIH (ORCPT ); Wed, 21 Oct 2015 21:08:07 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:49521 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655AbbJVBIF (ORCPT ); Wed, 21 Oct 2015 21:08:05 -0400 Date: Wed, 21 Oct 2015 18:24:30 -0700 (PDT) Message-Id: <20151021.182430.565026583970438038.davem@davemloft.net> To: linux@roeck-us.net Cc: arnd@arndb.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] net: hisilicon: Never build on SPARC From: David Miller In-Reply-To: <5627C549.9080600@roeck-us.net> References: <20151021.083311.2193871332944250588.davem@davemloft.net> <4129407.LpDXnpSZOL@wuerfel> <5627C549.9080600@roeck-us.net> X-Mailer: Mew version 6.4 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 21 Oct 2015 18:08:04 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guenter Roeck Date: Wed, 21 Oct 2015 10:03:05 -0700 > On 10/21/2015 08:57 AM, Arnd Bergmann wrote: >> On Wednesday 21 October 2015 08:33:11 David Miller wrote: >>> From: Guenter Roeck >>> 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; > > That suggests that sparc would need a translation after all, which > seems to contradict what David said earlier. It's not being translated, the code above is just figuring out what size the object in the property is.