From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Tue, 29 Mar 2016 17:46:14 +0200 Subject: [U-Boot] [PATCH 3/6] arm: Allow u32 as addrs for readX/writeX In-Reply-To: <1459265351-19812-4-git-send-email-agraf@suse.de> References: <1459265351-19812-1-git-send-email-agraf@suse.de> <1459265351-19812-4-git-send-email-agraf@suse.de> Message-ID: <56FAA346.10002@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 03/29/2016 05:29 PM, Alexander Graf wrote: > Gcc warns when you try to cast a u32 value into a pointer directly. When someone > calls functions like readl or writel, he's pretty sure the parameter he passes > is an address though, so we can as well cast it for him. > > This makes porting 32bit code to armv8 easier, as it means we don't have to > touch common board code with explicit casts or UL redefines. > > Signed-off-by: Alexander Graf Albert can we have your ack for this please ? It is probably easiest if I take the entire series upstream through the u-boot-sunxi tree. Regards, Hans > --- > arch/arm/include/asm/io.h | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h > index 75773bd..b85f4d7 100644 > --- a/arch/arm/include/asm/io.h > +++ b/arch/arm/include/asm/io.h > @@ -67,15 +67,15 @@ static inline phys_addr_t virt_to_phys(void * vaddr) > * read/writes. We define __arch_*[bl] here, and leave __arch_*w > * to the architecture specific code. > */ > -#define __arch_getb(a) (*(volatile unsigned char *)(a)) > -#define __arch_getw(a) (*(volatile unsigned short *)(a)) > -#define __arch_getl(a) (*(volatile unsigned int *)(a)) > -#define __arch_getq(a) (*(volatile unsigned long long *)(a)) > - > -#define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v)) > -#define __arch_putw(v,a) (*(volatile unsigned short *)(a) = (v)) > -#define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) > -#define __arch_putq(v,a) (*(volatile unsigned long long *)(a) = (v)) > +#define __arch_getb(a) (*(volatile unsigned char *)(long)(a)) > +#define __arch_getw(a) (*(volatile unsigned short *)(long)(a)) > +#define __arch_getl(a) (*(volatile unsigned int *)(long)(a)) > +#define __arch_getq(a) (*(volatile unsigned long long *)(long)(a)) > + > +#define __arch_putb(v,a) (*(volatile unsigned char *)(long)(a) = (v)) > +#define __arch_putw(v,a) (*(volatile unsigned short *)(long)(a) = (v)) > +#define __arch_putl(v,a) (*(volatile unsigned int *)(long)(a) = (v)) > +#define __arch_putq(v,a) (*(volatile unsigned long long *)(long)(a) = (v)) > > static inline void __raw_writesb(unsigned long addr, const void *data, > int bytelen) >