BLACKFIN: cleanup - use _AC macro to define PAGE_SIZE
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/4 AVR32: cleanup - use _AC macro to define PAGE_SIZE
---
page.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
include/asm-avr32/page.h +3 -5
@@ -10,13 +10,11 @@#ifdef __KERNEL__ +#include <linux/const.h> +/* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 -#ifdef __ASSEMBLY__ -#define PAGE_SIZE (1 << PAGE_SHIFT) -#else -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#endif +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1))#define PTE_MASK PAGE_MASK
Haavard Skinnemoen
AppliedRe: [patch 1/4] AVR32: cleanup - use _AC macro to define PAGE_SIZE
[removed bogus @atmel.co address from Cc]
Quoted 1 line · On Sun, 03 Feb 2008 14:22:18 +0300 Cyrill Gorcunov <[email protected]> wrote:
Signed-off-by Cyrill Gorcunov <[email protected]>
Applied, thanks.
I found myself having to grep through include/linux to figure out what this _AC macro was really all about, so I added this to the description:
PAGE_SIZE is used both from assembly and C code. We want to have type specifiers when using it from C, but this will make the assembler confused, so we need to make it conditional.
This is exactly what the _AC macro is for, so using it allows us to get rid of a few lines of cpp noise.
My first thought was "Autoconf", and it sent shivers down my spine ;-)
Haavard
Re: [patch 1/4] AVR32: cleanup - use _AC macro to define PAGE_SIZE
[Haavard Skinnemoen - Sun, Feb 03, 2008 at 02:25:06PM +0100]
| [removed bogus @atmel.co address from Cc] | | On Sun, 03 Feb 2008 14:22:18 +0300 | Cyrill Gorcunov <[email protected]> wrote: | | > Signed-off-by: Cyrill Gorcunov <[email protected]> | | Applied, thanks. | | I found myself having to grep through include/linux to figure out what | this _AC macro was really all about, so I added this to the description: | | PAGE_SIZE is used both from assembly and C code. We want to have type | specifiers when using it from C, but this will make the assembler | confused, so we need to make it conditional. | | This is exactly what the _AC macro is for, so using it allows us to | get rid of a few lines of cpp noise. | | My first thought was "Autoconf", and it sent shivers down my spine ;-) | | Haavard |
Thanks, Haavard. (btw, really good joke about Autoconf ;-)
- Cyrill -
PATCH 2/4 BLACKFIN: cleanup - use _AC macro to define PAGE_SIZE
In reply to a message not in the archive---
page.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
include/asm-blackfin/page.h +3 -5
@@ -1,14 +1,12 @@#ifndef _BLACKFIN_PAGE_H#define _BLACKFIN_PAGE_H +#include <linux/const.h> +/* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 -#ifdef __ASSEMBLY__ -#define PAGE_SIZE (1 << PAGE_SHIFT) -#else -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#endif +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1))#ifdef __KERNEL__
PATCH 3/4 FRV: cleanup - use _AC macro to define PAGE_SIZE
In reply to a message not in the archive---
mem-layout.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
include/asm-frv/mem-layout.h +3 -7
@@ -12,6 +12,8 @@#ifndef _ASM_MEM_LAYOUT_H#define _ASM_MEM_LAYOUT_H +#include <linux/const.h> +#ifndef __ASSEMBLY__#define __UL (X ) ((unsigned long) (X))#else
@@ -22,13 +24,7 @@* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 14 - -#ifndef __ASSEMBLY__ -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#else -#define PAGE_SIZE (1 << PAGE_SHIFT) -#endif - +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1))/*****************************************************************************/
PATCH 4/4 SPARC: cleanup - use _AC macro to define PAGE_SIZE
In reply to a message not in the archive---
page.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
include/asm-sparc/page.h +4 -7
@@ -10,18 +10,15 @@#ifdef __KERNEL__ +#include <linux/const.h> +#ifdef CONFIG_SUN4 #define PAGE_SHIFT 13#else #define PAGE_SHIFT 12#endif -#ifndef __ASSEMBLY__ -/* I have my suspicions... -DaveM */ -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#else -#define PAGE_SIZE (1 << PAGE_SHIFT) -#endif -#define PAGE_MASK (~(PAGE_SIZE-1)) +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1))#include <asm/btfixup.h>