linux/drivers/video/omap
Andrea Righi 27ac792ca0 PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures
On 32-bit architectures PAGE_ALIGN() truncates 64-bit values to the 32-bit
boundary. For example:

	u64 val = PAGE_ALIGN(size);

always returns a value < 4GB even if size is greater than 4GB.

The problem resides in PAGE_MASK definition (from include/asm-x86/page.h for
example):

#define PAGE_SHIFT      12
#define PAGE_SIZE       (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK       (~(PAGE_SIZE-1))
...
#define PAGE_ALIGN(addr)       (((addr)+PAGE_SIZE-1)&PAGE_MASK)

The "~" is performed on a 32-bit value, so everything in "and" with
PAGE_MASK greater than 4GB will be truncated to the 32-bit boundary.
Using the ALIGN() macro seems to be the right way, because it uses
typeof(addr) for the mask.

Also move the PAGE_ALIGN() definitions out of include/asm-*/page.h in
include/linux/mm.h.

See also lkml discussion: http://lkml.org/lkml/2008/6/11/237

[akpm@linux-foundation.org: fix drivers/media/video/uvc/uvc_queue.c]
[akpm@linux-foundation.org: fix v850]
[akpm@linux-foundation.org: fix powerpc]
[akpm@linux-foundation.org: fix arm]
[akpm@linux-foundation.org: fix mips]
[akpm@linux-foundation.org: fix drivers/media/video/pvrusb2/pvrusb2-dvb.c]
[akpm@linux-foundation.org: fix drivers/mtd/maps/uclinux.c]
[akpm@linux-foundation.org: fix powerpc]
Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:21 -07:00
..
Kconfig fb menu: fix FB_OMAP dependencies so that menu is displayed correctly 2007-10-30 08:06:55 -07:00
Makefile OMAP: LCD panel support for the Siemens SX1 mobile phone 2007-07-17 10:23:15 -07:00
blizzard.c Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
dispc.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
dispc.h OMAP: add TI OMAP2 internal display controller support. 2007-07-17 10:23:13 -07:00
hwa742.c Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
lcd_h3.c i2c/tps65010: move header to <linux/i2c/...> 2008-01-27 18:14:49 +01:00
lcd_h4.c OMAP: LCD panel support for the TI OMAP H4 board 2007-07-17 10:23:14 -07:00
lcd_inn1510.c OMAP: LCD panel support for the TI OMAP1510 Innovator board 2007-07-17 10:23:14 -07:00
lcd_inn1610.c Make the pr_*() family of macros in kernel.h complete 2007-10-17 08:42:57 -07:00
lcd_osk.c OMAP: LCD panel support for the TI OMAP OSK board 2007-07-17 10:23:14 -07:00
lcd_palmte.c OMAP: LCD panel support for the Palm Tungsten E 2007-07-17 10:23:14 -07:00
lcd_palmtt.c OMAP: LCD panel support for Palm Tungsten|T 2007-07-17 10:23:14 -07:00
lcd_palmz71.c OMAP: LCD panel support for the Palm Zire71 2007-07-17 10:23:14 -07:00
lcd_sx1.c OMAP: LCD panel support for the Siemens SX1 mobile phone 2007-07-17 10:23:15 -07:00
lcdc.c drivers/video/: Spelling fixes 2008-02-03 17:31:49 +02:00
lcdc.h
omapfb_main.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
rfbi.c Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
sossi.c OMAP: add TI OMAP1 external LCD controller support - SoSSI 2007-07-17 10:23:14 -07:00