android_kernel_xiaomi_sm8350/drivers/media/video
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
..
au0828 V4L/DVB (8043): au0828: add support for additional USB device id's 2008-06-26 15:58:52 -03:00
bt8xx v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
cpia2 cpia2: use request_firmware() 2008-07-14 14:43:28 -07:00
cx18 V4L/DVB (8414): videodev/cx18: fix get_index bug and error-handling lock-ups 2008-07-20 07:29:27 -03:00
cx88 v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
cx23885 V4L/DVB (8393): media/video: Fix depencencies for VIDEOBUF 2008-07-20 07:28:54 -03:00
cx25840 V4L/DVB (8377): ivtv/cx18: ensure the default control values are correct 2008-07-20 07:28:07 -03:00
em28xx v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
et61x251
gspca V4L/DVB (8415): gspca: Infinite loop in i2c_w() of etoms. 2008-07-20 07:29:33 -03:00
ivtv V4L/DVB (8379): saa7127: Make device detection optional 2008-07-20 07:28:17 -03:00
ovcamchip V4L/DVB (8245): ovcamchip: Delete stray I2C bus ID 2008-07-20 07:18:34 -03:00
pvrusb2 PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
pwc v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
saa7134 V4L/DVB (8395): saa7134: Fix Kbuild dependency of ir-kbd-i2c 2008-07-20 07:29:03 -03:00
sn9c102 V4L/DVB (8374): gspca: No conflict of 0c45:6011 with the sn9c102 driver. 2008-07-20 07:27:52 -03:00
usbvideo vicam: use request_firmware() 2008-07-14 14:44:32 -07:00
usbvision v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
uvc PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
zc0301
adv7170.c
adv7175.c
arv.c
bt819.c V4L/DVB (8316): bt819: Fix a debug message 2008-07-20 07:24:26 -03:00
bt856.c
bt866.c
btcx-risc.c V4L/DVB (7965): annotate bcx_riscmem 2008-06-05 06:35:51 -03:00
btcx-risc.h V4L/DVB (7965): annotate bcx_riscmem 2008-06-05 06:35:51 -03:00
bw-qcam.c
bw-qcam.h
c-qcam.c
cafe_ccic-regs.h
cafe_ccic.c V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacks 2008-07-20 07:07:32 -03:00
compat_ioctl32.c V4L/DVB (7942): Hardware frequency seek ioctl interface 2008-07-20 07:07:12 -03:00
cpia_pp.c
cpia_usb.c
cpia.c
cpia.h
cs53l32a.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
cs5345.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
cs8420.h
cx2341x.c V4L/DVB (8377): ivtv/cx18: ensure the default control values are correct 2008-07-20 07:28:07 -03:00
dabusb.c dabusb: use request_firmware() 2008-07-14 14:44:21 -07:00
dabusb.h
dpc7146.c
font.h
hexium_gemini.c
hexium_orion.c
ibmmpeg2.h
indycam.c
indycam.h
ir-kbd-i2c.c V4L/DVB (8395): saa7134: Fix Kbuild dependency of ir-kbd-i2c 2008-07-20 07:29:03 -03:00
Kconfig V4L/DVB (8397): video: convert select VIDEO_ZORAN_ZR36060 into depends on 2008-07-20 07:29:12 -03:00
ks0127.c
ks0127.h
m52790.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
Makefile V4L/DVB (8343): soc_camera_platform: Add SoC Camera Platform driver 2008-07-20 07:25:49 -03:00
meye.c V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacks 2008-07-20 07:07:32 -03:00
meye.h
msp3400-driver.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
msp3400-driver.h
msp3400-kthreads.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
mt9m001.c
mt9v022.c V4L/DVB (8143): Fix compilation for mt9v022 2008-07-20 07:14:00 -03:00
mxb.c
mxb.h
ov511.c
ov511.h
ov7670.c V4L/DVB (8381): ov7670: fix compile warnings 2008-07-20 07:28:27 -03:00
planb.c
planb.h
pms.c
pxa_camera.c V4L/DVB (8338): soc_camera: Move spinlocks 2008-07-20 07:25:21 -03:00
s2255drv.c V4L/DVB (8317): Sensoray 2255 V4l driver checkpatch fixes 2008-07-20 07:24:32 -03:00
saa711x_regs.h
saa717x.c
saa5246a.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
saa5246a.h
saa5249.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
saa6588.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
saa7110.c
saa7111.c
saa7114.c
saa7115.c V4L/DVB (8380): saa7115: use saa7115_auto instead of saa711x as the autodetect driver name. 2008-07-20 07:28:23 -03:00
saa7121.h
saa7127.c V4L/DVB (8379): saa7127: Make device detection optional 2008-07-20 07:28:17 -03:00
saa7146.h
saa7146reg.h
saa7185.c
saa7191.c
saa7191.h
saa7196.h
se401.c
se401.h
sh_mobile_ceu_camera.c V4L/DVB (8410): sh_mobile_ceu_camera: fix 64-bit compiler warnings 2008-07-20 07:29:17 -03:00
soc_camera_platform.c V4L/DVB (8343): soc_camera_platform: Add SoC Camera Platform driver 2008-07-20 07:25:49 -03:00
soc_camera.c V4L/DVB (8338): soc_camera: Move spinlocks 2008-07-20 07:25:21 -03:00
stk-sensor.c
stk-webcam.c V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacks 2008-07-20 07:07:32 -03:00
stk-webcam.h
stradis.c
stv680.c
stv680.h
tcm825x.c V4L/DVB (7897): TCM825x: Include invertation of image mirroring in configuration 2008-07-20 07:06:01 -03:00
tcm825x.h V4L/DVB (7897): TCM825x: Include invertation of image mirroring in configuration 2008-07-20 07:06:01 -03:00
tda7432.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
tda9840.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
tda9840.h
tda9875.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
tea6415c.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
tea6415c.h
tea6420.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
tea6420.h
tlv320aic23b.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
tuner-3036.c
tuner-core.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
tvaudio.c V4L/DVB (8246): tvaudio: Stop I2C driver ID abuse 2008-07-20 07:18:38 -03:00
tveeprom.c
tvp5150_reg.h
tvp5150.c
upd64031a.c
upd64083.c
v4l1-compat.c
v4l2-common.c
v4l2-int-device.c
videobuf-core.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
videobuf-dma-contig.c V4L/DVB (8411): videobuf-dma-contig.c: fix 64-bit build for pre-2.6.24 kernels 2008-07-20 07:29:22 -03:00
videobuf-dma-sg.c V4L/DVB (8340): videobuf: Fix gather spelling 2008-07-20 07:25:32 -03:00
videobuf-dvb.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
videobuf-vmalloc.c V4L/DVB (8340): videobuf: Fix gather spelling 2008-07-20 07:25:32 -03:00
videocodec.c
videocodec.h
videodev.c V4L/DVB (8414): videodev/cx18: fix get_index bug and error-handling lock-ups 2008-07-20 07:29:27 -03:00
vino.c
vino.h
vivi.c V4L/DVB (8024): vivi: rename MODULE_NAME macro to VIVI_MODULE_NAME to avoid namespace conflicts 2008-07-20 07:09:18 -03:00
vp27smpx.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
vpx3220.c
w9966.c
w9968cf_decoder.h
w9968cf_vpp.h
w9968cf.c
w9968cf.h
wm8739.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
wm8775.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
zoran_card.c V4L/DVB (8315): zr36067: Delete dead code 2008-07-20 07:24:20 -03:00
zoran_card.h
zoran_device.c V4L/DVB (7968): zoran: endianness annotations 2008-06-05 06:35:52 -03:00
zoran_device.h
zoran_driver.c V4L/DVB (8134): zoran annotations and fixes 2008-07-20 07:13:39 -03:00
zoran_procfs.c
zoran_procfs.h
zoran.h V4L/DVB (7968): zoran: endianness annotations 2008-06-05 06:35:52 -03:00
zr364xx.c V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacks 2008-07-20 07:07:32 -03:00
zr36016.c
zr36016.h
zr36050.c
zr36050.h
zr36057.h
zr36060.c
zr36060.h