Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b49d81de authored by Timur Tabi's avatar Timur Tabi Committed by Kumar Gala
Browse files

powerpc: fix warning when compiling immap_qe.h



Fix the warnings genereted by arch/powerpc/include/asm/immap_qe.h when
CONFIG_PHYS_ADDR_T_64BIT is defined:

immap_qe.h: In function 'immrbar_virt_to_phys':
immap_qe.h:472:8: warning: cast from pointer to integer of different size
immap_qe.h:472:24: warning: cast from pointer to integer of different size
immap_qe.h:473:5: warning: cast from pointer to integer of different size
immap_qe.h:473:21: warning: cast from pointer to integer of different size
immap_qe.h:474:36: warning: cast from pointer to integer of different size

Note that the QE does not support 36-bit physical addresses, so even when
CONFIG_PHYS_ADDR_T_64BIT is defined, the QE MURAM must be located below the
4GB boundary.

Signed-off-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent b2e0861e
Loading
Loading
Loading
Loading
+15 −6
Original line number Original line Diff line number Diff line
@@ -467,13 +467,22 @@ struct qe_immap {
extern struct qe_immap __iomem *qe_immr;
extern struct qe_immap __iomem *qe_immr;
extern phys_addr_t get_qe_base(void);
extern phys_addr_t get_qe_base(void);


static inline unsigned long immrbar_virt_to_phys(void *address)
/*
 * Returns the offset within the QE address space of the given pointer.
 *
 * Note that the QE does not support 36-bit physical addresses, so if
 * get_qe_base() returns a number above 4GB, the caller will probably fail.
 */
static inline phys_addr_t immrbar_virt_to_phys(void *address)
{
{
	if ( ((u32)address >= (u32)qe_immr) &&
	void *q = (void *)qe_immr;
			((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) )

		return (unsigned long)(address - (u32)qe_immr +
	/* Is it a MURAM address? */
				(u32)get_qe_base());
	if ((address >= q) && (address < (q + QE_IMMAP_SIZE)))
	return (unsigned long)virt_to_phys(address);
		return get_qe_base() + (address - q);

	/* It's an address returned by kmalloc */
	return virt_to_phys(address);
}
}


#endif /* __KERNEL__ */
#endif /* __KERNEL__ */