janitor patch for _PAGE_SIZE_*
I was looking at the ia64 port and noticed the _PAGE_SIZE* definitions are inconsistent with other uses of this term in the kernel.
This patch just renames them to _PAGE_SHIFT. It only touches ia64 code.
arch/ia64/mm/tlb.c +12 -12
@@ -23,16 +23,16 @@#include <asm/tlbflush.h> #define SUPPORTED_PGBITS ( \ - 1 << _PAGE_SIZE_256M | \ - 1 << _PAGE_SIZE_64M | \ - 1 << _PAGE_SIZE_16M | \ - 1 << _PAGE_SIZE_4M | \ - 1 << _PAGE_SIZE_1M | \ - 1 << _PAGE_SIZE_256K | \ - 1 << _PAGE_SIZE_64K | \ - 1 << _PAGE_SIZE_16K | \ - 1 << _PAGE_SIZE_8K | \ - 1 << _PAGE_SIZE_4K ) + 1 << _PAGE_SHIFT_256M | \ + 1 << _PAGE_SHIFT_64M | \ + 1 << _PAGE_SHIFT_16M | \ + 1 << _PAGE_SHIFT_4M | \ + 1 << _PAGE_SHIFT_1M | \ + 1 << _PAGE_SHIFT_256K | \ + 1 << _PAGE_SHIFT_64K | \ + 1 << _PAGE_SHIFT_16K | \ + 1 << _PAGE_SHIFT_8K | \ + 1 << _PAGE_SHIFT_4K )struct ia64_ctx ia64_ctx = { .lock =SPIN_LOCK_UNLOCKED ,
@@ -155,8 +155,8 @@ nbits =ia64_fls (size +0xfff );if (((1UL << nbits) &SUPPORTED_PGBITS ) =0 ) { -if (nbits > _PAGE_SIZE_256M) - nbits = _PAGE_SIZE_256M; +if (nbits > _PAGE_SHIFT_256M) + nbits = _PAGE_SHIFT_256M;else /* * Some page sizes are not implemented in the
include/asm-ia64/pgtable.h +13 -13
@@ -65,16 +65,16 @@#define _PFN_MASK _PAGE_PPN_MASK#define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_A | _PAGE_D) -#define _PAGE_SIZE_4K 12 -#define _PAGE_SIZE_8K 13 -#define _PAGE_SIZE_16K 14 -#define _PAGE_SIZE_64K 16 -#define _PAGE_SIZE_256K 18 -#define _PAGE_SIZE_1M 20 -#define _PAGE_SIZE_4M 22 -#define _PAGE_SIZE_16M 24 -#define _PAGE_SIZE_64M 26 -#define _PAGE_SIZE_256M 28 +#define _PAGE_SHIFT_4K 12 +#define _PAGE_SHIFT_8K 13 +#define _PAGE_SHIFT_16K 14 +#define _PAGE_SHIFT_64K 16 +#define _PAGE_SHIFT_256K 18 +#define _PAGE_SHIFT_1M 20 +#define _PAGE_SHIFT_4M 22 +#define _PAGE_SHIFT_16M 24 +#define _PAGE_SHIFT_64M 26 +#define _PAGE_SHIFT_256M 28#define __ACCESS_BITS _PAGE_ED | _PAGE_A | _PAGE_P | _PAGE_MA_WB#define __DIRTY_BITS_NO_ED _PAGE_A | _PAGE_P | _PAGE_D | _PAGE_MA_WB
@@ -475,15 +475,15 @@* know... */ #if defined(CONFIG_IA64_GRANULE_64MB ) -# define IA64_GRANULE_SHIFT _PAGE_SIZE_64M +# define IA64_GRANULE_SHIFT _PAGE_SHIFT_64M#elif defined(CONFIG_IA64_GRANULE_16MB ) -# define IA64_GRANULE_SHIFT _PAGE_SIZE_16M +# define IA64_GRANULE_SHIFT _PAGE_SHIFT_16M#endif #define IA64_GRANULE_SIZE (1 << IA64_GRANULE_SHIFT)/* * log2() of the page size we use to map the kernel image (IA64_TR_KERNEL): */ -#define KERNEL_TR_PAGE_SHIFT _PAGE_SIZE_64M +#define KERNEL_TR_PAGE_SHIFT _PAGE_SHIFT_64M#define KERNEL_TR_PAGE_SIZE (1 << KERNEL_TR_PAGE_SHIFT)#define KERNEL_TR_PAGE_NUM ((KERNEL_START - PAGE_OFFSET) / KERNEL_TR_PAGE_SIZE)
Signature · 1 line
Martin
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Martin Pool
Martin> I was looking at the ia64 port and noticed the _PAGE_SIZE* Martin> definitions are inconsistent with other uses of this term in Martin> the kernel.
Martin> This patch just renames them to _PAGE_SHIFT. It only touches ia64 Martin> code.
I'm not going to apply this one for the following reason: those macros actually are page-size _codes_ for the PTEs. Yes, the codes happen to be equal to the log2() of the page-size, but this isn't necessarily so. It's probably unlikely this will ever change, but unless it's nailed down by the architecture somewhere (I don't think it is), I'd like to leave that distinction. Subtle as it may be.
--david