diff options
author | Timur Tabi <timur@freescale.com> | 2010-10-14 16:15:30 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-01-12 19:02:46 -0500 |
commit | b49d81ded47e9d01f7128fce50d224ccc2150960 (patch) | |
tree | c242c67f47d4e0f8b83337aa8c39dd62dd891dc1 /arch/powerpc | |
parent | b2e0861e51f2961954330dcafe6d148ee3ab5cff (diff) |
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/immap_qe.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/immap_qe.h b/arch/powerpc/include/asm/immap_qe.h index 4e10f508570..0edb6842b13 100644 --- a/arch/powerpc/include/asm/immap_qe.h +++ b/arch/powerpc/include/asm/immap_qe.h | |||
@@ -467,13 +467,22 @@ struct qe_immap { | |||
467 | extern struct qe_immap __iomem *qe_immr; | 467 | extern struct qe_immap __iomem *qe_immr; |
468 | extern phys_addr_t get_qe_base(void); | 468 | extern phys_addr_t get_qe_base(void); |
469 | 469 | ||
470 | static inline unsigned long immrbar_virt_to_phys(void *address) | 470 | /* |
471 | * Returns the offset within the QE address space of the given pointer. | ||
472 | * | ||
473 | * Note that the QE does not support 36-bit physical addresses, so if | ||
474 | * get_qe_base() returns a number above 4GB, the caller will probably fail. | ||
475 | */ | ||
476 | static inline phys_addr_t immrbar_virt_to_phys(void *address) | ||
471 | { | 477 | { |
472 | if ( ((u32)address >= (u32)qe_immr) && | 478 | void *q = (void *)qe_immr; |
473 | ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) ) | 479 | |
474 | return (unsigned long)(address - (u32)qe_immr + | 480 | /* Is it a MURAM address? */ |
475 | (u32)get_qe_base()); | 481 | if ((address >= q) && (address < (q + QE_IMMAP_SIZE))) |
476 | return (unsigned long)virt_to_phys(address); | 482 | return get_qe_base() + (address - q); |
483 | |||
484 | /* It's an address returned by kmalloc */ | ||
485 | return virt_to_phys(address); | ||
477 | } | 486 | } |
478 | 487 | ||
479 | #endif /* __KERNEL__ */ | 488 | #endif /* __KERNEL__ */ |