Skip to content

Commit

Permalink
On CONFIG_64BIT_PHYS_ADDR, pfn always fits in 'unsigned long', but
Browse files Browse the repository at this point in the history
pfn<<PAGE_SHIFT sometimes extends beyond.  The pte is big enough to hold
'long long', but the shift in pfn_pte() needs to do its calculation with
enough bits to hold the result.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent 0952e29 commit 533330b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/asm-mips/pgtable-32.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
#else
#define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT))
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
#define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
#endif
#endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) */

Expand Down

0 comments on commit 533330b

Please sign in to comment.