lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4129407.LpDXnpSZOL@wuerfel>
Date:	Wed, 21 Oct 2015 17:57:24 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	David Miller <davem@...emloft.net>
Cc:	linux@...ck-us.net, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] net: hisilicon: Never build on SPARC

On Wednesday 21 October 2015 08:33:11 David Miller wrote:
> From: Guenter Roeck <linux@...ck-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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ