linux/drivers/scsi
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
..
aacraid Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
aic7xxx scsi: fix integer as NULL pointer warnings 2008-04-28 17:31:13 -07:00
aic7xxx_old
aic94xx aic94xx: treat firmware data as const 2008-07-10 14:26:15 +01:00
arcmsr
arm [ARM] rpc: acornscsi: update to new style ecard driver 2008-07-03 14:25:57 +01:00
device_handler scsi_dh: Verify "dev" is a sdev before accessing it. 2008-07-16 17:54:21 -07:00
dpt [SCSI] dpt_i2o: Add PROC_IA64 define 2008-06-15 11:12:20 -05:00
ibmvscsi [SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver 2008-07-12 08:22:32 -05:00
libsas
lpfc [SCSI] lpfc 8.2.7 : Update version to 8.2.7 2008-07-12 08:22:29 -05:00
megaraid megaraid: BKL pushdown 2008-06-20 14:05:58 -06:00
pcmcia
qla2xxx [SCSI] qla2xxx: Update version number to 8.02.01-k4. 2008-05-30 12:21:12 -05:00
qla4xxx [SCSI] iscsi: remove session/conn_data_size from iscsi_transport 2008-07-12 08:22:16 -05:00
sym53c8xx_2 [SCSI] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of 2008-07-12 08:22:37 -05:00
.gitignore
3w-9xxx.c Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
3w-9xxx.h
3w-xxxx.c Add a bunch of cycle_kernel_lock() calls 2008-06-20 14:05:53 -06:00
3w-xxxx.h
53c700_d.h_shipped
53c700.c [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer 2008-05-02 10:18:22 -05:00
53c700.h
53c700.scr
a100u2w.c Don't crash on IOMMU overflow in A100U2W driver 2008-07-15 14:30:56 -07:00
a100u2w.h
a2091.c
a2091.h
a3000.c
a3000.h
a4000t.c
advansys.c
aha152x.c scsi: fix integer as NULL pointer warning 2008-05-23 08:11:07 -07:00
aha152x.h
aha1542.c [SCSI] aha1542: minor irq handler cleanups 2008-04-27 12:19:55 -05:00
aha1542.h
aha1740.c
aha1740.h
aic7xxx_old.c
atari_dma_emul.c
atari_NCR5380.c
atari_scsi.c
atari_scsi.h
atp870u.c scsi: fix integer as NULL pointer warning 2008-05-23 08:11:07 -07:00
atp870u.h
BusLogic.c
BusLogic.h
bvme6000_scsi.c
ch.c Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
constants.c [SCSI] add support for variable length extended commands 2008-05-02 11:33:25 -05:00
dc395x.c
dc395x.h
dmx3191d.c
dpt_i2o.c device create: scsi: convert device_create to device_create_drvdata 2008-07-21 21:54:44 -07:00
dpti.h drivers/scsi/dpt_i2o.c: fix build on alpha 2008-05-08 10:46:56 -07:00
dtc.c
dtc.h
eata_generic.h
eata_pio.c
eata_pio.h
eata.c
esp_scsi.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
esp_scsi.h [SCSI] esp: tidy up target reference counting 2008-06-25 12:36:13 -05:00
fd_mcs.c
fdomain.c scsi: fix integer as NULL pointer warnings 2008-04-28 17:31:13 -07:00
fdomain.h
FlashPoint.c [SCSI] FlashPoint: fix off-by-one errors 2008-04-27 12:19:55 -05:00
g_NCR5380_mmio.c
g_NCR5380.c
g_NCR5380.h
gdth_ioctl.h
gdth_proc.c
gdth_proc.h
gdth.c gdth: cdev lock_kernel() pushdown 2008-06-20 14:05:49 -06:00
gdth.h
gvp11.c
gvp11.h
hosts.c driver core: remove KOBJ_NAME_LEN define 2008-07-21 21:54:52 -07:00
hptiop.c scsi: fix integer as NULL pointer warning 2008-05-23 08:11:07 -07:00
hptiop.h
ibmmca.c
ide-scsi.c ide-scsi: convert to using the new atapi_flags 2008-07-23 19:56:01 +02:00
imm.c
imm.h
in2000.c
in2000.h
initio.c [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer 2008-05-02 10:18:22 -05:00
initio.h
ipr.c [SCSI] ipr: Fix HDIO_GET_IDENTITY oops for SATA devices 2008-07-11 13:45:48 -05:00
ipr.h
ips.c
ips.h
iscsi_tcp.c [SCSI] libiscsi, iscsi_tcp, ib_iser: fix setting of can_queue with old tools. 2008-07-12 08:22:29 -05:00
iscsi_tcp.h [SCSI] iscsi_tcp: handle iscsi_cmd_task rename 2008-07-12 08:22:20 -05:00
jazz_esp.c [SCSI] jazz_esp, sgiwd93, sni_53c710, sun3x_esp: fix platform driver hotplug/coldplug 2008-04-27 12:33:04 -05:00
Kconfig [SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver 2008-07-12 08:22:32 -05:00
lasi700.c
libiscsi.c [SCSI] libiscsi, iscsi_tcp, ib_iser: fix setting of can_queue with old tools. 2008-07-12 08:22:29 -05:00
libsrp.c
mac53c94.c
mac53c94.h
mac_esp.c MODULE_LICENSE expects "GPL v2", not "GPLv2" 2008-05-21 16:56:00 -07:00
mac_scsi.c
mac_scsi.h
Makefile [SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver 2008-07-12 08:22:32 -05:00
megaraid.c Add a bunch of cycle_kernel_lock() calls 2008-06-20 14:05:53 -06:00
megaraid.h
mesh.c [SCSI] SCSI: remove dev->power.power_state from mesh driver 2008-06-05 09:23:44 -05:00
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvsas.c drivers/scsi/mvsas.c: fix printk warnings 2008-05-01 08:04:03 -07:00
ncr53c8xx.c drivers/scsi/ncr53c8xx.c: fix warning 2008-05-01 08:04:02 -07:00
ncr53c8xx.h
NCR53c406a.c
NCR5380.c
NCR5380.h
NCR_D700.c
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
nsp32_debug.c
nsp32_io.h
nsp32.c
nsp32.h
osst_detect.h
osst_options.h
osst.c Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
osst.h
pas16.c
pas16.h
ppa.c
ppa.h
ps3rom.c
ql1040_fw.h
ql1280_fw.h
ql12160_fw.h
qla1280.c scsi: fix integer as NULL pointer warning 2008-05-23 08:11:07 -07:00
qla1280.h
qlogicfas408.c
qlogicfas408.h
qlogicfas.c
qlogicpti_asm.c
qlogicpti.c
qlogicpti.h
raid_class.c
script_asm.pl
scsi_debug.c [SCSI] scsi_debug: add support for rotation speed 2008-07-12 08:22:30 -05:00
scsi_devinfo.c proc: switch /proc/scsi/device_info to seq_file interface 2008-04-29 08:06:19 -07:00
scsi_error.c [SCSI] scsi_dh: add infrastructure for SCSI Device Handlers 2008-06-05 09:23:40 -05:00
scsi_ioctl.c
scsi_lib_dma.c
scsi_lib.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
scsi_logging.h
scsi_module.c
scsi_netlink.c
scsi_priv.h
scsi_proc.c scsi: use non-racy method for proc entries creation 2008-04-29 08:06:21 -07:00
scsi_sas_internal.h
scsi_scan.c [SCSI] make struct scsi_{host,target}_type static 2008-07-12 08:22:36 -05:00
scsi_sysctl.c
scsi_sysfs.c [SCSI] scsi_dh: add infrastructure for SCSI Device Handlers 2008-06-05 09:23:40 -05:00
scsi_tgt_if.c scsi-tgt: BKL pushdown 2008-07-02 15:06:25 -06:00
scsi_tgt_lib.c [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer 2008-05-02 10:18:22 -05:00
scsi_tgt_priv.h
scsi_transport_api.h
scsi_transport_fc_internal.h
scsi_transport_fc.c driver core: remove KOBJ_NAME_LEN define 2008-07-21 21:54:52 -07:00
scsi_transport_iscsi.c driver core: remove KOBJ_NAME_LEN define 2008-07-21 21:54:52 -07:00
scsi_transport_sas.c block: make queue flags non-atomic 2008-04-29 14:48:33 +02:00
scsi_transport_spi.c [SCSI] scsi_transport_spi: include sysfs.h 2008-04-27 12:19:55 -05:00
scsi_transport_srp_internal.h
scsi_transport_srp.c
scsi_typedefs.h
scsi_wait_scan.c
scsi.c [SCSI] make use of the residue value 2008-06-05 09:23:45 -05:00
scsi.h
scsicam.c
sd.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
sd.h [SCSI] sd: Move scsi_disk() accessor function to sd.h 2008-07-12 08:22:31 -05:00
ses.c [SCSI] ses: Fix timeout 2008-06-24 12:02:27 -05:00
sg.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-07-15 18:58:04 -07:00
sgiwd93.c [SCSI] jazz_esp, sgiwd93, sni_53c710, sun3x_esp: fix platform driver hotplug/coldplug 2008-04-27 12:33:04 -05:00
sim710.c
sni_53c710.c [SCSI] jazz_esp, sgiwd93, sni_53c710, sun3x_esp: fix platform driver hotplug/coldplug 2008-04-27 12:33:04 -05:00
sr_ioctl.c
sr_vendor.c
sr.c scsi: sr avoids useless buffer allocation 2008-07-04 09:52:14 +02:00
sr.h
st_options.h
st.c Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
st.h
stex.c
sun3_NCR5380.c
sun3_scsi_vme.c
sun3_scsi.c
sun3_scsi.h
sun3x_esp.c [SCSI] jazz_esp, sgiwd93, sni_53c710, sun3x_esp: fix platform driver hotplug/coldplug 2008-04-27 12:33:04 -05:00
sun_esp.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
sym53c416.c
sym53c416.h
t128.c
t128.h
tmscsim.c
tmscsim.h
u14-34f.c [SCSI] u14-34f: Fix 32bit only problem 2008-05-02 13:18:06 -05:00
ultrastor.c scsi: fix integer as NULL pointer warnings 2008-04-28 17:31:13 -07:00
ultrastor.h
wd33c93.c
wd33c93.h
wd7000.c
zalon.c
zorro7xx.c