From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934451AbdJQIYR (ORCPT ); Tue, 17 Oct 2017 04:24:17 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:41952 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753474AbdJQIYO (ORCPT ); Tue, 17 Oct 2017 04:24:14 -0400 Date: Tue, 17 Oct 2017 01:24:13 -0700 From: Christoph Hellwig To: Jim Quinlan Cc: linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-mips@linux-mips.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, Florian Fainelli , Ralf Baechle , Catalin Marinas , Will Deacon , Bjorn Helgaas , Rob Herring , Mark Rutland , Gregory Fong , Kevin Cernekee , Brian Norris Subject: Re: [PATCH 1/9] SOC: brcmstb: add memory API Message-ID: <20171017082413.GA10574@infradead.org> References: <1507761269-7017-1-git-send-email-jim2101024@gmail.com> <1507761269-7017-2-git-send-email-jim2101024@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1507761269-7017-2-git-send-email-jim2101024@gmail.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +/* Macros to help extract property data */ > +#define U8TOU32(b, offs) \ > + ((((u32)b[0 + offs] << 0) & 0x000000ff) | \ > + (((u32)b[1 + offs] << 8) & 0x0000ff00) | \ > + (((u32)b[2 + offs] << 16) & 0x00ff0000) | \ > + (((u32)b[3 + offs] << 24) & 0xff000000)) Please us helpers like get_unaligned_le32 instead opencoding them. > +#define DT_PROP_DATA_TO_U32(b, offs) (fdt32_to_cpu(U8TOU32(b, offs))) And together with this it looks really whacky. So you're converting from le to native first and then do another conversion from be to cpu? Something doesn't work out here. > +/* -------------------- Functions -------------------- */ Please remove pointless comments like this one. > + > +/* > + * If the DT nodes are handy, determine which MEMC holds the specified > + * physical address. > + */ > +#ifdef CONFIG_ARCH_BRCMSTB > +int __brcmstb_memory_phys_addr_to_memc(phys_addr_t pa, void __iomem *base) Please move this into the arm arch code. > +#elif defined(CONFIG_MIPS) And this into the mips arch code. > +EXPORT_SYMBOL(brcmstb_memory_phys_addr_to_memc); > +EXPORT_SYMBOL(brcmstb_memory_memc_size); Why is this exported?