http://linux.bkbits.net/linux-2.5
torvalds@ppc970.osdl.org|ChangeSet|20040727215726|49922 torvalds
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/07/27 12:24:01-04:00 margitsw@t-online.de 
#   [PATCH] prism54 Fix null pointer reference (Bug 100)
#   
#   * prism54_get/set_debug_oid are missing checks for a null pointer.
#     Reported in Bugzilla number 100.
# 
# drivers/net/wireless/prism54/isl_ioctl.c
#   2004/07/26 04:35:17-04:00 margitsw@t-online.de +9 -7
#   prism54 Fix null pointer reference (Bug 100)
# 
# ChangeSet
#   2004/07/27 12:23:53-04:00 margitsw@t-online.de 
#   [PATCH] prism54 Fix initialization with older firmware
#   
#   * In the card initialization routine, we try to set the
#     output power. For firmware < 1.0.4.3, this leads to a
#     worrying "mgt_commit has failed .." in the log although
#     the device continues to react normally.
#     Fix is simple, do not try to configure output power.
#     (which I believe we should not be doing anyway as it is
#      probably against local country regulations)
# 
# drivers/net/wireless/prism54/oid_mgt.c
#   2004/07/22 03:50:20-04:00 margitsw@t-online.de +2 -0
#   prism54 Fix initialization with older firmware
# 
# ChangeSet
#   2004/07/27 12:23:44-04:00 margitsw@t-online.de 
#   [PATCH] prism54 Refix TRDY/RETRY_TIMEOUT
#   
#   * Reintroduce pushing 0 into the TRDY_TIMEOUT and RETRY_TIMEOUT
#     registers. Make this configurable with module parameter
#     init_pcitm.
#   
#   * We now have the ludicrous situation that some hardware setups
#     require this (not even pushing 0xFF helps), whilst others
#     don't care either way (the majority), and yet others bork
#     if anything is pushed into these regs.
#     If anybody can explain this (including Conexant :-) ), my ears
#     are open.
# 
# drivers/net/wireless/prism54/islpci_hotplug.c
#   2004/07/20 13:07:30-04:00 margitsw@t-online.de +10 -7
#   prism54 Refix TRDY/RETRY_TIMEOUT
# 
# ChangeSet
#   2004/07/27 12:23:35-04:00 margitsw@t-online.de 
#   [PATCH] prism54 Fix reference to uninitialized pointer
#   
#   * oid_mgt.c is calling islpci_mgt_transaction passing the address
#     of a pointer to the management frame. This is not being
#     initialized by the caller. The callee only updates this
#     pointer when successful. When not, boom.
#   
#   * Being ultracautious again, not only initialize in the caller,
#     also null out the pointer unconditionally in the callee.
# 
# drivers/net/wireless/prism54/oid_mgt.c
#   2004/07/15 09:13:53-04:00 margitsw@t-online.de +2 -2
#   prism54 Fix reference to uninitialized pointer
# 
# drivers/net/wireless/prism54/islpci_mgt.c
#   2004/07/15 09:17:21-04:00 margitsw@t-online.de +2 -0
#   prism54 Fix reference to uninitialized pointer
# 
# ChangeSet
#   2004/07/26 22:26:59-07:00 davidm@tiger.hpl.hp.com 
#   ia64: Update for elf_read_implies_exec() macro changes in mainline tree.
# 
# include/asm-ia64/processor.h
#   2004/07/26 22:26:50-07:00 davidm@tiger.hpl.hp.com +1 -2
#   (IA64_THREAD_XSTACK): Remove.
# 
# include/asm-ia64/page.h
#   2004/07/26 22:26:50-07:00 davidm@tiger.hpl.hp.com +1 -1
#   (VM_DATA_DEFAULT_FAGS): Use READ_IMPLIES_EXEC flag in the personality-word
#   	instead of IA64_THREAD_XSTACK in the thread-flags.
# 
# include/asm-ia64/elf.h
#   2004/07/26 22:26:50-07:00 davidm@tiger.hpl.hp.com +3 -3
#   (SET_PERSONALITY): Replace call to ia64_set_personality() with call to
#   	standard set_personality() routine.
#   (elf_read_implies_exec): Define it such that EF_IA_64_LINUX_EXECUTABLE_STACK
#   	ELF flag can be used to turn on execute-permission on data segments.
# 
# arch/ia64/mm/init.c
#   2004/07/26 22:26:50-07:00 davidm@tiger.hpl.hp.com +1 -1
#   (ia64_init_addr_space): Initialize vm_flags for register-backing store based
#   	on VM_DATA_DEFAULT_FLAGS, such that binaries with executable stacks
#   	will also get an executable backing-store.  This is for consistency's
#   	sake, mainly.  Nobody should really ever want executable stacks on
#   	ia64.
# 
# arch/ia64/kernel/process.c
#   2004/07/26 22:26:50-07:00 davidm@tiger.hpl.hp.com +0 -10
#   (ia64_set_personality): Delete.
# 
# arch/ia64/ia32/binfmt_elf32.c
#   2004/07/26 22:26:50-07:00 davidm@tiger.hpl.hp.com +4 -2
#   (elf_read_implies_exec): New macro.
#   (elf32_set_personality): Drop IA64_THREAD_XSTACcK from thread flags.
# 
# ChangeSet
#   2004/07/26 21:56:04-07:00 davidm@tiger.hpl.hp.com 
#   ia64: Update defconfig
# 
# arch/ia64/defconfig
#   2004/07/26 21:55:53-07:00 davidm@tiger.hpl.hp.com +64 -39
#   Update
# 
# ChangeSet
#   2004/07/26 21:05:10-07:00 viro@www.linux.org.uk 
#   [PATCH] wrong ifdef in ppc/kernel/setup.c (nvram)
#   
#   	Wrong ifdef around ppc nvram_read_byte() - it should be
#   CONFIG_GENERIC_NVRAM.
#   
#   [that's it for today; there's more (fb stuff), but I'd rather make that
#   a separate series]
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# arch/ppc/kernel/setup.c
#   2004/07/26 15:27:53-07:00 viro@www.linux.org.uk +1 -1
#   wrong ifdef in ppc/kernel/setup.c (nvram)
# 
# ChangeSet
#   2004/07/26 21:04:59-07:00 viro@www.linux.org.uk 
#   [PATCH] cpumask updates in open_pic.c (ppc)
#   
#   	compile fixes in open_pic.c - it missed cpumask conversion in several
#   places.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# include/asm-ppc/open_pic.h
#   2004/07/26 15:27:29-07:00 viro@www.linux.org.uk +1 -1
#   cpumask updates in open_pic.c (ppc)
# 
# arch/ppc/syslib/open_pic.c
#   2004/07/26 15:27:18-07:00 viro@www.linux.org.uk +10 -7
#   cpumask updates in open_pic.c (ppc)
# 
# ChangeSet
#   2004/07/26 21:04:48-07:00 viro@www.linux.org.uk 
#   [PATCH] inline reordering in drivers/*
#   
#   	usual "shift definition of inlines before their uses" in a couple of
#   places in drivers/*
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/net/seeq8005.c
#   2004/07/26 15:25:23-07:00 viro@www.linux.org.uk +21 -21
#   inline reordering in drivers/*
# 
# drivers/ieee1394/eth1394.c
#   2004/07/26 15:25:44-07:00 viro@www.linux.org.uk +14 -15
#   inline reordering in drivers/*
# 
# ChangeSet
#   2004/07/26 21:04:36-07:00 viro@www.linux.org.uk 
#   [PATCH] signed char fixes in drivers/*
#   
#   	a couple of "replace char with explicit s8 to make sure it's really
#   signed" fixes.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/isdn/i4l/isdn_net.c
#   2004/07/26 15:21:03-07:00 viro@www.linux.org.uk +1 -1
#   signed char fixes in drivers/*
# 
# drivers/input/keyboard/sunkbd.c
#   2004/07/26 15:20:55-07:00 viro@www.linux.org.uk +2 -2
#   signed char fixes in drivers/*
# 
# ChangeSet
#   2004/07/26 21:04:25-07:00 viro@www.linux.org.uk 
#   [PATCH] drivers/ieee1394 annotation
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/ieee1394/video1394.h
#   2004/07/26 15:19:51-07:00 viro@www.linux.org.uk +1 -1
#   drivers/ieee1394 annotation
# 
# drivers/ieee1394/video1394.c
#   2004/07/26 15:19:45-07:00 viro@www.linux.org.uk +14 -16
#   drivers/ieee1394 annotation
# 
# drivers/ieee1394/raw1394.c
#   2004/07/26 15:19:58-07:00 viro@www.linux.org.uk +2 -7
#   drivers/ieee1394 annotation
# 
# drivers/ieee1394/dv1394.c
#   2004/07/26 15:20:08-07:00 viro@www.linux.org.uk +2 -2
#   drivers/ieee1394 annotation
# 
# ChangeSet
#   2004/07/26 21:04:13-07:00 viro@www.linux.org.uk 
#   [PATCH] broken stuff marked as such in Kconfig
#   
#   	a) ppc KGDB builds only on two subarch; say so in Kconfig
#   	b) ide-pmac.c can't be a module; make it dependent on IDE=y.
#   	c) a bunch of isdn drivers is broken on ppc; marked as such
#   	d) oaknet is broken; marked as such (includes on files that do not
#   exist, etc.)
#   	e) buslogic and cyber2000 are broken on sparc64
#   	f) s3trio framebuffer is broken
#   	g) usual 8250-based serial is broken on sparc64; in principle it might
#   be worth supporting (there are PCI cards of that sort), for now marked as
#   broken (no asm/serial.h, to start with).
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/video/Kconfig
#   2004/07/26 15:16:17-07:00 viro@www.linux.org.uk +2 -2
#   broken stuff marked as such in Kconfig
# 
# drivers/serial/Kconfig
#   2004/07/26 15:16:02-07:00 viro@www.linux.org.uk +1 -0
#   broken stuff marked as such in Kconfig
# 
# drivers/scsi/Kconfig
#   2004/07/26 15:15:55-07:00 viro@www.linux.org.uk +1 -1
#   broken stuff marked as such in Kconfig
# 
# drivers/net/Kconfig
#   2004/07/26 15:15:48-07:00 viro@www.linux.org.uk +1 -1
#   broken stuff marked as such in Kconfig
# 
# drivers/isdn/pcbit/Kconfig
#   2004/07/26 15:15:38-07:00 viro@www.linux.org.uk +1 -1
#   broken stuff marked as such in Kconfig
# 
# drivers/isdn/hisax/Kconfig
#   2004/07/26 15:15:25-07:00 viro@www.linux.org.uk +5 -5
#   broken stuff marked as such in Kconfig
# 
# drivers/ide/Kconfig
#   2004/07/26 15:15:13-07:00 viro@www.linux.org.uk +1 -1
#   broken stuff marked as such in Kconfig
# 
# arch/ppc/Kconfig
#   2004/07/26 15:16:35-07:00 viro@www.linux.org.uk +1 -1
#   broken stuff marked as such in Kconfig
# 
# ChangeSet
#   2004/07/26 21:04:02-07:00 viro@www.linux.org.uk 
#   [PATCH] missing (void) in reiserfs on big-endian boxen
#   
#   Usual foo ? void : non-void  in reiserfs; gets triggered on big-endian
#   platforms.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# include/linux/reiserfs_fs.h
#   2004/07/26 15:13:45-07:00 viro@www.linux.org.uk +4 -4
#   missing (void) in reiserfs on big-endian boxen
# 
# ChangeSet
#   2004/07/26 21:03:51-07:00 viro@www.linux.org.uk 
#   [PATCH] asm-ppc/reg.h namespace pollution fixes
#   
#   	asm-ppc/reg.h defines pollutes namespace like there's no tomorrow;
#   among other things there are
#   	LR
#   	SR0...SR15
#   	DEC
#   etc.
#   
#   That breaks quite a few drivers that should otherwise work on ppc.  SR...
#   and LR were never used by ppc code; commented out in reg.h (note that
#   they are just aliases for SPRN_SR... and SPRN_LR).  RPA commented out and
#   its instances in ppc code (all four of them) replaced with SPRN_RPA.  Ditto
#   for DEC.  The rest of the offenders (DAR and PVR) are left alone for now and
#   #undef'ed in drivers in question.
#   
#   We probably want to rip all these guys out of reg.h and convert ppc users
#   to SPRN_... forms - file ends up included in alot of places and namespace
#   pollution like that is a Bad Thing(tm).
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# include/asm-ppc64/processor.h
#   2004/07/26 15:13:12-07:00 viro@www.linux.org.uk +1 -1
#   asm-ppc/reg.h namespace pollution fixes
# 
# include/asm-ppc/reg.h
#   2004/07/26 15:13:05-07:00 viro@www.linux.org.uk +5 -3
#   asm-ppc/reg.h namespace pollution fixes
# 
# drivers/char/synclinkmp.c
#   2004/07/26 15:11:26-07:00 viro@www.linux.org.uk +4 -0
#   asm-ppc/reg.h namespace pollution fixes
# 
# drivers/char/pcmcia/synclink_cs.c
#   2004/07/26 15:11:45-07:00 viro@www.linux.org.uk +5 -0
#   asm-ppc/reg.h namespace pollution fixes
# 
# arch/ppc64/kernel/head.S
#   2004/07/26 15:12:46-07:00 viro@www.linux.org.uk +1 -1
#   asm-ppc/reg.h namespace pollution fixes
# 
# arch/ppc/kernel/head.S
#   2004/07/26 15:12:27-07:00 viro@www.linux.org.uk +3 -3
#   asm-ppc/reg.h namespace pollution fixes
# 
# ChangeSet
#   2004/07/26 21:03:39-07:00 viro@www.linux.org.uk 
#   [PATCH] ffb_context annotation
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/char/drm/ffb_context.c
#   2004/07/26 15:10:53-07:00 viro@www.linux.org.uk +11 -11
#   ffb_context annotation
# 
# ChangeSet
#   2004/07/26 21:03:29-07:00 viro@www.linux.org.uk 
#   [PATCH] pointer-to-int conversion fixes
#   
#   Assorted pointer-to-int fixes:
#   	a) some places want to take pointer modulo alignment or extract
#   integer that was cast to pointer (which is legitimate), but do that via
#   wrong cast, triggering sparse warnings.
#   	b) usual %x (int)ptr -> %p ptr fixes
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# net/atm/resources.c
#   2004/07/26 15:06:31-07:00 viro@www.linux.org.uk +3 -3
#   pointer-to-int conversion fixes
# 
# drivers/isdn/tpam/tpam_memory.c
#   2004/07/26 15:08:28-07:00 viro@www.linux.org.uk +1 -1
#   pointer-to-int conversion fixes
# 
# drivers/isdn/hisax/netjet.c
#   2004/07/26 15:08:11-07:00 viro@www.linux.org.uk +6 -6
#   pointer-to-int conversion fixes
# 
# drivers/char/mwave/tp3780i.c
#   2004/07/26 15:07:32-07:00 viro@www.linux.org.uk +2 -2
#   pointer-to-int conversion fixes
# 
# drivers/char/mwave/mwavedd.c
#   2004/07/26 15:07:15-07:00 viro@www.linux.org.uk +6 -6
#   pointer-to-int conversion fixes
# 
# drivers/atm/firestream.c
#   2004/07/26 15:06:43-07:00 viro@www.linux.org.uk +1 -1
#   pointer-to-int conversion fixes
# 
# ChangeSet
#   2004/07/26 21:03:17-07:00 viro@www.linux.org.uk 
#   [PATCH] drivers/macintosh annotations
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/macintosh/via-pmu.c
#   2004/07/26 15:05:13-07:00 viro@www.linux.org.uk +6 -5
#   drivers/macintosh annotations
# 
# drivers/macintosh/ans-lcd.c
#   2004/07/26 15:05:06-07:00 viro@www.linux.org.uk +4 -4
#   drivers/macintosh annotations
# 
# ChangeSet
#   2004/07/26 21:03:05-07:00 viro@www.linux.org.uk 
#   [PATCH] via-velocity switched use of to if_mii()
#   
#   Either it got missed back when if_mii() was introduced, or it got merged
#   that way later.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/net/via-velocity.c
#   2004/07/26 15:04:04-07:00 viro@www.linux.org.uk +1 -1
#   via-velocity switched use of to if_mii()
# 
# ChangeSet
#   2004/07/26 21:02:54-07:00 viro@www.linux.org.uk 
#   [PATCH] dpt_i2o annotations
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/scsi/dpt_i2o.c
#   2004/07/26 15:03:34-07:00 viro@www.linux.org.uk +9 -9
#   dpt_i2o annotations
# 
# ChangeSet
#   2004/07/26 21:02:43-07:00 viro@www.linux.org.uk 
#   [PATCH] zoran switched to seq_file
#   
#   zoran procfs code switched to seq_file and cleaned up; a bunch of homegrown
#   procfs glue eliminated.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/media/video/zoran_procfs.c
#   2004/07/26 15:02:41-07:00 viro@www.linux.org.uk +26 -78
#   zoran switched to seq_file
# 
# ChangeSet
#   2004/07/26 21:02:32-07:00 viro@www.linux.org.uk 
#   [PATCH] cciss compat ioctl fix
#   
#   cciss compat ioctls were broken (mixing kernel and userland pointers);
#   fixed (and cleaned up) by switch to compat_alloc_user_space() and elimination
#   of set_fs().
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/block/cciss.c
#   2004/07/26 14:58:23-07:00 viro@www.linux.org.uk +18 -20
#   cciss compat ioctl fix
# 
# ChangeSet
#   2004/07/26 21:02:20-07:00 viro@www.linux.org.uk 
#   [PATCH] annotations for arch/ppc and include/asm-ppc
#   
#   Usual set - explicit -D<arch>=1 for sparse, __sighandler_t / __sigrestore_t
#   annotated, annotations in arch/ppc/kernel/*, etc. - same as for other platforms
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# include/asm-ppc/ucontext.h
#   2004/07/26 14:44:32-07:00 viro@www.linux.org.uk +2 -2
#   annotations for arch/ppc and include/asm-ppc
# 
# include/asm-ppc/signal.h
#   2004/07/26 14:44:25-07:00 viro@www.linux.org.uk +8 -4
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/mm/fault.c
#   2004/07/26 14:43:22-07:00 viro@www.linux.org.uk +3 -3
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/kernel/vecemu.c
#   2004/07/26 14:43:13-07:00 viro@www.linux.org.uk +1 -1
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/kernel/traps.c
#   2004/07/26 14:43:05-07:00 viro@www.linux.org.uk +1 -1
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/kernel/syscalls.c
#   2004/07/26 14:42:57-07:00 viro@www.linux.org.uk +6 -6
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/kernel/signal.c
#   2004/07/26 14:42:38-07:00 viro@www.linux.org.uk +8 -8
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/kernel/ptrace.c
#   2004/07/26 14:42:26-07:00 viro@www.linux.org.uk +8 -8
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/kernel/process.c
#   2004/07/26 14:42:17-07:00 viro@www.linux.org.uk +1 -1
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/kernel/ppc_htab.c
#   2004/07/26 14:42:11-07:00 viro@www.linux.org.uk +3 -3
#   annotations for arch/ppc and include/asm-ppc
# 
# arch/ppc/Makefile
#   2004/07/26 14:43:43-07:00 viro@www.linux.org.uk +2 -0
#   annotations for arch/ppc and include/asm-ppc
# 
# ChangeSet
#   2004/07/26 21:02:09-07:00 viro@www.linux.org.uk 
#   [PATCH] #if abuses in drivers/*
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/scsi/eata_pio.c
#   2004/07/26 14:38:51-07:00 viro@www.linux.org.uk +4 -4
#   #if abuses in drivers/*
# 
# drivers/scsi/aic7xxx_old.c
#   2004/07/26 14:38:41-07:00 viro@www.linux.org.uk +1 -1
#   #if abuses in drivers/*
# 
# drivers/scsi/aic7xxx/aic79xx_core.c
#   2004/07/26 14:38:57-07:00 viro@www.linux.org.uk +7 -7
#   #if abuses in drivers/*
# 
# drivers/scsi/aacraid/aacraid.h
#   2004/07/26 14:39:04-07:00 viro@www.linux.org.uk +1 -1
#   #if abuses in drivers/*
# 
# drivers/media/video/saa7134/saa7134-core.c
#   2004/07/26 14:38:01-07:00 viro@www.linux.org.uk +4 -4
#   #if abuses in drivers/*
# 
# drivers/media/radio/miropcm20-radio.c
#   2004/07/26 14:37:48-07:00 viro@www.linux.org.uk +3 -3
#   #if abuses in drivers/*
# 
# drivers/isdn/hisax/st5481_d.c
#   2004/07/26 14:37:23-07:00 viro@www.linux.org.uk +1 -1
#   #if abuses in drivers/*
# 
# drivers/isdn/hisax/hfc_2bds0.c
#   2004/07/26 14:37:13-07:00 viro@www.linux.org.uk +2 -2
#   #if abuses in drivers/*
# 
# drivers/input/joystick/analog.c
#   2004/07/26 14:37:03-07:00 viro@www.linux.org.uk +2 -2
#   #if abuses in drivers/*
# 
# drivers/char/tpqic02.c
#   2004/07/26 14:36:21-07:00 viro@www.linux.org.uk +2 -2
#   #if abuses in drivers/*
# 
# ChangeSet
#   2004/07/26 21:01:57-07:00 viro@www.linux.org.uk 
#   [PATCH] CONFIG_MCOUNT fix for sparc64
#   
#   CONFIG_MCOUNT on sparc64 is currently broken; we have both mcount and _mcount
#   declared (and aliased to each other), but end up exporting the wrong one.  As
#   the result, with that option all modules get unresolved symbol.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# arch/sparc64/kernel/sparc64_ksyms.c
#   2004/07/26 14:35:13-07:00 viro@www.linux.org.uk +2 -2
#   CONFIG_MCOUNT fix for sparc64
# 
# ChangeSet
#   2004/07/26 21:01:45-07:00 viro@www.linux.org.uk 
#   [PATCH] NULL noise removal in drivers/*
#   
#   it could be split (all chunks are obviously independent), but I don't think
#   that it's worth doing.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/video/radeonfb.c
#   2004/07/26 14:20:34-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/video/chipsfb.c
#   2004/07/26 14:20:20-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/video/aty/radeon_base.c
#   2004/07/26 14:19:44-07:00 viro@www.linux.org.uk +3 -3
#   NULL noise removal in drivers/*
# 
# drivers/video/aty/atyfb_base.c
#   2004/07/26 14:19:35-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/usb/core/hub.c
#   2004/07/26 14:19:06-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/serial/sunsu.c
#   2004/07/26 14:18:57-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/serial/suncore.c
#   2004/07/26 14:18:52-07:00 viro@www.linux.org.uk +3 -3
#   NULL noise removal in drivers/*
# 
# drivers/serial/pmac_zilog.c
#   2004/07/26 14:18:48-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/scsi/ultrastor.c
#   2004/07/26 14:23:55-07:00 viro@www.linux.org.uk +7 -7
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_comm.h
#   2004/07/26 14:23:44-07:00 viro@www.linux.org.uk +7 -7
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_2/sym_nvram.c
#   2004/07/26 14:24:36-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_2/sym_misc.h
#   2004/07/26 14:24:36-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_2/sym_malloc.c
#   2004/07/26 14:24:36-07:00 viro@www.linux.org.uk +9 -9
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_2/sym_hipd.h
#   2004/07/26 14:24:36-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_2/sym_hipd.c
#   2004/07/26 14:24:36-07:00 viro@www.linux.org.uk +14 -14
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_2/sym_glue.h
#   2004/07/26 14:24:36-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_2/sym_glue.c
#   2004/07/26 14:24:36-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal in drivers/*
# 
# drivers/scsi/sym53c8xx_2/sym_fw.c
#   2004/07/26 14:24:36-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/scsi/st.c
#   2004/07/26 14:23:30-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/scsi/qla2xxx/qla_isr.c
#   2004/07/26 14:24:46-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal in drivers/*
# 
# drivers/scsi/qla1280.c
#   2004/07/26 14:23:23-07:00 viro@www.linux.org.uk +7 -7
#   NULL noise removal in drivers/*
# 
# drivers/scsi/nsp32.c
#   2004/07/26 14:23:14-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/scsi/ncr53c8xx.c
#   2004/07/26 14:23:06-07:00 viro@www.linux.org.uk +21 -21
#   NULL noise removal in drivers/*
# 
# drivers/scsi/in2000.c
#   2004/07/26 14:22:47-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal in drivers/*
# 
# drivers/scsi/g_NCR5380.c
#   2004/07/26 14:22:32-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/scsi/aic7xxx_old.c
#   2004/07/26 14:22:04-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/scsi/aha1542.c
#   2004/07/26 14:21:48-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/scsi/aha152x.c
#   2004/07/26 14:21:42-07:00 viro@www.linux.org.uk +36 -36
#   NULL noise removal in drivers/*
# 
# drivers/scsi/NCR5380.c
#   2004/07/26 14:21:24-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/scsi/53c700.c
#   2004/07/26 14:21:16-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/pnp/pnpbios/bioscalls.c
#   2004/07/26 14:25:05-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal in drivers/*
# 
# drivers/macintosh/via-pmu.c
#   2004/07/26 14:26:23-07:00 viro@www.linux.org.uk +12 -12
#   NULL noise removal in drivers/*
# 
# drivers/macintosh/via-cuda.c
#   2004/07/26 14:25:57-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/macintosh/macio-adb.c
#   2004/07/26 14:25:48-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/macintosh/adbhid.c
#   2004/07/26 14:25:37-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/macintosh/adb.c
#   2004/07/26 14:25:31-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/input/mouse/pc110pad.c
#   2004/07/26 14:27:05-07:00 viro@www.linux.org.uk +5 -5
#   NULL noise removal in drivers/*
# 
# drivers/fc4/socal.c
#   2004/07/26 14:27:39-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/fc4/soc.c
#   2004/07/26 14:27:37-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/char/tpqic02.c
#   2004/07/26 14:29:52-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/char/synclinkmp.c
#   2004/07/26 14:29:35-07:00 viro@www.linux.org.uk +9 -9
#   NULL noise removal in drivers/*
# 
# drivers/char/synclink.c
#   2004/07/26 14:29:20-07:00 viro@www.linux.org.uk +6 -6
#   NULL noise removal in drivers/*
# 
# drivers/char/sonypi.h
#   2004/07/26 14:29:09-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/char/nvram.c
#   2004/07/26 14:29:02-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/char/n_hdlc.c
#   2004/07/26 14:28:56-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/char/mwave/tp3780i.c
#   2004/07/26 14:28:24-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/*
# 
# drivers/char/genrtc.c
#   2004/07/26 14:28:47-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# drivers/char/drm/drm_drv.h
#   2004/07/26 14:27:52-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/*
# 
# ChangeSet
#   2004/07/26 21:01:32-07:00 viro@www.linux.org.uk 
#   [PATCH] drm/gamma_old_dma.h fix
#   
#   blind dereferencing of userland pointer
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/char/drm/gamma_old_dma.h
#   2004/07/26 14:17:54-07:00 viro@www.linux.org.uk +27 -14
#   drm/gamma_old_dma.h fix
# 
# ChangeSet
#   2004/07/26 21:01:20-07:00 viro@www.linux.org.uk 
#   [PATCH] NULL noise removal on ppc
#   
#   0->NULL in arch/ppc and include/asm-ppc.
#   
#   [That's it for this series - there's still ~200Kb to merge, but I'd rather
#   take a break for a couple of hours before dealing with the rest]
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# include/asm-ppc/io.h
#   2004/07/26 11:45:20-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal on ppc
# 
# include/asm-ppc/highmem.h
#   2004/07/26 11:45:14-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal on ppc
# 
# arch/ppc/xmon/xmon.c
#   2004/07/26 11:44:49-07:00 viro@www.linux.org.uk +11 -11
#   NULL noise removal on ppc
# 
# arch/ppc/xmon/start.c
#   2004/07/26 11:44:40-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal on ppc
# 
# arch/ppc/xmon/ppc-opc.c
#   2004/07/26 11:44:32-07:00 viro@www.linux.org.uk +39 -39
#   NULL noise removal on ppc
# 
# arch/ppc/syslib/prom_init.c
#   2004/07/26 11:44:22-07:00 viro@www.linux.org.uk +17 -17
#   NULL noise removal on ppc
# 
# arch/ppc/syslib/prom.c
#   2004/07/26 11:44:11-07:00 viro@www.linux.org.uk +12 -12
#   NULL noise removal on ppc
# 
# arch/ppc/syslib/open_pic.c
#   2004/07/26 11:44:01-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal on ppc
# 
# arch/ppc/platforms/residual.c
#   2004/07/26 11:43:24-07:00 viro@www.linux.org.uk +6 -6
#   NULL noise removal on ppc
# 
# arch/ppc/platforms/prep_setup.c
#   2004/07/26 11:43:07-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal on ppc
# 
# arch/ppc/platforms/prep_pci.c
#   2004/07/26 11:42:57-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal on ppc
# 
# arch/ppc/platforms/pmac_smp.c
#   2004/07/26 11:42:45-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal on ppc
# 
# arch/ppc/platforms/pmac_pic.c
#   2004/07/26 11:42:35-07:00 viro@www.linux.org.uk +3 -3
#   NULL noise removal on ppc
# 
# arch/ppc/platforms/pmac_pci.c
#   2004/07/26 11:42:27-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal on ppc
# 
# arch/ppc/kernel/setup.c
#   2004/07/26 11:41:25-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal on ppc
# 
# arch/ppc/kernel/process.c
#   2004/07/26 11:41:07-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal on ppc
# 
# arch/ppc/kernel/ppc-stub.c
#   2004/07/26 11:40:41-07:00 viro@www.linux.org.uk +3 -3
#   NULL noise removal on ppc
# 
# arch/ppc/kernel/pci.c
#   2004/07/26 11:40:32-07:00 viro@www.linux.org.uk +6 -6
#   NULL noise removal on ppc
# 
# arch/ppc/kernel/irq.c
#   2004/07/26 11:40:21-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal on ppc
# 
# arch/ppc/boot/simple/misc.c
#   2004/07/26 11:41:48-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal on ppc
# 
# ChangeSet
#   2004/07/26 21:01:08-07:00 viro@www.linux.org.uk 
#   [PATCH] sparc32 emulation annotated
#   
#   annotated, a bunch of ioctls switched to compat_alloc_user_space() and
#   cleaned up.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# arch/sparc64/kernel/ioctl32.c
#   2004/07/26 11:37:30-07:00 viro@www.linux.org.uk +173 -402
#   sparc32 emulation annotated
# 
# arch/sparc64/kernel/binfmt_aout32.c
#   2004/07/26 11:37:42-07:00 viro@www.linux.org.uk +5 -4
#   sparc32 emulation annotated
# 
# ChangeSet
#   2004/07/26 21:00:57-07:00 viro@www.linux.org.uk 
#   [PATCH] solaris emulation annotated
#   
#   trivial annotations and cleanups + proper use of vfs_...stat().
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# arch/sparc64/solaris/timod.c
#   2004/07/26 11:36:33-07:00 viro@www.linux.org.uk +31 -29
#   solaris emulation annotated
# 
# arch/sparc64/solaris/socket.c
#   2004/07/26 11:36:33-07:00 viro@www.linux.org.uk +26 -26
#   solaris emulation annotated
# 
# arch/sparc64/solaris/signal.c
#   2004/07/26 11:36:33-07:00 viro@www.linux.org.uk +37 -33
#   solaris emulation annotated
# 
# arch/sparc64/solaris/misc.c
#   2004/07/26 11:36:33-07:00 viro@www.linux.org.uk +38 -46
#   solaris emulation annotated
# 
# arch/sparc64/solaris/ipc.c
#   2004/07/26 11:36:33-07:00 viro@www.linux.org.uk +23 -21
#   solaris emulation annotated
# 
# arch/sparc64/solaris/ioctl.c
#   2004/07/26 11:36:33-07:00 viro@www.linux.org.uk +64 -59
#   solaris emulation annotated
# 
# arch/sparc64/solaris/fs.c
#   2004/07/26 11:36:33-07:00 viro@www.linux.org.uk +64 -106
#   solaris emulation annotated
# 
# arch/sparc64/solaris/conv.h
#   2004/07/26 11:36:33-07:00 viro@www.linux.org.uk +1 -1
#   solaris emulation annotated
# 
# ChangeSet
#   2004/07/26 21:00:46-07:00 viro@www.linux.org.uk 
#   [PATCH] #if abuse in drivers/net/*
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/net/tulip/xircom_cb.c
#   2004/07/26 11:33:29-07:00 viro@www.linux.org.uk +1 -1
#   #if abuse in drivers/net/*
# 
# drivers/net/pcmcia/nmclan_cs.c
#   2004/07/26 11:33:29-07:00 viro@www.linux.org.uk +1 -1
#   #if abuse in drivers/net/*
# 
# drivers/net/ixgb/ixgb_osdep.h
#   2004/07/26 11:33:29-07:00 viro@www.linux.org.uk +1 -1
#   #if abuse in drivers/net/*
# 
# drivers/net/ixgb/ixgb_hw.c
#   2004/07/26 11:33:29-07:00 viro@www.linux.org.uk +1 -1
#   #if abuse in drivers/net/*
# 
# drivers/net/e1000/e1000_osdep.h
#   2004/07/26 11:33:29-07:00 viro@www.linux.org.uk +1 -1
#   #if abuse in drivers/net/*
# 
# drivers/net/e1000/e1000.h
#   2004/07/26 11:33:29-07:00 viro@www.linux.org.uk +1 -1
#   #if abuse in drivers/net/*
# 
# drivers/net/dgrs_i82596.h
#   2004/07/26 11:33:29-07:00 viro@www.linux.org.uk +2 -2
#   #if abuse in drivers/net/*
# 
# drivers/net/dgrs_asstruct.h
#   2004/07/26 11:33:29-07:00 viro@www.linux.org.uk +1 -1
#   #if abuse in drivers/net/*
# 
# ChangeSet
#   2004/07/26 21:00:34-07:00 viro@www.linux.org.uk 
#   [PATCH] NULL noise removal in drivers/net/*
#   
#   That definitely duplicates a bunch of stuff in pending patches from various
#   folks, but since it's all trivial 0->NULL replacements and patches are still
#   not submitted and/or merged...
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/net/yellowfin.c
#   2004/07/26 11:32:40-07:00 viro@www.linux.org.uk +5 -5
#   NULL noise removal in drivers/net/*
# 
# drivers/net/wireless/prism54/islpci_hotplug.c
#   2004/07/26 11:31:32-07:00 viro@www.linux.org.uk +7 -7
#   NULL noise removal in drivers/net/*
# 
# drivers/net/wireless/prism54/islpci_dev.c
#   2004/07/26 11:31:25-07:00 viro@www.linux.org.uk +7 -7
#   NULL noise removal in drivers/net/*
# 
# drivers/net/wireless/airport.c
#   2004/07/26 11:31:13-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/wireless/airo.c
#   2004/07/26 11:31:01-07:00 viro@www.linux.org.uk +14 -14
#   NULL noise removal in drivers/net/*
# 
# drivers/net/via-rhine.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +5 -5
#   NULL noise removal in drivers/net/*
# 
# drivers/net/tlan.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/sunqe.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/sunlance.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +6 -6
#   NULL noise removal in drivers/net/*
# 
# drivers/net/sundance.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +8 -8
#   NULL noise removal in drivers/net/*
# 
# drivers/net/sunbmac.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/slip.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/sis900.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal in drivers/net/*
# 
# drivers/net/sb1000.c
#   2004/07/26 11:30:40-07:00 viro@www.linux.org.uk +3 -3
#   NULL noise removal in drivers/net/*
# 
# drivers/net/ppp_synctty.c
#   2004/07/26 11:29:30-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal in drivers/net/*
# 
# drivers/net/ppp_generic.c
#   2004/07/26 11:29:20-07:00 viro@www.linux.org.uk +16 -16
#   NULL noise removal in drivers/net/*
# 
# drivers/net/ppp_async.c
#   2004/07/26 11:29:03-07:00 viro@www.linux.org.uk +5 -5
#   NULL noise removal in drivers/net/*
# 
# drivers/net/ns83820.c
#   2004/07/26 11:28:54-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/ne.c
#   2004/07/26 11:28:46-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/myri_sbus.c
#   2004/07/26 11:28:39-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/mace.c
#   2004/07/26 11:28:31-07:00 viro@www.linux.org.uk +3 -3
#   NULL noise removal in drivers/net/*
# 
# drivers/net/lp486e.c
#   2004/07/26 11:28:23-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/lance.c
#   2004/07/26 11:28:14-07:00 viro@www.linux.org.uk +3 -3
#   NULL noise removal in drivers/net/*
# 
# drivers/net/hamachi.c
#   2004/07/26 11:28:04-07:00 viro@www.linux.org.uk +8 -8
#   NULL noise removal in drivers/net/*
# 
# drivers/net/epic100.c
#   2004/07/26 11:27:46-07:00 viro@www.linux.org.uk +5 -5
#   NULL noise removal in drivers/net/*
# 
# drivers/net/eepro100.c
#   2004/07/26 11:27:32-07:00 viro@www.linux.org.uk +8 -8
#   NULL noise removal in drivers/net/*
# 
# drivers/net/dl2k.c
#   2004/07/26 11:27:21-07:00 viro@www.linux.org.uk +5 -5
#   NULL noise removal in drivers/net/*
# 
# drivers/net/cs89x0.c
#   2004/07/26 11:26:32-07:00 viro@www.linux.org.uk +1 -1
#   NULL noise removal in drivers/net/*
# 
# drivers/net/amd8111e.c
#   2004/07/26 11:26:20-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/net/*
# 
# drivers/net/acenic_firmware.h
#   2004/07/26 11:26:11-07:00 viro@www.linux.org.uk +3 -3
#   NULL noise removal in drivers/net/*
# 
# drivers/net/82596.c
#   2004/07/26 11:26:01-07:00 viro@www.linux.org.uk +2 -2
#   NULL noise removal in drivers/net/*
# 
# drivers/net/3c515.c
#   2004/07/26 11:25:51-07:00 viro@www.linux.org.uk +4 -4
#   NULL noise removal in drivers/net/*
# 
# ChangeSet
#   2004/07/26 21:00:21-07:00 viro@www.linux.org.uk 
#   [PATCH] mtd fixes
#   
#   Assorted mtd fixes.
#   	a) NULL noise removal
#   	b) %p pointer instead of %x (int)pointer in printks
#   	c) missed iovec->kvec replacements (basically, fixing merge problems)
#   	d) fixed type for (unused) last argument in doc_{read,write}_ecc()
#   	e) sanitized some comparisons.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/mtd/nand/diskonchip.c
#   2004/07/26 11:24:39-07:00 viro@www.linux.org.uk +7 -7
#   mtd fixes
# 
# drivers/mtd/mtdchar.c
#   2004/07/26 11:24:48-07:00 viro@www.linux.org.uk +1 -1
#   mtd fixes
# 
# drivers/mtd/maps/ichxrom.c
#   2004/07/26 11:24:31-07:00 viro@www.linux.org.uk +1 -1
#   mtd fixes
# 
# drivers/mtd/inftlmount.c
#   2004/07/26 11:22:05-07:00 viro@www.linux.org.uk +6 -7
#   mtd fixes
# 
# drivers/mtd/inftlcore.c
#   2004/07/26 11:21:59-07:00 viro@www.linux.org.uk +16 -16
#   mtd fixes
# 
# drivers/mtd/devices/doc2001.c
#   2004/07/26 11:22:59-07:00 viro@www.linux.org.uk +10 -6
#   mtd fixes
# 
# drivers/mtd/devices/doc2000.c
#   2004/07/26 11:22:55-07:00 viro@www.linux.org.uk +4 -4
#   mtd fixes
# 
# drivers/mtd/chips/cfi_cmdset_0002.c
#   2004/07/26 11:22:47-07:00 viro@www.linux.org.uk +1 -1
#   mtd fixes
# 
# ChangeSet
#   2004/07/26 21:00:10-07:00 viro@www.linux.org.uk 
#   [PATCH] impi annotation
#   
#   drivers/char/ipmi/* annotated, structure shared between kernel and
#   userland (ioctls) split in two.
#   ACPI callback in the same code used to have wrong type - it should've been
#   void (...), not u32 (...).  Fixed.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# include/linux/ipmi.h
#   2004/07/26 11:19:55-07:00 viro@www.linux.org.uk +13 -5
#   impi annotation
# 
# drivers/char/ipmi/ipmi_watchdog.c
#   2004/07/26 11:19:41-07:00 viro@www.linux.org.uk +3 -3
#   impi annotation
# 
# drivers/char/ipmi/ipmi_si_intf.c
#   2004/07/26 11:19:33-07:00 viro@www.linux.org.uk +1 -2
#   impi annotation
# 
# drivers/char/ipmi/ipmi_msghandler.c
#   2004/07/26 11:19:24-07:00 viro@www.linux.org.uk +13 -13
#   impi annotation
# 
# drivers/char/ipmi/ipmi_devintf.c
#   2004/07/26 11:19:16-07:00 viro@www.linux.org.uk +10 -8
#   impi annotation
# 
# ChangeSet
#   2004/07/26 20:59:59-07:00 viro@www.linux.org.uk 
#   [PATCH] bpck6 compile fix on ppc
#   
#   bpck6 was b0rken on ppc in rather amusing way - it used
#   typedef struct ... PPC;
#   which doesn't mix with having PPC (pre)defined to 1.  Fixed by renaming private
#   typedef in question.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/block/paride/ppc6lnx.c
#   2004/07/26 11:18:10-07:00 viro@www.linux.org.uk +31 -31
#   bpck6 compile fix on ppc
# 
# drivers/block/paride/bpck6.c
#   2004/07/26 11:18:03-07:00 viro@www.linux.org.uk +3 -3
#   bpck6 compile fix on ppc
# 
# ChangeSet
#   2004/07/26 20:59:48-07:00 viro@www.linux.org.uk 
#   [PATCH] more NULL noise removal in fs/*
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# fs/proc/proc_devtree.c
#   2004/07/26 11:17:15-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in fs/*
# 
# fs/jffs/jffs_proc.c
#   2004/07/26 11:17:05-07:00 viro@www.linux.org.uk +6 -6
#   more NULL noise removal in fs/*
# 
# ChangeSet
#   2004/07/26 20:59:37-07:00 viro@www.linux.org.uk 
#   [PATCH] openpromfs annotation
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# fs/openpromfs/inode.c
#   2004/07/26 11:16:33-07:00 viro@www.linux.org.uk +10 -10
#   openpromfs annotation
# 
# ChangeSet
#   2004/07/26 20:59:25-07:00 viro@www.linux.org.uk 
#   [PATCH] security/selinux/hooks.c compile fix
#   
#   added missing #include
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# security/selinux/hooks.c
#   2004/07/26 11:14:27-07:00 viro@www.linux.org.uk +1 -0
#   security/selinux/hooks.c compile fix
# 
# ChangeSet
#   2004/07/26 20:59:14-07:00 viro@www.linux.org.uk 
#   [PATCH] broken stuff in sound/* marked as such in Kconfig
#   
#   a) OSS is broken on sparc64 (as in "won't compile")
#   b) sb16_csp is broken on ppc
#   marked as such in Kconfig
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# sound/isa/Kconfig
#   2004/07/26 11:13:42-07:00 viro@www.linux.org.uk +1 -1
#   broken stuff in sound/* marked as such in Kconfig
# 
# sound/Kconfig
#   2004/07/26 11:13:49-07:00 viro@www.linux.org.uk +1 -1
#   broken stuff in sound/* marked as such in Kconfig
# 
# ChangeSet
#   2004/07/26 20:59:03-07:00 viro@www.linux.org.uk 
#   [PATCH] misc sound/* fixes
#   
#   a) ALSA variant of wavefront didn't compile on gcc 2.x with debugging
#   turned on - authors heard something about variadic macros on gcc 2.x,
#   but screwed it up.  Fixed.
#   b) au88x0 relied on char being signed in non-trivial ways.  On ppc it's
#   not true.  Fixed by explicit use of s8 (which is what that code really
#   wants).
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# sound/pci/au88x0/au88x0.h
#   2004/07/26 11:12:15-07:00 viro@www.linux.org.uk +5 -5
#   misc sound/* fixes
# 
# sound/isa/wavefront/wavefront_synth.c
#   2004/07/26 11:12:57-07:00 viro@www.linux.org.uk +1 -1
#   misc sound/* fixes
# 
# ChangeSet
#   2004/07/26 20:58:52-07:00 viro@www.linux.org.uk 
#   [PATCH] dmasound annotation
#   
#   dmasound (core + ppc-specific parts) annotated
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# sound/oss/dmasound/trans_16.c
#   2004/07/26 11:11:37-07:00 viro@www.linux.org.uk +46 -46
#   dmasound annotation
# 
# sound/oss/dmasound/tas3004.c
#   2004/07/26 11:11:37-07:00 viro@www.linux.org.uk +17 -27
#   dmasound annotation
# 
# sound/oss/dmasound/tas3001c_tables.c
#   2004/07/26 11:11:37-07:00 viro@www.linux.org.uk +6 -6
#   dmasound annotation
# 
# sound/oss/dmasound/tas3001c.c
#   2004/07/26 11:11:37-07:00 viro@www.linux.org.uk +17 -27
#   dmasound annotation
# 
# sound/oss/dmasound/dmasound_core.c
#   2004/07/26 11:11:37-07:00 viro@www.linux.org.uk +7 -7
#   dmasound annotation
# 
# sound/oss/dmasound/dmasound_awacs.c
#   2004/07/26 11:11:37-07:00 viro@www.linux.org.uk +7 -6
#   dmasound annotation
# 
# sound/oss/dmasound/dmasound.h
#   2004/07/26 11:11:37-07:00 viro@www.linux.org.uk +11 -11
#   dmasound annotation
# 
# ChangeSet
#   2004/07/26 20:58:41-07:00 viro@www.linux.org.uk 
#   [PATCH] check_region fixes
#   
#   A couple of old ISA drivers had trivial to fix check_region() uses.
#   Sanitized.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# sound/oss/msnd_pinnacle.c
#   2004/07/26 11:10:28-07:00 viro@www.linux.org.uk +2 -4
#   check_region fixes
# 
# sound/oss/gus_wave.c
#   2004/07/26 11:10:23-07:00 viro@www.linux.org.uk +12 -2
#   check_region fixes
# 
# sound/oss/gus_card.c
#   2004/07/26 11:10:16-07:00 viro@www.linux.org.uk +9 -19
#   check_region fixes
# 
# ChangeSet
#   2004/07/26 20:58:29-07:00 viro@www.linux.org.uk 
#   [PATCH] tea575 fix
#   
#   Very confused ioctl in tea575x - it is called via video_usercopy(), but
#   assumes that it still has userland pointers.  Fixed.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# sound/i2c/other/tea575x-tuner.c
#   2004/07/26 11:09:13-07:00 viro@www.linux.org.uk +3 -8
#   tea575 fix
# 
# ChangeSet
#   2004/07/26 20:58:17-07:00 viro@www.linux.org.uk 
#   [PATCH] #if abuse is sound/*
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# sound/pci/azt3328.c
#   2004/07/26 11:07:52-07:00 viro@www.linux.org.uk +4 -4
#   #if abuse is sound/*
# 
# sound/oss/aci.c
#   2004/07/26 11:06:53-07:00 viro@www.linux.org.uk +3 -3
#   #if abuse is sound/*
# 
# sound/drivers/serial-u16550.c
#   2004/07/26 11:06:35-07:00 viro@www.linux.org.uk +1 -1
#   #if abuse is sound/*
# 
# include/sound/asound.h
#   2004/07/26 11:08:12-07:00 viro@www.linux.org.uk +4 -2
#   #if abuse is sound/*
# 
# ChangeSet
#   2004/07/26 20:58:06-07:00 viro@www.linux.org.uk 
#   [PATCH] more NULL noise removal in sound/*
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# sound/ppc/pmac.c
#   2004/07/26 11:05:09-07:00 viro@www.linux.org.uk +2 -2
#   more NULL noise removal in sound/*
# 
# sound/pci/sonicvibes.c
#   2004/07/26 11:04:58-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/pci/rme9652/hdsp.c
#   2004/07/26 11:04:58-07:00 viro@www.linux.org.uk +7 -7
#   more NULL noise removal in sound/*
# 
# sound/pci/maestro3.c
#   2004/07/26 11:04:58-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/pci/intel8x0m.c
#   2004/07/26 11:04:58-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/pci/ice1712/ice1724.c
#   2004/07/26 11:04:58-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/pci/ice1712/ice1712.c
#   2004/07/26 11:04:58-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/oss/wavfront.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +12 -12
#   more NULL noise removal in sound/*
# 
# sound/oss/sb_common.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/oss/i810_audio.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +2 -2
#   more NULL noise removal in sound/*
# 
# sound/oss/forte.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +3 -3
#   more NULL noise removal in sound/*
# 
# sound/oss/emu10k1/midi.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/oss/emu10k1/main.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +4 -4
#   more NULL noise removal in sound/*
# 
# sound/oss/dmasound/dmasound_core.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +2 -2
#   more NULL noise removal in sound/*
# 
# sound/oss/dmasound/dmasound_awacs.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +12 -12
#   more NULL noise removal in sound/*
# 
# sound/oss/cs46xxpm-24.h
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/oss/cs46xx.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +2 -2
#   more NULL noise removal in sound/*
# 
# sound/oss/ali5455.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +2 -2
#   more NULL noise removal in sound/*
# 
# sound/oss/ad1889.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +3 -3
#   more NULL noise removal in sound/*
# 
# sound/oss/ad1848.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/oss/ad1816.c
#   2004/07/26 11:04:15-07:00 viro@www.linux.org.uk +2 -2
#   more NULL noise removal in sound/*
# 
# sound/isa/wavefront/wavefront_synth.c
#   2004/07/26 11:01:07-07:00 viro@www.linux.org.uk +12 -12
#   more NULL noise removal in sound/*
# 
# sound/isa/sb/sb8_main.c
#   2004/07/26 11:00:40-07:00 viro@www.linux.org.uk +2 -2
#   more NULL noise removal in sound/*
# 
# sound/isa/sb/emu8000_pcm.c
#   2004/07/26 11:00:30-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/isa/gus/gus_mem.c
#   2004/07/26 11:00:21-07:00 viro@www.linux.org.uk +1 -1
#   more NULL noise removal in sound/*
# 
# sound/drivers/vx/vx_pcm.c
#   2004/07/26 11:00:08-07:00 viro@www.linux.org.uk +8 -8
#   more NULL noise removal in sound/*
# 
# sound/core/pcm.c
#   2004/07/26 10:59:53-07:00 viro@www.linux.org.uk +6 -6
#   more NULL noise removal in sound/*
# 
# sound/core/oss/pcm_oss.c
#   2004/07/26 10:59:41-07:00 viro@www.linux.org.uk +3 -3
#   more NULL noise removal in sound/*
# 
# ChangeSet
#   2004/07/26 20:57:53-07:00 viro@www.linux.org.uk 
#   [PATCH] bluetooth annotations
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# net/bluetooth/rfcomm/core.c
#   2004/07/26 10:47:55-07:00 viro@www.linux.org.uk +15 -30
#   bluetooth annotations
# 
# net/bluetooth/hidp/core.c
#   2004/07/26 10:47:01-07:00 viro@www.linux.org.uk +2 -6
#   bluetooth annotations
# 
# net/bluetooth/cmtp/core.c
#   2004/07/26 10:46:51-07:00 viro@www.linux.org.uk +2 -6
#   bluetooth annotations
# 
# net/bluetooth/bnep/core.c
#   2004/07/26 10:46:35-07:00 viro@www.linux.org.uk +8 -14
#   bluetooth annotations
# 
# net/bluetooth/bnep/bnep.h
#   2004/07/26 10:46:31-07:00 viro@www.linux.org.uk +1 -1
#   bluetooth annotations
# 
# ChangeSet
#   2004/07/26 20:57:42-07:00 viro@www.linux.org.uk 
#   [PATCH] rndis fix
#   
#   blind dereferencing of userland pointers in procfs ->write() in rndis.c
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/usb/gadget/rndis.c
#   2004/07/26 10:44:46-07:00 viro@www.linux.org.uk +10 -8
#   rndis fix
# 
# ChangeSet
#   2004/07/26 20:57:31-07:00 viro@www.linux.org.uk 
#   [PATCH] appletalk SIOCADDRT fix
#   
#   blind dereferencing of userland pointer in appletalk SIOCADDRT handling.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# net/appletalk/ddp.c
#   2004/07/26 10:43:57-07:00 viro@www.linux.org.uk +5 -5
#   appletalk SIOCADDRT fix
# 
# ChangeSet
#   2004/07/26 20:57:19-07:00 viro@www.linux.org.uk 
#   [PATCH] size_t portability fixes
#   
#   A lot of places assumed that size_t == unsigned; on 64bit boxen that is not
#   true.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# net/irda/af_irda.c
#   2004/07/26 10:22:36-07:00 viro@www.linux.org.uk +7 -7
#   size_t portability fixes
# 
# fs/ntfs/super.c
#   2004/07/26 10:24:59-07:00 viro@www.linux.org.uk +1 -1
#   size_t portability fixes
# 
# fs/ntfs/dir.c
#   2004/07/26 10:24:50-07:00 viro@www.linux.org.uk +1 -1
#   size_t portability fixes
# 
# fs/ntfs/compress.c
#   2004/07/26 10:24:42-07:00 viro@www.linux.org.uk +1 -1
#   size_t portability fixes
# 
# fs/jffs2/gc.c
#   2004/07/26 10:24:29-07:00 viro@www.linux.org.uk +1 -1
#   size_t portability fixes
# 
# fs/jffs2/erase.c
#   2004/07/26 10:24:14-07:00 viro@www.linux.org.uk +1 -1
#   size_t portability fixes
# 
# drivers/w1/w1_int.c
#   2004/07/26 10:27:49-07:00 viro@www.linux.org.uk +1 -1
#   size_t portability fixes
# 
# drivers/usb/media/pwc-if.c
#   2004/07/26 10:29:57-07:00 viro@www.linux.org.uk +1 -1
#   size_t portability fixes
# 
# drivers/mtd/nand/diskonchip.c
#   2004/07/26 10:36:12-07:00 viro@www.linux.org.uk +2 -1
#   size_t portability fixes
# 
# drivers/mtd/inftlmount.c
#   2004/07/26 10:34:40-07:00 viro@www.linux.org.uk +8 -6
#   size_t portability fixes
# 
# drivers/mtd/ftl.c
#   2004/07/26 10:32:48-07:00 viro@www.linux.org.uk +6 -5
#   size_t portability fixes
# 
# drivers/mtd/devices/blkmtd.c
#   2004/07/26 10:29:35-07:00 viro@www.linux.org.uk +18 -18
#   size_t portability fixes
# 
# drivers/mtd/chips/cfi_cmdset_0002.c
#   2004/07/26 10:37:01-07:00 viro@www.linux.org.uk +2 -2
#   size_t portability fixes
# 
# drivers/char/mwave/mwavedd.c
#   2004/07/26 10:38:13-07:00 viro@www.linux.org.uk +2 -2
#   size_t portability fixes
# 
# ChangeSet
#   2004/07/26 16:37:27-07:00 davidm@tiger.hpl.hp.com 
#   ia64: Oops, SN2 needs pending_irq_cpumask to be global.
# 
# arch/ia64/kernel/irq.c
#   2004/07/26 16:37:18-07:00 davidm@tiger.hpl.hp.com +1 -1
#   (pending_irq_cpumask): Make it global again.
# 
# ChangeSet
#   2004/07/26 12:49:58-07:00 davidm@tiger.hpl.hp.com 
#   ia64: Clean up arch/ia64/kernel/irq.c a bit.
# 
# arch/ia64/kernel/irq.c
#   2004/07/26 12:49:47-07:00 davidm@tiger.hpl.hp.com +4 -3
#   (pending_irq_cpumask): Declare as "static".
#   (move_irq): Clarify the "redirection" bit testing code a bit.
# 
# ChangeSet
#   2004/07/26 12:43:40-07:00 kaneshige.kenji@jp.fujitsu.com 
#   [PATCH] ia64: fix bug in irq_affinity_write_proc()
#   
#   Writing 'R' or 'r' character to /proc/irq/<IRQ#>/smp_affinity
#   cause a kernel Oops. The following patch fixes this issue.
#   
#   Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
#   Signed-off-by: David Mosberger <davidm@hpl.hp.com>
# 
# arch/ia64/kernel/irq.c
#   2004/07/25 18:54:00-07:00 kaneshige.kenji@jp.fujitsu.com +9 -2
#   ia64: fix bug in irq_affinity_write_proc()
# 
# ChangeSet
#   2004/07/26 10:21:02-07:00 oleg@tv-sign.ru 
#   [PATCH] populate nonlinear mappings unconditionally
#   
#   filemap_populate and shmem_populate must install even a linear file_pte,
#   in case there was a nonlinear page or file_pte already installed there:
#   could only happen if already VM_NONLINEAR, but no need to check that.
#   
#   Acked by Ingo and Hugh.
#   
#   Signed-off-by: Hugh Dickins <hugh@veritas.com>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# mm/shmem.c
#   2004/07/25 07:51:35-07:00 oleg@tv-sign.ru +3 -9
#   populate nonlinear mappings unconditionally
# 
# mm/filemap.c
#   2004/07/25 07:53:46-07:00 oleg@tv-sign.ru +3 -9
#   populate nonlinear mappings unconditionally
# 
# ChangeSet
#   2004/07/25 17:22:52-07:00 kernel@kolivas.org 
#   [IPV6]: Fix route.c gcc-3.4.x inlining error.
#   
#   Fixes the inline error when compiling net/ipv6/route.c with gcc-3.4.1
#   
#   Signed-off-by: Con Kolivas <kernel@kolivas.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/ipv6/route.c
#   2004/07/25 17:22:30-07:00 kernel@kolivas.org +1 -1
#   [IPV6]: Fix route.c gcc-3.4.x inlining error.
#   
#   Fixes the inline error when compiling net/ipv6/route.c with gcc-3.4.1
#   
#   Signed-off-by: Con Kolivas <kernel@kolivas.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/25 16:54:54-07:00 kaber@trash.net 
#   [XFRM]: Wake up km_waitq once per gc-run instead of once per state.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/xfrm/xfrm_state.c
#   2004/07/25 16:54:39-07:00 kaber@trash.net +1 -1
#   [XFRM]: Wake up km_waitq once per gc-run instead of once per state.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/25 16:49:54-07:00 davem@nuts.davemloft.net 
#   Cset exclude: davem@nuts.davemloft.net|ChangeSet|20040723204655|22654
# 
# net/sched/Kconfig
#   2004/07/25 16:49:50-07:00 davem@nuts.davemloft.net +0 -0
#   Exclude
# 
# ChangeSet
#   2004/07/25 11:12:16-07:00 viro@parcelfarce.linux.theplanet.co.uk 
#   [PATCH] sparse: simplify and tighten sparse typechecking
#   
#   This takes advantage of the simplified typeof semantics of sparse
#   address spaces, (should be enough for alpha, i386, ppc, ppc64, sparc,
#   sparc64, x86_64 - most of them didn't actually need anything to be done)
#   and couple of missing annotations that got caught by that.
# 
# include/linux/atmdev.h
#   2004/07/25 06:31:09-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1
#   sparse: simplify and tighten sparse typechecking
# 
# include/asm-x86_64/uaccess.h
#   2004/07/25 06:31:09-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1
#   sparse: simplify and tighten sparse typechecking
# 
# include/asm-ppc64/uaccess.h
#   2004/07/25 06:34:02-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1
#   sparse: simplify and tighten sparse typechecking
# 
# include/asm-ppc/uaccess.h
#   2004/07/25 06:32:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -4
#   sparse: simplify and tighten sparse typechecking
# 
# include/asm-i386/uaccess.h
#   2004/07/25 06:31:09-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1
#   sparse: simplify and tighten sparse typechecking
# 
# include/asm-alpha/uaccess.h
#   2004/07/25 06:33:36-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2
#   sparse: simplify and tighten sparse typechecking
# 
# arch/ppc/kernel/syscalls.c
#   2004/07/25 06:31:09-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1
#   sparse: simplify and tighten sparse typechecking
# 
# arch/i386/kernel/sys_i386.c
#   2004/07/25 06:31:09-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1
#   sparse: simplify and tighten sparse typechecking
# 
# ChangeSet
#   2004/07/24 22:41:08-07:00 davem@nuts.davemloft.net 
#   [SCTP]: Fix mis-merge.
# 
# net/sctp/sm_statefuns.c
#   2004/07/24 22:40:49-07:00 davem@nuts.davemloft.net +18 -4
#   [SCTP]: Fix mis-merge.
# 
# ChangeSet
#   2004/07/24 22:31:11-07:00 anton@samba.org 
#   [NET]: Use NET_IP_ALIGN in acenic.
#   
#   Use NET_IP_ALIGN in acenic driver. Also remove the 16 byte padding,
#   caches can be anywhere from 16 to 256 bytes and the skb should be
#   cacheline aligned already.
#   
#   Signed-off-by: Anton Blanchard <anton@samba.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# drivers/net/acenic.c
#   2004/07/24 22:30:56-07:00 anton@samba.org +22 -31
#   [NET]: Use NET_IP_ALIGN in acenic.
#   
#   Use NET_IP_ALIGN in acenic driver. Also remove the 16 byte padding,
#   caches can be anywhere from 16 to 256 bytes and the skb should be
#   cacheline aligned already.
#   
#   Signed-off-by: Anton Blanchard <anton@samba.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/24 22:26:27-07:00 herbert@gondor.apana.org.au 
#   [AH6]: Replace skb by iph in clear_mutable_options.
#   
#   This patch replaces the skb argument in ipv6_clear_mutable_options() by
#   an ipv6hdr.  Doing so allows us to point skb->nh elsewhere when calling
#   this function.
#   
#   I've also thrown in some obvious clean-ups for that function.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/ipv6/ah6.c
#   2004/07/24 22:26:11-07:00 herbert@gondor.apana.org.au +23 -30
#   [AH6]: Replace skb by iph in clear_mutable_options.
#   
#   This patch replaces the skb argument in ipv6_clear_mutable_options() by
#   an ipv6hdr.  Doing so allows us to point skb->nh elsewhere when calling
#   this function.
#   
#   I've also thrown in some obvious clean-ups for that function.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/24 22:24:48-07:00 herbert@gondor.apana.org.au 
#   [AH4]: Save daddr iff options are present.
#   
#   This is a little optimisation for AH4.  When I moved the tunnel code out,
#   I put the daddr copying code on the main path which is unnecessary since
#   daddr is only mutable if IP options are present.
#   
#   This patch moves the saving and restoring of daddr under the check for
#   the existence of IP options.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/ipv4/ah4.c
#   2004/07/24 22:24:32-07:00 herbert@gondor.apana.org.au +4 -3
#   [AH4]: Save daddr iff options are present.
#   
#   This is a little optimisation for AH4.  When I moved the tunnel code out,
#   I put the daddr copying code on the main path which is unnecessary since
#   daddr is only mutable if IP options are present.
#   
#   This patch moves the saving and restoring of daddr under the check for
#   the existence of IP options.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/24 22:19:43-07:00 davem@nuts.davemloft.net 
#   Cset exclude: shemminger@osdl.org|ChangeSet|20040722205059|21273
# 
# include/linux/pkt_cls.h
#   2004/07/24 22:19:38-07:00 davem@nuts.davemloft.net +0 -0
#   Exclude
# 
# ChangeSet
#   2004/07/24 22:17:10-07:00 davem@nuts.davemloft.net 
#   Merge conflicts with Yoshfuji's SNMP stats changes.
# 
# net/sctp/sm_statefuns.c
#   2004/07/24 22:16:56-07:00 davem@nuts.davemloft.net +0 -15
#    
# 
# net/sctp/outqueue.c
#   2004/07/24 22:06:46-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/sctp/associola.c
#   2004/07/24 22:06:46-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/07/24 22:01:14-07:00 kaber@trash.net 
#   [IPV4/IPV6]: Add myself to MAINTAINERS.
# 
# MAINTAINERS
#   2004/07/24 22:00:59-07:00 kaber@trash.net +2 -0
#   [IPV4/IPV6]: Add myself to MAINTAINERS.
# 
# ChangeSet
#   2004/07/24 21:51:58-07:00 torvalds@ppc970.osdl.org 
#   ppc64: fix more 0/NULL confusion
# 
# fs/proc/proc_devtree.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +2 -2
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/xics.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +4 -4
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/vio.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +1 -1
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/smp.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +2 -2
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/rtc.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +1 -1
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/rtasd.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +1 -1
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/rtas.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +2 -2
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/proc_ppc64.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +2 -2
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/pmac_pci.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +1 -1
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/pci_dn.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +5 -5
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/pSeries_lpar.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +2 -2
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/pSeries_iommu.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +2 -2
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/open_pic.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +5 -5
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/hvconsole.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +1 -1
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/eeh.c
#   2004/07/24 21:51:52-07:00 torvalds@ppc970.osdl.org +6 -6
#   ppc64: fix more 0/NULL confusion
# 
# arch/ppc64/kernel/head.S
#   2004/07/24 15:47:03-07:00 anton@samba.org +1 -1
#   ppc64: exception path optimisations
# 
# arch/ppc64/kernel/entry.S
#   2004/07/24 15:47:03-07:00 anton@samba.org +4 -4
#   ppc64: exception path optimisations
# 
# ChangeSet
#   2004/07/24 09:39:20-07:00 anton@samba.org 
#   [PATCH] ppc64: exception path optimisations
#   
#   - We were statically predicting syscalls would be 32bit which meant every
#     64bit syscall was guaranteed to be mispredicted. Just let the hardware
#     predict this one.
#   
#   - We shouldnt use blrl for indirect function calls, it is unlikely to be
#     predicted correctly and corrupts the link prediction stack. We should
#     use bctrl instead.
#   
#   - Statically predict a branch in the system call path, favouring calls from
#     userspace.
#   
#   - Remove static prediction in pagefault path, hardware prediction should do
#     a better job here.
#   
#   Signed-off-by: Anton Blanchard <anton@samba.org>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# ChangeSet
#   2004/07/24 09:38:05-07:00 anton@samba.org 
#   [PATCH] Fix ppc64 max_pfn issue - again
#   
#   It turns out in the non NUMA case, max_low_pfn doesnt get initialised
#   until init_bootmem so we need to move initialisation of max_pfn below
#   it.
#   
#   Signed-off-by: Anton Blanchard <anton@samba.org>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# arch/ppc64/mm/init.c
#   2004/07/24 08:32:48-07:00 anton@samba.org +2 -2
#   Fix ppc64 max_pfn issue - again
# 
# ChangeSet
#   2004/07/23 22:18:59-07:00 anton@samba.org 
#   [PATCH] Fix ppc64 max_pfn issue
#   
#   I noticed excessive time in the pid hash functions on a ppc64 box. It
#   turns out the pid hash is being sized way too small, eg on a 16GB box:
#   
#   PID hash table entries: 16 (order 4: 256 bytes)
#   
#   The reason is that the pid hash init function uses max_pfn before it was
#   setup on ppc64. With the following patch things are good again:
#   
#   PID hash table entries: 4096 (order 12: 65536 bytes)
#   
#   Signed-off-by: Anton Blanchard <anton@samba.org>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# arch/ppc64/mm/numa.c
#   2004/07/23 21:20:48-07:00 anton@samba.org +1 -0
#   Fix ppc64 max_pfn issue
# 
# arch/ppc64/mm/init.c
#   2004/07/23 21:22:06-07:00 anton@samba.org +2 -1
#   Fix ppc64 max_pfn issue
# 
# ChangeSet
#   2004/07/23 16:41:31-07:00 sri@us.ibm.com 
#   [SCTP] Mark chunks as ineligible for fast retransmit after they are
#   retransmitted. Also mark any chunks that could not be fit in the
#   PMTU sized packet as ineligible for fast retransmit.
#   
#   Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
# 
# net/sctp/outqueue.c
#   2004/07/23 16:41:09-07:00 sri@us.ibm.com +20 -2
#   [SCTP] Mark chunks as ineligible for fast retransmit after they are
#   retransmitted. Also mark any chunks that could not be fit in the
#   PMTU sized packet as ineligible for fast retransmit.
# 
# ChangeSet
#   2004/07/23 15:11:26-07:00 steiner@sgi.com 
#   [PATCH] ia64: Update function prototype for sn_io_addr
#   
#   Add "const" to function prototype for sn_io_addr. Cuts boot time
#   on simulator in half.
#   
#   Signed-off-by: Jack Steiner <steiner@sgi.com>
#   Signed-off-by: David Mosberger <davidm@hpl.hp.com>
# 
# include/asm-ia64/sn/sn2/io.h
#   2004/07/22 17:00:00-07:00 steiner@sgi.com +3 -2
#   ia64: Update function prototype for sn_io_addr
# 
# ChangeSet
#   2004/07/23 14:14:25-07:00 shemminger@osdl.org 
#   [NET]: eql sparse cleanup.
#   
#   Minor 0 vs NULL cleanup
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# drivers/net/eql.c
#   2004/07/23 14:14:10-07:00 shemminger@osdl.org +1 -1
#   [NET]: eql sparse cleanup.
#   
#   Minor 0 vs NULL cleanup
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/23 14:12:36-07:00 shemminger@osdl.org 
#   [IPVS]: Convert to module_param.
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/ipv4/ipvs/ip_vs_ftp.c
#   2004/07/23 14:12:21-07:00 shemminger@osdl.org +4 -2
#   [IPVS]: Convert to module_param.
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/23 13:45:21-07:00 kaber@trash.net 
#   [PKT_SCHED]: Make clock source configurable
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_htb.c
#   2004/07/23 13:45:06-07:00 kaber@trash.net +10 -0
#   [PKT_SCHED]: Make clock source configurable
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_hfsc.c
#   2004/07/23 13:45:06-07:00 kaber@trash.net +5 -5
#   [PKT_SCHED]: Make clock source configurable
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_api.c
#   2004/07/23 13:45:06-07:00 kaber@trash.net +4 -4
#   [PKT_SCHED]: Make clock source configurable
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/Kconfig
#   2004/07/23 13:45:06-07:00 kaber@trash.net +55 -0
#   [PKT_SCHED]: Make clock source configurable
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# include/net/pkt_sched.h
#   2004/07/23 13:45:06-07:00 kaber@trash.net +11 -22
#   [PKT_SCHED]: Make clock source configurable
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/23 13:26:52-07:00 herbert@gondor.apana.org.au 
#   [AH6]: Disallow mutable bits after AH header.
#   
#   As we discussed before, mutable headers should not be allowed after
#   the AH header.  In fact, this appears to be the intention of RFC 2402.
#   It is further clarified in section 3.1.1 of
#   
#   http://www.ietf.org/internet-drafts/draft-ietf-ipsec-rfc2402bis-07.txt
#   
#   This allows us to simplify the code in ah6.c.  As a result, this also
#   fixes the following issues:
#   
#   * Dependence on skb->h in ah6_output().
#   * Bogus clearing of auth_data of 2nd AH header in ipv6_clear_mutable_options().
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/ipv6/ah6.c
#   2004/07/23 13:26:37-07:00 herbert@gondor.apana.org.au +19 -54
#   [AH6]: Disallow mutable bits after AH header.
#   
#   As we discussed before, mutable headers should not be allowed after
#   the AH header.  In fact, this appears to be the intention of RFC 2402.
#   It is further clarified in section 3.1.1 of
#   
#   http://www.ietf.org/internet-drafts/draft-ietf-ipsec-rfc2402bis-07.txt
#   
#   This allows us to simplify the code in ah6.c.  As a result, this also
#   fixes the following issues:
#   
#   * Dependence on skb->h in ah6_output().
#   * Bogus clearing of auth_data of 2nd AH header in ipv6_clear_mutable_options().
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/23 13:23:48-07:00 herbert@gondor.apana.org.au 
#   [IPSEC]: Missing unlock in policy timer.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/xfrm/xfrm_policy.c
#   2004/07/23 13:23:33-07:00 herbert@gondor.apana.org.au +1 -0
#   [IPSEC]: Missing unlock in policy timer.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/23 10:26:36-07:00 davidm@napali.hpl.hp.com 
#   [PATCH] NX: allow architectures to select legacy mode dynamically
#   
#   On some platforms, you'll want to support READ_IMPLIES_EXEC differently
#   depending on personality (e.g, native binary vs. x86 binary).
#   
#   This supports that (and makes the code more readable while at it) by
#   replacing the old architecture-specific fixed LEGACY_BINARIES macro
#   define with a architecture-specific "elf_read_implies_exec_binary()"
#   helper function.
#   
#   For now, x86 is the only user, and sets the "read implies exec" bit for
#   legacy apps.  ia64 and x86-64 are likely to want to do their own thing.
#   
#   Acked by Ingo.
#   
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# include/linux/elf.h
#   2004/07/19 14:56:03-07:00 davidm@napali.hpl.hp.com +7 -0
#   NX: allow architectures to select legacy mode dynamically
# 
# include/asm-i386/elf.h
#   2004/07/19 14:55:39-07:00 davidm@napali.hpl.hp.com +3 -3
#   NX: allow architectures to select legacy mode dynamically
# 
# fs/binfmt_elf.c
#   2004/07/19 14:55:49-07:00 davidm@napali.hpl.hp.com +4 -5
#   NX: allow architectures to select legacy mode dynamically
# 
# ChangeSet
#   2004/07/22 23:22:01-07:00 sri@us.ibm.com 
#   [SCTP] Fix missing '+' in the computation of sack chunk size in
#   sctp_sm_pull_sack().
#   
#   Signed-off-by: Jorge Hernandez <jhh@lucent.com>
#   Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
# 
# net/sctp/sm_statefuns.c
#   2004/07/22 23:21:35-07:00 sri@us.ibm.com +1 -1
#   [SCTP] Fix missing '+' in the computation of sack chunk size in
#   sctp_sm_pull_sack().
# 
# ChangeSet
#   2004/07/22 23:18:24-07:00 sri@us.ibm.com 
#   [SCTP] Use idr_get_new_above() with a starting id of 1 to avoid returning
#   an associd of 0.
#   
#   Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
# 
# net/sctp/sm_make_chunk.c
#   2004/07/22 23:18:00-07:00 sri@us.ibm.com +2 -3
#   [SCTP] Use idr_get_new_above() with a starting id of 1 to avoid returning
#   an associd of 0.
# 
# ChangeSet
#   2004/07/22 23:15:55-07:00 sri@us.ibm.com 
#   [SCTP] Fix issues with handling stale cookie error over multihoming
#   associations.
#   
#   Signed-off-by: Jorge Hernandez <jhh@lucent.com>
#   Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
# 
# net/sctp/sm_statefuns.c
#   2004/07/22 23:15:32-07:00 sri@us.ibm.com +24 -12
#   [SCTP] Fix issues with handling stale cookie error over multihoming
#   associations.
# 
# net/sctp/sm_sideeffect.c
#   2004/07/22 23:15:32-07:00 sri@us.ibm.com +71 -0
#   [SCTP] Fix issues with handling stale cookie error over multihoming
#   associations.
# 
# include/net/sctp/command.h
#   2004/07/22 23:15:32-07:00 sri@us.ibm.com +3 -0
#   [SCTP] Fix issues with handling stale cookie error over multihoming
#   associations.
# 
# ChangeSet
#   2004/07/22 23:13:05-07:00 sri@us.ibm.com 
#   [SCTP] Fix data not being delivered to user in SHUTDOWN_SENT state.
#      
#   Also cleaned up sctp_sf_eat_data_6_2() and sctp_sf_eat_data_fast_4_4()
#   as they have a lot of common code.
#   
#   Signed-off-by: Jorge Hernandez <jhh@lucent.com>
#   Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
# 
# net/sctp/sm_statefuns.c
#   2004/07/22 23:12:40-07:00 sri@us.ibm.com +200 -259
#   [SCTP] Fix data not being delivered to user in SHUTDOWN_SENT state.
#      
#   Also cleaned up sctp_sf_eat_data_6_2() and sctp_sf_eat_data_fast_4_4()
#   as they have a lot of common code.
# 
# net/sctp/associola.c
#   2004/07/22 23:12:40-07:00 sri@us.ibm.com +1 -0
#   [SCTP] Fix data not being delivered to user in SHUTDOWN_SENT state.
#      
#   Also cleaned up sctp_sf_eat_data_6_2() and sctp_sf_eat_data_fast_4_4()
#   as they have a lot of common code.
# 
# include/net/sctp/sm.h
#   2004/07/22 23:12:40-07:00 sri@us.ibm.com +3 -0
#   [SCTP] Fix data not being delivered to user in SHUTDOWN_SENT state.
#      
#   Also cleaned up sctp_sf_eat_data_6_2() and sctp_sf_eat_data_fast_4_4()
#   as they have a lot of common code.
# 
# include/net/sctp/constants.h
#   2004/07/22 23:12:40-07:00 sri@us.ibm.com +4 -0
#   [SCTP] Fix data not being delivered to user in SHUTDOWN_SENT state.
#      
#   Also cleaned up sctp_sf_eat_data_6_2() and sctp_sf_eat_data_fast_4_4()
#   as they have a lot of common code.
# 
# ChangeSet
#   2004/07/22 23:09:04-07:00 sri@us.ibm.com 
#   [SCTP] Set/Get default SCTP_PEER_ADDR_PARAMS for endpoint when associd
#   and peer address are 0.
#   
#   Signed-off-by: Anand R. Setlur <asetlur@lucent.com>
#   Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
# 
# net/sctp/socket.c
#   2004/07/22 23:08:41-07:00 sri@us.ibm.com +38 -0
#   [SCTP] Set/Get default SCTP_PEER_ADDR_PARAMS for endpoint when associd
#   and peer address are 0.
# 
# ChangeSet
#   2004/07/22 18:38:29-07:00 torvalds@ppc970.osdl.org 
#   Make "install_page()" able to handle truncated pages.
#   
#   This makes it much easier on the callers, no need to
#   worry about races with vmtruncate() and friends, since
#   "install_page()" will just cleanly handle that case
#   and tell the caller about it.
# 
# mm/fremap.c
#   2004/07/22 18:38:23-07:00 torvalds@ppc970.osdl.org +8 -6
#   Make "install_page()" able to handle truncated pages.
#   
#   This makes it much easier on the callers, no need to
#   worry about races with vmtruncate() and friends, since
#   "install_page()" will just cleanly handle that case
#   and tell the caller about it.
# 
# ChangeSet
#   2004/07/22 17:26:50-07:00 apw@shadowen.org 
#   [PATCH] is_highmem() and WANT_PAGE_VIRTUAL
#   
#   Add is_highmem_idx() and is_normal_idx() to determine whether
#   a zone index is a highmem or normal zone.  Use this for
#   memmap_init_zone().
#   
#   Signed-off-by: Andy Whitcroft <apw@shadowen.org>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# mm/page_alloc.c
#   2004/07/19 08:44:36-07:00 apw@shadowen.org +1 -1
#   is_highmem() and WANT_PAGE_VIRTUAL
# 
# include/linux/mmzone.h
#   2004/07/19 08:29:22-07:00 apw@shadowen.org +11 -2
#   is_highmem() and WANT_PAGE_VIRTUAL
# 
# ChangeSet
#   2004/07/22 17:20:03-07:00 kaber@trash.net 
#   [PKT_SCHED]: Use get_cycles() for PSCHED_CPU clock source
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_api.c
#   2004/07/22 17:19:48-07:00 kaber@trash.net +11 -11
#   [PKT_SCHED]: Use get_cycles() for PSCHED_CPU clock source
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# include/net/pkt_sched.h
#   2004/07/22 17:19:48-07:00 kaber@trash.net +15 -34
#   [PKT_SCHED]: Use get_cycles() for PSCHED_CPU clock source
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/22 17:14:12-07:00 Roman.Fietze@telemotive.de 
#   [PATCH] clean up n_tty alloc_buf()
#   
#   Don't bother zeroing the allocated memory inside alloc_buf() in the
#   n_tty line discipline.  alloc_buf() is static inline and is only
#   referenced by n_tty_open() which always clears the memory (once more).
#   
#   No bug, just a minor cleanup
# 
# drivers/char/n_tty.c
#   2004/07/20 00:02:36-07:00 Roman.Fietze@telemotive.de +4 -9
#   clean up n_tty alloc_buf()
# 
# ChangeSet
#   2004/07/22 17:14:00-07:00 linux@dominikbrodowski.de 
#   [PATCH] Asus M2N notebook hides SMBus device
#   
#   Asus also "hides" the LPC bridge on M2N notebooks. Add it to
#   the asus_hides_smbus PCI quirk.
#   
#   Fixes bug #2976 @ http://bugme.osdl.org/show_bug.cgi?id=2976
#   
#   Signed-off-by: Dominik Brodowski <linux@brodo.de>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/pci/quirks.c
#   2004/07/16 01:03:09-07:00 linux@dominikbrodowski.de +6 -0
#   Asus M2N notebook hides SMBus device
# 
# ChangeSet
#   2004/07/22 17:13:11-07:00 kaber@trash.net 
#   [PKT_SCHED]: Remove dead timer code.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_api.c
#   2004/07/22 17:12:45-07:00 kaber@trash.net +1 -14
#   [PKT_SCHED]: Remove dead timer code.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# include/net/pkt_sched.h
#   2004/07/22 17:12:45-07:00 kaber@trash.net +1 -2
#   [PKT_SCHED]: Remove dead timer code.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/22 17:01:38-07:00 viro@parcelfarce.linux.theplanet.co.uk 
#   [PATCH] Missing mnt_namespace update in copy_namespace()
#   
#   copy_namespace() forgets to switch the new 'mnt_namespace' field in the
#   vfsmounts of the new namespace.
# 
# fs/namespace.c
#   2004/07/18 10:23:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +13 -11
#   Missing mnt_namespace update in copy_namespace()
# 
# ChangeSet
#   2004/07/22 14:01:38-07:00 davem@nuts.davemloft.net 
#   [TCP]: Do not overflow 16-bit window field in tcp_select_window().
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/ipv4/tcp_output.c
#   2004/07/22 14:01:10-07:00 davem@nuts.davemloft.net +8 -0
#   [TCP]: Do not overflow 16-bit window field in tcp_select_window().
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/22 12:16:19-07:00 herbert@gondor.apana.org.au 
#   [INET]: Create enum of ECN bits
#   
#   This patch is a preparation for an update of the ECN encap/decap
#   code with respect to RFC3168.
#   
#   It creates an enum of the four code-points defined by RFC3168
#   and uses them throughout the inet_ecn.h file.
#   
#   The only non-trivial bit is in IP_ECN_set_ce/IP6_ECN_set_ce where
#   the patch uses INET_ECN_CE instead of 1.  This is OK as those
#   functions assume that the ECT bit is already set.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# include/net/inet_ecn.h
#   2004/07/22 12:16:04-07:00 herbert@gondor.apana.org.au +25 -16
#   [INET]: Create enum of ECN bits
#   
#   This patch is a preparation for an update of the ECN encap/decap
#   code with respect to RFC3168.
#   
#   It creates an enum of the four code-points defined by RFC3168
#   and uses them throughout the inet_ecn.h file.
#   
#   The only non-trivial bit is in IP_ECN_set_ce/IP6_ECN_set_ce where
#   the patch uses INET_ECN_CE instead of 1.  This is OK as those
#   functions assume that the ECT bit is already set.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/22 12:14:36-07:00 herbert@gondor.apana.org.au 
#   [IPSEC]: Fix IPCOMP6 ICMP type check.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/ipv6/ipcomp6.c
#   2004/07/22 12:14:21-07:00 herbert@gondor.apana.org.au +1 -1
#   [IPSEC]: Fix IPCOMP6 ICMP type check.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 17:18:28-07:00 davem@nuts.davemloft.net 
#   [ATM]: Update Marko Kiiskila's email address.
# 
# net/atm/lec_arpc.h
#   2004/07/21 17:18:01-07:00 davem@nuts.davemloft.net +1 -1
#   [ATM]: Update Marko Kiiskila's email address.
# 
# net/atm/lec.h
#   2004/07/21 17:18:01-07:00 davem@nuts.davemloft.net +1 -1
#   [ATM]: Update Marko Kiiskila's email address.
# 
# net/atm/lec.c
#   2004/07/21 17:18:01-07:00 davem@nuts.davemloft.net +1 -1
#   [ATM]: Update Marko Kiiskila's email address.
# 
# include/linux/atmlec.h
#   2004/07/21 17:18:01-07:00 davem@nuts.davemloft.net +1 -1
#   [ATM]: Update Marko Kiiskila's email address.
# 
# ChangeSet
#   2004/07/21 16:47:01-07:00 davem@nuts.davemloft.net 
#   [IPV4]: Make raw sockets behave like udp wrt. MSG_TRUNC.
# 
# net/ipv6/raw.c
#   2004/07/21 16:46:40-07:00 davem@nuts.davemloft.net +3 -0
#   [IPV4]: Make raw sockets behave like udp wrt. MSG_TRUNC.
# 
# net/ipv4/raw.c
#   2004/07/21 16:46:40-07:00 davem@nuts.davemloft.net +3 -1
#   [IPV4]: Make raw sockets behave like udp wrt. MSG_TRUNC.
# 
# ChangeSet
#   2004/07/21 16:08:53-07:00 chas@relax.cmd.nrl.navy.mil 
#   [ATM]: use try_module_get appropriately (from Stephen Hemminger <shemminger@osdl.org>)
# 
# net/atm/pppoatm.c
#   2004/07/21 16:08:38-07:00 chas@relax.cmd.nrl.navy.mil +1 -1
#   [ATM]: use try_module_get appropriately (from Stephen Hemminger <shemminger@osdl.org>)
# 
# net/atm/br2684.c
#   2004/07/21 16:08:38-07:00 chas@relax.cmd.nrl.navy.mil +1 -1
#   [ATM]: use try_module_get appropriately (from Stephen Hemminger <shemminger@osdl.org>)
# 
# ChangeSet
#   2004/07/21 15:55:16-07:00 davem@nuts.davemloft.net 
#   Merge bk://bk.skbuff.net:20608/linux-2.6-dgramconnect/
#   into nuts.davemloft.net:/disk1/BK/net-2.6
# 
# net/ipv6/udp.c
#   2004/07/21 15:55:07-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv6/raw.c
#   2004/07/21 15:55:07-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv4/udp.c
#   2004/07/21 15:55:07-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv4/raw.c
#   2004/07/21 15:55:07-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/07/21 14:51:31-07:00 herbert@gondor.apana.org.au 
#   [CRYPTO]: Fix stack overrun in crypt().
#   
#   The stack allocation in crypt() is bogus as whether tmp_src/tmp_dst
#   is used is determined by factors unrelated to nbytes and
#   src->length/dst->length.
#   
#   Since the condition for whether tmp_src/tmp_dst are used is very
#   complex, let's allocate them always instead of guessing.
#   
#   This fixes a number of weird crashes including those AES crashes
#   that people have been seeing with the 2.4 backport + ipt_conntrack.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: James Morris <jmorris@redhat.com>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# crypto/cipher.c
#   2004/07/21 14:51:14-07:00 herbert@gondor.apana.org.au +2 -2
#   [CRYPTO]: Fix stack overrun in crypt().
#   
#   The stack allocation in crypt() is bogus as whether tmp_src/tmp_dst
#   is used is determined by factors unrelated to nbytes and
#   src->length/dst->length.
#   
#   Since the condition for whether tmp_src/tmp_dst are used is very
#   complex, let's allocate them always instead of guessing.
#   
#   This fixes a number of weird crashes including those AES crashes
#   that people have been seeing with the 2.4 backport + ipt_conntrack.
#   
#   Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#   Signed-off-by: James Morris <jmorris@redhat.com>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 14:27:07-07:00 wli@holomorphy.com 
#   [SPARC32]: Mark William Lee Irwin III as maintainer.
# 
# MAINTAINERS
#   2004/07/21 14:26:51-07:00 wli@holomorphy.com +2 -2
#   [SPARC32]: Mark William Lee Irwin III as maintainer.
# 
# ChangeSet
#   2004/07/21 13:51:01-07:00 Samuel.Thibault@ens-lyon.fr 
#   [UDP]: Return true length if user specifies MSG_TRUNC.
# 
# net/ipv6/udp.c
#   2004/07/21 13:50:40-07:00 Samuel.Thibault@ens-lyon.fr +3 -0
#   [UDP]: Return true length if user specifies MSG_TRUNC.
# 
# net/ipv4/udp.c
#   2004/07/21 13:50:40-07:00 Samuel.Thibault@ens-lyon.fr +3 -0
#   [UDP]: Return true length if user specifies MSG_TRUNC.
# 
# ChangeSet
#   2004/07/21 13:44:37-07:00 tcallawa@redhat.com 
#   [SPARC]: Add pci_dma_mapping_error to pci.h
#   
#   Signed-off-by: Tom Callaway <tcallawa@redhat.com>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# include/asm-sparc/pci.h
#   2004/07/21 13:44:22-07:00 tcallawa@redhat.com +7 -0
#   [SPARC]: Add pci_dma_mapping_error to pci.h
#   
#   Signed-off-by: Tom Callaway <tcallawa@redhat.com>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 13:42:08-07:00 tcallawa@redhat.com 
#   [SPARC]: Fix copy_user.S with gcc 3.3
#   
#   Signed-off-by: Tom Callaway <tcallawa@redhat.com>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# arch/sparc/lib/copy_user.S
#   2004/07/21 13:41:53-07:00 tcallawa@redhat.com +38 -38
#   [SPARC]: Fix copy_user.S with gcc 3.3
#   
#   Signed-off-by: Tom Callaway <tcallawa@redhat.com>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 13:41:01-07:00 shemminger@osdl.org 
#   [IPV6]: Missing sparse annotation in addrconf.
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/ipv6/addrconf.c
#   2004/07/21 13:40:46-07:00 shemminger@osdl.org +1 -1
#   [IPV6]: Missing sparse annotation in addrconf.
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 13:34:49-07:00 shemminger@osdl.org 
#   [PKT_SCHED]: Need delayed packet limit in sch_netem.
#   
#   The netem scheduler needs to limit its delayed packet queue to prevent
#   a application burst from chewing up too much memory.
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_netem.c
#   2004/07/21 13:34:33-07:00 shemminger@osdl.org +11 -5
#   [PKT_SCHED]: Need delayed packet limit in sch_netem.
#   
#   The netem scheduler needs to limit its delayed packet queue to prevent
#   a application burst from chewing up too much memory.
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 13:33:42-07:00 shemminger@osdl.org 
#   [PKT_SCHED]: Missing qdisc destroy in sch_netem.
#   
#   The underlying qdisc was not being properly destroyed, shows up as
#   assertion failure on device removal.
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_netem.c
#   2004/07/21 13:33:26-07:00 shemminger@osdl.org +3 -0
#   [PKT_SCHED]: Missing qdisc destroy in sch_netem.
#   
#   The underlying qdisc was not being properly destroyed, shows up as
#   assertion failure on device removal.
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 13:31:05-07:00 shemminger@osdl.org 
#   [PKT_SCHED]: Make sch_netem classful.
#   
#   Simple enhancement to netem packet scheduler that makes it classful so
#   that the underlying pfifo default discipline can be substituted with something
#   else (tbf, red, ...)
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# net/sched/sch_netem.c
#   2004/07/21 13:30:41-07:00 shemminger@osdl.org +87 -0
#   [PKT_SCHED]: Make sch_netem classful.
#   
#   Simple enhancement to netem packet scheduler that makes it classful so
#   that the underlying pfifo default discipline can be substituted with something
#   else (tbf, red, ...)
#   
#   Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 13:27:12-07:00 dave@thedillows.org 
#   [SPARC64]: Handle SBUS dma allocations larger than 1MB.
#   
#   Signed-off-by: David Dillow <dave@thedillows.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# arch/sparc64/kernel/sbus.c
#   2004/07/21 13:26:57-07:00 dave@thedillows.org +50 -17
#   [SPARC64]: Handle SBUS dma allocations larger than 1MB.
#   
#   Signed-off-by: David Dillow <dave@thedillows.org>
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/21 13:12:56-07:00 davem@nuts.davemloft.net 
#   [SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.
#   
#   - Make SUNOS_EMUL depend upon BINFMT_AOUT32
#   - Make SOLARIS_EMUL depend upon SPARC32_COMPAT
#   - Add CONFIG_COMPAT guards, where necessary.
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# include/asm-sparc64/ttable.h
#   2004/07/21 13:12:26-07:00 davem@nuts.davemloft.net +4 -0
#   [SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.
#   
#   - Make SUNOS_EMUL depend upon BINFMT_AOUT32
#   - Make SOLARIS_EMUL depend upon SPARC32_COMPAT
#   - Add CONFIG_COMPAT guards, where necessary.
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# include/asm-sparc64/signal.h
#   2004/07/21 13:12:26-07:00 davem@nuts.davemloft.net +11 -0
#   [SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.
#   
#   - Make SUNOS_EMUL depend upon BINFMT_AOUT32
#   - Make SOLARIS_EMUL depend upon SPARC32_COMPAT
#   - Add CONFIG_COMPAT guards, where necessary.
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# include/asm-sparc64/siginfo.h
#   2004/07/21 13:12:26-07:00 davem@nuts.davemloft.net +8 -0
#   [SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.
#   
#   - Make SUNOS_EMUL depend upon BINFMT_AOUT32
#   - Make SOLARIS_EMUL depend upon SPARC32_COMPAT
#   - Add CONFIG_COMPAT guards, where necessary.
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# arch/sparc64/kernel/systbls.S
#   2004/07/21 13:12:26-07:00 davem@nuts.davemloft.net +4 -1
#   [SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.
#   
#   - Make SUNOS_EMUL depend upon BINFMT_AOUT32
#   - Make SOLARIS_EMUL depend upon SPARC32_COMPAT
#   - Add CONFIG_COMPAT guards, where necessary.
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# arch/sparc64/kernel/process.c
#   2004/07/21 13:12:26-07:00 davem@nuts.davemloft.net +6 -1
#   [SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.
#   
#   - Make SUNOS_EMUL depend upon BINFMT_AOUT32
#   - Make SOLARIS_EMUL depend upon SPARC32_COMPAT
#   - Add CONFIG_COMPAT guards, where necessary.
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# arch/sparc64/kernel/entry.S
#   2004/07/21 13:12:26-07:00 davem@nuts.davemloft.net +21 -7
#   [SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.
#   
#   - Make SUNOS_EMUL depend upon BINFMT_AOUT32
#   - Make SOLARIS_EMUL depend upon SPARC32_COMPAT
#   - Add CONFIG_COMPAT guards, where necessary.
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# arch/sparc64/Kconfig
#   2004/07/21 13:12:26-07:00 davem@nuts.davemloft.net +2 -1
#   [SPARC64]: Fix allnoconfig build, based upon a patch from Roland Dreier.
#   
#   - Make SUNOS_EMUL depend upon BINFMT_AOUT32
#   - Make SOLARIS_EMUL depend upon SPARC32_COMPAT
#   - Add CONFIG_COMPAT guards, where necessary.
#   
#   Signed-off-by: David S. Miller <davem@redhat.com>
# 
# ChangeSet
#   2004/07/20 15:57:37-07:00 davem@nuts.davemloft.net 
#   [SPARC64]: Update defconfig.
# 
# arch/sparc64/defconfig
#   2004/07/20 15:57:18-07:00 davem@nuts.davemloft.net +6 -5
#   [SPARC64]: Update defconfig.
# 
# ChangeSet
#   2004/07/20 15:55:45-07:00 davem@nuts.davemloft.net 
#   [SPARC64]: Export __copy_in_user to modules.
# 
# arch/sparc64/kernel/sparc64_ksyms.c
#   2004/07/20 15:55:23-07:00 davem@nuts.davemloft.net +2 -1
#   [SPARC64]: Export __copy_in_user to modules.
# 
# ChangeSet
#   2004/07/20 14:55:45-07:00 davem@nuts.davemloft.net 
#   Merge bk://bk.skbuff.net:20608/linux-2.6-snmp-20040708
#   into nuts.davemloft.net:/disk1/BK/snmp-2.6
# 
# net/sctp/ulpqueue.c
#   2004/07/20 14:55:36-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/sctp/sm_statefuns.c
#   2004/07/20 14:55:35-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/sctp/protocol.c
#   2004/07/20 14:55:35-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/sctp/outqueue.c
#   2004/07/20 14:55:35-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/sctp/output.c
#   2004/07/20 14:55:35-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv6/route.c
#   2004/07/20 14:55:35-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv6/mcast.c
#   2004/07/20 14:55:35-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv6/ip6_output.c
#   2004/07/20 14:55:35-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv4/tcp_output.c
#   2004/07/20 14:55:34-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv4/ipmr.c
#   2004/07/20 14:55:34-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# net/ipv4/ip_output.c
#   2004/07/20 14:55:34-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# include/net/tcp.h
#   2004/07/20 14:55:34-07:00 davem@nuts.davemloft.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/07/20 14:07:48-07:00 jbarnes@sgi.com 
#   [PATCH] ia64: sn2 requires a 3.40 or better PROM
#   
#   The SGI 3.40 PROM includes a fix for the move of the init_task to
#   region 5, so specify that in sn_sal.h.  Unfortunately, the check for
#   the minimum required version happens *after* the hang/MCA that is
#   symptomatic of the bug, so this message also acts as an announcement
#   of the requirement.
#   
#   Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
#   Signed-off-by: David Mosberger <davidm@hpl.hp.com>
# 
# include/asm-ia64/sn/sn_sal.h
#   2004/07/20 12:35:37-07:00 jbarnes@sgi.com +2 -2
#   ia64: sn2 requires a 3.40 or better PROM
# 
# ChangeSet
#   2004/07/19 12:27:06-07:00 jbarnes@engr.sgi.com 
#   [PATCH] ia64:  update sn2_defconfig to include new console
#   
#   Now that Linus' tree has the new sn2 console driver, make sn2_defconfig enable 
#   it by default.  The device is major 204, minor 40.  Note that you'll probably 
#   have to update your elilo.conf and inittab to use the new driver, as it's 
#   called ttySG0 rather than ttyS0.
#   
#   Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
#   Signed-off-by: David Mosberger <davidm@hpl.hp.com>
# 
# arch/ia64/configs/sn2_defconfig
#   2004/07/18 13:14:30-07:00 jbarnes@engr.sgi.com +13 -3
#   ia64:  update sn2_defconfig to include new console
# 
# ChangeSet
#   2004/07/19 23:25:15+09:00 yoshfuji@linux-ipv6.org 
#   [IPV6] remove rather pointless comment.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/net/ip6_route.h
#   2004/07/19 23:25:05+09:00 yoshfuji@linux-ipv6.org +0 -2
#   [IPV6] remove rather pointless comment.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# ChangeSet
#   2004/07/19 23:16:36+09:00 yoshfuji@linux-ipv6.org 
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/datagram.c
#   2004/07/19 23:16:26+09:00 yoshfuji@linux-ipv6.org +73 -0
# 
# net/ipv6/udp.c
#   2004/07/19 23:16:26+09:00 yoshfuji@linux-ipv6.org +2 -154
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/raw.c
#   2004/07/19 23:16:26+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/datagram.c
#   2004/07/19 23:16:26+09:00 yoshfuji@linux-ipv6.org +156 -0
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/udp.c
#   2004/07/19 23:16:26+09:00 yoshfuji@linux-ipv6.org +1 -50
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/raw.c
#   2004/07/19 23:16:26+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/datagram.c
#   2004/07/19 23:16:26+09:00 yoshfuji@linux-ipv6.org +0 -0
#   BitKeeper file /home2/yoshfuji/BitKeeper/linux-2.6-export-2.6.8/linux-2.6-dgramconnect/net/ipv4/datagram.c
# 
# net/ipv4/Makefile
#   2004/07/19 23:16:25+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/net/udp.h
#   2004/07/19 23:16:25+09:00 yoshfuji@linux-ipv6.org +0 -2
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/net/ipv6.h
#   2004/07/19 23:16:25+09:00 yoshfuji@linux-ipv6.org +3 -0
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/net/ip.h
#   2004/07/19 23:16:25+09:00 yoshfuji@linux-ipv6.org +3 -0
#   [IPV4] Look up route with appropriate protocol when we connect().
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# ChangeSet
#   2004/07/18 09:08:19-07:00 mingo@elte.hu 
#   [PATCH] NX: clean up legacy binary support
#   
#   This cleans up legacy x86 binary support by introducing a new
#   personality bit: READ_IMPLIES_EXEC, and implements Linus' suggestion to
#   add the PROT_EXEC bit on the two affected syscall entry places,
#   sys_mprotect() and sys_mmap().  If this bit is set then PROT_READ will
#   also add the PROT_EXEC bit - as expected by legacy x86 binaries.  The
#   ELF loader will automatically set this bit when it encounters a legacy
#   binary.
#   
#   This approach avoids the problems the previous ->def_flags solution
#   caused.  In particular this patch fixes the PROT_NONE problem in a
#   cleaner way (http://lkml.org/lkml/2004/7/12/227), and it should fix the
#   ia64 PROT_EXEC problem reported by David Mosberger.  Also,
#   mprotect(PROT_READ) done by legacy binaries will do the right thing as
#   well. 
#   
#   the details:
#   
#   - the personality bit is added to the personality mask upon exec(),
#     within the ELF loader, but is not cleared (see the exceptions below). 
#     This means that if an environment that already has the bit exec()s a
#     new-style binary it will still get the old behavior.
#   
#   - one exception are setuid/setgid binaries: these will reset the
#     bit - thus local attackers cannot manually set the bit and circumvent
#     NX protection. Legacy setuid binaries will still get the bit through
#     the ELF loader. This gives us maximum flexibility in shaping
#     compatibility environments.
#   
#   - selinux also clears the bit when switching SIDs via exec().
#   
#   - x86 is the only arch making use of READ_IMPLIES_EXEC currently. Other
#     arches will have the pre-NX-patch protection setup they always had.
#   
#   I have booted an old distro [RH 7.2] and two new PT_GNU_STACK distros
#   [SuSE 9.2 and FC2] on an NX-capable CPU - they work just fine and all
#   the mapping details are right. I've checked the PROT_NONE test-utility
#   as well and it works as expected. I have checked various setuid
#   scenarios as well involving legacy and new-style binaries.
#   
#   an improved setarch utility can be used to set the personality bit
#   manually:
#   
#   	http://redhat.com/~mingo/nx-patches/setarch-1.4-3.tar.gz
#   
#   the new '-X' flag does it, e.g.:
#   
#   	./setarch -X linux /bin/cat /proc/self/maps
#   
#   will trigger the old protection layout even on a new distro.
#   
#   Signed-off-by: Ingo Molnar <mingo@elte.hu>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# security/selinux/hooks.c
#   2004/07/17 17:00:00-07:00 mingo@elte.hu +3 -0
#   NX: clean up legacy binary support
# 
# mm/mprotect.c
#   2004/07/17 17:00:00-07:00 mingo@elte.hu +7 -0
#   NX: clean up legacy binary support
# 
# mm/mmap.c
#   2004/07/17 17:00:00-07:00 mingo@elte.hu +7 -6
#   NX: clean up legacy binary support
# 
# include/linux/personality.h
#   2004/07/17 17:00:00-07:00 mingo@elte.hu +7 -0
#   NX: clean up legacy binary support
# 
# include/asm-i386/page.h
#   2004/07/17 17:00:00-07:00 mingo@elte.hu +4 -2
#   NX: clean up legacy binary support
# 
# include/asm-i386/elf.h
#   2004/07/17 17:00:00-07:00 mingo@elte.hu +7 -1
#   NX: clean up legacy binary support
# 
# fs/exec.c
#   2004/07/17 17:00:00-07:00 mingo@elte.hu +6 -2
#   NX: clean up legacy binary support
# 
# fs/binfmt_elf.c
#   2004/07/17 17:00:00-07:00 mingo@elte.hu +3 -1
#   NX: clean up legacy binary support
# 
# ChangeSet
#   2004/07/18 09:06:48-07:00 eger@havoc.gtf.org 
#   [PATCH] pmac_zilog: serial minors taken failure path fix
#   
#   I've tracked down the core issue giving me the oops wrt pmac_zilog.
#   
#   When you have two serial drivers, (e.g. 8250 and PMAC_ZILOG) they both say
#   
#   "I want to reserve X ports starting with major TTY_MAJOR and minor 64".
#   
#   By the time pmac_zilog gets there, the ports it requests are already
#   reserved.  Unfortunately, init_pmz() doesn't check for pmz_register()
#   failure, and so it merrily goes on to register the half-initialized
#   pmac_zilog driver with the power management subsystem.
#   
#   This path provides a proper failure path.
#   
#   Also: 
#   
#   Restore ppc configs now that I know people use AT Keyboards on CHRP and PReP
#   machines, and the zilog driver is no longer Oops'ing.
#   
#   Signed-off-by: David Eger <eger@havoc.gtf.org>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# drivers/serial/pmac_zilog.c
#   2004/07/18 08:29:40-07:00 eger@havoc.gtf.org +27 -5
#   pmac_zilog: serial minors taken failure path fix
# 
# arch/ppc/defconfig
#   2004/07/18 08:29:41-07:00 eger@havoc.gtf.org +3 -3
#   pmac_zilog: serial minors taken failure path fix
# 
# ChangeSet
#   2004/07/16 21:40:02-07:00 eranian@hpl.hp.com 
#   [PATCH] ia64: fix perfmon bug that could result in kernel hang
#   
#   This patch fixes a potential kernel hang in perfmon during
#   PFM_UNLOAD_CONTEXT.  This commands requires that the monitored task be
#   stopped (except when self-monitoring). The task state tests in
#   check_task_state() were incorrect and an actively running task was
#   accepted for PFM_UNLOAD_CONTEXT. This eventually leads to a kernel
#   hang.
#   
#   Signed-off-by: Stephane Eranian <eranian@hpl.hp.com>
#   Signed-off-by: David Mosberger <davidm@hpl.hp.com>
# 
# arch/ia64/kernel/perfmon.c
#   2004/07/16 16:03:23-07:00 eranian@hpl.hp.com +8 -6
#   ia64: fix perfmon bug that could result in kernel hang
# 
# ChangeSet
#   2004/07/16 17:50:14-07:00 davidm@tiger.hpl.hp.com 
#   ia64: Nuke two compiler-warnings.
# 
# arch/ia64/kernel/mca.c
#   2004/07/16 17:50:04-07:00 davidm@tiger.hpl.hp.com +2 -2
#   (cpe_vector): Move it inside the CONFIG_ACPI bracket.
# 
# arch/ia64/hp/sim/hpsim_irq.c
#   2004/07/16 17:50:04-07:00 davidm@tiger.hpl.hp.com +6 -1
#   (hpsim_set_affinity_noop): New function.
#   (irq_type_hp_sim): Use hpsim_set_affinity_noop() to avoid casting
#   	function pointers.
# 
# ChangeSet
#   2004/07/16 16:14:38-07:00 jbarnes@engr.sgi.com 
#   [PATCH] ia64: make madt parsing quieter
#   
#   We already get this info in other forms from other boot messages, so kill the 
#   printing of the MADT entries as they're parsed.  This patch significantly 
#   reduces the amount of output from a boot of a 512p system.
#   
#   Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
#   Signed-off-by: David Mosberger <davidm@hpl.hp.com>
# 
# arch/ia64/kernel/acpi.c
#   2004/07/15 14:41:29-07:00 jbarnes@engr.sgi.com +1 -25
#   ia64: make madt parsing quieter
# 
# ChangeSet
#   2004/07/16 14:05:36+02:00 marcel@holtmann.org 
#   [Bluetooth] Use a signed integer for the RSSI value
#   
#   The RSSI value in the inquiry response with RSSI must be a signed
#   integer and not an unsigned one.
#   
#   Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
# 
# include/net/bluetooth/hci.h
#   2004/07/16 14:04:13+02:00 marcel@holtmann.org +1 -1
#   Use a signed integer for the RSSI value
# 
# ChangeSet
#   2004/07/16 13:27:29+02:00 marcel@holtmann.org 
#   [Bluetooth] Add missing entry for the HIDP support
#   
#   This small patch adds the missing entry about the HIDP support
#   to the main Kconfig file of the Bluetooth subsystem.
#   
#   Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
# 
# net/bluetooth/Kconfig
#   2004/07/16 13:25:28+02:00 marcel@holtmann.org +1 -0
#   Add missing entry for the HIDP support
# 
# ChangeSet
#   2004/07/16 12:59:11+02:00 marcel@holtmann.org 
#   [Bluetooth] Make use of usb_kill_urb()
#   
#   Now that usb_kill_urb() is in the main kernel tree it should
#   be used. This patch makes the needed modifications to the USB
#   Bluetooth driver.
#   
#   Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
#   Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
# 
# drivers/bluetooth/hci_usb.c
#   2004/07/16 12:55:02+02:00 marcel@holtmann.org +3 -12
#   Make use of usb_kill_urb()
# 
# ChangeSet
#   2004/07/16 12:53:17+02:00 marcel@holtmann.org 
#   [Bluetooth] Add support for another ALPS module
#   
#   This patch adds the specific vendor and product id's for another
#   ALPS module which don't uses the USB Bluetooth class id.
#   
#   Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
# 
# drivers/bluetooth/hci_usb.c
#   2004/07/16 12:51:54+02:00 marcel@holtmann.org +6 -5
#   Add support for another ALPS module
# 
# ChangeSet
#   2004/07/15 10:44:57-07:00 josha@sgi.com 
#   [PATCH] ia64: fix obsolete and now misleading comment
#   
#   Signed-off-by: Josh Aas <josha@sgi.com>
#   Signed-off-by: David Mosberger <davidm@hpl.hp.com>
# 
# arch/ia64/mm/init.c
#   2004/07/14 14:50:59-07:00 josha@sgi.com +2 -2
#   ia64: fix obsolete and now misleading comment
# 
# ChangeSet
#   2004/07/14 16:25:50-07:00 kaos@sgi.com 
#   [PATCH] ia64: Extend oem section types for SN mca records
#   
#   SN mca records now contain oem data for platform memory errors.
#   
#   Signed-off-by: Keith Owens <kaos@sgi.com>
#   Signed-off-by: David Mosberger <davidm@hpl.hp.com>
# 
# arch/ia64/sn/kernel/mca.c
#   2004/07/13 01:00:52-07:00 kaos@sgi.com +2 -1
#   ia64: Extend oem section types for SN mca records
# 
# ChangeSet
#   2004/07/08 07:50:01+09:00 yoshfuji@linux-ipv6.org 
#   [NET] use seq_puts() where appropriate.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/tcp_ipv6.c
#   2004/07/08 07:49:52+09:00 yoshfuji@linux-ipv6.org +6 -6
#   [NET] use seq_puts() where appropriate.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/ip6_flowlabel.c
#   2004/07/08 07:49:52+09:00 yoshfuji@linux-ipv6.org +2 -2
#   [NET] use seq_puts() where appropriate.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/proc.c
#   2004/07/08 07:49:52+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] use seq_puts() where appropriate.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/igmp.c
#   2004/07/08 07:49:52+09:00 yoshfuji@linux-ipv6.org +2 -2
#   [NET] use seq_puts() where appropriate.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# ChangeSet
#   2004/07/08 07:40:44+09:00 yoshfuji@linux-ipv6.org 
#   [NET] fold long comment lines.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/net/snmp.h
#   2004/07/08 07:40:35+09:00 yoshfuji@linux-ipv6.org +15 -13
#   [NET] fold long comment lines.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# ChangeSet
#   2004/07/08 07:38:12+09:00 yoshfuji@linux-ipv6.org 
#   [NET] use SNMP_MIB_ITEM for MIB description.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/proc.c
#   2004/07/08 07:38:03+09:00 yoshfuji@linux-ipv6.org +22 -23
#   [NET] use SNMP_MIB_ITEM for MIB description.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/proc.c
#   2004/07/08 07:38:03+09:00 yoshfuji@linux-ipv6.org +181 -75
#   [NET] use SNMP_MIB_ITEM for MIB description.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# ChangeSet
#   2004/07/08 07:18:00+09:00 yoshfuji@linux-ipv6.org 
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/linux/snmp.h
#   2004/07/08 07:17:32+09:00 yoshfuji@linux-ipv6.org +266 -0
# 
# net/sctp/ulpqueue.c
#   2004/07/08 07:17:32+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/linux/snmp.h
#   2004/07/08 07:17:32+09:00 yoshfuji@linux-ipv6.org +0 -0
#   BitKeeper file /home2/yoshfuji/BitKeeper/linux-2.6-export-2.6.8/linux-2.6-snmp-20040708/include/linux/snmp.h
# 
# net/sctp/sm_statefuns.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +47 -47
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/protocol.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/outqueue.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +4 -4
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/output.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/ipv6.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +2 -2
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/input.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +7 -7
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/endpointola.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/chunk.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/sctp/associola.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/udp.c
#   2004/07/08 07:17:31+09:00 yoshfuji@linux-ipv6.org +7 -7
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/tcp_ipv6.c
#   2004/07/08 07:17:30+09:00 yoshfuji@linux-ipv6.org +18 -16
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/route.c
#   2004/07/08 07:17:30+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/reassembly.c
#   2004/07/08 07:17:30+09:00 yoshfuji@linux-ipv6.org +14 -14
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/raw.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +2 -2
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/proc.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +64 -74
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/ndisc.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +12 -12
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/mcast.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +12 -12
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/ip6_output.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +24 -24
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/ip6_input.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +12 -12
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/icmp.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +9 -9
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv6/exthdrs.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +14 -14
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/udp.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +10 -10
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/tcp_timer.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +12 -12
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/tcp_output.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +9 -9
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/tcp_minisocks.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +6 -6
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/tcp_ipv4.c
#   2004/07/08 07:17:29+09:00 yoshfuji@linux-ipv6.org +21 -21
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/tcp_input.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +39 -39
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/tcp.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +9 -9
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/syncookies.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +3 -3
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/raw.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/proc.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +30 -42
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/ipmr.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +2 -2
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/ip_output.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +11 -11
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/ip_input.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +8 -8
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/ip_fragment.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +7 -7
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/ip_forward.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/icmp.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +48 -48
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# net/ipv4/arp.c
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +1 -1
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/net/tcp.h
#   2004/07/08 07:17:28+09:00 yoshfuji@linux-ipv6.org +8 -8
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/net/snmp.h
#   2004/07/08 07:17:27+09:00 yoshfuji@linux-ipv6.org +76 -267
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
# include/net/icmp.h
#   2004/07/08 07:17:27+09:00 yoshfuji@linux-ipv6.org +0 -12
#   [NET] convert storage for MIB from struct member to array item.
#   
#   Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
# 
diff -Nru a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS	2004-07-27 18:24:52 -07:00
+++ b/MAINTAINERS	2004-07-27 18:24:52 -07:00
@@ -1494,6 +1494,8 @@
 M:	jmorris@redhat.com
 P:	Hideaki YOSHIFUJI
 M:	yoshfuji@linux-ipv6.org
+P:	Patrick McHardy
+M:	kaber@coreworks.de
 L:	netdev@oss.sgi.com
 S:	Maintained
 
@@ -1945,8 +1947,8 @@
 S:	Maintained
 
 SPARC (sparc32):
-P:	Keith M. Wesolowski
-M:	wesolows@foobazco.org
+P:	William L. Irwin
+M:	wli@holomorphy.com
 L:	sparclinux@vger.kernel.org
 S:	Maintained
 
diff -Nru a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c
--- a/arch/i386/kernel/sys_i386.c	2004-07-27 18:24:52 -07:00
+++ b/arch/i386/kernel/sys_i386.c	2004-07-27 18:24:52 -07:00
@@ -149,7 +149,7 @@
 		union semun fourth;
 		if (!ptr)
 			return -EINVAL;
-		if (get_user(fourth.__pad, (void * __user *) ptr))
+		if (get_user(fourth.__pad, (void __user * __user *) ptr))
 			return -EFAULT;
 		return sys_semctl (first, second, third, fourth);
 	}
diff -Nru a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
--- a/arch/ia64/configs/sn2_defconfig	2004-07-27 18:24:51 -07:00
+++ b/arch/ia64/configs/sn2_defconfig	2004-07-27 18:24:51 -07:00
@@ -24,6 +24,7 @@
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -85,6 +86,7 @@
 # Firmware Drivers
 #
 CONFIG_EFI_VARS=y
+# CONFIG_EFI_PCDP is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 
@@ -271,7 +273,6 @@
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
 CONFIG_SCSI_SATA=y
 # CONFIG_SCSI_SATA_SVW is not set
@@ -527,8 +528,6 @@
 # CONFIG_SYNCLINKMP is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_STALDRV is not set
-CONFIG_SGI_L1_SERIAL=y
-CONFIG_SGI_L1_SERIAL_CONSOLE=y
 
 #
 # Serial drivers
@@ -538,6 +537,8 @@
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_SGI_L1_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -573,6 +574,11 @@
 # CONFIG_I2C is not set
 
 #
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
 # Misc devices
 #
 
@@ -751,6 +757,7 @@
 CONFIG_JOLIET=y
 # CONFIG_ZISOFS is not set
 CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
 
 #
 # DOS/FAT/NT Filesystems
@@ -785,6 +792,7 @@
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -885,6 +893,7 @@
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=y
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=m
@@ -935,6 +944,7 @@
 # CONFIG_CRYPTO_AES is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=m
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
diff -Nru a/arch/ia64/defconfig b/arch/ia64/defconfig
--- a/arch/ia64/defconfig	2004-07-27 18:24:51 -07:00
+++ b/arch/ia64/defconfig	2004-07-27 18:24:51 -07:00
@@ -18,6 +18,7 @@
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=16
@@ -27,6 +28,7 @@
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -86,6 +88,7 @@
 # Firmware Drivers
 #
 CONFIG_EFI_VARS=y
+CONFIG_EFI_PCDP=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=y
 
@@ -136,6 +139,7 @@
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
 
@@ -163,7 +167,7 @@
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
@@ -177,6 +181,7 @@
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_IDEDISK_MULTI_MODE=y
 CONFIG_BLK_DEV_IDECD=y
@@ -259,6 +264,7 @@
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
@@ -312,6 +318,9 @@
 CONFIG_MD_MULTIPATH=m
 CONFIG_BLK_DEV_DM=m
 # CONFIG_DM_CRYPT is not set
+# CONFIG_DM_SNAPSHOT is not set
+# CONFIG_DM_MIRROR is not set
+# CONFIG_DM_ZERO is not set
 
 #
 # Fusion MPT device support
@@ -400,6 +409,7 @@
 # QoS and/or fair queueing
 #
 # CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -454,6 +464,7 @@
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_VELOCITY is not set
 
 #
 # Ethernet (1000 Mbit)
@@ -557,7 +568,6 @@
 #
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_HCDP=y
 CONFIG_SERIAL_8250_ACPI=y
 CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
@@ -606,6 +616,7 @@
 # CONFIG_DRM_MGA is not set
 # CONFIG_DRM_SIS is not set
 # CONFIG_RAW_DRIVER is not set
+# CONFIG_HPET is not set
 
 #
 # I2C support
@@ -647,12 +658,15 @@
 #
 # CONFIG_I2C_SENSOR is not set
 # CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1031 is not set
 # CONFIG_SENSORS_ASB100 is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_FSCHER is not set
 # CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
 # CONFIG_SENSORS_LM78 is not set
 # CONFIG_SENSORS_LM80 is not set
 # CONFIG_SENSORS_LM83 is not set
@@ -677,6 +691,11 @@
 # CONFIG_I2C_DEBUG_CHIP is not set
 
 #
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
 # Misc devices
 #
 
@@ -700,6 +719,7 @@
 # CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 CONFIG_FB_RIVA=m
+CONFIG_FB_RIVA_I2C=y
 # CONFIG_FB_MATROX is not set
 # CONFIG_FB_RADEON_OLD is not set
 CONFIG_FB_RADEON=m
@@ -723,7 +743,6 @@
 # CONFIG_MDA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
@@ -950,6 +969,7 @@
 CONFIG_JOLIET=y
 # CONFIG_ZISOFS is not set
 CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
 
 #
 # DOS/FAT/NT Filesystems
@@ -957,6 +977,8 @@
 CONFIG_FAT_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -982,6 +1004,7 @@
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -999,7 +1022,7 @@
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
-CONFIG_NFSD_TCP=y
+# CONFIG_NFSD_TCP is not set
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
@@ -1027,7 +1050,6 @@
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -1039,46 +1061,48 @@
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_737=y
-CONFIG_NLS_CODEPAGE_775=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_CODEPAGE_852=y
-CONFIG_NLS_CODEPAGE_855=y
-CONFIG_NLS_CODEPAGE_857=y
-CONFIG_NLS_CODEPAGE_860=y
-CONFIG_NLS_CODEPAGE_861=y
-CONFIG_NLS_CODEPAGE_862=y
-CONFIG_NLS_CODEPAGE_863=y
-CONFIG_NLS_CODEPAGE_864=y
-CONFIG_NLS_CODEPAGE_865=y
-CONFIG_NLS_CODEPAGE_866=y
-CONFIG_NLS_CODEPAGE_869=y
-CONFIG_NLS_CODEPAGE_936=y
-CONFIG_NLS_CODEPAGE_950=y
-CONFIG_NLS_CODEPAGE_932=y
-CONFIG_NLS_CODEPAGE_949=y
-CONFIG_NLS_CODEPAGE_874=y
-CONFIG_NLS_ISO8859_8=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
-CONFIG_NLS_CODEPAGE_1251=y
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_2=y
-CONFIG_NLS_ISO8859_3=y
-CONFIG_NLS_ISO8859_4=y
-CONFIG_NLS_ISO8859_5=y
-CONFIG_NLS_ISO8859_6=y
-CONFIG_NLS_ISO8859_7=y
-CONFIG_NLS_ISO8859_9=y
-CONFIG_NLS_ISO8859_13=y
-CONFIG_NLS_ISO8859_14=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_KOI8_R=y
-CONFIG_NLS_KOI8_U=y
-CONFIG_NLS_UTF8=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
 
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=y
 # CONFIG_LIBCRC32C is not set
 
@@ -1128,6 +1152,7 @@
 # CONFIG_CRYPTO_AES is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
diff -Nru a/arch/ia64/hp/sim/hpsim_irq.c b/arch/ia64/hp/sim/hpsim_irq.c
--- a/arch/ia64/hp/sim/hpsim_irq.c	2004-07-27 18:24:53 -07:00
+++ b/arch/ia64/hp/sim/hpsim_irq.c	2004-07-27 18:24:53 -07:00
@@ -21,6 +21,11 @@
 {
 }
 
+static void
+hpsim_set_affinity_noop (unsigned int a, cpumask_t b)
+{
+}
+
 static struct hw_interrupt_type irq_type_hp_sim = {
 	.typename =	"hpsim",
 	.startup =	hpsim_irq_startup,
@@ -29,7 +34,7 @@
 	.disable =	hpsim_irq_noop,
 	.ack =		hpsim_irq_noop,
 	.end =		hpsim_irq_noop,
-	.set_affinity =	(void (*)(unsigned int, unsigned long)) hpsim_irq_noop,
+	.set_affinity =	hpsim_set_affinity_noop,
 };
 
 void __init
diff -Nru a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
--- a/arch/ia64/ia32/binfmt_elf32.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ia64/ia32/binfmt_elf32.c	2004-07-27 18:24:52 -07:00
@@ -41,6 +41,8 @@
 #undef SET_PERSONALITY
 #define SET_PERSONALITY(ex, ibcs2)	elf32_set_personality()
 
+#define elf_read_implies_exec(ex, have_pt_gnu_stack)	(!(have_pt_gnu_stack))
+
 /* Ugly but avoids duplication */
 #include "../../../fs/binfmt_elf.c"
 
@@ -163,7 +165,8 @@
 	if (!mpnt)
 		return -ENOMEM;
 
-	if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {
+	if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))
+				      >> PAGE_SHIFT)) {
 		kmem_cache_free(vm_area_cachep, mpnt);
 		return -ENOMEM;
 	}
@@ -210,7 +213,6 @@
 	set_personality(PER_LINUX32);
 	current->thread.map_base  = IA32_PAGE_OFFSET/3;
 	current->thread.task_size = IA32_PAGE_OFFSET;	/* use what Linux/x86 uses... */
-	current->thread.flags |= IA64_THREAD_XSTACK;	/* data must be executable */
 	set_fs(USER_DS);				/* set addr limit for new TASK_SIZE */
 }
 
diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
--- a/arch/ia64/kernel/acpi.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ia64/kernel/acpi.c	2004-07-27 18:24:51 -07:00
@@ -171,8 +171,6 @@
 	if (BAD_MADT_ENTRY(lapic, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	if (lapic->address) {
 		iounmap((void *) ipi_base_addr);
 		ipi_base_addr = (unsigned long) ioremap(lapic->address, 0);
@@ -191,25 +189,13 @@
 	if (BAD_MADT_ENTRY(lsapic, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
-	printk(KERN_INFO "CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid);
-
-	if (!lsapic->flags.enabled)
-		printk(" disabled");
-	else {
-		printk(" enabled");
+	if (lsapic->flags.enabled) {
 #ifdef CONFIG_SMP
 		smp_boot_data.cpu_phys_id[available_cpus] = (lsapic->id << 8) | lsapic->eid;
-		if (hard_smp_processor_id()
-		    == (unsigned int) smp_boot_data.cpu_phys_id[available_cpus])
-			printk(" (BSP)");
 #endif
 		++available_cpus;
 	}
 
-	printk("\n");
-
 	total_cpus++;
 	return 0;
 }
@@ -225,8 +211,6 @@
 	if (BAD_MADT_ENTRY(lacpi_nmi, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	/* TBD: Support lapic_nmi entries */
 	return 0;
 }
@@ -242,8 +226,6 @@
 	if (BAD_MADT_ENTRY(iosapic, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	iosapic_init(iosapic->address, iosapic->global_irq_base);
 
 	return 0;
@@ -262,8 +244,6 @@
 	if (BAD_MADT_ENTRY(plintsrc, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	/*
 	 * Get vector assignment for this interrupt, set attributes,
 	 * and program the IOSAPIC routing table.
@@ -292,8 +272,6 @@
 	if (BAD_MADT_ENTRY(p, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	iosapic_override_isa_irq(p->bus_irq, p->global_irq,
 				 (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
 				 (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
@@ -310,8 +288,6 @@
 
 	if (BAD_MADT_ENTRY(nmi_src, end))
 		return -EINVAL;
-
-	acpi_table_print_madt_entry(header);
 
 	/* TBD: Support nimsrc entries */
 	return 0;
diff -Nru a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
--- a/arch/ia64/kernel/irq.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ia64/kernel/irq.c	2004-07-27 18:24:52 -07:00
@@ -87,7 +87,8 @@
 /*
  * This is updated when the user sets irq affinity via /proc
  */
-cpumask_t    __cacheline_aligned pending_irq_cpumask[NR_IRQS];
+cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
+static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)];
 
 #ifdef CONFIG_IA64_GENERIC
 irq_desc_t * __ia64_irq_desc (unsigned int irq)
@@ -973,6 +974,7 @@
 	int prelen;
 	irq_desc_t *desc = irq_descp(irq);
 	unsigned long flags;
+	int redir = 0;
 
 	if (!desc->handler->set_affinity)
 		return -EIO;
@@ -995,7 +997,7 @@
 	prelen = 0;
 	if (tolower(*rbuf) == 'r') {
 		prelen = strspn(rbuf, "Rr ");
-		irq |= IA64_IRQ_REDIRECTED;
+		redir++;
 	}
 
 	err = cpumask_parse(buffer+prelen, count-prelen, new_value);
@@ -1013,6 +1015,10 @@
 
 	spin_lock_irqsave(&desc->lock, flags);
 	pending_irq_cpumask[irq] = new_value;
+	if (redir)
+		set_bit(irq, pending_irq_redir);
+	else
+		clear_bit(irq, pending_irq_redir);
 	spin_unlock_irqrestore(&desc->lock, flags);
 
 	return full_count;
@@ -1023,11 +1029,13 @@
 	/* note - we hold desc->lock */
 	cpumask_t tmp;
 	irq_desc_t *desc = irq_descp(irq);
+	int redir = test_bit(irq, pending_irq_redir);
 
 	if (!cpus_empty(pending_irq_cpumask[irq])) {
 		cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
 		if (unlikely(!cpus_empty(tmp))) {
-			desc->handler->set_affinity(irq, pending_irq_cpumask[irq]);
+			desc->handler->set_affinity(irq | (redir ? IA64_IRQ_REDIRECTED : 0),
+						    pending_irq_cpumask[irq]);
 		}
 		cpus_clear(pending_irq_cpumask[irq]);
 	}
diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
--- a/arch/ia64/kernel/mca.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ia64/kernel/mca.c	2004-07-27 18:24:51 -07:00
@@ -128,8 +128,6 @@
  */
 static int cpe_poll_enabled = 1;
 
-static int cpe_vector = -1;
-
 extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe);
 
 /*
@@ -273,6 +271,8 @@
 #ifndef PLATFORM_MCA_HANDLERS
 
 #ifdef CONFIG_ACPI
+
+static int cpe_vector = -1;
 
 static irqreturn_t
 ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
--- a/arch/ia64/kernel/perfmon.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ia64/kernel/perfmon.c	2004-07-27 18:24:52 -07:00
@@ -4729,6 +4729,11 @@
 	if (task == current || ctx->ctx_fl_system) return 0;
 
 	/*
+	 * if context is UNLOADED we are safe to go
+	 */
+	if (state == PFM_CTX_UNLOADED) return 0;
+
+	/*
 	 * no command can operate on a zombie context
 	 */
 	if (state == PFM_CTX_ZOMBIE) {
@@ -4737,12 +4742,9 @@
 	}
 
 	/*
-	 * if context is UNLOADED, MASKED we are safe to go
-	 */
-	if (state != PFM_CTX_LOADED) return 0;
-
-	/*
-	 * context is LOADED, we must make sure the task is stopped
+	 * context is LOADED or MASKED. Some commands may need to have 
+	 * the task stopped.
+	 *
 	 * We could lift this restriction for UP but it would mean that
 	 * the user has no guarantee the task would not run between
 	 * two successive calls to perfmonctl(). That's probably OK.
diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
--- a/arch/ia64/kernel/process.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ia64/kernel/process.c	2004-07-27 18:24:51 -07:00
@@ -616,16 +616,6 @@
 	return error;
 }
 
-void
-ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter)
-{
-	set_personality(PER_LINUX);
-	if (elf_ex->e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK)
-		current->thread.flags |= IA64_THREAD_XSTACK;
-	else
-		current->thread.flags &= ~IA64_THREAD_XSTACK;
-}
-
 pid_t
 kernel_thread (int (*fn)(void *), void *arg, unsigned long flags)
 {
diff -Nru a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
--- a/arch/ia64/mm/init.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ia64/mm/init.c	2004-07-27 18:24:51 -07:00
@@ -128,7 +128,7 @@
 		vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
 		vma->vm_end = vma->vm_start + PAGE_SIZE;
 		vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
-		vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE|VM_GROWSUP;
+		vma->vm_flags = VM_DATA_DEFAULT_FLAGS | VM_GROWSUP;
 		insert_vm_struct(current->mm, vma);
 	}
 
@@ -169,7 +169,7 @@
 {
 	struct page *page;
 	/*
-	 * EFI uses 4KB pages while the kernel can use 4KB  or bigger.
+	 * EFI uses 4KB pages while the kernel can use 4KB or bigger.
 	 * Thus EFI and the kernel may have different page sizes. It is
 	 * therefore possible to have the initrd share the same page as
 	 * the end of the kernel (given current setup).
@@ -580,7 +580,7 @@
 		if (!fsyscall_table[i] || nolwsys)
 			fsyscall_table[i] = sys_call_table[i] | 1;
 	}
-	setup_gate();	/* setup gate pages before we free up boot memory... */
+	setup_gate();
 
 #ifdef CONFIG_IA32_SUPPORT
 	ia32_boot_gdt_init();
diff -Nru a/arch/ia64/sn/kernel/mca.c b/arch/ia64/sn/kernel/mca.c
--- a/arch/ia64/sn/kernel/mca.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ia64/sn/kernel/mca.c	2004-07-27 18:24:51 -07:00
@@ -123,7 +123,8 @@
 	*oemdata_size = 0;
 	vfree(*oemdata);
 	*oemdata = NULL;
-	if (efi_guidcmp(guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID) == 0)
+	if (efi_guidcmp(guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID) == 0 ||
+	    efi_guidcmp(guid, SAL_PLAT_MEM_DEV_ERR_SECT_GUID) == 0)
 		return sn_platform_plat_specific_err_print(sect_header, oemdata, oemdata_size);
 	return 0;
 }
diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig
--- a/arch/ppc/Kconfig	2004-07-27 18:24:53 -07:00
+++ b/arch/ppc/Kconfig	2004-07-27 18:24:53 -07:00
@@ -1295,7 +1295,7 @@
 
 config KGDB
 	bool "Include kgdb kernel debugger"
-	depends on DEBUG_KERNEL
+	depends on DEBUG_KERNEL && (BROKEN || PPC_GEN550 || 4xx)
 	select DEBUG_INFO
 	help
 	  Include in-kernel hooks for kgdb, the Linux kernel source level
diff -Nru a/arch/ppc/Makefile b/arch/ppc/Makefile
--- a/arch/ppc/Makefile	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/Makefile	2004-07-27 18:24:51 -07:00
@@ -27,6 +27,8 @@
 		-ffixed-r2 -Wno-uninitialized -mmultiple
 CPP		= $(CC) -E $(CFLAGS)
 
+CHECK		:= $(CHECK) -D__powerpc__=1
+
 ifndef CONFIG_E500
 cflags-y	+= -mstring
 endif
diff -Nru a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c
--- a/arch/ppc/boot/simple/misc.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/boot/simple/misc.c	2004-07-27 18:24:52 -07:00
@@ -221,7 +221,7 @@
 	puts("\n");
 
 	puts("Uncompressing Linux...");
-	gunzip(0, 0x400000, zimage_start, &zimage_size);
+	gunzip(NULL, 0x400000, zimage_start, &zimage_size);
 	puts("done.\n");
 
 	/* get the bi_rec address */
diff -Nru a/arch/ppc/defconfig b/arch/ppc/defconfig
--- a/arch/ppc/defconfig	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/defconfig	2004-07-27 18:24:52 -07:00
@@ -689,7 +689,7 @@
 # Input Device Drivers
 #
 CONFIG_INPUT_KEYBOARD=y
-# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
 # CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
@@ -724,8 +724,8 @@
 #
 # Non-8250 serial port support
 #
-# CONFIG_SERIAL_CORE is not set
-# CONFIG_SERIAL_PMACZILOG is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_PMACZILOG=y
 # CONFIG_SERIAL_PMACZILOG_CONSOLE is not set
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
diff -Nru a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
--- a/arch/ppc/kernel/head.S	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/kernel/head.S	2004-07-27 18:24:51 -07:00
@@ -552,7 +552,7 @@
 	rlwimi	r3,r3,32-1,31,31	/* _PAGE_USER -> PP lsb */
 	ori	r1,r1,0xe14		/* clear out reserved bits and M */
 	andc	r1,r3,r1		/* PP = user? (rw&dirty? 2: 3): 0 */
-	mtspr	RPA,r1
+	mtspr	SPRN_RPA,r1
 	mfspr	r3,IMISS
 	tlbli	r3
 	mfspr	r3,SRR1		/* Need to restore CR0 */
@@ -626,7 +626,7 @@
 	rlwimi	r3,r3,32-1,31,31	/* _PAGE_USER -> PP lsb */
 	ori	r1,r1,0xe14		/* clear out reserved bits and M */
 	andc	r1,r3,r1		/* PP = user? (rw&dirty? 2: 3): 0 */
-	mtspr	RPA,r1
+	mtspr	SPRN_RPA,r1
 	mfspr	r3,DMISS
 	tlbld	r3
 	mfspr	r3,SRR1		/* Need to restore CR0 */
@@ -694,7 +694,7 @@
 	rlwimi	r3,r3,32-1,30,30	/* _PAGE_USER -> PP msb */
 	li	r1,0xe15		/* clear out reserved bits and M */
 	andc	r1,r3,r1		/* PP = user? 2: 0 */
-	mtspr	RPA,r1
+	mtspr	SPRN_RPA,r1
 	mfspr	r3,DMISS
 	tlbld	r3
 	mfspr	r3,SRR1		/* Need to restore CR0 */
diff -Nru a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
--- a/arch/ppc/kernel/irq.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/kernel/irq.c	2004-07-27 18:24:52 -07:00
@@ -106,7 +106,7 @@
 			cache_bitmask |= (1<<i);
 			return (void *)(&malloc_cache[i]);
 		}
-	return 0;
+	return NULL;
 }
 
 void irq_kfree(void *ptr)
@@ -676,7 +676,7 @@
 	int i;
 
 	/* create /proc/irq */
-	root_irq_dir = proc_mkdir("irq", 0);
+	root_irq_dir = proc_mkdir("irq", NULL);
 
 	/* create /proc/irq/prof_cpu_mask */
 	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
diff -Nru a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
--- a/arch/ppc/kernel/pci.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/kernel/pci.c	2004-07-27 18:24:51 -07:00
@@ -671,11 +671,11 @@
 		struct pci_dev* dev;
 		unsigned int *class_code, *reg;
 	
-		class_code = (unsigned int *) get_property(node, "class-code", 0);
+		class_code = (unsigned int *) get_property(node, "class-code", NULL);
 		if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
 			continue;
-		reg = (unsigned int *)get_property(node, "reg", 0);
+		reg = (unsigned int *)get_property(node, "reg", NULL);
 		if (!reg)
 			continue;
 		dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
@@ -712,7 +712,7 @@
 			continue;
 		make_one_node_map(node, hose->first_busno);
 	}
-	of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", 0);
+	of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", NULL);
 	if (of_prop_map)
 		memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count);
 #ifdef DEBUG
@@ -743,7 +743,7 @@
 		 * a fake root for all functions of a multi-function device,
 		 * we go down them as well.
 		 */
-		class_code = (unsigned int *) get_property(node, "class-code", 0);
+		class_code = (unsigned int *) get_property(node, "class-code", NULL);
 		if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
 			strcmp(node->name, "multifunc-device"))
@@ -761,7 +761,7 @@
 	unsigned int *reg;
 	u8* fdata = (u8*)data;
 	
-	reg = (unsigned int *) get_property(node, "reg", 0);
+	reg = (unsigned int *) get_property(node, "reg", NULL);
 	if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
 		&& ((reg[0] >> 16) & 0xff) == fdata[0])
 		return 1;
@@ -874,7 +874,7 @@
 	if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
 			find_OF_pci_device_filter, (void *)node))
 		return -ENODEV;
-	reg = (unsigned int *) get_property(node, "reg", 0);
+	reg = (unsigned int *) get_property(node, "reg", NULL);
 	if (!reg)
 		return -ENODEV;
 	*bus = (reg[0] >> 16) & 0xff;
diff -Nru a/arch/ppc/kernel/ppc-stub.c b/arch/ppc/kernel/ppc-stub.c
--- a/arch/ppc/kernel/ppc-stub.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/kernel/ppc-stub.c	2004-07-27 18:24:52 -07:00
@@ -234,7 +234,7 @@
 	} else {
 		/* error condition */
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	*buf = 0;
 	return buf;
 }
@@ -300,7 +300,7 @@
 	} else {
 		/* error condition */
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return mem;
 }
 
@@ -331,7 +331,7 @@
 	} else {
 		/* error condition */
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 
 	return (numChars);
 }
diff -Nru a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c
--- a/arch/ppc/kernel/ppc_htab.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/kernel/ppc_htab.c	2004-07-27 18:24:51 -07:00
@@ -448,15 +448,15 @@
 	}
 
 	if (!write && !first && left) {
-		if(put_user('\n', (char *) buffer))
+		if(put_user('\n', (char __user *) buffer))
 			return -EFAULT;
 		left--, buffer++;
 	}
 	if (write) {
-		p = (char *) buffer;
+		char __user *s = (char __user *) buffer;
 		while (left) {
 			char c;
-			if(get_user(c, p++))
+			if(get_user(c, s++))
 				return -EFAULT;
 			if (!isspace(c))
 				break;
diff -Nru a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c
--- a/arch/ppc/kernel/process.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/kernel/process.c	2004-07-27 18:24:51 -07:00
@@ -479,9 +479,9 @@
 	regs->gpr[1] = sp;
 	regs->msr = MSR_USER;
 	if (last_task_used_math == current)
-		last_task_used_math = 0;
+		last_task_used_math = NULL;
 	if (last_task_used_altivec == current)
-		last_task_used_altivec = 0;
+		last_task_used_altivec = NULL;
 	memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
 	current->thread.fpscr = 0;
 #ifdef CONFIG_ALTIVEC
@@ -544,7 +544,7 @@
 #endif
 	else
 		val = __unpack_fe01(tsk->thread.fpexc_mode);
-	return put_user(val, (unsigned int *) adr);
+	return put_user(val, (unsigned int __user *) adr);
 }
 
 int sys_clone(unsigned long clone_flags, unsigned long usp,
diff -Nru a/arch/ppc/kernel/ptrace.c b/arch/ppc/kernel/ptrace.c
--- a/arch/ppc/kernel/ptrace.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/kernel/ptrace.c	2004-07-27 18:24:51 -07:00
@@ -77,7 +77,7 @@
 /*
  * Get contents of AltiVec register state in task TASK
  */
-static inline int get_vrregs(unsigned long *data, struct task_struct *task)
+static inline int get_vrregs(unsigned long __user *data, struct task_struct *task)
 {
 	int i, j;
 
@@ -105,7 +105,7 @@
 /*
  * Write contents of AltiVec register state into task TASK.
  */
-static inline int set_vrregs(struct task_struct *task, unsigned long *data)
+static inline int set_vrregs(struct task_struct *task, unsigned long __user *data)
 {
 	int i, j;
 
@@ -286,7 +286,7 @@
 		ret = -EIO;
 		if (copied != sizeof(tmp))
 			break;
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp,(unsigned long __user *) data);
 		break;
 	}
 
@@ -312,7 +312,7 @@
 			preempt_enable();
 			tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0];
 		}
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp,(unsigned long __user *) data);
 		break;
 	}
 
@@ -410,7 +410,7 @@
 		if (child->thread.regs->msr & MSR_VEC)
 			giveup_altivec(child);
 		preempt_enable();
-		ret = get_vrregs((unsigned long *)data, child);
+		ret = get_vrregs((unsigned long __user *)data, child);
 		break;
 
 	case PTRACE_SETVRREGS:
@@ -421,7 +421,7 @@
 		if (child->thread.regs->msr & MSR_VEC)
 			giveup_altivec(child);
 		preempt_enable();
-		ret = set_vrregs(child, (unsigned long *)data);
+		ret = set_vrregs(child, (unsigned long __user *)data);
 		break;
 #endif
 #ifdef CONFIG_SPE
@@ -429,7 +429,7 @@
 		/* Get the child spe register state. */
 		if (child->thread.regs->msr & MSR_SPE)
 			giveup_spe(child);
-		ret = get_evrregs((unsigned long *)data, child);
+		ret = get_evrregs((unsigned long __user *)data, child);
 		break;
 
 	case PTRACE_SETEVRREGS:
@@ -438,7 +438,7 @@
 		 * of register state from memory */
 		if (child->thread.regs->msr & MSR_SPE)
 			giveup_spe(child);
-		ret = set_evrregs(child, (unsigned long *)data);
+		ret = set_evrregs(child, (unsigned long __user *)data);
 		break;
 #endif
 
diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
--- a/arch/ppc/kernel/setup.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/kernel/setup.c	2004-07-27 18:24:52 -07:00
@@ -622,7 +622,7 @@
 }
 __setup("l2cr=", ppc_setup_l2cr);
 
-#ifdef CONFIG_NVRAM
+#ifdef CONFIG_GENERIC_NVRAM
 
 /* Generic nvram hooks used by drivers/char/gen_nvram.c */
 unsigned char nvram_read_byte(int addr)
@@ -693,7 +693,7 @@
 #ifdef CONFIG_XMON
 	xmon_map_scc();
 	if (strstr(cmd_line, "xmon"))
-		xmon(0);
+		xmon(NULL);
 #endif /* CONFIG_XMON */
 	if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
 
diff -Nru a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c
--- a/arch/ppc/kernel/signal.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/kernel/signal.c	2004-07-27 18:24:52 -07:00
@@ -187,7 +187,7 @@
  * altivec/spe instructions at some point.
  */
 static int
-save_user_regs(struct pt_regs *regs, struct mcontext *frame, int sigret)
+save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, int sigret)
 {
 	/* save general and floating-point registers */
 	CHECK_FULL_REGS(regs);
@@ -229,7 +229,7 @@
 	 * significant bits of a vector, we "cheat" and stuff VRSAVE in the
 	 * most significant bits of that same vector. --BenH
 	 */
-	if (__put_user(current->thread.vrsave, (u32 *)&frame->mc_vregs[32]))
+	if (__put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
 
@@ -308,7 +308,7 @@
 		memset(&current->thread.vr, 0, ELF_NVRREG * sizeof(vector128));
 
 	/* Always get VRSAVE back */
-	if (__get_user(current->thread.vrsave, (u32 *)&sr->mc_vregs[32]))
+	if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
 
@@ -412,7 +412,7 @@
 static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int sig)
 {
 	sigset_t set;
-	struct mcontext *mcp;
+	struct mcontext __user *mcp;
 
 	if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(set))
 	    || __get_user(mcp, &ucp->uc_regs))
@@ -447,8 +447,8 @@
 	if (new_ctx == NULL)
 		return 0;
 	if (verify_area(VERIFY_READ, new_ctx, sizeof(*new_ctx))
-	    || __get_user(tmp, (u8 *) new_ctx)
-	    || __get_user(tmp, (u8 *) (new_ctx + 1) - 1))
+	    || __get_user(tmp, (u8 __user *) new_ctx)
+	    || __get_user(tmp, (u8 __user *) (new_ctx + 1) - 1))
 		return -EFAULT;
 
 	/*
@@ -524,7 +524,7 @@
 	/* create a stack frame for the caller of the handler */
 	newsp -= __SIGNAL_FRAMESIZE;
 
-	if (verify_area(VERIFY_WRITE, (void *) newsp, origsp - newsp))
+	if (verify_area(VERIFY_WRITE, (void __user *) newsp, origsp - newsp))
 		goto badframe;
 
 #if _NSIG != 64
@@ -583,7 +583,7 @@
 	set.sig[1] = sigctx._unused[3];
 	restore_sigmask(&set);
 
-	sr = (struct mcontext *) sigctx.regs;
+	sr = (struct mcontext __user *) sigctx.regs;
 	if (verify_area(VERIFY_READ, sr, sizeof(*sr))
 	    || restore_user_regs(regs, sr, 1))
 		goto badframe;
diff -Nru a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
--- a/arch/ppc/kernel/syscalls.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/kernel/syscalls.c	2004-07-27 18:24:52 -07:00
@@ -67,7 +67,7 @@
 		break;
 	case SEMTIMEDOP:
 		ret = sys_semtimedop (first, (struct sembuf __user *)ptr,
-				      second, (const struct timespec *) fifth);
+				      second, (const struct timespec __user *) fifth);
 		break;
 	case SEMGET:
 		ret = sys_semget (first, second, third);
@@ -78,7 +78,7 @@
 		if (!ptr)
 			break;
 		if ((ret = verify_area (VERIFY_READ, ptr, sizeof(long)))
-		    || (ret = get_user(fourth.__pad, (void *__user *)ptr)))
+		    || (ret = get_user(fourth.__pad, (void __user *__user *)ptr)))
 			break;
 		ret = sys_semctl (first, second, third, fourth);
 		break;
@@ -208,17 +208,17 @@
  * sys_select() with the appropriate args. -- Cort
  */
 int
-ppc_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp)
+ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timeval __user *tvp)
 {
 	if ( (unsigned long)n >= 4096 )
 	{
 		unsigned long __user *buffer = (unsigned long __user *)n;
 		if (verify_area(VERIFY_READ, buffer, 5*sizeof(unsigned long))
 		    || __get_user(n, buffer)
-		    || __get_user(inp, ((fd_set **)(buffer+1)))
-		    || __get_user(outp, ((fd_set **)(buffer+2)))
-		    || __get_user(exp, ((fd_set **)(buffer+3)))
-		    || __get_user(tvp, ((struct timeval **)(buffer+4))))
+		    || __get_user(inp, ((fd_set __user * __user *)(buffer+1)))
+		    || __get_user(outp, ((fd_set  __user * __user *)(buffer+2)))
+		    || __get_user(exp, ((fd_set  __user * __user *)(buffer+3)))
+		    || __get_user(tvp, ((struct timeval  __user * __user *)(buffer+4))))
 			return -EFAULT;
 	}
 	return sys_select(n, inp, outp, exp, tvp);
diff -Nru a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
--- a/arch/ppc/kernel/traps.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/kernel/traps.c	2004-07-27 18:24:51 -07:00
@@ -114,7 +114,7 @@
 	info.si_signo = signr;
 	info.si_errno = 0;
 	info.si_code = code;
-	info.si_addr = (void *) addr;
+	info.si_addr = (void __user *) addr;
 	force_sig_info(signr, &info, current);
 }
 
diff -Nru a/arch/ppc/kernel/vecemu.c b/arch/ppc/kernel/vecemu.c
--- a/arch/ppc/kernel/vecemu.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/kernel/vecemu.c	2004-07-27 18:24:51 -07:00
@@ -262,7 +262,7 @@
 	unsigned int va, vb, vc, vd;
 	vector128 *vrs;
 
-	if (get_user(instr, (unsigned int *) regs->nip))
+	if (get_user(instr, (unsigned int __user *) regs->nip))
 		return -EFAULT;
 	if ((instr >> 26) != 4)
 		return -EINVAL;		/* not an altivec instruction */
diff -Nru a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c
--- a/arch/ppc/mm/fault.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/mm/fault.c	2004-07-27 18:24:51 -07:00
@@ -59,7 +59,7 @@
 {
 	unsigned int inst;
 
-	if (get_user(inst, (unsigned int *)regs->nip))
+	if (get_user(inst, (unsigned int __user *)regs->nip))
 		return 0;
 	/* check for 1 in the rA field */
 	if (((inst >> 16) & 0x1f) != 1)
@@ -281,7 +281,7 @@
 		info.si_signo = SIGSEGV;
 		info.si_errno = 0;
 		info.si_code = code;
-		info.si_addr = (void *) address;
+		info.si_addr = (void __user *) address;
 		force_sig_info(SIGSEGV, &info, current);
 		return 0;
 	}
@@ -309,7 +309,7 @@
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *)address;
+	info.si_addr = (void __user *)address;
 	force_sig_info (SIGBUS, &info, current);
 	if (!user_mode(regs))
 		return SIGBUS;
diff -Nru a/arch/ppc/platforms/pmac_pci.c b/arch/ppc/platforms/pmac_pci.c
--- a/arch/ppc/platforms/pmac_pci.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/platforms/pmac_pci.c	2004-07-27 18:24:51 -07:00
@@ -72,7 +72,7 @@
 		int len;
 
 		/* For PCI<->PCI bridges or CardBus bridges, we go down */
-		class_code = (unsigned int *) get_property(node, "class-code", 0);
+		class_code = (unsigned int *) get_property(node, "class-code", NULL);
 		if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
 			continue;
@@ -509,7 +509,7 @@
 			continue;
 		if (0x0035 != *prop)
 			continue;
-		prop = (u32 *)get_property(nec, "reg", 0);
+		prop = (u32 *)get_property(nec, "reg", NULL);
 		if (prop == NULL)
 			continue;
 		devfn = (prop[0] >> 8) & 0xff;
diff -Nru a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
--- a/arch/ppc/platforms/pmac_pic.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/platforms/pmac_pic.c	2004-07-27 18:24:52 -07:00
@@ -444,7 +444,7 @@
 					nmi_irq = pswitch->intrs[0].line;
 					openpic_init_nmi_irq(nmi_irq);
 					request_irq(nmi_irq, xmon_irq, 0,
-						    "NMI - XMON", 0);
+						    "NMI - XMON", NULL);
 				}
 			}
 #endif	/* CONFIG_XMON */
@@ -542,7 +542,7 @@
 		for ( i = max_real_irqs ; i < max_irqs ; i++ )
 			irq_desc[i].handler = &gatwick_pic;
 		request_irq( irq_cascade, gatwick_action, SA_INTERRUPT,
-			     "cascade", 0 );
+			     "cascade", NULL );
 	}
 	printk("System has %d possible interrupts\n", max_irqs);
 	if (max_irqs != max_real_irqs)
@@ -550,7 +550,7 @@
 			max_real_irqs);
 
 #ifdef CONFIG_XMON
-	request_irq(20, xmon_irq, 0, "NMI - XMON", 0);
+	request_irq(20, xmon_irq, 0, "NMI - XMON", NULL);
 #endif	/* CONFIG_XMON */
 }
 
diff -Nru a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c
--- a/arch/ppc/platforms/pmac_smp.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/platforms/pmac_smp.c	2004-07-27 18:24:51 -07:00
@@ -421,7 +421,7 @@
 		/* reset the entry point so if we get another intr we won't
 		 * try to startup again */
 		out_be32(psurge_start, 0x100);
-		if (request_irq(30, psurge_primary_intr, SA_INTERRUPT, "primary IPI", 0))
+		if (request_irq(30, psurge_primary_intr, SA_INTERRUPT, "primary IPI", NULL))
 			printk(KERN_ERR "Couldn't get primary IPI interrupt");
 	}
 
diff -Nru a/arch/ppc/platforms/prep_pci.c b/arch/ppc/platforms/prep_pci.c
--- a/arch/ppc/platforms/prep_pci.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/platforms/prep_pci.c	2004-07-27 18:24:52 -07:00
@@ -741,7 +741,7 @@
 	}
 
 	/* Check the first PCI device to see if it is a Raven. */
-	early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &devid);
+	early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &devid);
 
 	switch (devid & 0xffff0000) {
 	case MPIC_RAVEN_ID:
@@ -757,7 +757,7 @@
 
 
 	/* Read the memory base register. */
-	early_read_config_dword(0, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
+	early_read_config_dword(NULL, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
 
 	if (pci_membase == 0) {
 		OpenPIC_Addr = NULL;
diff -Nru a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
--- a/arch/ppc/platforms/prep_setup.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/platforms/prep_setup.c	2004-07-27 18:24:52 -07:00
@@ -865,7 +865,7 @@
 		irq_desc[i].handler = &i8259_pic;
 	/* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory
 	 * controller, we poll (as they have a different int-ack address). */
-	early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &pci_viddid);
+	early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &pci_viddid);
 	pci_did = (pci_viddid & 0xffff0000) >> 16;
 	if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
 			&& ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN)
diff -Nru a/arch/ppc/platforms/residual.c b/arch/ppc/platforms/residual.c
--- a/arch/ppc/platforms/residual.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/platforms/residual.c	2004-07-27 18:24:51 -07:00
@@ -802,7 +802,7 @@
 		     !(n--) ) return res->Devices+i;
 #undef Dev
 	}
-	return 0;
+	return NULL;
 }
 
 PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
@@ -824,7 +824,7 @@
 		     !(n--) ) return res->Devices+i;
 #undef Dev
 	}
-	return 0;
+	return NULL;
 }
 
 PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
@@ -832,7 +832,7 @@
 				int n)
 {
 	unsigned mask, masked_tag, size;
-	if(!p) return 0;
+	if(!p) return NULL;
 	if (tag_type(packet_tag)) mask=0xff; else mask=0xF8;
 	masked_tag = packet_tag&mask;
 	for(; *p != END_TAG; p+=size) {
@@ -843,7 +843,7 @@
 		else
 			size=tag_small_count(*p)+1;
 	}
-	return 0; /* not found */
+	return NULL; /* not found */
 }
 
 PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
@@ -857,7 +857,7 @@
 			return (PnP_TAG_PACKET *) p;
 		next = 1;
 	};
-	return 0; /* not found */
+	return NULL; /* not found */
 }
 
 PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
@@ -871,7 +871,7 @@
 			return (PnP_TAG_PACKET *) p;
 		next = 1;
 	};
-	return 0; /* not found */
+	return NULL; /* not found */
 }
 
 #ifdef CONFIG_PROC_PREPRESIDUAL
diff -Nru a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
--- a/arch/ppc/syslib/open_pic.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/syslib/open_pic.c	2004-07-27 18:24:51 -07:00
@@ -554,14 +554,16 @@
  *  Externally called, however, it takes an IPI number (0...OPENPIC_NUM_IPI)
  *  and not a system-wide interrupt number
  */
-void openpic_cause_IPI(u_int ipi, u_int cpumask)
+void openpic_cause_IPI(u_int ipi, cpumask_t cpumask)
 {
+	cpumask_t phys;
 	DECL_THIS_CPU;
 
 	CHECK_THIS_CPU;
 	check_arg_ipi(ipi);
+	phys = physmask(cpumask);
 	openpic_write(&OpenPIC->THIS_CPU.IPI_Dispatch(ipi),
-		      physmask(cpumask));
+		      cpus_addr(physmask(cpumask))[0]);
 }
 
 void openpic_request_IPIs(void)
@@ -579,16 +581,16 @@
 	/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset,
 		    openpic_ipi_action, SA_INTERRUPT,
-		    "IPI0 (call function)", 0);
+		    "IPI0 (call function)", NULL);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1,
 		    openpic_ipi_action, SA_INTERRUPT,
-		    "IPI1 (reschedule)", 0);
+		    "IPI1 (reschedule)", NULL);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2,
 		    openpic_ipi_action, SA_INTERRUPT,
-		    "IPI2 (invalidate tlb)", 0);
+		    "IPI2 (invalidate tlb)", NULL);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3,
 		    openpic_ipi_action, SA_INTERRUPT,
-		    "IPI3 (xmon break)", 0);
+		    "IPI3 (xmon break)", NULL);
 
 	for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
 		openpic_enable_ipi(OPENPIC_VEC_IPI+open_pic_irq_offset+i);
@@ -610,7 +612,7 @@
 	spin_lock(&openpic_setup_lock);
 
 #ifdef CONFIG_IRQ_ALL_CPUS
-	cpu_set(smp_hw_index[smp_processor_id()], mask);
+	cpu_set(smp_hw_index[smp_processor_id()], msk);
 
  	/* let the openpic know we want intrs. default affinity
  	 * is 0xffffffff until changed via /proc
@@ -872,6 +874,7 @@
 void
 smp_openpic_message_pass(int target, int msg, unsigned long data, int wait)
 {
+	cpumask_t mask = CPU_MASK_ALL;
 	/* make sure we're sending something that translates to an IPI */
 	if (msg > 0x3) {
 		printk("SMP %d: smp_message_pass: unknown msg %d\n",
@@ -880,14 +883,14 @@
 	}
 	switch (target) {
 	case MSG_ALL:
-		openpic_cause_IPI(msg, 0xffffffff);
+		openpic_cause_IPI(msg, mask);
 		break;
 	case MSG_ALL_BUT_SELF:
-		openpic_cause_IPI(msg,
-				  0xffffffff & ~(1 << smp_processor_id()));
+		cpu_clear(smp_processor_id(), mask);
+		openpic_cause_IPI(msg, mask);
 		break;
 	default:
-		openpic_cause_IPI(msg, 1<<target);
+		openpic_cause_IPI(msg, cpumask_of_cpu(target));
 		break;
 	}
 }
diff -Nru a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
--- a/arch/ppc/syslib/prom.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/syslib/prom.c	2004-07-27 18:24:51 -07:00
@@ -126,7 +126,7 @@
 
 	/* All newworld pmac machines and CHRPs now use the interrupt tree */
 	for (np = allnodes; np != NULL; np = np->allnext) {
-		if (get_property(np, "interrupt-parent", 0)) {
+		if (get_property(np, "interrupt-parent", NULL)) {
 			use_of_interrupt_tree = 1;
 			break;
 		}
@@ -181,8 +181,8 @@
 	struct device_node *child;
 	int *ip;
 
-	np->name = get_property(np, "name", 0);
-	np->type = get_property(np, "device_type", 0);
+	np->name = get_property(np, "name", NULL);
+	np->type = get_property(np, "device_type", NULL);
 
 	if (!np->name)
 		np->name = "<NULL>";
@@ -197,10 +197,10 @@
 		mem_start = finish_node_interrupts(np, mem_start);
 
 	/* Look for #address-cells and #size-cells properties. */
-	ip = (int *) get_property(np, "#address-cells", 0);
+	ip = (int *) get_property(np, "#address-cells", NULL);
 	if (ip != NULL)
 		naddrc = *ip;
-	ip = (int *) get_property(np, "#size-cells", 0);
+	ip = (int *) get_property(np, "#size-cells", NULL);
 	if (ip != NULL)
 		nsizec = *ip;
 
@@ -501,7 +501,7 @@
 	do {
 		if (np->parent)
 			np = np->parent;
-		ip = (int *) get_property(np, "#address-cells", 0);
+		ip = (int *) get_property(np, "#address-cells", NULL);
 		if (ip != NULL)
 			return *ip;
 	} while (np->parent);
@@ -516,7 +516,7 @@
 	do {
 		if (np->parent)
 			np = np->parent;
-		ip = (int *) get_property(np, "#size-cells", 0);
+		ip = (int *) get_property(np, "#size-cells", NULL);
 		if (ip != NULL)
 			return *ip;
 	} while (np->parent);
@@ -836,7 +836,7 @@
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
@@ -855,7 +855,7 @@
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
@@ -872,7 +872,7 @@
 		*prevp = np;
 		prevp = &np->next;
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
@@ -934,7 +934,7 @@
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
@@ -1159,7 +1159,7 @@
 				*lenp = pp->length;
 			return pp->value;
 		}
-	return 0;
+	return NULL;
 }
 
 /*
diff -Nru a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
--- a/arch/ppc/syslib/prom_init.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc/syslib/prom_init.c	2004-07-27 18:24:53 -07:00
@@ -111,15 +111,15 @@
 static void * early_get_property(unsigned long base, unsigned long node,
 				char *prop);
 
-prom_entry prom __initdata = 0;
-ihandle prom_chosen __initdata = 0;
-ihandle prom_stdout __initdata = 0;
+prom_entry prom __initdata;
+ihandle prom_chosen __initdata;
+ihandle prom_stdout __initdata;
 
-char *prom_display_paths[FB_MAX] __initdata = { 0, };
+char *prom_display_paths[FB_MAX] __initdata;
 phandle prom_display_nodes[FB_MAX] __initdata;
-unsigned int prom_num_displays __initdata = 0;
-char *of_stdout_device __initdata = 0;
-static ihandle prom_disp_node __initdata = 0;
+unsigned int prom_num_displays __initdata;
+char *of_stdout_device __initdata;
+static ihandle prom_disp_node __initdata;
 
 unsigned int rtas_data;   /* physical pointer */
 unsigned int rtas_entry;  /* physical pointer */
@@ -161,7 +161,7 @@
 		prom_args.args[i] = va_arg(list, void *);
 	va_end(list);
 	for (i = 0; i < nret; ++i)
-		prom_args.args[i + nargs] = 0;
+		prom_args.args[i + nargs] = NULL;
 	prom(&prom_args);
 	return prom_args.args[nargs];
 }
@@ -181,7 +181,7 @@
 		prom_args.args[i] = va_arg(list, void *);
 	va_end(list);
 	for (i = 0; i < nret; ++i)
-		prom_args.args[i + nargs] = 0;
+		prom_args.args[i + nargs] = NULL;
 	prom(&prom_args);
 	for (i = 1; i < nret; ++i)
 		rets[i-1] = prom_args.args[nargs + i];
@@ -363,9 +363,9 @@
 	};
 	const unsigned char *clut;
 
-	prom_disp_node = 0;
+	prom_disp_node = NULL;
 
-	for (node = 0; prom_next_node(&node); ) {
+	for (node = NULL; prom_next_node(&node); ) {
 		type[0] = 0;
 		call_prom("getprop", 4, 1, node, "device_type",
 			  type, sizeof(type));
@@ -546,8 +546,8 @@
 	}
 	allnextp = &allnodes;
 	mem_start = ALIGNUL(mem_start);
-	new_start = inspect_node(root, 0, mem_start, mem_end, &allnextp);
-	*allnextp = 0;
+	new_start = inspect_node(root, NULL, mem_start, mem_end, &allnextp);
+	*allnextp = NULL;
 	return new_start;
 }
 
@@ -695,7 +695,7 @@
 	/* look for cpus */
 	*(unsigned long *)(0x0) = 0;
 	asm volatile("dcbf 0,%0": : "r" (0) : "memory");
-	for (node = 0; prom_next_node(&node); ) {
+	for (node = NULL; prom_next_node(&node); ) {
 		type[0] = 0;
 		call_prom("getprop", 4, 1, node, "device_type",
 			  type, sizeof(type));
@@ -888,7 +888,7 @@
 	prom_print("returning 0x");
 	prom_print_hex(phys);
 	prom_print("from prom_init\n");
-	prom_stdout = 0;
+	prom_stdout = NULL;
 
 	return phys;
 }
@@ -910,7 +910,7 @@
 			return (void *)((unsigned long)pp->value + base);
 		}
 	}
-	return 0;
+	return NULL;
 }
 
 /* Is boot-info compatible ? */
@@ -928,7 +928,7 @@
 
 	boot_infos = PTRUNRELOC(bi);
 	if (!BOOT_INFO_IS_V2_COMPATIBLE(bi))
-		bi->logicalDisplayBase = 0;
+		bi->logicalDisplayBase = NULL;
 
 #ifdef CONFIG_BOOTX_TEXT
 	btext_init(bi);
diff -Nru a/arch/ppc/xmon/ppc-opc.c b/arch/ppc/xmon/ppc-opc.c
--- a/arch/ppc/xmon/ppc-opc.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/xmon/ppc-opc.c	2004-07-27 18:24:51 -07:00
@@ -82,12 +82,12 @@
   /* The zero index is used to indicate the end of the list of
      operands.  */
 #define UNUSED (0)
-  { 0, 0, 0, 0, 0 },
+  { 0, 0, NULL, NULL, 0 },
 
   /* The BA field in an XL form instruction.  */
 #define BA (1)
 #define BA_MASK (0x1f << 16)
-  { 5, 16, 0, 0, PPC_OPERAND_CR },
+  { 5, 16, NULL, NULL, PPC_OPERAND_CR },
 
   /* The BA field in an XL form instruction when it must be the same
      as the BT field in the same instruction.  */
@@ -97,7 +97,7 @@
   /* The BB field in an XL form instruction.  */
 #define BB (3)
 #define BB_MASK (0x1f << 11)
-  { 5, 11, 0, 0, PPC_OPERAND_CR },
+  { 5, 11, NULL, NULL, PPC_OPERAND_CR },
 
   /* The BB field in an XL form instruction when it must be the same
      as the BA field in the same instruction.  */
@@ -140,21 +140,21 @@
 
   /* The BF field in an X or XL form instruction.  */
 #define BF (11)
-  { 3, 23, 0, 0, PPC_OPERAND_CR },
+  { 3, 23, NULL, NULL, PPC_OPERAND_CR },
 
   /* An optional BF field.  This is used for comparison instructions,
      in which an omitted BF field is taken as zero.  */
 #define OBF (12)
-  { 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
+  { 3, 23, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The BFA field in an X or XL form instruction.  */
 #define BFA (13)
-  { 3, 18, 0, 0, PPC_OPERAND_CR },
+  { 3, 18, NULL, NULL, PPC_OPERAND_CR },
 
   /* The BI field in a B form or XL form instruction.  */
 #define BI (14)
 #define BI_MASK (0x1f << 16)
-  { 5, 16, 0, 0, PPC_OPERAND_CR },
+  { 5, 16, NULL, NULL, PPC_OPERAND_CR },
 
   /* The BO field in a B form instruction.  Certain values are
      illegal.  */
@@ -169,20 +169,20 @@
 
   /* The BT field in an X or XL form instruction.  */
 #define BT (17)
-  { 5, 21, 0, 0, PPC_OPERAND_CR },
+  { 5, 21, NULL, NULL, PPC_OPERAND_CR },
 
   /* The condition register number portion of the BI field in a B form
      or XL form instruction.  This is used for the extended
      conditional branch mnemonics, which set the lower two bits of the
      BI field.  This field is optional.  */
 #define CR (18)
-  { 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
+  { 3, 18, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The D field in a D form instruction.  This is a displacement off
      a register, and implies that the next operand is a register in
      parentheses.  */
 #define D (19)
-  { 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
+  { 16, 0, NULL, NULL, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
 
   /* The DS field in a DS form instruction.  This is like D, but the
      lower two bits are forced to zero.  */
@@ -191,49 +191,49 @@
 
   /* The FL1 field in a POWER SC form instruction.  */
 #define FL1 (21)
-  { 4, 12, 0, 0, 0 },
+  { 4, 12, NULL, NULL, 0 },
 
   /* The FL2 field in a POWER SC form instruction.  */
 #define FL2 (22)
-  { 3, 2, 0, 0, 0 },
+  { 3, 2, NULL, NULL, 0 },
 
   /* The FLM field in an XFL form instruction.  */
 #define FLM (23)
-  { 8, 17, 0, 0, 0 },
+  { 8, 17, NULL, NULL, 0 },
 
   /* The FRA field in an X or A form instruction.  */
 #define FRA (24)
 #define FRA_MASK (0x1f << 16)
-  { 5, 16, 0, 0, PPC_OPERAND_FPR },
+  { 5, 16, NULL, NULL, PPC_OPERAND_FPR },
 
   /* The FRB field in an X or A form instruction.  */
 #define FRB (25)
 #define FRB_MASK (0x1f << 11)
-  { 5, 11, 0, 0, PPC_OPERAND_FPR },
+  { 5, 11, NULL, NULL, PPC_OPERAND_FPR },
 
   /* The FRC field in an A form instruction.  */
 #define FRC (26)
 #define FRC_MASK (0x1f << 6)
-  { 5, 6, 0, 0, PPC_OPERAND_FPR },
+  { 5, 6, NULL, NULL, PPC_OPERAND_FPR },
 
   /* The FRS field in an X form instruction or the FRT field in a D, X
      or A form instruction.  */
 #define FRS (27)
 #define FRT (FRS)
-  { 5, 21, 0, 0, PPC_OPERAND_FPR },
+  { 5, 21, NULL, NULL, PPC_OPERAND_FPR },
 
   /* The FXM field in an XFX instruction.  */
 #define FXM (28)
 #define FXM_MASK (0xff << 12)
-  { 8, 12, 0, 0, 0 },
+  { 8, 12, NULL, NULL, 0 },
 
   /* The L field in a D or X form instruction.  */
 #define L (29)
-  { 1, 21, 0, 0, PPC_OPERAND_OPTIONAL },
+  { 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
 
   /* The LEV field in a POWER SC form instruction.  */
 #define LEV (30)
-  { 7, 5, 0, 0, 0 },
+  { 7, 5, NULL, NULL, 0 },
 
   /* The LI field in an I form instruction.  The lower two bits are
      forced to zero.  */
@@ -248,19 +248,19 @@
   /* The MB field in an M form instruction.  */
 #define MB (33)
 #define MB_MASK (0x1f << 6)
-  { 5, 6, 0, 0, 0 },
+  { 5, 6, NULL, NULL, 0 },
 
   /* The ME field in an M form instruction.  */
 #define ME (34)
 #define ME_MASK (0x1f << 1)
-  { 5, 1, 0, 0, 0 },
+  { 5, 1, NULL, NULL, 0 },
 
   /* The MB and ME fields in an M form instruction expressed a single
      operand which is a bitmask indicating which bits to select.  This
      is a two operand form using PPC_OPERAND_NEXT.  See the
      description in opcode/ppc.h for what this means.  */
 #define MBE (35)
-  { 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
+  { 5, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
   { 32, 0, insert_mbe, extract_mbe, 0 },
 
   /* The MB or ME field in an MD or MDS form instruction.  The high
@@ -284,29 +284,29 @@
   /* The RA field in an D, DS, X, XO, M, or MDS form instruction.  */
 #define RA (40)
 #define RA_MASK (0x1f << 16)
-  { 5, 16, 0, 0, PPC_OPERAND_GPR },
+  { 5, 16, NULL, NULL, PPC_OPERAND_GPR },
 
   /* The RA field in a D or X form instruction which is an updating
      load, which means that the RA field may not be zero and may not
      equal the RT field.  */
 #define RAL (41)
-  { 5, 16, insert_ral, 0, PPC_OPERAND_GPR },
+  { 5, 16, insert_ral, NULL, PPC_OPERAND_GPR },
 
   /* The RA field in an lmw instruction, which has special value
      restrictions.  */
 #define RAM (42)
-  { 5, 16, insert_ram, 0, PPC_OPERAND_GPR },
+  { 5, 16, insert_ram, NULL, PPC_OPERAND_GPR },
 
   /* The RA field in a D or X form instruction which is an updating
      store or an updating floating point load, which means that the RA
      field may not be zero.  */
 #define RAS (43)
-  { 5, 16, insert_ras, 0, PPC_OPERAND_GPR },
+  { 5, 16, insert_ras, NULL, PPC_OPERAND_GPR },
 
   /* The RB field in an X, XO, M, or MDS form instruction.  */
 #define RB (44)
 #define RB_MASK (0x1f << 11)
-  { 5, 11, 0, 0, PPC_OPERAND_GPR },
+  { 5, 11, NULL, NULL, PPC_OPERAND_GPR },
 
   /* The RB field in an X form instruction when it must be the same as
      the RS field in the instruction.  This is used for extended
@@ -320,12 +320,12 @@
 #define RS (46)
 #define RT (RS)
 #define RT_MASK (0x1f << 21)
-  { 5, 21, 0, 0, PPC_OPERAND_GPR },
+  { 5, 21, NULL, NULL, PPC_OPERAND_GPR },
 
   /* The SH field in an X or M form instruction.  */
 #define SH (47)
 #define SH_MASK (0x1f << 11)
-  { 5, 11, 0, 0, 0 },
+  { 5, 11, NULL, NULL, 0 },
 
   /* The SH field in an MD form instruction.  This is split.  */
 #define SH6 (48)
@@ -334,12 +334,12 @@
 
   /* The SI field in a D form instruction.  */
 #define SI (49)
-  { 16, 0, 0, 0, PPC_OPERAND_SIGNED },
+  { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED },
 
   /* The SI field in a D form instruction when we accept a wide range
      of positive values.  */
 #define SISIGNOPT (50)
-  { 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
+  { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
 
   /* The SPR field in an XFX form instruction.  This is flipped--the
      lower 5 bits are stored in the upper 5 and vice- versa.  */
@@ -350,20 +350,20 @@
   /* The BAT index number in an XFX form m[ft]ibat[lu] instruction.  */
 #define SPRBAT (52)
 #define SPRBAT_MASK (0x3 << 17)
-  { 2, 17, 0, 0, 0 },
+  { 2, 17, NULL, NULL, 0 },
 
   /* The SPRG register number in an XFX form m[ft]sprg instruction.  */
 #define SPRG (53)
 #define SPRG_MASK (0x3 << 16)
-  { 2, 16, 0, 0, 0 },
+  { 2, 16, NULL, NULL, 0 },
 
   /* The SR field in an X form instruction.  */
 #define SR (54)
-  { 4, 16, 0, 0, 0 },
+  { 4, 16, NULL, NULL, 0 },
 
   /* The SV field in a POWER SC form instruction.  */
 #define SV (55)
-  { 14, 2, 0, 0, 0 },
+  { 14, 2, NULL, NULL, 0 },
 
   /* The TBR field in an XFX form instruction.  This is like the SPR
      field, but it is optional.  */
@@ -373,15 +373,15 @@
   /* The TO field in a D or X form instruction.  */
 #define TO (57)
 #define TO_MASK (0x1f << 21)
-  { 5, 21, 0, 0, 0 },
+  { 5, 21, NULL, NULL, 0 },
 
   /* The U field in an X form instruction.  */
 #define U (58)
-  { 4, 12, 0, 0, 0 },
+  { 4, 12, NULL, NULL, 0 },
 
   /* The UI field in a D form instruction.  */
 #define UI (59)
-  { 16, 0, 0, 0, 0 },
+  { 16, 0, NULL, NULL, 0 },
 };
 
 /* The functions used to insert and extract complicated operands.  */
diff -Nru a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
--- a/arch/ppc/xmon/start.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/xmon/start.c	2004-07-27 18:24:51 -07:00
@@ -448,13 +448,13 @@
 	scc_initialized = 1;
 	if (via_modem) {
 		for (;;) {
-			xmon_write(0, "ATE1V1\r", 7);
+			xmon_write(NULL, "ATE1V1\r", 7);
 			if (xmon_expect("OK", 5)) {
-				xmon_write(0, "ATA\r", 4);
+				xmon_write(NULL, "ATA\r", 4);
 				if (xmon_expect("CONNECT", 40))
 					break;
 			}
-			xmon_write(0, "+++", 3);
+			xmon_write(NULL, "+++", 3);
 			xmon_expect("OK", 3);
 		}
 	}
@@ -618,7 +618,7 @@
 	c = xmon_getchar();
 	if (c == -1) {
 	    if (p == str)
-		return 0;
+		return NULL;
 	    break;
 	}
 	*p++ = c;
diff -Nru a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
--- a/arch/ppc/xmon/xmon.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc/xmon/xmon.c	2004-07-27 18:24:51 -07:00
@@ -239,7 +239,7 @@
 		set_backlight_level(BACKLIGHT_MAX);
 		sync();
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 #endif	/* CONFIG_PMAC_BACKLIGHT */
 	cmd = cmds(excp);
 	if (cmd == 's') {
@@ -253,7 +253,7 @@
 		insert_bpts();
 	}
 	xmon_leave();
-	xmon_regs[smp_processor_id()] = 0;
+	xmon_regs[smp_processor_id()] = NULL;
 #ifdef CONFIG_SMP
 	clear_bit(0, &got_xmon);
 	clear_bit(smp_processor_id(), &cpus_in_xmon);
@@ -352,7 +352,7 @@
 	for (i = 0; i < NBPTS; ++i, ++bp)
 		if (bp->enabled && pc == bp->address)
 			return bp;
-	return 0;
+	return NULL;
 }
 
 static void
@@ -962,7 +962,7 @@
 			xmon_puts(sysmap);
 			sync();
 		}
-		debugger_fault_handler = 0;
+		debugger_fault_handler = NULL;
 	}
 	else
 		printf("No System.map\n");
@@ -1203,7 +1203,7 @@
 		__delay(200);
 		n = size;
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return n;
 }
 
@@ -1233,7 +1233,7 @@
 	} else {
 		printf("*** Error writing address %x\n", adrs + n);
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return n;
 }
 
@@ -1673,7 +1673,7 @@
 	} else {
 		printf("*** %x exception occurred\n", fault_except);
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 }
 
 /* Input scanning routines */
@@ -1886,7 +1886,7 @@
 				} while (cur);
 				sync();
 			}
-			debugger_fault_handler = 0;
+			debugger_fault_handler = NULL;
 			termch = 0;
 			break;
 	}
@@ -1939,7 +1939,7 @@
 				*(ep++) = 0;
 				if (saddr)
 					*saddr = prev;
-				debugger_fault_handler = 0;
+				debugger_fault_handler = NULL;
 				return rbuffer;
 			}
 			prev = next;
@@ -1951,7 +1951,7 @@
 bail:
 		sync();
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return NULL;
 }
 
@@ -2003,6 +2003,6 @@
 		}
 		sync();
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return result;
 }		
diff -Nru a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c
--- a/arch/ppc64/kernel/eeh.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc64/kernel/eeh.c	2004-07-27 18:24:52 -07:00
@@ -473,10 +473,10 @@
 {
 	struct eeh_early_enable_info *info = data;
 	int ret;
-	char *status = get_property(dn, "status", 0);
-	u32 *class_code = (u32 *)get_property(dn, "class-code", 0);
-	u32 *vendor_id = (u32 *)get_property(dn, "vendor-id", 0);
-	u32 *device_id = (u32 *)get_property(dn, "device-id", 0);
+	char *status = get_property(dn, "status", NULL);
+	u32 *class_code = (u32 *)get_property(dn, "class-code", NULL);
+	u32 *vendor_id = (u32 *)get_property(dn, "vendor-id", NULL);
+	u32 *device_id = (u32 *)get_property(dn, "device-id", NULL);
 	u32 *regs;
 	int enable;
 
@@ -522,7 +522,7 @@
 
 	/* Ok... see if this device supports EEH.  Some do, some don't,
 	 * and the only way to find out is to check each and every one. */
-	regs = (u32 *)get_property(dn, "reg", 0);
+	regs = (u32 *)get_property(dn, "reg", NULL);
 	if (regs) {
 		/* First register entry is addr (00BBSS00)  */
 		/* Try to enable eeh */
@@ -802,7 +802,7 @@
 
 	/* Build list of strings to match */
 	nstrs = 0;
-	s = (char *)get_property(dn, "ibm,loc-code", 0);
+	s = (char *)get_property(dn, "ibm,loc-code", NULL);
 	if (s)
 		strs[nstrs++] = s;
 	sprintf(devname, "dev%04x:%04x", vendor_id, device_id);
diff -Nru a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S
--- a/arch/ppc64/kernel/entry.S	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/entry.S	2004-07-27 18:24:51 -07:00
@@ -132,7 +132,7 @@
  */
 	ld	r11,.SYS_CALL_TABLE@toc(2)
 	andi.	r10,r10,_TIF_32BIT
-	beq-	15f
+	beq	15f
 	ld	r11,.SYS_CALL_TABLE32@toc(2)
 	clrldi	r3,r3,32
 	clrldi	r4,r4,32
@@ -143,8 +143,8 @@
 15:
 	slwi	r0,r0,3
 	ldx	r10,r11,r0	/* Fetch system call handler [ptr] */
-	mtlr	r10
-	blrl			/* Call handler */
+	mtctr   r10
+	bctrl			/* Call handler */
 
 syscall_exit:
 #ifdef SHOW_SYSCALLS
@@ -182,7 +182,7 @@
 	stdcx.	r0,0,r1			/* to clear the reservation */
 	andi.	r6,r8,MSR_PR
 	ld	r4,_LINK(r1)
-	beq	1f			/* only restore r13 if */
+	beq-	1f			/* only restore r13 if */
 	ld	r13,GPR13(r1)		/* returning to usermode */
 1:	ld	r2,GPR2(r1)
 	ld	r1,GPR1(r1)
diff -Nru a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
--- a/arch/ppc64/kernel/head.S	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/head.S	2004-07-27 18:24:51 -07:00
@@ -683,7 +683,7 @@
 	li	r11,1
 	stb	r11,PACALPPACA+LPPACADECRINT(r13)
 	lwz	r12,PACADEFAULTDECR(r13)
-	mtspr	DEC,r12
+	mtspr	SPRN_DEC,r12
 	/* fall through */
 
 	.globl HardwareInterrupt_Iseries_masked
@@ -1028,7 +1028,7 @@
 	bl	.local_irq_restore
 	b	11f
 #else
-	beq+	fast_exception_return   /* Return from exception on success */
+	beq	fast_exception_return   /* Return from exception on success */
 	/* fall through */
 #endif
 
diff -Nru a/arch/ppc64/kernel/hvconsole.c b/arch/ppc64/kernel/hvconsole.c
--- a/arch/ppc64/kernel/hvconsole.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/hvconsole.c	2004-07-27 18:24:51 -07:00
@@ -76,7 +76,7 @@
 	 * we should _always_ be able to find one. */
 	vty = of_find_node_by_name(NULL, "vty");
 	if (vty && device_is_compatible(vty, "hvterm1")) {
-		u32 *termno = (u32 *)get_property(vty, "reg", 0);
+		u32 *termno = (u32 *)get_property(vty, "reg", NULL);
 
 		if (termno && start_termno)
 			*start_termno = *termno;
diff -Nru a/arch/ppc64/kernel/open_pic.c b/arch/ppc64/kernel/open_pic.c
--- a/arch/ppc64/kernel/open_pic.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/open_pic.c	2004-07-27 18:24:51 -07:00
@@ -168,7 +168,7 @@
         struct device_node *np;
         int i;
         unsigned int *addrp;
-        unsigned char* chrp_int_ack_special = 0;
+        unsigned char* chrp_int_ack_special = NULL;
         unsigned char init_senses[NR_IRQS - NUM_ISA_INTERRUPTS];
         int nmi_irq = -1;
 #if defined(CONFIG_VT) && defined(CONFIG_ADB_KEYBOARD) && defined(XMON)
@@ -642,13 +642,13 @@
 
 	/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
 	request_irq(openpic_vec_ipi, openpic_ipi_action, SA_INTERRUPT,
-		    "IPI0 (call function)", 0);
+		    "IPI0 (call function)", NULL);
 	request_irq(openpic_vec_ipi+1, openpic_ipi_action, SA_INTERRUPT,
-		   "IPI1 (reschedule)", 0);
+		   "IPI1 (reschedule)", NULL);
 	request_irq(openpic_vec_ipi+2, openpic_ipi_action, SA_INTERRUPT,
-		   "IPI2 (unused)", 0);
+		   "IPI2 (unused)", NULL);
 	request_irq(openpic_vec_ipi+3, openpic_ipi_action, SA_INTERRUPT,
-		   "IPI3 (debugger break)", 0);
+		   "IPI3 (debugger break)", NULL);
 
 	for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
 		openpic_enable_ipi(openpic_vec_ipi+i);
diff -Nru a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c
--- a/arch/ppc64/kernel/pSeries_iommu.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/pSeries_iommu.c	2004-07-27 18:24:51 -07:00
@@ -147,7 +147,7 @@
 		bus = pci_bus_b(ln);
 		busdn = PCI_GET_DN(bus);
 
-		dma_window = (unsigned int *)get_property(busdn, "ibm,dma-window", 0);
+		dma_window = (unsigned int *)get_property(busdn, "ibm,dma-window", NULL);
 		if (dma_window) {
 			/* Bussubno hasn't been copied yet.
 			 * Do it now because iommu_table_setparms_lpar needs it.
@@ -231,7 +231,7 @@
 {
 	unsigned int *dma_window;
 
-	dma_window = (unsigned int *)get_property(dn, "ibm,dma-window", 0);
+	dma_window = (unsigned int *)get_property(dn, "ibm,dma-window", NULL);
 
 	if (!dma_window)
 		panic("iommu_table_setparms_lpar: device %s has no"
diff -Nru a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c
--- a/arch/ppc64/kernel/pSeries_lpar.c	2004-07-27 18:24:53 -07:00
+++ b/arch/ppc64/kernel/pSeries_lpar.c	2004-07-27 18:24:53 -07:00
@@ -269,7 +269,7 @@
 	}
 
 	/* now we have the stdout node; figure out what type of device it is. */
-	name = (char *)get_property(stdout_node, "name", 0);
+	name = (char *)get_property(stdout_node, "name", NULL);
 	if (!name) {
 		printk(KERN_WARNING "stdout node missing 'name' property!\n");
 		goto out;
@@ -277,7 +277,7 @@
 
 	if (strncmp(name, "vty", 3) == 0) {
 		if (device_is_compatible(stdout_node, "hvterm1")) {
-			termno = (u32 *)get_property(stdout_node, "reg", 0);
+			termno = (u32 *)get_property(stdout_node, "reg", NULL);
 			if (termno) {
 				vtermno = termno[0];
 				ppc_md.udbg_putc = udbg_putcLP;
diff -Nru a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c
--- a/arch/ppc64/kernel/pci_dn.c	2004-07-27 18:24:53 -07:00
+++ b/arch/ppc64/kernel/pci_dn.c	2004-07-27 18:24:53 -07:00
@@ -49,13 +49,13 @@
 #ifdef CONFIG_PPC_PSERIES
 	struct pci_controller *phb = (struct pci_controller *)data;
 	u32 *regs;
-	char *device_type = get_property(dn, "device_type", 0);
+	char *device_type = get_property(dn, "device_type", NULL);
 	char *model;
 
 	dn->phb = phb;
-	if (device_type && strcmp(device_type, "pci") == 0 && get_property(dn, "class-code", 0) == 0) {
+	if (device_type && strcmp(device_type, "pci") == 0 && get_property(dn, "class-code", NULL) == 0) {
 		/* special case for PHB's.  Sigh. */
-		regs = (u32 *)get_property(dn, "bus-range", 0);
+		regs = (u32 *)get_property(dn, "bus-range", NULL);
 		dn->busno = regs[0];
 
 		model = (char *)get_property(dn, "model", NULL);
@@ -65,7 +65,7 @@
 		else
 			dn->devfn = 0;	/* assumption */
 	} else {
-		regs = (u32 *)get_property(dn, "reg", 0);
+		regs = (u32 *)get_property(dn, "reg", NULL);
 		if (regs) {
 			/* First register entry is addr (00BBSS00)  */
 			dn->busno = (regs[0] >> 16) & 0xff;
@@ -107,7 +107,7 @@
 	for (dn = start->child; dn; dn = nextdn) {
 		nextdn = NULL;
 #ifdef CONFIG_PPC_PSERIES
-		if (get_property(dn, "class-code", 0)) {
+		if (get_property(dn, "class-code", NULL)) {
 			if (pre && (ret = pre(dn, data)) != NULL)
 				return ret;
 			if (dn->child) {
diff -Nru a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c
--- a/arch/ppc64/kernel/pmac_pci.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc64/kernel/pmac_pci.c	2004-07-27 18:24:52 -07:00
@@ -57,7 +57,7 @@
 		int len;
 
 		/* For PCI<->PCI bridges or CardBus bridges, we go down */
-		class_code = (unsigned int *) get_property(node, "class-code", 0);
+		class_code = (unsigned int *) get_property(node, "class-code", NULL);
 		if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
 			continue;
diff -Nru a/arch/ppc64/kernel/proc_ppc64.c b/arch/ppc64/kernel/proc_ppc64.c
--- a/arch/ppc64/kernel/proc_ppc64.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc64/kernel/proc_ppc64.c	2004-07-27 18:24:52 -07:00
@@ -84,7 +84,7 @@
 {
 	struct proc_dir_entry *root;
 
-	root = proc_mkdir("ppc64", 0);
+	root = proc_mkdir("ppc64", NULL);
 	if (!root)
 		return 1;
 
@@ -94,7 +94,7 @@
 	if (!proc_mkdir("rtas", root))
 		return 1;
 
-	if (!proc_symlink("rtas", 0, "ppc64/rtas"))
+	if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
 		return 1;
 
 	return 0;
diff -Nru a/arch/ppc64/kernel/rtas.c b/arch/ppc64/kernel/rtas.c
--- a/arch/ppc64/kernel/rtas.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/rtas.c	2004-07-27 18:24:51 -07:00
@@ -31,7 +31,7 @@
 #include <asm/delay.h>
 #include <asm/uaccess.h>
 
-struct flash_block_list_header rtas_firmware_flash_list = {0, 0};
+struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
 
 struct rtas_t rtas = { 
 	.lock = SPIN_LOCK_UNLOCKED
@@ -329,7 +329,7 @@
 		if (f->next)
 			f->next = (struct flash_block_list *)virt_to_abs(f->next);
 		else
-			f->next = 0LL;
+			f->next = NULL;
 		/* make num_blocks into the version/length field */
 		f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
 	}
diff -Nru a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c
--- a/arch/ppc64/kernel/rtasd.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/rtasd.c	2004-07-27 18:24:51 -07:00
@@ -455,7 +455,7 @@
 	else
 		printk(KERN_ERR "Failed to create error_log proc entry\n");
 
-	if (kernel_thread(rtasd, 0, CLONE_FS) < 0)
+	if (kernel_thread(rtasd, NULL, CLONE_FS) < 0)
 		printk(KERN_ERR "Failed to start RTAS daemon\n");
 
 	return 0;
diff -Nru a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
--- a/arch/ppc64/kernel/rtc.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/rtc.c	2004-07-27 18:24:51 -07:00
@@ -207,7 +207,7 @@
 		return retval;
 
 #ifdef CONFIG_PROC_FS
-	if(create_proc_read_entry ("driver/rtc", 0, 0, rtc_read_proc, NULL) == NULL)
+	if (create_proc_read_entry ("driver/rtc", 0, NULL, rtc_read_proc, NULL) == NULL)
 		misc_deregister(&rtc_dev);
 		return -ENOMEM;
 #endif
diff -Nru a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
--- a/arch/ppc64/kernel/smp.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc64/kernel/smp.c	2004-07-27 18:24:52 -07:00
@@ -715,7 +715,7 @@
 			printk("smp_call_function on cpu %d: other cpus not "
 			       "responding (%d)\n", smp_processor_id(),
 			       atomic_read(&data.started));
-			debugger(0);
+			debugger(NULL);
 			goto out;
 		}
 	}
@@ -730,7 +730,7 @@
 				       smp_processor_id(),
 				       atomic_read(&data.finished),
 				       atomic_read(&data.started));
-				debugger(0);
+				debugger(NULL);
 				goto out;
 			}
 		}
diff -Nru a/arch/ppc64/kernel/vio.c b/arch/ppc64/kernel/vio.c
--- a/arch/ppc64/kernel/vio.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/vio.c	2004-07-27 18:24:51 -07:00
@@ -380,7 +380,7 @@
 	viodev->dev.platform_data = of_node_get(of_node);
 
 	viodev->irq = NO_IRQ;
-	irq_p = (unsigned int *)get_property(of_node, "interrupts", 0);
+	irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
 	if (irq_p) {
 		int virq = virt_irq_create_mapping(*irq_p);
 		if (virq == NO_IRQ) {
diff -Nru a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c
--- a/arch/ppc64/kernel/xics.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/kernel/xics.c	2004-07-27 18:24:51 -07:00
@@ -475,7 +475,7 @@
 		while (1);
 	}
 nextnode:
-	ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", 0);
+	ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL);
 	if (ireg) {
 		/*
 		 * set node starting index for this node
@@ -532,7 +532,7 @@
 		xics_irq_8259_cascade_real = -1;
 		xics_irq_8259_cascade = -1;
 	} else {
-		ireg = (uint *) get_property(np, "interrupts", 0);
+		ireg = (uint *) get_property(np, "interrupts", NULL);
 		if (!ireg) {
 			printk(KERN_WARNING "Can't find ISA Interrupts Property\n");
 			udbg_printf("Can't find ISA Interrupts Property\n");
@@ -589,7 +589,7 @@
 	if (naca->interrupt_controller == IC_PPC_XIC &&
 	    xics_irq_8259_cascade != -1) {
 		if (request_irq(irq_offset_up(xics_irq_8259_cascade),
-				no_action, 0, "8259 cascade", 0))
+				no_action, 0, "8259 cascade", NULL))
 			printk(KERN_ERR "xics_init_IRQ: couldn't get 8259 cascade\n");
 		i8259_init();
 	}
@@ -604,7 +604,7 @@
 
 	/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
 	request_irq(irq_offset_up(XICS_IPI), xics_ipi_action, SA_INTERRUPT,
-		    "IPI", 0);
+		    "IPI", NULL);
 	get_irq_desc(irq_offset_up(XICS_IPI))->status |= IRQ_PER_CPU;
 }
 #endif
diff -Nru a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
--- a/arch/ppc64/mm/init.c	2004-07-27 18:24:51 -07:00
+++ b/arch/ppc64/mm/init.c	2004-07-27 18:24:51 -07:00
@@ -545,6 +545,8 @@
 
 	boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
 
+	max_pfn = max_low_pfn;
+
 	/* add all physical memory to the bootmem map. Also find the first */
 	for (i=0; i < lmb.memory.cnt; i++) {
 		unsigned long physbase, size;
@@ -629,7 +631,6 @@
 
 	num_physpages = max_low_pfn;	/* RAM is assumed contiguous */
 	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
-	max_pfn = max_low_pfn;
 
 #ifdef CONFIG_DISCONTIGMEM
 {
diff -Nru a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c
--- a/arch/ppc64/mm/numa.c	2004-07-27 18:24:52 -07:00
+++ b/arch/ppc64/mm/numa.c	2004-07-27 18:24:52 -07:00
@@ -356,6 +356,7 @@
 
 	min_low_pfn = 0;
 	max_low_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
+	max_pfn = max_low_pfn;
 
 	if (parse_numa_properties())
 		setup_nonnuma();
diff -Nru a/arch/sparc/lib/copy_user.S b/arch/sparc/lib/copy_user.S
--- a/arch/sparc/lib/copy_user.S	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc/lib/copy_user.S	2004-07-27 18:24:51 -07:00
@@ -64,52 +64,52 @@
 
 /* Both these macros have to start with exactly the same insn */
 #define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
-	ldd	[%src + offset + 0x00], %t0; \
-	ldd	[%src + offset + 0x08], %t2; \
-	ldd	[%src + offset + 0x10], %t4; \
-	ldd	[%src + offset + 0x18], %t6; \
-	st	%t0, [%dst + offset + 0x00]; \
-	st	%t1, [%dst + offset + 0x04]; \
-	st	%t2, [%dst + offset + 0x08]; \
-	st	%t3, [%dst + offset + 0x0c]; \
-	st	%t4, [%dst + offset + 0x10]; \
-	st	%t5, [%dst + offset + 0x14]; \
-	st	%t6, [%dst + offset + 0x18]; \
-	st	%t7, [%dst + offset + 0x1c];
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	ldd	[%src + (offset) + 0x10], %t4; \
+	ldd	[%src + (offset) + 0x18], %t6; \
+	st	%t0, [%dst + (offset) + 0x00]; \
+	st	%t1, [%dst + (offset) + 0x04]; \
+	st	%t2, [%dst + (offset) + 0x08]; \
+	st	%t3, [%dst + (offset) + 0x0c]; \
+	st	%t4, [%dst + (offset) + 0x10]; \
+	st	%t5, [%dst + (offset) + 0x14]; \
+	st	%t6, [%dst + (offset) + 0x18]; \
+	st	%t7, [%dst + (offset) + 0x1c];
 
 #define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
-	ldd	[%src + offset + 0x00], %t0; \
-	ldd	[%src + offset + 0x08], %t2; \
-	ldd	[%src + offset + 0x10], %t4; \
-	ldd	[%src + offset + 0x18], %t6; \
-	std	%t0, [%dst + offset + 0x00]; \
-	std	%t2, [%dst + offset + 0x08]; \
-	std	%t4, [%dst + offset + 0x10]; \
-	std	%t6, [%dst + offset + 0x18];
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	ldd	[%src + (offset) + 0x10], %t4; \
+	ldd	[%src + (offset) + 0x18], %t6; \
+	std	%t0, [%dst + (offset) + 0x00]; \
+	std	%t2, [%dst + (offset) + 0x08]; \
+	std	%t4, [%dst + (offset) + 0x10]; \
+	std	%t6, [%dst + (offset) + 0x18];
 
 #define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
-	ldd	[%src - offset - 0x10], %t0; \
-	ldd	[%src - offset - 0x08], %t2; \
-	st	%t0, [%dst - offset - 0x10]; \
-	st	%t1, [%dst - offset - 0x0c]; \
-	st	%t2, [%dst - offset - 0x08]; \
-	st	%t3, [%dst - offset - 0x04];
+	ldd	[%src - (offset) - 0x10], %t0; \
+	ldd	[%src - (offset) - 0x08], %t2; \
+	st	%t0, [%dst - (offset) - 0x10]; \
+	st	%t1, [%dst - (offset) - 0x0c]; \
+	st	%t2, [%dst - (offset) - 0x08]; \
+	st	%t3, [%dst - (offset) - 0x04];
 
 #define MOVE_HALFCHUNK(src, dst, offset, t0, t1, t2, t3) \
-	lduh	[%src + offset + 0x00], %t0; \
-	lduh	[%src + offset + 0x02], %t1; \
-	lduh	[%src + offset + 0x04], %t2; \
-	lduh	[%src + offset + 0x06], %t3; \
-	sth	%t0, [%dst + offset + 0x00]; \
-	sth	%t1, [%dst + offset + 0x02]; \
-	sth	%t2, [%dst + offset + 0x04]; \
-	sth	%t3, [%dst + offset + 0x06];
+	lduh	[%src + (offset) + 0x00], %t0; \
+	lduh	[%src + (offset) + 0x02], %t1; \
+	lduh	[%src + (offset) + 0x04], %t2; \
+	lduh	[%src + (offset) + 0x06], %t3; \
+	sth	%t0, [%dst + (offset) + 0x00]; \
+	sth	%t1, [%dst + (offset) + 0x02]; \
+	sth	%t2, [%dst + (offset) + 0x04]; \
+	sth	%t3, [%dst + (offset) + 0x06];
 
 #define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
-	ldub	[%src - offset - 0x02], %t0; \
-	ldub	[%src - offset - 0x01], %t1; \
-	stb	%t0, [%dst - offset - 0x02]; \
-	stb	%t1, [%dst - offset - 0x01];
+	ldub	[%src - (offset) - 0x02], %t0; \
+	ldub	[%src - (offset) - 0x01], %t1; \
+	stb	%t0, [%dst - (offset) - 0x02]; \
+	stb	%t1, [%dst - (offset) - 0x01];
 
 	.text
 	.align	4
diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
--- a/arch/sparc64/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/arch/sparc64/Kconfig	2004-07-27 18:24:52 -07:00
@@ -382,6 +382,7 @@
 
 config SUNOS_EMUL
 	bool "SunOS binary emulation"
+	depends on BINFMT_AOUT32
 	help
 	  This allows you to run most SunOS binaries.  If you want to do this,
 	  say Y here and place appropriate files in /usr/gnemul/sunos. See
@@ -391,7 +392,7 @@
 
 config SOLARIS_EMUL
 	tristate "Solaris binary emulation (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
+	depends on SPARC32_COMPAT && EXPERIMENTAL
 	help
 	  This is experimental code which will enable you to run (many)
 	  Solaris binaries on your SPARC Linux machine.
diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig
--- a/arch/sparc64/defconfig	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/defconfig	2004-07-27 18:24:51 -07:00
@@ -201,8 +201,6 @@
 CONFIG_SUN_MOSTEK_RTC=y
 CONFIG_OBP_FLASH=m
 # CONFIG_SUN_BPP is not set
-# CONFIG_SUN_VIDEOPIX is not set
-# CONFIG_SUN_AURORA is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -346,10 +344,8 @@
 CONFIG_SCSI_SATA_VITESSE=m
 # CONFIG_SCSI_BUSLOGIC is not set
 CONFIG_SCSI_DMX3191D=m
-# CONFIG_SCSI_EATA is not set
 CONFIG_SCSI_EATA_PIO=m
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GDTH is not set
 CONFIG_SCSI_IPS=m
 CONFIG_SCSI_INIA100=m
 CONFIG_SCSI_PPA=m
@@ -377,7 +373,7 @@
 # CONFIG_SCSI_QLA6312 is not set
 # CONFIG_SCSI_QLA6322 is not set
 CONFIG_SCSI_DC395x=m
-CONFIG_SCSI_DC390T=m
+# CONFIG_SCSI_DC390T is not set
 CONFIG_SCSI_DEBUG=m
 CONFIG_SCSI_SUNESP=y
 
@@ -1132,12 +1128,15 @@
 #
 CONFIG_I2C_SENSOR=m
 CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1031=m
 CONFIG_SENSORS_ASB100=m
 CONFIG_SENSORS_DS1621=m
 CONFIG_SENSORS_FSCHER=m
 CONFIG_SENSORS_GL518SM=m
 CONFIG_SENSORS_IT87=m
 CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
 CONFIG_SENSORS_LM78=m
 CONFIG_SENSORS_LM80=m
 CONFIG_SENSORS_LM83=m
@@ -1240,6 +1239,7 @@
 # CONFIG_BEFS_DEBUG is not set
 CONFIG_BFS_FS=m
 CONFIG_EFS_FS=m
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 CONFIG_CRAMFS=m
 CONFIG_VXFS_FS=m
 CONFIG_HPFS_FS=m
@@ -1606,6 +1606,7 @@
 # CONFIG_USB_OV511 is not set
 CONFIG_USB_PWC=m
 # CONFIG_USB_SE401 is not set
+CONFIG_USB_SN9C102=m
 # CONFIG_USB_STV680 is not set
 CONFIG_USB_W9968CF=m
 
diff -Nru a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
--- a/arch/sparc64/kernel/binfmt_aout32.c	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/kernel/binfmt_aout32.c	2004-07-27 18:24:51 -07:00
@@ -247,10 +247,10 @@
 		loff_t pos = fd_offset;
 		/* Fuck me plenty... */
 		error = do_brk(N_TXTADDR(ex), ex.a_text);
-		bprm->file->f_op->read(bprm->file, (char *) N_TXTADDR(ex),
+		bprm->file->f_op->read(bprm->file, (char __user *)N_TXTADDR(ex),
 			  ex.a_text, &pos);
 		error = do_brk(N_DATADDR(ex), ex.a_data);
-		bprm->file->f_op->read(bprm->file, (char *) N_DATADDR(ex),
+		bprm->file->f_op->read(bprm->file, (char __user *)N_DATADDR(ex),
 			  ex.a_data, &pos);
 		goto beyond_if;
 	}
@@ -259,7 +259,7 @@
 		loff_t pos = fd_offset;
 		do_brk(N_TXTADDR(ex) & PAGE_MASK,
 			ex.a_text+ex.a_data + PAGE_SIZE - 1);
-		bprm->file->f_op->read(bprm->file, (char *) N_TXTADDR(ex),
+		bprm->file->f_op->read(bprm->file, (char __user *)N_TXTADDR(ex),
 			  ex.a_text+ex.a_data, &pos);
 	} else {
 		static unsigned long error_time;
@@ -273,7 +273,8 @@
 		if (!bprm->file->f_op->mmap) {
 			loff_t pos = fd_offset;
 			do_brk(0, ex.a_text+ex.a_data);
-			bprm->file->f_op->read(bprm->file,(char *)N_TXTADDR(ex),
+			bprm->file->f_op->read(bprm->file,
+				  (char __user *)N_TXTADDR(ex),
 				  ex.a_text+ex.a_data, &pos);
 			goto beyond_if;
 		}
diff -Nru a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
--- a/arch/sparc64/kernel/entry.S	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/kernel/entry.S	2004-07-27 18:24:51 -07:00
@@ -1496,28 +1496,30 @@
 	/* SunOS's execv() call only specifies the argv argument, the
 	 * environment settings are the same as the calling processes.
 	 */
-	.globl	sunos_execv, sys_execve, sys32_execve
+	.globl	sunos_execv
 sys_execve:
 	sethi		%hi(sparc_execve), %g1
 	ba,pt		%xcc, execve_merge
 	 or		%g1, %lo(sparc_execve), %g1
+#ifdef CONFIG_COMPAT
+	.globl	sys_execve
 sunos_execv:
 	stx		%g0, [%sp + PTREGS_OFF + PT_V9_I2]
+	.globl	sys32_execve
 sys32_execve:
 	sethi		%hi(sparc32_execve), %g1
 	or		%g1, %lo(sparc32_execve), %g1
+#endif
 execve_merge:
 	flushw
 	jmpl		%g1, %g0
 	 add		%sp, PTREGS_OFF, %o0
 
 	.globl	sys_pipe, sys_sigpause, sys_nis_syscall
-	.globl	sys_sigsuspend, sys_rt_sigsuspend, sys32_rt_sigsuspend
+	.globl	sys_sigsuspend, sys_rt_sigsuspend
 	.globl	sys_rt_sigreturn
-	.globl	sys32_sigreturn, sys32_rt_sigreturn
-	.globl	sys32_execve, sys_ptrace
-	.globl	sys_sigaltstack, sys32_sigaltstack
-	.globl	sys32_sigstack
+	.globl	sys_ptrace
+	.globl	sys_sigaltstack
 	.align	32
 sys_pipe:	ba,pt		%xcc, sparc_pipe
 		 add		%sp, PTREGS_OFF, %o0
@@ -1528,12 +1530,15 @@
 		 add		%sp, PTREGS_OFF, %o1
 sys_sigaltstack:ba,pt		%xcc, do_sigaltstack
 		 add		%i6, STACK_BIAS, %o2
+#ifdef CONFIG_COMPAT
+	.globl	sys32_sigstack
 sys32_sigstack:	ba,pt		%xcc, do_sys32_sigstack
 		 mov		%i6, %o2
+	.globl	sys32_sigaltstack
 sys32_sigaltstack:
 		ba,pt		%xcc, do_sys32_sigaltstack
 		 mov		%i6, %o2
-
+#endif
 		.align		32
 sys_sigsuspend:	add		%sp, PTREGS_OFF, %o0
 		call		do_sigsuspend
@@ -1544,31 +1549,40 @@
 		call		do_rt_sigsuspend
 		 add		%o7, 1f-.-4, %o7
 		nop
+#ifdef CONFIG_COMPAT
+	.globl	sys32_rt_sigsuspend
 sys32_rt_sigsuspend: /* NOTE: %o0,%o1 have a correct value already */
 		srl		%o0, 0, %o0
 		add		%sp, PTREGS_OFF, %o2
 		call		do_rt_sigsuspend32
 		 add		%o7, 1f-.-4, %o7
+#endif
 		/* NOTE: %o0 has a correct value already */
 sys_sigpause:	add		%sp, PTREGS_OFF, %o1
 		call		do_sigpause
 		 add		%o7, 1f-.-4, %o7
 		nop
+#ifdef CONFIG_COMPAT
+	.globl	sys32_sigreturn
 sys32_sigreturn:
 		add		%sp, PTREGS_OFF, %o0
 		call		do_sigreturn32
 		 add		%o7, 1f-.-4, %o7
 		nop
+#endif
 sys_rt_sigreturn:
 		add		%sp, PTREGS_OFF, %o0
 		call		do_rt_sigreturn
 		 add		%o7, 1f-.-4, %o7
 		nop
+#ifdef CONFIG_COMPAT
+	.globl	sys32_rt_sigreturn
 sys32_rt_sigreturn:
 		add		%sp, PTREGS_OFF, %o0
 		call		do_rt_sigreturn32
 		 add		%o7, 1f-.-4, %o7
 		nop
+#endif
 sys_ptrace:	add		%sp, PTREGS_OFF, %o0
 		call		do_ptrace
 		 add		%o7, 1f-.-4, %o7
diff -Nru a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
--- a/arch/sparc64/kernel/ioctl32.c	2004-07-27 18:24:52 -07:00
+++ b/arch/sparc64/kernel/ioctl32.c	2004-07-27 18:24:52 -07:00
@@ -25,7 +25,7 @@
 /* Use this to get at 32-bit user passed pointers. 
  * See sys_sparc32.c for description about it.
  */
-#define A(__x) ((void __user *)(unsigned long)(__x))
+#define A(__x) compat_ptr(__x)
 
 static __inline__ void *alloc_user_space(long len)
 {
@@ -54,39 +54,21 @@
 
 static int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct fbcmap f;
+	struct fbcmap32 __user *argp = (void __user *)arg;
+	struct fbcmap __user *p = compat_alloc_user_space(sizeof(*p));
+	u32 addr;
 	int ret;
-	char red[256], green[256], blue[256];
-	u32 r, g, b;
-	mm_segment_t old_fs = get_fs();
 	
-	ret = get_user(f.index, &(((struct fbcmap32 __user *)arg)->index));
-	ret |= __get_user(f.count, &(((struct fbcmap32 __user *)arg)->count));
-	ret |= __get_user(r, &(((struct fbcmap32 __user *)arg)->red));
-	ret |= __get_user(g, &(((struct fbcmap32 __user *)arg)->green));
-	ret |= __get_user(b, &(((struct fbcmap32 __user *)arg)->blue));
+	ret = copy_in_user(p, argp, 2 * sizeof(int));
+	ret |= get_user(addr, &argp->red);
+	ret |= put_user(compat_ptr(addr), &p->red);
+	ret |= get_user(addr, &argp->green);
+	ret |= put_user(compat_ptr(addr), &p->green);
+	ret |= get_user(addr, &argp->blue);
+	ret |= put_user(compat_ptr(addr), &p->blue);
 	if (ret)
 		return -EFAULT;
-	if ((f.index < 0) || (f.index > 255)) return -EINVAL;
-	if (f.index + f.count > 256)
-		f.count = 256 - f.index;
-	if (cmd == FBIOPUTCMAP32) {
-		ret = copy_from_user (red, A(r), f.count);
-		ret |= copy_from_user (green, A(g), f.count);
-		ret |= copy_from_user (blue, A(b), f.count);
-		if (ret)
-			return -EFAULT;
-	}
-	f.red = red; f.green = green; f.blue = blue;
-	set_fs (KERNEL_DS);
-	ret = sys_ioctl (fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (long)&f);
-	set_fs (old_fs);
-	if (!ret && cmd == FBIOGETCMAP32) {
-		ret = copy_to_user (A(r), red, f.count);
-		ret |= copy_to_user (A(g), green, f.count);
-		ret |= copy_to_user (A(b), blue, f.count);
-	}
-	return ret ? -EFAULT : 0;
+	return sys_ioctl(fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (unsigned long)p);
 }
 
 struct fbcursor32 {
@@ -105,52 +87,28 @@
 
 static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct fbcursor f;
+	struct fbcursor __user *p = compat_alloc_user_space(sizeof(*p));
+	struct fbcursor32 __user *argp =  (void __user *)arg;
+	compat_uptr_t addr;
 	int ret;
-	char red[2], green[2], blue[2];
-	char image[128], mask[128];
-	u32 r, g, b;
-	u32 m, i;
-	mm_segment_t old_fs = get_fs();
 	
-	ret = copy_from_user (&f, (struct fbcursor32 __user *) arg,
+	ret = copy_in_user(p, argp,
 			      2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
-	ret |= __get_user(f.size.x,
-			  &(((struct fbcursor32 __user *)arg)->size.x));
-	ret |= __get_user(f.size.y,
-			  &(((struct fbcursor32 __user *)arg)->size.y));
-	ret |= __get_user(f.cmap.index,
-			  &(((struct fbcursor32 __user *)arg)->cmap.index));
-	ret |= __get_user(f.cmap.count,
-			  &(((struct fbcursor32 __user *)arg)->cmap.count));
-	ret |= __get_user(r, &(((struct fbcursor32 __user *)arg)->cmap.red));
-	ret |= __get_user(g, &(((struct fbcursor32 __user *)arg)->cmap.green));
-	ret |= __get_user(b, &(((struct fbcursor32 __user *)arg)->cmap.blue));
-	ret |= __get_user(m, &(((struct fbcursor32 __user *)arg)->mask));
-	ret |= __get_user(i, &(((struct fbcursor32 __user *)arg)->image));
+	ret |= copy_in_user(&p->size, &argp->size, sizeof(struct fbcurpos));
+	ret |= copy_in_user(&p->cmap, &argp->cmap, 2 * sizeof(int));
+	ret |= get_user(addr, &argp->cmap.red);
+	ret |= put_user(compat_ptr(addr), &p->cmap.red);
+	ret |= get_user(addr, &argp->cmap.green);
+	ret |= put_user(compat_ptr(addr), &p->cmap.green);
+	ret |= get_user(addr, &argp->cmap.blue);
+	ret |= put_user(compat_ptr(addr), &p->cmap.blue);
+	ret |= get_user(addr, &argp->mask);
+	ret |= put_user(compat_ptr(addr), &p->mask);
+	ret |= get_user(addr, &argp->image);
+	ret |= put_user(compat_ptr(addr), &p->image);
 	if (ret)
 		return -EFAULT;
-	if (f.set & FB_CUR_SETCMAP) {
-		if ((uint) f.size.y > 32)
-			return -EINVAL;
-		ret = copy_from_user (mask, A(m), f.size.y * 4);
-		ret |= copy_from_user (image, A(i), f.size.y * 4);
-		if (ret)
-			return -EFAULT;
-		f.image = image; f.mask = mask;
-	}
-	if (f.set & FB_CUR_SETCMAP) {
-		ret = copy_from_user (red, A(r), 2);
-		ret |= copy_from_user (green, A(g), 2);
-		ret |= copy_from_user (blue, A(b), 2);
-		if (ret)
-			return -EFAULT;
-		f.cmap.red = red; f.cmap.green = green; f.cmap.blue = blue;
-	}
-	set_fs (KERNEL_DS);
-	ret = sys_ioctl (fd, FBIOSCURSOR, (long)&f);
-	set_fs (old_fs);
-	return ret;
+	return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p);
 }
 
 #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
@@ -173,72 +131,40 @@
 static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_version_t __user *uversion = (drm32_version_t __user *)arg;
-	char __user *name_ptr, *date_ptr, *desc_ptr;
-	u32 tmp1, tmp2, tmp3;
-	drm_version_t kversion;
-	mm_segment_t old_fs;
+	drm_version_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int n;
 	int ret;
 
-	memset(&kversion, 0, sizeof(kversion));
-	if (get_user(kversion.name_len, &uversion->name_len) ||
-	    get_user(kversion.date_len, &uversion->date_len) ||
-	    get_user(kversion.desc_len, &uversion->desc_len) ||
-	    get_user(tmp1, &uversion->name) ||
-	    get_user(tmp2, &uversion->date) ||
-	    get_user(tmp3, &uversion->desc))
-		return -EFAULT;
-
-	name_ptr = A(tmp1);
-	date_ptr = A(tmp2);
-	desc_ptr = A(tmp3);
-
-	ret = -ENOMEM;
-	if (kversion.name_len && name_ptr) {
-		kversion.name = kmalloc(kversion.name_len, GFP_KERNEL);
-		if (!kversion.name)
-			goto out;
-	}
-	if (kversion.date_len && date_ptr) {
-		kversion.date = kmalloc(kversion.date_len, GFP_KERNEL);
-		if (!kversion.date)
-			goto out;
-	}
-	if (kversion.desc_len && desc_ptr) {
-		kversion.desc = kmalloc(kversion.desc_len, GFP_KERNEL);
-		if (!kversion.desc)
-			goto out;
-	}
+	if (clear_user(p, 3 * sizeof(int)) ||
+	    get_user(n, &uversion->name_len) ||
+	    put_user(n, &p->name_len) ||
+	    get_user(addr, &uversion->name) ||
+	    put_user(compat_ptr(addr), &p->name) ||
+	    get_user(n, &uversion->date_len) ||
+	    put_user(n, &p->date_len) ||
+	    get_user(addr, &uversion->date) ||
+	    put_user(compat_ptr(addr), &p->date) ||
+	    get_user(n, &uversion->desc_len) ||
+	    put_user(n, &p->desc_len) ||
+	    get_user(addr, &uversion->desc) ||
+	    put_user(compat_ptr(addr), &p->desc))
+		return -EFAULT;
 
-        old_fs = get_fs();
-	set_fs(KERNEL_DS);
-        ret = sys_ioctl (fd, DRM_IOCTL_VERSION, (unsigned long)&kversion);
-        set_fs(old_fs);
+        ret = sys_ioctl(fd, DRM_IOCTL_VERSION, (unsigned long)p);
+	if (ret)
+		return ret;
 
-	if (!ret) {
-		if ((kversion.name &&
-		     copy_to_user(name_ptr, kversion.name, kversion.name_len)) ||
-		    (kversion.date &&
-		     copy_to_user(date_ptr, kversion.date, kversion.date_len)) ||
-		    (kversion.desc &&
-		     copy_to_user(desc_ptr, kversion.desc, kversion.desc_len)))
-			ret = -EFAULT;
-		if (put_user(kversion.version_major, &uversion->version_major) ||
-		    put_user(kversion.version_minor, &uversion->version_minor) ||
-		    put_user(kversion.version_patchlevel, &uversion->version_patchlevel) ||
-		    put_user(kversion.name_len, &uversion->name_len) ||
-		    put_user(kversion.date_len, &uversion->date_len) ||
-		    put_user(kversion.desc_len, &uversion->desc_len))
-			ret = -EFAULT;
-	}
+	if (copy_in_user(uversion, p, 3 * sizeof(int)) ||
+	    get_user(n, &p->name_len) ||
+	    put_user(n, &uversion->name_len) ||
+	    get_user(n, &p->date_len) ||
+	    put_user(n, &uversion->date_len) ||
+	    get_user(n, &p->desc_len) ||
+	    put_user(n, &uversion->desc_len))
+		return -EFAULT;
 
-out:
-	if (kversion.name)
-		kfree(kversion.name);
-	if (kversion.date)
-		kfree(kversion.date);
-	if (kversion.desc)
-		kfree(kversion.desc);
-	return ret;
+	return 0;
 }
 
 typedef struct drm32_unique {
@@ -251,53 +177,29 @@
 static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_unique_t __user *uarg = (drm32_unique_t __user *)arg;
-	drm_unique_t karg;
-	mm_segment_t old_fs;
-	char __user *uptr;
-	u32 tmp;
+	drm_unique_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int n;
 	int ret;
 
-	if (get_user(karg.unique_len, &uarg->unique_len))
+	if (get_user(n, &uarg->unique_len) ||
+	    put_user(n, &p->unique_len) ||
+	    get_user(addr, &uarg->unique) ||
+	    put_user(compat_ptr(addr), &p->unique))
 		return -EFAULT;
-	karg.unique = NULL;
 
-	if (get_user(tmp, &uarg->unique))
-		return -EFAULT;
-
-	uptr = A(tmp);
-
-	if (uptr) {
-		karg.unique = kmalloc(karg.unique_len, GFP_KERNEL);
-		if (!karg.unique)
-			return -ENOMEM;
-		if (cmd == DRM32_IOCTL_SET_UNIQUE &&
-		    copy_from_user(karg.unique, uptr, karg.unique_len)) {
-			kfree(karg.unique);
-			return -EFAULT;
-		}
-	}
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
 	if (cmd == DRM32_IOCTL_GET_UNIQUE)
-		ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)&karg);
+		ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)p);
 	else
-		ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)&karg);
-        set_fs(old_fs);
+		ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)p);
 
-	if (!ret) {
-		if (cmd == DRM32_IOCTL_GET_UNIQUE &&
-		    uptr != NULL &&
-		    copy_to_user(uptr, karg.unique, karg.unique_len))
-			ret = -EFAULT;
-		if (put_user(karg.unique_len, &uarg->unique_len))
-			ret = -EFAULT;
-	}
+	if (ret)
+		return ret;
 
-	if (karg.unique != NULL)
-		kfree(karg.unique);
+	if (get_user(n, &p->unique_len) || put_user(n, &uarg->unique_len))
+		return -EFAULT;
 
-	return ret;
+	return 0;
 }
 
 typedef struct drm32_map {
@@ -360,41 +262,23 @@
 static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_buf_info_t __user *uarg = (drm32_buf_info_t __user *)arg;
-	drm_buf_desc_t __user *ulist;
-	drm_buf_info_t karg;
-	mm_segment_t old_fs;
-	int orig_count, ret;
-	u32 tmp;
+	drm_buf_info_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int n;
+	int ret;
 
-	if (get_user(karg.count, &uarg->count) ||
-	    get_user(tmp, &uarg->list))
+	if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
+	    get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
 		return -EFAULT;
 
-	ulist = A(tmp);
-
-	orig_count = karg.count;
+	ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long)p);
+	if (ret)
+		return ret;
 
-	karg.list = kmalloc(karg.count * sizeof(drm_buf_desc_t), GFP_KERNEL);
-	if (!karg.list)
+	if (get_user(n, &p->count) || put_user(n, &uarg->count))
 		return -EFAULT;
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long) &karg);
-	set_fs(old_fs);
-
-	if (!ret) {
-		if (karg.count <= orig_count &&
-		    (copy_to_user(ulist, karg.list,
-				  karg.count * sizeof(drm_buf_desc_t))))
-			ret = -EFAULT;
-		if (put_user(karg.count, &uarg->count))
-			ret = -EFAULT;
-	}
-
-	kfree(karg.list);
-
-	return ret;
+	return 0;
 }
 
 typedef struct drm32_buf_free {
@@ -406,35 +290,15 @@
 static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_buf_free_t __user *uarg = (drm32_buf_free_t __user *)arg;
-	drm_buf_free_t karg;
-	mm_segment_t old_fs;
-	int __user *ulist;
-	int ret;
-	u32 tmp;
+	drm_buf_free_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int n;
 
-	if (get_user(karg.count, &uarg->count) ||
-	    get_user(tmp, &uarg->list))
+	if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
+	    get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
 		return -EFAULT;
 
-	ulist = A(tmp);
-
-	karg.list = kmalloc(karg.count * sizeof(int), GFP_KERNEL);
-	if (!karg.list)
-		return -ENOMEM;
-
-	ret = -EFAULT;
-	if (copy_from_user(karg.list, ulist, (karg.count * sizeof(int))))
-		goto out;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long) &karg);
-	set_fs(old_fs);
-
-out:
-	kfree(karg.list);
-
-	return ret;
+	return sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long)p);
 }
 
 typedef struct drm32_buf_pub {
@@ -455,59 +319,61 @@
 {
 	drm32_buf_map_t __user *uarg = (drm32_buf_map_t __user *)arg;
 	drm32_buf_pub_t __user *ulist;
-	drm_buf_map_t karg;
-	mm_segment_t old_fs;
+	drm_buf_map_t __user *arg64;
+	drm_buf_pub_t __user *list;
 	int orig_count, ret, i;
-	u32 tmp1, tmp2;
+	int n;
+	compat_uptr_t addr;
 
-	if (get_user(karg.count, &uarg->count) ||
-	    get_user(tmp1, &uarg->virtual) ||
-	    get_user(tmp2, &uarg->list))
+	if (get_user(orig_count, &uarg->count))
 		return -EFAULT;
 
-	karg.virtual = (void *) (unsigned long) tmp1;
-	ulist = A(tmp2);
-
-	orig_count = karg.count;
-
-	karg.list = kmalloc(karg.count * sizeof(drm_buf_pub_t), GFP_KERNEL);
-	if (!karg.list)
-		return -ENOMEM;
-
-	ret = -EFAULT;
-	for (i = 0; i < karg.count; i++) {
-		if (get_user(karg.list[i].idx, &ulist[i].idx) ||
-		    get_user(karg.list[i].total, &ulist[i].total) ||
-		    get_user(karg.list[i].used, &ulist[i].used) ||
-		    get_user(tmp1, &ulist[i].address))
-			goto out;
-
-		karg.list[i].address = (void *) (unsigned long) tmp1;
+	arg64 = compat_alloc_user_space(sizeof(drm_buf_map_t) +
+				(size_t)orig_count * sizeof(drm_buf_pub_t));
+	list = (void __user *)(arg64 + 1);
+
+	if (put_user(orig_count, &arg64->count) ||
+	    put_user(list, &arg64->list) ||
+	    get_user(addr, &uarg->virtual) ||
+	    put_user(compat_ptr(addr), &arg64->virtual) ||
+	    get_user(addr, &uarg->list))
+		return -EFAULT;
+
+	ulist = compat_ptr(addr);
+
+	for (i = 0; i < orig_count; i++) {
+		if (get_user(n, &ulist[i].idx) ||
+		    put_user(n, &list[i].idx) ||
+		    get_user(n, &ulist[i].total) ||
+		    put_user(n, &list[i].total) ||
+		    get_user(n, &ulist[i].used) ||
+		    put_user(n, &list[i].used) ||
+		    get_user(addr, &ulist[i].address) ||
+		    put_user(compat_ptr(addr), &list[i].address))
+			return -EFAULT;
 	}
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) &karg);
-	set_fs(old_fs);
+	ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) arg64);
+	if (ret)
+		return ret;
 
-	if (!ret) {
-		for (i = 0; i < orig_count; i++) {
-			tmp1 = (u32) (long) karg.list[i].address;
-			if (put_user(karg.list[i].idx, &ulist[i].idx) ||
-			    put_user(karg.list[i].total, &ulist[i].total) ||
-			    put_user(karg.list[i].used, &ulist[i].used) ||
-			    put_user(tmp1, &ulist[i].address)) {
-				ret = -EFAULT;
-				goto out;
-			}
-		}
-		if (put_user(karg.count, &uarg->count))
-			ret = -EFAULT;
+	for (i = 0; i < orig_count; i++) {
+		void __user *p;
+		if (get_user(n, &list[i].idx) ||
+		    put_user(n, &ulist[i].idx) ||
+		    get_user(n, &list[i].total) ||
+		    put_user(n, &ulist[i].total) ||
+		    get_user(n, &list[i].used) ||
+		    put_user(n, &ulist[i].used) ||
+		    get_user(p, &list[i].address) ||
+		    put_user((unsigned long)p, &ulist[i].address))
+			return -EFAULT;
 	}
 
-out:
-	kfree(karg.list);
-	return ret;
+	if (get_user(n, &arg64->count) || put_user(n, &uarg->count))
+		return -EFAULT;
+
+	return 0;
 }
 
 typedef struct drm32_dma {
@@ -533,105 +399,37 @@
 static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_dma_t __user *uarg = (drm32_dma_t __user *) arg;
-	int __user *u_si, *u_ss, *u_ri, *u_rs;
-	drm_dma_t karg;
-	mm_segment_t old_fs;
+	drm_dma_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
 	int ret;
-	u32 tmp1, tmp2, tmp3, tmp4;
-
-	karg.send_indices = karg.send_sizes = NULL;
-	karg.request_indices = karg.request_sizes = NULL;
-
-	if (get_user(karg.context, &uarg->context) ||
-	    get_user(karg.send_count, &uarg->send_count) ||
-	    get_user(tmp1, &uarg->send_indices) ||
-	    get_user(tmp2, &uarg->send_sizes) ||
-	    get_user(karg.flags, &uarg->flags) ||
-	    get_user(karg.request_count, &uarg->request_count) ||
-	    get_user(karg.request_size, &uarg->request_size) ||
-	    get_user(tmp3, &uarg->request_indices) ||
-	    get_user(tmp4, &uarg->request_sizes) ||
-	    get_user(karg.granted_count, &uarg->granted_count))
-		return -EFAULT;
-
-	u_si = A(tmp1);
-	u_ss = A(tmp2);
-	u_ri = A(tmp3);
-	u_rs = A(tmp4);
-
-	if (karg.send_count) {
-		karg.send_indices = kmalloc(karg.send_count * sizeof(int), GFP_KERNEL);
-		karg.send_sizes = kmalloc(karg.send_count * sizeof(int), GFP_KERNEL);
-
-		ret = -ENOMEM;
-		if (!karg.send_indices || !karg.send_sizes)
-			goto out;
-
-		ret = -EFAULT;
-		if (copy_from_user(karg.send_indices, u_si,
-				   (karg.send_count * sizeof(int))) ||
-		    copy_from_user(karg.send_sizes, u_ss,
-				   (karg.send_count * sizeof(int))))
-			goto out;
-	}
 
-	if (karg.request_count) {
-		karg.request_indices = kmalloc(karg.request_count * sizeof(int), GFP_KERNEL);
-		karg.request_sizes = kmalloc(karg.request_count * sizeof(int), GFP_KERNEL);
-
-		ret = -ENOMEM;
-		if (!karg.request_indices || !karg.request_sizes)
-			goto out;
-
-		ret = -EFAULT;
-		if (copy_from_user(karg.request_indices, u_ri,
-				   (karg.request_count * sizeof(int))) ||
-		    copy_from_user(karg.request_sizes, u_rs,
-				   (karg.request_count * sizeof(int))))
-			goto out;
-	}
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long) &karg);
-	set_fs(old_fs);
-
-	if (!ret) {
-		if (put_user(karg.context, &uarg->context) ||
-		    put_user(karg.send_count, &uarg->send_count) ||
-		    put_user(karg.flags, &uarg->flags) ||
-		    put_user(karg.request_count, &uarg->request_count) ||
-		    put_user(karg.request_size, &uarg->request_size) ||
-		    put_user(karg.granted_count, &uarg->granted_count))
-			ret = -EFAULT;
+	if (copy_in_user(p, uarg, 2 * sizeof(int)) ||
+	    get_user(addr, &uarg->send_indices) ||
+	    put_user(compat_ptr(addr), &p->send_indices) ||
+	    get_user(addr, &uarg->send_sizes) ||
+	    put_user(compat_ptr(addr), &p->send_sizes) ||
+	    copy_in_user(&p->flags, &uarg->flags, sizeof(drm_dma_flags_t)) ||
+	    copy_in_user(&p->request_count, &uarg->request_count, sizeof(int))||
+	    copy_in_user(&p->request_size, &uarg->request_size, sizeof(int)) ||
+	    get_user(addr, &uarg->request_indices) ||
+	    put_user(compat_ptr(addr), &p->request_indices) ||
+	    get_user(addr, &uarg->request_sizes) ||
+	    put_user(compat_ptr(addr), &p->request_sizes) ||
+	    copy_in_user(&p->granted_count, &uarg->granted_count, sizeof(int)))
+		return -EFAULT;
 
-		if (karg.send_count) {
-			if (copy_to_user(u_si, karg.send_indices,
-					 (karg.send_count * sizeof(int))) ||
-			    copy_to_user(u_ss, karg.send_sizes,
-					 (karg.send_count * sizeof(int))))
-				ret = -EFAULT;
-		}
-		if (karg.request_count) {
-			if (copy_to_user(u_ri, karg.request_indices,
-					 (karg.request_count * sizeof(int))) ||
-			    copy_to_user(u_rs, karg.request_sizes,
-					 (karg.request_count * sizeof(int))))
-				ret = -EFAULT;
-		}
-	}
+	ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long)p);
+	if (ret)
+		return ret;
 
-out:
-	if (karg.send_indices)
-		kfree(karg.send_indices);
-	if (karg.send_sizes)
-		kfree(karg.send_sizes);
-	if (karg.request_indices)
-		kfree(karg.request_indices);
-	if (karg.request_sizes)
-		kfree(karg.request_sizes);
+	if (copy_in_user(uarg, p, 2 * sizeof(int)) ||
+	    copy_in_user(&uarg->flags, &p->flags, sizeof(drm_dma_flags_t)) ||
+	    copy_in_user(&uarg->request_count, &p->request_count, sizeof(int))||
+	    copy_in_user(&uarg->request_size, &p->request_size, sizeof(int)) ||
+	    copy_in_user(&uarg->granted_count, &p->granted_count, sizeof(int)))
+		return -EFAULT;
 
-	return ret;
+	return 0;
 }
 
 typedef struct drm32_ctx_res {
@@ -643,50 +441,23 @@
 static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_ctx_res_t __user *uarg = (drm32_ctx_res_t __user *) arg;
-	drm_ctx_t __user *ulist;
-	drm_ctx_res_t karg;
-	mm_segment_t old_fs;
-	int orig_count, ret;
-	u32 tmp;
+	drm_ctx_res_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int ret;
 
-	karg.contexts = NULL;
-	if (get_user(karg.count, &uarg->count) ||
-	    get_user(tmp, &uarg->contexts))
+	if (copy_in_user(p, uarg, sizeof(int)) ||
+	    get_user(addr, &uarg->contexts) ||
+	    put_user(compat_ptr(addr), &p->contexts))
 		return -EFAULT;
 
-	ulist = A(tmp);
-
-	orig_count = karg.count;
-	if (karg.count && ulist) {
-		karg.contexts = kmalloc((karg.count * sizeof(drm_ctx_t)), GFP_KERNEL);
-		if (!karg.contexts)
-			return -ENOMEM;
-		if (copy_from_user(karg.contexts, ulist,
-				   (karg.count * sizeof(drm_ctx_t)))) {
-			kfree(karg.contexts);
-			return -EFAULT;
-		}
-	}
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long) &karg);
-	set_fs(old_fs);
-
-	if (!ret) {
-		if (orig_count) {
-			if (copy_to_user(ulist, karg.contexts,
-					 (orig_count * sizeof(drm_ctx_t))))
-				ret = -EFAULT;
-		}
-		if (put_user(karg.count, &uarg->count))
-			ret = -EFAULT;
-	}
+	ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long)p);
+	if (ret)
+		return ret;
 
-	if (karg.contexts)
-		kfree(karg.contexts);
+	if (copy_in_user(uarg, p, sizeof(int)))
+		return -EFAULT;
 
-	return ret;
+	return 0;
 }
 
 #endif
diff -Nru a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
--- a/arch/sparc64/kernel/process.c	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/kernel/process.c	2004-07-27 18:24:51 -07:00
@@ -12,6 +12,7 @@
 
 #include <stdarg.h>
 
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -28,6 +29,7 @@
 #include <linux/config.h>
 #include <linux/reboot.h>
 #include <linux/delay.h>
+#include <linux/compat.h>
 #include <linux/init.h>
 
 #include <asm/oplib.h>
@@ -588,10 +590,13 @@
 
 	clone_flags &= ~CLONE_IDLETASK;
 
+#ifdef CONFIG_COMPAT
 	if (test_thread_flag(TIF_32BIT)) {
 		parent_tid_ptr = compat_ptr(regs->u_regs[UREG_I2]);
 		child_tid_ptr = compat_ptr(regs->u_regs[UREG_I4]);
-	} else {
+	} else
+#endif
+	{
 		parent_tid_ptr = (int __user *) regs->u_regs[UREG_I2];
 		child_tid_ptr = (int __user *) regs->u_regs[UREG_I4];
 	}
diff -Nru a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
--- a/arch/sparc64/kernel/sbus.c	2004-07-27 18:24:53 -07:00
+++ b/arch/sparc64/kernel/sbus.c	2004-07-27 18:24:53 -07:00
@@ -28,10 +28,10 @@
  *
  * On SYSIO, using an 8K page size we have 1GB of SBUS
  * DMA space mapped.  We divide this space into equally
- * sized clusters.  Currently we allow clusters up to a
- * size of 1MB.  If anything begins to generate DMA
- * mapping requests larger than this we will need to
- * increase things a bit.
+ * sized clusters. We allocate a DMA mapping from the
+ * cluster that matches the order of the allocation, or
+ * if the order is greater than the number of clusters,
+ * we try to allocate from the last cluster.
  */
 
 #define NCLUSTERS	8UL
@@ -134,12 +134,17 @@
 
 static iopte_t *alloc_streaming_cluster(struct sbus_iommu *iommu, unsigned long npages)
 {
-	iopte_t *iopte, *limit, *first;
-	unsigned long cnum, ent, flush_point;
+	iopte_t *iopte, *limit, *first, *cluster;
+	unsigned long cnum, ent, nent, flush_point, found;
 
 	cnum = 0;
+	nent = 1;
 	while ((1UL << cnum) < npages)
 		cnum++;
+	if(cnum >= NCLUSTERS) {
+		nent = 1UL << (cnum - NCLUSTERS);
+		cnum = NCLUSTERS - 1;
+	}
 	iopte  = iommu->page_table + (cnum * CLUSTER_NPAGES);
 
 	if (cnum == 0)
@@ -152,22 +157,31 @@
 	flush_point = iommu->alloc_info[cnum].flush;
 
 	first = iopte;
+	cluster = NULL;
+	found = 0;
 	for (;;) {
 		if (iopte_val(*iopte) == 0UL) {
-			if ((iopte + (1 << cnum)) >= limit)
-				ent = 0;
-			else
-				ent = ent + 1;
-			iommu->alloc_info[cnum].next = ent;
-			if (ent == flush_point)
-				__iommu_flushall(iommu);
-			break;
+			found++;
+			if (!cluster)
+				cluster = iopte;
+		} else {
+			/* Used cluster in the way */
+			cluster = NULL;
+			found = 0;
 		}
+
+		if (found == nent)
+			break;
+
 		iopte += (1 << cnum);
 		ent++;
 		if (iopte >= limit) {
 			iopte = (iommu->page_table + (cnum * CLUSTER_NPAGES));
 			ent = 0;
+
+			/* Multiple cluster allocations must not wrap */
+			cluster = NULL;
+			found = 0;
 		}
 		if (ent == flush_point)
 			__iommu_flushall(iommu);
@@ -175,8 +189,19 @@
 			goto bad;
 	}
 
+	/* ent/iopte points to the last cluster entry we're going to use,
+	 * so save our place for the next allocation.
+	 */
+	if ((iopte + (1 << cnum)) >= limit)
+		ent = 0;
+	else
+		ent = ent + 1;
+	iommu->alloc_info[cnum].next = ent;
+	if (ent == flush_point)
+		__iommu_flushall(iommu);
+
 	/* I've got your streaming cluster right here buddy boy... */
-	return iopte;
+	return cluster;
 
 bad:
 	printk(KERN_EMERG "sbus: alloc_streaming_cluster of npages(%ld) failed!\n",
@@ -186,15 +211,23 @@
 
 static void free_streaming_cluster(struct sbus_iommu *iommu, u32 base, unsigned long npages)
 {
-	unsigned long cnum, ent;
+	unsigned long cnum, ent, nent;
 	iopte_t *iopte;
 
 	cnum = 0;
+	nent = 1;
 	while ((1UL << cnum) < npages)
 		cnum++;
+	if(cnum >= NCLUSTERS) {
+		nent = 1UL << (cnum - NCLUSTERS);
+		cnum = NCLUSTERS - 1;
+	}
 	ent = (base & CLUSTER_MASK) >> (IO_PAGE_SHIFT + cnum);
 	iopte = iommu->page_table + ((base - MAP_BASE) >> IO_PAGE_SHIFT);
-	iopte_val(*iopte) = 0UL;
+	do {
+		iopte_val(*iopte) = 0UL;
+		iopte += 1 << cnum;
+	} while(--nent);
 
 	/* If the global flush might not have caught this entry,
 	 * adjust the flush point such that we will flush before
diff -Nru a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
--- a/arch/sparc64/kernel/sparc64_ksyms.c	2004-07-27 18:24:52 -07:00
+++ b/arch/sparc64/kernel/sparc64_ksyms.c	2004-07-27 18:24:52 -07:00
@@ -142,8 +142,8 @@
 EXPORT_SYMBOL(synchronize_irq);
 
 #if defined(CONFIG_MCOUNT)
-extern void mcount(void);
-EXPORT_SYMBOL_NOVERS(mcount);
+extern void _mcount(void);
+EXPORT_SYMBOL_NOVERS(_mcount);
 #endif
 
 /* CPU online map and active count.  */
@@ -350,9 +350,10 @@
 EXPORT_SYMBOL(csum_partial_copy_sparc64);
 EXPORT_SYMBOL(ip_fast_csum);
 
-/* Moving data to/from userspace. */
+/* Moving data to/from/in userspace. */
 EXPORT_SYMBOL(__copy_to_user);
 EXPORT_SYMBOL(__copy_from_user);
+EXPORT_SYMBOL(__copy_in_user);
 EXPORT_SYMBOL(__strncpy_from_user);
 EXPORT_SYMBOL(__bzero_noasi);
 
diff -Nru a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
--- a/arch/sparc64/kernel/systbls.S	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/kernel/systbls.S	2004-07-27 18:24:51 -07:00
@@ -15,6 +15,7 @@
 	.text
 	.align	4
 
+#ifdef CONFIG_COMPAT
 	/* First, the 32-bit Linux native syscall table. */
 
 	.globl sys_call_table32
@@ -77,6 +78,8 @@
 	.word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, sys_ni_syscall
 /*280*/	.word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall
 
+#endif /* CONFIG_COMPAT */
+
 	/* Now the 64-bit native Linux syscall table. */
 
 	.align	4
@@ -85,7 +88,7 @@
 sys_call_table:
 /*0*/	.word sys_restart_syscall, sparc_exit, sys_fork, sys_read, sys_write
 /*5*/	.word sys_open, sys_close, sys_wait4, sys_creat, sys_link
-/*10*/  .word sys_unlink, sunos_execv, sys_chdir, sys_chown, sys_mknod
+/*10*/  .word sys_unlink, sys_nis_syscall, sys_chdir, sys_chown, sys_mknod
 /*15*/	.word sys_chmod, sys_lchown, sparc_brk, sys_perfctr, sys_lseek
 /*20*/	.word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
 /*25*/	.word sys_nis_syscall, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
diff -Nru a/arch/sparc64/solaris/conv.h b/arch/sparc64/solaris/conv.h
--- a/arch/sparc64/solaris/conv.h	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/solaris/conv.h	2004-07-27 18:24:51 -07:00
@@ -17,7 +17,7 @@
 	__asm__ ("srl	%0, 0, %0"	\
 		 : "=r" (__ret)		\
 		 : "0" (__x));		\
-	__ret;				\
+	(void __user *)__ret;		\
 })
 
 extern unsigned sys_call_table[];
diff -Nru a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c
--- a/arch/sparc64/solaris/fs.c	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/solaris/fs.c	2004-07-27 18:24:51 -07:00
@@ -79,7 +79,7 @@
 
 #define UFSMAGIC (((unsigned)'u'<<24)||((unsigned)'f'<<16)||((unsigned)'s'<<8))
 
-static inline int putstat(struct sol_stat *ubuf, struct kstat *kbuf)
+static inline int putstat(struct sol_stat __user *ubuf, struct kstat *kbuf)
 {
 	if (kbuf->size > MAX_NON_LFS ||
 	    !sysv_valid_dev(kbuf->dev) ||
@@ -101,12 +101,12 @@
 	    __put_user (kbuf->ctime.tv_nsec, &ubuf->st_ctime.tv_nsec)	||
 	    __put_user (kbuf->blksize, &ubuf->st_blksize)	||
 	    __put_user (kbuf->blocks, &ubuf->st_blocks)	||
-	    __put_user (UFSMAGIC, (unsigned *)ubuf->st_fstype))
+	    __put_user (UFSMAGIC, (unsigned __user *)ubuf->st_fstype))
 		return -EFAULT;
 	return 0;
 }
 
-static inline int putstat64(struct sol_stat64 *ubuf, struct kstat *kbuf)
+static inline int putstat64(struct sol_stat64 __user *ubuf, struct kstat *kbuf)
 {
 	if (!sysv_valid_dev(kbuf->dev) || !sysv_valid_dev(kbuf->rdev))
 		return -EOVERFLOW;
@@ -126,27 +126,17 @@
 	    __put_user (kbuf->ctime.tv_nsec, &ubuf->st_ctime.tv_nsec)	||
 	    __put_user (kbuf->blksize, &ubuf->st_blksize)	||
 	    __put_user (kbuf->blocks, &ubuf->st_blocks)	||
-	    __put_user (UFSMAGIC, (unsigned *)ubuf->st_fstype))
+	    __put_user (UFSMAGIC, (unsigned __user *)ubuf->st_fstype))
 		return -EFAULT;
 	return 0;
 }
 
 asmlinkage int solaris_stat(u32 filename, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	char *filenam;
-	mm_segment_t old_fs = get_fs();
-	
-	filenam = getname ((char *)A(filename));
-	ret = PTR_ERR(filenam);
-	if (!IS_ERR(filenam)) {
-		set_fs (KERNEL_DS);
-		ret = vfs_stat(filenam, &s);
-		set_fs (old_fs);
-		putname (filenam);
-		return putstat((struct sol_stat *)A(statbuf), &s);
-	}
+	int ret = vfs_stat(A(filename), &s);
+	if (!ret)
+		return putstat(A(statbuf), &s);
 	return ret;
 }
 
@@ -158,39 +148,19 @@
 
 asmlinkage int solaris_stat64(u32 filename, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	char *filenam;
-	mm_segment_t old_fs = get_fs();
-	
-	filenam = getname ((char *)A(filename));
-	ret = PTR_ERR(filenam);
-	if (!IS_ERR(filenam)) {
-		set_fs (KERNEL_DS);
-		ret = vfs_stat(filenam, &s);
-		set_fs (old_fs);
-		putname (filenam);
-		return putstat64((struct sol_stat64 *)A(statbuf), &s);
-	}
+	int ret = vfs_stat(A(filename), &s);
+	if (!ret)
+		return putstat64(A(statbuf), &s);
 	return ret;
 }
 
 asmlinkage int solaris_lstat(u32 filename, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	char *filenam;
-	mm_segment_t old_fs = get_fs();
-	
-	filenam = getname ((char *)A(filename));
-	ret = PTR_ERR(filenam);
-	if (!IS_ERR(filenam)) {
-		set_fs (KERNEL_DS);
-		ret = vfs_lstat(filenam, &s);
-		set_fs (old_fs);
-		putname (filenam);
-		return putstat((struct sol_stat *)A(statbuf), &s);
-	}
+	int ret = vfs_lstat(A(filename), &s);
+	if (!ret)
+		return putstat(A(statbuf), &s);
 	return ret;
 }
 
@@ -201,30 +171,19 @@
 
 asmlinkage int solaris_lstat64(u32 filename, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	char *filenam;
-	mm_segment_t old_fs = get_fs();
-	
-	filenam = getname ((char *)A(filename));
-	ret = PTR_ERR(filenam);
-	if (!IS_ERR(filenam)) {
-		set_fs (KERNEL_DS);
-		ret = vfs_lstat(filenam, &s);
-		set_fs (old_fs);
-		putname (filenam);
-		return putstat64((struct sol_stat64 *)A(statbuf), &s);
-	}
+	int ret = vfs_lstat(A(filename), &s);
+	if (!ret)
+		return putstat64(A(statbuf), &s);
 	return ret;
 }
 
 asmlinkage int solaris_fstat(unsigned int fd, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	ret = vfs_fstat(fd, &s);
+	int ret = vfs_fstat(fd, &s);
 	if (!ret)
-		return putstat((struct sol_stat *)A(statbuf), &s);
+		return putstat(A(statbuf), &s);
 	return ret;
 }
 
@@ -235,27 +194,24 @@
 
 asmlinkage int solaris_fstat64(unsigned int fd, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	
-	ret = vfs_fstat(fd, &s);
+	int ret = vfs_fstat(fd, &s);
 	if (!ret)
-		return putstat64((struct sol_stat64 *)A(statbuf), &s);
+		return putstat64(A(statbuf), &s);
 	return ret;
 }
 
 asmlinkage int solaris_mknod(u32 path, u32 mode, s32 dev)
 {
-	int (*sys_mknod)(const char *,int,unsigned) = 
-		(int (*)(const char *,int,unsigned))SYS(mknod);
+	int (*sys_mknod)(const char __user *,int,unsigned) = 
+		(int (*)(const char __user *,int,unsigned))SYS(mknod);
 	int major = sysv_major(dev);
 	int minor = sysv_minor(dev);
 
 	/* minor is guaranteed to be OK for MKDEV, major might be not */
 	if (major > 0xfff)
 		return -EINVAL;
-	return sys_mknod((const char *)A(path), mode,
-				new_encode_dev(MKDEV(major,minor)));
+	return sys_mknod(A(path), mode, new_encode_dev(MKDEV(major,minor)));
 }
 
 asmlinkage int solaris_xmknod(int vers, u32 path, u32 mode, s32 dev)
@@ -263,10 +219,10 @@
 	return solaris_mknod(path, mode, dev);
 }
 
-asmlinkage int solaris_getdents64(unsigned int fd, void *dirent, unsigned int count)
+asmlinkage int solaris_getdents64(unsigned int fd, void __user *dirent, unsigned int count)
 {
-	int (*sys_getdents)(unsigned int, void *, unsigned int) =
-		(int (*)(unsigned int, void *, unsigned int))SYS(getdents);
+	int (*sys_getdents)(unsigned int, void __user *, unsigned int) =
+		(int (*)(unsigned int, void __user *, unsigned int))SYS(getdents);
 		
 	return sys_getdents(fd, dirent, count);
 }
@@ -290,14 +246,15 @@
 	int ret;
 	struct statfs s;
 	mm_segment_t old_fs = get_fs();
-	int (*sys_statfs)(const char *,struct statfs *) = 
-		(int (*)(const char *,struct statfs *))SYS(statfs);
-	struct sol_statfs *ss = (struct sol_statfs *)A(buf);
+	int (*sys_statfs)(const char __user *,struct statfs __user *) = 
+		(int (*)(const char __user *,struct statfs __user *))SYS(statfs);
+	struct sol_statfs __user *ss = A(buf);
 	
 	if (len != sizeof(struct sol_statfs)) return -EINVAL;
 	if (!fstype) {
+		/* FIXME: mixing userland and kernel pointers */
 		set_fs (KERNEL_DS);
-		ret = sys_statfs((const char *)A(path), &s);
+		ret = sys_statfs(A(path), &s);
 		set_fs (old_fs);
 		if (!ret) {
 			if (put_user (s.f_type, &ss->f_type)		||
@@ -332,9 +289,9 @@
 	int ret;
 	struct statfs s;
 	mm_segment_t old_fs = get_fs();
-	int (*sys_fstatfs)(unsigned,struct statfs *) = 
-		(int (*)(unsigned,struct statfs *))SYS(fstatfs);
-	struct sol_statfs *ss = (struct sol_statfs *)A(buf);
+	int (*sys_fstatfs)(unsigned,struct statfs __user *) = 
+		(int (*)(unsigned,struct statfs __user *))SYS(fstatfs);
+	struct sol_statfs __user *ss = A(buf);
 	
 	if (len != sizeof(struct sol_statfs)) return -EINVAL;
 	if (!fstype) {
@@ -396,7 +353,7 @@
 {
 	struct kstatfs s;
 	int error;
-	struct sol_statvfs *ss = (struct sol_statvfs *)A(buf);
+	struct sol_statvfs __user *ss = A(buf);
 
 	error = vfs_statfs(mnt->mnt_sb, &s);
 	if (!error) {
@@ -419,7 +376,7 @@
 		    __put_user (s.f_ffree, &ss->f_favail)	||
 		    __put_user (sysv_encode_dev(inode->i_sb->s_dev), &ss->f_fsid) ||
 		    __copy_to_user (ss->f_basetype,p,j)		||
-		    __put_user (0, (char *)&ss->f_basetype[j])	||
+		    __put_user (0, (char __user *)&ss->f_basetype[j])	||
 		    __put_user (s.f_namelen, &ss->f_namemax)	||
 		    __put_user (i, &ss->f_flag)			||		    
 		    __clear_user (&ss->f_fstr, 32))
@@ -432,7 +389,7 @@
 {
 	struct kstatfs s;
 	int error;
-	struct sol_statvfs64 *ss = (struct sol_statvfs64 *)A(buf);
+	struct sol_statvfs64 __user *ss = A(buf);
 			
 	error = vfs_statfs(mnt->mnt_sb, &s);
 	if (!error) {
@@ -455,7 +412,7 @@
 		    __put_user (s.f_ffree, &ss->f_favail)	||
 		    __put_user (sysv_encode_dev(inode->i_sb->s_dev), &ss->f_fsid) ||
 		    __copy_to_user (ss->f_basetype,p,j)		||
-		    __put_user (0, (char *)&ss->f_basetype[j])	||
+		    __put_user (0, (char __user *)&ss->f_basetype[j])	||
 		    __put_user (s.f_namelen, &ss->f_namemax)	||
 		    __put_user (i, &ss->f_flag)			||		    
 		    __clear_user (&ss->f_fstr, 32))
@@ -469,7 +426,7 @@
 	struct nameidata nd;
 	int error;
 
-	error = user_path_walk((const char *)A(path),&nd);
+	error = user_path_walk(A(path),&nd);
 	if (!error) {
 		struct inode * inode = nd.dentry->d_inode;
 		error = report_statvfs(nd.mnt, inode, buf);
@@ -499,7 +456,7 @@
 	int error;
 
 	lock_kernel();
-	error = user_path_walk((const char *)A(path), &nd);
+	error = user_path_walk(A(path), &nd);
 	if (!error) {
 		struct inode * inode = nd.dentry->d_inode;
 		error = report_statvfs64(nd.mnt, inode, buf);
@@ -594,6 +551,7 @@
 	case SOL_F_SETLKW:
 		{
 			struct flock f;
+			struct sol_flock __user *p = A(arg);
 			mm_segment_t old_fs = get_fs();
 
 			switch (cmd) {
@@ -602,23 +560,23 @@
 			case SOL_F_SETLKW: cmd = F_SETLKW; break;
 			}
 
-			if (get_user (f.l_type, &((struct sol_flock *)A(arg))->l_type) ||
-			    __get_user (f.l_whence, &((struct sol_flock *)A(arg))->l_whence) ||
-			    __get_user (f.l_start, &((struct sol_flock *)A(arg))->l_start) ||
-			    __get_user (f.l_len, &((struct sol_flock *)A(arg))->l_len) ||
-			    __get_user (f.l_pid, &((struct sol_flock *)A(arg))->l_sysid))
+			if (get_user (f.l_type, &p->l_type) ||
+			    __get_user (f.l_whence, &p->l_whence) ||
+			    __get_user (f.l_start, &p->l_start) ||
+			    __get_user (f.l_len, &p->l_len) ||
+			    __get_user (f.l_pid, &p->l_sysid))
 				return -EFAULT;
 
 			set_fs(KERNEL_DS);
 			ret = sys_fcntl(fd, cmd, (unsigned long)&f);
 			set_fs(old_fs);
 
-			if (__put_user (f.l_type, &((struct sol_flock *)A(arg))->l_type) ||
-			    __put_user (f.l_whence, &((struct sol_flock *)A(arg))->l_whence) ||
-			    __put_user (f.l_start, &((struct sol_flock *)A(arg))->l_start) ||
-			    __put_user (f.l_len, &((struct sol_flock *)A(arg))->l_len) ||
-			    __put_user (f.l_pid, &((struct sol_flock *)A(arg))->l_pid) ||
-			    __put_user (0, &((struct sol_flock *)A(arg))->l_sysid))
+			if (__put_user (f.l_type, &p->l_type) ||
+			    __put_user (f.l_whence, &p->l_whence) ||
+			    __put_user (f.l_start, &p->l_start) ||
+			    __put_user (f.l_len, &p->l_len) ||
+			    __put_user (f.l_pid, &p->l_pid) ||
+			    __put_user (0, &p->l_sysid))
 				return -EFAULT;
 
 			return ret;
@@ -629,7 +587,7 @@
 		    int (*sys_newftruncate)(unsigned int, unsigned long)=
 			    (int (*)(unsigned int, unsigned long))SYS(ftruncate);
 
-		    if (get_user(length, &((struct sol_flock*)A(arg))->l_start))
+		    if (get_user(length, &((struct sol_flock __user *)A(arg))->l_start))
 			    return -EFAULT;
 
 		    return sys_newftruncate(fd, length);
@@ -677,18 +635,18 @@
 	return -ENOSYS;
 }
 
-asmlinkage int solaris_pread(unsigned int fd, char *buf, u32 count, u32 pos)
+asmlinkage int solaris_pread(unsigned int fd, char __user *buf, u32 count, u32 pos)
 {
-	ssize_t (*sys_pread64)(unsigned int, char *, size_t, loff_t) =
-		(ssize_t (*)(unsigned int, char *, size_t, loff_t))SYS(pread64);
+	ssize_t (*sys_pread64)(unsigned int, char __user *, size_t, loff_t) =
+		(ssize_t (*)(unsigned int, char __user *, size_t, loff_t))SYS(pread64);
 
 	return sys_pread64(fd, buf, count, (loff_t)pos);
 }
 
-asmlinkage int solaris_pwrite(unsigned int fd, char *buf, u32 count, u32 pos)
+asmlinkage int solaris_pwrite(unsigned int fd, char __user *buf, u32 count, u32 pos)
 {
-	ssize_t (*sys_pwrite64)(unsigned int, char *, size_t, loff_t) =
-		(ssize_t (*)(unsigned int, char *, size_t, loff_t))SYS(pwrite64);
+	ssize_t (*sys_pwrite64)(unsigned int, char __user *, size_t, loff_t) =
+		(ssize_t (*)(unsigned int, char __user *, size_t, loff_t))SYS(pwrite64);
 
 	return sys_pwrite64(fd, buf, count, (loff_t)pos);
 }
@@ -757,8 +715,8 @@
 /* solaris_llseek returns long long - quite difficult */
 asmlinkage long solaris_llseek(struct pt_regs *regs, u32 off_hi, u32 off_lo, int whence)
 {
-	int (*sys_llseek)(unsigned int, unsigned long, unsigned long, loff_t *, unsigned int) =
-		(int (*)(unsigned int, unsigned long, unsigned long, loff_t *, unsigned int))SYS(_llseek);
+	int (*sys_llseek)(unsigned int, unsigned long, unsigned long, loff_t __user *, unsigned int) =
+		(int (*)(unsigned int, unsigned long, unsigned long, loff_t __user *, unsigned int))SYS(_llseek);
 	int ret;
 	mm_segment_t old_fs = get_fs();
 	loff_t retval;
@@ -774,8 +732,8 @@
 /* Have to mask out all but lower 3 bits */
 asmlinkage int solaris_access(u32 filename, long mode)
 {
-	int (*sys_access)(const char *, int) = 
-		(int (*)(const char *, int))SYS(access);
+	int (*sys_access)(const char __user *, int) = 
+		(int (*)(const char __user *, int))SYS(access);
 		
-	return sys_access((const char *)A(filename), mode & 7);
+	return sys_access(A(filename), mode & 7);
 }
diff -Nru a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c
--- a/arch/sparc64/solaris/ioctl.c	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/solaris/ioctl.c	2004-07-27 18:24:51 -07:00
@@ -39,10 +39,10 @@
 	u32 arg);
 asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
 
-extern int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len,
-			char *data_buf, int data_len, int flags);
-extern int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, int *ctl_len,
-			char *data_buf, int data_maxlen, int *data_len, int *flags);
+extern int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len,
+			char __user *data_buf, int data_len, int flags);
+extern int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, int __user *ctl_len,
+			char __user *data_buf, int data_maxlen, int __user *data_len, int *flags);
 
 /* termio* stuff {{{ */
 
@@ -117,16 +117,17 @@
 
 static inline int linux_to_solaris_termio(unsigned int fd, unsigned int cmd, u32 arg)
 {
+	struct solaris_termio __user *p = A(arg);
 	int ret;
 	
-	ret = sys_ioctl(fd, cmd, A(arg));
+	ret = sys_ioctl(fd, cmd, (unsigned long)p);
 	if (!ret) {
 		u32 cflag;
 		
-		if (__get_user (cflag, &((struct solaris_termio *)A(arg))->c_cflag))
+		if (__get_user (cflag, &p->c_cflag))
 			return -EFAULT;
 		cflag = linux_to_solaris_cflag(cflag);
-		if (__put_user (cflag, &((struct solaris_termio *)A(arg))->c_cflag))
+		if (__put_user (cflag, &p->c_cflag))
 			return -EFAULT;
 	}
 	return ret;
@@ -138,7 +139,7 @@
 	struct solaris_termio s;
 	mm_segment_t old_fs = get_fs();
 	
-	if (copy_from_user (&s, (struct solaris_termio *)A(arg), sizeof(struct solaris_termio)))
+	if (copy_from_user (&s, (struct solaris_termio __user *)A(arg), sizeof(struct solaris_termio)))
 		return -EFAULT;
 	s.c_cflag = solaris_to_linux_cflag(s.c_cflag);
 	set_fs(KERNEL_DS);
@@ -157,12 +158,13 @@
 	ret = sys_ioctl(fd, cmd, (unsigned long)&s);
 	set_fs(old_fs);
 	if (!ret) {
-		if (put_user (s.c_iflag, &((struct solaris_termios *)A(arg))->c_iflag) ||
-		    __put_user (s.c_oflag, &((struct solaris_termios *)A(arg))->c_oflag) ||
-		    __put_user (linux_to_solaris_cflag(s.c_cflag), &((struct solaris_termios *)A(arg))->c_cflag) ||
-		    __put_user (s.c_lflag, &((struct solaris_termios *)A(arg))->c_lflag) ||
-		    __copy_to_user (((struct solaris_termios *)A(arg))->c_cc, s.c_cc, 16) ||
-		    __clear_user (((struct solaris_termios *)A(arg))->c_cc + 16, 2))
+		struct solaris_termios __user *p = A(arg);
+		if (put_user (s.c_iflag, &p->c_iflag) ||
+		    __put_user (s.c_oflag, &p->c_oflag) ||
+		    __put_user (linux_to_solaris_cflag(s.c_cflag), &p->c_cflag) ||
+		    __put_user (s.c_lflag, &p->c_lflag) ||
+		    __copy_to_user (p->c_cc, s.c_cc, 16) ||
+		    __clear_user (p->c_cc + 16, 2))
 			return -EFAULT;
 	}
 	return ret;
@@ -172,17 +174,18 @@
 {
 	int ret;
 	struct solaris_termios s;
+	struct solaris_termios __user *p = A(arg);
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(KERNEL_DS);
 	ret = sys_ioctl(fd, TCGETS, (unsigned long)&s);
 	set_fs(old_fs);
 	if (ret) return ret;
-	if (put_user (s.c_iflag, &((struct solaris_termios *)A(arg))->c_iflag) ||
-	    __put_user (s.c_oflag, &((struct solaris_termios *)A(arg))->c_oflag) ||
-	    __put_user (s.c_cflag, &((struct solaris_termios *)A(arg))->c_cflag) ||
-	    __put_user (s.c_lflag, &((struct solaris_termios *)A(arg))->c_lflag) ||
-	    __copy_from_user (s.c_cc, ((struct solaris_termios *)A(arg))->c_cc, 16))
+	if (put_user (s.c_iflag, &p->c_iflag) ||
+	    __put_user (s.c_oflag, &p->c_oflag) ||
+	    __put_user (s.c_cflag, &p->c_cflag) ||
+	    __put_user (s.c_lflag, &p->c_lflag) ||
+	    __copy_from_user (s.c_cc, p->c_cc, 16))
 		return -EFAULT;
 	s.c_cflag = solaris_to_linux_cflag(s.c_cflag);
 	set_fs(KERNEL_DS);
@@ -305,7 +308,7 @@
 	case 109: /* SI_SOCKPARAMS */
 	{
 		struct solaris_si_sockparams si;
-		if (copy_from_user (&si, (struct solaris_si_sockparams *) A(arg), sizeof(si)))
+		if (copy_from_user (&si, A(arg), sizeof(si)))
 			return (EFAULT << 8) | TSYSERR;
 
 		/* Should we modify socket ino->socket_i.ops and type? */
@@ -314,6 +317,7 @@
 	case 110: /* SI_GETUDATA */
 	{
 		int etsdusize, servtype;
+		struct solaris_si_udata __user *p = A(arg);
 		switch (SOCKET_I(ino)->type) {
 		case SOCK_STREAM:
 			etsdusize = 1;
@@ -324,23 +328,24 @@
 			servtype = 3;
 			break;
 		}
-		if (put_user(16384, &((struct solaris_si_udata *)A(arg))->tidusize) ||
-		    __put_user(sizeof(struct sockaddr), &((struct solaris_si_udata *)A(arg))->addrsize) ||
-		    __put_user(-1, &((struct solaris_si_udata *)A(arg))->optsize) ||
-		    __put_user(etsdusize, &((struct solaris_si_udata *)A(arg))->etsdusize) ||
-		    __put_user(servtype, &((struct solaris_si_udata *)A(arg))->servtype) ||
-		    __put_user(0, &((struct solaris_si_udata *)A(arg))->so_state) ||
-		    __put_user(0, &((struct solaris_si_udata *)A(arg))->so_options) ||
-		    __put_user(16384, &((struct solaris_si_udata *)A(arg))->tsdusize) ||
-		    __put_user(SOCKET_I(ino)->ops->family, &((struct solaris_si_udata *)A(arg))->sockparams.sp_family) ||
-		    __put_user(SOCKET_I(ino)->type, &((struct solaris_si_udata *)A(arg))->sockparams.sp_type) ||
-		    __put_user(SOCKET_I(ino)->ops->family, &((struct solaris_si_udata *)A(arg))->sockparams.sp_protocol))
+		if (put_user(16384, &p->tidusize) ||
+		    __put_user(sizeof(struct sockaddr), &p->addrsize) ||
+		    __put_user(-1, &p->optsize) ||
+		    __put_user(etsdusize, &p->etsdusize) ||
+		    __put_user(servtype, &p->servtype) ||
+		    __put_user(0, &p->so_state) ||
+		    __put_user(0, &p->so_options) ||
+		    __put_user(16384, &p->tsdusize) ||
+		    __put_user(SOCKET_I(ino)->ops->family, &p->sockparams.sp_family) ||
+		    __put_user(SOCKET_I(ino)->type, &p->sockparams.sp_type) ||
+		    __put_user(SOCKET_I(ino)->ops->family, &p->sockparams.sp_protocol))
 			return (EFAULT << 8) | TSYSERR;
 		return 0;
 	}
 	case 101: /* O_SI_GETUDATA */
 	{
 		int etsdusize, servtype;
+		struct solaris_o_si_udata __user *p = A(arg);
 		switch (SOCKET_I(ino)->type) {
 		case SOCK_STREAM:
 			etsdusize = 1;
@@ -351,14 +356,14 @@
 			servtype = 3;
 			break;
 		}
-		if (put_user(16384, &((struct solaris_o_si_udata *)A(arg))->tidusize) ||
-		    __put_user(sizeof(struct sockaddr), &((struct solaris_o_si_udata *)A(arg))->addrsize) ||
-		    __put_user(-1, &((struct solaris_o_si_udata *)A(arg))->optsize) ||
-		    __put_user(etsdusize, &((struct solaris_o_si_udata *)A(arg))->etsdusize) ||
-		    __put_user(servtype, &((struct solaris_o_si_udata *)A(arg))->servtype) ||
-		    __put_user(0, &((struct solaris_o_si_udata *)A(arg))->so_state) ||
-		    __put_user(0, &((struct solaris_o_si_udata *)A(arg))->so_options) ||
-		    __put_user(16384, &((struct solaris_o_si_udata *)A(arg))->tsdusize))
+		if (put_user(16384, &p->tidusize) ||
+		    __put_user(sizeof(struct sockaddr), &p->addrsize) ||
+		    __put_user(-1, &p->optsize) ||
+		    __put_user(etsdusize, &p->etsdusize) ||
+		    __put_user(servtype, &p->servtype) ||
+		    __put_user(0, &p->so_state) ||
+		    __put_user(0, &p->so_options) ||
+		    __put_user(16384, &p->tsdusize))
 			return (EFAULT << 8) | TSYSERR;
 		return 0;
 	}
@@ -375,7 +380,7 @@
 }
 
 static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
-                                    int len, int *len_p)
+                                    int len, int __user *len_p)
 {
 	int ret;
 		
@@ -385,25 +390,25 @@
 		int i;
 		u32 prim;
 		SOLD("TI_OPMGMT entry");
-		ret = timod_putmsg(fd, (char *)A(arg), len, NULL, -1, 0);
+		ret = timod_putmsg(fd, A(arg), len, NULL, -1, 0);
 		SOLD("timod_putmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
 		i = MSG_HIPRI;
 		SOLD("calling timod_getmsg()");
-		ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
+		ret = timod_getmsg(fd, A(arg), len, len_p, NULL, -1, NULL, &i);
 		SOLD("timod_getmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
 		SOLD("ret ok");
-		if (get_user(prim, (u32 *)A(arg)))
+		if (get_user(prim, (u32 __user *)A(arg)))
 			return (EFAULT << 8) | TSYSERR;
 		SOLD("got prim");
 		if (prim == T_ERROR_ACK) {
 			u32 tmp, tmp2;
 			SOLD("prim is T_ERROR_ACK");
-			if (get_user(tmp, (u32 *)A(arg)+3) ||
-			    get_user(tmp2, (u32 *)A(arg)+2))
+			if (get_user(tmp, (u32 __user *)A(arg)+3) ||
+			    get_user(tmp2, (u32 __user *)A(arg)+2))
 				return (EFAULT << 8) | TSYSERR;
 			return (tmp2 << 8) | tmp;
 		}
@@ -415,26 +420,26 @@
 		int i;
 		u32 prim;
 		SOLD("TI_BIND entry");
-		ret = timod_putmsg(fd, (char *)A(arg), len, NULL, -1, 0);
+		ret = timod_putmsg(fd, A(arg), len, NULL, -1, 0);
 		SOLD("timod_putmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
 		len = 1024; /* Solaris allows arbitrary return size */
 		i = MSG_HIPRI;
 		SOLD("calling timod_getmsg()");
-		ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
+		ret = timod_getmsg(fd, A(arg), len, len_p, NULL, -1, NULL, &i);
 		SOLD("timod_getmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
 		SOLD("ret ok");
-		if (get_user(prim, (u32 *)A(arg)))
+		if (get_user(prim, (u32 __user *)A(arg)))
 			return (EFAULT << 8) | TSYSERR;
 		SOLD("got prim");
 		if (prim == T_ERROR_ACK) {
 			u32 tmp, tmp2;
 			SOLD("prim is T_ERROR_ACK");
-			if (get_user(tmp, (u32 *)A(arg)+3) ||
-			    get_user(tmp2, (u32 *)A(arg)+2))
+			if (get_user(tmp, (u32 __user *)A(arg)+3) ||
+			    get_user(tmp2, (u32 __user *)A(arg)+2))
 				return (EFAULT << 8) | TSYSERR;
 			return (tmp2 << 8) | tmp;
 		}
@@ -444,7 +449,7 @@
 		SOLD("OK_ACK requested");
 		i = MSG_HIPRI;
 		SOLD("calling timod_getmsg()");
-		ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
+		ret = timod_getmsg(fd, A(arg), len, len_p, NULL, -1, NULL, &i);
 		SOLD("timod_getmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
@@ -491,7 +496,7 @@
 		return -ENOSYS;
 	case 2: /* I_PUSH */
         {
-		p = getname ((char *)A(arg));
+		p = getname (A(arg));
 		if (IS_ERR (p))
 			return PTR_ERR(p);
                 ret = -EINVAL;
@@ -520,14 +525,14 @@
         	const char *p;
                 if (sock->modcount <= 0) return -EINVAL;
                 p = module_table[(unsigned)sock->module[sock->modcount]].name;
-                if (copy_to_user ((char *)A(arg), p, strlen(p)))
+                if (copy_to_user (A(arg), p, strlen(p)))
                 	return -EFAULT;
                 return 0;
         }
 	case 5: /* I_FLUSH */
 		return 0;
 	case 8: /* I_STR */
-		if (copy_from_user(&si, (struct strioctl *)A(arg), sizeof(struct strioctl)))
+		if (copy_from_user(&si, A(arg), sizeof(struct strioctl)))
 			return -EFAULT;
                 /* We ignore what module is actually at the top of stack. */
 		switch ((si.cmd >> 8) & 0xff) {
@@ -535,7 +540,7 @@
                         return solaris_sockmod(fd, si.cmd, si.data);
 		case 'T':
                         return solaris_timod(fd, si.cmd, si.data, si.len,
-                                                &((struct strioctl*)A(arg))->len);
+				&((struct strioctl __user *)A(arg))->len);
 		default:
 			return solaris_ioctl(fd, si.cmd, si.data);
 		}
@@ -551,7 +556,7 @@
 	case 11: /* I_FIND */
         {
                 int i;
-		p = getname ((char *)A(arg));
+		p = getname (A(arg));
 		if (IS_ERR (p))
 			return PTR_ERR(p);
                 ret = 0;
@@ -580,7 +585,7 @@
 		return 0; /* We don't support them */
 	case 1: /* SIOCGHIWAT */
 	case 3: /* SIOCGLOWAT */
-		if (put_user (0, (u32 *)A(arg)))
+		if (put_user (0, (u32 __user *)A(arg)))
 			return -EFAULT;
 		return 0; /* Lie */
 	case 7: /* SIOCATMARK */
@@ -663,7 +668,7 @@
 					args);
 			set_fs(old_fs);
 			if (ret >= 0) {
-				if (copy_to_user((char *)A(arg), &uaddr, uaddr_len))
+				if (copy_to_user(A(arg), &uaddr, uaddr_len))
 					return -EFAULT;
 			}
 			return ret;
@@ -681,7 +686,7 @@
 			for (d = dev_base; d; d = d->next) i++;
 			read_unlock_bh(&dev_base_lock);
 
-			if (put_user (i, (int *)A(arg)))
+			if (put_user (i, (int __user *)A(arg)))
 				return -EFAULT;
 			return 0;
 		}
diff -Nru a/arch/sparc64/solaris/ipc.c b/arch/sparc64/solaris/ipc.c
--- a/arch/sparc64/solaris/ipc.c	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/solaris/ipc.c	2004-07-27 18:24:51 -07:00
@@ -54,8 +54,8 @@
 
 asmlinkage long solaris_shmsys(int cmd, u32 arg1, u32 arg2, u32 arg3)
 {
-	int (*sys_ipc)(unsigned,int,int,unsigned long,void *,long) = 
-		(int (*)(unsigned,int,int,unsigned long,void *,long))SYS(ipc);
+	int (*sys_ipc)(unsigned,int,int,unsigned long,void __user *,long) = 
+		(int (*)(unsigned,int,int,unsigned long,void __user *,long))SYS(ipc);
 	mm_segment_t old_fs;
 	unsigned long raddr;
 	int ret;
@@ -64,7 +64,7 @@
 	case 0: /* shmat */
 		old_fs = get_fs();
 		set_fs(KERNEL_DS);
-		ret = sys_ipc(SHMAT, arg1, arg3 & ~0x4000, (unsigned long)&raddr, (void *)A(arg2), 0);
+		ret = sys_ipc(SHMAT, arg1, arg3 & ~0x4000, (unsigned long)&raddr, A(arg2), 0);
 		set_fs(old_fs);
 		if (ret >= 0) return (u32)raddr;
 		else return ret;
@@ -78,10 +78,11 @@
 		case 11: /* IPC_SET */
 			{
 				struct shmid_ds s;
+				struct solaris_shmid_ds __user *p = A(arg3);
 				
-				if (get_user (s.shm_perm.uid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.uid)) ||
-				    __get_user (s.shm_perm.gid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.gid)) || 
-				    __get_user (s.shm_perm.mode, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.mode)))
+				if (get_user (s.shm_perm.uid, &p->shm_perm.uid) ||
+				    __get_user (s.shm_perm.gid, &p->shm_perm.gid) || 
+				    __get_user (s.shm_perm.mode, &p->shm_perm.mode))
 					return -EFAULT;
 				old_fs = get_fs();
 				set_fs(KERNEL_DS);
@@ -92,32 +93,33 @@
 		case 12: /* IPC_STAT */
 			{
 				struct shmid_ds s;
+				struct solaris_shmid_ds __user *p = A(arg3);
 				
 				old_fs = get_fs();
 				set_fs(KERNEL_DS);
 				ret = sys_ipc(SHMCTL, arg1, IPC_SET, 0, &s, 0);
 				set_fs(old_fs);
-				if (get_user (s.shm_perm.uid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.uid)) ||
-				    __get_user (s.shm_perm.gid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.gid)) || 
-				    __get_user (s.shm_perm.cuid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.cuid)) ||
-				    __get_user (s.shm_perm.cgid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.cgid)) || 
-				    __get_user (s.shm_perm.mode, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.mode)) ||
-				    __get_user (s.shm_perm.seq, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.seq)) ||
-				    __get_user (s.shm_perm.key, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.key)) ||
-				    __get_user (s.shm_segsz, &(((struct solaris_shmid_ds *)A(arg3))->shm_segsz)) ||
-				    __get_user (s.shm_lpid, &(((struct solaris_shmid_ds *)A(arg3))->shm_lpid)) ||
-				    __get_user (s.shm_cpid, &(((struct solaris_shmid_ds *)A(arg3))->shm_cpid)) ||
-				    __get_user (s.shm_nattch, &(((struct solaris_shmid_ds *)A(arg3))->shm_nattch)) ||
-				    __get_user (s.shm_atime, &(((struct solaris_shmid_ds *)A(arg3))->shm_atime)) ||
-				    __get_user (s.shm_dtime, &(((struct solaris_shmid_ds *)A(arg3))->shm_dtime)) ||
-				    __get_user (s.shm_ctime, &(((struct solaris_shmid_ds *)A(arg3))->shm_ctime)))
+				if (put_user (s.shm_perm.uid, &(p->shm_perm.uid)) ||
+				    __put_user (s.shm_perm.gid, &(p->shm_perm.gid)) || 
+				    __put_user (s.shm_perm.cuid, &(p->shm_perm.cuid)) ||
+				    __put_user (s.shm_perm.cgid, &(p->shm_perm.cgid)) || 
+				    __put_user (s.shm_perm.mode, &(p->shm_perm.mode)) ||
+				    __put_user (s.shm_perm.seq, &(p->shm_perm.seq)) ||
+				    __put_user (s.shm_perm.key, &(p->shm_perm.key)) ||
+				    __put_user (s.shm_segsz, &(p->shm_segsz)) ||
+				    __put_user (s.shm_lpid, &(p->shm_lpid)) ||
+				    __put_user (s.shm_cpid, &(p->shm_cpid)) ||
+				    __put_user (s.shm_nattch, &(p->shm_nattch)) ||
+				    __put_user (s.shm_atime, &(p->shm_atime)) ||
+				    __put_user (s.shm_dtime, &(p->shm_dtime)) ||
+				    __put_user (s.shm_ctime, &(p->shm_ctime)))
 					return -EFAULT;
 				return ret;
 			}
 		default: return -EINVAL;
 		}
 	case 2: /* shmdt */
-		return sys_ipc(SHMDT, 0, 0, 0, (void *)A(arg1), 0);
+		return sys_ipc(SHMDT, 0, 0, 0, A(arg1), 0);
 	case 3: /* shmget */
 		return sys_ipc(SHMGET, arg1, arg2, arg3, NULL, 0);
 	}
diff -Nru a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
--- a/arch/sparc64/solaris/misc.c	2004-07-27 18:24:52 -07:00
+++ b/arch/sparc64/solaris/misc.c	2004-07-27 18:24:52 -07:00
@@ -121,10 +121,10 @@
 	u32 offlo;
 	
 	if (regs->u_regs[UREG_G1]) {
-		if (get_user (offlo, (u32 *)(long)((u32)regs->u_regs[UREG_I6] + 0x5c)))
+		if (get_user (offlo, (u32 __user *)(long)((u32)regs->u_regs[UREG_I6] + 0x5c)))
 			return -EFAULT;
 	} else {
-		if (get_user (offlo, (u32 *)(long)((u32)regs->u_regs[UREG_I6] + 0x60)))
+		if (get_user (offlo, (u32 __user *)(long)((u32)regs->u_regs[UREG_I6] + 0x60)))
 			return -EFAULT;
 	}
 	return do_solaris_mmap((u32)regs->u_regs[UREG_I0], len, prot, flags, fd, (((u64)offhi)<<32)|offlo);
@@ -148,7 +148,7 @@
 		for (p=from,i=0; *p && *p != '.' && --len; p++,i++); 	\
 	else 								\
 		i = len - 1; 						\
-	if (__put_user('\0', (char *)(to+i)))				\
+	if (__put_user('\0', (char __user *)((to)+i)))			\
 		return -EFAULT;						\
 }
 
@@ -218,21 +218,17 @@
 
 asmlinkage int solaris_utssys(u32 buf, u32 flags, int which, u32 buf2)
 {
+	struct sol_uname __user *v = A(buf);
 	switch (which) {
 	case 0:	/* old uname */
 		/* Let's cheat */
-		set_utsfield(((struct sol_uname *)A(buf))->sysname, 
-			"SunOS", 1, 0);
+		set_utsfield(v->sysname, "SunOS", 1, 0);
 		down_read(&uts_sem);
-		set_utsfield(((struct sol_uname *)A(buf))->nodename, 
-			system_utsname.nodename, 1, 1);
+		set_utsfield(v->nodename, system_utsname.nodename, 1, 1);
 		up_read(&uts_sem);
-		set_utsfield(((struct sol_uname *)A(buf))->release, 
-			"2.6", 0, 0);
-		set_utsfield(((struct sol_uname *)A(buf))->version, 
-			"Generic", 0, 0);
-		set_utsfield(((struct sol_uname *)A(buf))->machine, 
-			machine(), 0, 0);
+		set_utsfield(v->release, "2.6", 0, 0);
+		set_utsfield(v->version, "Generic", 0, 0);
+		set_utsfield(v->machine, machine(), 0, 0);
 		return 0;
 	case 2: /* ustat */
 		return -ENOSYS;
@@ -245,18 +241,14 @@
 
 asmlinkage int solaris_utsname(u32 buf)
 {
+	struct sol_utsname __user *v = A(buf);
 	/* Why should we not lie a bit? */
 	down_read(&uts_sem);
-	set_utsfield(((struct sol_utsname *)A(buf))->sysname, 
-			"SunOS", 0, 0);
-	set_utsfield(((struct sol_utsname *)A(buf))->nodename, 
-			system_utsname.nodename, 1, 1);
-	set_utsfield(((struct sol_utsname *)A(buf))->release, 
-			"5.6", 0, 0);
-	set_utsfield(((struct sol_utsname *)A(buf))->version, 
-			"Generic", 0, 0);
-	set_utsfield(((struct sol_utsname *)A(buf))->machine, 
-			machine(), 0, 0);
+	set_utsfield(v->sysname, "SunOS", 0, 0);
+	set_utsfield(v->nodename, system_utsname.nodename, 1, 1);
+	set_utsfield(v->release, "5.6", 0, 0);
+	set_utsfield(v->version, "Generic", 0, 0);
+	set_utsfield(v->machine, machine(), 0, 0);
 	up_read(&uts_sem);
 	return 0;
 }
@@ -302,11 +294,11 @@
 	}
 	len = strlen(r) + 1;
 	if (count < len) {
-		if (copy_to_user((char *)A(buf), r, count - 1) ||
-		    __put_user(0, (char *)A(buf) + count - 1))
+		if (copy_to_user(A(buf), r, count - 1) ||
+		    __put_user(0, (char __user *)A(buf) + count - 1))
 			return -EFAULT;
 	} else {
-		if (copy_to_user((char *)A(buf), r, len))
+		if (copy_to_user(A(buf), r, len))
 			return -EFAULT;
 	}
 	return len;
@@ -453,7 +445,7 @@
 	u32	rlim_max;
 };
 
-asmlinkage int solaris_getrlimit(unsigned int resource, struct rlimit32 *rlim)
+asmlinkage int solaris_getrlimit(unsigned int resource, struct rlimit32 __user *rlim)
 {
 	struct rlimit r;
 	int ret;
@@ -486,15 +478,15 @@
 	return ret;
 }
 
-asmlinkage int solaris_setrlimit(unsigned int resource, struct rlimit32 *rlim)
+asmlinkage int solaris_setrlimit(unsigned int resource, struct rlimit32 __user *rlim)
 {
 	struct rlimit r, rold;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
-	int (*sys_getrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(getrlimit);
-	int (*sys_setrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(setrlimit);
+	int (*sys_getrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(getrlimit);
+	int (*sys_setrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(setrlimit);
 
 	if (resource > RLIMIT_SOL_VMEM)
 		return -EINVAL;	
@@ -527,13 +519,13 @@
 	return ret;
 }
 
-asmlinkage int solaris_getrlimit64(unsigned int resource, struct rlimit *rlim)
+asmlinkage int solaris_getrlimit64(unsigned int resource, struct rlimit __user *rlim)
 {
 	struct rlimit r;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
-	int (*sys_getrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(getrlimit);
+	int (*sys_getrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(getrlimit);
 
 	if (resource > RLIMIT_SOL_VMEM)
 		return -EINVAL;	
@@ -556,15 +548,15 @@
 	return ret;
 }
 
-asmlinkage int solaris_setrlimit64(unsigned int resource, struct rlimit *rlim)
+asmlinkage int solaris_setrlimit64(unsigned int resource, struct rlimit __user *rlim)
 {
 	struct rlimit r, rold;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
-	int (*sys_getrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(getrlimit);
-	int (*sys_setrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(setrlimit);
+	int (*sys_getrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(getrlimit);
+	int (*sys_setrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(setrlimit);
 
 	if (resource > RLIMIT_SOL_VMEM)
 		return -EINVAL;	
@@ -623,10 +615,10 @@
 	s32 stbcnt;
 };
 
-asmlinkage int solaris_ntp_gettime(struct sol_ntptimeval *ntp)
+asmlinkage int solaris_ntp_gettime(struct sol_ntptimeval __user *ntp)
 {
-	int (*sys_adjtimex)(struct timex *) =
-		(int (*)(struct timex *))SYS(adjtimex);
+	int (*sys_adjtimex)(struct timex __user *) =
+		(int (*)(struct timex __user *))SYS(adjtimex);
 	struct timex t;
 	int ret;
 	mm_segment_t old_fs = get_fs();
@@ -644,10 +636,10 @@
 	return ret;	                        
 }
 
-asmlinkage int solaris_ntp_adjtime(struct sol_timex *txp)
+asmlinkage int solaris_ntp_adjtime(struct sol_timex __user *txp)
 {
-	int (*sys_adjtimex)(struct timex *) =
-		(int (*)(struct timex *))SYS(adjtimex);
+	int (*sys_adjtimex)(struct timex __user *) =
+		(int (*)(struct timex __user *))SYS(adjtimex);
 	struct timex t;
 	int ret, err;
 	mm_segment_t old_fs = get_fs();
diff -Nru a/arch/sparc64/solaris/signal.c b/arch/sparc64/solaris/signal.c
--- a/arch/sparc64/solaris/signal.c	2004-07-27 18:24:53 -07:00
+++ b/arch/sparc64/solaris/signal.c	2004-07-27 18:24:53 -07:00
@@ -76,8 +76,8 @@
 	struct sigaction sa, old;
 	int ret;
 	mm_segment_t old_fs = get_fs();
-	int (*sys_sigaction)(int,struct sigaction *,struct sigaction *) = 
-		(int (*)(int,struct sigaction *,struct sigaction *))SYS(sigaction);
+	int (*sys_sigaction)(int,struct sigaction __user *,struct sigaction __user *) = 
+		(int (*)(int,struct sigaction __user *,struct sigaction __user *))SYS(sigaction);
 	
 	sigemptyset(&sa.sa_mask);
 	sa.sa_restorer = NULL;
@@ -85,10 +85,10 @@
 	sa.sa_flags = 0;
 	if (one_shot) sa.sa_flags = SA_ONESHOT | SA_NOMASK;
 	set_fs (KERNEL_DS);
-	ret = sys_sigaction(sig, &sa, &old);
+	ret = sys_sigaction(sig, (void __user *)&sa, (void __user *)&old);
 	set_fs (old_fs);
 	if (ret < 0) return ret;
-	return (u32)(long)old.sa_handler;
+	return (u32)(unsigned long)old.sa_handler;
 }
 
 static inline long solaris_signal(int sig, u32 arg)
@@ -129,7 +129,7 @@
 
 static inline long solaris_sigignore(int sig)
 {
-	return sig_handler (sig, (u32)SIG_IGN, 0);
+	return sig_handler(sig, (u32)(unsigned long)SIG_IGN, 0);
 }
 
 static inline long solaris_sigpause(int sig)
@@ -207,21 +207,22 @@
 	sigset_t in_s, *ins, out_s, *outs;
 	mm_segment_t old_fs = get_fs();
 	int ret;
-	int (*sys_sigprocmask)(int,sigset_t *,sigset_t *) = 
-		(int (*)(int,sigset_t *,sigset_t *))SYS(sigprocmask);
+	int (*sys_sigprocmask)(int,sigset_t __user *,sigset_t __user *) = 
+		(int (*)(int,sigset_t __user *,sigset_t __user *))SYS(sigprocmask);
 	
 	ins = NULL; outs = NULL;
 	if (in) {
 		u32 tmp[2];
 		
-		if (copy_from_user (tmp, (sol_sigset_t *)A(in), 2*sizeof(u32)))
+		if (copy_from_user (tmp, (void __user *)A(in), 2*sizeof(u32)))
 			return -EFAULT;
 		ins = &in_s;
 		if (mapin (tmp, ins)) return -EINVAL;
 	}
 	if (out) outs = &out_s;
 	set_fs (KERNEL_DS);
-	ret = sys_sigprocmask((how == 3) ? SIG_SETMASK : how, ins, outs);
+	ret = sys_sigprocmask((how == 3) ? SIG_SETMASK : how,
+				(void __user *)ins, (void __user *)outs);
 	set_fs (old_fs);
 	if (ret) return ret;
 	if (out) {
@@ -229,7 +230,7 @@
 		
 		tmp[2] = 0; tmp[3] = 0;
 		if (mapout (outs, tmp)) return -EINVAL;
-		if (copy_to_user((sol_sigset_t *)A(out), tmp, 4*sizeof(u32)))
+		if (copy_to_user((void __user *)A(out), tmp, 4*sizeof(u32)))
 			return -EFAULT;
 	}
 	return 0;
@@ -240,7 +241,7 @@
 	sigset_t s;
 	u32 tmp[2];
 		
-	if (copy_from_user (tmp, (sol_sigset_t *)A(mask), 2*sizeof(u32)))
+	if (copy_from_user (tmp, (sol_sigset_t __user *)A(mask), 2*sizeof(u32)))
 		return -EFAULT;
 	if (mapin (tmp, &s)) return -EINVAL;
 	return (long)s.sig[0];
@@ -259,18 +260,19 @@
 	struct sigaction s, s2;
 	int ret;
 	mm_segment_t old_fs = get_fs();
-	int (*sys_sigaction)(int,struct sigaction *,struct sigaction *) = 
-		(int (*)(int,struct sigaction *,struct sigaction *))SYS(sigaction);
+	struct sol_sigaction __user *p = (void __user *)A(old);
+	int (*sys_sigaction)(int,struct sigaction __user *,struct sigaction __user *) = 
+		(int (*)(int,struct sigaction __user *,struct sigaction __user *))SYS(sigaction);
 	
 	sig = mapsig(sig); 
 	if (sig < 0) {
 		/* We cheat a little bit for Solaris only signals */
-		if (old && clear_user((struct sol_sigaction *)A(old), sizeof(struct sol_sigaction)))
+		if (old && clear_user(p, sizeof(struct sol_sigaction)))
 			return -EFAULT;
 		return 0;
 	}
 	if (act) {
-		if (get_user (tmp, &((struct sol_sigaction *)A(act))->sa_flags))
+		if (get_user (tmp, &p->sa_flags))
 			return -EFAULT;
 		s.sa_flags = 0;
 		if (tmp & SOLARIS_SA_ONSTACK) s.sa_flags |= SA_STACK;
@@ -278,15 +280,16 @@
 		if (tmp & SOLARIS_SA_NODEFER) s.sa_flags |= SA_NOMASK;
 		if (tmp & SOLARIS_SA_RESETHAND) s.sa_flags |= SA_ONESHOT;
 		if (tmp & SOLARIS_SA_NOCLDSTOP) s.sa_flags |= SA_NOCLDSTOP;
-		if (get_user (tmp, &((struct sol_sigaction *)A(act))->sa_handler) ||
-		    copy_from_user (tmp2, &((struct sol_sigaction *)A(act))->sa_mask, 2*sizeof(u32)))
+		if (get_user (tmp, &p->sa_handler) ||
+		    copy_from_user (tmp2, &p->sa_mask, 2*sizeof(u32)))
 			return -EFAULT;
 		s.sa_handler = (__sighandler_t)A(tmp);
 		if (mapin (tmp2, &s.sa_mask)) return -EINVAL;
-		s.sa_restorer = 0;
+		s.sa_restorer = NULL;
 	}
 	set_fs(KERNEL_DS);
-	ret = sys_sigaction(sig, act ? &s : NULL, old ? &s2 : NULL);
+	ret = sys_sigaction(sig, act ? (void __user *)&s : NULL,
+				 old ? (void __user *)&s2 : NULL);
 	set_fs(old_fs);
 	if (ret) return ret;
 	if (old) {
@@ -297,9 +300,9 @@
 		if (s2.sa_flags & SA_NOMASK) tmp |= SOLARIS_SA_NODEFER;
 		if (s2.sa_flags & SA_ONESHOT) tmp |= SOLARIS_SA_RESETHAND;
 		if (s2.sa_flags & SA_NOCLDSTOP) tmp |= SOLARIS_SA_NOCLDSTOP;
-		if (put_user (tmp, &((struct sol_sigaction *)A(old))->sa_flags) ||
-		    __put_user ((u32)(long)s2.sa_handler, &((struct sol_sigaction *)A(old))->sa_handler) ||
-		    copy_to_user (&((struct sol_sigaction *)A(old))->sa_mask, tmp2, 4*sizeof(u32)))
+		if (put_user (tmp, &p->sa_flags) ||
+		    __put_user ((u32)(unsigned long)s2.sa_handler, &p->sa_handler) ||
+		    copy_to_user (&p->sa_mask, tmp2, 4*sizeof(u32)))
 			return -EFAULT;
 	}
 	return 0;
@@ -323,26 +326,27 @@
 	}
 	if (mapout (&s, tmp)) return -EINVAL;
 	tmp[2] = 0; tmp[3] = 0;
-	if (copy_to_user ((u32 *)A(set), tmp, sizeof(tmp)))
+	if (copy_to_user ((u32 __user *)A(set), tmp, sizeof(tmp)))
 		return -EFAULT;
 	return 0;
 }
 
 asmlinkage int solaris_wait(u32 stat_loc)
 {
-	int (*sys_wait4)(pid_t,unsigned int *, int, struct rusage *) =
-		(int (*)(pid_t,unsigned int *, int, struct rusage *))SYS(wait4);
+	unsigned __user *p = (unsigned __user *)A(stat_loc);
+	int (*sys_wait4)(pid_t,unsigned __user *, int, struct rusage __user *) =
+		(int (*)(pid_t,unsigned __user *, int, struct rusage __user *))SYS(wait4);
 	int ret, status;
 	
-	ret = sys_wait4(-1, (unsigned int *)A(stat_loc), WUNTRACED, NULL);
+	ret = sys_wait4(-1, p, WUNTRACED, NULL);
 	if (ret >= 0 && stat_loc) {
-		if (get_user (status, (unsigned int *)A(stat_loc)))
+		if (get_user (status, p))
 			return -EFAULT;
 		if (((status - 1) & 0xffff) < 0xff)
 			status = linux_to_solaris_signals[status & 0x7f] & 0x7f;
 		else if ((status & 0xff) == 0x7f)
 			status = (linux_to_solaris_signals[(status >> 8) & 0xff] << 8) | 0x7f;
-		if (__put_user (status, (unsigned int *)A(stat_loc)))
+		if (__put_user (status, p))
 			return -EFAULT;
 	}
 	return ret;
@@ -350,8 +354,8 @@
 
 asmlinkage int solaris_waitid(int idtype, s32 pid, u32 info, int options)
 {
-	int (*sys_wait4)(pid_t,unsigned int *, int, struct rusage *) =
-		(int (*)(pid_t,unsigned int *, int, struct rusage *))SYS(wait4);
+	int (*sys_wait4)(pid_t,unsigned __user *, int, struct rusage __user *) =
+		(int (*)(pid_t,unsigned __user *, int, struct rusage __user *))SYS(wait4);
 	int opts, status, ret;
 	
 	switch (idtype) {
@@ -364,12 +368,12 @@
 	if (options & SOLARIS_WUNTRACED) opts |= WUNTRACED;
 	if (options & SOLARIS_WNOHANG) opts |= WNOHANG;
 	current->state = TASK_RUNNING;
-	ret = sys_wait4(pid, (unsigned int *)A(info), opts, NULL);
+	ret = sys_wait4(pid, (unsigned int __user *)A(info), opts, NULL);
 	if (ret < 0) return ret;
 	if (info) {
-		struct sol_siginfo *s = (struct sol_siginfo *)A(info);
+		struct sol_siginfo __user *s = (void __user *)A(info);
 	
-		if (get_user (status, (unsigned int *)A(info)))
+		if (get_user (status, (unsigned int __user *)A(info)))
 			return -EFAULT;
 
 		if (__put_user (SOLARIS_SIGCLD, &s->si_signo) ||
diff -Nru a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c
--- a/arch/sparc64/solaris/socket.c	2004-07-27 18:24:52 -07:00
+++ b/arch/sparc64/solaris/socket.c	2004-07-27 18:24:52 -07:00
@@ -132,18 +132,18 @@
 	return sunos_getsockopt(fd, level, optname, optval, optlen);
 }
 
-asmlinkage int solaris_connect(int fd, struct sockaddr *addr, int addrlen)
+asmlinkage int solaris_connect(int fd, struct sockaddr __user *addr, int addrlen)
 {
-	int (*sys_connect)(int, struct sockaddr *, int) =
-		(int (*)(int, struct sockaddr *, int))SYS(connect);
+	int (*sys_connect)(int, struct sockaddr __user *, int) =
+		(int (*)(int, struct sockaddr __user *, int))SYS(connect);
 
 	return sys_connect(fd, addr, addrlen);
 }
 
-asmlinkage int solaris_accept(int fd, struct sockaddr *addr, int *addrlen)
+asmlinkage int solaris_accept(int fd, struct sockaddr __user *addr, int __user *addrlen)
 {
-	int (*sys_accept)(int, struct sockaddr *, int *) =
-		(int (*)(int, struct sockaddr *, int *))SYS(accept);
+	int (*sys_accept)(int, struct sockaddr __user *, int __user *) =
+		(int (*)(int, struct sockaddr __user *, int __user *))SYS(accept);
 
 	return sys_accept(fd, addr, addrlen);
 }
@@ -197,28 +197,28 @@
 	return fl;
 }
 
-asmlinkage int solaris_recvfrom(int s, char *buf, int len, int flags, u32 from, u32 fromlen)
+asmlinkage int solaris_recvfrom(int s, char __user *buf, int len, int flags, u32 from, u32 fromlen)
 {
-	int (*sys_recvfrom)(int, void *, size_t, unsigned, struct sockaddr *, int *) =
-		(int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(recvfrom);
+	int (*sys_recvfrom)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *) =
+		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *))SYS(recvfrom);
 	
-	return sys_recvfrom(s, buf, len, solaris_to_linux_msgflags(flags), (struct sockaddr *)A(from), (int *)A(fromlen));
+	return sys_recvfrom(s, buf, len, solaris_to_linux_msgflags(flags), A(from), A(fromlen));
 }
 
-asmlinkage int solaris_recv(int s, char *buf, int len, int flags)
+asmlinkage int solaris_recv(int s, char __user *buf, int len, int flags)
 {
-	int (*sys_recvfrom)(int, void *, size_t, unsigned, struct sockaddr *, int *) =
-		(int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(recvfrom);
+	int (*sys_recvfrom)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *) =
+		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *))SYS(recvfrom);
 	
 	return sys_recvfrom(s, buf, len, solaris_to_linux_msgflags(flags), NULL, NULL);
 }
 
-asmlinkage int solaris_sendto(int s, char *buf, int len, int flags, u32 to, u32 tolen)
+asmlinkage int solaris_sendto(int s, char __user *buf, int len, int flags, u32 to, u32 tolen)
 {
-	int (*sys_sendto)(int, void *, size_t, unsigned, struct sockaddr *, int *) =
-		(int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(sendto);
+	int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *) =
+		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *))SYS(sendto);
 	
-	return sys_sendto(s, buf, len, solaris_to_linux_msgflags(flags), (struct sockaddr *)A(to), (int *)A(tolen));
+	return sys_sendto(s, buf, len, solaris_to_linux_msgflags(flags), A(to), A(tolen));
 }
 
 asmlinkage int solaris_send(int s, char *buf, int len, int flags)
@@ -269,7 +269,7 @@
 };
 
 static inline int msghdr_from_user32_to_kern(struct msghdr *kmsg,
-					     struct sol_nmsghdr *umsg)
+					     struct sol_nmsghdr __user *umsg)
 {
 	u32 tmp1, tmp2, tmp3;
 	int err;
@@ -280,9 +280,9 @@
 	if (err)
 		return -EFAULT;
 
-	kmsg->msg_name = (void *)A(tmp1);
-	kmsg->msg_iov = (struct iovec *)A(tmp2);
-	kmsg->msg_control = (void *)A(tmp3);
+	kmsg->msg_name = A(tmp1);
+	kmsg->msg_iov = A(tmp2);
+	kmsg->msg_control = A(tmp3);
 
 	err = get_user(kmsg->msg_namelen, &umsg->msg_namelen);
 	err |= get_user(kmsg->msg_controllen, &umsg->msg_controllen);
@@ -293,7 +293,7 @@
 	return err;
 }
 
-asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr *user_msg, unsigned user_flags)
+asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned user_flags)
 {
 	struct socket *sock;
 	char address[MAX_SOCK_ADDR];
@@ -313,7 +313,7 @@
 	total_len = err;
 
 	if(kern_msg.msg_controllen) {
-		struct sol_cmsghdr *ucmsg = (struct sol_cmsghdr *)kern_msg.msg_control;
+		struct sol_cmsghdr __user *ucmsg = kern_msg.msg_control;
 		unsigned long *kcmsg;
 		compat_size_t cmlen;
 
@@ -356,15 +356,15 @@
 	return err;
 }
 
-asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr *user_msg, unsigned int user_flags)
+asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags)
 {
 	struct iovec iovstack[UIO_FASTIOV];
 	struct msghdr kern_msg;
 	char addr[MAX_SOCK_ADDR];
 	struct socket *sock;
 	struct iovec *iov = iovstack;
-	struct sockaddr *uaddr;
-	int *uaddr_len;
+	struct sockaddr __user *uaddr;
+	int __user *uaddr_len;
 	unsigned long cmsg_ptr;
 	int err, total_len, len = 0;
 
diff -Nru a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c
--- a/arch/sparc64/solaris/timod.c	2004-07-27 18:24:51 -07:00
+++ b/arch/sparc64/solaris/timod.c	2004-07-27 18:24:51 -07:00
@@ -219,7 +219,7 @@
 	SOLD("done");
 }
 
-static int timod_optmgmt(unsigned int fd, int flag, char *opt_buf, int opt_len, int do_ret)
+static int timod_optmgmt(unsigned int fd, int flag, char __user *opt_buf, int opt_len, int do_ret)
 {
 	int error, failed;
 	int ret_space, ret_len;
@@ -337,8 +337,8 @@
 	return 0;
 }
 
-int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len,
-			char *data_buf, int data_len, int flags)
+int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len,
+			char __user *data_buf, int data_len, int flags)
 {
 	int ret, error, terror;
 	char *buf;
@@ -347,15 +347,15 @@
 	struct sol_socket_struct *sock;
 	mm_segment_t old_fs = get_fs();
 	long args[6];
-	int (*sys_socketcall)(int, unsigned long *) =
-		(int (*)(int, unsigned long *))SYS(socketcall);
-	int (*sys_sendto)(int, void *, size_t, unsigned, struct sockaddr *, int) =
-		(int (*)(int, void *, size_t, unsigned, struct sockaddr *, int))SYS(sendto);
+	int (*sys_socketcall)(int, unsigned long __user *) =
+		(int (*)(int, unsigned long __user *))SYS(socketcall);
+	int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int) =
+		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int))SYS(sendto);
 	filp = current->files->fd[fd];
 	ino = filp->f_dentry->d_inode;
 	sock = (struct sol_socket_struct *)filp->private_data;
 	SOLD("entry");
-	if (get_user(ret, (int *)A(ctl_buf)))
+	if (get_user(ret, (int __user *)A(ctl_buf)))
 		return -EFAULT;
 	switch (ret) {
 	case T_BIND_REQ:
@@ -596,7 +596,7 @@
 			printk("\n");
 		}
 #endif		
-		err = sys_sendto(fd, data_buf, data_len, 0, req.DEST_length > 0 ? (struct sockaddr*)(ctl_buf+req.DEST_offset) : NULL, req.DEST_length);
+		err = sys_sendto(fd, data_buf, data_len, 0, req.DEST_length > 0 ? (struct sockaddr __user *)(ctl_buf+req.DEST_offset) : NULL, req.DEST_length);
 		if (err == data_len)
 			return 0;
 		if(err >= 0) {
@@ -613,8 +613,8 @@
 	return -EINVAL;
 }
 
-int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
-			char *data_buf, int data_maxlen, s32 *data_len, int *flags_p)
+int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, s32 __user *ctl_len,
+			char __user *data_buf, int data_maxlen, s32 __user *data_len, int *flags_p)
 {
 	int error;
 	int oldflags;
@@ -624,11 +624,11 @@
 	struct T_unitdata_ind udi;
 	mm_segment_t old_fs = get_fs();
 	long args[6];
-	char *tmpbuf;
+	char __user *tmpbuf;
 	int tmplen;
-	int (*sys_socketcall)(int, unsigned long *) =
-		(int (*)(int, unsigned long *))SYS(socketcall);
-	int (*sys_recvfrom)(int, void *, size_t, unsigned, struct sockaddr *, int *);
+	int (*sys_socketcall)(int, unsigned long __user *) =
+		(int (*)(int, unsigned long __user *))SYS(socketcall);
+	int (*sys_recvfrom)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *);
 	
 	SOLD("entry");
 	SOLDD(("%u %p %d %p %p %d %p %d\n", fd, ctl_buf, ctl_maxlen, ctl_len, data_buf, data_maxlen, data_len, *flags_p));
@@ -808,8 +808,8 @@
 	oldflags = filp->f_flags;
 	filp->f_flags |= O_NONBLOCK;
 	SOLD("calling recvfrom");
-	sys_recvfrom = (int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(recvfrom);
-	error = sys_recvfrom(fd, data_buf, data_maxlen, 0, (struct sockaddr*)tmpbuf, ctl_len);
+	sys_recvfrom = (int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *))SYS(recvfrom);
+	error = sys_recvfrom(fd, data_buf, data_maxlen, 0, (struct sockaddr __user *)tmpbuf, ctl_len);
 	filp->f_flags = oldflags;
 	if (error < 0)
 		return error;
@@ -838,9 +838,10 @@
 {
 	struct file *filp;
 	struct inode *ino;
-	struct strbuf *ctlptr, *datptr;
+	struct strbuf __user *ctlptr;
+	struct strbuf __user *datptr;
 	struct strbuf ctl, dat;
-	int *flgptr;
+	int __user *flgptr;
 	int flags;
 	int error = -EBADF;
 
@@ -857,9 +858,9 @@
 	if (!ino->i_sock)
 		goto out;
 
-	ctlptr = (struct strbuf *)A(arg1);
-	datptr = (struct strbuf *)A(arg2);
-	flgptr = (int *)A(arg3);
+	ctlptr = (struct strbuf __user *)A(arg1);
+	datptr = (struct strbuf __user *)A(arg2);
+	flgptr = (int __user *)A(arg3);
 
 	error = -EFAULT;
 
@@ -891,8 +892,8 @@
 		goto out;
 	}
 
-	error = timod_getmsg(fd,(char*)A(ctl.buf),ctl.maxlen,&ctlptr->len,
-				(char*)A(dat.buf),dat.maxlen,&datptr->len,&flags);
+	error = timod_getmsg(fd,A(ctl.buf),ctl.maxlen,&ctlptr->len,
+				A(dat.buf),dat.maxlen,&datptr->len,&flags);
 
 	if (!error && put_user(flags,flgptr))
 		error = -EFAULT;
@@ -906,7 +907,8 @@
 {
 	struct file *filp;
 	struct inode *ino;
-	struct strbuf *ctlptr, *datptr;
+	struct strbuf __user *ctlptr;
+	struct strbuf __user *datptr;
 	struct strbuf ctl, dat;
 	int flags = (int) arg3;
 	int error = -EBADF;
@@ -925,8 +927,8 @@
 		(imajor(ino) != 30 || iminor(ino) != 1))
 		goto out;
 
-	ctlptr = (struct strbuf *)A(arg1);
-	datptr = (struct strbuf *)A(arg2);
+	ctlptr = A(arg1);
+	datptr = A(arg2);
 
 	error = -EFAULT;
 
@@ -950,8 +952,8 @@
 		dat.buf = 0;
 	}
 
-	error = timod_putmsg(fd,(char*)A(ctl.buf),ctl.len,
-				(char*)A(dat.buf),dat.len,flags);
+	error = timod_putmsg(fd,A(ctl.buf),ctl.len,
+				A(dat.buf),dat.len,flags);
 out:
 	unlock_kernel();
 	SOLD("done");
diff -Nru a/crypto/cipher.c b/crypto/cipher.c
--- a/crypto/cipher.c	2004-07-27 18:24:51 -07:00
+++ b/crypto/cipher.c	2004-07-27 18:24:51 -07:00
@@ -52,8 +52,8 @@
 {
 	struct scatter_walk walk_in, walk_out;
 	const unsigned int bsize = crypto_tfm_alg_blocksize(tfm);
-	u8 tmp_src[nbytes > src->length ? bsize : 0];
-	u8 tmp_dst[nbytes > dst->length ? bsize : 0];
+	u8 tmp_src[bsize];
+	u8 tmp_dst[bsize];
 
 	if (!nbytes)
 		return 0;
diff -Nru a/drivers/atm/firestream.c b/drivers/atm/firestream.c
--- a/drivers/atm/firestream.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/atm/firestream.c	2004-07-27 18:24:51 -07:00
@@ -1380,7 +1380,7 @@
 
 	if (alignment <= 0x10) {
 		t = kmalloc (size, flags);
-		if ((unsigned int)t & (alignment-1)) {
+		if ((unsigned long)t & (alignment-1)) {
 			printk ("Kmalloc doesn't align things correctly! %p\n", t);
 			kfree (t);
 			return aligned_kmalloc (size, flags, alignment * 4);
diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c
--- a/drivers/block/cciss.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/block/cciss.c	2004-07-27 18:24:52 -07:00
@@ -37,6 +37,7 @@
 #include <linux/init.h> 
 #include <linux/hdreg.h>
 #include <linux/spinlock.h>
+#include <linux/compat.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
@@ -555,12 +556,12 @@
 int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg,
 	struct file *file)
 {
-	IOCTL32_Command_struct *arg32 =
-		(IOCTL32_Command_struct *) arg;
+	IOCTL32_Command_struct __user *arg32 =
+		(IOCTL32_Command_struct __user *) arg;
 	IOCTL_Command_struct arg64;
-	mm_segment_t old_fs;
+	IOCTL_Command_struct __user *p = compat_alloc_user_space(sizeof(arg64));
 	int err;
-	unsigned long cp;
+	u32 cp;
 
 	err = 0;
 	err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
@@ -568,31 +569,30 @@
 	err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info));
 	err |= get_user(arg64.buf_size, &arg32->buf_size);
 	err |= get_user(cp, &arg32->buf);
-	arg64.buf = (BYTE *)cp;
+	arg64.buf = compat_ptr(cp);
+	err |= copy_to_user(p, &arg64, sizeof(arg64));
 
 	if (err)
 		return -EFAULT;
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) &arg64);
-	set_fs(old_fs);
+	err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) p);
 	if (err)
 		return err;
-	err |= copy_to_user(&arg32->error_info, &arg64.error_info, sizeof(&arg32->error_info));
+	err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(&arg32->error_info));
 	if (err)
 		return -EFAULT;
 	return err;
 }
+
 int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg,
 	struct file *file)
 {
-	BIG_IOCTL32_Command_struct *arg32 =
-		(BIG_IOCTL32_Command_struct *) arg;
+	BIG_IOCTL32_Command_struct __user *arg32 =
+		(BIG_IOCTL32_Command_struct __user *) arg;
 	BIG_IOCTL_Command_struct arg64;
-	mm_segment_t old_fs;
+	BIG_IOCTL_Command_struct __user *p = compat_alloc_user_space(sizeof(arg64));
 	int err;
-	unsigned long cp;
+	u32 cp;
 
 	err = 0;
 	err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
@@ -601,18 +601,16 @@
 	err |= get_user(arg64.buf_size, &arg32->buf_size);
 	err |= get_user(arg64.malloc_size, &arg32->malloc_size);
 	err |= get_user(cp, &arg32->buf);
-	arg64.buf = (BYTE *)cp;
+	arg64.buf = compat_ptr(cp);
+	err |= copy_to_user(p, &arg64, sizeof(arg64));
 
 	if (err)
 		 return -EFAULT;
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) &arg64);
-	set_fs(old_fs);
+	err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) p);
 	if (err)
 		return err;
-	err |= copy_to_user(&arg32->error_info, &arg64.error_info, sizeof(&arg32->error_info));
+	err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(&arg32->error_info));
 	if (err)
 		return -EFAULT;
 	return err;
diff -Nru a/drivers/block/paride/bpck6.c b/drivers/block/paride/bpck6.c
--- a/drivers/block/paride/bpck6.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/block/paride/bpck6.c	2004-07-27 18:24:51 -07:00
@@ -41,7 +41,7 @@
 
  
 
-#define PPCSTRUCT(pi) ((PPC *)(pi->private))
+#define PPCSTRUCT(pi) ((Interface *)(pi->private))
 
 /****************************************************************/
 /*
@@ -224,10 +224,10 @@
 
 static int bpck6_init_proto(PIA *pi)
 {
-	PPC *p = kmalloc(sizeof(PPC), GFP_KERNEL);
+	Interface *p = kmalloc(sizeof(Interface), GFP_KERNEL);
 
 	if (p) {
-		memset(p, 0, sizeof(PPC));
+		memset(p, 0, sizeof(Interface));
 		pi->private = (unsigned long)p;
 		return 0;
 	}
diff -Nru a/drivers/block/paride/ppc6lnx.c b/drivers/block/paride/ppc6lnx.c
--- a/drivers/block/paride/ppc6lnx.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/block/paride/ppc6lnx.c	2004-07-27 18:24:51 -07:00
@@ -79,7 +79,7 @@
 	u8	org_data;				// original LPT data port contents
 	u8	org_ctrl;				// original LPT control port contents
 	u8	cur_ctrl;				// current control port contents
-} PPC;
+} Interface;
 
 //***************************************************************************
 
@@ -101,25 +101,25 @@
 
 //***************************************************************************
 
-static int ppc6_select(PPC *ppc);
-static void ppc6_deselect(PPC *ppc);
-static void ppc6_send_cmd(PPC *ppc, u8 cmd);
-static void ppc6_wr_data_byte(PPC *ppc, u8 data);
-static u8 ppc6_rd_data_byte(PPC *ppc);
-static u8 ppc6_rd_port(PPC *ppc, u8 port);
-static void ppc6_wr_port(PPC *ppc, u8 port, u8 data);
-static void ppc6_rd_data_blk(PPC *ppc, u8 *data, long count);
-static void ppc6_wait_for_fifo(PPC *ppc);
-static void ppc6_wr_data_blk(PPC *ppc, u8 *data, long count);
-static void ppc6_rd_port16_blk(PPC *ppc, u8 port, u8 *data, long length);
-static void ppc6_wr_port16_blk(PPC *ppc, u8 port, u8 *data, long length);
-static void ppc6_wr_extout(PPC *ppc, u8 regdata);
-static int ppc6_open(PPC *ppc);
-static void ppc6_close(PPC *ppc);
+static int ppc6_select(Interface *ppc);
+static void ppc6_deselect(Interface *ppc);
+static void ppc6_send_cmd(Interface *ppc, u8 cmd);
+static void ppc6_wr_data_byte(Interface *ppc, u8 data);
+static u8 ppc6_rd_data_byte(Interface *ppc);
+static u8 ppc6_rd_port(Interface *ppc, u8 port);
+static void ppc6_wr_port(Interface *ppc, u8 port, u8 data);
+static void ppc6_rd_data_blk(Interface *ppc, u8 *data, long count);
+static void ppc6_wait_for_fifo(Interface *ppc);
+static void ppc6_wr_data_blk(Interface *ppc, u8 *data, long count);
+static void ppc6_rd_port16_blk(Interface *ppc, u8 port, u8 *data, long length);
+static void ppc6_wr_port16_blk(Interface *ppc, u8 port, u8 *data, long length);
+static void ppc6_wr_extout(Interface *ppc, u8 regdata);
+static int ppc6_open(Interface *ppc);
+static void ppc6_close(Interface *ppc);
 
 //***************************************************************************
 
-static int ppc6_select(PPC *ppc)
+static int ppc6_select(Interface *ppc)
 {
 	u8 i, j, k;
 
@@ -205,7 +205,7 @@
 
 //***************************************************************************
 
-static void ppc6_deselect(PPC *ppc)
+static void ppc6_deselect(Interface *ppc)
 {
 	if (ppc->mode & 4)	// EPP
 		ppc->cur_ctrl |= port_init;
@@ -223,7 +223,7 @@
 
 //***************************************************************************
 
-static void ppc6_send_cmd(PPC *ppc, u8 cmd)
+static void ppc6_send_cmd(Interface *ppc, u8 cmd)
 {
 	switch(ppc->mode)
 	{
@@ -254,7 +254,7 @@
 
 //***************************************************************************
 
-static void ppc6_wr_data_byte(PPC *ppc, u8 data)
+static void ppc6_wr_data_byte(Interface *ppc, u8 data)
 {
 	switch(ppc->mode)
 	{
@@ -285,7 +285,7 @@
 
 //***************************************************************************
 
-static u8 ppc6_rd_data_byte(PPC *ppc)
+static u8 ppc6_rd_data_byte(Interface *ppc)
 {
 	u8 data = 0;
 
@@ -358,7 +358,7 @@
 
 //***************************************************************************
 
-static u8 ppc6_rd_port(PPC *ppc, u8 port)
+static u8 ppc6_rd_port(Interface *ppc, u8 port)
 {
 	ppc6_send_cmd(ppc,(u8)(port | ACCESS_PORT | ACCESS_READ));
 
@@ -367,7 +367,7 @@
 
 //***************************************************************************
 
-static void ppc6_wr_port(PPC *ppc, u8 port, u8 data)
+static void ppc6_wr_port(Interface *ppc, u8 port, u8 data)
 {
 	ppc6_send_cmd(ppc,(u8)(port | ACCESS_PORT | ACCESS_WRITE));
 
@@ -376,7 +376,7 @@
 
 //***************************************************************************
 
-static void ppc6_rd_data_blk(PPC *ppc, u8 *data, long count)
+static void ppc6_rd_data_blk(Interface *ppc, u8 *data, long count)
 {
 	switch(ppc->mode)
 	{
@@ -512,7 +512,7 @@
 
 //***************************************************************************
 
-static void ppc6_wait_for_fifo(PPC *ppc)
+static void ppc6_wait_for_fifo(Interface *ppc)
 {
 	int i;
 
@@ -525,7 +525,7 @@
 
 //***************************************************************************
 
-static void ppc6_wr_data_blk(PPC *ppc, u8 *data, long count)
+static void ppc6_wr_data_blk(Interface *ppc, u8 *data, long count)
 {
 	switch(ppc->mode)
 	{
@@ -644,7 +644,7 @@
 
 //***************************************************************************
 
-static void ppc6_rd_port16_blk(PPC *ppc, u8 port, u8 *data, long length)
+static void ppc6_rd_port16_blk(Interface *ppc, u8 port, u8 *data, long length)
 {
 	length = length << 1;
 
@@ -664,7 +664,7 @@
 
 //***************************************************************************
 
-static void ppc6_wr_port16_blk(PPC *ppc, u8 port, u8 *data, long length)
+static void ppc6_wr_port16_blk(Interface *ppc, u8 port, u8 *data, long length)
 {
 	length = length << 1;
 
@@ -684,7 +684,7 @@
 
 //***************************************************************************
 
-static void ppc6_wr_extout(PPC *ppc, u8 regdata)
+static void ppc6_wr_extout(Interface *ppc, u8 regdata)
 {
 	ppc6_send_cmd(ppc,(REG_VERSION | ACCESS_REG | ACCESS_WRITE));
 
@@ -693,7 +693,7 @@
 
 //***************************************************************************
 
-static int ppc6_open(PPC *ppc)
+static int ppc6_open(Interface *ppc)
 {
 	int ret;
 
@@ -717,7 +717,7 @@
 
 //***************************************************************************
 
-static void ppc6_close(PPC *ppc)
+static void ppc6_close(Interface *ppc)
 {
 	ppc6_deselect(ppc);
 }
diff -Nru a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
--- a/drivers/bluetooth/hci_usb.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/bluetooth/hci_usb.c	2004-07-27 18:24:52 -07:00
@@ -76,14 +76,15 @@
 	/* AVM BlueFRITZ! USB v2.0 */
 	{ USB_DEVICE(0x057c, 0x3800) },
 
-	/* Ericsson with non-standard id */
-	{ USB_DEVICE(0x0bdb, 0x1002) },
+	/* Bluetooth Ultraport Module from IBM */
+	{ USB_DEVICE(0x04bf, 0x030a) },
 
-	/* ALPS Module with non-standard id */
+	/* ALPS Modules with non-standard id */
+	{ USB_DEVICE(0x044e, 0x3001) },
 	{ USB_DEVICE(0x044e, 0x3002) },
 
-	/* Bluetooth Ultraport Module from IBM */
-	{ USB_DEVICE(0x04bf, 0x030a) },
+	/* Ericsson with non-standard id */
+	{ USB_DEVICE(0x0bdb, 0x1002) },
 
 	{ }	/* Terminating entry */
 };
@@ -338,26 +339,18 @@
 
 	BT_DBG("%s", hdev->name);
 
-	for (i=0; i < 4; i++)
+	for (i = 0; i < 4; i++)
 		skb_queue_purge(&husb->transmit_q[i]);
 	return 0;
 }
 
-static inline void hci_usb_wait_for_urb(struct urb *urb)
-{
-	while (atomic_read(&urb->kref.refcount) > 1) {
-		current->state = TASK_UNINTERRUPTIBLE;
-		schedule_timeout((5 * HZ + 999) / 1000);
-	}
-}
-
 static void hci_usb_unlink_urbs(struct hci_usb *husb)
 {
 	int i;
 
 	BT_DBG("%s", husb->hdev->name);
 
-	for (i=0; i < 4; i++) {
+	for (i = 0; i < 4; i++) {
 		struct _urb *_urb;
 		struct urb *urb;
 
@@ -366,8 +359,7 @@
 			urb = &_urb->urb;
 			BT_DBG("%s unlinking _urb %p type %d urb %p", 
 					husb->hdev->name, _urb, _urb->type, urb);
-			usb_unlink_urb(urb);
-			hci_usb_wait_for_urb(urb);
+			usb_kill_urb(urb);
 			_urb_queue_tail(__completed_q(husb, _urb->type), _urb);
 		}
 
diff -Nru a/drivers/char/drm/drm_drv.h b/drivers/char/drm/drm_drv.h
--- a/drivers/char/drm/drm_drv.h	2004-07-27 18:24:52 -07:00
+++ b/drivers/char/drm/drm_drv.h	2004-07-27 18:24:52 -07:00
@@ -1178,7 +1178,7 @@
 	 * agent to request it then we should just be able to
 	 * take it immediately and not eat the ioctl.
 	 */
-	dev->lock.filp = 0;
+	dev->lock.filp = NULL;
 	{
 		__volatile__ unsigned int *plock = &dev->lock.hw_lock->lock;
 		unsigned int old, new, prev, ctx;
diff -Nru a/drivers/char/drm/ffb_context.c b/drivers/char/drm/ffb_context.c
--- a/drivers/char/drm/ffb_context.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/char/drm/ffb_context.c	2004-07-27 18:24:52 -07:00
@@ -358,7 +358,7 @@
 {
 	ffb_dev_priv_t *fpriv = (ffb_dev_priv_t *) dev->dev_private;
 
-#if DRM_DMA_HISTOGRAM
+#ifdef DRM_DMA_HISTOGRAM
         dev->ctx_start = get_cycles();
 #endif
         
@@ -388,7 +388,7 @@
 	int		i;
 
 	DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
-	if (copy_from_user(&res, (drm_ctx_res_t *)arg, sizeof(res)))
+	if (copy_from_user(&res, (drm_ctx_res_t __user *)arg, sizeof(res)))
 		return -EFAULT;
 	if (res.count >= DRM_RESERVED_CONTEXTS) {
 		memset(&ctx, 0, sizeof(ctx));
@@ -401,7 +401,7 @@
 		}
 	}
 	res.count = DRM_RESERVED_CONTEXTS;
-	if (copy_to_user((drm_ctx_res_t *)arg, &res, sizeof(res)))
+	if (copy_to_user((drm_ctx_res_t __user *)arg, &res, sizeof(res)))
 		return -EFAULT;
 	return 0;
 }
@@ -415,7 +415,7 @@
 	drm_ctx_t	ctx;
 	int idx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	idx = DRM(alloc_queue)(dev, (ctx.flags & _DRM_CONTEXT_2DONLY));
 	if (idx < 0)
@@ -423,7 +423,7 @@
 
 	DRM_DEBUG("%d\n", ctx.handle);
 	ctx.handle = idx;
-	if (copy_to_user((drm_ctx_t *)arg, &ctx, sizeof(ctx)))
+	if (copy_to_user((drm_ctx_t __user *)arg, &ctx, sizeof(ctx)))
 		return -EFAULT;
 	return 0;
 }
@@ -438,7 +438,7 @@
 	drm_ctx_t ctx;
 	int idx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 
 	idx = ctx.handle;
@@ -467,7 +467,7 @@
 	drm_ctx_t ctx;
 	int idx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 
 	idx = ctx.handle;
@@ -483,7 +483,7 @@
 	else
 		ctx.flags = 0;
 
-	if (copy_to_user((drm_ctx_t*)arg, &ctx, sizeof(ctx)))
+	if (copy_to_user((drm_ctx_t __user *)arg, &ctx, sizeof(ctx)))
 		return -EFAULT;
 
 	return 0;
@@ -496,7 +496,7 @@
 	drm_device_t	*dev	= priv->dev;
 	drm_ctx_t	ctx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t  __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 	return DRM(context_switch)(dev, dev->last_context, ctx.handle);
@@ -507,7 +507,7 @@
 {
 	drm_ctx_t	ctx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t  __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 
@@ -523,7 +523,7 @@
 	ffb_dev_priv_t	*fpriv	= (ffb_dev_priv_t *) dev->dev_private;
 	int idx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 
diff -Nru a/drivers/char/drm/gamma_old_dma.h b/drivers/char/drm/gamma_old_dma.h
--- a/drivers/char/drm/gamma_old_dma.h	2004-07-27 18:24:52 -07:00
+++ b/drivers/char/drm/gamma_old_dma.h	2004-07-27 18:24:52 -07:00
@@ -122,6 +122,8 @@
 	int		  idx;
 	int		  while_locked = 0;
 	drm_device_dma_t  *dma = dev->dma;
+	int		  *ind;
+	int		  err;
 	DECLARE_WAITQUEUE(entry, current);
 
 	DRM_DEBUG("%d\n", d->send_count);
@@ -168,45 +170,51 @@
 		remove_wait_queue(&q->write_queue, &entry);
 	}
 
+	ind = DRM(alloc)(d->send_count * sizeof(int), DRM_MEM_DRIVER);
+	if (!ind)
+		return -ENOMEM;
+
+	if (copy_from_user(ind, d->send_indices, d->send_count * sizeof(int))) {
+		err = -EFAULT;
+                goto out;
+	}
+
+	err = -EINVAL;
 	for (i = 0; i < d->send_count; i++) {
-		idx = d->send_indices[i];
+		idx = ind[i];
 		if (idx < 0 || idx >= dma->buf_count) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Index %d (of %d max)\n",
-				  d->send_indices[i], dma->buf_count - 1);
-			return -EINVAL;
+				  ind[i], dma->buf_count - 1);
+			goto out;
 		}
 		buf = dma->buflist[ idx ];
 		if (buf->filp != filp) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Process %d using buffer not owned\n",
 				  current->pid);
-			return -EINVAL;
+			goto out;
 		}
 		if (buf->list != DRM_LIST_NONE) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Process %d using buffer %d on list %d\n",
 				  current->pid, buf->idx, buf->list);
+			goto out;
 		}
-		buf->used	  = d->send_sizes[i];
+		buf->used	  = ind[i];
 		buf->while_locked = while_locked;
 		buf->context	  = d->context;
 		if (!buf->used) {
 			DRM_ERROR("Queueing 0 length buffer\n");
 		}
 		if (buf->pending) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Queueing pending buffer:"
 				  " buffer %d, offset %d\n",
-				  d->send_indices[i], i);
-			return -EINVAL;
+				  ind[i], i);
+			goto out;
 		}
 		if (buf->waiting) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Queueing waiting buffer:"
 				  " buffer %d, offset %d\n",
-				  d->send_indices[i], i);
-			return -EINVAL;
+				  ind[i], i);
+			goto out;
 		}
 		buf->waiting = 1;
 		if (atomic_read(&q->use_count) == 1
@@ -220,6 +228,11 @@
 	atomic_dec(&q->use_count);
 
 	return 0;
+
+out:
+	DRM(free)(ind, d->send_count * sizeof(int), DRM_MEM_DRIVER);
+	atomic_dec(&q->use_count);
+	return err;
 }
 
 static int DRM(dma_get_buffers_of_order)(struct file *filp, drm_dma_t *d,
diff -Nru a/drivers/char/genrtc.c b/drivers/char/genrtc.c
--- a/drivers/char/genrtc.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/char/genrtc.c	2004-07-27 18:24:52 -07:00
@@ -469,7 +469,7 @@
 {
 	struct proc_dir_entry *r;
 
-	r = create_proc_read_entry("driver/rtc", 0, 0, gen_rtc_read_proc, NULL);
+	r = create_proc_read_entry("driver/rtc", 0, NULL, gen_rtc_read_proc, NULL);
 	if (!r)
 		return -ENOMEM;
 	return 0;
diff -Nru a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
--- a/drivers/char/ipmi/ipmi_devintf.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/char/ipmi/ipmi_devintf.c	2004-07-27 18:24:52 -07:00
@@ -174,7 +174,7 @@
 {
 	int              rv;
 	struct ipmi_addr addr;
-	unsigned char    *msgdata;
+	struct kernel_ipmi_msg msg;
 
 	if (req->addr_len > sizeof(struct ipmi_addr))
 		return -EINVAL;
@@ -182,8 +182,11 @@
 	if (copy_from_user(&addr, req->addr, req->addr_len))
 		return -EFAULT;
 
-	msgdata = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL);
-	if (!msgdata)
+	msg.netfn = req->msg.netfn;
+	msg.cmd = req->msg.cmd;
+	msg.data_len = req->msg.data_len;
+	msg.data = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL);
+	if (!msg.data)
 		return -ENOMEM;
 
 	/* From here out we cannot return, we must jump to "out" for
@@ -199,7 +202,7 @@
 			goto out;
 		}
 
-		if (copy_from_user(msgdata,
+		if (copy_from_user(msg.data,
 				   req->msg.data,
 				   req->msg.data_len))
 		{
@@ -207,20 +210,19 @@
 			goto out;
 		}
 	} else {
-		req->msg.data_len = 0;
+		msg.data_len = 0;
 	}
-	req->msg.data = msgdata;
 
 	rv = ipmi_request_settime(user,
 				  &addr,
 				  req->msgid,
-				  &(req->msg),
+				  &msg,
 				  NULL,
 				  0,
 				  retries,
 				  retry_time_ms);
  out:
-	kfree(msgdata);
+	kfree(msg.data);
 	return rv;
 }
 
diff -Nru a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
--- a/drivers/char/ipmi/ipmi_msghandler.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/ipmi/ipmi_msghandler.c	2004-07-27 18:24:51 -07:00
@@ -907,7 +907,7 @@
 }
 
 static inline void format_ipmb_msg(struct ipmi_smi_msg   *smi_msg,
-				   struct ipmi_msg       *msg,
+				   struct kernel_ipmi_msg *msg,
 				   struct ipmi_ipmb_addr *ipmb_addr,
 				   long                  msgid,
 				   unsigned char         ipmb_seq,
@@ -949,7 +949,7 @@
 }
 
 static inline void format_lan_msg(struct ipmi_smi_msg   *smi_msg,
-				  struct ipmi_msg       *msg,
+				  struct kernel_ipmi_msg *msg,
 				  struct ipmi_lan_addr  *lan_addr,
 				  long                  msgid,
 				  unsigned char         ipmb_seq,
@@ -993,7 +993,7 @@
 				 ipmi_smi_t           intf,
 				 struct ipmi_addr     *addr,
 				 long                 msgid,
-				 struct ipmi_msg      *msg,
+				 struct kernel_ipmi_msg *msg,
 				 void                 *user_msg_data,
 				 void                 *supplied_smi,
 				 struct ipmi_recv_msg *supplied_recv,
@@ -1335,7 +1335,7 @@
 		goto out_err;
 	}
 
-#if DEBUG_MSGING
+#ifdef DEBUG_MSGING
 	{
 		int m;
 		for (m=0; m<smi_msg->data_size; m++)
@@ -1356,7 +1356,7 @@
 int ipmi_request(ipmi_user_t      user,
 		 struct ipmi_addr *addr,
 		 long             msgid,
-		 struct ipmi_msg  *msg,
+		 struct kernel_ipmi_msg  *msg,
 		 void             *user_msg_data,
 		 int              priority)
 {
@@ -1376,7 +1376,7 @@
 int ipmi_request_settime(ipmi_user_t      user,
 			 struct ipmi_addr *addr,
 			 long             msgid,
-			 struct ipmi_msg  *msg,
+			 struct kernel_ipmi_msg  *msg,
 			 void             *user_msg_data,
 			 int              priority,
 			 int              retries,
@@ -1399,7 +1399,7 @@
 int ipmi_request_supply_msgs(ipmi_user_t          user,
 			     struct ipmi_addr     *addr,
 			     long                 msgid,
-			     struct ipmi_msg      *msg,
+			     struct kernel_ipmi_msg *msg,
 			     void                 *user_msg_data,
 			     void                 *supplied_smi,
 			     struct ipmi_recv_msg *supplied_recv,
@@ -1422,7 +1422,7 @@
 int ipmi_request_with_source(ipmi_user_t      user,
 			     struct ipmi_addr *addr,
 			     long             msgid,
-			     struct ipmi_msg  *msg,
+			     struct kernel_ipmi_msg  *msg,
 			     void             *user_msg_data,
 			     int              priority,
 			     unsigned char    source_address,
@@ -1609,7 +1609,7 @@
 static int
 send_channel_info_cmd(ipmi_smi_t intf, int chan)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg            msg;
 	unsigned char                     data[1];
 	struct ipmi_system_interface_addr si;
 
@@ -2033,7 +2033,7 @@
 		msg->data[10] = ipmb_checksum(&(msg->data[6]), 4);
 		msg->data_size = 11;
 
-#if DEBUG_MSGING
+#ifdef DEBUG_MSGING
 	{
 		int m;
 		printk("Invalid command:");
@@ -2424,7 +2424,7 @@
 	int requeue;
 	int chan;
 
-#if DEBUG_MSGING
+#ifdef DEBUG_MSGING
 	int m;
 	printk("Recv:");
 	for (m=0; m<msg->rsp_size; m++)
@@ -2639,7 +2639,7 @@
 	   MC, which don't get resent. */
 	intf->handlers->sender(intf->send_info, smi_msg, 0);
 
-#if DEBUG_MSGING
+#ifdef DEBUG_MSGING
 	{
 		int m;
 		printk("Resend: ");
@@ -2873,7 +2873,7 @@
 
 static void send_panic_events(char *str)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg            msg;
 	ipmi_smi_t                        intf;
 	unsigned char                     data[16];
 	int                               i;
diff -Nru a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
--- a/drivers/char/ipmi/ipmi_si_intf.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/ipmi/ipmi_si_intf.c	2004-07-27 18:24:51 -07:00
@@ -1132,7 +1132,7 @@
 static int acpi_failure = 0;
 
 /* For GPE-type interrupts. */
-u32 ipmi_acpi_gpe(void *context)
+void ipmi_acpi_gpe(void *context)
 {
 	struct smi_info *smi_info = context;
 	unsigned long   flags;
@@ -1156,7 +1156,6 @@
 	smi_event_handler(smi_info, 0);
  out:
 	spin_unlock_irqrestore(&(smi_info->si_lock), flags);
-	return 0;
 }
 
 static int acpi_gpe_irq_setup(struct smi_info *info)
diff -Nru a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
--- a/drivers/char/ipmi/ipmi_watchdog.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/char/ipmi/ipmi_watchdog.c	2004-07-27 18:24:52 -07:00
@@ -229,7 +229,7 @@
 			      struct ipmi_recv_msg *recv_msg,
 			      int                  *send_heartbeat_now)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg            msg;
 	unsigned char                     data[6];
 	int                               rv;
 	struct ipmi_system_interface_addr addr;
@@ -406,7 +406,7 @@
  
 static int ipmi_heartbeat(void)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg            msg;
 	int                               rv;
 	struct ipmi_system_interface_addr addr;
 
@@ -478,7 +478,7 @@
 
 static void panic_halt_ipmi_heartbeat(void)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg             msg;
 	struct ipmi_system_interface_addr addr;
 
 
diff -Nru a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
--- a/drivers/char/mwave/mwavedd.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/mwave/mwavedd.c	2004-07-27 18:24:51 -07:00
@@ -94,8 +94,8 @@
 	unsigned int retval = 0;
 
 	PRINTK_3(TRACE_MWAVE,
-		"mwavedd::mwave_open, entry inode %x file %x\n",
-		(int) inode, (int) file);
+		"mwavedd::mwave_open, entry inode %p file %p\n",
+		 inode, file);
 	PRINTK_2(TRACE_MWAVE,
 		"mwavedd::mwave_open, exit return retval %x\n", retval);
 
@@ -107,8 +107,8 @@
 	unsigned int retval = 0;
 
 	PRINTK_3(TRACE_MWAVE,
-		"mwavedd::mwave_close, entry inode %x file %x\n",
-		(int) inode, (int) file);
+		"mwavedd::mwave_close, entry inode %p file %p\n",
+		 inode,  file);
 
 	PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_close, exit retval %x\n",
 		retval);
@@ -124,8 +124,8 @@
 	void __user *arg = (void __user *)ioarg;
 
 	PRINTK_5(TRACE_MWAVE,
-		"mwavedd::mwave_ioctl, entry inode %x file %x cmd %x arg %x\n",
-		(int) inode, (int) file, iocmd, (int) ioarg);
+		"mwavedd::mwave_ioctl, entry inode %p file %p cmd %x arg %x\n",
+		 inode,  file, iocmd, (int) ioarg);
 
 	switch (iocmd) {
 
@@ -389,7 +389,7 @@
                           loff_t * ppos)
 {
 	PRINTK_5(TRACE_MWAVE,
-		"mwavedd::mwave_read entry file %p, buf %p, count %x ppos %p\n",
+		"mwavedd::mwave_read entry file %p, buf %p, count %zx ppos %p\n",
 		file, buf, count, ppos);
 
 	return -EINVAL;
@@ -401,7 +401,7 @@
 {
 	PRINTK_5(TRACE_MWAVE,
 		"mwavedd::mwave_write entry file %p, buf %p,"
-		" count %x ppos %p\n",
+		" count %zx ppos %p\n",
 		file, buf, count, ppos);
 
 	return -EINVAL;
diff -Nru a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c
--- a/drivers/char/mwave/tp3780i.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/mwave/tp3780i.c	2004-07-27 18:24:51 -07:00
@@ -99,7 +99,7 @@
 static irqreturn_t UartInterrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	PRINTK_3(TRACE_TP3780I,
-		"tp3780i::UartInterrupt entry irq %x dev_id %x\n", irq, (int) dev_id);
+		"tp3780i::UartInterrupt entry irq %x dev_id %p\n", irq, dev_id);
 	return IRQ_HANDLED;
 }
 
@@ -111,7 +111,7 @@
 	unsigned short usIPCSource = 0, usIsolationMask, usPCNum;
 
 	PRINTK_3(TRACE_TP3780I,
-		"tp3780i::DspInterrupt entry irq %x dev_id %x\n", irq, (int) dev_id);
+		"tp3780i::DspInterrupt entry irq %x dev_id %p\n", irq, dev_id);
 
 	if (dsp3780I_GetIPCSource(usDspBaseIO, &usIPCSource) == 0) {
 		PRINTK_2(TRACE_TP3780I,
@@ -368,14 +368,14 @@
 	pSettings->bPllBypass = TP_CFG_PllBypass;
 	pSettings->usChipletEnable = TP_CFG_ChipletEnable;
 
-	if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart", 0)) {
+	if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart", NULL)) {
 		PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings->usUartIrq);
 		goto exit_cleanup;
 	} else {		/* no conflict just release */
 		free_irq(pSettings->usUartIrq, NULL);
 	}
 
-	if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", 0)) {
+	if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", NULL)) {
 		PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->usDspIrq);
 		goto exit_cleanup;
 	} else {
diff -Nru a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
--- a/drivers/char/n_hdlc.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/n_hdlc.c	2004-07-27 18:24:51 -07:00
@@ -294,7 +294,7 @@
 #endif
 		tty->disc_data = NULL;
 		if (tty == n_hdlc->backup_tty)
-			n_hdlc->backup_tty = 0;
+			n_hdlc->backup_tty = NULL;
 		if (tty != n_hdlc->tty)
 			return;
 		if (n_hdlc->backup_tty) {
@@ -829,7 +829,7 @@
 	struct n_hdlc *n_hdlc = kmalloc(sizeof(*n_hdlc), GFP_KERNEL);
 
 	if (!n_hdlc)
-		return 0;
+		return NULL;
 
 	memset(n_hdlc, 0, sizeof(*n_hdlc));
 
diff -Nru a/drivers/char/n_tty.c b/drivers/char/n_tty.c
--- a/drivers/char/n_tty.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/n_tty.c	2004-07-27 18:24:51 -07:00
@@ -62,17 +62,12 @@
 
 static inline unsigned char *alloc_buf(void)
 {
-	unsigned char *p;
 	int prio = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
 
-	if (PAGE_SIZE != N_TTY_BUF_SIZE) {
-		p = kmalloc(N_TTY_BUF_SIZE, prio);
-		if (p)
-			memset(p, 0, N_TTY_BUF_SIZE);
-	} else
-		p = (unsigned char *)get_zeroed_page(prio);
-
-	return p;
+	if (PAGE_SIZE != N_TTY_BUF_SIZE)
+		return kmalloc(N_TTY_BUF_SIZE, prio);
+	else
+		return (unsigned char *)__get_free_page(prio);
 }
 
 static inline void free_buf(unsigned char *buf)
diff -Nru a/drivers/char/nvram.c b/drivers/char/nvram.c
--- a/drivers/char/nvram.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/nvram.c	2004-07-27 18:24:51 -07:00
@@ -467,7 +467,7 @@
 		    NVRAM_MINOR);
 		goto out;
 	}
-	if (!create_proc_read_entry("driver/nvram", 0, 0, nvram_read_proc,
+	if (!create_proc_read_entry("driver/nvram", 0, NULL, nvram_read_proc,
 		NULL)) {
 		printk(KERN_ERR "nvram: can't create /proc/driver/nvram\n");
 		ret = -ENOMEM;
@@ -485,7 +485,7 @@
 static void __exit
 nvram_cleanup_module(void)
 {
-	remove_proc_entry("driver/nvram", 0);
+	remove_proc_entry("driver/nvram", NULL);
 	misc_deregister(&nvram_dev);
 }
 
diff -Nru a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
--- a/drivers/char/pcmcia/synclink_cs.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/pcmcia/synclink_cs.c	2004-07-27 18:24:51 -07:00
@@ -257,6 +257,11 @@
     
 #define CHA     0x00   /* channel A offset */
 #define CHB     0x40   /* channel B offset */
+
+/*
+ *  FIXME: PPC has PVR defined in asm/reg.h.  For now we just undef it.
+ */
+#undef PVR
     
 #define RXFIFO  0
 #define TXFIFO  0
diff -Nru a/drivers/char/sonypi.h b/drivers/char/sonypi.h
--- a/drivers/char/sonypi.h	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/sonypi.h	2004-07-27 18:24:51 -07:00
@@ -336,7 +336,7 @@
 	{ SONYPI_DEVICE_MODEL_TYPE2, 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
 	{ SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev },
 
-	{ 0, 0, 0, 0 }
+	{ 0 }
 };
 
 #define SONYPI_BUF_SIZE	128
diff -Nru a/drivers/char/synclink.c b/drivers/char/synclink.c
--- a/drivers/char/synclink.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/synclink.c	2004-07-27 18:24:51 -07:00
@@ -1873,7 +1873,7 @@
 
 	if (info->xmit_buf) {
 		free_page((unsigned long) info->xmit_buf);
-		info->xmit_buf = 0;
+		info->xmit_buf = NULL;
 	}
 
 	spin_lock_irqsave(&info->irq_spinlock,flags);
@@ -3260,7 +3260,7 @@
 	shutdown(info);
 	
 	tty->closing = 0;
-	info->tty = 0;
+	info->tty = NULL;
 	
 	if (info->blocked_open) {
 		if (info->close_delay) {
@@ -3381,7 +3381,7 @@
 	
 	info->count = 0;	
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 
 	wake_up_interruptible(&info->open_wait);
 	
@@ -3592,7 +3592,7 @@
 cleanup:			
 	if (retval) {
 		if (tty->count == 1)
-			info->tty = 0; /* tty layer will release tty struct */
+			info->tty = NULL;/* tty layer will release tty struct */
 		if(info->count)
 			info->count--;
 	}
@@ -4341,11 +4341,11 @@
 	}
 	if (info->memory_base){
 		iounmap(info->memory_base);
-		info->memory_base = 0;
+		info->memory_base = NULL;
 	}
 	if (info->lcr_base){
 		iounmap(info->lcr_base - info->lcr_offset);
-		info->lcr_base = 0;
+		info->lcr_base = NULL;
 	}
 	
 	if ( debug_level >= DEBUG_LEVEL_INFO )
diff -Nru a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
--- a/drivers/char/synclinkmp.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/synclinkmp.c	2004-07-27 18:24:51 -07:00
@@ -361,6 +361,10 @@
 #define TMCS	0x64
 #define TEPR	0x65
 
+/*
+ *  FIXME: DAR here clashed with asm-ppc/reg.h and asm-sh/.../dma.h
+ */
+#undef DAR
 /* DMA Controller Register macros */
 #define DAR	0x80
 #define DARL	0x80
@@ -796,7 +800,7 @@
 cleanup:
 	if (retval) {
 		if (tty->count == 1)
-			info->tty = 0; /* tty layer will release tty struct */
+			info->tty = NULL;/* tty layer will release tty struct */
 		if(info->count)
 			info->count--;
 	}
@@ -871,7 +875,7 @@
 	shutdown(info);
 
 	tty->closing = 0;
-	info->tty = 0;
+	info->tty = NULL;
 
 	if (info->blocked_open) {
 		if (info->close_delay) {
@@ -910,7 +914,7 @@
 
 	info->count = 0;
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 
 	wake_up_interruptible(&info->open_wait);
 }
@@ -2607,7 +2611,7 @@
 
 	if (info->tx_buf) {
 		kfree(info->tx_buf);
-		info->tx_buf = 0;
+		info->tx_buf = NULL;
 	}
 
 	spin_lock_irqsave(&info->lock,flags);
@@ -3548,22 +3552,22 @@
 
 	if (info->memory_base){
 		iounmap(info->memory_base);
-		info->memory_base = 0;
+		info->memory_base = NULL;
 	}
 
 	if (info->sca_base) {
 		iounmap(info->sca_base - info->sca_offset);
-		info->sca_base=0;
+		info->sca_base=NULL;
 	}
 
 	if (info->statctrl_base) {
 		iounmap(info->statctrl_base - info->statctrl_offset);
-		info->statctrl_base=0;
+		info->statctrl_base=NULL;
 	}
 
 	if (info->lcr_base){
 		iounmap(info->lcr_base - info->lcr_offset);
-		info->lcr_base = 0;
+		info->lcr_base = NULL;
 	}
 
 	if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -5143,7 +5147,7 @@
 	u32 speed = info->params.clock_speed;
 
 	info->params.clock_speed = 3686400;
-	info->tty = 0;
+	info->tty = NULL;
 
 	/* assume failure */
 	info->init_error = DiagStatus_DmaFailure;
diff -Nru a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c
--- a/drivers/char/tpqic02.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/char/tpqic02.c	2004-07-27 18:24:51 -07:00
@@ -898,7 +898,7 @@
 		printk(TPQIC02_NAME ": ll_do_qic_cmd(%x, %ld) failed\n", cmd, (long) timeout);
 		return -EIO;
 	}
-#if OBSOLETE
+#ifdef OBSOLETE
 	/* wait for ready since it may not be active immediately after reading status */
 	while ((inb_p(QIC02_STAT_PORT) & QIC02_STAT_READY) != 0)
 		cpu_relax();
@@ -1419,7 +1419,7 @@
 		if (stat != TE_OK)
 			return stat;
 
-#if OBSOLETE
+#ifdef OBSOLETE
 		/************* not needed iff rd_status() would wait for ready!!!!!! **********/
 		if (wait_for_ready(TIM_S) != TE_OK) {	/*** not sure this is needed ***/
 			tpqputs(TPQD_ALWAYS, "wait_for_ready failed in start_dma");
@@ -2589,7 +2589,7 @@
 	release_region(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
 	if (buffaddr)
 		free_pages((unsigned long) buffaddr, get_order(TPQBUF_SIZE));
-	buffaddr = 0;		/* Better to cause a panic than overwite someone else */
+	buffaddr = NULL;	/* Better to cause a panic than overwite someone else */
 	status_zombie = YES;
 }				/* qic02_release_resources */
 
diff -Nru a/drivers/fc4/soc.c b/drivers/fc4/soc.c
--- a/drivers/fc4/soc.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/fc4/soc.c	2004-07-27 18:24:51 -07:00
@@ -714,7 +714,7 @@
 static int __init soc_probe(void)
 {
 	struct sbus_bus *sbus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	struct soc *s;
 	int cards = 0;
 
diff -Nru a/drivers/fc4/socal.c b/drivers/fc4/socal.c
--- a/drivers/fc4/socal.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/fc4/socal.c	2004-07-27 18:24:51 -07:00
@@ -851,7 +851,7 @@
 static int __init socal_probe(void)
 {
 	struct sbus_bus *sbus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	struct socal *s;
 	int cards = 0;
 
diff -Nru a/drivers/ide/Kconfig b/drivers/ide/Kconfig
--- a/drivers/ide/Kconfig	2004-07-27 18:24:51 -07:00
+++ b/drivers/ide/Kconfig	2004-07-27 18:24:51 -07:00
@@ -753,7 +753,7 @@
 
 config BLK_DEV_IDE_PMAC
 	bool "Builtin PowerMac IDE support"
-	depends on PPC_PMAC
+	depends on PPC_PMAC && IDE=y
 	help
 	  This driver provides support for the built-in IDE controller on
 	  most of the recent Apple Power Macintoshes and PowerBooks.
diff -Nru a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
--- a/drivers/ieee1394/dv1394.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/ieee1394/dv1394.c	2004-07-27 18:24:52 -07:00
@@ -2518,7 +2518,7 @@
 	if (file->f_op->ioctl != dv1394_ioctl)
 		return -EFAULT;
 
-	if (copy_from_user(&dv32, (void *)arg, sizeof(dv32)))
+	if (copy_from_user(&dv32, (void __user *)arg, sizeof(dv32)))
 		return -EFAULT;
 
 	dv.api_version = dv32.api_version;
@@ -2568,7 +2568,7 @@
 		dv32.n_clear_frames = dv.n_clear_frames;
 		dv32.dropped_frames = dv.dropped_frames;
 
-		if (copy_to_user((struct dv1394_status32 *)arg, &dv32, sizeof(dv32)))
+		if (copy_to_user((struct dv1394_status32 __user *)arg, &dv32, sizeof(dv32)))
 			ret = -EFAULT;
 	}
 
diff -Nru a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
--- a/drivers/ieee1394/eth1394.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/ieee1394/eth1394.c	2004-07-27 18:24:52 -07:00
@@ -290,6 +290,20 @@
 	return 0;
 }
 
+static inline void purge_partial_datagram(struct list_head *old)
+{
+	struct partial_datagram *pd = list_entry(old, struct partial_datagram, list);
+	struct list_head *lh, *n;
+
+	list_for_each_safe(lh, n, &pd->frag_info) {
+		struct fragment_info *fi = list_entry(lh, struct fragment_info, list);
+		list_del(lh);
+		kfree(fi);
+	}
+	list_del(old);
+	kfree_skb(pd->skb);
+	kfree(pd);
+}
 
 /******************************************
  * 1394 bus activity functions
@@ -1079,21 +1093,6 @@
 	list_add(lh, pdgl);
 
 	return 0;
-}
-
-static inline void purge_partial_datagram(struct list_head *old)
-{
-	struct partial_datagram *pd = list_entry(old, struct partial_datagram, list);
-	struct list_head *lh, *n;
-
-	list_for_each_safe(lh, n, &pd->frag_info) {
-		struct fragment_info *fi = list_entry(lh, struct fragment_info, list);
-		list_del(lh);
-		kfree(fi);
-	}
-	list_del(old);
-	kfree_skb(pd->skb);
-	kfree(pd);
 }
 
 static inline int is_datagram_complete(struct list_head *lh, int dg_size)
diff -Nru a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
--- a/drivers/ieee1394/raw1394.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/ieee1394/raw1394.c	2004-07-27 18:24:51 -07:00
@@ -55,13 +55,8 @@
 #include "raw1394.h"
 #include "raw1394-private.h"
 
-#if BITS_PER_LONG == 64
-#define int2ptr(x) ((void __user *)x)
+#define int2ptr(x) ((void __user *)(unsigned long)x)
 #define ptr2int(x) ((u64)(unsigned long)(void __user *)x)
-#else
-#define int2ptr(x) ((void __user *)(u32)x)
-#define ptr2int(x) ((u64)(unsigned long)(void __user *)x)
-#endif
 
 #ifdef CONFIG_IEEE1394_VERBOSEDEBUG
 #define RAW1394_DEBUG
@@ -1629,7 +1624,7 @@
         if (another_host) {
                 DBGMSG("another hosts entry is valid -> SUCCESS");
                 if (copy_to_user(int2ptr(req->req.recvb),
-                        int2ptr(&addr->start),sizeof(u64))) {
+                        &addr->start,sizeof(u64))) {
                         printk(KERN_ERR "raw1394: arm_register failed "
                               " address-range-entry is invalid -> EFAULT !!!\n");
                         vfree(addr->addr_space_buffer);
diff -Nru a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
--- a/drivers/ieee1394/video1394.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/ieee1394/video1394.c	2004-07-27 18:24:51 -07:00
@@ -1003,11 +1003,9 @@
 	case VIDEO1394_IOC_TALK_QUEUE_BUFFER:
 	{
 		struct video1394_wait v;
-		struct video1394_queue_variable qv;
+		unsigned int *psizes = NULL;
 		struct dma_iso_ctx *d;
 
-		qv.packet_sizes = NULL;
-
 		if (copy_from_user(&v, argp, sizeof(v)))
 			return -EFAULT;
 
@@ -1021,22 +1019,21 @@
 		}
 
 		if (d->flags & VIDEO1394_VARIABLE_PACKET_SIZE) {
-			unsigned int *psizes;
 			int buf_size = d->nb_cmd * sizeof(unsigned int);
+			struct video1394_queue_variable __user *p = argp;
+			unsigned int __user *qv;
 
-			if (copy_from_user(&qv, argp, sizeof(qv)))
+			if (get_user(qv, &p->packet_sizes))
 				return -EFAULT;
 
 			psizes = kmalloc(buf_size, GFP_KERNEL);
 			if (!psizes)
 				return -ENOMEM;
 
-			if (copy_from_user(psizes, qv.packet_sizes, buf_size)) {
+			if (copy_from_user(psizes, qv, buf_size)) {
 				kfree(psizes);
 				return -EFAULT;
 			}
-
-			qv.packet_sizes = psizes;
 		}
 
 		spin_lock_irqsave(&d->lock,flags);
@@ -1045,14 +1042,14 @@
 			PRINT(KERN_ERR, ohci->host->id,
 			      "Buffer %d is already used",v.buffer);
 			spin_unlock_irqrestore(&d->lock,flags);
-			if (qv.packet_sizes)
-				kfree(qv.packet_sizes);
+			if (psizes)
+				kfree(psizes);
 			return -EFAULT;
 		}
 
 		if (d->flags & VIDEO1394_VARIABLE_PACKET_SIZE) {
 			initialize_dma_it_prg_var_packet_queue(
-				d, v.buffer, qv.packet_sizes,
+				d, v.buffer, psizes,
 				ohci);
 		}
 
@@ -1101,8 +1098,8 @@
 			}
 		}
 
-		if (qv.packet_sizes)
-			kfree(qv.packet_sizes);
+		if (psizes)
+			kfree(psizes);
 
 		return 0;
 
@@ -1339,6 +1336,7 @@
 static int video1394_wr_wait32(unsigned int fd, unsigned int cmd, unsigned long arg,
 			       struct file *file)
 {
+        struct video1394_wait32 __user *argp = (void __user *)arg;
         struct video1394_wait32 wait32;
         struct video1394_wait wait;
         mm_segment_t old_fs;
@@ -1347,7 +1345,7 @@
 	if (file->f_op->ioctl != video1394_ioctl)
 		return -EFAULT;
 
-        if (copy_from_user(&wait32, (void *)arg, sizeof(wait32)))
+        if (copy_from_user(&wait32, argp, sizeof(wait32)))
                 return -EFAULT;
 
         wait.channel = wait32.channel;
@@ -1373,7 +1371,7 @@
                 wait32.filltime.tv_sec = (int)wait.filltime.tv_sec;
                 wait32.filltime.tv_usec = (int)wait.filltime.tv_usec;
 
-                if (copy_to_user((struct video1394_wait32 *)arg, &wait32, sizeof(wait32)))
+                if (copy_to_user(argp, &wait32, sizeof(wait32)))
                         ret = -EFAULT;
         }
 
@@ -1391,7 +1389,7 @@
 	if (file->f_op->ioctl != video1394_ioctl)
 		return -EFAULT;
 
-        if (copy_from_user(&wait32, (void *)arg, sizeof(wait32)))
+        if (copy_from_user(&wait32, (void __user *)arg, sizeof(wait32)))
                 return -EFAULT;
 
         wait.channel = wait32.channel;
diff -Nru a/drivers/ieee1394/video1394.h b/drivers/ieee1394/video1394.h
--- a/drivers/ieee1394/video1394.h	2004-07-27 18:24:52 -07:00
+++ b/drivers/ieee1394/video1394.h	2004-07-27 18:24:52 -07:00
@@ -53,7 +53,7 @@
 struct video1394_queue_variable {
 	unsigned int channel;
 	unsigned int buffer;
-	unsigned int* packet_sizes; /* Buffer of size:
+	unsigned int __user * packet_sizes; /* Buffer of size:
 				       buf_size / packet_size  */
 };
 
diff -Nru a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
--- a/drivers/input/joystick/analog.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/input/joystick/analog.c	2004-07-27 18:24:52 -07:00
@@ -158,11 +158,11 @@
 
         return count;
 }
-#elif __x86_64__
+#elif defined(__x86_64__)
 #define GET_TIME(x)	rdtscl(x)
 #define DELTA(x,y)	((y)-(x))
 #define TIME_NAME	"TSC"
-#elif __alpha__
+#elif defined(__alpha__)
 #define GET_TIME(x)	do { x = get_cycles(); } while (0)
 #define DELTA(x,y)	((y)-(x))
 #define TIME_NAME	"PCC"
diff -Nru a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c
--- a/drivers/input/keyboard/sunkbd.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/input/keyboard/sunkbd.c	2004-07-27 18:24:51 -07:00
@@ -81,8 +81,8 @@
 	char name[64];
 	char phys[32];
 	char type;
-	volatile char reset;
-	volatile char layout;
+	volatile s8 reset;
+	volatile s8 layout;
 };
 
 /*
diff -Nru a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
--- a/drivers/input/mouse/pc110pad.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/input/mouse/pc110pad.c	2004-07-27 18:24:51 -07:00
@@ -98,9 +98,9 @@
 	if (pc110pad_used++)
 		return 0;
 
-	pc110pad_interrupt(0,0,0);
-	pc110pad_interrupt(0,0,0);
-	pc110pad_interrupt(0,0,0);
+	pc110pad_interrupt(0,NULL,NULL);
+	pc110pad_interrupt(0,NULL,NULL);
+	pc110pad_interrupt(0,NULL,NULL);
 	outb(PC110PAD_ON, pc110pad_io + 2);
 	pc110pad_count = 0;
 
@@ -117,7 +117,7 @@
 
 	outb(PC110PAD_OFF, pc110pad_io + 2);
 
-	if (request_irq(pc110pad_irq, pc110pad_interrupt, 0, "pc110pad", 0))
+	if (request_irq(pc110pad_irq, pc110pad_interrupt, 0, "pc110pad", NULL))
 	{
 		release_region(pc110pad_io, 4);
 		printk(KERN_ERR "pc110pad: Unable to get irq %d.\n", pc110pad_irq);
@@ -155,7 +155,7 @@
 
 	outb(PC110PAD_OFF, pc110pad_io + 2);
 
-	free_irq(pc110pad_irq, 0);
+	free_irq(pc110pad_irq, NULL);
 	release_region(pc110pad_io, 4);
 }
 
diff -Nru a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig
--- a/drivers/isdn/hisax/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/drivers/isdn/hisax/Kconfig	2004-07-27 18:24:52 -07:00
@@ -110,7 +110,7 @@
 
 config HISAX_TELESPCI
 	bool "Teles PCI"
-	depends on PCI && (BROKEN || !SPARC64)
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the Teles PCI.
 	  See <file:Documentation/isdn/README.HiSax> on how to configure it.
@@ -237,7 +237,7 @@
 
 config HISAX_NETJET
 	bool "NETjet card"
-	depends on PCI && (BROKEN || !SPARC64)
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the NetJet from Traverse
 	  Technologies.
@@ -248,7 +248,7 @@
 
 config HISAX_NETJET_U
 	bool "NETspider U card"
-	depends on PCI && (BROKEN || !SPARC64)
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the Netspider U interface ISDN card
 	  from Traverse Technologies.
@@ -316,7 +316,7 @@
 
 config HISAX_HFC_PCI
 	bool "HFC PCI-Bus cards"
-	depends on PCI && (BROKEN || !SPARC64)
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the HFC-S PCI 2BDS0 based cards.
 
@@ -343,7 +343,7 @@
 
 config HISAX_ENTERNOW_PCI
 	bool "Formula-n enter:now PCI card"
-	depends on PCI && (BROKEN || !SPARC64)
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the Formula-n enter:now PCI
 	  ISDN card.
diff -Nru a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c
--- a/drivers/isdn/hisax/hfc_2bds0.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/isdn/hisax/hfc_2bds0.c	2004-07-27 18:24:51 -07:00
@@ -40,7 +40,7 @@
 			byteout(cs->hw.hfcD.addr | 1, reg);
 		}
 		ret = bytein(cs->hw.hfcD.addr);
-#if HFC_REG_DEBUG
+#ifdef HFC_REG_DEBUG
 		if (cs->debug & L1_DEB_HSCX_FIFO && (data != 2))
 			debugl1(cs, "t3c RD %02x %02x", reg, ret);
 #endif
@@ -58,7 +58,7 @@
 	}
 	if (data)
 		byteout(cs->hw.hfcD.addr, value);
-#if HFC_REG_DEBUG
+#ifdef HFC_REG_DEBUG
 	if (cs->debug & L1_DEB_HSCX_FIFO && (data != HFCD_DATA_NODEB))
 		debugl1(cs, "t3c W%c %02x %02x", data ? 'D' : 'C', reg, value);
 #endif
diff -Nru a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c
--- a/drivers/isdn/hisax/netjet.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/isdn/hisax/netjet.c	2004-07-27 18:24:51 -07:00
@@ -701,8 +701,8 @@
 		}
 		bcs->hw.tiger.s_tot += s_cnt;
 		if (bcs->cs->debug & L1_DEB_HSCX)
-			debugl1(bcs->cs,"tiger write_raw: c%d %x-%x %d/%d %d %x", bcs->channel,
-				(u_int)buf, (u_int)p, s_cnt, cnt,
+			debugl1(bcs->cs,"tiger write_raw: c%d %p-%p %d/%d %d %x", bcs->channel,
+				buf, p, s_cnt, cnt,
 				bcs->hw.tiger.sendcnt, bcs->cs->hw.njet.irqstat0);
 		if (bcs->cs->debug & L1_DEB_HSCX_FIFO)
 			printframe(bcs->cs, bcs->hw.tiger.sp, s_cnt, "snd");
@@ -931,8 +931,8 @@
 	cs->bcs[1].hw.tiger.s_end = cs->bcs[0].hw.tiger.s_end;
 	
 	memset(cs->bcs[0].hw.tiger.send, 0xff, NETJET_DMA_TXSIZE * sizeof(unsigned int));
-	debugl1(cs, "tiger: send buf %x - %x", (u_int)cs->bcs[0].hw.tiger.send,
-		(u_int)(cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE - 1));
+	debugl1(cs, "tiger: send buf %p - %p", cs->bcs[0].hw.tiger.send,
+		cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE - 1);
 	outl(virt_to_bus(cs->bcs[0].hw.tiger.send),
 		cs->hw.njet.base + NETJET_DMA_READ_START);
 	outl(virt_to_bus(cs->bcs[0].hw.tiger.s_irq),
@@ -945,8 +945,8 @@
 		       "HiSax: No memory for tiger.rec\n");
 		return;
 	}
-	debugl1(cs, "tiger: rec buf %x - %x", (u_int)cs->bcs[0].hw.tiger.rec,
-		(u_int)(cs->bcs[0].hw.tiger.rec + NETJET_DMA_RXSIZE - 1));
+	debugl1(cs, "tiger: rec buf %p - %p", cs->bcs[0].hw.tiger.rec,
+		cs->bcs[0].hw.tiger.rec + NETJET_DMA_RXSIZE - 1);
 	cs->bcs[1].hw.tiger.rec = cs->bcs[0].hw.tiger.rec;
 	memset(cs->bcs[0].hw.tiger.rec, 0xff, NETJET_DMA_RXSIZE * sizeof(unsigned int));
 	outl(virt_to_bus(cs->bcs[0].hw.tiger.rec),
diff -Nru a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c
--- a/drivers/isdn/hisax/st5481_d.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/isdn/hisax/st5481_d.c	2004-07-27 18:24:51 -07:00
@@ -623,7 +623,7 @@
 	st5481_usb_device_ctrl_msg(adapter, FFMSK_D, 0xfc, NULL, NULL);
 	st5481_in_mode(d_in, L1_MODE_HDLC);
 
-#if LOOPBACK
+#ifdef LOOPBACK
 	// Turn loopback on (data sent on B and D looped back)
 	st5481_usb_device_ctrl_msg(cs, LBB, 0x04, NULL, NULL);
 #endif
diff -Nru a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
--- a/drivers/isdn/i4l/isdn_net.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/isdn/i4l/isdn_net.c	2004-07-27 18:24:53 -07:00
@@ -1432,7 +1432,7 @@
 	unsigned long expires = 0;
 	int tmp = 0;
 	int period = lp->cisco_keepalive_period;
-	char debserint = lp->cisco_debserint;
+	s8 debserint = lp->cisco_debserint;
 	int rc = 0;
 
 	if (lp->p_encap != ISDN_NET_ENCAP_CISCOHDLCK)
diff -Nru a/drivers/isdn/pcbit/Kconfig b/drivers/isdn/pcbit/Kconfig
--- a/drivers/isdn/pcbit/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/drivers/isdn/pcbit/Kconfig	2004-07-27 18:24:52 -07:00
@@ -3,7 +3,7 @@
 #
 config ISDN_DRV_PCBIT
 	tristate "PCBIT-D support"
-	depends on ISDN_I4L && ISA
+	depends on ISDN_I4L && ISA && (BROKEN || !PPC)
 	help
 	  This enables support for the PCBIT ISDN-card.  This card is
 	  manufactured in Portugal by Octal.  For running this card,
diff -Nru a/drivers/isdn/tpam/tpam_memory.c b/drivers/isdn/tpam/tpam_memory.c
--- a/drivers/isdn/tpam/tpam_memory.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/isdn/tpam/tpam_memory.c	2004-07-27 18:24:51 -07:00
@@ -30,7 +30,7 @@
 	       card->bar0 + TPAM_PAGE_REGISTER);
 
 	/* write the value */
-	writel(val, card->bar0 + (((u32)addr) & TPAM_PAGE_SIZE));
+	writel(val, card->bar0 + (((unsigned long)addr) & TPAM_PAGE_SIZE));
 }
 
 /*
diff -Nru a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
--- a/drivers/macintosh/adb.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/macintosh/adb.c	2004-07-27 18:24:53 -07:00
@@ -561,7 +561,7 @@
 			write_lock_irq(&adb_handler_lock);
 		}
 		ret = 0;
-		adb_handler[index].handler = 0;
+		adb_handler[index].handler = NULL;
 	}
 	write_unlock_irq(&adb_handler_lock);
 	up(&adb_handler_sem);
diff -Nru a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
--- a/drivers/macintosh/adbhid.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/macintosh/adbhid.c	2004-07-27 18:24:53 -07:00
@@ -102,7 +102,7 @@
 #define FLAG_POWER_FROM_FN	0x00000002
 #define FLAG_EMU_FWDEL_DOWN	0x00000004
 
-static struct adbhid *adbhid[16] = { 0 };
+static struct adbhid *adbhid[16];
 
 static void adbhid_probe(void);
 
@@ -689,7 +689,7 @@
 	if (adbhid[id]->keycode)
 		kfree(adbhid[id]->keycode);
 	kfree(adbhid[id]);
-	adbhid[id] = 0;
+	adbhid[id] = NULL;
 }
 
 
diff -Nru a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
--- a/drivers/macintosh/ans-lcd.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/macintosh/ans-lcd.c	2004-07-27 18:24:53 -07:00
@@ -49,10 +49,10 @@
 }
 
 static ssize_t __pmac
-anslcd_write( struct file * file, const char * buf, 
+anslcd_write( struct file * file, const char __user * buf, 
 				size_t count, loff_t *ppos )
 {
-	const char * p = buf;
+	const char __user *p = buf;
 	int i;
 
 #ifdef DEBUG
@@ -75,7 +75,7 @@
 anslcd_ioctl( struct inode * inode, struct file * file,
 				unsigned int cmd, unsigned long arg )
 {
-	char ch, *temp;
+	char ch, __user *temp;
 
 #ifdef DEBUG
 	printk(KERN_DEBUG "LCD: ioctl(%d,%d)\n",cmd,arg);
@@ -91,7 +91,7 @@
 		anslcd_write_byte_ctrl ( 0x02 );
 		return 0;
 	case ANSLCD_SENDCTRL:
-		temp = (char *) arg;
+		temp = (char __user *) arg;
 		__get_user(ch, temp);
 		for (; ch; temp++) { /* FIXME: This is ugly, but should work, as a \0 byte is not a valid command code */
 			anslcd_write_byte_ctrl ( ch );
diff -Nru a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
--- a/drivers/macintosh/macio-adb.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/macintosh/macio-adb.c	2004-07-27 18:24:53 -07:00
@@ -175,7 +175,7 @@
 		req->data[i] = req->data[i+1];
 	--req->nbytes;
 	
-	req->next = 0;
+	req->next = NULL;
 	req->sent = 0;
 	req->complete = 0;
 	req->reply_len = 0;
@@ -280,6 +280,6 @@
 
 	local_irq_save(flags);
 	if (in_8(&adb->intr.r) != 0)
-		macio_adb_interrupt(0, 0, 0);
+		macio_adb_interrupt(0, NULL, NULL);
 	local_irq_restore(flags);
 }
diff -Nru a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
--- a/drivers/macintosh/via-cuda.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/macintosh/via-cuda.c	2004-07-27 18:24:51 -07:00
@@ -386,7 +386,7 @@
 	req->complete = 1;
 	return -EINVAL;
     }
-    req->next = 0;
+    req->next = NULL;
     req->sent = 0;
     req->complete = 0;
     req->reply_len = 0;
@@ -437,7 +437,7 @@
      * disable_irq(), would that work on m68k ? --BenH
      */
     local_irq_save(flags);
-    cuda_interrupt(0, 0, 0);
+    cuda_interrupt(0, NULL, NULL);
     local_irq_restore(flags);
 }
 
diff -Nru a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
--- a/drivers/macintosh/via-pmu.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/macintosh/via-pmu.c	2004-07-27 18:24:52 -07:00
@@ -492,7 +492,7 @@
 	}
 #endif /* CONFIG_PMAC_PBOOK */
 	/* Create /proc/pmu */
-	proc_pmu_root = proc_mkdir("pmu", 0);
+	proc_pmu_root = proc_mkdir("pmu", NULL);
 	if (proc_pmu_root) {
 		int i;
 		proc_pmu_info = create_proc_read_entry("info", 0, proc_pmu_root,
@@ -549,7 +549,7 @@
 		}
 		if (pmu_state == idle)
 			adb_int_pending = 1;
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 		udelay(10);
 	}
 
@@ -1122,7 +1122,7 @@
 		return -EINVAL;
 	}
 
-	req->next = 0;
+	req->next = NULL;
 	req->sent = 0;
 	req->complete = 0;
 
@@ -1225,7 +1225,7 @@
 		return;
 	if (disable_poll)
 		return;
-	via_pmu_interrupt(0, 0, 0);
+	via_pmu_interrupt(0, NULL, NULL);
 }
 
 void __openfirmware
@@ -1238,7 +1238,7 @@
 	/* Kicks ADB read when PMU is suspended */
 	adb_int_pending = 1;
 	do {
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 	} while (pmu_suspended && (adb_int_pending || pmu_state != idle
 		|| req_awaiting_reply));
 }
@@ -1249,7 +1249,7 @@
 	if (!via)
 		return;
 	while((pmu_state != idle && pmu_state != locked) || !req->complete)
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 }
 
 /* This function loops until the PMU is idle and prevents it from
@@ -1278,7 +1278,7 @@
 		spin_unlock_irqrestore(&pmu_lock, flags);
 		if (req_awaiting_reply)
 			adb_int_pending = 1;
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 		spin_lock_irqsave(&pmu_lock, flags);
 		if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) {
 #ifdef SUSPEND_USES_PMU
@@ -1377,7 +1377,7 @@
 				printk(KERN_ERR "PMU: extra ADB reply\n");
 				return;
 			}
-			req_awaiting_reply = 0;
+			req_awaiting_reply = NULL;
 			if (len <= 2)
 				req->reply_len = 0;
 			else {
@@ -1662,7 +1662,7 @@
 		pmu_irq_stats[1]++;
 		adb_int_pending = 1;
 		spin_unlock_irqrestore(&pmu_lock, flags);
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 		return IRQ_HANDLED;
 	}
 	return IRQ_NONE;
@@ -2071,7 +2071,7 @@
 	if (n->list.next == 0)
 		return -ENOENT;
 	list_del(&n->list);
-	n->list.next = 0;
+	n->list.next = NULL;
 	return 0;
 }
 
@@ -2406,7 +2406,7 @@
 
 	/* Force a poll of ADB interrupts */
 	adb_int_pending = 1;
-	via_pmu_interrupt(0, 0, 0);
+	via_pmu_interrupt(0, NULL, NULL);
 
 	/* Restart jiffies & scheduling */
 	wakeup_decrementer();
@@ -2857,7 +2857,7 @@
 
 	lock_kernel();
 	if (pp != 0) {
-		file->private_data = 0;
+		file->private_data = NULL;
 		spin_lock_irqsave(&all_pvt_lock, flags);
 		list_del(&pp->list);
 		spin_unlock_irqrestore(&all_pvt_lock, flags);
@@ -2880,6 +2880,7 @@
 		     u_int cmd, u_long arg)
 {
 	struct pmu_private *pp = filp->private_data;
+	__u32 __user *argp = (__u32 __user *)arg;
 	int error;
 
 	switch (cmd) {
@@ -2906,7 +2907,7 @@
 		sleep_in_progress = 0;
 		return error;
 	case PMU_IOC_CAN_SLEEP:
-		return put_user((u32)can_sleep, (__u32 *)arg);
+		return put_user((u32)can_sleep, argp);
 
 #ifdef CONFIG_PMAC_BACKLIGHT
 	/* Backlight should have its own device or go via
@@ -2918,13 +2919,13 @@
 		error = get_backlight_level();
 		if (error < 0)
 			return error;
-		return put_user(error, (__u32 *)arg);
+		return put_user(error, argp);
 	case PMU_IOC_SET_BACKLIGHT:
 	{
 		__u32 value;
 		if (sleep_in_progress)
 			return -EBUSY;
-		error = get_user(value, (__u32 *)arg);
+		error = get_user(value, argp);
 		if (!error)
 			error = set_backlight_level(value);
 		return error;
@@ -2943,9 +2944,9 @@
 #endif /* CONFIG_INPUT_ADBHID */
 #endif /* CONFIG_PMAC_BACKLIGHT */
 	case PMU_IOC_GET_MODEL:
-	    	return put_user(pmu_kind, (__u32 *)arg);
+	    	return put_user(pmu_kind, argp);
 	case PMU_IOC_HAS_ADB:
-		return put_user(pmu_has_adb, (__u32 *)arg);
+		return put_user(pmu_has_adb, argp);
 	}
 	return -EINVAL;
 }
diff -Nru a/drivers/media/radio/miropcm20-radio.c b/drivers/media/radio/miropcm20-radio.c
--- a/drivers/media/radio/miropcm20-radio.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/media/radio/miropcm20-radio.c	2004-07-27 18:24:51 -07:00
@@ -75,7 +75,7 @@
 
 	if ((i=aci_rw_cmd(ACI_READ_TUNERSTATION, -1, -1))<0)
 		return i;
-#if DEBUG
+#ifdef DEBUG
 	printk("check_sig: 0x%x\n", i);
 #endif
 	if (i & 0x80) {
@@ -107,7 +107,7 @@
 
 	if ((i=aci_rds_cmd(RDS_RXVALUE, &buf, 1))<0)
 		return i;
-#if DEBUG
+#ifdef DEBUG
 	printk("rds-signal: %d\n", buf);
 #endif
 	if (buf > 15) {
@@ -172,7 +172,7 @@
 			unsigned long *freq = arg;
 			pcm20->freq = *freq;
 			i=pcm20_setfreq(pcm20, pcm20->freq);
-#if DEBUG
+#ifdef DEBUG
 			printk("First view (setfreq): 0x%x\n", i);
 #endif
 			return i;
diff -Nru a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
--- a/drivers/media/video/saa7134/saa7134-core.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/media/video/saa7134/saa7134-core.c	2004-07-27 18:24:51 -07:00
@@ -324,7 +324,7 @@
 			 struct saa7134_buf *buf)
 {
 	struct saa7134_buf *next = NULL;
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	
@@ -353,7 +353,7 @@
 			   struct saa7134_dmaqueue *q,
 			   unsigned int state)
 {
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	dprintk("buffer_finish %p\n",q->curr);
@@ -370,7 +370,7 @@
 {
 	struct saa7134_buf *buf,*next = NULL;
 
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	BUG_ON(NULL != q->curr);
@@ -427,7 +427,7 @@
 	enum v4l2_field cap = V4L2_FIELD_ANY;
 	enum v4l2_field ov  = V4L2_FIELD_ANY;
 
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 
diff -Nru a/drivers/media/video/zoran_procfs.c b/drivers/media/video/zoran_procfs.c
--- a/drivers/media/video/zoran_procfs.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/media/video/zoran_procfs.c	2004-07-27 18:24:52 -07:00
@@ -40,6 +40,7 @@
 #include <linux/videodev.h>
 #include <linux/spinlock.h>
 #include <linux/sem.h>
+#include <linux/seq_file.h>
 
 #include <linux/ctype.h>
 #include <asm/io.h>
@@ -93,14 +94,6 @@
 	{NULL, 0, 0, 0},
 };
 
-struct procfs_io {
-	char *buffer;
-	char *end;
-	int neof;
-	int count;
-	int count_current;
-};
-
 static void
 setparam (struct zoran *zr,
 	  char         *name,
@@ -130,85 +123,34 @@
 	}
 }
 
-static int
-print_procfs (struct procfs_io *io,
-	      const char       *fmt,
-	      ...)
+static int zoran_show(struct seq_file *p, void *v)
 {
-	va_list args;
+	struct zoran *zr = p->private;
 	int i;
 
-	if (io->buffer >= io->end) {
-		io->neof++;
-		return 0;
-	}
-	if (io->count > io->count_current++)
-		return 0;
-	va_start(args, fmt);
-	i = vsprintf(io->buffer, fmt, args);
-	io->buffer += i;
-	va_end(args);
-	return i;
+	seq_printf(p, "ZR36067 registers:\n");
+	for (i = 0; i < 0x130; i += 16)
+		seq_printf(p, "%03X %08X  %08X  %08X  %08X \n", i,
+			   btread(i), btread(i+4), btread(i+8), btread(i+12));
+	return 0;
 }
 
-static void
-zoran_procfs_output (struct procfs_io *io,
-		     void             *data)
+static int zoran_open(struct inode *inode, struct file *file)
 {
-	int i;
-	struct zoran *zr;
-	zr = (struct zoran *) data;
-
-	print_procfs(io, "ZR36067 registers:");
-	for (i = 0; i < 0x130; i += 4) {
-		if (!(i % 16)) {
-			print_procfs(io, "\n%03X", i);
-		};
-		print_procfs(io, " %08X ", btread(i));
-	};
-	print_procfs(io, "\n");
+	struct zoran *data = PDE(inode)->data;
+	return single_open(file, zoran_show, data);
 }
 
-static int
-zoran_read_proc (char  *buffer,
-		 char **start,
-		 off_t  offset,
-		 int    size,
-		 int   *eof,
-		 void  *data)
-{
-	struct procfs_io io;
-	int nbytes;
-
-	io.buffer = buffer;
-	io.end = buffer + size - 128;	// Just to make it a little bit safer
-	io.count = offset;
-	io.count_current = 0;
-	io.neof = 0;
-	zoran_procfs_output(&io, data);
-	*start = (char *) (io.count_current - io.count);
-	nbytes = (int) (io.buffer - buffer);
-	*eof = !io.neof;
-	return nbytes;
-
-	return 0;
-}
-
-static int
-zoran_write_proc (struct file   *file,
-		  const char    __user *buffer,
-		  unsigned long  count,
-		  void          *data)
+static ssize_t zoran_write(struct file *file, const char __user *buffer,
+			size_t count, loff_t *ppos)
 {
+	struct zoran *zr = PDE(file->f_dentry->d_inode)->data;
 	char *string, *sp;
 	char *line, *ldelim, *varname, *svar, *tdelim;
-	struct zoran *zr;
 
 	if (count > 32768)	/* Stupidity filter */
 		return -EINVAL;
 
-	zr = (struct zoran *) data;
-
 	string = sp = vmalloc(count + 1);
 	if (!string) {
 		dprintk(1,
@@ -222,8 +164,8 @@
 		return -EFAULT;
 	}
 	string[count] = 0;
-	dprintk(4, KERN_INFO "%s: write_proc: name=%s count=%lu data=%x\n",
-		ZR_DEVNAME(zr), file->f_dentry->d_name.name, count, (int) data);
+	dprintk(4, KERN_INFO "%s: write_proc: name=%s count=%zu zr=%p\n",
+		ZR_DEVNAME(zr), file->f_dentry->d_name.name, count, zr);
 	ldelim = " \t\n";
 	tdelim = "=";
 	line = strpbrk(sp, ldelim);
@@ -243,6 +185,14 @@
 
 	return count;
 }
+
+static struct file_operations zoran_operations = {
+	.open		= zoran_open,
+	.read		= seq_read,
+	.write		= zoran_write,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
 #endif
 
 int
@@ -253,10 +203,9 @@
 
 	snprintf(name, 7, "zoran%d", zr->id);
 	if ((zr->zoran_proc = create_proc_entry(name, 0, NULL))) {
-		zr->zoran_proc->read_proc = zoran_read_proc;
-		zr->zoran_proc->write_proc = zoran_write_proc;
 		zr->zoran_proc->data = zr;
 		zr->zoran_proc->owner = THIS_MODULE;
+		zr->zoran_proc->proc_fops = &zoran_operations;
 		dprintk(2,
 			KERN_INFO
 			"%s: procfs entry /proc/%s allocated. data=%p\n",
@@ -277,9 +226,8 @@
 	char name[8];
 
 	snprintf(name, 7, "zoran%d", zr->id);
-	if (zr->zoran_proc) {
+	if (zr->zoran_proc)
 		remove_proc_entry(name, NULL);
-	}
 	zr->zoran_proc = NULL;
 #endif
 }
diff -Nru a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
--- a/drivers/mtd/chips/cfi_cmdset_0002.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c	2004-07-27 18:24:51 -07:00
@@ -1415,7 +1415,7 @@
 	ofs = instr->addr;
 	len = instr->len;
 
-	ret = cfi_amdstd_varsize_frob(mtd, do_erase_oneblock, ofs, len, 0);
+	ret = cfi_amdstd_varsize_frob(mtd, do_erase_oneblock, ofs, len, NULL);
 	if (ret)
 		return ret;
 
@@ -1681,7 +1681,7 @@
 	int ret;
 
 	DEBUG(MTD_DEBUG_LEVEL3,
-	      "%s: lock status before, ofs=0x%08llx, len=0x%08X\n",
+	      "%s: lock status before, ofs=0x%08llx, len=0x%08zX\n",
 	      __func__, ofs, len);
 	debug_dump_locks(mtd, do_printlockstatus_oneblock, ofs, len, 0);
 
@@ -1705,7 +1705,7 @@
 	int ret;
 
 	DEBUG(MTD_DEBUG_LEVEL3,
-	      "%s: lock status before, ofs=0x%08llx, len=0x%08X\n",
+	      "%s: lock status before, ofs=0x%08llx, len=0x%08zX\n",
 	      __func__, ofs, len);
 	debug_dump_locks(mtd, do_printlockstatus_oneblock, ofs, len, 0);
 
diff -Nru a/drivers/mtd/devices/blkmtd.c b/drivers/mtd/devices/blkmtd.c
--- a/drivers/mtd/devices/blkmtd.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/mtd/devices/blkmtd.c	2004-07-27 18:24:51 -07:00
@@ -246,7 +246,7 @@
 	pagenr = to >> PAGE_SHIFT;
 	offset = to & ~PAGE_MASK;
 
-	DEBUG(2, "blkmtd: write_pages: buf = %p to = %ld len = %d pagenr = %d offset = %d\n",
+	DEBUG(2, "blkmtd: write_pages: buf = %p to = %ld len = %zd pagenr = %d offset = %d\n",
 	      buf, (long)to, len, pagenr, offset);
 
 	/* see if we have to do a partial write at the start */
@@ -270,21 +270,21 @@
 
 	down(&dev->wrbuf_mutex);
 
-	DEBUG(3, "blkmtd: write: start_len = %d len = %d end_len = %d pagecnt = %d\n",
+	DEBUG(3, "blkmtd: write: start_len = %zd len = %zd end_len = %zd pagecnt = %d\n",
 	      start_len, len, end_len, pagecnt);
 
 	if(start_len) {
 		/* do partial start region */
 		struct page *page;
 
-		DEBUG(3, "blkmtd: write: doing partial start, page = %d len = %d offset = %d\n",
+		DEBUG(3, "blkmtd: write: doing partial start, page = %d len = %zd offset = %d\n",
 		      pagenr, start_len, offset);
 
 		BUG_ON(!buf);
 		page = read_cache_page(dev->blkdev->bd_inode->i_mapping, pagenr, (filler_t *)blkmtd_readpage, dev);
 		lock_page(page);
 		if(PageDirty(page)) {
-			err("to = %lld start_len = %d len = %d end_len = %d pagenr = %d\n",
+			err("to = %lld start_len = %zd len = %zd end_len = %zd pagenr = %d\n",
 			    to, start_len, len, end_len, pagenr);
 			BUG();
 		}
@@ -346,13 +346,13 @@
 	if(end_len) {
 		/* do the third region */
 		struct page *page;
-		DEBUG(3, "blkmtd: write: doing partial end, page = %d len = %d\n",
+		DEBUG(3, "blkmtd: write: doing partial end, page = %d len = %zd\n",
 		      pagenr, end_len);
 		BUG_ON(!buf);
 		page = read_cache_page(dev->blkdev->bd_inode->i_mapping, pagenr, (filler_t *)blkmtd_readpage, dev);
 		lock_page(page);
 		if(PageDirty(page)) {
-			err("to = %lld start_len = %d len = %d end_len = %d pagenr = %d\n",
+			err("to = %lld start_len = %zd len = %zd end_len = %zd pagenr = %d\n",
 			    to, start_len, len, end_len, pagenr);
 			BUG();
 		}
@@ -375,7 +375,7 @@
 	if(bio)
 		blkmtd_write_out(bio);
 
-	DEBUG(2, "blkmtd: write: end, retlen = %d, err = %d\n", *retlen, err);
+	DEBUG(2, "blkmtd: write: end, retlen = %zd, err = %d\n", *retlen, err);
 	up(&dev->wrbuf_mutex);
 
 	if(retlen)
@@ -393,14 +393,14 @@
 	size_t from;
 	u_long len;
 	int err = -EIO;
-	int retlen;
+	size_t retlen;
 
 	instr->state = MTD_ERASING;
 	from = instr->addr;
 	len = instr->len;
 
 	/* check erase region has valid start and length */
-	DEBUG(2, "blkmtd: erase: dev = `%s' from = 0x%x len = 0x%lx\n",
+	DEBUG(2, "blkmtd: erase: dev = `%s' from = 0x%zx len = 0x%lx\n",
 	      mtd->name+9, from, len);
 	while(numregions) {
 		DEBUG(3, "blkmtd: checking erase region = 0x%08X size = 0x%X num = 0x%x\n",
@@ -417,14 +417,14 @@
 
 	if(!numregions) {
 		/* Not a valid erase block */
-		err("erase: invalid erase request 0x%lX @ 0x%08X", len, from);
+		err("erase: invalid erase request 0x%lX @ 0x%08zX", len, from);
 		instr->state = MTD_ERASE_FAILED;
 		err = -EIO;
 	}
 
 	if(instr->state != MTD_ERASE_FAILED) {
 		/* do the erase */
-		DEBUG(3, "Doing erase from = %d len = %ld\n", from, len);
+		DEBUG(3, "Doing erase from = %zd len = %ld\n", from, len);
 		err = write_pages(dev, NULL, from, len, &retlen);
 		if(err || retlen != len) {
 			err("erase failed err = %d", err);
@@ -453,8 +453,8 @@
 	int pagenr, pages;
 	size_t thislen = 0;
 
-	DEBUG(2, "blkmtd: read: dev = `%s' from = %ld len = %d buf = %p\n",
-	      mtd->name+9, (long int)from, len, buf);
+	DEBUG(2, "blkmtd: read: dev = `%s' from = %lld len = %zd buf = %p\n",
+	      mtd->name+9, from, len, buf);
 
 	if(from > mtd->size)
 		return -EINVAL;
@@ -496,7 +496,7 @@
  readerr:
 	if(retlen)
 		*retlen = thislen;
-	DEBUG(2, "blkmtd: end read: retlen = %d, err = %d\n", thislen, err);
+	DEBUG(2, "blkmtd: end read: retlen = %zd, err = %d\n", thislen, err);
 	return err;
 }
 
@@ -511,8 +511,8 @@
 	if(!len)
 		return 0;
 
-	DEBUG(2, "blkmtd: write: dev = `%s' to = %ld len = %d buf = %p\n",
-	      mtd->name+9, (long int)to, len, buf);
+	DEBUG(2, "blkmtd: write: dev = `%s' to = %lld len = %zd buf = %p\n",
+	      mtd->name+9, to, len, buf);
 
 	if(to >= mtd->size) {
 		return -ENOSPC;
@@ -565,7 +565,7 @@
 {
 	struct mtd_erase_region_info *info = NULL;
 
-	DEBUG(2, "calc_erase_regions, es = %d size = %d regions = %d\n",
+	DEBUG(2, "calc_erase_regions, es = %zd size = %zd regions = %d\n",
 	      erase_size, total_size, *regions);
 	/* Make any user specified erasesize be a power of 2
 	   and at least PAGE_SIZE */
@@ -613,7 +613,7 @@
 				break;
 		}
 	} while(!(*regions));
-	DEBUG(2, "calc_erase_regions done, es = %d size = %d regions = %d\n",
+	DEBUG(2, "calc_erase_regions done, es = %zd size = %zd regions = %d\n",
 	      erase_size, total_size, *regions);
 	return info;
 }
diff -Nru a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
--- a/drivers/mtd/devices/doc2000.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/mtd/devices/doc2000.c	2004-07-27 18:24:51 -07:00
@@ -58,7 +58,7 @@
 			size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
 static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
 			 size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
-static int doc_writev_ecc(struct mtd_info *mtd, const struct iovec *vecs, 
+static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, 
 			  unsigned long count, loff_t to, size_t *retlen,
 			  u_char *eccbuf, struct nand_oobinfo *oobsel);
 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
@@ -632,7 +632,7 @@
 		    size_t * retlen, u_char * buf)
 {
 	/* Just a special case of doc_read_ecc */
-	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, 0);
+	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL);
 }
 
 static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
@@ -790,7 +790,7 @@
 		     size_t * retlen, const u_char * buf)
 {
 	char eccbuf[6];
-	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, 0);
+	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL);
 }
 
 static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
@@ -979,7 +979,7 @@
 	return 0;
 }
 
-static int doc_writev_ecc(struct mtd_info *mtd, const struct iovec *vecs, 
+static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, 
 			  unsigned long count, loff_t to, size_t *retlen,
 			  u_char *eccbuf, struct nand_oobinfo *oobsel)
 {
diff -Nru a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c
--- a/drivers/mtd/devices/doc2001.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/mtd/devices/doc2001.c	2004-07-27 18:24:51 -07:00
@@ -38,9 +38,11 @@
 static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
 		     size_t *retlen, const u_char *buf);
 static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-			size_t *retlen, u_char *buf, u_char *eccbuf, int oobsel);
+			size_t *retlen, u_char *buf, u_char *eccbuf,
+			struct nand_oobinfo *oobsel);
 static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
-			 size_t *retlen, const u_char *buf, u_char *eccbuf, int oobsel);
+			 size_t *retlen, const u_char *buf, u_char *eccbuf,
+			 struct nand_oobinfo *oobsel);
 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
 			size_t *retlen, u_char *buf);
 static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
@@ -404,11 +406,12 @@
 		     size_t *retlen, u_char *buf)
 {
 	/* Just a special case of doc_read_ecc */
-	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, 0);
+	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL);
 }
 
 static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
-			 size_t *retlen, u_char *buf, u_char *eccbuf, int oobsel)
+			 size_t *retlen, u_char *buf, u_char *eccbuf,
+			 struct nand_oobinfo *oobsel)
 {
 	int i, ret;
 	volatile char dummy;
@@ -530,11 +533,12 @@
 		      size_t *retlen, const u_char *buf)
 {
 	char eccbuf[6];
-	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, 0);
+	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL);
 }
 
 static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,
-			  size_t *retlen, const u_char *buf, u_char *eccbuf, int oobsel)
+			  size_t *retlen, const u_char *buf, u_char *eccbuf,
+			 struct nand_oobinfo *oobsel)
 {
 	int i,ret = 0;
 	volatile char dummy;
diff -Nru a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
--- a/drivers/mtd/ftl.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/mtd/ftl.c	2004-07-27 18:24:52 -07:00
@@ -167,7 +167,8 @@
 {
     erase_unit_header_t header;
     loff_t offset, max_offset;
-    int ret;
+    size_t ret;
+    int err;
     part->header.FormattedSize = 0;
     max_offset = (0x100000<part->mbd.mtd->size)?0x100000:part->mbd.mtd->size;
     /* Search first megabyte for a valid FTL header */
@@ -175,11 +176,11 @@
 	 (offset + sizeof(header)) < max_offset;
 	 offset += part->mbd.mtd->erasesize ? : 0x2000) {
 
-	ret = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(header), &ret, 
+	err = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(header), &ret, 
 			      (unsigned char *)&header);
 	
-	if (ret) 
-	    return ret;
+	if (err) 
+	    return err;
 
 	if (strcmp(header.DataOrgTuple+3, "FTL100") == 0) break;
     }
@@ -958,7 +959,7 @@
 	if (ret) {
 	    printk(KERN_NOTICE "ftl_cs: block write failed!\n");
 	    printk(KERN_NOTICE "ftl_cs:   log_addr = 0x%x, virt_addr"
-		   " = 0x%x, Offset = 0x%x\n", log_addr, virt_addr,
+		   " = 0x%x, Offset = 0x%zx\n", log_addr, virt_addr,
 		   offset);
 	    return -EIO;
 	}
diff -Nru a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
--- a/drivers/mtd/inftlcore.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/mtd/inftlcore.c	2004-07-27 18:24:51 -07:00
@@ -167,8 +167,8 @@
 	u16 pot = inftl->LastFreeEUN;
 	int silly = inftl->nb_blocks;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=0x%x,"
-		"desperate=%d)\n", (int)inftl, desperate);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=%p,"
+		"desperate=%d)\n", inftl, desperate);
 
 	/*
 	 * Normally, we force a fold to happen before we run out of free
@@ -210,8 +210,8 @@
 	struct inftl_oob oob;
         size_t retlen;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=0x%x,thisVUC=%d,"
-		"pending=%d)\n", (int)inftl, thisVUC, pendingblock);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d,"
+		"pending=%d)\n", inftl, thisVUC, pendingblock);
 
 	memset(BlockMap, 0xff, sizeof(BlockMap));
 	memset(BlockDeleted, 0, sizeof(BlockDeleted));
@@ -366,8 +366,8 @@
 	u16 ChainLength = 0, thislen;
 	u16 chain, EUN;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=0x%x,"
-		"pending=%d)\n", (int)inftl, pendingblock);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=%p,"
+		"pending=%d)\n", inftl, pendingblock);
 
 	for (chain = 0; chain < inftl->nb_blocks; chain++) {
 		EUN = inftl->VUtable[chain];
@@ -428,8 +428,8 @@
 	size_t retlen;
 	int silly, silly2 = 3;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=0x%x,"
-		"block=%d)\n", (int)inftl, block);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=%p,"
+		"block=%d)\n", inftl, block);
 
 	do {
 		/*
@@ -590,8 +590,8 @@
 	struct inftl_bci bci;
 	size_t retlen;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=0x%x,"
-		"thisVUC=%d)\n", (int)inftl, thisVUC);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=%p,"
+		"thisVUC=%d)\n", inftl, thisVUC);
 
 	memset(BlockUsed, 0, sizeof(BlockUsed));
 	memset(BlockDeleted, 0, sizeof(BlockDeleted));
@@ -709,8 +709,8 @@
 	size_t retlen;
 	struct inftl_bci bci;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_deleteblock(inftl=0x%x,"
-		"block=%d)\n", (int)inftl, block);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_deleteblock(inftl=%p,"
+		"block=%d)\n", inftl, block);
 
 	while (thisEUN < inftl->nb_blocks) {
 		if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) +
@@ -768,8 +768,8 @@
 	struct inftl_oob oob;
 	char *p, *pend;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_writeblock(inftl=0x%x,block=%ld,"
-		"buffer=0x%x)\n", (int)inftl, block, (int)buffer);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_writeblock(inftl=%p,block=%ld,"
+		"buffer=%p)\n", inftl, block, buffer);
 
 	/* Is block all zero? */
 	pend = buffer + SECTORSIZE;
@@ -816,8 +816,8 @@
         struct inftl_bci bci;
 	size_t retlen;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_readblock(inftl=0x%x,block=%ld,"
-		"buffer=0x%x)\n", (int)inftl, block, (int)buffer);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_readblock(inftl=%p,block=%ld,"
+		"buffer=%p)\n", inftl, block, buffer);
 
 	while (thisEUN < inftl->nb_blocks) {
 		if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) +
diff -Nru a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
--- a/drivers/mtd/inftlmount.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/mtd/inftlmount.c	2004-07-27 18:24:51 -07:00
@@ -58,10 +58,9 @@
 	u8 buf[SECTORSIZE];
 	struct INFTLMediaHeader *mh = &inftl->MediaHdr;
 	struct INFTLPartition *ip;
-	int retlen;
+	size_t retlen;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=0x%x)\n",
-		(int)inftl);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=%p)\n", inftl);
 
         /*
 	 * Assume logical EraseSize == physical erasesize for starting the
@@ -288,7 +287,7 @@
 		inftl->PUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL);
 		if (!inftl->PUtable) {
 			printk(KERN_WARNING "INFTL: allocation of PUtable "
-				"failed (%d bytes)\n",
+				"failed (%zd bytes)\n",
 				inftl->nb_blocks * sizeof(u16));
 			return -ENOMEM;
 		}
@@ -297,7 +296,7 @@
 		if (!inftl->VUtable) {
 			kfree(inftl->PUtable);
 			printk(KERN_WARNING "INFTL: allocation of VUtable "
-				"failed (%d bytes)\n",
+				"failed (%zd bytes)\n",
 				inftl->nb_blocks * sizeof(u16));
 			return -ENOMEM;
 		}
@@ -348,11 +347,12 @@
 static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
 	int len, int check_oob)
 {
-	int i, retlen;
 	u8 buf[SECTORSIZE + inftl->mbd.mtd->oobsize];
+	size_t retlen;
+	int i;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: check_free_sectors(inftl=0x%x,"
-		"address=0x%x,len=%d,check_oob=%d)\n", (int)inftl,
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: check_free_sectors(inftl=%p,"
+		"address=0x%x,len=%d,check_oob=%d)\n", inftl,
 		address, len, check_oob);
 
 	for (i = 0; i < len; i += SECTORSIZE) {
@@ -382,13 +382,13 @@
  */
 int INFTL_formatblock(struct INFTLrecord *inftl, int block)
 {
-	int retlen;
+	size_t retlen;
 	struct inftl_unittail uci;
 	struct erase_info *instr = &inftl->instr;
 	int physblock;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_formatblock(inftl=0x%x,"
-		"block=%d)\n", (int)inftl, block);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_formatblock(inftl=%p,"
+		"block=%d)\n", inftl, block);
 
 	memset(instr, 0, sizeof(struct erase_info));
 
@@ -551,10 +551,11 @@
 	int chain_length, do_format_chain;
 	struct inftl_unithead1 h0;
 	struct inftl_unittail h1;
-	int i, retlen;
+	size_t retlen;
+	int i;
 	u8 *ANACtable, ANAC;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_mount(inftl=0x%x)\n", (int)s);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_mount(inftl=%p)\n", s);
 
 	/* Search for INFTL MediaHeader and Spare INFTL Media Header */
 	if (find_boot_record(s) < 0) {
diff -Nru a/drivers/mtd/maps/ichxrom.c b/drivers/mtd/maps/ichxrom.c
--- a/drivers/mtd/maps/ichxrom.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/mtd/maps/ichxrom.c	2004-07-27 18:24:51 -07:00
@@ -286,7 +286,7 @@
 		info->mtd->unlock = ichxrom_unlock;
 	}
 	if (info->mtd->size > info->map.size) {
-		printk(KERN_WARNING MOD_NAME " rom(%u) larger than window(%u). fixing...\n",
+		printk(KERN_WARNING MOD_NAME " rom(%u) larger than window(%lu). fixing...\n",
 		       info->mtd->size, info->map.size);
 		info->mtd->size = info->map.size;
 	}
diff -Nru a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
--- a/drivers/mtd/mtdchar.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/mtd/mtdchar.c	2004-07-27 18:24:52 -07:00
@@ -511,7 +511,7 @@
 	}
 
 	default:
-		DEBUG(MTD_DEBUG_LEVEL0, "Invalid ioctl %x (MEMGETINFO = %x)\n", cmd, MEMGETINFO);
+		DEBUG(MTD_DEBUG_LEVEL0, "Invalid ioctl %x (MEMGETINFO = %lx)\n", cmd, (unsigned long)MEMGETINFO);
 		ret = -ENOTTY;
 	}
 
diff -Nru a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
--- a/drivers/mtd/nand/diskonchip.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/mtd/nand/diskonchip.c	2004-07-27 18:24:51 -07:00
@@ -651,10 +651,11 @@
 {
 	struct nand_chip *this = mtd->priv;
 	struct doc_priv *doc = (void *)this->priv;
-	int offs, end = (MAX_MEDIAHEADER_SCAN << this->phys_erase_shift);
-	int ret, retlen;
+	unsigned offs, end = (MAX_MEDIAHEADER_SCAN << this->phys_erase_shift);
+	int ret;
+	size_t retlen;
 
-	end = min(end, (int)mtd->size); // paranoia
+	end = min(end, mtd->size); // paranoia
 	for (offs = 0; offs < end; offs += mtd->erasesize) {
 		ret = mtd->read(mtd, offs, mtd->oobblock, &retlen, buf);
 		if (retlen != mtd->oobblock) continue;
@@ -695,8 +696,8 @@
 	struct doc_priv *doc = (void *)this->priv;
 	u_char *buf = this->data_buf;
 	struct NFTLMediaHeader *mh = (struct NFTLMediaHeader *) buf;
-	const int psize = 1 << this->page_shift;
-	int blocks, maxblocks;
+	const unsigned psize = 1 << this->page_shift;
+	unsigned blocks, maxblocks;
 	int offs, numheaders;
 
 	if (!(numheaders=find_media_headers(mtd, buf, "ANAND", 1))) return 0;
@@ -714,7 +715,7 @@
 //#endif
 
 	blocks = mtd->size >> this->phys_erase_shift;
-	maxblocks = min(32768, (int)mtd->erasesize - psize);
+	maxblocks = min(32768U, mtd->erasesize - psize);
 
 	if (mh->UnitSizeFactor == 0x00) {
 		/* Auto-determine UnitSizeFactor.  The constraints are:
@@ -725,7 +726,7 @@
 		mh->UnitSizeFactor = 0xff;
 		while (blocks > maxblocks) {
 			blocks >>= 1;
-			maxblocks = min(32768, (maxblocks << 1) + psize);
+			maxblocks = min(32768U, (maxblocks << 1) + psize);
 			mh->UnitSizeFactor--;
 		}
 		printk(KERN_WARNING "UnitSizeFactor=0x00 detected.  Correct value is assumed to be 0x%02x.\n", mh->UnitSizeFactor);
@@ -741,7 +742,7 @@
 		mtd->erasesize <<= (0xff - mh->UnitSizeFactor);
 		printk(KERN_INFO "Setting virtual erase size to %d\n", mtd->erasesize);
 		blocks = mtd->size >> this->bbt_erase_shift;
-		maxblocks = min(32768, (int)mtd->erasesize - psize);
+		maxblocks = min(32768U, mtd->erasesize - psize);
 	}
 
 	if (blocks > maxblocks) {
diff -Nru a/drivers/net/3c515.c b/drivers/net/3c515.c
--- a/drivers/net/3c515.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/3c515.c	2004-07-27 18:24:51 -07:00
@@ -831,7 +831,7 @@
 		outb(PKT_BUF_SZ >> 8, ioaddr + TxFreeThreshold);	/* Room for a packet. */
 		/* Clear the Tx ring. */
 		for (i = 0; i < TX_RING_SIZE; i++)
-			vp->tx_skbuff[i] = 0;
+			vp->tx_skbuff[i] = NULL;
 		outl(0, ioaddr + DownListPtr);
 	}
 	/* Set receiver mode: presumably accept b-case and phys addr only. */
@@ -1174,7 +1174,7 @@
 					break;	/* It still hasn't been processed. */
 				if (lp->tx_skbuff[entry]) {
 					dev_kfree_skb_irq(lp->tx_skbuff[entry]);
-					lp->tx_skbuff[entry] = 0;
+					lp->tx_skbuff[entry] = NULL;
 				}
 				dirty_tx++;
 			}
@@ -1458,7 +1458,7 @@
 		for (i = 0; i < RX_RING_SIZE; i++)
 			if (vp->rx_skbuff[i]) {
 				dev_kfree_skb(vp->rx_skbuff[i]);
-				vp->rx_skbuff[i] = 0;
+				vp->rx_skbuff[i] = NULL;
 			}
 	}
 	if (vp->full_bus_master_tx) {	/* Free Boomerang bus master Tx buffers. */
@@ -1466,7 +1466,7 @@
 		for (i = 0; i < TX_RING_SIZE; i++)
 			if (vp->tx_skbuff[i]) {
 				dev_kfree_skb(vp->tx_skbuff[i]);
-				vp->tx_skbuff[i] = 0;
+				vp->tx_skbuff[i] = NULL;
 			}
 	}
 
diff -Nru a/drivers/net/82596.c b/drivers/net/82596.c
--- a/drivers/net/82596.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/82596.c	2004-07-27 18:24:52 -07:00
@@ -619,7 +619,7 @@
 #endif
 	unsigned long flags;
 
-	MPU_PORT(dev, PORT_RESET, 0);
+	MPU_PORT(dev, PORT_RESET, NULL);
 
 	udelay(100);		/* Wait 100us - seems to help */
 
@@ -760,7 +760,7 @@
 
 failed:
 	printk(KERN_CRIT "%s: Failed to initialise 82596\n", dev->name);
-	MPU_PORT(dev, PORT_RESET, 0);
+	MPU_PORT(dev, PORT_RESET, NULL);
 	return -1;
 }
 
diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/Kconfig	2004-07-27 18:24:52 -07:00
@@ -234,7 +234,7 @@
 
 config OAKNET
 	tristate "National DP83902AV (Oak ethernet) support"
-	depends on NET_ETHERNET && PPC
+	depends on NET_ETHERNET && PPC && BROKEN
 	select CRC32
 	help
 	  Say Y if your machine has this type of Ethernet network card.
diff -Nru a/drivers/net/acenic.c b/drivers/net/acenic.c
--- a/drivers/net/acenic.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/acenic.c	2004-07-27 18:24:51 -07:00
@@ -369,9 +369,9 @@
  */
 #define ACE_MINI_SIZE		100
 
-#define ACE_MINI_BUFSIZE	(ACE_MINI_SIZE + 2 + 16)
-#define ACE_STD_BUFSIZE		(ACE_STD_MTU + ETH_HLEN + 2+4+16)
-#define ACE_JUMBO_BUFSIZE	(ACE_JUMBO_MTU + ETH_HLEN + 2+4+16)
+#define ACE_MINI_BUFSIZE	ACE_MINI_SIZE
+#define ACE_STD_BUFSIZE		(ACE_STD_MTU + ETH_HLEN + 4)
+#define ACE_JUMBO_BUFSIZE	(ACE_JUMBO_MTU + ETH_HLEN + 4)
 
 /*
  * There seems to be a magic difference in the effect between 995 and 996
@@ -678,7 +678,7 @@
 			ringp = &ap->skb->rx_std_skbuff[i];
 			mapping = pci_unmap_addr(ringp, mapping);
 			pci_unmap_page(ap->pdev, mapping,
-				       ACE_STD_BUFSIZE - (2 + 16),
+				       ACE_STD_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 
 			ap->rx_std_ring[i].size = 0;
@@ -698,7 +698,7 @@
 				ringp = &ap->skb->rx_mini_skbuff[i];
 				mapping = pci_unmap_addr(ringp,mapping);
 				pci_unmap_page(ap->pdev, mapping,
-					       ACE_MINI_BUFSIZE - (2 + 16),
+					       ACE_MINI_BUFSIZE,
 					       PCI_DMA_FROMDEVICE);
 
 				ap->rx_mini_ring[i].size = 0;
@@ -717,7 +717,7 @@
 			ringp = &ap->skb->rx_jumbo_skbuff[i];
 			mapping = pci_unmap_addr(ringp, mapping);
 			pci_unmap_page(ap->pdev, mapping,
-				       ACE_JUMBO_BUFSIZE - (2 + 16),
+				       ACE_JUMBO_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 
 			ap->rx_jumbo_ring[i].size = 0;
@@ -1257,7 +1257,7 @@
 	set_aceaddr(&info->stats2_ptr, (dma_addr_t) tmp_ptr);
 
 	set_aceaddr(&info->rx_std_ctrl.rngptr, ap->rx_ring_base_dma);
-	info->rx_std_ctrl.max_len = ACE_STD_MTU + ETH_HLEN + 4;
+	info->rx_std_ctrl.max_len = ACE_STD_BUFSIZE;
 	info->rx_std_ctrl.flags =
 	  RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | ACE_RCB_VLAN_FLAG;
 
@@ -1700,17 +1700,14 @@
 		struct rx_desc *rd;
 		dma_addr_t mapping;
 
-		skb = alloc_skb(ACE_STD_BUFSIZE, GFP_ATOMIC);
+		skb = alloc_skb(ACE_STD_BUFSIZE + NET_IP_ALIGN, GFP_ATOMIC);
 		if (!skb)
 			break;
 
-		/*
-		 * Make sure IP header starts on a fresh cache line.
-		 */
-		skb_reserve(skb, 2 + 16);
+		skb_reserve(skb, NET_IP_ALIGN);
 		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_STD_BUFSIZE - (2 + 16),
+				       ACE_STD_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 		ap->skb->rx_std_skbuff[idx].skb = skb;
 		pci_unmap_addr_set(&ap->skb->rx_std_skbuff[idx],
@@ -1718,7 +1715,7 @@
 
 		rd = &ap->rx_std_ring[idx];
 		set_aceaddr(&rd->addr, mapping);
-		rd->size = ACE_STD_MTU + ETH_HLEN + 4;
+		rd->size = ACE_STD_BUFSIZE;
 		rd->idx = idx;
 		idx = (idx + 1) % RX_STD_RING_ENTRIES;
 	}
@@ -1766,17 +1763,14 @@
 		struct rx_desc *rd;
 		dma_addr_t mapping;
 
-		skb = alloc_skb(ACE_MINI_BUFSIZE, GFP_ATOMIC);
+		skb = alloc_skb(ACE_MINI_BUFSIZE + NET_IP_ALIGN, GFP_ATOMIC);
 		if (!skb)
 			break;
 
-		/*
-		 * Make sure the IP header ends up on a fresh cache line
-		 */
-		skb_reserve(skb, 2 + 16);
+		skb_reserve(skb, NET_IP_ALIGN);
 		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_MINI_BUFSIZE - (2 + 16),
+				       ACE_MINI_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 		ap->skb->rx_mini_skbuff[idx].skb = skb;
 		pci_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx],
@@ -1784,7 +1778,7 @@
 
 		rd = &ap->rx_mini_ring[idx];
 		set_aceaddr(&rd->addr, mapping);
-		rd->size = ACE_MINI_SIZE;
+		rd->size = ACE_MINI_BUFSIZE;
 		rd->idx = idx;
 		idx = (idx + 1) % RX_MINI_RING_ENTRIES;
 	}
@@ -1827,17 +1821,14 @@
 		struct rx_desc *rd;
 		dma_addr_t mapping;
 
-		skb = alloc_skb(ACE_JUMBO_BUFSIZE, GFP_ATOMIC);
+		skb = alloc_skb(ACE_JUMBO_BUFSIZE + NET_IP_ALIGN, GFP_ATOMIC);
 		if (!skb)
 			break;
 
-		/*
-		 * Make sure the IP header ends up on a fresh cache line
-		 */
-		skb_reserve(skb, 2 + 16);
+		skb_reserve(skb, NET_IP_ALIGN);
 		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_JUMBO_BUFSIZE - (2 + 16),
+				       ACE_JUMBO_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 		ap->skb->rx_jumbo_skbuff[idx].skb = skb;
 		pci_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx],
@@ -1845,7 +1836,7 @@
 
 		rd = &ap->rx_jumbo_ring[idx];
 		set_aceaddr(&rd->addr, mapping);
-		rd->size = ACE_JUMBO_MTU + ETH_HLEN + 4;
+		rd->size = ACE_JUMBO_BUFSIZE;
 		rd->idx = idx;
 		idx = (idx + 1) % RX_JUMBO_RING_ENTRIES;
 	}
@@ -2027,19 +2018,19 @@
 			 */
 		case 0:
 			rip = &ap->skb->rx_std_skbuff[skbidx];
-			mapsize = ACE_STD_BUFSIZE - (2 + 16);
+			mapsize = ACE_STD_BUFSIZE;
 			rxdesc = &ap->rx_std_ring[skbidx];
 			std_count++;
 			break;
 		case BD_FLG_JUMBO:
 			rip = &ap->skb->rx_jumbo_skbuff[skbidx];
-			mapsize = ACE_JUMBO_BUFSIZE - (2 + 16);
+			mapsize = ACE_JUMBO_BUFSIZE;
 			rxdesc = &ap->rx_jumbo_ring[skbidx];
 			atomic_dec(&ap->cur_jumbo_bufs);
 			break;
 		case BD_FLG_MINI:
 			rip = &ap->skb->rx_mini_skbuff[skbidx];
-			mapsize = ACE_MINI_BUFSIZE - (2 + 16);
+			mapsize = ACE_MINI_BUFSIZE;
 			rxdesc = &ap->rx_mini_ring[skbidx];
 			mini_count++; 
 			break;
diff -Nru a/drivers/net/acenic_firmware.h b/drivers/net/acenic_firmware.h
--- a/drivers/net/acenic_firmware.h	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/acenic_firmware.h	2004-07-27 18:24:52 -07:00
@@ -18,9 +18,9 @@
 #define tigonFwBssAddr 0x00015dd0
 #define tigonFwBssLen 0x2080
 #ifdef CONFIG_ACENIC_OMIT_TIGON_I
-#define tigonFwText 0
-#define tigonFwData 0
-#define tigonFwRodata 0
+#define tigonFwText NULL
+#define tigonFwData NULL
+#define tigonFwRodata NULL
 #else
 /* Generated by genfw.c */
 static u32 tigonFwText[(MAX_TEXT_LEN/4) + 1] __initdata = {
diff -Nru a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
--- a/drivers/net/amd8111e.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/amd8111e.c	2004-07-27 18:24:51 -07:00
@@ -701,7 +701,7 @@
 				  	lp->tx_skbuff[tx_index]->len,
 					PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq (lp->tx_skbuff[tx_index]);
-			lp->tx_skbuff[tx_index] = 0;
+			lp->tx_skbuff[tx_index] = NULL;
 			lp->tx_dma_addr[tx_index] = 0;
 		}
 		lp->tx_complete_idx++;
@@ -1544,7 +1544,7 @@
 	if( dev->mc_count == 0 ){
 		/* get only own packets */
 		mc_filter[1] = mc_filter[0] = 0;
-		lp->mc_list = 0;
+		lp->mc_list = NULL;
 		lp->options &= ~OPTION_MULTICAST_ENABLE;
 		amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF);
 		/* disable promiscous mode */
diff -Nru a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
--- a/drivers/net/cs89x0.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/cs89x0.c	2004-07-27 18:24:52 -07:00
@@ -1566,7 +1566,7 @@
 {
 	if (lp->dma_buff) {
 		free_pages((unsigned long)(lp->dma_buff), get_order(lp->dmasize * 1024));
-		lp->dma_buff = 0;
+		lp->dma_buff = NULL;
 	}
 }
 #endif
diff -Nru a/drivers/net/dgrs_asstruct.h b/drivers/net/dgrs_asstruct.h
--- a/drivers/net/dgrs_asstruct.h	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/dgrs_asstruct.h	2004-07-27 18:24:51 -07:00
@@ -4,7 +4,7 @@
  *	$Id: asstruct.h,v 1.1.1.1 1994/10/23 05:08:32 rick Exp $
  */
 
-#if ASSEMBLER
+#ifdef ASSEMBLER
 
 #	define MO(t,a)		(a)
 #	define VMO(t,a)		(a)
diff -Nru a/drivers/net/dgrs_i82596.h b/drivers/net/dgrs_i82596.h
--- a/drivers/net/dgrs_i82596.h	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/dgrs_i82596.h	2004-07-27 18:24:52 -07:00
@@ -95,7 +95,7 @@
 /************************************************************************/
 typedef volatile struct _I596_RBD
 {
-#if INTEL_RETENTIVE
+#ifdef INTEL_RETENTIVE
 	ushort			count;	/* Length of data in buf */
 	ushort			offset;
 #else
@@ -103,7 +103,7 @@
 #endif
 	vol struct _I596_RBD	*next;	/* Next buffer descriptor in list */
 	uchar			*buf;	/* Data buffer */
-#if INTEL_RETENTIVE
+#ifdef INTEL_RETENTIVE
 	ushort			size;	/* Size of buf (constant) */
 	ushort			zero;
 #else
diff -Nru a/drivers/net/dl2k.c b/drivers/net/dl2k.c
--- a/drivers/net/dl2k.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/dl2k.c	2004-07-27 18:24:51 -07:00
@@ -583,7 +583,7 @@
 
 	/* Initialize Tx descriptors, TFDListPtr leaves in start_xmit(). */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		np->tx_skbuff[i] = 0;
+		np->tx_skbuff[i] = NULL;
 		np->tx_ring[i].status = cpu_to_le64 (TFDDone);
 		np->tx_ring[i].next_desc = cpu_to_le64 (np->tx_ring_dma +
 					      ((i+1)%TX_RING_SIZE) *
@@ -597,7 +597,7 @@
 						sizeof (struct netdev_desc));
 		np->rx_ring[i].status = 0;
 		np->rx_ring[i].fraginfo = 0;
-		np->rx_skbuff[i] = 0;
+		np->rx_skbuff[i] = NULL;
 	}
 
 	/* Allocate the rx buffers */
@@ -770,7 +770,7 @@
 		else
 			dev_kfree_skb (skb);
 
-		np->tx_skbuff[entry] = 0;
+		np->tx_skbuff[entry] = NULL;
 		entry = (entry + 1) % TX_RING_SIZE;
 		tx_use++;
 	}
@@ -1818,7 +1818,7 @@
 			pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo,
 					  skb->len, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb (skb);
-			np->rx_skbuff[i] = 0;
+			np->rx_skbuff[i] = NULL;
 		}
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
@@ -1827,7 +1827,7 @@
 			pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo,
 					  skb->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb (skb);
-			np->tx_skbuff[i] = 0;
+			np->tx_skbuff[i] = NULL;
 		}
 	}
 
diff -Nru a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
--- a/drivers/net/e1000/e1000.h	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/e1000/e1000.h	2004-07-27 18:24:51 -07:00
@@ -82,7 +82,7 @@
 
 #include "e1000_hw.h"
 
-#if DBG
+#ifdef DBG
 #define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
 #else
 #define E1000_DBG(args...)
diff -Nru a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
--- a/drivers/net/e1000/e1000_osdep.h	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/e1000/e1000_osdep.h	2004-07-27 18:24:51 -07:00
@@ -63,7 +63,7 @@
 
 #define MSGOUT(S, A, B)	printk(KERN_DEBUG S "\n", A, B)
 
-#if DBG
+#ifdef DBG
 #define DEBUGOUT(S)		printk(KERN_DEBUG S "\n")
 #define DEBUGOUT1(S, A...)	printk(KERN_DEBUG S "\n", A)
 #else
diff -Nru a/drivers/net/eepro100.c b/drivers/net/eepro100.c
--- a/drivers/net/eepro100.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/eepro100.c	2004-07-27 18:24:52 -07:00
@@ -1021,7 +1021,7 @@
 	/* Set up the Tx queue early.. */
 	sp->cur_tx = 0;
 	sp->dirty_tx = 0;
-	sp->last_cmd = 0;
+	sp->last_cmd = NULL;
 	sp->tx_full = 0;
 	sp->in_interrupt = 0;
 
@@ -1355,7 +1355,7 @@
 					le32_to_cpu(sp->tx_ring[entry].tx_buf_addr0),
 					sp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq(sp->tx_skbuff[entry]);
-			sp->tx_skbuff[entry] = 0;
+			sp->tx_skbuff[entry] = NULL;
 		}
 		sp->dirty_tx++;
 	}
@@ -1559,7 +1559,7 @@
 					le32_to_cpu(sp->tx_ring[entry].tx_buf_addr0),
 					sp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq(sp->tx_skbuff[entry]);
-			sp->tx_skbuff[entry] = 0;
+			sp->tx_skbuff[entry] = NULL;
 		}
 		dirty_tx++;
 	}
@@ -1932,7 +1932,7 @@
     /* Free all the skbuffs in the Rx and Tx queues. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		struct sk_buff *skb = sp->rx_skbuff[i];
-		sp->rx_skbuff[i] = 0;
+		sp->rx_skbuff[i] = NULL;
 		/* Clear the Rx descriptors. */
 		if (skb) {
 			pci_unmap_single(sp->pdev,
@@ -1944,7 +1944,7 @@
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		struct sk_buff *skb = sp->tx_skbuff[i];
-		sp->tx_skbuff[i] = 0;
+		sp->tx_skbuff[i] = NULL;
 		/* Clear the Tx descriptors. */
 		if (skb) {
 			pci_unmap_single(sp->pdev,
@@ -2174,7 +2174,7 @@
 		last_cmd = sp->last_cmd;
 		sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
 
-		sp->tx_skbuff[entry] = 0;			/* Redundant. */
+		sp->tx_skbuff[entry] = NULL;			/* Redundant. */
 		sp->tx_ring[entry].status = cpu_to_le32(CmdSuspend | CmdConfigure);
 		sp->tx_ring[entry].link =
 			cpu_to_le32(TX_RING_ELEM_DMA(sp, (entry + 1) % TX_RING_SIZE));
@@ -2217,7 +2217,7 @@
 		last_cmd = sp->last_cmd;
 		sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
 
-		sp->tx_skbuff[entry] = 0;
+		sp->tx_skbuff[entry] = NULL;
 		sp->tx_ring[entry].status = cpu_to_le32(CmdSuspend | CmdMulticastList);
 		sp->tx_ring[entry].link =
 			cpu_to_le32(TX_RING_ELEM_DMA(sp, (entry + 1) % TX_RING_SIZE));
@@ -2298,7 +2298,7 @@
 		sp->last_cmd = mc_setup_frm;
 
 		/* Change the command to a NoOp, pointing to the CmdMulti command. */
-		sp->tx_skbuff[entry] = 0;
+		sp->tx_skbuff[entry] = NULL;
 		sp->tx_ring[entry].status = cpu_to_le32(CmdNOp);
 		sp->tx_ring[entry].link = cpu_to_le32(mc_blk->frame_dma);
 
diff -Nru a/drivers/net/epic100.c b/drivers/net/epic100.c
--- a/drivers/net/epic100.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/epic100.c	2004-07-27 18:24:51 -07:00
@@ -937,7 +937,7 @@
 		ep->rx_ring[i].buflength = cpu_to_le32(ep->rx_buf_sz);
 		ep->rx_ring[i].next = ep->rx_ring_dma + 
 				      (i+1)*sizeof(struct epic_rx_desc);
-		ep->rx_skbuff[i] = 0;
+		ep->rx_skbuff[i] = NULL;
 	}
 	/* Mark the last entry as wrapping the ring. */
 	ep->rx_ring[i-1].next = ep->rx_ring_dma;
@@ -959,7 +959,7 @@
 	/* The Tx buffer descriptor is filled in as needed, but we
 	   do need to clear the ownership bit. */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		ep->tx_skbuff[i] = 0;
+		ep->tx_skbuff[i] = NULL;
 		ep->tx_ring[i].txstatus = 0x0000;
 		ep->tx_ring[i].next = ep->tx_ring_dma + 
 			(i+1)*sizeof(struct epic_tx_desc);
@@ -1093,7 +1093,7 @@
 				pci_unmap_single(ep->pci_dev, ep->tx_ring[entry].bufaddr, 
 						 skb->len, PCI_DMA_TODEVICE);
 				dev_kfree_skb_irq(skb);
-				ep->tx_skbuff[entry] = 0;
+				ep->tx_skbuff[entry] = NULL;
 			}
 
 #ifndef final_version
@@ -1274,7 +1274,7 @@
 	/* Free all the skbuffs in the Rx queue. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		skb = ep->rx_skbuff[i];
-		ep->rx_skbuff[i] = 0;
+		ep->rx_skbuff[i] = NULL;
 		ep->rx_ring[i].rxstatus = 0;		/* Not owned by Epic chip. */
 		ep->rx_ring[i].buflength = 0;
 		if (skb) {
@@ -1286,7 +1286,7 @@
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		skb = ep->tx_skbuff[i];
-		ep->tx_skbuff[i] = 0;
+		ep->tx_skbuff[i] = NULL;
 		if (!skb)
 			continue;
 		pci_unmap_single(ep->pci_dev, ep->tx_ring[i].bufaddr, 
diff -Nru a/drivers/net/eql.c b/drivers/net/eql.c
--- a/drivers/net/eql.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/eql.c	2004-07-27 18:24:52 -07:00
@@ -389,7 +389,7 @@
 static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave)
 {
 	if (!eql_is_full(queue)) {
-		slave_t *duplicate_slave = 0;
+		slave_t *duplicate_slave = NULL;
 
 		duplicate_slave = __eql_find_slave_dev(queue, slave->dev);
 		if (duplicate_slave != 0)
diff -Nru a/drivers/net/hamachi.c b/drivers/net/hamachi.c
--- a/drivers/net/hamachi.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/net/hamachi.c	2004-07-27 18:24:53 -07:00
@@ -1017,7 +1017,7 @@
 				hmp->tx_ring[entry].addr, skb->len, 
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			hmp->tx_skbuff[entry] = 0;
+			hmp->tx_skbuff[entry] = NULL;
 		}
 		hmp->tx_ring[entry].status_n_length = 0;
 		if (entry >= TX_RING_SIZE-1) 
@@ -1105,7 +1105,7 @@
 			pci_unmap_single(hmp->pci_dev, hmp->tx_ring[i].addr, 
 				skb->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			hmp->tx_skbuff[i] = 0;
+			hmp->tx_skbuff[i] = NULL;
 		}
 	}
 
@@ -1127,7 +1127,7 @@
 			pci_unmap_single(hmp->pci_dev, hmp->rx_ring[i].addr, 
 				hmp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(skb);
-			hmp->rx_skbuff[i] = 0;
+			hmp->rx_skbuff[i] = NULL;
 		}
 	}
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
@@ -1189,7 +1189,7 @@
 	/* Initialize all Rx descriptors. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		hmp->rx_ring[i].status_n_length = 0;
-		hmp->rx_skbuff[i] = 0;
+		hmp->rx_skbuff[i] = NULL;
 	}
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
@@ -1209,7 +1209,7 @@
 	hmp->rx_ring[RX_RING_SIZE-1].status_n_length |= cpu_to_le32(DescEndRing);
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		hmp->tx_skbuff[i] = 0;
+		hmp->tx_skbuff[i] = NULL;
 		hmp->tx_ring[i].status_n_length = 0;
 	}
 	/* Mark the last entry of the ring */
@@ -1421,7 +1421,7 @@
 							skb->len,
 							PCI_DMA_TODEVICE);
 						dev_kfree_skb_irq(skb);
-						hmp->tx_skbuff[entry] = 0;
+						hmp->tx_skbuff[entry] = NULL;
 					}
 					hmp->tx_ring[entry].status_n_length = 0;
 					if (entry >= TX_RING_SIZE-1)  
@@ -1791,7 +1791,7 @@
 				hmp->rx_ring[i].addr, hmp->rx_buf_sz, 
 				PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(skb);
-			hmp->rx_skbuff[i] = 0;
+			hmp->rx_skbuff[i] = NULL;
 		}
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
@@ -1801,7 +1801,7 @@
 				hmp->tx_ring[i].addr, skb->len, 
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			hmp->tx_skbuff[i] = 0;
+			hmp->tx_skbuff[i] = NULL;
 		}
 	}
 
diff -Nru a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
--- a/drivers/net/ixgb/ixgb_hw.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/ixgb/ixgb_hw.c	2004-07-27 18:24:52 -07:00
@@ -67,7 +67,7 @@
 	/* Delay a few ms just to allow the reset to complete */
 	msec_delay(IXGB_DELAY_AFTER_RESET);
 	ctrl_reg = IXGB_READ_REG(hw, CTRL0);
-#if DBG
+#ifdef DBG
 	/* Make sure the self-clearing global reset bit did self clear */
 	ASSERT(!(ctrl_reg & IXGB_CTRL0_RST));
 #endif
diff -Nru a/drivers/net/ixgb/ixgb_osdep.h b/drivers/net/ixgb/ixgb_osdep.h
--- a/drivers/net/ixgb/ixgb_osdep.h	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/ixgb/ixgb_osdep.h	2004-07-27 18:24:52 -07:00
@@ -64,7 +64,7 @@
 #define ASSERT(x)	if(!(x)) BUG()
 #define MSGOUT(S, A, B)	printk(KERN_DEBUG S "\n", A, B)
 
-#if DBG
+#ifdef DBG
 #define DEBUGOUT(S)		printk(KERN_DEBUG S "\n")
 #define DEBUGOUT1(S, A...)	printk(KERN_DEBUG S "\n", A)
 #else
diff -Nru a/drivers/net/lance.c b/drivers/net/lance.c
--- a/drivers/net/lance.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/lance.c	2004-07-27 18:24:51 -07:00
@@ -834,7 +834,7 @@
 	/* Free all the skbuffs in the Rx and Tx queues. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		struct sk_buff *skb = lp->rx_skbuff[i];
-		lp->rx_skbuff[i] = 0;
+		lp->rx_skbuff[i] = NULL;
 		lp->rx_ring[i].base = 0;		/* Not owned by LANCE chip. */
 		if (skb)
 			dev_kfree_skb_any(skb);
@@ -878,7 +878,7 @@
 	/* The Tx buffer address is filled in as needed, but we do need to clear
 	   the upper ownership bit. */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		lp->tx_skbuff[i] = 0;
+		lp->tx_skbuff[i] = NULL;
 		lp->tx_ring[i].base = 0;
 	}
 
@@ -1083,7 +1083,7 @@
 				   in the bounce buffer. */
 				if (lp->tx_skbuff[entry]) {
 					dev_kfree_skb_irq(lp->tx_skbuff[entry]);
-					lp->tx_skbuff[entry] = 0;
+					lp->tx_skbuff[entry] = NULL;
 				}
 				dirty_tx++;
 			}
diff -Nru a/drivers/net/lp486e.c b/drivers/net/lp486e.c
--- a/drivers/net/lp486e.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/lp486e.c	2004-07-27 18:24:51 -07:00
@@ -479,7 +479,7 @@
 		kfree(rfd);
 	} while (rfd != lp->rx_tail);
 
-	lp->rx_tail = 0;
+	lp->rx_tail = NULL;
 
 #if 0
 	for (lp->rbd_list) {
diff -Nru a/drivers/net/mace.c b/drivers/net/mace.c
--- a/drivers/net/mace.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/mace.c	2004-07-27 18:24:51 -07:00
@@ -432,7 +432,7 @@
     for (i = 0; i < N_RX_RING; ++i) {
 	if (mp->rx_bufs[i] != 0) {
 	    dev_kfree_skb(mp->rx_bufs[i]);
-	    mp->rx_bufs[i] = 0;
+	    mp->rx_bufs[i] = NULL;
 	}
     }
     for (i = mp->tx_empty; i != mp->tx_fill; ) {
@@ -475,7 +475,7 @@
 	cp->xfer_status = 0;
 	++cp;
     }
-    mp->rx_bufs[i] = 0;
+    mp->rx_bufs[i] = NULL;
     st_le16(&cp->command, DBDMA_STOP);
     mp->rx_fill = i;
     mp->rx_empty = 0;
@@ -959,7 +959,7 @@
 		mp->stats.rx_bytes += skb->len;
 		netif_rx(skb);
 		dev->last_rx = jiffies;
-		mp->rx_bufs[i] = 0;
+		mp->rx_bufs[i] = NULL;
 		++mp->stats.rx_packets;
 	    }
 	} else {
diff -Nru a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
--- a/drivers/net/myri_sbus.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/myri_sbus.c	2004-07-27 18:24:51 -07:00
@@ -1129,7 +1129,7 @@
 static int __init myri_sbus_probe(void)
 {
 	struct sbus_bus *bus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	static int called;
 	int cards = 0, v;
 
diff -Nru a/drivers/net/ne.c b/drivers/net/ne.c
--- a/drivers/net/ne.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/ne.c	2004-07-27 18:24:51 -07:00
@@ -111,7 +111,7 @@
     {"PCM-4823", "PCM-4823", {0x00, 0xc0, 0x6c}}, /* Broken Advantech MoBo */
     {"REALTEK", "RTL8019", {0x00, 0x00, 0xe8}}, /* no-name with Realtek chip */
     {"LCS-8834", "LCS-8836", {0x04, 0x04, 0x37}}, /* ShinyNet (SET) */
-    {0,}
+    {NULL,}
 };
 #endif
 
diff -Nru a/drivers/net/ns83820.c b/drivers/net/ns83820.c
--- a/drivers/net/ns83820.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/ns83820.c	2004-07-27 18:24:52 -07:00
@@ -1089,7 +1089,7 @@
 
 	frag = skb_shinfo(skb)->frags;
 	if (!nr_frags)
-		frag = 0;
+		frag = NULL;
 	extsts = 0;
 	if (skb->ip_summed == CHECKSUM_HW) {
 		extsts |= EXTSTS_IPPKT;
diff -Nru a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
--- a/drivers/net/pcmcia/nmclan_cs.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/pcmcia/nmclan_cs.c	2004-07-27 18:24:51 -07:00
@@ -1472,7 +1472,7 @@
 	Modified from Am79C90 data sheet.
 ---------------------------------------------------------------------------- */
 
-#if BROKEN_MULTICAST
+#ifdef BROKEN_MULTICAST
 
 static void updateCRC(int *CRC, int bit)
 {
diff -Nru a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
--- a/drivers/net/ppp_async.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/ppp_async.c	2004-07-27 18:24:52 -07:00
@@ -208,7 +208,7 @@
 
 	write_lock_irq(&disc_data_lock);
 	ap = tty->disc_data;
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	write_unlock_irq(&disc_data_lock);
 	if (ap == 0)
 		return;
@@ -606,7 +606,7 @@
 	ap->olim = buf;
 
 	kfree_skb(ap->tpkt);
-	ap->tpkt = 0;
+	ap->tpkt = NULL;
 	return 1;
 }
 
@@ -705,7 +705,7 @@
 	clear_bit(XMIT_BUSY, &ap->xmit_flags);
 	if (ap->tpkt != 0) {
 		kfree_skb(ap->tpkt);
-		ap->tpkt = 0;
+		ap->tpkt = NULL;
 		clear_bit(XMIT_FULL, &ap->xmit_flags);
 		done = 1;
 	}
@@ -727,7 +727,7 @@
 	ap->optr = ap->olim;
 	if (ap->tpkt != NULL) {
 		kfree_skb(ap->tpkt);
-		ap->tpkt = 0;
+		ap->tpkt = NULL;
 		clear_bit(XMIT_FULL, &ap->xmit_flags);
 		done = 1;
 	}
@@ -805,7 +805,7 @@
 	/* queue the frame to be processed */
 	skb->cb[0] = ap->state;
 	skb_queue_tail(&ap->rqueue, skb);
-	ap->rpkt = 0;
+	ap->rpkt = NULL;
 	ap->state = 0;
 	return;
 
diff -Nru a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
--- a/drivers/net/ppp_generic.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/ppp_generic.c	2004-07-27 18:24:52 -07:00
@@ -371,7 +371,7 @@
 	struct ppp *ppp;
 
 	if (pf != 0) {
-		file->private_data = 0;
+		file->private_data = NULL;
 		if (pf->kind == INTERFACE) {
 			ppp = PF_TO_PPP(pf);
 			if (file == ppp->owner)
@@ -397,7 +397,7 @@
 	struct ppp_file *pf = file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
 	ssize_t ret;
-	struct sk_buff *skb = 0;
+	struct sk_buff *skb = NULL;
 
 	ret = count;
 
@@ -1161,7 +1161,7 @@
 	list = &ppp->channels;
 	if (list_empty(list)) {
 		/* nowhere to send the packet, just drop it */
-		ppp->xmit_pending = 0;
+		ppp->xmit_pending = NULL;
 		kfree_skb(skb);
 		return;
 	}
@@ -1174,11 +1174,11 @@
 		spin_lock_bh(&pch->downl);
 		if (pch->chan) {
 			if (pch->chan->ops->start_xmit(pch->chan, skb))
-				ppp->xmit_pending = 0;
+				ppp->xmit_pending = NULL;
 		} else {
 			/* channel got unregistered */
 			kfree_skb(skb);
-			ppp->xmit_pending = 0;
+			ppp->xmit_pending = NULL;
 		}
 		spin_unlock_bh(&pch->downl);
 		return;
@@ -1191,7 +1191,7 @@
 		return;
 #endif /* CONFIG_PPP_MULTILINK */
 
-	ppp->xmit_pending = 0;
+	ppp->xmit_pending = NULL;
 	kfree_skb(skb);
 }
 
@@ -1976,7 +1976,7 @@
 
 	if (pch == 0)
 		return;		/* should never happen */
-	chan->ppp = 0;
+	chan->ppp = NULL;
 
 	/*
 	 * This ensures that we have returned from any calls into the
@@ -1984,7 +1984,7 @@
 	 */
 	down_write(&pch->chan_sem);
 	spin_lock_bh(&pch->downl);
-	pch->chan = 0;
+	pch->chan = NULL;
 	spin_unlock_bh(&pch->downl);
 	up_write(&pch->chan_sem);
 	ppp_disconnect_channel(pch);
@@ -2187,11 +2187,11 @@
 	ppp->xstate = 0;
 	xcomp = ppp->xcomp;
 	xstate = ppp->xc_state;
-	ppp->xc_state = 0;
+	ppp->xc_state = NULL;
 	ppp->rstate = 0;
 	rcomp = ppp->rcomp;
 	rstate = ppp->rc_state;
-	ppp->rc_state = 0;
+	ppp->rc_state = NULL;
 	ppp_unlock(ppp);
 
 	if (xstate) {
@@ -2224,7 +2224,7 @@
 		if (ce->comp->compress_proto == proto)
 			return ce;
 	}
-	return 0;
+	return NULL;
 }
 
 /* Register a compressor */
@@ -2269,7 +2269,7 @@
 find_compressor(int type)
 {
 	struct compressor_entry *ce;
-	struct compressor *cp = 0;
+	struct compressor *cp = NULL;
 
 	spin_lock(&compressor_list_lock);
 	ce = find_comp_entry(type);
@@ -2413,7 +2413,7 @@
 	down(&all_ppp_sem);
 	ppp_lock(ppp);
 	dev = ppp->dev;
-	ppp->dev = 0;
+	ppp->dev = NULL;
 	ppp_unlock(ppp);
 	/* This will call dev_close() for us. */
 	if (dev) {
@@ -2447,7 +2447,7 @@
 	ppp_ccp_closed(ppp);
 	if (ppp->vj) {
 		slhc_free(ppp->vj);
-		ppp->vj = 0;
+		ppp->vj = NULL;
 	}
 	skb_queue_purge(&ppp->file.xq);
 	skb_queue_purge(&ppp->file.rq);
@@ -2461,7 +2461,7 @@
 	}
 	if (ppp->active_filter) {
 		kfree(ppp->active_filter);
-		ppp->active_filter = 0;
+		ppp->active_filter = NULL;
 	}
 #endif /* CONFIG_PPP_FILTER */
 
@@ -2507,7 +2507,7 @@
 		if (pch->file.index == unit)
 			return pch;
 	}
-	return 0;
+	return NULL;
 }
 
 /*
diff -Nru a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
--- a/drivers/net/ppp_synctty.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/ppp_synctty.c	2004-07-27 18:24:51 -07:00
@@ -259,7 +259,7 @@
 
 	write_lock_irq(&disc_data_lock);
 	ap = tty->disc_data;
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	write_unlock_irq(&disc_data_lock);
 	if (ap == 0)
 		return;
@@ -656,7 +656,7 @@
 				tty_stuffed = 1;
 			} else {
 				kfree_skb(ap->tpkt);
-				ap->tpkt = 0;
+				ap->tpkt = NULL;
 				clear_bit(XMIT_FULL, &ap->xmit_flags);
 				done = 1;
 			}
@@ -675,7 +675,7 @@
 flush:
 	if (ap->tpkt != 0) {
 		kfree_skb(ap->tpkt);
-		ap->tpkt = 0;
+		ap->tpkt = NULL;
 		clear_bit(XMIT_FULL, &ap->xmit_flags);
 		done = 1;
 	}
@@ -695,7 +695,7 @@
 	spin_lock_bh(&ap->xmit_lock);
 	if (ap->tpkt != NULL) {
 		kfree_skb(ap->tpkt);
-		ap->tpkt = 0;
+		ap->tpkt = NULL;
 		clear_bit(XMIT_FULL, &ap->xmit_flags);
 		done = 1;
 	}
diff -Nru a/drivers/net/sb1000.c b/drivers/net/sb1000.c
--- a/drivers/net/sb1000.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/sb1000.c	2004-07-27 18:24:51 -07:00
@@ -799,7 +799,7 @@
 			skb ? session_id : session_id | 0x40, frame_id);
 	if (skb) {
 		dev_kfree_skb(skb);
-		skb = 0;
+		skb = NULL;
 	}
 
 good_frame:
@@ -875,7 +875,7 @@
 	dev->last_rx = jiffies;
 	stats->rx_bytes+=dlen;
 	stats->rx_packets++;
-	lp->rx_skb[ns] = 0;
+	lp->rx_skb[ns] = NULL;
 	lp->rx_session_id[ns] |= 0x40;
 	return 0;
 
@@ -893,7 +893,7 @@
 	if (ns < NPIDS) {
 		if ((skb = lp->rx_skb[ns])) {
 			dev_kfree_skb(skb);
-			lp->rx_skb[ns] = 0;
+			lp->rx_skb[ns] = NULL;
 		}
 		lp->rx_session_id[ns] |= 0x40;
 	}
diff -Nru a/drivers/net/seeq8005.c b/drivers/net/seeq8005.c
--- a/drivers/net/seeq8005.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/seeq8005.c	2004-07-27 18:24:52 -07:00
@@ -414,6 +414,27 @@
 	return 0;
 }
 
+/*
+ * wait_for_buffer
+ *
+ * This routine waits for the SEEQ chip to assert that the FIFO is ready
+ * by checking for a window interrupt, and then clearing it. This has to
+ * occur in the interrupt handler!
+ */
+inline void wait_for_buffer(struct net_device * dev)
+{
+	int ioaddr = dev->base_addr;
+	unsigned long tmp;
+	int status;
+	
+	tmp = jiffies + HZ;
+	while ( ( ((status=inw(SEEQ_STATUS)) & SEEQSTAT_WINDOW_INT) != SEEQSTAT_WINDOW_INT) && time_before(jiffies, tmp))
+		cpu_relax();
+		
+	if ( (status & SEEQSTAT_WINDOW_INT) == SEEQSTAT_WINDOW_INT)
+		outw( SEEQCMD_WINDOW_INT_ACK | (status & SEEQCMD_INT_MASK), SEEQ_CMD);
+}
+
 /* The typical workload of the driver:
    Handle the network interface interrupts. */
 static irqreturn_t seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * regs)
@@ -712,27 +733,6 @@
 }
 
 
-/*
- * wait_for_buffer
- *
- * This routine waits for the SEEQ chip to assert that the FIFO is ready
- * by checking for a window interrupt, and then clearing it. This has to
- * occur in the interrupt handler!
- */
-inline void wait_for_buffer(struct net_device * dev)
-{
-	int ioaddr = dev->base_addr;
-	unsigned long tmp;
-	int status;
-	
-	tmp = jiffies + HZ;
-	while ( ( ((status=inw(SEEQ_STATUS)) & SEEQSTAT_WINDOW_INT) != SEEQSTAT_WINDOW_INT) && time_before(jiffies, tmp))
-		cpu_relax();
-		
-	if ( (status & SEEQSTAT_WINDOW_INT) == SEEQSTAT_WINDOW_INT)
-		outw( SEEQCMD_WINDOW_INT_ACK | (status & SEEQCMD_INT_MASK), SEEQ_CMD);
-}
-	
 #ifdef MODULE
 
 static struct net_device *dev_seeq;
diff -Nru a/drivers/net/sis900.c b/drivers/net/sis900.c
--- a/drivers/net/sis900.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/sis900.c	2004-07-27 18:24:51 -07:00
@@ -126,7 +126,7 @@
 	{ "NS 83851 PHY",			0x2000, 0x5C20, MIX },
 	{ "Realtek RTL8201 PHY",		0x0000, 0x8200, LAN },
 	{ "VIA 6103 PHY",			0x0101, 0x8f20, LAN },
-	{0,},
+	{NULL,},
 };
 
 struct mii_phy {
@@ -1452,7 +1452,7 @@
 				sis_priv->tx_ring[i].bufptr, skb->len,
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq(skb);
-			sis_priv->tx_skbuff[i] = 0;
+			sis_priv->tx_skbuff[i] = NULL;
 			sis_priv->tx_ring[i].cmdsts = 0;
 			sis_priv->tx_ring[i].bufptr = 0;
 			sis_priv->stats.tx_dropped++;
@@ -1847,7 +1847,7 @@
 				sis_priv->rx_ring[i].bufptr,
 				RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(skb);
-			sis_priv->rx_skbuff[i] = 0;
+			sis_priv->rx_skbuff[i] = NULL;
 		}
 	}
 	for (i = 0; i < NUM_TX_DESC; i++) {
@@ -1857,7 +1857,7 @@
 				sis_priv->tx_ring[i].bufptr, skb->len,
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			sis_priv->tx_skbuff[i] = 0;
+			sis_priv->tx_skbuff[i] = NULL;
 		}
 	}
 
diff -Nru a/drivers/net/slip.c b/drivers/net/slip.c
--- a/drivers/net/slip.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/net/slip.c	2004-07-27 18:24:53 -07:00
@@ -954,7 +954,7 @@
 	if (!sl || sl->magic != SLIP_MAGIC || sl->tty != tty)
 		return;
 
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	sl->tty = NULL;
 	if (!sl->leased)
 		sl->line = 0;
diff -Nru a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
--- a/drivers/net/sunbmac.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/sunbmac.c	2004-07-27 18:24:51 -07:00
@@ -1274,7 +1274,7 @@
 static int __init bigmac_probe(void)
 {
 	struct sbus_bus *sbus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	static int called;
 	int cards = 0, v;
 
diff -Nru a/drivers/net/sundance.c b/drivers/net/sundance.c
--- a/drivers/net/sundance.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/sundance.c	2004-07-27 18:24:52 -07:00
@@ -300,7 +300,7 @@
 	{"D-Link DFE-530TXS FAST Ethernet Adapter"},
 	{"D-Link DL10050-based FAST Ethernet Adapter"},
 	{"Sundance Technology Alta"},
-	{0,},			/* 0 terminated list. */
+	{NULL,},			/* 0 terminated list. */
 };
 
 /* This driver was written to use PCI memory space, however x86-oriented
@@ -1030,7 +1030,7 @@
 			((i+1)%RX_RING_SIZE)*sizeof(*np->rx_ring));
 		np->rx_ring[i].status = 0;
 		np->rx_ring[i].frag[0].length = 0;
-		np->rx_skbuff[i] = 0;
+		np->rx_skbuff[i] = NULL;
 	}
 
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
@@ -1049,7 +1049,7 @@
 	np->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		np->tx_skbuff[i] = 0;
+		np->tx_skbuff[i] = NULL;
 		np->tx_ring[i].status = 0;
 	}
 	return;
@@ -1153,7 +1153,7 @@
 				dev_kfree_skb_irq (skb);
 			else
 				dev_kfree_skb (skb);
-			np->tx_skbuff[i] = 0;
+			np->tx_skbuff[i] = NULL;
 			np->stats.tx_dropped++;
 		}
 	}
@@ -1256,7 +1256,7 @@
 					np->tx_ring[entry].frag[0].addr,
 					skb->len, PCI_DMA_TODEVICE);
 				dev_kfree_skb_irq (np->tx_skbuff[entry]);
-				np->tx_skbuff[entry] = 0;
+				np->tx_skbuff[entry] = NULL;
 				np->tx_ring[entry].frag[0].addr = 0;
 				np->tx_ring[entry].frag[0].length = 0;
 			}
@@ -1275,7 +1275,7 @@
 					np->tx_ring[entry].frag[0].addr,
 					skb->len, PCI_DMA_TODEVICE);
 				dev_kfree_skb_irq (np->tx_skbuff[entry]);
-				np->tx_skbuff[entry] = 0;
+				np->tx_skbuff[entry] = NULL;
 				np->tx_ring[entry].frag[0].addr = 0;
 				np->tx_ring[entry].frag[0].length = 0;
 			}
@@ -1753,7 +1753,7 @@
 				np->rx_ring[i].frag[0].addr, np->rx_buf_sz,
 				PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(skb);
-			np->rx_skbuff[i] = 0;
+			np->rx_skbuff[i] = NULL;
 		}
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
@@ -1763,7 +1763,7 @@
 				np->tx_ring[i].frag[0].addr, skb->len,
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			np->tx_skbuff[i] = 0;
+			np->tx_skbuff[i] = NULL;
 		}
 	}
 
diff -Nru a/drivers/net/sunlance.c b/drivers/net/sunlance.c
--- a/drivers/net/sunlance.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/sunlance.c	2004-07-27 18:24:51 -07:00
@@ -911,7 +911,7 @@
 	lp->tx_new = TX_NEXT(entry);
 }
 
-struct net_device *last_dev = 0;
+struct net_device *last_dev;
 
 static int lance_open(struct net_device *dev)
 {
@@ -1550,8 +1550,8 @@
 static int __init sparc_lance_probe(void)
 {
 	struct sbus_bus *bus;
-	struct sbus_dev *sdev = 0;
-	struct sbus_dma *ledma = 0;
+	struct sbus_dev *sdev = NULL;
+	struct sbus_dma *ledma = NULL;
 	static int called;
 	int cards = 0, v;
 
@@ -1565,7 +1565,7 @@
 		for_each_sbusdev (sdev, bus) {
 			if (strcmp(sdev->prom_name, "le") == 0) {
 				cards++;
-				if ((v = sparc_lance_init(sdev, 0, 0)))
+				if ((v = sparc_lance_init(sdev, NULL, NULL)))
 					return v;
 				continue;
 			}
@@ -1573,14 +1573,14 @@
 				cards++;
 				ledma = find_ledma(sdev);
 				if ((v = sparc_lance_init(sdev->child,
-							  ledma, 0)))
+							  ledma, NULL)))
 					return v;
 				continue;
 			}
 			if (strcmp(sdev->prom_name, "lebuffer") == 0){
 				cards++;
 				if ((v = sparc_lance_init(sdev->child,
-							  0, sdev)))
+							  NULL, sdev)))
 					return v;
 				continue;
 			}
diff -Nru a/drivers/net/sunqe.c b/drivers/net/sunqe.c
--- a/drivers/net/sunqe.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/sunqe.c	2004-07-27 18:24:51 -07:00
@@ -981,7 +981,7 @@
 {
 	struct net_device *dev = NULL;
 	struct sbus_bus *bus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	static int called;
 	int cards = 0, v;
 
diff -Nru a/drivers/net/tlan.c b/drivers/net/tlan.c
--- a/drivers/net/tlan.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/tlan.c	2004-07-27 18:24:51 -07:00
@@ -225,7 +225,7 @@
 
 const char *media[] = {
 	"10BaseT-HD ", "10BaseT-FD ","100baseTx-HD ", 
-	"100baseTx-FD", "100baseT4", 0
+	"100baseTx-FD", "100baseT4", NULL
 };
 
 int media_map[] = { 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,};
diff -Nru a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
--- a/drivers/net/tulip/xircom_cb.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/tulip/xircom_cb.c	2004-07-27 18:24:52 -07:00
@@ -337,7 +337,7 @@
 	spin_lock(&card->lock);
 	status = inl(card->io_port+CSR5);
 
-#if DEBUG	
+#ifdef DEBUG	
 	print_binary(status);
 	printk("tx status 0x%08x 0x%08x \n",card->tx_buffer[0],card->tx_buffer[4]);
 	printk("rx status 0x%08x 0x%08x \n",card->rx_buffer[0],card->rx_buffer[4]);
diff -Nru a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
--- a/drivers/net/via-rhine.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/via-rhine.c	2004-07-27 18:24:52 -07:00
@@ -980,7 +980,7 @@
 		rp->rx_ring[i].desc_length = cpu_to_le32(rp->rx_buf_sz);
 		next += sizeof(struct rx_desc);
 		rp->rx_ring[i].next_desc = cpu_to_le32(next);
-		rp->rx_skbuff[i] = 0;
+		rp->rx_skbuff[i] = NULL;
 	}
 	/* Mark the last entry as wrapping the ring. */
 	rp->rx_ring[i-1].next_desc = cpu_to_le32(rp->rx_ring_dma);
@@ -1018,7 +1018,7 @@
 					 rp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(rp->rx_skbuff[i]);
 		}
-		rp->rx_skbuff[i] = 0;
+		rp->rx_skbuff[i] = NULL;
 	}
 }
 
@@ -1031,7 +1031,7 @@
 	rp->dirty_tx = rp->cur_tx = 0;
 	next = rp->tx_ring_dma;
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		rp->tx_skbuff[i] = 0;
+		rp->tx_skbuff[i] = NULL;
 		rp->tx_ring[i].tx_status = 0;
 		rp->tx_ring[i].desc_length = cpu_to_le32(TXDESC);
 		next += sizeof(struct tx_desc);
@@ -1060,8 +1060,8 @@
 			}
 			dev_kfree_skb(rp->tx_skbuff[i]);
 		}
-		rp->tx_skbuff[i] = 0;
-		rp->tx_buf[i] = 0;
+		rp->tx_skbuff[i] = NULL;
+		rp->tx_buf[i] = NULL;
 	}
 }
 
diff -Nru a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
--- a/drivers/net/via-velocity.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/via-velocity.c	2004-07-27 18:24:52 -07:00
@@ -2892,7 +2892,7 @@
 	struct velocity_info *vptr = dev->priv;
 	struct mac_regs * regs = vptr->mac_regs;
 	unsigned long flags;
-	struct mii_ioctl_data *miidata = (struct mii_ioctl_data *) &(ifr->ifr_data);
+	struct mii_ioctl_data *miidata = if_mii(ifr);
 	int err;
 	
 	switch (cmd) {
diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
--- a/drivers/net/wireless/airo.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/wireless/airo.c	2004-07-27 18:24:51 -07:00
@@ -2615,10 +2615,10 @@
 
 static void wifi_setup(struct net_device *dev)
 {
-	dev->hard_header        = 0;
-	dev->rebuild_header     = 0;
-	dev->hard_header_cache  = 0;
-	dev->header_cache_update= 0;
+	dev->hard_header        = NULL;
+	dev->rebuild_header     = NULL;
+	dev->hard_header_cache  = NULL;
+	dev->header_cache_update= NULL;
 
 	dev->hard_header_parse  = wll_header_parse;
 	dev->hard_start_xmit = &airo_start_xmit11;
@@ -2699,7 +2699,7 @@
 	}
 
 	ai = dev->priv;
-	ai->wifidev = 0;
+	ai->wifidev = NULL;
 	ai->flags = 0;
 	if (pci && (pci->device == 0x5000 || pci->device == 0xa504)) {
 		printk(KERN_DEBUG "airo: Found an MPI350 card\n");
@@ -2829,7 +2829,7 @@
 
 struct net_device *init_airo_card( unsigned short irq, int port, int is_pcmcia )
 {
-	return _init_airo_card ( irq, port, is_pcmcia, 0);
+	return _init_airo_card ( irq, port, is_pcmcia, NULL);
 }
 
 EXPORT_SYMBOL(init_airo_card);
@@ -4351,7 +4351,7 @@
 	.release	= proc_close
 };
 
-static struct proc_dir_entry *airo_entry = 0;
+static struct proc_dir_entry *airo_entry;
 
 struct proc_data {
 	int release_buffer;
@@ -5139,7 +5139,7 @@
 	    (data->wbuffer[1] == ' ' || data->wbuffer[1] == '\n')) {
 		index = data->wbuffer[0] - '0';
 		if (data->wbuffer[1] == '\n') {
-			set_wep_key(ai, index, 0, 0, 1, 1);
+			set_wep_key(ai, index, NULL, 0, 1, 1);
 			return;
 		}
 		j = 2;
@@ -5324,8 +5324,8 @@
 	}
 	data->writelen = 0;
 	data->maxwritelen = 0;
-	data->wbuffer = 0;
-	data->on_close = 0;
+	data->wbuffer = NULL;
+	data->on_close = NULL;
 
 	if (file->f_mode & FMODE_WRITE) {
 		if (!(file->f_mode & FMODE_READ)) {
@@ -5386,7 +5386,7 @@
 static struct net_device_list {
 	struct net_device *dev;
 	struct net_device_list *next;
-} *airo_devices = 0;
+} *airo_devices;
 
 /* Since the card doesn't automatically switch to the right WEP mode,
    we will make it do it.  If the card isn't associated, every secs we
@@ -5407,13 +5407,13 @@
 			break;
 		case AUTH_SHAREDKEY:
 			if (apriv->keyindex < auto_wep) {
-				set_wep_key(apriv, apriv->keyindex, 0, 0, 0, 0);
+				set_wep_key(apriv, apriv->keyindex, NULL, 0, 0, 0);
 				apriv->config.authType = AUTH_SHAREDKEY;
 				apriv->keyindex++;
 			} else {
 			        /* Drop to ENCRYPT */
 				apriv->keyindex = 0;
-				set_wep_key(apriv, apriv->defindex, 0, 0, 0, 0);
+				set_wep_key(apriv, apriv->defindex, NULL, 0, 0, 0);
 				apriv->config.authType = AUTH_ENCRYPT;
 			}
 			break;
@@ -6207,7 +6207,7 @@
 		/* Do we want to just set the transmit key index ? */
 		int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
 		if ((index >= 0) && (index < ((cap_rid.softCap & 0x80)?4:1))) {
-			set_wep_key(local, index, 0, 0, 1, 1);
+			set_wep_key(local, index, NULL, 0, 1, 1);
 		} else
 			/* Don't complain if only change the mode */
 			if(!dwrq->flags & IW_ENCODE_MODE) {
diff -Nru a/drivers/net/wireless/airport.c b/drivers/net/wireless/airport.c
--- a/drivers/net/wireless/airport.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/wireless/airport.c	2004-07-27 18:24:52 -07:00
@@ -139,7 +139,7 @@
 
 	if (card->vaddr)
 		iounmap(card->vaddr);
-	card->vaddr = 0;
+	card->vaddr = NULL;
 
 	macio_release_resource(mdev, 0);
 
diff -Nru a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
--- a/drivers/net/wireless/prism54/isl_ioctl.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/wireless/prism54/isl_ioctl.c	2004-07-27 18:24:51 -07:00
@@ -1942,7 +1942,7 @@
 {
 	islpci_private *priv = netdev_priv(ndev);
 	struct islpci_mgmtframe *response = NULL;
-	int ret = -EIO, response_op = PIMFOR_OP_ERROR;
+	int ret = -EIO;
 
 	printk("%s: get_oid 0x%08X\n", ndev->name, priv->priv_oid);
 	data->length = 0;
@@ -1952,9 +1952,7 @@
 		    islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
 					   priv->priv_oid, extra, 256,
 					   &response);
-		response_op = response->header->operation;
 		printk("%s: ret: %i\n", ndev->name, ret);
-		printk("%s: response_op: %i\n", ndev->name, response_op);
 		if (ret || !response
 		    || response->header->operation == PIMFOR_OP_ERROR) {
 			if (response) {
@@ -1991,15 +1989,19 @@
 					   priv->priv_oid, extra, data->length,
 					   &response);
 		printk("%s: ret: %i\n", ndev->name, ret);
+		if (ret || !response
+		    || response->header->operation == PIMFOR_OP_ERROR) {
+			if (response) {
+				islpci_mgt_release(response);
+			}
+			printk("%s: EIO\n", ndev->name);
+			ret = -EIO;
+		}
 		if (!ret) {
 			response_op = response->header->operation;
 			printk("%s: response_op: %i\n", ndev->name,
 			       response_op);
 			islpci_mgt_release(response);
-		}
-		if (ret || response_op == PIMFOR_OP_ERROR) {
-			printk("%s: EIO\n", ndev->name);
-			ret = -EIO;
 		}
 	}
 
diff -Nru a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
--- a/drivers/net/wireless/prism54/islpci_dev.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/wireless/prism54/islpci_dev.c	2004-07-27 18:24:51 -07:00
@@ -82,7 +82,7 @@
 	mdelay(50);
 
 	{
-		const struct firmware *fw_entry = 0;
+		const struct firmware *fw_entry = NULL;
 		long fw_len;
 		const u32 *fw_ptr;
 
@@ -716,7 +716,7 @@
 
 	if (priv->device_base)
 		iounmap(priv->device_base);
-	priv->device_base = 0;
+	priv->device_base = NULL;
 
 	/* free consistent DMA area... */
 	if (priv->driver_mem_address)
@@ -725,10 +725,10 @@
 				    priv->device_host_address);
 
 	/* clear some dangling pointers */
-	priv->driver_mem_address = 0;
+	priv->driver_mem_address = NULL;
 	priv->device_host_address = 0;
 	priv->device_psm_buffer = 0;
-	priv->control_block = 0;
+	priv->control_block = NULL;
 
         /* clean up mgmt rx buffers */
         for (counter = 0; counter < ISL38XX_CB_MGMT_QSIZE; counter++) {
@@ -754,7 +754,7 @@
 
 		if (priv->data_low_rx[counter])
 			dev_kfree_skb(priv->data_low_rx[counter]);
-		priv->data_low_rx[counter] = 0;
+		priv->data_low_rx[counter] = NULL;
 	}
 
 	/* Free the acces control list and the WPA list */
@@ -880,9 +880,9 @@
       do_islpci_free_memory:
 	islpci_free_memory(priv);
       do_free_netdev:
-	pci_set_drvdata(pdev, 0);
+	pci_set_drvdata(pdev, NULL);
 	free_netdev(ndev);
-	priv = 0;
+	priv = NULL;
 	return NULL;
 }
 
diff -Nru a/drivers/net/wireless/prism54/islpci_hotplug.c b/drivers/net/wireless/prism54/islpci_hotplug.c
--- a/drivers/net/wireless/prism54/islpci_hotplug.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/wireless/prism54/islpci_hotplug.c	2004-07-27 18:24:51 -07:00
@@ -36,6 +36,9 @@
 MODULE_DESCRIPTION("The Prism54 802.11 Wireless LAN adapter");
 MODULE_LICENSE("GPL");
 
+static int	init_pcitm = 0;
+module_param(init_pcitm, int, 0);
+
 /* In this order: vendor, device, subvendor, subdevice, class, class_mask,
  * driver_data 
  * If you have an update for this please contact prism54-devel@prism54.org 
@@ -292,14 +295,14 @@
 	 *
 	 * 	Writing zero to both these two registers will disable both timeouts and
 	 * 	*can* solve problems caused by devices that are slow to respond.
+	 *	Make this configurable - MSW
 	 */
-	/*	I am taking these out, we should not be poking around in the
-	 *	programmable timers - MSW
-	*/
-/*	Do not zero the programmable timers
-	pci_write_config_byte(pdev, 0x40, 0);
-	pci_write_config_byte(pdev, 0x41, 0);
-*/
+	if ( init_pcitm >= 0 ) {
+		pci_write_config_byte(pdev, 0x40, (u8)init_pcitm);
+		pci_write_config_byte(pdev, 0x41, (u8)init_pcitm);
+	} else {
+		printk(KERN_INFO "PCI TRDY/RETRY unchanged\n");
+	}
 
 	/* request the pci device I/O regions */
 	rvalue = pci_request_regions(pdev, DRV_NAME);
@@ -359,9 +362,9 @@
       do_unregister_netdev:
 	unregister_netdev(ndev);
 	islpci_free_memory(priv);
-	pci_set_drvdata(pdev, 0);
+	pci_set_drvdata(pdev, NULL);
 	free_netdev(ndev);
-	priv = 0;
+	priv = NULL;
       do_pci_release_regions:
 	pci_release_regions(pdev);
       do_pci_disable_device:
@@ -377,7 +380,7 @@
 prism54_remove(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
-	islpci_private *priv = ndev ? netdev_priv(ndev) : 0;
+	islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
 	BUG_ON(!priv);
 
 	if (!__in_cleanup_module) {
@@ -405,9 +408,9 @@
 	/* free the PCI memory and unmap the remapped page */
 	islpci_free_memory(priv);
 
-	pci_set_drvdata(pdev, 0);
+	pci_set_drvdata(pdev, NULL);
 	free_netdev(ndev);
-	priv = 0;
+	priv = NULL;
 
 	pci_release_regions(pdev);
 
@@ -418,7 +421,7 @@
 prism54_suspend(struct pci_dev *pdev, u32 state)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
-	islpci_private *priv = ndev ? netdev_priv(ndev) : 0;
+	islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
 	BUG_ON(!priv);
 
 	printk(KERN_NOTICE "%s: got suspend request (state %d)\n",
@@ -443,7 +446,7 @@
 prism54_resume(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
-	islpci_private *priv = ndev ? netdev_priv(ndev) : 0;
+	islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
 	BUG_ON(!priv);
 
 	printk(KERN_NOTICE "%s: got resume request\n", ndev->name);
diff -Nru a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c
--- a/drivers/net/wireless/prism54/islpci_mgt.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/wireless/prism54/islpci_mgt.c	2004-07-27 18:24:52 -07:00
@@ -458,6 +458,8 @@
 	int err;
 	DEFINE_WAIT(wait);
 
+	*recvframe = NULL;
+
 	if (down_interruptible(&priv->mgmt_sem))
 		return -ERESTARTSYS;
 
diff -Nru a/drivers/net/wireless/prism54/oid_mgt.c b/drivers/net/wireless/prism54/oid_mgt.c
--- a/drivers/net/wireless/prism54/oid_mgt.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/net/wireless/prism54/oid_mgt.c	2004-07-27 18:24:52 -07:00
@@ -408,7 +408,7 @@
 mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 {
 	int ret = 0;
-	struct islpci_mgmtframe *response;
+	struct islpci_mgmtframe *response = NULL;
 	int response_op = PIMFOR_OP_ERROR;
 	int dlen;
 	void *cache, *_data = data;
@@ -613,14 +613,16 @@
 	DOT11_OID_DEFKEYID,
 	DOT11_OID_DOT1XENABLE,
 	OID_INL_DOT11D_CONFORMANCE,
+	/* Do not initialize this - fw < 1.0.4.3 rejects it
 	OID_INL_OUTPUTPOWER,
+	*/
 };
 
 /* update the MAC addr. */
 static int
 mgt_update_addr(islpci_private *priv)
 {
-	struct islpci_mgmtframe *res;
+	struct islpci_mgmtframe *res = NULL;
 	int ret;
 
 	ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
diff -Nru a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
--- a/drivers/net/yellowfin.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/net/yellowfin.c	2004-07-27 18:24:51 -07:00
@@ -286,7 +286,7 @@
 	 FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug | DontUseEeprom},
 	{"Symbios SYM83C885", { 0x07011000, 0xffffffff},
 	 PCI_IOTYPE, YELLOWFIN_SIZE, HasMII | DontUseEeprom },
-	{0,},
+	{NULL,},
 };
 
 static struct pci_device_id yellowfin_pci_tbl[] = {
@@ -805,7 +805,7 @@
 #ifdef NO_TXSTATS
 	/* In this mode the Tx ring needs only a single descriptor. */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		yp->tx_skbuff[i] = 0;
+		yp->tx_skbuff[i] = NULL;
 		yp->tx_ring[i].dbdma_cmd = cpu_to_le32(CMD_STOP);
 		yp->tx_ring[i].branch_addr = cpu_to_le32(yp->tx_ring_dma +
 			((i+1)%TX_RING_SIZE)*sizeof(struct yellowfin_desc));
@@ -987,7 +987,7 @@
 			pci_unmap_single(yp->pci_dev, yp->tx_ring[entry].addr,
 				skb->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq(skb);
-			yp->tx_skbuff[entry] = 0;
+			yp->tx_skbuff[entry] = NULL;
 		}
 		if (yp->tx_full
 			&& yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE - 4) {
@@ -1320,12 +1320,12 @@
 		if (yp->rx_skbuff[i]) {
 			dev_kfree_skb(yp->rx_skbuff[i]);
 		}
-		yp->rx_skbuff[i] = 0;
+		yp->rx_skbuff[i] = NULL;
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		if (yp->tx_skbuff[i])
 			dev_kfree_skb(yp->tx_skbuff[i]);
-		yp->tx_skbuff[i] = 0;
+		yp->tx_skbuff[i] = NULL;
 	}
 
 #ifdef YF_PROTOTYPE			/* Support for prototype hardware errata. */
diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c
--- a/drivers/pci/quirks.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/pci/quirks.c	2004-07-27 18:24:51 -07:00
@@ -718,6 +718,11 @@
 			case 0x8070: /* P4G8X Deluxe */
 				asus_hides_smbus = 1;
 			}
+		if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB)
+			switch (dev->subsystem_device) {
+			case 0x1751: /* M2N notebook */
+				asus_hides_smbus = 1;
+			}
 	} else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_HP)) {
 		if (dev->device ==  PCI_DEVICE_ID_INTEL_82855PM_HB)
 			switch(dev->subsystem_device) {
@@ -1020,6 +1025,7 @@
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82850_HB,	asus_hides_smbus_hostbridge },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_7205_0,	asus_hides_smbus_hostbridge },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82855PM_HB,	asus_hides_smbus_hostbridge },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82855GM_HB,	asus_hides_smbus_hostbridge },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82801DB_0,	asus_hides_smbus_lpc },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82801BA_0,	asus_hides_smbus_lpc },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82801DB_12,	asus_hides_smbus_lpc },
diff -Nru a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
--- a/drivers/pnp/pnpbios/bioscalls.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/pnp/pnpbios/bioscalls.c	2004-07-27 18:24:52 -07:00
@@ -353,7 +353,7 @@
 	if (!pnp_bios_present())
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_EVENT, 0, PNP_TS1, PNP_DS, 0, 0 ,0 ,0,
-			       event, sizeof(u16), 0, 0);
+			       event, sizeof(u16), NULL, 0);
 	return status;
 }
 #endif
@@ -411,7 +411,7 @@
 	if (!pnp_bios_present())
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_STATIC_ALLOCED_RES_INFO, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0,
-			       info, 65536, 0, 0);
+			       info, 65536, NULL, 0);
 	return status;
 }
 
@@ -448,7 +448,7 @@
 	if (!pnp_bios_present())
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_PNP_ISA_CONFIG_STRUC, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0,
-			       data, sizeof(struct pnp_isa_config_struc), 0, 0);
+			       data, sizeof(struct pnp_isa_config_struc), NULL, 0);
 	return status;
 }
 
@@ -470,7 +470,7 @@
 	if (!pnp_bios_present())
 		return ESCD_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_ESCD_INFO, 0, PNP_TS1, 2, PNP_TS1, 4, PNP_TS1, PNP_DS,
-			       data, sizeof(struct escd_info_struc), 0, 0);
+			       data, sizeof(struct escd_info_struc), NULL, 0);
 	return status;
 }
 
diff -Nru a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
--- a/drivers/scsi/53c700.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/53c700.c	2004-07-27 18:24:51 -07:00
@@ -1527,7 +1527,7 @@
 
 			/* clear all the negotiated parameters */
 			__shost_for_each_device(SDp, host)
-				SDp->hostdata = 0;
+				SDp->hostdata = NULL;
 			
 			/* clear all the slots and their pending commands */
 			for(i = 0; i < NCR_700_COMMAND_SLOTS_PER_HOST; i++) {
diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
--- a/drivers/scsi/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/drivers/scsi/Kconfig	2004-07-27 18:24:52 -07:00
@@ -491,7 +491,7 @@
 
 config SCSI_BUSLOGIC
 	tristate "BusLogic SCSI support"
-	depends on (PCI || ISA || MCA) && SCSI
+	depends on (PCI || ISA || MCA) && SCSI && (BROKEN || !SPARC64)
 	---help---
 	  This is support for BusLogic MultiMaster and FlashPoint SCSI Host
 	  Adapters. Consult the SCSI-HOWTO, available from
diff -Nru a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
--- a/drivers/scsi/NCR5380.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/NCR5380.c	2004-07-27 18:24:51 -07:00
@@ -1248,7 +1248,7 @@
 					 * and see if we can do an information transfer,
 					 * with failures we will restart.
 					 */
-					hostdata->selecting = 0;	
+					hostdata->selecting = NULL;
 					/* RvC: have to preset this to indicate a new command is being performed */
 
 					if (!NCR5380_select(instance, tmp,
@@ -1634,7 +1634,7 @@
 				   to go to sleep */
 	}
 
-	hostdata->selecting = 0;	/* clear this pointer, because we passed the
+	hostdata->selecting = NULL;/* clear this pointer, because we passed the
 					   waiting period */
 	if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == (SR_SEL | SR_IO)) {
 		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
diff -Nru a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
--- a/drivers/scsi/aacraid/aacraid.h	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/aacraid/aacraid.h	2004-07-27 18:24:51 -07:00
@@ -1313,7 +1313,7 @@
  *	only used for debugging.
  */
  
-#if DBG
+#ifdef DBG
 #define	FIB_COUNTER_INCREMENT(counter)		(counter)++
 #else
 #define	FIB_COUNTER_INCREMENT(counter)		
diff -Nru a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
--- a/drivers/scsi/aha152x.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/aha152x.c	2004-07-27 18:24:51 -07:00
@@ -422,7 +422,7 @@
 #endif /* !PCMCIA */
 
 static int registered_count=0;
-static struct Scsi_Host *aha152x_host[2] = {0, 0};
+static struct Scsi_Host *aha152x_host[2];
 static Scsi_Host_Template aha152x_driver_template;
 
 /*
@@ -647,20 +647,20 @@
 	void		(*end)(struct Scsi_Host *);
 	int		spio;
 } states[] = {
-	{ "idle",	0,		0,		0,		0},
-	{ "unknown",	0,		0,		0,		0},
-	{ "seldo",	0,		seldo_run,	0,		0},
-	{ "seldi",	0,		seldi_run,	0,		0},
-	{ "selto",	0,		selto_run,	0,		0},
-	{ "busfree",	0,		busfree_run,	0,		0},
+	{ "idle",	NULL,		NULL,		NULL,		0},
+	{ "unknown",	NULL,		NULL,		NULL,		0},
+	{ "seldo",	NULL,		seldo_run,	NULL,		0},
+	{ "seldi",	NULL,		seldi_run,	NULL,		0},
+	{ "selto",	NULL,		selto_run,	NULL,		0},
+	{ "busfree",	NULL,		busfree_run,	NULL,		0},
 	{ "msgo",	msgo_init,	msgo_run,	msgo_end,	1},
 	{ "cmd",	cmd_init,	cmd_run,	cmd_end,	1},
-	{ "msgi",	0,		msgi_run,	msgi_end,	1},
-	{ "status",	0,		status_run,	0,		1},
+	{ "msgi",	NULL,		msgi_run,	msgi_end,	1},
+	{ "status",	NULL,		status_run,	NULL,		1},
 	{ "datai",	datai_init,	datai_run,	datai_end,	0},
 	{ "datao",	datao_init,	datao_run,	datao_end,	0},
-	{ "parerr",	0,		parerr_run,	0,		0},
-	{ "rsti",	0,		rsti_run,	0,		0},
+	{ "parerr",	NULL,		parerr_run,	NULL,		0},
+	{ "rsti",	NULL,		rsti_run,	NULL,		0},
 };
 
 /* setup & interrupt */
@@ -756,7 +756,7 @@
 		if(aha152x_host[i] && aha152x_host[i]->irq==irqno)
 			return aha152x_host[i];
 
-	return 0;
+	return NULL;
 }
 
 static irqreturn_t swintr(int irqno, void *dev_id, struct pt_regs *regs)
@@ -892,7 +892,7 @@
 		goto out_host_put;
 	}
 
-	if( scsi_add_host(shpnt, 0) ) {
+	if( scsi_add_host(shpnt, NULL) ) {
 		free_irq(shpnt->irq, shpnt);
 		printk(KERN_ERR "aha152x%d: failed to add host.\n", shpnt->host_no);
 		goto out_host_put;
@@ -905,10 +905,10 @@
 	return shpnt;
 
 out_host_put:
-	aha152x_host[registered_count]=0;
+	aha152x_host[registered_count]=NULL;
 	scsi_host_put(shpnt);
 
-	return 0;
+	return NULL;
 }
 
 void aha152x_release(struct Scsi_Host *shpnt)
@@ -1011,7 +1011,7 @@
 		}
 	}
 
-	SCNEXT(SCpnt)		= 0;
+	SCNEXT(SCpnt)		= NULL;
 	SCSEM(SCpnt)		= sem;
 
 	/* setup scratch area
@@ -1068,7 +1068,7 @@
 	}
 #endif
 
-	return aha152x_internal_queue(SCpnt, 0, 0, done);
+	return aha152x_internal_queue(SCpnt, NULL, 0, done);
 }
 
 
@@ -1119,7 +1119,7 @@
 		DO_UNLOCK(flags);
 
 		kfree(SCpnt->host_scribble);
-		SCpnt->host_scribble=0;
+		SCpnt->host_scribble=NULL;
 
 		return SUCCESS;
 	} 
@@ -1184,7 +1184,7 @@
 
 	SCpnt->cmd_len         = 0;
 	SCpnt->use_sg          = 0;
-	SCpnt->request_buffer  = 0;
+	SCpnt->request_buffer  = NULL;
 	SCpnt->request_bufflen = 0;
 
 	init_timer(&timer);
@@ -1209,7 +1209,7 @@
 		if (!HOSTDATA(shpnt)->commands)
 			SETPORT(PORTA, 0);
 		kfree(SCpnt->host_scribble);
-		SCpnt->host_scribble=0;
+		SCpnt->host_scribble=NULL;
 
 		ret = SUCCESS;
 	} else {
@@ -1241,7 +1241,7 @@
 			next = SCNEXT(ptr);
 		} else {
 			printk(DEBUG_LEAD "queue corrupted at %p\n", CMDINFO(ptr), ptr);
-			next = 0;
+			next = NULL;
 		}
 
 		if (!ptr->device->soft_reset) {
@@ -1249,7 +1249,7 @@
 			remove_SC(SCs, ptr);
 			HOSTDATA(shpnt)->commands--;
 			kfree(ptr->host_scribble);
-			ptr->host_scribble=0;
+			ptr->host_scribble=NULL;
 		}
 
 		ptr = next;
@@ -1415,7 +1415,7 @@
 			printk(ERR_LEAD "there's already a completed command %p - will cause abort\n", CMDINFO(CURRENT_SC), DONE_SC);
 
 		DONE_SC = CURRENT_SC;
-		CURRENT_SC = 0;
+		CURRENT_SC = NULL;
 		DONE_SC->result = error;
 	} else
 		printk(KERN_ERR "aha152x: done() called outside of command\n");
@@ -1538,7 +1538,7 @@
 #endif
 			append_SC(&DISCONNECTED_SC, CURRENT_SC);
 			CURRENT_SC->SCp.phase |= 1 << 16;
-			CURRENT_SC = 0;
+			CURRENT_SC = NULL;
 
 		} else {
 			done(shpnt, DID_ERROR << 16);
@@ -1586,7 +1586,7 @@
 
 			if(!(DONE_SC->SCp.Status & not_issued)) {
 				Scsi_Cmnd *ptr = DONE_SC;
-				DONE_SC=0;
+				DONE_SC=NULL;
 #if 0
 				DPRINTK(debug_eh, ERR_LEAD "requesting sense\n", CMDINFO(ptr));
 #endif
@@ -1603,7 +1603,7 @@
 				ptr->request_bufflen = sizeof(ptr->sense_buffer);
 			
 				DO_UNLOCK(flags);
-				aha152x_internal_queue(ptr, 0, check_condition, ptr->scsi_done);
+				aha152x_internal_queue(ptr, NULL, check_condition, ptr->scsi_done);
 				DO_LOCK(flags);
 #if 0
 			} else {
@@ -1619,7 +1619,7 @@
 			int lun=DONE_SC->device->lun & 0x7;
 #endif
 			Scsi_Cmnd *ptr = DONE_SC;
-			DONE_SC=0;
+			DONE_SC=NULL;
 
 			/* turn led off, when no commands are in the driver */
 			HOSTDATA(shpnt)->commands--;
@@ -1628,7 +1628,7 @@
 
 			if(ptr->scsi_done != reset_done) {
 				kfree(ptr->host_scribble);
-				ptr->host_scribble=0;
+				ptr->host_scribble=NULL;
 			}
 
 			DO_UNLOCK(flags);
@@ -1638,7 +1638,7 @@
 			DO_LOCK(flags);
 		}
 
-		DONE_SC=0;
+		DONE_SC=NULL;
 #if defined(AHA152X_STAT)
 	} else {
 		HOSTDATA(shpnt)->busfree_without_done_command++;
@@ -1780,7 +1780,7 @@
 		append_SC(&ISSUE_SC, CURRENT_SC);
 		DO_UNLOCK(flags);
 
-		CURRENT_SC = 0;
+		CURRENT_SC = NULL;
 	}
 
 	if(!DISCONNECTED_SC) {
@@ -2503,7 +2503,7 @@
 			remove_SC(&DISCONNECTED_SC, ptr);
 
 			kfree(ptr->host_scribble);
-			ptr->host_scribble=0;
+			ptr->host_scribble=NULL;
 
 			ptr->result =  DID_RESET << 16;
 			ptr->scsi_done(ptr);
@@ -2976,7 +2976,7 @@
 		printk(KERN_DEBUG "none\n");
 
 	printk(KERN_DEBUG "disconnected_SC:\n");
-	for (ptr = DISCONNECTED_SC; ptr; ptr = SCDATA(ptr) ? SCNEXT(ptr) : 0)
+	for (ptr = DISCONNECTED_SC; ptr; ptr = SCDATA(ptr) ? SCNEXT(ptr) : NULL)
 		show_command(ptr);
 
 	disp_ports(shpnt);
@@ -3454,7 +3454,7 @@
 
 	if(thislength<0) {
 		DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: output too short\n");
-		*start = 0;
+		*start = NULL;
 		return 0;
 	}
 
@@ -3638,7 +3638,7 @@
 	aha152x_config conf;
 #endif
 #ifdef __ISAPNP__
-	struct pnp_dev *dev=0, *pnpdev[2] = {0, 0};
+	struct pnp_dev *dev=NULL, *pnpdev[2] = {NULL, NULL};
 #endif
 
 	if ( setup_count ) {
@@ -3901,7 +3901,7 @@
 #if defined(__ISAPNP__)
 			} else if( pnpdev[i] ) {
 				HOSTDATA(shpnt)->pnpdev=pnpdev[i];
-				pnpdev[i]=0;
+				pnpdev[i]=NULL;
 #endif
 			}
 		} else {
@@ -3923,7 +3923,7 @@
 
 	for(i=0; i<ARRAY_SIZE(setup); i++) {
 		aha152x_release(aha152x_host[i]);
-		aha152x_host[i]=0;
+		aha152x_host[i]=NULL;
 	}
 }
 
diff -Nru a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
--- a/drivers/scsi/aha1542.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/aha1542.c	2004-07-27 18:24:51 -07:00
@@ -545,7 +545,7 @@
 		my_done = SCtmp->scsi_done;
 		if (SCtmp->host_scribble) {
 			kfree(SCtmp->host_scribble);
-			SCtmp->host_scribble = 0;
+			SCtmp->host_scribble = NULL;
 		}
 		/* Fetch the sense data, and tuck it away, in the required slot.  The
 		   Adaptec automatically fetches it, and there is no guarantee that
diff -Nru a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
--- a/drivers/scsi/aic7xxx/aic79xx_core.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c	2004-07-27 18:24:51 -07:00
@@ -173,7 +173,7 @@
 					    struct ahd_devinfo *devinfo,
 					    u_int lun, cam_status status,
 					    char *message, int verbose_level);
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 static void		ahd_setup_target_msgin(struct ahd_softc *ahd,
 					       struct ahd_devinfo *devinfo,
 					       struct scb *scb);
@@ -1190,7 +1190,7 @@
 					ahd->msgin_index = 0;
 				}
 			}
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 			else {
 				if (bus_phase == P_MESGOUT) {
 					ahd->msg_type =
@@ -5303,7 +5303,7 @@
 
 		tstate = ahd->enabled_targets[i];
 		if (tstate != NULL) {
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 			int j;
 
 			for (j = 0; j < AHD_NUM_LUNS; j++) {
@@ -5319,7 +5319,7 @@
 			free(tstate, M_DEVBUF);
 		}
 	}
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 	if (ahd->black_hole != NULL) {
 		xpt_free_path(ahd->black_hole->path);
 		free(ahd->black_hole, M_DEVBUF);
@@ -6575,7 +6575,7 @@
 	ahd_outb(ahd, CLRSINT3, NTRAMPERR|OSRAMPERR);
 	ahd_outb(ahd, CLRINT, CLRSCSIINT);
 
-#if NEEDS_MORE_TESTING
+#ifdef NEEDS_MORE_TESTING
 	/*
 	 * Always enable abort on incoming L_Qs if this feature is
 	 * supported.  We use this to catch invalid SCB references.
@@ -7157,7 +7157,7 @@
 	if (match != 0)
 		match = ((lun == slun) || (lun == CAM_LUN_WILDCARD));
 	if (match != 0) {
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 		int group;
 
 		group = XPT_FC_GROUP(scb->io_ctx->ccb_h.func_code);
@@ -7768,7 +7768,7 @@
 	/* Make sure the sequencer is in a safe location. */
 	ahd_clear_critical_section(ahd);
 
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 	if ((ahd->flags & AHD_TARGETROLE) != 0) {
 		ahd_run_tqinfifo(ahd, /*paused*/TRUE);
 	}
diff -Nru a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
--- a/drivers/scsi/aic7xxx_old.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/scsi/aic7xxx_old.c	2004-07-27 18:24:53 -07:00
@@ -4881,7 +4881,7 @@
     }
     break;
 
-#if AIC7XXX_NOT_YET 
+#ifdef AIC7XXX_NOT_YET 
     case TRACEPOINT2:
       {
         printk(INFO_LEAD "Tracepoint #2 reached.\n", p->host_no,
@@ -9335,7 +9335,7 @@
                 printk(KERN_INFO "aic7xxx: MMAPed I/O failed, reverting to "
                                  "Programmed I/O.\n");
                 iounmap((void *) (((unsigned long) temp_p->maddr) & PAGE_MASK));
-                temp_p->maddr = 0;
+                temp_p->maddr = NULL;
                 if(temp_p->base == 0)
                 {
                   printk("aic7xxx: <%s> at PCI %d/%d/%d\n", 
@@ -9743,7 +9743,7 @@
     temp_p->pause = hcntrl | PAUSE | INTEN;
     temp_p->base = base;
     temp_p->mbase = 0;
-    temp_p->maddr = 0;
+    temp_p->maddr = NULL;
     temp_p->pci_bus = 0;
     temp_p->pci_device_fn = slot;
     aic_outb(temp_p, hcntrl | PAUSE, HCNTRL);
diff -Nru a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
--- a/drivers/scsi/dpt_i2o.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/scsi/dpt_i2o.c	2004-07-27 18:24:52 -07:00
@@ -1643,13 +1643,13 @@
 	u32 reply_size = 0;
 	u32 __user *user_msg = arg;
 	u32 __user * user_reply = NULL;
-	ulong sg_list[pHba->sg_tablesize];
+	void *sg_list[pHba->sg_tablesize];
 	u32 sg_offset = 0;
 	u32 sg_count = 0;
 	int sg_index = 0;
 	u32 i = 0;
 	u32 rcode = 0;
-	ulong p = 0;
+	void *p = NULL;
 	ulong flags = 0;
 
 	memset(&msg, 0, MAX_MESSAGE_SIZE*4);
@@ -1705,8 +1705,8 @@
 			}
 			sg_size = sg[i].flag_count & 0xffffff;      
 			/* Allocate memory for the transfer */
-			p = (ulong)kmalloc(sg_size, GFP_KERNEL|ADDR32);
-			if(p == 0) {
+			p = kmalloc(sg_size, GFP_KERNEL|ADDR32);
+			if(!p) {
 				printk(KERN_DEBUG"%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
 						pHba->name,sg_size,i,sg_count);
 				rcode = -ENOMEM;
@@ -1716,14 +1716,14 @@
 			/* Copy in the user's SG buffer if necessary */
 			if(sg[i].flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR*/) {
 				// TODO 64bit fix
-				if (copy_from_user((void*)p,(void*)sg[i].addr_bus, sg_size)) {
+				if (copy_from_user(p,(void __user *)sg[i].addr_bus, sg_size)) {
 					printk(KERN_DEBUG"%s: Could not copy SG buf %d FROM user\n",pHba->name,i);
 					rcode = -EFAULT;
 					goto cleanup;
 				}
 			}
 			//TODO 64bit fix
-			sg[i].addr_bus = (u32)virt_to_bus((void*)p);
+			sg[i].addr_bus = (u32)virt_to_bus(p);
 		}
 	}
 
@@ -1778,8 +1778,8 @@
 			if(! (sg[j].flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR*/)) {
 				sg_size = sg[j].flag_count & 0xffffff; 
 				// TODO 64bit fix
-				if (copy_to_user((void*)sg[j].addr_bus,(void*)sg_list[j], sg_size)) {
-					printk(KERN_WARNING"%s: Could not copy %lx TO user %x\n",pHba->name, sg_list[j], sg[j].addr_bus);
+				if (copy_to_user((void __user *)sg[j].addr_bus,sg_list[j], sg_size)) {
+					printk(KERN_WARNING"%s: Could not copy %p TO user %x\n",pHba->name, sg_list[j], sg[j].addr_bus);
 					rcode = -EFAULT;
 					goto cleanup;
 				}
@@ -1807,7 +1807,7 @@
 	while(sg_index) {
 		if(sg_list[--sg_index]) {
 			if (rcode != -ETIME && rcode != -EINTR)
-				kfree((void*)(sg_list[sg_index]));
+				kfree(sg_list[sg_index]);
 		}
 	}
 	return rcode;
diff -Nru a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c
--- a/drivers/scsi/eata_pio.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/scsi/eata_pio.c	2004-07-27 18:24:52 -07:00
@@ -840,7 +840,7 @@
 	u32 base;
 	int i;
 
-#if CHECKPAL
+#ifdef CHECKPAL
 	u8 pal1, pal2, pal3;
 #endif
 
@@ -848,7 +848,7 @@
 		if (EISAbases[i]) {	/* Still a possibility ?          */
 
 			base = 0x1c88 + (i * 0x1000);
-#if CHECKPAL
+#ifdef CHECKPAL
 			pal1 = inb((u16) base - 8);
 			pal2 = inb((u16) base - 7);
 			pal3 = inb((u16) base - 6);
@@ -868,7 +868,7 @@
 				}
 				/* Nothing found here so we take it from the list */
 				EISAbases[i] = 0;
-#if CHECKPAL
+#ifdef CHECKPAL
 			}
 #endif
 		}
@@ -929,7 +929,7 @@
 					EISAbases[x] = 0;
 				}
 			}
-#if CHECK_BLINK
+#ifdef CHECK_BLINK
 			else if (check_blink_state(base)) {
 				printk("eata_pio: HBA is in BLINK state.\n" "Consult your HBAs manual to correct this.\n");
 			}
diff -Nru a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
--- a/drivers/scsi/g_NCR5380.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/g_NCR5380.c	2004-07-27 18:24:51 -07:00
@@ -355,7 +355,7 @@
 		if (!(overrides[current_override].NCR5380_map_name))
 			continue;
 
-		ports = 0;
+		ports = NULL;
 		switch (overrides[current_override].board) {
 		case BOARD_NCR5380:
 			flags = FLAG_NO_PSEUDO_DMA;
diff -Nru a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
--- a/drivers/scsi/in2000.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/scsi/in2000.c	2004-07-27 18:24:52 -07:00
@@ -184,7 +184,7 @@
 static char *setup_args[] = { "", "", "", "", "", "", "", "", "" };
 
 /* filled in by 'insmod' */
-static char *setup_strings = 0;
+static char *setup_strings;
 
 MODULE_PARM(setup_strings, "s");
 
@@ -468,7 +468,7 @@
 	 */
 
 	cmd = (Scsi_Cmnd *) hostdata->input_Q;
-	prev = 0;
+	prev = NULL;
 	while (cmd) {
 		if (!(hostdata->busy[cmd->device->id] & (1 << cmd->device->lun)))
 			break;
@@ -1702,7 +1702,7 @@
  */
 
 	tmp = (Scsi_Cmnd *) hostdata->input_Q;
-	prev = 0;
+	prev = NULL;
 	while (tmp) {
 		if (tmp == cmd) {
 			if (prev)
@@ -1923,7 +1923,7 @@
  */
 
 	if (!done_setup && setup_strings)
-		in2000_setup(setup_strings, 0);
+		in2000_setup(setup_strings, NULL);
 
 	detect_count = 0;
 	for (bios = 0; bios_tab[bios]; bios++) {
diff -Nru a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
--- a/drivers/scsi/ncr53c8xx.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/ncr53c8xx.c	2004-07-27 18:24:51 -07:00
@@ -4520,7 +4520,7 @@
 	*/
 
 	if (cp == tp->nego_cp)
-		tp->nego_cp = 0;
+		tp->nego_cp = NULL;
 
 	/*
 	**	If auto-sense performed, change scsi status.
@@ -4538,7 +4538,7 @@
 		if (cp == lp->held_ccb) {
 			xpt_que_splice(&lp->skip_ccbq, &lp->wait_ccbq);
 			xpt_que_init(&lp->skip_ccbq);
-			lp->held_ccb = 0;
+			lp->held_ccb = NULL;
 		}
 	}
 
@@ -5646,7 +5646,7 @@
 	} else {
 		script_ofs	= dsp;
 		script_size	= 0;
-		script_base	= 0;
+		script_base	= NULL;
 		script_name	= "mem";
 	}
 
@@ -6125,7 +6125,7 @@
 	if (!(cmd & 6)) {
 		cp = np->header.cp;
 		if (CCB_PHYS(cp, phys) != dsa)
-			cp = 0;
+			cp = NULL;
 	} else {
 		cp  = np->ccb;
 		while (cp && (CCB_PHYS (cp, phys) != dsa))
@@ -6136,7 +6136,7 @@
 	**	try to find the interrupted script command,
 	**	and the address at which to continue.
 	*/
-	vdsp	= 0;
+	vdsp	= NULL;
 	nxtdsp	= 0;
 	if	(dsp >  np->p_script &&
 		 dsp <= np->p_script + sizeof(struct script)) {
@@ -6533,7 +6533,7 @@
 	u_char scntl3;
 	u_char chg, ofs, per, fak, wide;
 	u_char num = INB (nc_dsps);
-	struct ccb *cp=0;
+	struct ccb *cp=NULL;
 	u_long	dsa    = INL (nc_dsa);
 	u_char	target = INB (nc_sdid) & 0x0f;
 	struct tcb *tp     = &np->target[target];
@@ -7046,7 +7046,7 @@
 			if (cp->magic) {
 				PRINT_LUN(np, tn, ln);
 				printk ("ccb free list corrupted (@%p)\n", cp);
-				cp = 0;
+				cp = NULL;
 			}
 			else {
 				xpt_insque_tail(qp, &lp->wait_ccbq);
@@ -7232,7 +7232,7 @@
 {
 	struct tcb *tp = &np->target[tn];
 	struct lcb *lp = tp->lp[ln];
-	struct ccb *cp = 0;
+	struct ccb *cp = NULL;
 
 	/*
 	**	Allocate memory for this CCB.
@@ -8095,7 +8095,7 @@
      NCR_LOCK_NCB(np, flags);
      ncr_exception(np);
      done_list     = np->done_list;
-     np->done_list = 0;
+     np->done_list = NULL;
      NCR_UNLOCK_NCB(np, flags);
 
      if (DEBUG_FLAGS & DEBUG_TINY) printk ("]\n");
@@ -8121,7 +8121,7 @@
      NCR_LOCK_NCB(np, flags);
      ncr_timeout(np);
      done_list     = np->done_list;
-     np->done_list = 0;
+     np->done_list = NULL;
      NCR_UNLOCK_NCB(np, flags);
 
      if (done_list) {
@@ -8154,7 +8154,7 @@
 	sts = ncr_reset_bus(np, cmd, 1);
 
 	done_list     = np->done_list;
-	np->done_list = 0;
+	np->done_list = NULL;
 	NCR_UNLOCK_NCB(np, flags);
 
 	ncr_flush_done_cmds(done_list);
@@ -8195,7 +8195,7 @@
 	sts = ncr_abort_command(np, cmd);
 out:
 	done_list     = np->done_list;
-	np->done_list = 0;
+	np->done_list = NULL;
 	NCR_UNLOCK_NCB(np, flags);
 
 	ncr_flush_done_cmds(done_list);
@@ -8226,7 +8226,7 @@
 #ifdef DEBUG_WAITING_LIST
 	printk("%s: cmd %lx inserted into waiting list\n", ncr_name(np), (u_long) cmd);
 #endif
-	cmd->next_wcmd = 0;
+	cmd->next_wcmd = NULL;
 	if (!(wcmd = np->waiting_list)) np->waiting_list = cmd;
 	else {
 		while ((wcmd->next_wcmd) != 0)
@@ -8243,7 +8243,7 @@
 		if (cmd == *pcmd) {
 			if (to_remove) {
 				*pcmd = (struct scsi_cmnd *) cmd->next_wcmd;
-				cmd->next_wcmd = 0;
+				cmd->next_wcmd = NULL;
 			}
 #ifdef DEBUG_WAITING_LIST
 	printk("%s: cmd %lx retrieved from waiting list\n", ncr_name(np), (u_long) cmd);
@@ -8252,7 +8252,7 @@
 		}
 		pcmd = (struct scsi_cmnd **) &(*pcmd)->next_wcmd;
 	}
-	return 0;
+	return NULL;
 }
 
 static void process_waiting_list(struct ncb *np, int sts)
@@ -8260,14 +8260,14 @@
 	struct scsi_cmnd *waiting_list, *wcmd;
 
 	waiting_list = np->waiting_list;
-	np->waiting_list = 0;
+	np->waiting_list = NULL;
 
 #ifdef DEBUG_WAITING_LIST
 	if (waiting_list) printk("%s: waiting_list=%lx processing sts=%d\n", ncr_name(np), (u_long) waiting_list, sts);
 #endif
 	while ((wcmd = waiting_list) != 0) {
 		waiting_list = (struct scsi_cmnd *) wcmd->next_wcmd;
-		wcmd->next_wcmd = 0;
+		wcmd->next_wcmd = NULL;
 		if (sts == DID_OK) {
 #ifdef DEBUG_WAITING_LIST
 	printk("%s: cmd %lx trying to requeue\n", ncr_name(np), (u_long) wcmd);
@@ -8535,7 +8535,7 @@
 			int length, int func)
 {
 	struct host_data *host_data;
-	struct ncb *ncb = 0;
+	struct ncb *ncb = NULL;
 	int retv;
 
 #ifdef DEBUG_PROC_INFO
@@ -8579,7 +8579,7 @@
 **==========================================================
 */
 #ifdef	MODULE
-char *ncr53c8xx = 0;	/* command line passed by insmod */
+char *ncr53c8xx;	/* command line passed by insmod */
 MODULE_PARM(ncr53c8xx, "s");
 #endif
 
@@ -8617,8 +8617,8 @@
 					int unit, struct ncr_device *device)
 {
 	struct host_data *host_data;
-	struct ncb *np = 0;
-	struct Scsi_Host *instance = 0;
+	struct ncb *np = NULL;
+	struct Scsi_Host *instance = NULL;
 	u_long flags = 0;
 	int i;
 
diff -Nru a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
--- a/drivers/scsi/nsp32.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/nsp32.c	2004-07-27 18:24:51 -07:00
@@ -1604,7 +1604,7 @@
 	thislength = pos - (buffer + offset);
 
 	if(thislength < 0) {
-		*start = 0;
+		*start = NULL;
                 return 0;
         }
 
diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
--- a/drivers/scsi/qla1280.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/scsi/qla1280.c	2004-07-27 18:24:53 -07:00
@@ -3667,7 +3667,7 @@
 qla1280_req_pkt(struct scsi_qla_host *ha)
 {
 	struct device_reg *reg = ha->iobase;
-	request_t *pkt = 0;
+	request_t *pkt = NULL;
 	int cnt;
 	uint32_t timer;
 
@@ -3774,7 +3774,7 @@
 {
 	struct device_reg *reg = ha->iobase;
 	struct response *pkt;
-	struct srb *sp = 0;
+	struct srb *sp = NULL;
 	uint16_t mailbox[MAILBOX_REGISTER_COUNT];
 	uint16_t *wptr;
 	uint32_t index;
@@ -3832,11 +3832,11 @@
 				if (index < MAX_OUTSTANDING_COMMANDS)
 					sp = ha->outstanding_cmds[index];
 				else
-					sp = 0;
+					sp = NULL;
 
 				if (sp) {
 					/* Free outstanding command slot. */
-					ha->outstanding_cmds[index] = 0;
+					ha->outstanding_cmds[index] = NULL;
 
 					/* Save ISP completion status */
 					CMD_RESULT(sp->cmd) = 0;
@@ -4095,7 +4095,7 @@
 	}
 
 	/* Free outstanding command slot. */
-	ha->outstanding_cmds[handle] = 0;
+	ha->outstanding_cmds[handle] = NULL;
 
 	cmd = sp->cmd;
 
@@ -4188,11 +4188,11 @@
 	if (handle < MAX_OUTSTANDING_COMMANDS)
 		sp = ha->outstanding_cmds[handle];
 	else
-		sp = 0;
+		sp = NULL;
 
 	if (sp) {
 		/* Free outstanding command slot. */
-		ha->outstanding_cmds[handle] = 0;
+		ha->outstanding_cmds[handle] = NULL;
 
 		/* Bad payload or header */
 		if (pkt->entry_status & (BIT_3 + BIT_2)) {
diff -Nru a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
--- a/drivers/scsi/qla2xxx/qla_isr.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/scsi/qla2xxx/qla_isr.c	2004-07-27 18:24:53 -07:00
@@ -686,7 +686,7 @@
 	sp = ha->outstanding_cmds[index];
 	if (sp) {
 		/* Free outstanding command slot. */
-		ha->outstanding_cmds[index] = 0;
+		ha->outstanding_cmds[index] = NULL;
 
 		if (ha->actthreads)
 			ha->actthreads--;
@@ -836,7 +836,7 @@
 	/* Validate handle. */
 	if (pkt->handle < MAX_OUTSTANDING_COMMANDS) {
 		sp = ha->outstanding_cmds[pkt->handle];
-		ha->outstanding_cmds[pkt->handle] = 0;
+		ha->outstanding_cmds[pkt->handle] = NULL;
 	} else
 		sp = NULL;
 
@@ -1320,7 +1320,7 @@
 
 	if (sp) {
 		/* Free outstanding command slot. */
-		ha->outstanding_cmds[pkt->handle] = 0;
+		ha->outstanding_cmds[pkt->handle] = NULL;
 		if (ha->actthreads)
 			ha->actthreads--;
 		sp->lun_queue->out_cnt--;
@@ -1383,7 +1383,7 @@
 	CMD_ENTRY_STATUS(sp->cmd) = pkt->entry_status;
 
 	/* Free outstanding command slot. */
-	ha->outstanding_cmds[pkt->handle1] = 0;
+	ha->outstanding_cmds[pkt->handle1] = NULL;
 
 	add_to_done_queue(ha, sp);
 }
diff -Nru a/drivers/scsi/st.c b/drivers/scsi/st.c
--- a/drivers/scsi/st.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/scsi/st.c	2004-07-27 18:24:52 -07:00
@@ -3974,7 +3974,7 @@
 	for (i = 0; i < st_dev_max; i++) {
 		tpnt = scsi_tapes[i];
 		if (tpnt != NULL && tpnt->device == SDp) {
-			scsi_tapes[i] = 0;
+			scsi_tapes[i] = NULL;
 			st_nr_dev--;
 			write_unlock(&st_dev_arr_lock);
 			devfs_unregister_tape(tpnt->disk->number);
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_fw.c b/drivers/scsi/sym53c8xx_2/sym_fw.c
--- a/drivers/scsi/sym53c8xx_2/sym_fw.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/scsi/sym53c8xx_2/sym_fw.c	2004-07-27 18:24:52 -07:00
@@ -383,7 +383,7 @@
 		return &sym_fw1;
 #endif
 	else
-		return 0;
+		return NULL;
 }
 
 /*
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c	2004-07-27 18:24:53 -07:00
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c	2004-07-27 18:24:53 -07:00
@@ -868,7 +868,7 @@
 	}
 
 	/* Revert everything */
-	SYM_UCMD_PTR(cmd)->eh_wait = 0;
+	SYM_UCMD_PTR(cmd)->eh_wait = NULL;
 	cmd->scsi_done = ep->old_done;
 
 	/* Wake up the eh thread if it wants to sleep */
@@ -965,7 +965,7 @@
 
 	/* On error, restore everything and cross fingers :) */
 	if (sts) {
-		SYM_UCMD_PTR(cmd)->eh_wait = 0;
+		SYM_UCMD_PTR(cmd)->eh_wait = NULL;
 		cmd->scsi_done = ep->old_done;
 		to_do = SYM_EH_DO_IGNORE;
 	}
@@ -1568,7 +1568,7 @@
 			char **start, off_t offset, int length, int func)
 {
 	struct host_data *host_data;
-	struct sym_hcb *np = 0;
+	struct sym_hcb *np = NULL;
 	int retv;
 
 	host_data = (struct host_data *) host->hostdata;
@@ -1915,7 +1915,7 @@
 static struct sym_driver_setup
 	sym_driver_safe_setup __initdata = SYM_LINUX_DRIVER_SAFE_SETUP;
 #ifdef	MODULE
-char *sym53c8xx = 0;	/* command line passed by insmod */
+char *sym53c8xx;	/* command line passed by insmod */
 MODULE_PARM(sym53c8xx, "s");
 #endif
 
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h
--- a/drivers/scsi/sym53c8xx_2/sym_glue.h	2004-07-27 18:24:53 -07:00
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.h	2004-07-27 18:24:53 -07:00
@@ -481,7 +481,7 @@
 
 static __inline m_addr_t sym_m_get_dma_mem_cluster(m_pool_p mp, m_vtob_p vbp)
 {
-	void *vaddr = 0;
+	void *vaddr = NULL;
 	dma_addr_t baddr = 0;
 
 	vaddr = pci_alloc_consistent(mp->dev_dmat,SYM_MEM_CLUSTER_SIZE, &baddr);
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c	2004-07-27 18:24:51 -07:00
@@ -1302,7 +1302,7 @@
 	} else {
 		script_ofs	= dsp;
 		script_size	= 0;
-		script_base	= 0;
+		script_base	= NULL;
 		script_name	= "mem";
 	}
 
@@ -1440,7 +1440,7 @@
 		return chip;
 	}
 
-	return 0;
+	return NULL;
 }
 
 #if SYM_CONF_DMA_ADDRESSING_MODE == 2
@@ -2490,7 +2490,7 @@
 	 *  try to find the interrupted script command,
 	 *  and the address at which to continue.
 	 */
-	vdsp	= 0;
+	vdsp	= NULL;
 	nxtdsp	= 0;
 	if	(dsp >  np->scripta_ba &&
 		 dsp <= np->scripta_ba + np->scripta_sz) {
@@ -3400,7 +3400,7 @@
 		 *  we are not in race.
 		 */
 		i = 0;
-		cp = 0;
+		cp = NULL;
 		FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
 			cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
 			if (cp->host_status != HS_BUSY &&
@@ -3516,7 +3516,7 @@
 		 *  abort for this target.
 		 */
 		i = 0;
-		cp = 0;
+		cp = NULL;
 		FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
 			cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
 			if (cp->host_status != HS_DISCONNECT)
@@ -3698,7 +3698,7 @@
 	else if (dp_scr == SCRIPTA_BA (np, pm1_data))
 		pm = &cp->phys.pm1;
 	else
-		pm = 0;
+		pm = NULL;
 
 	if (pm) {
 		dp_scr  = scr_to_cpu(pm->ret);
@@ -4946,7 +4946,7 @@
 	 *  used for negotiation, clear this info in the tcb.
 	 */
 	if (cp == tp->nego_cp)
-		tp->nego_cp = 0;
+		tp->nego_cp = NULL;
 
 #ifdef SYM_CONF_IARB_SUPPORT
 	/*
@@ -4965,7 +4965,7 @@
 	/*
 	 *  Make this CCB available.
 	 */
-	cp->cam_ccb = 0;
+	cp->cam_ccb = NULL;
 	cp->host_status = HS_IDLE;
 	sym_remque(&cp->link_ccbq);
 	sym_insque_head(&cp->link_ccbq, &np->free_ccbq);
@@ -4997,7 +4997,7 @@
  */
 static ccb_p sym_alloc_ccb(hcb_p np)
 {
-	ccb_p cp = 0;
+	ccb_p cp = NULL;
 	int hcode;
 
 	/*
@@ -5005,7 +5005,7 @@
 	 *  queue to the controller.
 	 */
 	if (np->actccbs >= SYM_CONF_MAX_START)
-		return 0;
+		return NULL;
 
 	/*
 	 *  Allocate memory for this CCB.
@@ -5076,7 +5076,7 @@
 			sym_mfree_dma(cp->sns_bbuf,SYM_SNS_BBUF_LEN,"SNS_BBUF");
 		sym_mfree_dma(cp, sizeof(*cp), "CCB");
 	}
-	return 0;
+	return NULL;
 }
 
 /*
@@ -5134,7 +5134,7 @@
 	 *  allocation for not probed LUNs.
 	 */
 	if (!sym_is_bit(tp->lun_map, ln))
-		return 0;
+		return NULL;
 
 	/*
 	 *  Initialize the target control block if not yet.
@@ -5242,7 +5242,7 @@
 	lp->cb_tags = sym_calloc(SYM_CONF_MAX_TASK, "CB_TAGS");
 	if (!lp->cb_tags) {
 		sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
-		lp->itlq_tbl = 0;
+		lp->itlq_tbl = NULL;
 		goto fail;
 	}
 
@@ -5471,7 +5471,7 @@
 	/*
 	 *  Look up our CCB control block.
 	 */
-	cp = 0;
+	cp = NULL;
 	FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
 		ccb_p cp2 = sym_que_entry(qp, struct sym_ccb, link_ccbq);
 		if (cp2->cam_ccb == ccb) {
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.h	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h	2004-07-27 18:24:51 -07:00
@@ -613,10 +613,10 @@
  *  LUN(s) > 0.
  */
 #if SYM_CONF_MAX_LUN <= 1
-#define sym_lp(np, tp, lun) (!lun) ? (tp)->lun0p : 0
+#define sym_lp(np, tp, lun) (!lun) ? (tp)->lun0p : NULL
 #else
 #define sym_lp(np, tp, lun) \
-	(!lun) ? (tp)->lun0p : (tp)->lunmp ? (tp)->lunmp[(lun)] : 0
+	(!lun) ? (tp)->lun0p : (tp)->lunmp ? (tp)->lunmp[(lun)] : NULL
 #endif
 
 /*
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_malloc.c b/drivers/scsi/sym53c8xx_2/sym_malloc.c
--- a/drivers/scsi/sym53c8xx_2/sym_malloc.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/scsi/sym53c8xx_2/sym_malloc.c	2004-07-27 18:24:52 -07:00
@@ -83,7 +83,7 @@
 	m_link_p h = mp->h;
 
 	if (size > SYM_MEM_CLUSTER_SIZE)
-		return 0;
+		return NULL;
 
 	while (size > s) {
 		s <<= 1;
@@ -95,7 +95,7 @@
 		if (s == SYM_MEM_CLUSTER_SIZE) {
 			h[j].next = (m_link_p) M_GET_MEM_CLUSTER();
 			if (h[j].next)
-				h[j].next->next = 0;
+				h[j].next->next = NULL;
 			break;
 		}
 		++j;
@@ -108,7 +108,7 @@
 			j -= 1;
 			s >>= 1;
 			h[j].next = (m_link_p) (a+s);
-			h[j].next->next = 0;
+			h[j].next->next = NULL;
 		}
 	}
 #ifdef DEBUG
@@ -225,10 +225,10 @@
 
 #ifdef	SYM_MEM_FREE_UNUSED
 static struct sym_m_pool mp0 =
-	{0, ___mp0_get_mem_cluster, ___mp0_free_mem_cluster};
+	{NULL, ___mp0_get_mem_cluster, ___mp0_free_mem_cluster};
 #else
 static struct sym_m_pool mp0 =
-	{0, ___mp0_get_mem_cluster};
+	{NULL, ___mp0_get_mem_cluster};
 #endif
 
 /*
@@ -310,7 +310,7 @@
 /* Create a new memory DMAable pool (when fetch failed) */
 static m_pool_p ___cre_dma_pool(m_pool_ident_t dev_dmat)
 {
-	m_pool_p mp = 0;
+	m_pool_p mp = NULL;
 
 	mp = __sym_calloc(&mp0, sizeof(*mp), "MPOOL");
 	if (mp) {
@@ -327,7 +327,7 @@
 	}
 	if (mp)
 		__sym_mfree(&mp0, mp, sizeof(*mp), "MPOOL");
-	return 0;
+	return NULL;
 }
 
 #ifdef	SYM_MEM_FREE_UNUSED
@@ -352,7 +352,7 @@
 void *__sym_calloc_dma_unlocked(m_pool_ident_t dev_dmat, int size, char *name)
 {
 	m_pool_p mp;
-	void *m = 0;
+	void *m = NULL;
 
 	mp = ___get_dma_pool(dev_dmat);
 	if (!mp)
@@ -392,7 +392,7 @@
 {
 	m_pool_p mp;
 	int hc = VTOB_HASH_CODE(m);
-	m_vtob_p vp = 0;
+	m_vtob_p vp = NULL;
 	m_addr_t a = ((m_addr_t) m) & ~SYM_MEM_CLUSTER_MASK;
 
 	mp = ___get_dma_pool(dev_dmat);
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_misc.h b/drivers/scsi/sym53c8xx_2/sym_misc.h
--- a/drivers/scsi/sym53c8xx_2/sym_misc.h	2004-07-27 18:24:53 -07:00
+++ b/drivers/scsi/sym53c8xx_2/sym_misc.h	2004-07-27 18:24:53 -07:00
@@ -151,7 +151,7 @@
 	if (elem != head)
 		__sym_que_del(head, elem->flink);
 	else
-		elem = 0;
+		elem = NULL;
 	return elem;
 }
 
diff -Nru a/drivers/scsi/sym53c8xx_2/sym_nvram.c b/drivers/scsi/sym53c8xx_2/sym_nvram.c
--- a/drivers/scsi/sym53c8xx_2/sym_nvram.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c	2004-07-27 18:24:52 -07:00
@@ -330,7 +330,7 @@
 			    u_char *gpcntl)
 {
 	OUTB (nc_gpcntl, *gpcntl & 0xfe);
-	S24C16_do_bit(np, 0, write_bit, gpreg);
+	S24C16_do_bit(np, NULL, write_bit, gpreg);
 	OUTB (nc_gpcntl, *gpcntl);
 }
 
@@ -356,7 +356,7 @@
 	int x;
 	
 	for (x = 0; x < 8; x++)
-		S24C16_do_bit(np, 0, (write_data >> (7 - x)) & 0x01, gpreg);
+		S24C16_do_bit(np, NULL, (write_data >> (7 - x)) & 0x01, gpreg);
 		
 	S24C16_read_ack(np, ack_data, gpreg, gpcntl);
 }
diff -Nru a/drivers/scsi/sym53c8xx_comm.h b/drivers/scsi/sym53c8xx_comm.h
--- a/drivers/scsi/sym53c8xx_comm.h	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/sym53c8xx_comm.h	2004-07-27 18:24:51 -07:00
@@ -210,7 +210,7 @@
 	if (elem != head)
 		__xpt_que_del(head, elem->flink);
 	else
-		elem = 0;
+		elem = NULL;
 	return elem;
 }
 
@@ -375,7 +375,7 @@
 	m_link_s *h = mp->h;
 
 	if (size > (PAGE_SIZE << MEMO_PAGE_ORDER))
-		return 0;
+		return NULL;
 
 	while (size > s) {
 		s <<= 1;
@@ -387,7 +387,7 @@
 		if (s == (PAGE_SIZE << MEMO_PAGE_ORDER)) {
 			h[j].next = (m_link_s *) M_GETP();
 			if (h[j].next)
-				h[j].next->next = 0;
+				h[j].next->next = NULL;
 			break;
 		}
 		++j;
@@ -400,7 +400,7 @@
 			j -= 1;
 			s >>= 1;
 			h[j].next = (m_link_s *) (a+s);
-			h[j].next->next = 0;
+			h[j].next->next = NULL;
 		}
 	}
 #ifdef DEBUG
@@ -503,7 +503,7 @@
 	--mp->nump;
 }
 
-static m_pool_s mp0 = {0, ___mp0_getp, ___mp0_freep};
+static m_pool_s mp0 = {NULL, ___mp0_getp, ___mp0_freep};
 
 /*
  * DMAable pools.
@@ -595,7 +595,7 @@
 {
 	u_long flags;
 	struct m_pool *mp;
-	void *m = 0;
+	void *m = NULL;
 
 	NCR_LOCK_DRIVER(flags);
 	mp = ___get_dma_pool(bush);
@@ -629,7 +629,7 @@
 	u_long flags;
 	m_pool_s *mp;
 	int hc = VTOB_HASH_CODE(m);
-	m_vtob_s *vp = 0;
+	m_vtob_s *vp = NULL;
 	m_addr_t a = ((m_addr_t) m) & ~MEMO_CLUSTER_MASK;
 
 	NCR_LOCK_DRIVER(flags);
diff -Nru a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
--- a/drivers/scsi/ultrastor.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/scsi/ultrastor.c	2004-07-27 18:24:51 -07:00
@@ -948,9 +948,9 @@
 	return SCSI_ABORT_NOT_RUNNING;
 
     if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort");
-    config.mscp[mscp_index].SCint = 0;
+    config.mscp[mscp_index].SCint = NULL;
     done = config.mscp[mscp_index].done;
-    config.mscp[mscp_index].done = 0;
+    config.mscp[mscp_index].done = NULL;
     SCpnt->result = DID_ABORT << 16;
     
     /* Take the host lock to guard against scsi layer re-entry */
@@ -1000,9 +1000,9 @@
 	  {
 	    config.mscp[i].SCint->result = DID_RESET << 16;
 	    config.mscp[i].done(config.mscp[i].SCint);
-	    config.mscp[i].done = 0;
+	    config.mscp[i].done = NULL;
 	  }
-	config.mscp[i].SCint = 0;
+	config.mscp[i].SCint = NULL;
       }
 #endif
 
@@ -1083,7 +1083,7 @@
 	if (icm_status == 3) {
 	    void (*done)(Scsi_Cmnd *) = mscp->done;
 	    if (done) {
-		mscp->done = 0;
+		mscp->done = NULL;
 		mscp->SCint->result = DID_ABORT << 16;
 		done(mscp->SCint);
 	    }
@@ -1114,7 +1114,7 @@
        once we call done, we may get another command queued before this
        interrupt service routine can return. */
     done = mscp->done;
-    mscp->done = 0;
+    mscp->done = NULL;
 
     /* Let the higher levels know that we're done */
     switch (mscp->adapter_status)
@@ -1138,7 +1138,7 @@
 
     SCtmp->result = status | mscp->target_status;
 
-    SCtmp->host_scribble = 0;
+    SCtmp->host_scribble = NULL;
 
     /* Free up mscp block for next command */
 #if ULTRASTOR_MAX_CMDS == 1
diff -Nru a/drivers/serial/Kconfig b/drivers/serial/Kconfig
--- a/drivers/serial/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/drivers/serial/Kconfig	2004-07-27 18:24:52 -07:00
@@ -10,6 +10,7 @@
 # The new 8250/16550 serial drivers
 config SERIAL_8250
 	tristate "8250/16550 and compatible serial support"
+	depends on (BROKEN || !SPARC64)
 	select SERIAL_CORE
 	---help---
 	  This selects whether you want to include the driver for the standard
diff -Nru a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
--- a/drivers/serial/pmac_zilog.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/serial/pmac_zilog.c	2004-07-27 18:24:51 -07:00
@@ -245,7 +245,7 @@
 			if (tty->flip.count >= TTY_FLIPBUF_SIZE)
 				drop = 1;
 			if (ZS_IS_ASLEEP(uap))
-				return 0;
+				return NULL;
 			if (!ZS_IS_OPEN(uap))
 				goto retry;
 		}
@@ -1433,6 +1433,7 @@
 			ioremap(np->addrs[np->n_addrs - 1].address, 0x1000);
 		if (uap->rx_dma_regs == NULL) {	
 			iounmap((void *)uap->tx_dma_regs);
+			uap->tx_dma_regs = NULL;
 			uap->flags &= ~PMACZILOG_FLAG_HAS_DMA;
 			goto no_dma;
 		}
@@ -1490,7 +1491,6 @@
 	uap->port.ops = &pmz_pops;
 	uap->port.type = PORT_PMAC_ZILOG;
 	uap->port.flags = 0;
-	spin_lock_init(&uap->port.lock);
 
 	/* Setup some valid baud rate information in the register
 	 * shadows so we don't write crap there before baud rate is
@@ -1508,10 +1508,13 @@
 {
 	struct device_node *np;
 
-	iounmap((void *)uap->control_reg);
 	np = uap->node;
+	iounmap((void *)uap->rx_dma_regs);
+	iounmap((void *)uap->tx_dma_regs);
+	iounmap((void *)uap->control_reg);
 	uap->node = NULL;
 	of_node_put(np);
+	memset(uap, 0, sizeof(struct uart_pmac_port));
 }
 
 /*
@@ -1798,7 +1801,7 @@
 	 * Register this driver with the serial core
 	 */
 	rc = uart_register_driver(&pmz_uart_reg);
-	if (rc != 0)
+	if (rc)
 		return rc;
 
 	/*
@@ -1808,10 +1811,19 @@
 		struct uart_pmac_port *uport = &pmz_ports[i];
 		/* NULL node may happen on wallstreet */
 		if (uport->node != NULL)
-			uart_add_one_port(&pmz_uart_reg, &uport->port);
+			rc = uart_add_one_port(&pmz_uart_reg, &uport->port);
+		if (rc)
+			goto err_out;
 	}
 
 	return 0;
+err_out:
+	while (i-- > 0) {
+		struct uart_pmac_port *uport = &pmz_ports[i];
+		uart_remove_one_port(&pmz_uart_reg, &uport->port);
+	}
+	uart_unregister_driver(&pmz_uart_reg);
+	return rc;
 }
 
 static struct of_match pmz_match[] = 
@@ -1841,6 +1853,7 @@
 
 static int __init init_pmz(void)
 {
+	int rc, i;
 	printk(KERN_INFO "%s\n", version);
 
 	/* 
@@ -1862,7 +1875,16 @@
 	/*
 	 * Now we register with the serial layer
 	 */
-	pmz_register();
+	rc = pmz_register();
+	if (rc) {
+		printk(KERN_ERR 
+			"pmac_zilog: Error registering serial device, disabling pmac_zilog.\n"
+		 	"pmac_zilog: Did another serial driver already claim the minors?\n"); 
+		/* effectively "pmz_unprobe()" */
+		for (i=0; i < pmz_ports_count; i++)
+			pmz_dispose_port(&pmz_ports[i]);
+		return rc;
+	}
 	
 	/*
 	 * Then we register the macio driver itself
diff -Nru a/drivers/serial/suncore.c b/drivers/serial/suncore.c
--- a/drivers/serial/suncore.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/serial/suncore.c	2004-07-27 18:24:51 -07:00
@@ -90,13 +90,13 @@
 	cflag = CREAD | HUPCL | CLOCAL;
 
 	s = mode;
-	baud = simple_strtoul(s, 0, 0);
+	baud = simple_strtoul(s, NULL, 0);
 	s = strchr(s, ',');
-	bits = simple_strtoul(++s, 0, 0);
+	bits = simple_strtoul(++s, NULL, 0);
 	s = strchr(s, ',');
 	parity = *(++s);
 	s = strchr(s, ',');
-	stop = simple_strtoul(++s, 0, 0);
+	stop = simple_strtoul(++s, NULL, 0);
 	s = strchr(s, ',');
 	/* XXX handshake is not handled here. */
 
diff -Nru a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
--- a/drivers/serial/sunsu.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/serial/sunsu.c	2004-07-27 18:24:51 -07:00
@@ -1045,7 +1045,7 @@
 {
 	unsigned char status1, status2, scratch, scratch2, scratch3;
 	unsigned char save_lcr, save_mcr;
-	struct linux_ebus_device *dev = 0;
+	struct linux_ebus_device *dev = NULL;
 	struct linux_ebus *ebus;
 #ifdef CONFIG_SPARC64
 	struct sparc_isa_bridge *isa_br;
diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/usb/core/hub.c	2004-07-27 18:24:51 -07:00
@@ -1253,8 +1253,8 @@
 	return 0;
 }
 
-#define	hub_suspend		0
-#define	hub_resume		0
+#define	hub_suspend		NULL
+#define	hub_resume		NULL
 #define	remote_wakeup(x)	0
 
 #endif	/* CONFIG_USB_SUSPEND */
diff -Nru a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
--- a/drivers/usb/gadget/rndis.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/usb/gadget/rndis.c	2004-07-27 18:24:51 -07:00
@@ -1323,11 +1323,15 @@
 int rndis_proc_write (struct file *file, const char __user *buffer, 
 		      unsigned long count, void *data)
 {
+	rndis_params *p = data;
 	u32 speed = 0;
 	int i, fl_speed = 0;
 	
 	for (i = 0; i < count; i++) {
-		switch (*buffer) {
+		char c;
+		if (get_user(c, buffer))
+			return -EFAULT;
+		switch (c) {
 		case '0':
 		case '1':
 		case '2':
@@ -1339,21 +1343,19 @@
 		case '8':
 		case '9':
 			fl_speed = 1;
-			speed = speed*10 + *buffer - '0';
+			speed = speed*10 + c - '0';
 			break;
 		case 'C':
 		case 'c':
-			rndis_signal_connect (((rndis_params *) data)
-				->confignr);
+			rndis_signal_connect (p->confignr);
 			break;
 		case 'D':
 		case 'd':
-			rndis_signal_disconnect (((rndis_params *) data)
-				->confignr);
+			rndis_signal_disconnect(p->confignr);
 			break;
 		default: 
-			if (fl_speed) ((rndis_params *) data)->speed = speed;
-			else DEBUG ("%c is not valid\n", *buffer);
+			if (fl_speed) p->speed = speed;
+			else DEBUG ("%c is not valid\n", c);
 			break;
 		}
 		
diff -Nru a/drivers/usb/media/pwc-if.c b/drivers/usb/media/pwc-if.c
--- a/drivers/usb/media/pwc-if.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/usb/media/pwc-if.c	2004-07-27 18:24:52 -07:00
@@ -1150,7 +1150,7 @@
 	DECLARE_WAITQUEUE(wait, current);
         int bytes_to_read;
 
-	Trace(TRACE_READ, "video_read(0x%p, %p, %d) called.\n", vdev, buf, count);
+	Trace(TRACE_READ, "video_read(0x%p, %p, %zd) called.\n", vdev, buf, count);
 	if (vdev == NULL)
 		return -EFAULT;
 	pdev = vdev->priv;
diff -Nru a/drivers/video/Kconfig b/drivers/video/Kconfig
--- a/drivers/video/Kconfig	2004-07-27 18:24:51 -07:00
+++ b/drivers/video/Kconfig	2004-07-27 18:24:51 -07:00
@@ -93,7 +93,7 @@
 
 config FB_CYBER2000
 	tristate "CyberPro 2000/2010/5000 support"
-	depends on FB && PCI
+	depends on FB && PCI && (BROKEN || !SPARC64)
 	help
 	  This enables support for the Integraphics CyberPro 20x0 and 5000
 	  VGA chips used in the Rebel.com Netwinder and other machines.
@@ -238,7 +238,7 @@
 
 config FB_S3TRIO
 	bool "S3 Trio display support"
-	depends on FB && PPC
+	depends on FB && PPC && BROKEN
 	help
 	  If you have a S3 Trio say Y. Say N for S3 Virge.
 
diff -Nru a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
--- a/drivers/video/aty/atyfb_base.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/video/aty/atyfb_base.c	2004-07-27 18:24:52 -07:00
@@ -1405,7 +1405,7 @@
 		case PBOOK_SLEEP_REJECT:
 			if (par->save_framebuffer) {
 				vfree(par->save_framebuffer);
-				par->save_framebuffer = 0;
+				par->save_framebuffer = NULL;
 			}
 			break;
 		case PBOOK_SLEEP_NOW:
@@ -1435,7 +1435,7 @@
 				memcpy_toio((void *) info->screen_base,
 					    par->save_framebuffer, nb);
 				vfree(par->save_framebuffer);
-				par->save_framebuffer = 0;
+				par->save_framebuffer = NULL;
 			}
 			/* Restore display */
 			atyfb_set_par(info);
diff -Nru a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
--- a/drivers/video/aty/radeon_base.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/video/aty/radeon_base.c	2004-07-27 18:24:51 -07:00
@@ -432,7 +432,7 @@
 		printk(KERN_WARNING "radeonfb: Cannot match card to OF node !\n");
 		return -ENODEV;
 	}
-	val = (u32 *) get_property(dp, "ATY,RefCLK", 0);
+	val = (u32 *) get_property(dp, "ATY,RefCLK", NULL);
 	if (!val || !*val) {
 		printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n");
 		return -EINVAL;
@@ -440,11 +440,11 @@
 
 	rinfo->pll.ref_clk = (*val) / 10;
 
-	val = (u32 *) get_property(dp, "ATY,SCLK", 0);
+	val = (u32 *) get_property(dp, "ATY,SCLK", NULL);
 	if (val && *val)
 		rinfo->pll.sclk = (*val) / 10;
 
-	val = (u32 *) get_property(dp, "ATY,MCLK", 0);
+	val = (u32 *) get_property(dp, "ATY,MCLK", NULL);
 	if (val && *val)
 		rinfo->pll.mclk = (*val) / 10;
 
diff -Nru a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
--- a/drivers/video/chipsfb.c	2004-07-27 18:24:51 -07:00
+++ b/drivers/video/chipsfb.c	2004-07-27 18:24:51 -07:00
@@ -493,7 +493,7 @@
 	case PBOOK_SLEEP_REJECT:
 		if (save_framebuffer) {
 			vfree(save_framebuffer);
-			save_framebuffer = 0;
+			save_framebuffer = NULL;
 		}
 		break;
 	case PBOOK_SLEEP_NOW:
@@ -505,7 +505,7 @@
 		if (save_framebuffer) {
 			memcpy(p->screen_base, save_framebuffer, nb);
 			vfree(save_framebuffer);
-			save_framebuffer = 0;
+			save_framebuffer = NULL;
 		}
 		chipsfb_blank(0, p);
 		break;
diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
--- a/drivers/video/radeonfb.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/video/radeonfb.c	2004-07-27 18:24:52 -07:00
@@ -1221,7 +1221,7 @@
 
 	dp = pci_device_to_OF_node(rinfo->pdev);
 
-	xtal = (unsigned int *) get_property(dp, "ATY,RefCLK", 0);
+	xtal = (unsigned int *) get_property(dp, "ATY,RefCLK", NULL);
 
 	rinfo->pll.ref_clk = *xtal / 10;
 
diff -Nru a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
--- a/drivers/w1/w1_int.c	2004-07-27 18:24:52 -07:00
+++ b/drivers/w1/w1_int.c	2004-07-27 18:24:52 -07:00
@@ -49,7 +49,7 @@
 	dev = kmalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL);
 	if (!dev) {
 		printk(KERN_ERR
-			"Failed to allocate %d bytes for new w1 device.\n",
+			"Failed to allocate %zd bytes for new w1 device.\n",
 			sizeof(struct w1_master));
 		return NULL;
 	}
diff -Nru a/fs/binfmt_elf.c b/fs/binfmt_elf.c
--- a/fs/binfmt_elf.c	2004-07-27 18:24:51 -07:00
+++ b/fs/binfmt_elf.c	2004-07-27 18:24:51 -07:00
@@ -492,7 +492,7 @@
   	struct exec interp_ex;
 	char passed_fileno[6];
 	struct files_struct *files;
-	int executable_stack = EXSTACK_DEFAULT;
+	int have_pt_gnu_stack, executable_stack = EXSTACK_DEFAULT;
 	unsigned long def_flags = 0;
 	
 	/* Get the exec-header */
@@ -627,8 +627,7 @@
 				executable_stack = EXSTACK_DISABLE_X;
 			break;
 		}
-	if (i == elf_ex.e_phnum)
-		def_flags |= VM_EXEC | VM_MAYEXEC;
+	have_pt_gnu_stack = (i < elf_ex.e_phnum);
 
 	/* Some simple consistency checks for the interpreter */
 	if (elf_interpreter) {
@@ -701,6 +700,8 @@
 	/* Do this immediately, since STACK_TOP as used in setup_arg_pages
 	   may depend on the personality.  */
 	SET_PERSONALITY(elf_ex, ibcs2_interpreter);
+	if (elf_read_implies_exec(elf_ex, have_pt_gnu_stack))
+		current->personality |= READ_IMPLIES_EXEC;
 
 	/* Do this so that we can load the interpreter, if need be.  We will
 	   change some of these later */
diff -Nru a/fs/exec.c b/fs/exec.c
--- a/fs/exec.c	2004-07-27 18:24:51 -07:00
+++ b/fs/exec.c	2004-07-27 18:24:51 -07:00
@@ -887,8 +887,10 @@
 
 	if(!(bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID)) {
 		/* Set-uid? */
-		if (mode & S_ISUID)
+		if (mode & S_ISUID) {
+			current->personality &= ~PER_CLEAR_ON_SETID;
 			bprm->e_uid = inode->i_uid;
+		}
 
 		/* Set-gid? */
 		/*
@@ -896,8 +898,10 @@
 		 * is a candidate for mandatory locking, not a setgid
 		 * executable.
 		 */
-		if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP))
+		if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
+			current->personality &= ~PER_CLEAR_ON_SETID;
 			bprm->e_gid = inode->i_gid;
+		}
 	}
 
 	/* fill in binprm security blob */
diff -Nru a/fs/jffs/jffs_proc.c b/fs/jffs/jffs_proc.c
--- a/fs/jffs/jffs_proc.c	2004-07-27 18:24:52 -07:00
+++ b/fs/jffs/jffs_proc.c	2004-07-27 18:24:52 -07:00
@@ -68,9 +68,9 @@
 int jffs_register_jffs_proc_dir(int mtd, struct jffs_control *c)
 {
 	struct jffs_partition_dir *part_dir;
-	struct proc_dir_entry *part_info = 0;
-	struct proc_dir_entry *part_layout = 0;
-	struct proc_dir_entry *part_root = 0;
+	struct proc_dir_entry *part_info = NULL;
+	struct proc_dir_entry *part_layout = NULL;
+	struct proc_dir_entry *part_root = NULL;
 	char name[10];
 
 	sprintf(name, "%d", mtd);
@@ -127,7 +127,7 @@
 int jffs_unregister_jffs_proc_dir(struct jffs_control *c)
 {
 	struct jffs_partition_dir *part_dir = jffs_part_dirs;
-	struct jffs_partition_dir *prev_part_dir = 0;
+	struct jffs_partition_dir *prev_part_dir = NULL;
 
 	while (part_dir) {
 		if (part_dir->c == c) {
@@ -209,8 +209,8 @@
 		int count, int *eof, void *data)
 {
 	struct jffs_control *c = (struct jffs_control *) data;
-	struct jffs_fm *fm = 0;
-	struct jffs_fm *last_fm = 0;
+	struct jffs_fm *fm = NULL;
+	struct jffs_fm *last_fm = NULL;
 	int len = 0;
 
 	/* Get the first item in the list */
diff -Nru a/fs/jffs2/erase.c b/fs/jffs2/erase.c
--- a/fs/jffs2/erase.c	2004-07-27 18:24:51 -07:00
+++ b/fs/jffs2/erase.c	2004-07-27 18:24:51 -07:00
@@ -402,7 +402,7 @@
 			goto bad2;
 		}
 		if (retlen != sizeof(marker)) {
-			printk(KERN_WARNING "Short write to newly-erased block at 0x%08x: Wanted %d, got %zd\n",
+			printk(KERN_WARNING "Short write to newly-erased block at 0x%08x: Wanted %zd, got %zd\n",
 			       jeb->offset, sizeof(marker), retlen);
 			goto bad2;
 		}
diff -Nru a/fs/jffs2/gc.c b/fs/jffs2/gc.c
--- a/fs/jffs2/gc.c	2004-07-27 18:24:51 -07:00
+++ b/fs/jffs2/gc.c	2004-07-27 18:24:51 -07:00
@@ -824,7 +824,7 @@
 				continue;
 			}
 			if (retlen != rawlen) {
-				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Short read (%zd not %zd) reading header from obsolete node at %08x\n",
+				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Short read (%zd not %u) reading header from obsolete node at %08x\n",
 				       retlen, rawlen, ref_offset(raw));
 				continue;
 			}
diff -Nru a/fs/namespace.c b/fs/namespace.c
--- a/fs/namespace.c	2004-07-27 18:24:52 -07:00
+++ b/fs/namespace.c	2004-07-27 18:24:52 -07:00
@@ -1037,6 +1037,7 @@
 	struct namespace *new_ns;
 	struct vfsmount *rootmnt = NULL, *pwdmnt = NULL, *altrootmnt = NULL;
 	struct fs_struct *fs = tsk->fs;
+	struct vfsmount *p, *q;
 
 	if (!namespace)
 		return 0;
@@ -1071,14 +1072,16 @@
 	list_add_tail(&new_ns->list, &new_ns->root->mnt_list);
 	spin_unlock(&vfsmount_lock);
 
-	/* Second pass: switch the tsk->fs->* elements */
-	if (fs) {
-		struct vfsmount *p, *q;
-		write_lock(&fs->lock);
-
-		p = namespace->root;
-		q = new_ns->root;
-		while (p) {
+	/*
+	 * Second pass: switch the tsk->fs->* elements and mark new vfsmounts
+	 * as belonging to new namespace.  We have already acquired a private
+	 * fs_struct, so tsk->fs->lock is not needed.
+	 */
+	p = namespace->root;
+	q = new_ns->root;
+	while (p) {
+		q->mnt_namespace = new_ns;
+		if (fs) {
 			if (p == fs->rootmnt) {
 				rootmnt = p;
 				fs->rootmnt = mntget(q);
@@ -1091,10 +1094,9 @@
 				altrootmnt = p;
 				fs->altrootmnt = mntget(q);
 			}
-			p = next_mnt(p, namespace->root);
-			q = next_mnt(q, new_ns->root);
 		}
-		write_unlock(&fs->lock);
+		p = next_mnt(p, namespace->root);
+		q = next_mnt(q, new_ns->root);
 	}
 	up_write(&tsk->namespace->sem);
 
diff -Nru a/fs/ntfs/compress.c b/fs/ntfs/compress.c
--- a/fs/ntfs/compress.c	2004-07-27 18:24:51 -07:00
+++ b/fs/ntfs/compress.c	2004-07-27 18:24:51 -07:00
@@ -195,7 +195,7 @@
 
 	ntfs_debug("Entering, cb_size = 0x%x.", cb_size);
 do_next_sb:
-	ntfs_debug("Beginning sub-block at offset = 0x%x in the cb.",
+	ntfs_debug("Beginning sub-block at offset = 0x%zx in the cb.",
 			cb - cb_start);
 	/*
 	 * Have we reached the end of the compression block or the end of the
diff -Nru a/fs/ntfs/dir.c b/fs/ntfs/dir.c
--- a/fs/ntfs/dir.c	2004-07-27 18:24:51 -07:00
+++ b/fs/ntfs/dir.c	2004-07-27 18:24:51 -07:00
@@ -1222,7 +1222,7 @@
 	 * or signals an error (both covered by the rc test).
 	 */
 	for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
-		ntfs_debug("In index root, offset 0x%x.", (u8*)ie - (u8*)ir);
+		ntfs_debug("In index root, offset 0x%zx.", (u8*)ie - (u8*)ir);
 		/* Bounds checks. */
 		if (unlikely((u8*)ie < (u8*)ir || (u8*)ie +
 				sizeof(INDEX_ENTRY_HEADER) > index_end ||
diff -Nru a/fs/ntfs/super.c b/fs/ntfs/super.c
--- a/fs/ntfs/super.c	2004-07-27 18:24:52 -07:00
+++ b/fs/ntfs/super.c	2004-07-27 18:24:52 -07:00
@@ -1190,7 +1190,7 @@
 			goto read_partial_upcase_page;
 	}
 	vol->upcase_len = ino->i_size >> UCHAR_T_SIZE_BITS;
-	ntfs_debug("Read %llu bytes from $UpCase (expected %u bytes).",
+	ntfs_debug("Read %llu bytes from $UpCase (expected %zu bytes).",
 			ino->i_size, 64 * 1024 * sizeof(ntfschar));
 	iput(ino);
 	down(&ntfs_lock);
diff -Nru a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
--- a/fs/openpromfs/inode.c	2004-07-27 18:24:51 -07:00
+++ b/fs/openpromfs/inode.c	2004-07-27 18:24:51 -07:00
@@ -64,7 +64,7 @@
 static struct dentry *openpromfs_lookup(struct inode *, struct dentry *dentry, struct nameidata *nd);
 static int openpromfs_unlink (struct inode *, struct dentry *dentry);
 
-static ssize_t nodenum_read(struct file *file, char *buf,
+static ssize_t nodenum_read(struct file *file, char __user *buf,
 			    size_t count, loff_t *ppos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
@@ -83,7 +83,7 @@
 	return count;
 }
 
-static ssize_t property_read(struct file *filp, char *buf,
+static ssize_t property_read(struct file *filp, char __user *buf,
 			     size_t count, loff_t *ppos)
 {
 	struct inode *inode = filp->f_dentry->d_inode;
@@ -101,7 +101,7 @@
 		i = ((u32)(long)inode->u.generic_ip) >> 16;
 		if ((u16)((long)inode->u.generic_ip) == aliases) {
 			if (i >= aliases_nodes)
-				p = 0;
+				p = NULL;
 			else
 				p = alias_names [i];
 		} else
@@ -135,7 +135,7 @@
 			return -EIO;
 		op->value [k] = 0;
 		if (k) {
-			for (s = 0, p = op->value; p < op->value + k; p++) {
+			for (s = NULL, p = op->value; p < op->value + k; p++) {
 				if ((*p >= ' ' && *p <= '~') || *p == '\n') {
 					op->flag |= OPP_STRING;
 					s = p;
@@ -318,7 +318,7 @@
 	return count;
 }
 
-static ssize_t property_write(struct file *filp, const char *buf,
+static ssize_t property_write(struct file *filp, const char __user *buf,
 			      size_t count, loff_t *ppos)
 {
 	int i, j, k;
@@ -330,7 +330,7 @@
 	if (filp->f_pos >= 0xffffff || count >= 0xffffff)
 		return -EINVAL;
 	if (!filp->private_data) {
-		i = property_read (filp, NULL, 0, 0);
+		i = property_read (filp, NULL, 0, NULL);
 		if (i)
 			return i;
 	}
@@ -416,7 +416,7 @@
 			mask &= mask2;
 			if (mask) {
 				*first &= ~mask;
-				*first |= simple_strtoul (tmp, 0, 16);
+				*first |= simple_strtoul (tmp, NULL, 16);
 				op->flag |= OPP_DIRTY;
 			}
 		} else {
@@ -433,7 +433,7 @@
 						for (j = 0; j < first_off; j++)
 							mask >>= 1;
 						*q &= ~mask;
-						*q |= simple_strtoul (tmp,0,16);
+						*q |= simple_strtoul (tmp,NULL,16);
 					}
 					buf += 9;
 				} else if ((q == last - 1) && last_cnt
@@ -445,14 +445,14 @@
 					for (j = 0; j < 8 - last_cnt; j++)
 						mask <<= 1;
 					*q &= ~mask;
-					*q |= simple_strtoul (tmp, 0, 16);
+					*q |= simple_strtoul (tmp, NULL, 16);
 					buf += last_cnt;
 				} else {
 					char tchars[17]; /* XXX yuck... */
 
 					if (copy_from_user(tchars, buf, 16))
 						return -EFAULT;
-					*q = simple_strtoul (tchars, 0, 16);
+					*q = simple_strtoul (tchars, NULL, 16);
 					buf += 9;
 				}
 			}
diff -Nru a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
--- a/fs/proc/proc_devtree.c	2004-07-27 18:24:52 -07:00
+++ b/fs/proc/proc_devtree.c	2004-07-27 18:24:52 -07:00
@@ -88,7 +88,7 @@
 	child = NULL;
 	while ((child = of_get_next_child(np, child))) {
 		p = strrchr(child->full_name, '/');
-		if (p == 0)
+		if (!p)
 			p = child->full_name;
 		else
 			++p;
@@ -140,7 +140,7 @@
 		lastp = &al->next;
 	}
 	of_node_put(child);
-	*lastp = 0;
+	*lastp = NULL;
 	de->subdir = list;
 }
 
@@ -152,7 +152,7 @@
 	struct device_node *root;
 	if ( !have_of )
 		return;
-	proc_device_tree = proc_mkdir("device-tree", 0);
+	proc_device_tree = proc_mkdir("device-tree", NULL);
 	if (proc_device_tree == 0)
 		return;
 	root = of_find_node_by_path("/");
diff -Nru a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
--- a/include/asm-alpha/uaccess.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-alpha/uaccess.h	2004-07-27 18:24:52 -07:00
@@ -107,7 +107,7 @@
 #define __get_user_check(x,ptr,size,segment)				\
 ({									\
 	long __gu_err = -EFAULT, __gu_val = 0;				\
-	const __typeof__(*(ptr)) *__gu_addr = (ptr);			\
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);		\
 	__chk_user_ptr(ptr);						\
 	if (__access_ok((unsigned long)__gu_addr,size,segment)) {	\
 		__gu_err = 0;						\
@@ -222,7 +222,7 @@
 #define __put_user_check(x,ptr,size,segment)				\
 ({									\
 	long __pu_err = -EFAULT;					\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);				\
+	__typeof__(*(ptr)) __user *__pu_addr = (ptr);			\
 	__chk_user_ptr(ptr);						\
 	if (__access_ok((unsigned long)__pu_addr,size,segment)) {	\
 		__pu_err = 0;						\
diff -Nru a/include/asm-i386/elf.h b/include/asm-i386/elf.h
--- a/include/asm-i386/elf.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-i386/elf.h	2004-07-27 18:24:52 -07:00
@@ -117,7 +117,13 @@
 #define AT_SYSINFO_EHDR		33
 
 #ifdef __KERNEL__
-#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
+#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
+
+/*
+ * An executable for which elf_read_implies_exec() returns TRUE will
+ * have the READ_IMPLIES_EXEC personality flag set automatically.
+ */
+#define elf_read_implies_exec_binary(ex, have_pt_gnu_stack)	(!(have_pt_gnu_stack))
 
 extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
 extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
diff -Nru a/include/asm-i386/page.h b/include/asm-i386/page.h
--- a/include/asm-i386/page.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-i386/page.h	2004-07-27 18:24:51 -07:00
@@ -140,8 +140,10 @@
 
 #define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
 
-#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | \
-				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+#define VM_DATA_DEFAULT_FLAGS \
+	(VM_READ | VM_WRITE | \
+	((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+		 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 
 #endif /* __KERNEL__ */
 
diff -Nru a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
--- a/include/asm-i386/uaccess.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-i386/uaccess.h	2004-07-27 18:24:51 -07:00
@@ -261,7 +261,7 @@
 #define __put_user_check(x,ptr,size)					\
 ({									\
 	long __pu_err = -EFAULT;					\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);				\
+	__typeof__(*(ptr)) __user *__pu_addr = (ptr);			\
 	might_sleep();						\
 	if (access_ok(VERIFY_WRITE,__pu_addr,size))			\
 		__put_user_size((x),__pu_addr,(size),__pu_err,-EFAULT);	\
diff -Nru a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h
--- a/include/asm-ia64/elf.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-ia64/elf.h	2004-07-27 18:24:52 -07:00
@@ -185,9 +185,9 @@
 #define AT_SYSINFO_EHDR	33
 
 #ifdef __KERNEL__
-struct elf64_hdr;
-extern void ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter);
-#define SET_PERSONALITY(ex, ibcs2)	ia64_set_personality(&(ex), ibcs2)
+#define SET_PERSONALITY(ex, ibcs2)	set_personality(PER_LINUX)
+#define elf_read_implies_exec(ex, have_pt_gnu_stack)					\
+	(!(have_pt_gnu_stack) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
 
 struct task_struct;
 
diff -Nru a/include/asm-ia64/page.h b/include/asm-ia64/page.h
--- a/include/asm-ia64/page.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-ia64/page.h	2004-07-27 18:24:51 -07:00
@@ -184,7 +184,7 @@
 
 #define VM_DATA_DEFAULT_FLAGS		(VM_READ | VM_WRITE |					\
 					 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC |		\
-					 (((current->thread.flags & IA64_THREAD_XSTACK) != 0)	\
+					 (((current->personality & READ_IMPLIES_EXEC) != 0)	\
 					  ? VM_EXEC : 0))
 
 #endif /* _ASM_IA64_PAGE_H */
diff -Nru a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
--- a/include/asm-ia64/processor.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-ia64/processor.h	2004-07-27 18:24:51 -07:00
@@ -2,7 +2,7 @@
 #define _ASM_IA64_PROCESSOR_H
 
 /*
- * Copyright (C) 1998-2003 Hewlett-Packard Co
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  *	Stephane Eranian <eranian@hpl.hp.com>
  * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
@@ -61,7 +61,6 @@
 							/* bit 5 is currently unused */
 #define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6)	/* don't log any fpswa faults */
 #define IA64_THREAD_FPEMU_SIGFPE  (__IA64_UL(1) << 7)	/* send a SIGFPE for fpswa faults */
-#define IA64_THREAD_XSTACK	(__IA64_UL(1) << 8)	/* stack executable by default? */
 
 #define IA64_THREAD_UAC_SHIFT	3
 #define IA64_THREAD_UAC_MASK	(IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS)
diff -Nru a/include/asm-ia64/sn/sn2/io.h b/include/asm-ia64/sn/sn2/io.h
--- a/include/asm-ia64/sn/sn2/io.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-ia64/sn/sn2/io.h	2004-07-27 18:24:51 -07:00
@@ -8,10 +8,11 @@
 
 #ifndef _ASM_SN_SN2_IO_H
 #define _ASM_SN_SN2_IO_H
+#include <linux/compiler.h>
+#include <asm/intrinsics.h>
 
-extern void * sn_io_addr(unsigned long port); /* Forward definition */
+extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */
 extern void sn_mmiob(void); /* Forward definition */
-#include <asm/intrinsics.h>
 
 #define __sn_mf_a()   ia64_mfa()
 
diff -Nru a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
--- a/include/asm-ia64/sn/sn_sal.h	2004-07-27 18:24:53 -07:00
+++ b/include/asm-ia64/sn/sn_sal.h	2004-07-27 18:24:53 -07:00
@@ -141,8 +141,8 @@
  * Specify the minimum PROM revsion required for this kernel.
  * Note that they're stored in hex format...
  */
-#define SN_SAL_MIN_MAJOR	0x1  /* SN2 kernels need at least PROM 1.0 */
-#define SN_SAL_MIN_MINOR	0x0
+#define SN_SAL_MIN_MAJOR	0x3  /* SN2 kernels need at least PROM 3.40 */
+#define SN_SAL_MIN_MINOR	0x40
 
 u64 ia64_sn_probe_io_slot(long paddr, long size, void *data_ptr);
 
diff -Nru a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
--- a/include/asm-ppc/highmem.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-ppc/highmem.h	2004-07-27 18:24:52 -07:00
@@ -91,7 +91,7 @@
 	BUG_ON(!pte_none(*(kmap_pte+idx)));
 #endif
 	set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
-	flush_tlb_page(0, vaddr);
+	flush_tlb_page(NULL, vaddr);
 
 	return (void*) vaddr;
 }
@@ -115,7 +115,7 @@
 	 * this pte without first remap it
 	 */
 	pte_clear(kmap_pte+idx);
-	flush_tlb_page(0, vaddr);
+	flush_tlb_page(NULL, vaddr);
 #endif
 	dec_preempt_count();
 	preempt_check_resched();
diff -Nru a/include/asm-ppc/io.h b/include/asm-ppc/io.h
--- a/include/asm-ppc/io.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-ppc/io.h	2004-07-27 18:24:52 -07:00
@@ -237,7 +237,7 @@
 {
 #ifndef CONFIG_APUS
         if (address == 0)
-		return 0;
+		return NULL;
         return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
 #else
 	return (void*) mm_ptov (address);
diff -Nru a/include/asm-ppc/open_pic.h b/include/asm-ppc/open_pic.h
--- a/include/asm-ppc/open_pic.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-ppc/open_pic.h	2004-07-27 18:24:51 -07:00
@@ -50,7 +50,7 @@
 extern int openpic_get_irq(struct pt_regs *regs);
 extern void openpic_reset_processor_phys(u_int cpumask);
 extern void openpic_setup_ISU(int isu_num, unsigned long addr);
-extern void openpic_cause_IPI(u_int ipi, u_int cpumask);
+extern void openpic_cause_IPI(u_int ipi, cpumask_t cpumask);
 extern void smp_openpic_message_pass(int target, int msg, unsigned long data,
 				     int wait);
 extern void openpic_set_k2_cascade(int irq);
diff -Nru a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
--- a/include/asm-ppc/reg.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-ppc/reg.h	2004-07-27 18:24:52 -07:00
@@ -350,7 +350,7 @@
 #define DBAT6U	SPRN_DBAT6U	/* Data BAT 6 Upper Register */
 #define DBAT7L	SPRN_DBAT7L	/* Data BAT 7 Lower Register */
 #define DBAT7U	SPRN_DBAT7U	/* Data BAT 7 Upper Register */
-#define DEC	SPRN_DEC	/* Decrement Register */
+//#define DEC	SPRN_DEC	/* Decrement Register */
 #define DMISS	SPRN_DMISS	/* Data TLB Miss Register */
 #define DSISR	SPRN_DSISR	/* Data Storage Interrupt Status Register */
 #define EAR	SPRN_EAR	/* External Address Register */
@@ -380,9 +380,9 @@
 #define IMMR	SPRN_IMMR	/* PPC 860/821 Internal Memory Map Register */
 #define L2CR	SPRN_L2CR	/* Classic PPC L2 cache control register */
 #define L3CR	SPRN_L3CR	/* PPC 745x L3 cache control register */
-#define LR	SPRN_LR
+//#define LR	SPRN_LR
 #define PVR	SPRN_PVR	/* Processor Version */
-#define RPA	SPRN_RPA	/* Required Physical Address Register */
+//#define RPA	SPRN_RPA	/* Required Physical Address Register */
 #define SDR1	SPRN_SDR1	/* MMU hash base register */
 #define SPR0	SPRN_SPRG0	/* Supervisor Private Registers */
 #define SPR1	SPRN_SPRG1
@@ -489,6 +489,7 @@
 #define SVR_8555E	0x80790000
 #define SVR_8560	0x80700000
 
+#if 0
 /* Segment Registers */
 #define SR0	0
 #define SR1	1
@@ -506,6 +507,7 @@
 #define SR13	13
 #define SR14	14
 #define SR15	15
+#endif
 
 /* Macros for setting and retrieving special purpose registers */
 #ifndef __ASSEMBLY__
diff -Nru a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h
--- a/include/asm-ppc/signal.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-ppc/signal.h	2004-07-27 18:24:51 -07:00
@@ -118,7 +118,11 @@
 #define SIG_SETMASK        2	/* for setting the signal mask */
 
 /* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
 
 #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
 #define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
@@ -128,13 +132,13 @@
 	__sighandler_t sa_handler;
 	old_sigset_t sa_mask;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 };
 
 struct sigaction {
 	__sighandler_t sa_handler;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 	sigset_t sa_mask;		/* mask last for extensibility */
 };
 
@@ -143,7 +147,7 @@
 };
 
 typedef struct sigaltstack {
-	void *ss_sp;
+	void __user *ss_sp;
 	int ss_flags;
 	size_t ss_size;
 } stack_t;
diff -Nru a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h
--- a/include/asm-ppc/uaccess.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-ppc/uaccess.h	2004-07-27 18:24:51 -07:00
@@ -34,7 +34,8 @@
 	((addr) <= current->thread.fs.seg				    \
 	 && ((size) == 0 || (size) - 1 <= current->thread.fs.seg - (addr)))
 
-#define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))
+#define access_ok(type, addr, size) \
+	(__chk_user_ptr(addr),__access_ok((unsigned long)(addr),(size)))
 
 extern inline int verify_area(int type, const void __user * addr, unsigned long size)
 {
@@ -105,6 +106,7 @@
 #define __put_user_nocheck(x,ptr,size)			\
 ({							\
 	long __pu_err;					\
+	__chk_user_ptr(ptr);				\
 	__put_user_size((x),(ptr),(size),__pu_err);	\
 	__pu_err;					\
 })
@@ -112,7 +114,7 @@
 #define __put_user_check(x,ptr,size)				\
 ({								\
 	long __pu_err = -EFAULT;				\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);			\
+	__typeof__(*(ptr)) __user *__pu_addr = (ptr);		\
 	if (access_ok(VERIFY_WRITE,__pu_addr,size))		\
 		__put_user_size((x),__pu_addr,(size),__pu_err);	\
 	__pu_err;						\
@@ -179,6 +181,7 @@
 #define __get_user_nocheck(x, ptr, size)			\
 ({								\
 	long __gu_err, __gu_val;				\
+	__chk_user_ptr(ptr);					\
 	__get_user_size(__gu_val, (ptr), (size), __gu_err);	\
 	(x) = (__typeof__(*(ptr)))__gu_val;			\
 	__gu_err;						\
@@ -188,6 +191,7 @@
 ({								\
 	long __gu_err;						\
 	long long __gu_val;					\
+	__chk_user_ptr(ptr);					\
 	__get_user_size64(__gu_val, (ptr), (size), __gu_err);	\
 	(x) = (__typeof__(*(ptr)))__gu_val;			\
 	__gu_err;						\
@@ -196,7 +200,7 @@
 #define __get_user_check(x, ptr, size)					\
 ({									\
 	long __gu_err = -EFAULT, __gu_val = 0;				\
-	const __typeof__(*(ptr)) *__gu_addr = (ptr);			\
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);		\
 	if (access_ok(VERIFY_READ, __gu_addr, (size)))			\
 		__get_user_size(__gu_val, __gu_addr, (size), __gu_err);	\
 	(x) = (__typeof__(*(ptr)))__gu_val;				\
@@ -207,7 +211,7 @@
 ({									  \
 	long __gu_err = -EFAULT;					  \
 	long long __gu_val = 0;						  \
-	const __typeof__(*(ptr)) *__gu_addr = (ptr);			  \
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);		  \
 	if (access_ok(VERIFY_READ, __gu_addr, (size)))			  \
 		__get_user_size64(__gu_val, __gu_addr, (size), __gu_err); \
 	(x) = (__typeof__(*(ptr)))__gu_val;				  \
diff -Nru a/include/asm-ppc/ucontext.h b/include/asm-ppc/ucontext.h
--- a/include/asm-ppc/ucontext.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-ppc/ucontext.h	2004-07-27 18:24:52 -07:00
@@ -13,10 +13,10 @@
 
 struct ucontext {
 	unsigned long	 uc_flags;
-	struct ucontext *uc_link;
+	struct ucontext __user *uc_link;
 	stack_t		 uc_stack;
 	int		 uc_pad[7];
-	struct mcontext	*uc_regs;	/* points to uc_mcontext field */
+	struct mcontext	__user *uc_regs;/* points to uc_mcontext field */
 	sigset_t	 uc_sigmask;
 	/* glibc has 1024-bit signal masks, ours are 64-bit */
 	int		 uc_maskext[30];
diff -Nru a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
--- a/include/asm-ppc64/processor.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-ppc64/processor.h	2004-07-27 18:24:51 -07:00
@@ -348,7 +348,7 @@
 #define	PVR	SPRN_PVR	/* Processor Version */
 #define	PIR	SPRN_PIR	/* Processor ID */
 #define	PURR	SPRN_PURR	/* Processor Utilization of Resource Register */
-#define	RPA	SPRN_RPA	/* Required Physical Address Register */
+//#define	RPA	SPRN_RPA	/* Required Physical Address Register */
 #define	SDR1	SPRN_SDR1      	/* MMU hash base register */
 #define	SPR0	SPRN_SPRG0	/* Supervisor Private Registers */
 #define	SPR1	SPRN_SPRG1
diff -Nru a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h
--- a/include/asm-ppc64/uaccess.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-ppc64/uaccess.h	2004-07-27 18:24:51 -07:00
@@ -175,7 +175,7 @@
 #define __get_user_check(x,ptr,size)					\
 ({									\
 	long __gu_err = -EFAULT, __gu_val = 0;				\
-	const __typeof__(*(ptr)) *__gu_addr = (ptr);			\
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);		\
 	if (access_ok(VERIFY_READ,__gu_addr,size))			\
 		__get_user_size(__gu_val,__gu_addr,(size),__gu_err,-EFAULT);\
 	(x) = (__typeof__(*(ptr)))__gu_val;				\
diff -Nru a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h
--- a/include/asm-sparc/pci.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-sparc/pci.h	2004-07-27 18:24:52 -07:00
@@ -154,6 +154,13 @@
 {
 }
 
+#define PCI_DMA_ERROR_CODE      (~(dma_addr_t)0x0)
+
+static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
+{
+        return (dma_addr == PCI_DMA_ERROR_CODE);
+}
+
 #endif /* __KERNEL__ */
 
 /* generic pci stuff */
diff -Nru a/include/asm-sparc64/siginfo.h b/include/asm-sparc64/siginfo.h
--- a/include/asm-sparc64/siginfo.h	2004-07-27 18:24:52 -07:00
+++ b/include/asm-sparc64/siginfo.h	2004-07-27 18:24:52 -07:00
@@ -14,8 +14,11 @@
 
 #ifdef __KERNEL__
 
+#include <linux/config.h>
 #include <linux/compat.h>
 
+#ifdef CONFIG_COMPAT
+
 typedef union sigval32 {
 	int sival_int;
 	u32 sival_ptr;
@@ -72,6 +75,7 @@
 		} _sigpoll;
 	} _sifields;
 } siginfo_t32;
+#endif /* CONFIG_COMPAT */
 
 #endif /* __KERNEL__ */
 
@@ -85,6 +89,8 @@
 
 #ifdef __KERNEL__
 
+#ifdef CONFIG_COMPAT
+
 typedef struct sigevent32 {
 	sigval_t32 sigev_value;
 	int sigev_signo;
@@ -100,6 +106,8 @@
 } sigevent_t32;
 
 extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
+
+#endif /* CONFIG_COMPAT */
 
 #endif /* __KERNEL__ */
 
diff -Nru a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
--- a/include/asm-sparc64/signal.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-sparc64/signal.h	2004-07-27 18:24:51 -07:00
@@ -6,6 +6,7 @@
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
+#include <linux/config.h>
 #include <linux/personality.h>
 #include <linux/types.h>
 #include <linux/compat.h>
@@ -208,12 +209,15 @@
 };
 
 #ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
 struct __new_sigaction32 {
 	unsigned		sa_handler;
 	unsigned int    	sa_flags;
 	unsigned		sa_restorer;     /* not used by Linux/SPARC yet */
 	compat_sigset_t 	sa_mask;
 };
+#endif
 
 struct k_sigaction {
 	struct __new_sigaction 	sa;
@@ -229,6 +233,8 @@
 };
 
 #ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
 struct __old_sigaction32 {
 	unsigned		sa_handler;
 	compat_old_sigset_t  	sa_mask;
@@ -237,6 +243,8 @@
 };
 #endif
 
+#endif
+
 typedef struct sigaltstack {
 	void			__user *ss_sp;
 	int			ss_flags;
@@ -244,11 +252,14 @@
 } stack_t;
 
 #ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
 typedef struct sigaltstack32 {
 	u32			ss_sp;
 	int			ss_flags;
 	compat_size_t		ss_size;
 } stack_t32;
+#endif
 
 struct signal_deliver_cookie {
 	int restart_syscall;
diff -Nru a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
--- a/include/asm-sparc64/ttable.h	2004-07-27 18:24:51 -07:00
+++ b/include/asm-sparc64/ttable.h	2004-07-27 18:24:51 -07:00
@@ -123,7 +123,11 @@
 #else
 #define SUNOS_SYSCALL_TRAP TRAP(sunos_syscall)
 #endif
+#ifdef CONFIG_COMPAT
 #define	LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
+#else
+#define	LINUX_32BIT_SYSCALL_TRAP BTRAP(0x110)
+#endif
 #define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
 #define GETCC_TRAP TRAP(getcc)
 #define SETCC_TRAP TRAP(setcc)
diff -Nru a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
--- a/include/asm-x86_64/uaccess.h	2004-07-27 18:24:53 -07:00
+++ b/include/asm-x86_64/uaccess.h	2004-07-27 18:24:53 -07:00
@@ -148,7 +148,7 @@
 #define __put_user_check(x,ptr,size)			\
 ({							\
 	int __pu_err = -EFAULT;				\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);		\
+	__typeof__(*(ptr)) __user *__pu_addr = (ptr);	\
 	if (likely(access_ok(VERIFY_WRITE,__pu_addr,size)))	\
 		__put_user_size((x),__pu_addr,(size),__pu_err);	\
 	__pu_err;					\
diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h
--- a/include/linux/atmdev.h	2004-07-27 18:24:52 -07:00
+++ b/include/linux/atmdev.h	2004-07-27 18:24:52 -07:00
@@ -147,7 +147,7 @@
 
 struct atm_iobuf {
 	int length;
-	void *buffer;
+	void __user *buffer;
 };
 
 /* for ATM_GETCIRANGE / ATM_SETCIRANGE */
diff -Nru a/include/linux/atmlec.h b/include/linux/atmlec.h
--- a/include/linux/atmlec.h	2004-07-27 18:24:52 -07:00
+++ b/include/linux/atmlec.h	2004-07-27 18:24:52 -07:00
@@ -2,7 +2,7 @@
  * 
  * ATM Lan Emulation Daemon vs. driver interface
  *
- * carnil@cs.tut.fi
+ * mkiiskila@yahoo.com
  *
  */
 
diff -Nru a/include/linux/elf.h b/include/linux/elf.h
--- a/include/linux/elf.h	2004-07-27 18:24:51 -07:00
+++ b/include/linux/elf.h	2004-07-27 18:24:51 -07:00
@@ -4,6 +4,13 @@
 #include <linux/types.h>
 #include <asm/elf.h>
 
+#ifndef elf_read_implies_exec
+  /* Executables for which elf_read_implies_exec() returns TRUE will
+     have the READ_IMPLIES_EXEC personality flag set automatically.
+     Override in asm/elf.h as needed.  */
+# define elf_read_implies_exec(ex, have_pt_gnu_stack)	0
+#endif
+
 /* 32-bit ELF base types. */
 typedef __u32	Elf32_Addr;
 typedef __u16	Elf32_Half;
diff -Nru a/include/linux/ipmi.h b/include/linux/ipmi.h
--- a/include/linux/ipmi.h	2004-07-27 18:24:53 -07:00
+++ b/include/linux/ipmi.h	2004-07-27 18:24:53 -07:00
@@ -159,6 +159,14 @@
 	unsigned char  netfn;
 	unsigned char  cmd;
 	unsigned short data_len;
+	unsigned char  __user *data;
+};
+
+struct kernel_ipmi_msg
+{
+	unsigned char  netfn;
+	unsigned char  cmd;
+	unsigned short data_len;
 	unsigned char  *data;
 };
 
@@ -223,7 +231,7 @@
 	ipmi_user_t      user;
 	struct ipmi_addr addr;
 	long             msgid;
-	struct ipmi_msg  msg;
+	struct kernel_ipmi_msg  msg;
 
 	/* The user_msg_data is the data supplied when a message was
 	   sent, if this is a response to a sent message.  If this is
@@ -316,7 +324,7 @@
 int ipmi_request(ipmi_user_t      user,
 		 struct ipmi_addr *addr,
 		 long             msgid,
-		 struct ipmi_msg  *msg,
+		 struct kernel_ipmi_msg *msg,
 		 void             *user_msg_data,
 		 int              priority);
 
@@ -336,7 +344,7 @@
 int ipmi_request_settime(ipmi_user_t      user,
 			 struct ipmi_addr *addr,
 			 long             msgid,
-			 struct ipmi_msg  *msg,
+			 struct kernel_ipmi_msg  *msg,
 			 void             *user_msg_data,
 			 int              priority,
 			 int              max_retries,
@@ -348,7 +356,7 @@
 int ipmi_request_with_source(ipmi_user_t      user,
 			     struct ipmi_addr *addr,
 			     long             msgid,
-			     struct ipmi_msg  *msg,
+			     struct kernel_ipmi_msg  *msg,
 			     void             *user_msg_data,
 			     int              priority,
 			     unsigned char    source_address,
@@ -366,7 +374,7 @@
 int ipmi_request_supply_msgs(ipmi_user_t          user,
 			     struct ipmi_addr     *addr,
 			     long                 msgid,
-			     struct ipmi_msg      *msg,
+			     struct kernel_ipmi_msg *msg,
 			     void                 *user_msg_data,
 			     void                 *supplied_smi,
 			     struct ipmi_recv_msg *supplied_recv,
diff -Nru a/include/linux/mmzone.h b/include/linux/mmzone.h
--- a/include/linux/mmzone.h	2004-07-27 18:24:51 -07:00
+++ b/include/linux/mmzone.h	2004-07-27 18:24:51 -07:00
@@ -345,6 +345,15 @@
 #define for_each_zone(zone) \
 	for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone))
 
+static inline int is_highmem_idx(int idx)
+{
+	return (idx == ZONE_HIGHMEM);
+}
+
+static inline int is_normal_idx(int idx)
+{
+	return (idx == ZONE_NORMAL);
+}
 /**
  * is_highmem - helper function to quickly check if a struct zone is a 
  *              highmem zone or not.  This is an attempt to keep references
@@ -353,12 +362,12 @@
  */
 static inline int is_highmem(struct zone *zone)
 {
-	return (zone - zone->zone_pgdat->node_zones == ZONE_HIGHMEM);
+	return (is_highmem_idx(zone - zone->zone_pgdat->node_zones));
 }
 
 static inline int is_normal(struct zone *zone)
 {
-	return (zone - zone->zone_pgdat->node_zones == ZONE_NORMAL);
+	return (is_normal_idx(zone - zone->zone_pgdat->node_zones));
 }
 
 /* These two functions are used to setup the per zone pages min values */
diff -Nru a/include/linux/personality.h b/include/linux/personality.h
--- a/include/linux/personality.h	2004-07-27 18:24:51 -07:00
+++ b/include/linux/personality.h	2004-07-27 18:24:51 -07:00
@@ -30,12 +30,19 @@
  */
 enum {
 	MMAP_PAGE_ZERO =	0x0100000,
+	READ_IMPLIES_EXEC =	0x0400000,
 	ADDR_LIMIT_32BIT =	0x0800000,
 	SHORT_INODE =		0x1000000,
 	WHOLE_SECONDS =		0x2000000,
 	STICKY_TIMEOUTS	=	0x4000000,
 	ADDR_LIMIT_3GB = 	0x8000000,
 };
+
+/*
+ * Security-relevant compatibility flags that must be
+ * cleared upon setuid or setgid exec:
+ */
+#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC)
 
 /*
  * Personality types.
diff -Nru a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
--- a/include/linux/reiserfs_fs.h	2004-07-27 18:24:52 -07:00
+++ b/include/linux/reiserfs_fs.h	2004-07-27 18:24:52 -07:00
@@ -630,8 +630,8 @@
 static inline void set_le_key_k_offset (int version, struct key * key, loff_t offset)
 {
     (version == KEY_FORMAT_3_5) ?
-        (key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */
-	(set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
+        (void)(key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */
+	(void)(set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
 }
 
 
@@ -644,8 +644,8 @@
 static inline void set_le_key_k_type (int version, struct key * key, int type)
 {
     (version == KEY_FORMAT_3_5) ?
-        (key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))):
-	(set_offset_v2_k_type( &(key->u.k_offset_v2), type ));
+        (void)(key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))):
+	(void)(set_offset_v2_k_type( &(key->u.k_offset_v2), type ));
 }
 static inline void set_le_ih_k_type (struct item_head * ih, int type)
 {
diff -Nru a/include/linux/snmp.h b/include/linux/snmp.h
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/include/linux/snmp.h	2004-07-27 18:24:53 -07:00
@@ -0,0 +1,266 @@
+/*
+ * Definitions for MIBs
+ *
+ * Author: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
+ */
+
+#ifndef _LINUX_SNMP_H
+#define _LINUX_SNMP_H
+
+/* ipstats mib definitions */
+/*
+ * RFC 1213:  MIB-II
+ * RFC 2011 (updates 1213):  SNMPv2-MIB-IP
+ * RFC 2863:  Interfaces Group MIB
+ * RFC 2465:  IPv6 MIB: General Group
+ * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
+ */
+enum
+{
+	IPSTATS_MIB_NUM = 0,
+	IPSTATS_MIB_INRECEIVES,			/* InReceives */
+	IPSTATS_MIB_INHDRERRORS,		/* InHdrErrors */
+	IPSTATS_MIB_INTOOBIGERRORS,		/* InTooBigErrors */
+	IPSTATS_MIB_INNOROUTES,			/* InNoRoutes */
+	IPSTATS_MIB_INADDRERRORS,		/* InAddrErrors */
+	IPSTATS_MIB_INUNKNOWNPROTOS,		/* InUnknownProtos */
+	IPSTATS_MIB_INTRUNCATEDPKTS,		/* InTruncatedPkts */
+	IPSTATS_MIB_INDISCARDS,			/* InDiscards */
+	IPSTATS_MIB_INDELIVERS,			/* InDelivers */
+	IPSTATS_MIB_OUTFORWDATAGRAMS,		/* OutForwDatagrams */
+	IPSTATS_MIB_OUTREQUESTS,		/* OutRequests */
+	IPSTATS_MIB_OUTDISCARDS,		/* OutDiscards */
+	IPSTATS_MIB_OUTNOROUTES,		/* OutNoRoutes */
+	IPSTATS_MIB_REASMTIMEOUT,		/* ReasmTimeout */
+	IPSTATS_MIB_REASMREQDS,			/* ReasmReqds */
+	IPSTATS_MIB_REASMOKS,			/* ReasmOKs */
+	IPSTATS_MIB_REASMFAILS,			/* ReasmFails */
+	IPSTATS_MIB_FRAGOKS,			/* FragOKs */
+	IPSTATS_MIB_FRAGFAILS,			/* FragFails */
+	IPSTATS_MIB_FRAGCREATES,		/* FragCreates */
+	IPSTATS_MIB_INMCASTPKTS,		/* InMcastPkts */
+	IPSTATS_MIB_OUTMCASTPKTS,		/* OutMcastPkts */
+	__IPSTATS_MIB_MAX
+};
+
+/* icmp mib definitions */
+/*
+ * RFC 1213:  MIB-II ICMP Group
+ * RFC 2011 (updates 1213):  SNMPv2 MIB for IP: ICMP group
+ */
+enum
+{
+	ICMP_MIB_NUM = 0,
+	ICMP_MIB_INMSGS,			/* InMsgs */
+	ICMP_MIB_INERRORS,			/* InErrors */
+	ICMP_MIB_INDESTUNREACHS,		/* InDestUnreachs */
+	ICMP_MIB_INTIMEEXCDS,			/* InTimeExcds */
+	ICMP_MIB_INPARMPROBS,			/* InParmProbs */
+	ICMP_MIB_INSRCQUENCHS,			/* InSrcQuenchs */
+	ICMP_MIB_INREDIRECTS,			/* InRedirects */
+	ICMP_MIB_INECHOS,			/* InEchos */
+	ICMP_MIB_INECHOREPS,			/* InEchoReps */
+	ICMP_MIB_INTIMESTAMPS,			/* InTimestamps */
+	ICMP_MIB_INTIMESTAMPREPS,		/* InTimestampReps */
+	ICMP_MIB_INADDRMASKS,			/* InAddrMasks */
+	ICMP_MIB_INADDRMASKREPS,		/* InAddrMaskReps */
+	ICMP_MIB_OUTMSGS,			/* OutMsgs */
+	ICMP_MIB_OUTERRORS,			/* OutErrors */
+	ICMP_MIB_OUTDESTUNREACHS,		/* OutDestUnreachs */
+	ICMP_MIB_OUTTIMEEXCDS,			/* OutTimeExcds */
+	ICMP_MIB_OUTPARMPROBS,			/* OutParmProbs */
+	ICMP_MIB_OUTSRCQUENCHS,			/* OutSrcQuenchs */
+	ICMP_MIB_OUTREDIRECTS,			/* OutRedirects */
+	ICMP_MIB_OUTECHOS,			/* OutEchos */
+	ICMP_MIB_OUTECHOREPS,			/* OutEchoReps */
+	ICMP_MIB_OUTTIMESTAMPS,			/* OutTimestamps */
+	ICMP_MIB_OUTTIMESTAMPREPS,		/* OutTimestampReps */
+	ICMP_MIB_OUTADDRMASKS,			/* OutAddrMasks */
+	ICMP_MIB_OUTADDRMASKREPS,		/* OutAddrMaskReps */
+	__ICMP_MIB_MAX
+};
+
+/* icmp6 mib definitions */
+/*
+ * RFC 2466:  ICMPv6-MIB
+ */
+enum
+{
+	ICMP6_MIB_NUM = 0,
+	ICMP6_MIB_INMSGS,			/* InMsgs */
+	ICMP6_MIB_INERRORS,			/* InErrors */
+	ICMP6_MIB_INDESTUNREACHS,		/* InDestUnreachs */
+	ICMP6_MIB_INPKTTOOBIGS,			/* InPktTooBigs */
+	ICMP6_MIB_INTIMEEXCDS,			/* InTimeExcds */
+	ICMP6_MIB_INPARMPROBLEMS,		/* InParmProblems */
+	ICMP6_MIB_INECHOS,			/* InEchos */
+	ICMP6_MIB_INECHOREPLIES,		/* InEchoReplies */
+	ICMP6_MIB_INGROUPMEMBQUERIES,		/* InGroupMembQueries */
+	ICMP6_MIB_INGROUPMEMBRESPONSES,		/* InGroupMembResponses */
+	ICMP6_MIB_INGROUPMEMBREDUCTIONS,	/* InGroupMembReductions */
+	ICMP6_MIB_INROUTERSOLICITS,		/* InRouterSolicits */
+	ICMP6_MIB_INROUTERADVERTISEMENTS,	/* InRouterAdvertisements */
+	ICMP6_MIB_INNEIGHBORSOLICITS,		/* InNeighborSolicits */
+	ICMP6_MIB_INNEIGHBORADVERTISEMENTS,	/* InNeighborAdvertisements */
+	ICMP6_MIB_INREDIRECTS,			/* InRedirects */
+	ICMP6_MIB_OUTMSGS,			/* OutMsgs */
+	ICMP6_MIB_OUTDESTUNREACHS,		/* OutDestUnreachs */
+	ICMP6_MIB_OUTPKTTOOBIGS,		/* OutPktTooBigs */
+	ICMP6_MIB_OUTTIMEEXCDS,			/* OutTimeExcds */
+	ICMP6_MIB_OUTPARMPROBLEMS,		/* OutParmProblems */
+	ICMP6_MIB_OUTECHOREPLIES,		/* OutEchoReplies */
+	ICMP6_MIB_OUTROUTERSOLICITS,		/* OutRouterSolicits */
+	ICMP6_MIB_OUTNEIGHBORSOLICITS,		/* OutNeighborSolicits */
+	ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS,	/* OutNeighborAdvertisements */
+	ICMP6_MIB_OUTREDIRECTS,			/* OutRedirects */
+	ICMP6_MIB_OUTGROUPMEMBRESPONSES,	/* OutGroupMembResponses */
+	ICMP6_MIB_OUTGROUPMEMBREDUCTIONS,	/* OutGroupMembReductions */
+	__ICMP6_MIB_MAX
+};
+
+/* tcp mib definitions */
+/*
+ * RFC 1213:  MIB-II TCP group
+ * RFC 2012 (updates 1213):  SNMPv2-MIB-TCP
+ */
+enum
+{
+	TCP_MIB_NUM = 0,
+	TCP_MIB_RTOALGORITHM,			/* RtoAlgorithm */
+	TCP_MIB_RTOMIN,				/* RtoMin */
+	TCP_MIB_RTOMAX,				/* RtoMax */
+	TCP_MIB_MAXCONN,			/* MaxConn */
+	TCP_MIB_ACTIVEOPENS,			/* ActiveOpens */
+	TCP_MIB_PASSIVEOPENS,			/* PassiveOpens */
+	TCP_MIB_ATTEMPTFAILS,			/* AttemptFails */
+	TCP_MIB_ESTABRESETS,			/* EstabResets */
+	TCP_MIB_CURRESTAB,			/* CurrEstab */
+	TCP_MIB_INSEGS,				/* InSegs */
+	TCP_MIB_OUTSEGS,			/* OutSegs */
+	TCP_MIB_RETRANSSEGS,			/* RetransSegs */
+	TCP_MIB_INERRS,				/* InErrs */
+	TCP_MIB_OUTRSTS,			/* OutRsts */
+	__TCP_MIB_MAX
+};
+
+/* udp mib definitions */
+/*
+ * RFC 1213:  MIB-II UDP group
+ * RFC 2013 (updates 1213):  SNMPv2-MIB-UDP
+ */
+enum
+{
+	UDP_MIB_NUM = 0,
+	UDP_MIB_INDATAGRAMS,			/* InDatagrams */
+	UDP_MIB_NOPORTS,			/* NoPorts */
+	UDP_MIB_INERRORS,			/* InErrors */
+	UDP_MIB_OUTDATAGRAMS,			/* OutDatagrams */
+	__UDP_MIB_MAX
+};
+
+/* sctp mib definitions */
+/*
+ * draft-ietf-sigtran-sctp-mib-07.txt
+ */
+enum
+{
+	SCTP_MIB_NUM = 0,
+	SCTP_MIB_CURRESTAB,			/* CurrEstab */
+	SCTP_MIB_ACTIVEESTABS,			/* ActiveEstabs */
+	SCTP_MIB_PASSIVEESTABS,			/* PassiveEstabs */
+	SCTP_MIB_ABORTEDS,			/* Aborteds */
+	SCTP_MIB_SHUTDOWNS,			/* Shutdowns */
+	SCTP_MIB_OUTOFBLUES,			/* OutOfBlues */
+	SCTP_MIB_CHECKSUMERRORS,		/* ChecksumErrors */
+	SCTP_MIB_OUTCTRLCHUNKS,			/* OutCtrlChunks */
+	SCTP_MIB_OUTORDERCHUNKS,		/* OutOrderChunks */
+	SCTP_MIB_OUTUNORDERCHUNKS,		/* OutUnorderChunks */
+	SCTP_MIB_INCTRLCHUNKS,			/* InCtrlChunks */
+	SCTP_MIB_INORDERCHUNKS,			/* InOrderChunks */
+	SCTP_MIB_INUNORDERCHUNKS,		/* InUnorderChunks */
+	SCTP_MIB_FRAGUSRMSGS,			/* FragUsrMsgs */
+	SCTP_MIB_REASMUSRMSGS,			/* ReasmUsrMsgs */
+	SCTP_MIB_OUTSCTPPACKS,			/* OutSCTPPacks */
+	SCTP_MIB_INSCTPPACKS,			/* InSCTPPacks */
+	SCTP_MIB_RTOALGORITHM,			/* RtoAlgorithm */
+	SCTP_MIB_RTOMIN,			/* RtoMin */
+	SCTP_MIB_RTOMAX,			/* RtoMax */
+	SCTP_MIB_RTOINITIAL,			/* RtoInitial */
+	SCTP_MIB_VALCOOKIELIFE,			/* ValCookieLife */
+	SCTP_MIB_MAXINITRETR,			/* MaxInitRetr */
+	__SCTP_MIB_MAX
+};
+
+/* linux mib definitions */
+enum
+{
+	LINUX_MIB_NUM = 0,
+	LINUX_MIB_SYNCOOKIESSENT,		/* SyncookiesSent */
+	LINUX_MIB_SYNCOOKIESRECV,		/* SyncookiesRecv */
+	LINUX_MIB_SYNCOOKIESFAILED,		/* SyncookiesFailed */
+	LINUX_MIB_EMBRYONICRSTS,		/* EmbryonicRsts */
+	LINUX_MIB_PRUNECALLED,			/* PruneCalled */
+	LINUX_MIB_RCVPRUNED,			/* RcvPruned */
+	LINUX_MIB_OFOPRUNED,			/* OfoPruned */
+	LINUX_MIB_OUTOFWINDOWICMPS,		/* OutOfWindowIcmps */
+	LINUX_MIB_LOCKDROPPEDICMPS,		/* LockDroppedIcmps */
+	LINUX_MIB_ARPFILTER,			/* ArpFilter */
+	LINUX_MIB_TIMEWAITED,			/* TimeWaited */
+	LINUX_MIB_TIMEWAITRECYCLED,		/* TimeWaitRecycled */
+	LINUX_MIB_TIMEWAITKILLED,		/* TimeWaitKilled */
+	LINUX_MIB_PAWSPASSIVEREJECTED,		/* PAWSPassiveRejected */
+	LINUX_MIB_PAWSACTIVEREJECTED,		/* PAWSActiveRejected */
+	LINUX_MIB_PAWSESTABREJECTED,		/* PAWSEstabRejected */
+	LINUX_MIB_DELAYEDACKS,			/* DelayedACKs */
+	LINUX_MIB_DELAYEDACKLOCKED,		/* DelayedACKLocked */
+	LINUX_MIB_DELAYEDACKLOST,		/* DelayedACKLost */
+	LINUX_MIB_LISTENOVERFLOWS,		/* ListenOverflows */
+	LINUX_MIB_LISTENDROPS,			/* ListenDrops */
+	LINUX_MIB_TCPPREQUEUED,			/* TCPPrequeued */
+	LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG,	/* TCPDirectCopyFromBacklog */
+	LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE,	/* TCPDirectCopyFromPrequeue */
+	LINUX_MIB_TCPPREQUEUEDROPPED,		/* TCPPrequeueDropped */
+	LINUX_MIB_TCPHPHITS,			/* TCPHPHits */
+	LINUX_MIB_TCPHPHITSTOUSER,		/* TCPHPHitsToUser */
+	LINUX_MIB_TCPPUREACKS,			/* TCPPureAcks */
+	LINUX_MIB_TCPHPACKS,			/* TCPHPAcks */
+	LINUX_MIB_TCPRENORECOVERY,		/* TCPRenoRecovery */
+	LINUX_MIB_TCPSACKRECOVERY,		/* TCPSackRecovery */
+	LINUX_MIB_TCPSACKRENEGING,		/* TCPSACKReneging */
+	LINUX_MIB_TCPFACKREORDER,		/* TCPFACKReorder */
+	LINUX_MIB_TCPSACKREORDER,		/* TCPSACKReorder */
+	LINUX_MIB_TCPRENOREORDER,		/* TCPRenoReorder */
+	LINUX_MIB_TCPTSREORDER,			/* TCPTSReorder */
+	LINUX_MIB_TCPFULLUNDO,			/* TCPFullUndo */
+	LINUX_MIB_TCPPARTIALUNDO,		/* TCPPartialUndo */
+	LINUX_MIB_TCPDSACKUNDO,			/* TCPDSACKUndo */
+	LINUX_MIB_TCPLOSSUNDO,			/* TCPLossUndo */
+	LINUX_MIB_TCPLOSS,			/* TCPLoss */
+	LINUX_MIB_TCPLOSTRETRANSMIT,		/* TCPLostRetransmit */
+	LINUX_MIB_TCPRENOFAILURES,		/* TCPRenoFailures */
+	LINUX_MIB_TCPSACKFAILURES,		/* TCPSackFailures */
+	LINUX_MIB_TCPLOSSFAILURES,		/* TCPLossFailures */
+	LINUX_MIB_TCPFASTRETRANS,		/* TCPFastRetrans */
+	LINUX_MIB_TCPFORWARDRETRANS,		/* TCPForwardRetrans */
+	LINUX_MIB_TCPSLOWSTARTRETRANS,		/* TCPSlowStartRetrans */
+	LINUX_MIB_TCPTIMEOUTS,			/* TCPTimeouts */
+	LINUX_MIB_TCPRENORECOVERYFAIL,		/* TCPRenoRecoveryFail */
+	LINUX_MIB_TCPSACKRECOVERYFAIL,		/* TCPSackRecoveryFail */
+	LINUX_MIB_TCPSCHEDULERFAILED,		/* TCPSchedulerFailed */
+	LINUX_MIB_TCPRCVCOLLAPSED,		/* TCPRcvCollapsed */
+	LINUX_MIB_TCPDSACKOLDSENT,		/* TCPDSACKOldSent */
+	LINUX_MIB_TCPDSACKOFOSENT,		/* TCPDSACKOfoSent */
+	LINUX_MIB_TCPDSACKRECV,			/* TCPDSACKRecv */
+	LINUX_MIB_TCPDSACKOFORECV,		/* TCPDSACKOfoRecv */
+	LINUX_MIB_TCPABORTONSYN,		/* TCPAbortOnSyn */
+	LINUX_MIB_TCPABORTONDATA,		/* TCPAbortOnData */
+	LINUX_MIB_TCPABORTONCLOSE,		/* TCPAbortOnClose */
+	LINUX_MIB_TCPABORTONMEMORY,		/* TCPAbortOnMemory */
+	LINUX_MIB_TCPABORTONTIMEOUT,		/* TCPAbortOnTimeout */
+	LINUX_MIB_TCPABORTONLINGER,		/* TCPAbortOnLinger */
+	LINUX_MIB_TCPABORTFAILED,		/* TCPAbortFailed */
+	LINUX_MIB_TCPMEMORYPRESSURES,		/* TCPMemoryPressures */
+	__LINUX_MIB_MAX
+};
+
+#endif	/* _LINUX_SNMP_H */
diff -Nru a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
--- a/include/net/bluetooth/hci.h	2004-07-27 18:24:52 -07:00
+++ b/include/net/bluetooth/hci.h	2004-07-27 18:24:52 -07:00
@@ -432,7 +432,7 @@
 	__u8     pscan_period_mode;
 	__u8     dev_class[3];
 	__u16    clock_offset;
-	__u8     rssi;
+	__s8     rssi;
 } __attribute__ ((packed));
 
 #define HCI_EV_CONN_COMPLETE 	0x03
diff -Nru a/include/net/icmp.h b/include/net/icmp.h
--- a/include/net/icmp.h	2004-07-27 18:24:52 -07:00
+++ b/include/net/icmp.h	2004-07-27 18:24:52 -07:00
@@ -37,18 +37,6 @@
 #define ICMP_INC_STATS(field)		SNMP_INC_STATS(icmp_statistics, field)
 #define ICMP_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmp_statistics, field)
 #define ICMP_INC_STATS_USER(field) 	SNMP_INC_STATS_USER(icmp_statistics, field)
-#define ICMP_INC_STATS_FIELD(offt)					\
-	(*((unsigned long *) ((void *)					\
-			     per_cpu_ptr(icmp_statistics[!in_softirq()],\
-					 smp_processor_id()) + offt)))++
-#define ICMP_INC_STATS_BH_FIELD(offt)					\
-	(*((unsigned long *) ((void *)					\
-			     per_cpu_ptr(icmp_statistics[0],		\
-					 smp_processor_id()) + offt)))++
-#define ICMP_INC_STATS_USER_FIELD(offt)					\
-	(*((unsigned long *) ((void *)					\
-			     per_cpu_ptr(icmp_statistics[1],		\
-					 smp_processor_id()) + offt)))++
 
 extern void	icmp_send(struct sk_buff *skb_in,  int type, int code, u32 info);
 extern int	icmp_rcv(struct sk_buff *skb);
diff -Nru a/include/net/inet_ecn.h b/include/net/inet_ecn.h
--- a/include/net/inet_ecn.h	2004-07-27 18:24:52 -07:00
+++ b/include/net/inet_ecn.h	2004-07-27 18:24:52 -07:00
@@ -3,39 +3,48 @@
 
 #include <linux/ip.h>
 
+enum {
+	INET_ECN_NOT_ECT = 0,
+	INET_ECN_ECT_1 = 1,
+	INET_ECN_ECT_0 = 2,
+	INET_ECN_CE = 3,
+	INET_ECN_MASK = 3,
+};
+
 static inline int INET_ECN_is_ce(__u8 dsfield)
 {
-	return (dsfield&3) == 3;
+	return (dsfield & INET_ECN_MASK) == INET_ECN_CE;
 }
 
 static inline int INET_ECN_is_not_ce(__u8 dsfield)
 {
-	return (dsfield&3) == 2;
+	return (dsfield & INET_ECN_MASK) == INET_ECN_ECT_0;
 }
 
 static inline int INET_ECN_is_capable(__u8 dsfield)
 {
-	return (dsfield&2);
+	return (dsfield & INET_ECN_ECT_0);
 }
 
 static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
 {
-	outer &= ~3;
+	outer &= ~INET_ECN_MASK;
 	if (INET_ECN_is_capable(inner))
-		outer |= (inner & 3);
+		outer |= (inner & INET_ECN_MASK);
 	return outer;
 }
 
-#define	INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= 2; } while (0)
-#define	INET_ECN_dontxmit(sk) do { inet_sk(sk)->tos &= ~3; } while (0)
+#define	INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= INET_ECN_ECT_0; } while (0)
+#define	INET_ECN_dontxmit(sk) \
+	do { inet_sk(sk)->tos &= ~INET_ECN_MASK; } while (0)
 
-#define IP6_ECN_flow_init(label) do {	\
-      (label) &= ~htonl(3<<20);		\
+#define IP6_ECN_flow_init(label) do {		\
+      (label) &= ~htonl(INET_ECN_MASK << 20);	\
     } while (0)
 
-#define	IP6_ECN_flow_xmit(sk, label) do {			\
-	if (INET_ECN_is_capable(inet_sk(sk)->tos))		\
-		(label) |= __constant_htons(2 << 4);		\
+#define	IP6_ECN_flow_xmit(sk, label) do {				\
+	if (INET_ECN_is_capable(inet_sk(sk)->tos))			\
+		(label) |= __constant_htons(INET_ECN_ECT_0 << 4);	\
     } while (0)
 
 static inline void IP_ECN_set_ce(struct iphdr *iph)
@@ -43,24 +52,24 @@
 	u32 check = iph->check;
 	check += __constant_htons(0xFFFE);
 	iph->check = check + (check>=0xFFFF);
-	iph->tos |= 1;
+	iph->tos |= INET_ECN_CE;
 }
 
 static inline void IP_ECN_clear(struct iphdr *iph)
 {
-	iph->tos &= ~3;
+	iph->tos &= ~INET_ECN_MASK;
 }
 
 struct ipv6hdr;
 
 static inline void IP6_ECN_set_ce(struct ipv6hdr *iph)
 {
-	*(u32*)iph |= htonl(1<<20);
+	*(u32*)iph |= htonl(INET_ECN_CE << 20);
 }
 
 static inline void IP6_ECN_clear(struct ipv6hdr *iph)
 {
-	*(u32*)iph &= ~htonl(3<<20);
+	*(u32*)iph &= ~htonl(INET_ECN_MASK << 20);
 }
 
 #define ip6_get_dsfield(iph) ((ntohs(*(u16*)(iph)) >> 4) & 0xFF)
diff -Nru a/include/net/ip.h b/include/net/ip.h
--- a/include/net/ip.h	2004-07-27 18:24:52 -07:00
+++ b/include/net/ip.h	2004-07-27 18:24:52 -07:00
@@ -109,6 +109,9 @@
 extern int		ip_push_pending_frames(struct sock *sk);
 extern void		ip_flush_pending_frames(struct sock *sk);
 
+/* datagram.c */
+extern int		ip4_datagram_connect(struct sock *sk, 
+					     struct sockaddr *uaddr, int addr_len);
 
 /*
  *	Map a multicast IP onto multicast MAC for type Token Ring.
diff -Nru a/include/net/ip6_route.h b/include/net/ip6_route.h
--- a/include/net/ip6_route.h	2004-07-27 18:24:51 -07:00
+++ b/include/net/ip6_route.h	2004-07-27 18:24:51 -07:00
@@ -104,9 +104,7 @@
 
 /*
  *	Store a destination cache entry in a socket
- *	For UDP/RAW sockets this is done on udp_connect.
  */
-
 static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
 				     struct in6_addr *daddr)
 {
diff -Nru a/include/net/ipv6.h b/include/net/ipv6.h
--- a/include/net/ipv6.h	2004-07-27 18:24:52 -07:00
+++ b/include/net/ipv6.h	2004-07-27 18:24:52 -07:00
@@ -406,6 +406,9 @@
 
 extern void			ipv6_packet_cleanup(void);
 
+extern int			ip6_datagram_connect(struct sock *sk, 
+						     struct sockaddr *addr, int addr_len);
+
 extern int 			ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len);
 extern void			ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port,
 						u32 info, u8 *payload);
diff -Nru a/include/net/pkt_sched.h b/include/net/pkt_sched.h
--- a/include/net/pkt_sched.h	2004-07-27 18:24:51 -07:00
+++ b/include/net/pkt_sched.h	2004-07-27 18:24:51 -07:00
@@ -1,12 +1,6 @@
 #ifndef __NET_PKT_SCHED_H
 #define __NET_PKT_SCHED_H
 
-#define PSCHED_GETTIMEOFDAY	1
-#define PSCHED_JIFFIES 		2
-#define PSCHED_CPU 		3
-
-#define PSCHED_CLOCK_SOURCE	PSCHED_JIFFIES
-
 #include <linux/config.h>
 #include <linux/netdevice.h>
 #include <linux/types.h>
@@ -16,11 +10,6 @@
 #include <linux/module.h>
 #include <linux/rtnetlink.h>
 
-#ifdef CONFIG_X86_TSC
-#include <asm/msr.h>
-#endif
-
-
 struct rtattr;
 struct Qdisc;
 
@@ -184,25 +173,19 @@
    The reason is that, when it is not the same thing as
    gettimeofday, it returns invalid timestamp, which is
    not updated, when net_bh is active.
-
-   So, use PSCHED_CLOCK_SOURCE = PSCHED_CPU on alpha and pentiums
-   with rtdsc. And PSCHED_JIFFIES on all other architectures, including [34]86
-   and pentiums without rtdsc.
-   You can use PSCHED_GETTIMEOFDAY on another architectures,
-   which have fast and precise clock source, but it is too expensive.
  */
 
 /* General note about internal clock.
 
    Any clock source returns time intervals, measured in units
-   close to 1usec. With source PSCHED_GETTIMEOFDAY it is precisely
+   close to 1usec. With source CONFIG_NET_SCH_CLK_GETTIMEOFDAY it is precisely
    microseconds, otherwise something close but different chosen to minimize
    arithmetic cost. Ratio usec/internal untis in form nominator/denominator
    may be read from /proc/net/psched.
  */
 
 
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
 
 typedef struct timeval	psched_time_t;
 typedef long		psched_tdiff_t;
@@ -211,14 +194,12 @@
 #define PSCHED_US2JIFFIE(usecs) (((usecs)+(1000000/HZ-1))/(1000000/HZ))
 #define PSCHED_JIFFIE2US(delay) ((delay)*(1000000/HZ))
 
-#else /* PSCHED_CLOCK_SOURCE != PSCHED_GETTIMEOFDAY */
+#else /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
 
 typedef u64	psched_time_t;
 typedef long	psched_tdiff_t;
 
-extern psched_time_t	psched_time_base;
-
-#if PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES
+#ifdef CONFIG_NET_SCH_CLK_JIFFIES
 
 #if HZ < 96
 #define PSCHED_JSCALE 14
@@ -236,47 +217,35 @@
 #define PSCHED_US2JIFFIE(delay) (((delay)+(1<<PSCHED_JSCALE)-1)>>PSCHED_JSCALE)
 #define PSCHED_JIFFIE2US(delay) ((delay)<<PSCHED_JSCALE)
 
-#elif PSCHED_CLOCK_SOURCE == PSCHED_CPU
+#endif /* CONFIG_NET_SCH_CLK_JIFFIES */
+#ifdef CONFIG_NET_SCH_CLK_CPU
+#include <asm/timex.h>
 
 extern psched_tdiff_t psched_clock_per_hz;
 extern int psched_clock_scale;
+extern psched_time_t psched_time_base;
+extern cycles_t psched_time_mark;
 
+#define PSCHED_GET_TIME(stamp)						\
+do {									\
+	cycles_t cur = get_cycles();					\
+	if (sizeof(cycles_t) == sizeof(u32)) {				\
+		if (cur <= psched_time_mark)				\
+			psched_time_base += 0x100000000ULL;		\
+		psched_time_mark = cur;					\
+		(stamp) = (psched_time_base + cur)>>psched_clock_scale;	\
+	} else {							\
+		(stamp) = cur>>psched_clock_scale;			\
+	}								\
+} while (0)
 #define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
 #define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz)
 
-#ifdef CONFIG_X86_TSC
-
-#define PSCHED_GET_TIME(stamp) \
-({ u64 __cur; \
-   rdtscll(__cur); \
-   (stamp) = __cur>>psched_clock_scale; \
-})
-
-#elif defined (__alpha__)
+#endif /* CONFIG_NET_SCH_CLK_CPU */
 
-#define PSCHED_WATCHER u32
+#endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
 
-extern PSCHED_WATCHER psched_time_mark;
-
-#define PSCHED_GET_TIME(stamp) \
-({ u32 __res; \
-   __asm__ __volatile__ ("rpcc %0" : "r="(__res)); \
-   if (__res <= psched_time_mark) psched_time_base += 0x100000000UL; \
-   psched_time_mark = __res; \
-   (stamp) = (psched_time_base + __res)>>psched_clock_scale; \
-})
-
-#else
-
-#error PSCHED_CLOCK_SOURCE=PSCHED_CPU is not supported on this arch.
-
-#endif /* ARCH */
-
-#endif /* PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES */
-
-#endif /* PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY */
-
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
 #define PSCHED_TDIFF(tv1, tv2) \
 ({ \
 	   int __delta_sec = (tv1).tv_sec - (tv2).tv_sec; \
@@ -340,7 +309,7 @@
 
 #define	PSCHED_AUDIT_TDIFF(t) ({ if ((t) > 2000000) (t) = 2000000; })
 
-#else
+#else /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
 
 #define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
 #define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
@@ -354,7 +323,7 @@
 #define PSCHED_IS_PASTPERFECT(t)	((t) == 0)
 #define	PSCHED_AUDIT_TDIFF(t)
 
-#endif
+#endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
 
 struct tcf_police
 {
diff -Nru a/include/net/sctp/command.h b/include/net/sctp/command.h
--- a/include/net/sctp/command.h	2004-07-27 18:24:53 -07:00
+++ b/include/net/sctp/command.h	2004-07-27 18:24:53 -07:00
@@ -94,6 +94,9 @@
 	SCTP_CMD_REPORT_FWDTSN,	 /* Report new cumulative TSN Ack. */
 	SCTP_CMD_PROCESS_FWDTSN, /* Skips were reported, so process further. */
 	SCTP_CMD_CLEAR_INIT_TAG, /* Clears association peer's inittag. */
+	SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */
+	SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */
+	SCTP_CMD_FORCE_PRIM_RETRAN,  /* Forces retrans. over primary path. */
 	SCTP_CMD_LAST
 } sctp_verb_t;
 
diff -Nru a/include/net/sctp/constants.h b/include/net/sctp/constants.h
--- a/include/net/sctp/constants.h	2004-07-27 18:24:51 -07:00
+++ b/include/net/sctp/constants.h	2004-07-27 18:24:51 -07:00
@@ -175,6 +175,10 @@
 	SCTP_IERROR_BAD_TAG,
 	SCTP_IERROR_BIG_GAP,
 	SCTP_IERROR_DUP_TSN,
+	SCTP_IERROR_HIGH_TSN,
+	SCTP_IERROR_IGNORE_TSN,
+	SCTP_IERROR_NO_DATA,
+	SCTP_IERROR_BAD_STREAM,
 
 } sctp_ierror_t;
 
diff -Nru a/include/net/sctp/sm.h b/include/net/sctp/sm.h
--- a/include/net/sctp/sm.h	2004-07-27 18:24:51 -07:00
+++ b/include/net/sctp/sm.h	2004-07-27 18:24:51 -07:00
@@ -322,6 +322,9 @@
 				const struct sctp_chunk *chunk,
 				sctp_cmd_seq_t *commands,
 				struct sctp_chunk *err_chunk);
+int sctp_eat_data(const struct sctp_association *asoc,
+		  struct sctp_chunk *chunk,
+		  sctp_cmd_seq_t *commands);
 
 /* 3rd level prototypes */
 __u32 sctp_generate_tag(const struct sctp_endpoint *);
diff -Nru a/include/net/snmp.h b/include/net/snmp.h
--- a/include/net/snmp.h	2004-07-27 18:24:51 -07:00
+++ b/include/net/snmp.h	2004-07-27 18:24:51 -07:00
@@ -22,291 +22,102 @@
 #define _SNMP_H
 
 #include <linux/cache.h>
- 
+#include <linux/snmp.h>
+
 /*
- *	We use all unsigned longs. Linux will soon be so reliable that even these
- *	will rapidly get too small 8-). Seriously consider the IpInReceives count
- *	on the 20Gb/s + networks people expect in a few years time!
+ * Mibs are stored in array of unsigned long.
  */
-
-/* 
- * The rule for padding: 
- * Best is power of two because then the right structure can be found by a simple
- * shift. The structure should be always cache line aligned.
- * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add instructions
- * to emulate multiply in case it is not power-of-two. Currently n is always <=3 for
- * all sizes so simple cache line alignment is enough. 
- * 
- * The best solution would be a global CPU local area , especially on 64 and 128byte 
- * cacheline machine it makes a *lot* of sense -AK
- */ 
-
-struct snmp_item {
+/*
+ * struct snmp_mib{}
+ *  - list of entries for particular API (such as /proc/net/snmp)
+ *  - name of entries.
+ */
+struct snmp_mib {
 	char *name;
-	int offset;
+	int entry;
 };
 
-#define SNMP_ITEM(mib,entry,procname)	{	\
-	.name = procname,			\
-	.offset = offsetof(mib, entry),		\
+#define SNMP_MIB_ITEM(_name,_entry)	{	\
+	.name = _name,				\
+	.entry = _entry,			\
 }
 
-#define SNMP_ITEM_SENTINEL {			\
-	.name = NULL,				\
-	.offset = 0,				\
+#define SNMP_MIB_SENTINEL {	\
+	.name = NULL,		\
+	.entry = 0,		\
 }
 
 /*
- * RFC 1213:  MIB-II
- * RFC 2011 (updates 1213):  SNMPv2-MIB-IP
- * RFC 2863:  Interfaces Group MIB
- * RFC 2465:  IPv6 MIB: General Group
- * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
+ * We use all unsigned longs. Linux will soon be so reliable that even 
+ * these will rapidly get too small 8-). Seriously consider the IpInReceives 
+ * count on the 20Gb/s + networks people expect in a few years time!
  */
-struct ipstats_mib
-{
-	unsigned long	InReceives;
- 	unsigned long	InHdrErrors;
- 	unsigned long	InTooBigErrors;
- 	unsigned long	InNoRoutes;
- 	unsigned long	InAddrErrors;
- 	unsigned long	InUnknownProtos;
- 	unsigned long	InTruncatedPkts;
- 	unsigned long	InDiscards;
- 	unsigned long	InDelivers;
- 	unsigned long	OutForwDatagrams;
- 	unsigned long	OutRequests;
- 	unsigned long	OutDiscards;
- 	unsigned long	OutNoRoutes;
- 	unsigned long	ReasmTimeout;
- 	unsigned long	ReasmReqds;
- 	unsigned long	ReasmOKs;
- 	unsigned long	ReasmFails;
- 	unsigned long	FragOKs;
- 	unsigned long	FragFails;
- 	unsigned long	FragCreates;
- 	unsigned long	InMcastPkts;
- 	unsigned long	OutMcastPkts;
-	unsigned long   __pad[0]; 
-};
- 
-/*
- * RFC 1213:  MIB-II ICMP Group
- * RFC 2011 (updates 1213):  SNMPv2 MIB for IP: ICMP group
- */
-struct icmp_mib
-{
- 	unsigned long	IcmpInMsgs;
- 	unsigned long	IcmpInErrors;
-  	unsigned long	IcmpInDestUnreachs;
- 	unsigned long	IcmpInTimeExcds;
- 	unsigned long	IcmpInParmProbs;
- 	unsigned long	IcmpInSrcQuenchs;
- 	unsigned long	IcmpInRedirects;
- 	unsigned long	IcmpInEchos;
- 	unsigned long	IcmpInEchoReps;
- 	unsigned long	IcmpInTimestamps;
- 	unsigned long	IcmpInTimestampReps;
- 	unsigned long	IcmpInAddrMasks;
- 	unsigned long	IcmpInAddrMaskReps;
- 	unsigned long	IcmpOutMsgs;
- 	unsigned long	IcmpOutErrors;
- 	unsigned long	IcmpOutDestUnreachs;
- 	unsigned long	IcmpOutTimeExcds;
- 	unsigned long	IcmpOutParmProbs;
- 	unsigned long	IcmpOutSrcQuenchs;
- 	unsigned long	IcmpOutRedirects;
- 	unsigned long	IcmpOutEchos;
- 	unsigned long	IcmpOutEchoReps;
- 	unsigned long	IcmpOutTimestamps;
- 	unsigned long	IcmpOutTimestampReps;
- 	unsigned long	IcmpOutAddrMasks;
- 	unsigned long	IcmpOutAddrMaskReps;
-	unsigned long	dummy;
-	unsigned long   __pad[0]; 
-};
 
-/*
- * RFC 2466:  ICMPv6-MIB
- */
-struct icmpv6_mib
-{
-	unsigned long	Icmp6InMsgs;
-	unsigned long	Icmp6InErrors;
-
-	unsigned long	Icmp6InDestUnreachs;
-	unsigned long	Icmp6InPktTooBigs;
-	unsigned long	Icmp6InTimeExcds;
-	unsigned long	Icmp6InParmProblems;
-
-	unsigned long	Icmp6InEchos;
-	unsigned long	Icmp6InEchoReplies;
-	unsigned long	Icmp6InGroupMembQueries;
-	unsigned long	Icmp6InGroupMembResponses;
-	unsigned long	Icmp6InGroupMembReductions;
-	unsigned long	Icmp6InRouterSolicits;
-	unsigned long	Icmp6InRouterAdvertisements;
-	unsigned long	Icmp6InNeighborSolicits;
-	unsigned long	Icmp6InNeighborAdvertisements;
-	unsigned long	Icmp6InRedirects;
-
-	unsigned long	Icmp6OutMsgs;
-
-	unsigned long	Icmp6OutDestUnreachs;
-	unsigned long	Icmp6OutPktTooBigs;
-	unsigned long	Icmp6OutTimeExcds;
-	unsigned long	Icmp6OutParmProblems;
-
-	unsigned long	Icmp6OutEchoReplies;
-	unsigned long	Icmp6OutRouterSolicits;
-	unsigned long	Icmp6OutNeighborSolicits;
-	unsigned long	Icmp6OutNeighborAdvertisements;
-	unsigned long	Icmp6OutRedirects;
-	unsigned long	Icmp6OutGroupMembResponses;
-	unsigned long	Icmp6OutGroupMembReductions;
-	unsigned long   __pad[0]; 
-};
- 
-/*
- * RFC 1213:  MIB-II TCP group
- * RFC 2012 (updates 1213):  SNMPv2-MIB-TCP
- */
-struct tcp_mib
-{
- 	unsigned long	TcpRtoAlgorithm;
- 	unsigned long	TcpRtoMin;
- 	unsigned long	TcpRtoMax;
- 	unsigned long	TcpMaxConn;
- 	unsigned long	TcpActiveOpens;
- 	unsigned long	TcpPassiveOpens;
- 	unsigned long	TcpAttemptFails;
- 	unsigned long	TcpEstabResets;
- 	unsigned long	TcpCurrEstab;
- 	unsigned long	TcpInSegs;
- 	unsigned long	TcpOutSegs;
- 	unsigned long	TcpRetransSegs;
- 	unsigned long	TcpInErrs;
- 	unsigned long	TcpOutRsts;
-	unsigned long   __pad[0]; 
-};
- 
-/*
- * RFC 1213:  MIB-II UDP group
- * RFC 2013 (updates 1213):  SNMPv2-MIB-UDP
- */
-struct udp_mib
-{
- 	unsigned long	UdpInDatagrams;
- 	unsigned long	UdpNoPorts;
- 	unsigned long	UdpInErrors;
- 	unsigned long	UdpOutDatagrams;
-	unsigned long   __pad[0];
-}; 
-
-/* draft-ietf-sigtran-sctp-mib-07.txt */
-struct sctp_mib
-{
-	unsigned long   SctpCurrEstab;
-	unsigned long   SctpActiveEstabs;
-	unsigned long   SctpPassiveEstabs;
-	unsigned long   SctpAborteds;
-	unsigned long   SctpShutdowns;
-	unsigned long   SctpOutOfBlues;
-	unsigned long   SctpChecksumErrors;
-	unsigned long   SctpOutCtrlChunks;
-	unsigned long   SctpOutOrderChunks;
-	unsigned long   SctpOutUnorderChunks;
-	unsigned long   SctpInCtrlChunks;
-	unsigned long   SctpInOrderChunks;
-	unsigned long   SctpInUnorderChunks;
-	unsigned long   SctpFragUsrMsgs;
-	unsigned long   SctpReasmUsrMsgs;
-	unsigned long   SctpOutSCTPPacks;
-	unsigned long   SctpInSCTPPacks;
-	unsigned long   SctpRtoAlgorithm;
-	unsigned long   SctpRtoMin;
-	unsigned long   SctpRtoMax;
-	unsigned long   SctpRtoInitial;
-	unsigned long   SctpValCookieLife;
-	unsigned long   SctpMaxInitRetr;
-	unsigned long   __pad[0];
-};
+/* 
+ * The rule for padding: 
+ * Best is power of two because then the right structure can be found by a 
+ * simple shift. The structure should be always cache line aligned.
+ * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add 
+ * instructions to emulate multiply in case it is not power-of-two. 
+ * Currently n is always <=3 for all sizes so simple cache line alignment 
+ * is enough. 
+ * 
+ * The best solution would be a global CPU local area , especially on 64 
+ * and 128byte cacheline machine it makes a *lot* of sense -AK
+ */ 
+
+#define __SNMP_MIB_ALIGN__	____cacheline_aligned
 
-struct linux_mib 
-{
-	unsigned long	SyncookiesSent;
-	unsigned long	SyncookiesRecv;
-	unsigned long	SyncookiesFailed;
-	unsigned long	EmbryonicRsts;
-	unsigned long	PruneCalled; 
-	unsigned long	RcvPruned;
-	unsigned long	OfoPruned;
-	unsigned long	OutOfWindowIcmps; 
-	unsigned long	LockDroppedIcmps; 
-        unsigned long   ArpFilter;
-	unsigned long	TimeWaited; 
-	unsigned long	TimeWaitRecycled; 
-	unsigned long	TimeWaitKilled; 
-	unsigned long	PAWSPassiveRejected; 
-	unsigned long	PAWSActiveRejected; 
-	unsigned long	PAWSEstabRejected; 
-	unsigned long	DelayedACKs;
-	unsigned long	DelayedACKLocked;
-	unsigned long	DelayedACKLost;
-	unsigned long	ListenOverflows;
-	unsigned long	ListenDrops;
-	unsigned long	TCPPrequeued;
-	unsigned long	TCPDirectCopyFromBacklog;
-	unsigned long	TCPDirectCopyFromPrequeue;
-	unsigned long	TCPPrequeueDropped;
-	unsigned long	TCPHPHits;
-	unsigned long	TCPHPHitsToUser;
-	unsigned long	TCPPureAcks;
-	unsigned long	TCPHPAcks;
-	unsigned long	TCPRenoRecovery;
-	unsigned long	TCPSackRecovery;
-	unsigned long	TCPSACKReneging;
-	unsigned long	TCPFACKReorder;
-	unsigned long	TCPSACKReorder;
-	unsigned long	TCPRenoReorder;
-	unsigned long	TCPTSReorder;
-	unsigned long	TCPFullUndo;
-	unsigned long	TCPPartialUndo;
-	unsigned long	TCPDSACKUndo;
-	unsigned long	TCPLossUndo;
-	unsigned long	TCPLoss;
-	unsigned long	TCPLostRetransmit;
-	unsigned long	TCPRenoFailures;
-	unsigned long	TCPSackFailures;
-	unsigned long	TCPLossFailures;
-	unsigned long	TCPFastRetrans;
-	unsigned long	TCPForwardRetrans;
-	unsigned long	TCPSlowStartRetrans;
-	unsigned long	TCPTimeouts;
-	unsigned long	TCPRenoRecoveryFail;
-	unsigned long	TCPSackRecoveryFail;
-	unsigned long	TCPSchedulerFailed;
-	unsigned long	TCPRcvCollapsed;
-	unsigned long	TCPDSACKOldSent;
-	unsigned long	TCPDSACKOfoSent;
-	unsigned long	TCPDSACKRecv;
-	unsigned long	TCPDSACKOfoRecv;
-	unsigned long	TCPAbortOnSyn;
-	unsigned long	TCPAbortOnData;
-	unsigned long	TCPAbortOnClose;
-	unsigned long	TCPAbortOnMemory;
-	unsigned long	TCPAbortOnTimeout;
-	unsigned long	TCPAbortOnLinger;
-	unsigned long	TCPAbortFailed;
-	unsigned long	TCPMemoryPressures;
-	unsigned long   __pad[0];
+/* IPstats */
+#define IPSTATS_MIB_MAX	__IPSTATS_MIB_MAX
+struct ipstats_mib {
+	unsigned long	mibs[IPSTATS_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* ICMP */
+#define ICMP_MIB_DUMMY	__ICMP_MIB_MAX
+#define ICMP_MIB_MAX	(__ICMP_MIB_MAX + 1)
+
+struct icmp_mib {
+	unsigned long	mibs[ICMP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* ICMP6 (IPv6-ICMP) */
+#define ICMP6_MIB_MAX	__ICMP6_MIB_MAX
+struct icmpv6_mib {
+	unsigned long	mibs[ICMP6_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* TCP */
+#define TCP_MIB_MAX	__TCP_MIB_MAX
+struct tcp_mib {
+	unsigned long	mibs[TCP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* UDP */
+#define UDP_MIB_MAX	__UDP_MIB_MAX
+struct udp_mib {
+	unsigned long	mibs[UDP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* SCTP */
+#define SCTP_MIB_MAX	__SCTP_MIB_MAX
+struct sctp_mib {
+	unsigned long	mibs[SCTP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* Linux */
+#define LINUX_MIB_MAX	__LINUX_MIB_MAX
+struct linux_mib {
+	unsigned long	mibs[LINUX_MIB_MAX];
 };
 
 
 /* 
- * FIXME: On x86 and some other CPUs the split into user and softirq parts is not needed because 
- * addl $1,memory is atomic against interrupts (but atomic_inc would be overkill because of the lock 
- * cycles). Wants new nonlocked_atomic_inc() primitives -AK
+ * FIXME: On x86 and some other CPUs the split into user and softirq parts
+ * is not needed because addl $1,memory is atomic against interrupts (but 
+ * atomic_inc would be overkill because of the lock cycles). Wants new 
+ * nonlocked_atomic_inc() primitives -AK
  */ 
 #define DEFINE_SNMP_STAT(type, name)	\
 	__typeof__(type) *name[2]
@@ -317,18 +128,18 @@
 #define SNMP_STAT_USRPTR(name)	(name[1])
 
 #define SNMP_INC_STATS_BH(mib, field) 	\
-	(per_cpu_ptr(mib[0], smp_processor_id())->field++)
+	(per_cpu_ptr(mib[0], smp_processor_id())->mibs[field]++)
 #define SNMP_INC_STATS_OFFSET_BH(mib, field, offset)	\
-	((*((&per_cpu_ptr(mib[0], smp_processor_id())->field) + (offset)))++)
+	(per_cpu_ptr(mib[0], smp_processor_id())->mibs[field + (offset)]++)
 #define SNMP_INC_STATS_USER(mib, field) \
-	(per_cpu_ptr(mib[1], smp_processor_id())->field++)
+	(per_cpu_ptr(mib[1], smp_processor_id())->mibs[field]++)
 #define SNMP_INC_STATS(mib, field) 	\
-	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->field++)
+	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->mibs[field]++)
 #define SNMP_DEC_STATS(mib, field) 	\
-	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->field--)
+	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->mibs[field]--)
 #define SNMP_ADD_STATS_BH(mib, field, addend) 	\
-	(per_cpu_ptr(mib[0], smp_processor_id())->field += addend)
+	(per_cpu_ptr(mib[0], smp_processor_id())->mibs[field] += addend)
 #define SNMP_ADD_STATS_USER(mib, field, addend) 	\
-	(per_cpu_ptr(mib[1], smp_processor_id())->field += addend)
- 	
+	(per_cpu_ptr(mib[1], smp_processor_id())->mibs[field] += addend)
+
 #endif
diff -Nru a/include/net/tcp.h b/include/net/tcp.h
--- a/include/net/tcp.h	2004-07-27 18:24:51 -07:00
+++ b/include/net/tcp.h	2004-07-27 18:24:51 -07:00
@@ -1543,7 +1543,7 @@
 
 			while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
 				sk->sk_backlog_rcv(sk, skb1);
-				NET_INC_STATS_BH(TCPPrequeueDropped);
+				NET_INC_STATS_BH(LINUX_MIB_TCPPREQUEUEDROPPED);
 			}
 
 			tp->ucopy.memory = 0;
@@ -1575,12 +1575,12 @@
 	switch (state) {
 	case TCP_ESTABLISHED:
 		if (oldstate != TCP_ESTABLISHED)
-			TCP_INC_STATS(TcpCurrEstab);
+			TCP_INC_STATS(TCP_MIB_CURRESTAB);
 		break;
 
 	case TCP_CLOSE:
 		if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
-			TCP_INC_STATS(TcpEstabResets);
+			TCP_INC_STATS(TCP_MIB_ESTABRESETS);
 
 		sk->sk_prot->unhash(sk);
 		if (tcp_sk(sk)->bind_hash &&
@@ -1589,7 +1589,7 @@
 		/* fall through */
 	default:
 		if (oldstate==TCP_ESTABLISHED)
-			TCP_DEC_STATS(TcpCurrEstab);
+			TCP_DEC_STATS(TCP_MIB_CURRESTAB);
 	}
 
 	/* Change state AFTER socket is unhashed to avoid closed
@@ -1961,10 +1961,10 @@
 static inline void tcp_mib_init(void)
 {
 	/* See RFC 2012 */
-	TCP_ADD_STATS_USER(TcpRtoAlgorithm, 1);
-	TCP_ADD_STATS_USER(TcpRtoMin, TCP_RTO_MIN*1000/HZ);
-	TCP_ADD_STATS_USER(TcpRtoMax, TCP_RTO_MAX*1000/HZ);
-	TCP_ADD_STATS_USER(TcpMaxConn, -1);
+	TCP_ADD_STATS_USER(TCP_MIB_RTOALGORITHM, 1);
+	TCP_ADD_STATS_USER(TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ);
+	TCP_ADD_STATS_USER(TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ);
+	TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1);
 }
 
 /* /proc */
diff -Nru a/include/net/udp.h b/include/net/udp.h
--- a/include/net/udp.h	2004-07-27 18:24:52 -07:00
+++ b/include/net/udp.h	2004-07-27 18:24:52 -07:00
@@ -64,8 +64,6 @@
 
 
 extern void	udp_err(struct sk_buff *, u32);
-extern int	udp_connect(struct sock *sk,
-			    struct sockaddr *usin, int addr_len);
 
 extern int	udp_sendmsg(struct kiocb *iocb, struct sock *sk,
 			    struct msghdr *msg, size_t len);
diff -Nru a/include/sound/asound.h b/include/sound/asound.h
--- a/include/sound/asound.h	2004-07-27 18:24:52 -07:00
+++ b/include/sound/asound.h	2004-07-27 18:24:52 -07:00
@@ -33,12 +33,14 @@
 #include <linux/time.h>
 #include <asm/byteorder.h>
 
-#if  __LITTLE_ENDIAN == 1234
+#ifdef  __LITTLE_ENDIAN
 #define SNDRV_LITTLE_ENDIAN
-#elif __BIG_ENDIAN == 4321
+#else
+#ifdef __BIG_ENDIAN
 #define SNDRV_BIG_ENDIAN
 #else
 #error "Unsupported endian..."
+#endif
 #endif
 
 #else /* !__KERNEL__ */
diff -Nru a/mm/filemap.c b/mm/filemap.c
--- a/mm/filemap.c	2004-07-27 18:24:51 -07:00
+++ b/mm/filemap.c	2004-07-27 18:24:51 -07:00
@@ -1421,15 +1421,9 @@
 			return err;
 		}
 	} else {
-	    	/*
-		 * If a nonlinear mapping then store the file page offset
-		 * in the pte.
-		 */
-		if (pgoff != linear_page_index(vma, addr)) {
-	    		err = install_file_pte(mm, vma, addr, pgoff, prot);
-			if (err)
-		    		return err;
-		}
+		err = install_file_pte(mm, vma, addr, pgoff, prot);
+		if (err)
+			return err;
 	}
 
 	len -= PAGE_SIZE;
diff -Nru a/mm/fremap.c b/mm/fremap.c
--- a/mm/fremap.c	2004-07-27 18:24:51 -07:00
+++ b/mm/fremap.c	2004-07-27 18:24:51 -07:00
@@ -61,12 +61,6 @@
 	pmd_t *pmd;
 	pte_t pte_val;
 
-	/*
-	 * We use page_add_file_rmap below: if install_page is
-	 * ever extended to anonymous pages, this will warn us.
-	 */
-	BUG_ON(!page_mapping(page));
-
 	pgd = pgd_offset(mm, addr);
 	spin_lock(&mm->page_table_lock);
 
@@ -76,6 +70,14 @@
 
 	pte = pte_alloc_map(mm, pmd, addr);
 	if (!pte)
+		goto err_unlock;
+
+	/*
+	 * This page may have been truncated. Tell the
+	 * caller about it.
+	 */
+	err = -EAGAIN;
+	if (!page_mapping(page))
 		goto err_unlock;
 
 	zap_pte(mm, vma, addr, pte);
diff -Nru a/mm/mmap.c b/mm/mmap.c
--- a/mm/mmap.c	2004-07-27 18:24:52 -07:00
+++ b/mm/mmap.c	2004-07-27 18:24:52 -07:00
@@ -750,6 +750,13 @@
 	int accountable = 1;
 	unsigned long charged = 0;
 
+	/*
+	 * Does the application expect PROT_READ to imply PROT_EXEC:
+	 */
+	if (unlikely((prot & PROT_READ) &&
+			(current->personality & READ_IMPLIES_EXEC)))
+		prot |= PROT_EXEC;
+
 	if (file) {
 		if (is_file_hugepages(file))
 			accountable = 0;
@@ -791,12 +798,6 @@
 	 */
 	vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) |
 			mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
-
-	/*
-	 * mm->def_flags might have VM_EXEC set, which PROT_NONE does NOT want.
-	 */
-	if (prot == PROT_NONE)
-		vm_flags &= ~VM_EXEC;
 
 	if (flags & MAP_LOCKED) {
 		if (!capable(CAP_IPC_LOCK))
diff -Nru a/mm/mprotect.c b/mm/mprotect.c
--- a/mm/mprotect.c	2004-07-27 18:24:53 -07:00
+++ b/mm/mprotect.c	2004-07-27 18:24:53 -07:00
@@ -17,6 +17,7 @@
 #include <linux/highmem.h>
 #include <linux/security.h>
 #include <linux/mempolicy.h>
+#include <linux/personality.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -205,6 +206,12 @@
 		return -EINVAL;
 	if (end == start)
 		return 0;
+	/*
+	 * Does the application expect PROT_READ to imply PROT_EXEC:
+	 */
+	if (unlikely((prot & PROT_READ) &&
+			(current->personality & READ_IMPLIES_EXEC)))
+		prot |= PROT_EXEC;
 
 	vm_flags = calc_vm_prot_bits(prot);
 
diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c	2004-07-27 18:24:51 -07:00
+++ b/mm/page_alloc.c	2004-07-27 18:24:51 -07:00
@@ -1402,7 +1402,7 @@
 		INIT_LIST_HEAD(&page->lru);
 #ifdef WANT_PAGE_VIRTUAL
 		/* The shift won't overflow because ZONE_NORMAL is below 4G. */
-		if (!is_highmem(zone))
+		if (!is_highmem_idx(zone))
 			set_page_address(page, __va(start_pfn << PAGE_SHIFT));
 #endif
 		start_pfn++;
diff -Nru a/mm/shmem.c b/mm/shmem.c
--- a/mm/shmem.c	2004-07-27 18:24:51 -07:00
+++ b/mm/shmem.c	2004-07-27 18:24:51 -07:00
@@ -1121,15 +1121,9 @@
 				return err;
 			}
 		} else if (nonblock) {
-	    		/*
-		 	 * If a nonlinear mapping then store the file page
-			 * offset in the pte.
-			 */
-			if (pgoff != linear_page_index(vma, addr)) {
-	    			err = install_file_pte(mm, vma, addr, pgoff, prot);
-				if (err)
-		    			return err;
-			}
+    			err = install_file_pte(mm, vma, addr, pgoff, prot);
+			if (err)
+	    			return err;
 		}
 
 		len -= PAGE_SIZE;
diff -Nru a/net/appletalk/ddp.c b/net/appletalk/ddp.c
--- a/net/appletalk/ddp.c	2004-07-27 18:24:53 -07:00
+++ b/net/appletalk/ddp.c	2004-07-27 18:24:53 -07:00
@@ -908,12 +908,12 @@
 
 		case SIOCADDRT: {
 			struct net_device *dev = NULL;
-			/*
-			 * FIXME: the name of the device is still in user
-			 * space, isn't it?
-			 */
 			if (rt.rt_dev) {
-				dev = __dev_get_by_name(rt.rt_dev);
+				char name[IFNAMSIZ];
+				if (copy_from_user(name, rt.rt_dev, IFNAMSIZ-1))
+					return -EFAULT;
+				name[IFNAMSIZ-1] = '\0';
+				dev = __dev_get_by_name(name);
 				if (!dev)
 					return -ENODEV;
 			}			
diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c
--- a/net/atm/br2684.c	2004-07-27 18:24:53 -07:00
+++ b/net/atm/br2684.c	2004-07-27 18:24:53 -07:00
@@ -563,7 +563,7 @@
 		BRPRIV(skb->dev)->stats.rx_packets--;
 		br2684_push(atmvcc, skb);
 	}
-	(void) try_module_get(THIS_MODULE);
+	__module_get(THIS_MODULE);
 	return 0;
     error:
 	write_unlock_irq(&devs_lock);
diff -Nru a/net/atm/lec.c b/net/atm/lec.c
--- a/net/atm/lec.c	2004-07-27 18:24:52 -07:00
+++ b/net/atm/lec.c	2004-07-27 18:24:52 -07:00
@@ -1,6 +1,6 @@
 /*
  * lec.c: Lan Emulation driver 
- * Marko Kiiskila carnil@cs.tut.fi
+ * Marko Kiiskila mkiiskila@yahoo.com
  *
  */
 
diff -Nru a/net/atm/lec.h b/net/atm/lec.h
--- a/net/atm/lec.h	2004-07-27 18:24:51 -07:00
+++ b/net/atm/lec.h	2004-07-27 18:24:51 -07:00
@@ -2,7 +2,7 @@
  *
  * Lan Emulation client header file
  *
- * Marko Kiiskila carnil@cs.tut.fi
+ * Marko Kiiskila mkiiskila@yahoo.com
  *
  */
 
diff -Nru a/net/atm/lec_arpc.h b/net/atm/lec_arpc.h
--- a/net/atm/lec_arpc.h	2004-07-27 18:24:52 -07:00
+++ b/net/atm/lec_arpc.h	2004-07-27 18:24:52 -07:00
@@ -1,6 +1,6 @@
 /*
  * Lec arp cache
- * Marko Kiiskila carnil@cs.tut.fi
+ * Marko Kiiskila mkiiskila@yahoo.com
  *
  */
 #ifndef _LEC_ARP_H
diff -Nru a/net/atm/pppoatm.c b/net/atm/pppoatm.c
--- a/net/atm/pppoatm.c	2004-07-27 18:24:52 -07:00
+++ b/net/atm/pppoatm.c	2004-07-27 18:24:52 -07:00
@@ -307,7 +307,7 @@
 	atmvcc->user_back = pvcc;
 	atmvcc->push = pppoatm_push;
 	atmvcc->pop = pppoatm_pop;
-	(void) try_module_get(THIS_MODULE);
+	__module_get(THIS_MODULE);
 	return 0;
 }
 
diff -Nru a/net/atm/resources.c b/net/atm/resources.c
--- a/net/atm/resources.c	2004-07-27 18:24:52 -07:00
+++ b/net/atm/resources.c	2004-07-27 18:24:52 -07:00
@@ -356,9 +356,9 @@
 				? -EFAULT : 0;
 			goto done;
 		case ATM_SETLOOP:
-			if (__ATM_LM_XTRMT((int) (long) buf) &&
-			    __ATM_LM_XTLOC((int) (long) buf) >
-			    __ATM_LM_XTRMT((int) (long) buf)) {
+			if (__ATM_LM_XTRMT((int) (unsigned long) buf) &&
+			    __ATM_LM_XTLOC((int) (unsigned long) buf) >
+			    __ATM_LM_XTRMT((int) (unsigned long) buf)) {
 				error = -EINVAL;
 				goto done;
 			}
diff -Nru a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
--- a/net/bluetooth/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/net/bluetooth/Kconfig	2004-07-27 18:24:52 -07:00
@@ -20,6 +20,7 @@
 	     RFCOMM Module (RFCOMM Protocol)  
 	     BNEP Module (Bluetooth Network Encapsulation Protocol)
 	     CMTP Module (CAPI Message Transport Protocol)
+	     HIDP Module (Human Interface Device Protocol)
 
 	  Say Y here to compile Bluetooth support into the kernel or say M to
 	  compile it as module (bluetooth).
diff -Nru a/net/bluetooth/bnep/bnep.h b/net/bluetooth/bnep/bnep.h
--- a/net/bluetooth/bnep/bnep.h	2004-07-27 18:24:51 -07:00
+++ b/net/bluetooth/bnep/bnep.h	2004-07-27 18:24:51 -07:00
@@ -139,7 +139,7 @@
 
 struct bnep_connlist_req {
 	__u32  cnum;
-	struct bnep_conninfo *ci;
+	struct bnep_conninfo __user *ci;
 };
 
 struct bnep_proto_filter {
diff -Nru a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
--- a/net/bluetooth/bnep/core.c	2004-07-27 18:24:52 -07:00
+++ b/net/bluetooth/bnep/core.c	2004-07-27 18:24:52 -07:00
@@ -99,11 +99,9 @@
 static int bnep_send(struct bnep_session *s, void *data, size_t len)
 {
 	struct socket *sock = s->sock;
-	struct iovec iv = { data, len };
+	struct kvec iv = { data, len };
 
-	s->msg.msg_iov    = &iv;
-	s->msg.msg_iovlen = 1;
-	return sock_sendmsg(sock, &s->msg, len);
+	return kernel_sendmsg(sock, &s->msg, &iv, 1, len);
 }
 
 static int bnep_send_rsp(struct bnep_session *s, u8 ctrl, u16 resp)
@@ -389,7 +387,7 @@
 {
 	struct ethhdr *eh = (void *) skb->data;
 	struct socket *sock = s->sock;
-	struct iovec iv[3];
+	struct kvec iv[3];
 	int len = 0, il = 0;
 	u8 type = 0;
 
@@ -400,7 +398,7 @@
 		goto send;
 	}
 
-	iv[il++] = (struct iovec) { &type, 1 };
+	iv[il++] = (struct kvec) { &type, 1 };
 	len++;
 
 	if (!memcmp(eh->h_dest, s->eh.h_source, ETH_ALEN))
@@ -415,25 +413,23 @@
 	type = __bnep_tx_types[type];
 	switch (type) {
 	case BNEP_COMPRESSED_SRC_ONLY:
-		iv[il++] = (struct iovec) { eh->h_source, ETH_ALEN };
+		iv[il++] = (struct kvec) { eh->h_source, ETH_ALEN };
 		len += ETH_ALEN;
 		break;
 		
 	case BNEP_COMPRESSED_DST_ONLY:
-		iv[il++] = (struct iovec) { eh->h_dest, ETH_ALEN };
+		iv[il++] = (struct kvec) { eh->h_dest, ETH_ALEN };
 		len += ETH_ALEN;
 		break;
 	}
 
 send:
-	iv[il++] = (struct iovec) { skb->data, skb->len };
+	iv[il++] = (struct kvec) { skb->data, skb->len };
 	len += skb->len;
 	
 	/* FIXME: linearize skb */
 	{
-		s->msg.msg_iov    = iv;
-		s->msg.msg_iovlen = il;
-		len = sock_sendmsg(sock, &s->msg, len);
+		len = kernel_sendmsg(sock, &s->msg, iv, il, len);
 	}
 	kfree_skb(skb);
 
@@ -459,8 +455,6 @@
         daemonize("kbnepd %s", dev->name);
 	set_user_nice(current, -15);
 	current->flags |= PF_NOFREEZE;
-
-        set_fs(KERNEL_DS);
 
 	init_waitqueue_entry(&wait, current);
 	add_wait_queue(sk->sk_sleep, &wait);
diff -Nru a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
--- a/net/bluetooth/cmtp/core.c	2004-07-27 18:24:52 -07:00
+++ b/net/bluetooth/cmtp/core.c	2004-07-27 18:24:52 -07:00
@@ -201,7 +201,7 @@
 static int cmtp_send_frame(struct cmtp_session *session, unsigned char *data, int len)
 {
 	struct socket *sock = session->sock;
-	struct iovec iv = { data, len };
+	struct kvec iv = { data, len };
 	struct msghdr msg;
 
 	BT_DBG("session %p data %p len %d", session, data, len);
@@ -210,10 +210,8 @@
 		return 0;
 
 	memset(&msg, 0, sizeof(msg));
-	msg.msg_iovlen = 1;
-	msg.msg_iov = &iv;
 
-	return sock_sendmsg(sock, &msg, len);
+	return kernel_sendmsg(sock, &msg, &iv, 1, len);
 }
 
 static int cmtp_process_transmit(struct cmtp_session *session)
@@ -294,8 +292,6 @@
 	daemonize("kcmtpd_ctr_%d", session->num);
 	set_user_nice(current, -15);
 	current->flags |= PF_NOFREEZE;
-
-	set_fs(KERNEL_DS);
 
 	init_waitqueue_entry(&wait, current);
 	add_wait_queue(sk->sk_sleep, &wait);
diff -Nru a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
--- a/net/bluetooth/hidp/core.c	2004-07-27 18:24:52 -07:00
+++ b/net/bluetooth/hidp/core.c	2004-07-27 18:24:52 -07:00
@@ -274,7 +274,7 @@
 
 static int hidp_send_frame(struct socket *sock, unsigned char *data, int len)
 {
-	struct iovec iv = { data, len };
+	struct kvec iv = { data, len };
 	struct msghdr msg;
 
 	BT_DBG("sock %p data %p len %d", sock, data, len);
@@ -283,10 +283,8 @@
 		return 0;
 
 	memset(&msg, 0, sizeof(msg));
-	msg.msg_iovlen = 1;
-	msg.msg_iov = &iv;
 
-	return sock_sendmsg(sock, &msg, len);
+	return kernel_sendmsg(sock, &msg, &iv, 1, len);
 }
 
 static int hidp_process_transmit(struct hidp_session *session)
@@ -339,8 +337,6 @@
 	daemonize("khidpd_%04x%04x", vendor, product);
 	set_user_nice(current, -15);
 	current->flags |= PF_NOFREEZE;
-
-	set_fs(KERNEL_DS);
 
 	init_waitqueue_entry(&ctrl_wait, current);
 	init_waitqueue_entry(&intr_wait, current);
diff -Nru a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
--- a/net/bluetooth/rfcomm/core.c	2004-07-27 18:24:51 -07:00
+++ b/net/bluetooth/rfcomm/core.c	2004-07-27 18:24:51 -07:00
@@ -323,14 +323,11 @@
 
 int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, u8 channel)
 {
-	mm_segment_t fs;
 	int r;
 
 	rfcomm_lock();
 
-	fs = get_fs(); set_fs(KERNEL_DS);
 	r = __rfcomm_dlc_open(d, src, dst, channel);
-	set_fs(fs);
 
 	rfcomm_unlock();
 	return r;
@@ -376,14 +373,11 @@
 
 int rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
 {
-	mm_segment_t fs;
 	int r;
 
 	rfcomm_lock();
 
-	fs = get_fs(); set_fs(KERNEL_DS);
 	r = __rfcomm_dlc_close(d, err);
-	set_fs(fs);
 
 	rfcomm_unlock();
 	return r;
@@ -552,9 +546,8 @@
 {
 	struct rfcomm_session *s = NULL;
 	struct sockaddr_l2 addr;
-	struct l2cap_options opts;
 	struct socket *sock;
-	int    size;
+	struct sock *sk;
 
 	BT_DBG("%s %s", batostr(src), batostr(dst));
 
@@ -570,11 +563,10 @@
 		goto failed;
 
 	/* Set L2CAP options */
-	size = sizeof(opts);
-	sock->ops->getsockopt(sock, SOL_L2CAP, L2CAP_OPTIONS, (void *)&opts, &size);
-	
-	opts.imtu = RFCOMM_MAX_L2CAP_MTU;
-	sock->ops->setsockopt(sock, SOL_L2CAP, L2CAP_OPTIONS, (void *)&opts, size);
+	sk = sock->sk;
+	lock_sock(sk);
+	l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU;
+	release_sock(sk);
 
 	s = rfcomm_session_add(sock, BT_BOUND);
 	if (!s) {
@@ -612,16 +604,14 @@
 static int rfcomm_send_frame(struct rfcomm_session *s, u8 *data, int len)
 {
 	struct socket *sock = s->sock;
-	struct iovec iv = { data, len };
+	struct kvec iv = { data, len };
 	struct msghdr msg;
 
 	BT_DBG("session %p len %d", s, len);
 
 	memset(&msg, 0, sizeof(msg));
-	msg.msg_iovlen = 1;
-	msg.msg_iov = &iv;
 
-	return sock_sendmsg(sock, &msg, len);
+	return kernel_sendmsg(sock, &msg, &iv, 1, len);
 }
 
 static int rfcomm_send_sabm(struct rfcomm_session *s, u8 dlci)
@@ -905,7 +895,7 @@
 static int rfcomm_send_test(struct rfcomm_session *s, int cr, u8 *pattern, int len)
 {
 	struct socket *sock = s->sock;
-	struct iovec iv[3];
+	struct kvec iv[3];
 	struct msghdr msg;
 	unsigned char hdr[5], crc[1];
 
@@ -930,10 +920,8 @@
 	iv[2].iov_len  = 1;
 
 	memset(&msg, 0, sizeof(msg));
-	msg.msg_iovlen = 3;
-	msg.msg_iov = iv;
 
-	return sock_sendmsg(sock, &msg, 6 + len);
+	return kernel_sendmsg(sock, &msg, iv, 3, 6 + len);
 }
 
 static int rfcomm_send_credits(struct rfcomm_session *s, u8 addr, u8 credits)
@@ -1749,10 +1737,10 @@
 static int rfcomm_add_listener(bdaddr_t *ba)
 {
 	struct sockaddr_l2 addr;
-	struct l2cap_options opts;
 	struct socket *sock;
+	struct sock *sk;
 	struct rfcomm_session *s;
-	int    size, err = 0;
+	int    err = 0;
 
 	/* Create socket */
 	err = rfcomm_l2sock_create(&sock);
@@ -1772,11 +1760,10 @@
 	}
 
 	/* Set L2CAP options */
-	size = sizeof(opts);
-	sock->ops->getsockopt(sock, SOL_L2CAP, L2CAP_OPTIONS, (void *)&opts, &size);
-
-	opts.imtu = RFCOMM_MAX_L2CAP_MTU;
-	sock->ops->setsockopt(sock, SOL_L2CAP, L2CAP_OPTIONS, (void *)&opts, size);
+	sk = sock->sk;
+	lock_sock(sk);
+	l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU;
+	release_sock(sk);
 
 	/* Start listening on the socket */
 	err = sock->ops->listen(sock, 10);
@@ -1819,8 +1806,6 @@
 	daemonize("krfcommd");
 	set_user_nice(current, -10);
 	current->flags |= PF_NOFREEZE;
-
-	set_fs(KERNEL_DS);
 
 	BT_DBG("");
 
diff -Nru a/net/ipv4/Makefile b/net/ipv4/Makefile
--- a/net/ipv4/Makefile	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/Makefile	2004-07-27 18:24:51 -07:00
@@ -6,7 +6,7 @@
 	     ip_input.o ip_fragment.o ip_forward.o ip_options.o \
 	     ip_output.o ip_sockglue.o \
 	     tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o tcp_minisocks.o \
-	     tcp_diag.o raw.o udp.o arp.o icmp.o devinet.o af_inet.o igmp.o \
+	     tcp_diag.o datagram.o raw.o udp.o arp.o icmp.o devinet.o af_inet.o igmp.o \
 	     sysctl_net_ipv4.o fib_frontend.o fib_semantics.o fib_hash.o
 
 obj-$(CONFIG_PROC_FS) += proc.o
diff -Nru a/net/ipv4/ah4.c b/net/ipv4/ah4.c
--- a/net/ipv4/ah4.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv4/ah4.c	2004-07-27 18:24:52 -07:00
@@ -73,9 +73,9 @@
 	iph->tos = top_iph->tos;
 	iph->ttl = top_iph->ttl;
 	iph->frag_off = top_iph->frag_off;
-	iph->daddr = top_iph->daddr;
 
 	if (top_iph->ihl != 5) {
+		iph->daddr = top_iph->daddr;
 		memcpy(iph+1, top_iph+1, top_iph->ihl*4 - sizeof(struct iphdr));
 		err = ip_clear_mutable_options(top_iph, &top_iph->daddr);
 		if (err)
@@ -104,9 +104,10 @@
 	top_iph->tos = iph->tos;
 	top_iph->ttl = iph->ttl;
 	top_iph->frag_off = iph->frag_off;
-	top_iph->daddr = iph->daddr;
-	if (top_iph->ihl != 5)
+	if (top_iph->ihl != 5) {
+		top_iph->daddr = iph->daddr;
 		memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr));
+	}
 
 	ip_send_check(top_iph);
 
diff -Nru a/net/ipv4/arp.c b/net/ipv4/arp.c
--- a/net/ipv4/arp.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv4/arp.c	2004-07-27 18:24:52 -07:00
@@ -426,7 +426,7 @@
 	if (ip_route_output_key(&rt, &fl) < 0) 
 		return 1;
 	if (rt->u.dst.dev != dev) { 
-		NET_INC_STATS_BH(ArpFilter);
+		NET_INC_STATS_BH(LINUX_MIB_ARPFILTER);
 		flag = 1;
 	} 
 	ip_rt_put(rt); 
diff -Nru a/net/ipv4/datagram.c b/net/ipv4/datagram.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/net/ipv4/datagram.c	2004-07-27 18:24:53 -07:00
@@ -0,0 +1,73 @@
+/*
+ *	common UDP/RAW code
+ *	Linux INET implementation
+ *
+ * Authors:
+ * 	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
+ *
+ * 	This program is free software; you can redistribute it and/or
+ * 	modify it under the terms of the GNU General Public License
+ * 	as published by the Free Software Foundation; either version
+ * 	2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/ip.h>
+#include <linux/in.h>
+#include <net/sock.h>
+#include <net/tcp.h>
+#include <net/route.h>
+
+int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
+{
+	struct inet_opt *inet = inet_sk(sk);
+	struct sockaddr_in *usin = (struct sockaddr_in *) uaddr;
+	struct rtable *rt;
+	u32 saddr;
+	int oif;
+	int err;
+
+	
+	if (addr_len < sizeof(*usin)) 
+	  	return -EINVAL;
+
+	if (usin->sin_family != AF_INET) 
+	  	return -EAFNOSUPPORT;
+
+	sk_dst_reset(sk);
+
+	oif = sk->sk_bound_dev_if;
+	saddr = inet->saddr;
+	if (MULTICAST(usin->sin_addr.s_addr)) {
+		if (!oif)
+			oif = inet->mc_index;
+		if (!saddr)
+			saddr = inet->mc_addr;
+	}
+	err = ip_route_connect(&rt, usin->sin_addr.s_addr, saddr,
+			       RT_CONN_FLAGS(sk), oif,
+			       sk->sk_protocol,
+			       inet->sport, usin->sin_port, sk);
+	if (err)
+		return err;
+	if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) {
+		ip_rt_put(rt);
+		return -EACCES;
+	}
+  	if (!inet->saddr)
+	  	inet->saddr = rt->rt_src;	/* Update source address */
+	if (!inet->rcv_saddr)
+		inet->rcv_saddr = rt->rt_src;
+	inet->daddr = rt->rt_dst;
+	inet->dport = usin->sin_port;
+	sk->sk_state = TCP_ESTABLISHED;
+	inet->id = jiffies;
+
+	sk_dst_set(sk, &rt->u.dst);
+	return(0);
+}
+
+EXPORT_SYMBOL(ip4_datagram_connect);
+
diff -Nru a/net/ipv4/icmp.c b/net/ipv4/icmp.c
--- a/net/ipv4/icmp.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv4/icmp.c	2004-07-27 18:24:52 -07:00
@@ -213,8 +213,8 @@
  */
 
 struct icmp_control {
-	int output_off;		/* Field offset for increment on output */
-	int input_off;		/* Field offset for increment on input */
+	int output_entry;	/* Field for increment on output */
+	int input_entry;	/* Field for increment on input */
 	void (*handler)(struct sk_buff *skb);
 	short   error;		/* This ICMP is classed as an error message */
 };
@@ -318,8 +318,8 @@
 static void icmp_out_count(int type)
 {
 	if (type <= NR_ICMP_TYPES) {
-		ICMP_INC_STATS_FIELD(icmp_pointers[type].output_off);
-		ICMP_INC_STATS(IcmpOutMsgs);
+		ICMP_INC_STATS(icmp_pointers[type].output_entry);
+		ICMP_INC_STATS(ICMP_MIB_OUTMSGS);
 	}
 }
 
@@ -714,7 +714,7 @@
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(IcmpInErrors);
+	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -755,7 +755,7 @@
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(IcmpInErrors);
+	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -823,7 +823,7 @@
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(IcmpInErrors);
+	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -922,7 +922,7 @@
 	struct icmphdr *icmph;
 	struct rtable *rt = (struct rtable *)skb->dst;
 
-	ICMP_INC_STATS_BH(IcmpInMsgs);
+	ICMP_INC_STATS_BH(ICMP_MIB_INMSGS);
 
 	switch (skb->ip_summed) {
 	case CHECKSUM_HW:
@@ -974,14 +974,14 @@
   		}
 	}
 
-	ICMP_INC_STATS_BH_FIELD(icmp_pointers[icmph->type].input_off);
+	ICMP_INC_STATS_BH(icmp_pointers[icmph->type].input_entry);
 	icmp_pointers[icmph->type].handler(skb);
 
 drop:
 	kfree_skb(skb);
 	return 0;
 error:
-	ICMP_INC_STATS_BH(IcmpInErrors);
+	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 	goto drop;
 }
 
@@ -990,109 +990,109 @@
  */
 static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
 	[ICMP_ECHOREPLY] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutEchoReps),
-		.input_off = offsetof(struct icmp_mib, IcmpInEchoReps),
+		.output_entry = ICMP_MIB_OUTECHOREPS,
+		.input_entry = ICMP_MIB_INECHOREPS,
 		.handler = icmp_discard,
 	},
 	[1] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib,IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[2] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib,IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[ICMP_DEST_UNREACH] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutDestUnreachs),
-		.input_off = offsetof(struct icmp_mib, IcmpInDestUnreachs),
+		.output_entry = ICMP_MIB_OUTDESTUNREACHS,
+		.input_entry = ICMP_MIB_INDESTUNREACHS,
 		.handler = icmp_unreach,
 		.error = 1,
 	},
 	[ICMP_SOURCE_QUENCH] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutSrcQuenchs),
-		.input_off = offsetof(struct icmp_mib, IcmpInSrcQuenchs),
+		.output_entry = ICMP_MIB_OUTSRCQUENCHS,
+		.input_entry = ICMP_MIB_INSRCQUENCHS,
 		.handler = icmp_unreach,
 		.error = 1,
 	},
 	[ICMP_REDIRECT] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutRedirects),
-		.input_off = offsetof(struct icmp_mib, IcmpInRedirects),
+		.output_entry = ICMP_MIB_OUTREDIRECTS,
+		.input_entry = ICMP_MIB_INREDIRECTS,
 		.handler = icmp_redirect,
 		.error = 1,
 	},
 	[6] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[7] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[ICMP_ECHO] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutEchos),
-		.input_off = offsetof(struct icmp_mib, IcmpInEchos),
+		.output_entry = ICMP_MIB_OUTECHOS,
+		.input_entry = ICMP_MIB_INECHOS,
 		.handler = icmp_echo,
 	},
 	[9] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[10] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[ICMP_TIME_EXCEEDED] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutTimeExcds),
-		.input_off = offsetof(struct icmp_mib,IcmpInTimeExcds),
+		.output_entry = ICMP_MIB_OUTTIMEEXCDS,
+		.input_entry = ICMP_MIB_INTIMEEXCDS,
 		.handler = icmp_unreach,
 		.error = 1,
 	},
 	[ICMP_PARAMETERPROB] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutParmProbs),
-		.input_off = offsetof(struct icmp_mib, IcmpInParmProbs),
+		.output_entry = ICMP_MIB_OUTPARMPROBS,
+		.input_entry = ICMP_MIB_INPARMPROBS,
 		.handler = icmp_unreach,
 		.error = 1,
 	},
 	[ICMP_TIMESTAMP] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutTimestamps),
-		.input_off = offsetof(struct icmp_mib, IcmpInTimestamps),
+		.output_entry = ICMP_MIB_OUTTIMESTAMPS,
+		.input_entry = ICMP_MIB_INTIMESTAMPS,
 		.handler = icmp_timestamp,
 	},
 	[ICMP_TIMESTAMPREPLY] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutTimestampReps),
-		.input_off = offsetof(struct icmp_mib, IcmpInTimestampReps),
+		.output_entry = ICMP_MIB_OUTTIMESTAMPREPS,
+		.input_entry = ICMP_MIB_INTIMESTAMPREPS,
 		.handler = icmp_discard,
 	},
 	[ICMP_INFO_REQUEST] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, dummy),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_DUMMY,
 		.handler = icmp_discard,
 	},
  	[ICMP_INFO_REPLY] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, dummy),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_DUMMY,
 		.handler = icmp_discard,
 	},
 	[ICMP_ADDRESS] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutAddrMasks),
-		.input_off = offsetof(struct icmp_mib, IcmpInAddrMasks),
+		.output_entry = ICMP_MIB_OUTADDRMASKS,
+		.input_entry = ICMP_MIB_INADDRMASKS,
 		.handler = icmp_address,
 	},
 	[ICMP_ADDRESSREPLY] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutAddrMaskReps),
-		.input_off = offsetof(struct icmp_mib, IcmpInAddrMaskReps),
+		.output_entry = ICMP_MIB_OUTADDRMASKREPS,
+		.input_entry = ICMP_MIB_INADDRMASKREPS,
 		.handler = icmp_address_reply,
 	},
 };
diff -Nru a/net/ipv4/igmp.c b/net/ipv4/igmp.c
--- a/net/ipv4/igmp.c	2004-07-27 18:24:53 -07:00
+++ b/net/ipv4/igmp.c	2004-07-27 18:24:53 -07:00
@@ -2217,8 +2217,8 @@
 static int igmp_mc_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == SEQ_START_TOKEN)
-		seq_printf(seq, 
-			   "Idx\tDevice    : Count Querier\tGroup    Users Timer\tReporter\n");
+		seq_puts(seq, 
+			 "Idx\tDevice    : Count Querier\tGroup    Users Timer\tReporter\n");
 	else {
 		struct ip_mc_list *im = (struct ip_mc_list *)v;
 		struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
diff -Nru a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
--- a/net/ipv4/ip_forward.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/ip_forward.c	2004-07-27 18:24:51 -07:00
@@ -46,7 +46,7 @@
 {
 	struct ip_options * opt	= &(IPCB(skb)->opt);
 
-	IP_INC_STATS_BH(OutForwDatagrams);
+	IP_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
 
 	if (unlikely(opt->optlen))
 		ip_forward_options(skb);
diff -Nru a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
--- a/net/ipv4/ip_fragment.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/ip_fragment.c	2004-07-27 18:24:51 -07:00
@@ -263,7 +263,7 @@
 		spin_unlock(&qp->lock);
 
 		ipq_put(qp);
-		IP_INC_STATS_BH(ReasmFails);
+		IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	}
 }
 
@@ -281,8 +281,8 @@
 
 	ipq_kill(qp);
 
-	IP_INC_STATS_BH(ReasmTimeout);
-	IP_INC_STATS_BH(ReasmFails);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 
 	if ((qp->last_in&FIRST_IN) && qp->fragments != NULL) {
 		struct sk_buff *head = qp->fragments;
@@ -609,7 +609,7 @@
 	iph = head->nh.iph;
 	iph->frag_off = 0;
 	iph->tot_len = htons(len);
-	IP_INC_STATS_BH(ReasmOKs);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
 	qp->fragments = NULL;
 	return head;
 
@@ -625,7 +625,7 @@
 			"Oversized IP packet from %d.%d.%d.%d.\n",
 			NIPQUAD(qp->saddr));
 out_fail:
-	IP_INC_STATS_BH(ReasmFails);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	return NULL;
 }
 
@@ -636,7 +636,7 @@
 	struct ipq *qp;
 	struct net_device *dev;
 	
-	IP_INC_STATS_BH(ReasmReqds);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
 
 	/* Start by cleaning up the memory. */
 	if (atomic_read(&ip_frag_mem) > sysctl_ipfrag_high_thresh)
@@ -661,7 +661,7 @@
 		return ret;
 	}
 
-	IP_INC_STATS_BH(ReasmFails);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	kfree_skb(skb);
 	return NULL;
 }
diff -Nru a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
--- a/net/ipv4/ip_input.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/ip_input.c	2004-07-27 18:24:51 -07:00
@@ -245,16 +245,16 @@
 				protocol = -ret;
 				goto resubmit;
 			}
-			IP_INC_STATS_BH(InDelivers);
+			IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
 		} else {
 			if (!raw_sk) {
 				if (xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
-					IP_INC_STATS_BH(InUnknownProtos);
+					IP_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS);
 					icmp_send(skb, ICMP_DEST_UNREACH,
 						  ICMP_PROT_UNREACH, 0);
 				}
 			} else
-				IP_INC_STATS_BH(InDelivers);
+				IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
 			kfree_skb(skb);
 		}
 	}
@@ -320,7 +320,7 @@
 		*/
 
 		if (skb_cow(skb, skb_headroom(skb))) {
-			IP_INC_STATS_BH(InDiscards);
+			IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 			goto drop;
 		}
 		iph = skb->nh.iph;
@@ -349,7 +349,7 @@
 	return dst_input(skb);
 
 inhdr_error:
-	IP_INC_STATS_BH(InHdrErrors);
+	IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 drop:
         kfree_skb(skb);
         return NET_RX_DROP;
@@ -368,10 +368,10 @@
 	if (skb->pkt_type == PACKET_OTHERHOST)
 		goto drop;
 
-	IP_INC_STATS_BH(InReceives);
+	IP_INC_STATS_BH(IPSTATS_MIB_INRECEIVES);
 
 	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
-		IP_INC_STATS_BH(InDiscards);
+		IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 		goto out;
 	}
 
@@ -422,7 +422,7 @@
 		       ip_rcv_finish);
 
 inhdr_error:
-	IP_INC_STATS_BH(InHdrErrors);
+	IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 drop:
         kfree_skb(skb);
 out:
diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c	2004-07-27 18:24:53 -07:00
+++ b/net/ipv4/ip_output.c	2004-07-27 18:24:53 -07:00
@@ -233,7 +233,7 @@
 	/*
 	 *	If the indicated interface is up and running, send the packet.
 	 */
-	IP_INC_STATS(OutRequests);
+	IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 
 	skb->dev = dev;
 	skb->protocol = htons(ETH_P_IP);
@@ -288,7 +288,7 @@
 {
 	struct sk_buff *skb = *pskb;
 
-	IP_INC_STATS(OutRequests);
+	IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 
 	if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list) &&
 	    !skb_shinfo(skb)->tso_size)
@@ -393,7 +393,7 @@
 		       dst_output);
 
 no_route:
-	IP_INC_STATS(OutNoRoutes);
+	IP_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
 	kfree_skb(skb);
 	return -EHOSTUNREACH;
 }
@@ -546,7 +546,7 @@
 		}
 
 		if (err == 0) {
-			IP_INC_STATS(FragOKs);
+			IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
 			return 0;
 		}
 
@@ -555,7 +555,7 @@
 			kfree_skb(frag);
 			frag = skb;
 		}
-		IP_INC_STATS(FragFails);
+		IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 		return err;
 	}
 
@@ -661,7 +661,7 @@
 		 *	Put this fragment into the sending queue.
 		 */
 
-		IP_INC_STATS(FragCreates);
+		IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
 
 		iph->tot_len = htons(len + hlen);
 
@@ -672,12 +672,12 @@
 			goto fail;
 	}
 	kfree_skb(skb);
-	IP_INC_STATS(FragOKs);
+	IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
 	return err;
 
 fail:
 	kfree_skb(skb); 
-	IP_INC_STATS(FragFails);
+	IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 	return err;
 }
 
@@ -963,7 +963,7 @@
 
 error:
 	inet->cork.length -= length;
-	IP_INC_STATS(OutDiscards);
+	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err; 
 }
 
@@ -1076,7 +1076,7 @@
 
 error:
 	inet->cork.length -= size;
-	IP_INC_STATS(OutDiscards);
+	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err;
 }
 
@@ -1184,7 +1184,7 @@
 	return err;
 
 error:
-	IP_INC_STATS(OutDiscards);
+	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	goto out;
 }
 
diff -Nru a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
--- a/net/ipv4/ipmr.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/ipmr.c	2004-07-27 18:24:51 -07:00
@@ -1114,7 +1114,7 @@
 {
 	struct ip_options * opt	= &(IPCB(skb)->opt);
 
-	IP_INC_STATS_BH(OutForwDatagrams);
+	IP_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
 
 	if (unlikely(opt->optlen))
 		ip_forward_options(skb);
@@ -1177,7 +1177,7 @@
 		   to blackhole.
 		 */
 
-		IP_INC_STATS_BH(FragFails);
+		IP_INC_STATS_BH(IPSTATS_MIB_FRAGFAILS);
 		ip_rt_put(rt);
 		goto out_free;
 	}
diff -Nru a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c
--- a/net/ipv4/ipvs/ip_vs_ftp.c	2004-07-27 18:24:53 -07:00
+++ b/net/ipv4/ipvs/ip_vs_ftp.c	2004-07-27 18:24:53 -07:00
@@ -25,6 +25,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/in.h>
@@ -44,16 +45,17 @@
  * First port is set to the default port.
  */
 static int ports[IP_VS_APP_MAX_PORTS] = {21, 0};
+static int ports_c;
+module_param_array(ports, int, ports_c, 0);
 
 /*
  *	Debug level
  */
 #ifdef CONFIG_IP_VS_DEBUG
 static int debug=0;
-MODULE_PARM(debug, "i");
+module_param(debug, int, 0);
 #endif
 
-MODULE_PARM(ports, "1-" __MODULE_STRING(IP_VS_APP_MAX_PORTS) "i");
 
 /*	Dummy variable */
 static int ip_vs_ftp_pasv;
diff -Nru a/net/ipv4/proc.c b/net/ipv4/proc.c
--- a/net/ipv4/proc.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/proc.c	2004-07-27 18:24:51 -07:00
@@ -88,7 +88,7 @@
 };
 
 static unsigned long
-__fold_field(void *mib[], int offt)
+fold_field(void *mib[], int offt)
 {
 	unsigned long res = 0;
 	int i;
@@ -96,41 +96,157 @@
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_possible(i))
 			continue;
-		res +=
-		    *((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) +
-					 offt));
-		res +=
-		    *((unsigned long *) (((void *) per_cpu_ptr(mib[1], i)) +
-					 offt));
+		res += *(((unsigned long *) per_cpu_ptr(mib[0], i)) + offt);
+		res += *(((unsigned long *) per_cpu_ptr(mib[1], i)) + offt);
 	}
 	return res;
 }
 
-#define fold_field(_mib, _nr)	__fold_field(_mib, (sizeof(unsigned long) * (_nr)))
-
 /* snmp items */
-static struct snmp_item snmp4_ipstats_list[] = {
-#define __SNMP_GEN(x,y)	SNMP_ITEM(struct ipstats_mib, x, y)
-#define SNMP_GEN(x)	__SNMP_GEN(x, #x)
-	SNMP_GEN(InReceives),
-	SNMP_GEN(InHdrErrors),
-	SNMP_GEN(InAddrErrors),
-	__SNMP_GEN(OutForwDatagrams,"ForwDatagrams"),	/* for backward compatibility */
-	SNMP_GEN(InUnknownProtos),
-	SNMP_GEN(InDiscards),
-	SNMP_GEN(InDelivers),
-	SNMP_GEN(OutRequests),
-	SNMP_GEN(OutDiscards),
-	SNMP_GEN(OutNoRoutes),
-	SNMP_GEN(ReasmTimeout),
-	SNMP_GEN(ReasmReqds),
-	SNMP_GEN(ReasmOKs),
-	SNMP_GEN(ReasmFails),
-	SNMP_GEN(FragOKs),
-	SNMP_GEN(FragFails),
-	SNMP_GEN(FragCreates),
-	SNMP_ITEM_SENTINEL
-#undef SNMP_GEN
+static struct snmp_mib snmp4_ipstats_list[] = {
+	SNMP_MIB_ITEM("InReceives", IPSTATS_MIB_INRECEIVES),
+	SNMP_MIB_ITEM("InHdrErrors", IPSTATS_MIB_INHDRERRORS),
+	SNMP_MIB_ITEM("InAddrErrors", IPSTATS_MIB_INADDRERRORS),
+	SNMP_MIB_ITEM("ForwDatagrams", IPSTATS_MIB_OUTFORWDATAGRAMS),
+	SNMP_MIB_ITEM("InUnknownProtos", IPSTATS_MIB_INUNKNOWNPROTOS),
+	SNMP_MIB_ITEM("InDiscards", IPSTATS_MIB_INDISCARDS),
+	SNMP_MIB_ITEM("InDelivers", IPSTATS_MIB_INDELIVERS),
+	SNMP_MIB_ITEM("OutRequests", IPSTATS_MIB_OUTREQUESTS),
+	SNMP_MIB_ITEM("OutDiscards", IPSTATS_MIB_OUTDISCARDS),
+	SNMP_MIB_ITEM("OutNoRoutes", IPSTATS_MIB_OUTNOROUTES),
+	SNMP_MIB_ITEM("ReasmTimeout", IPSTATS_MIB_REASMTIMEOUT),
+	SNMP_MIB_ITEM("ReasmReqds", IPSTATS_MIB_REASMREQDS),
+	SNMP_MIB_ITEM("ReasmOKs", IPSTATS_MIB_REASMOKS),
+	SNMP_MIB_ITEM("ReasmFails", IPSTATS_MIB_REASMFAILS),
+	SNMP_MIB_ITEM("FragOKs", IPSTATS_MIB_FRAGOKS),
+	SNMP_MIB_ITEM("FragFails", IPSTATS_MIB_FRAGFAILS),
+	SNMP_MIB_ITEM("FragCreates", IPSTATS_MIB_FRAGCREATES),
+	SNMP_MIB_SENTINEL
+};
+
+static struct snmp_mib snmp4_icmp_list[] = {
+	SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
+	SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
+	SNMP_MIB_ITEM("InDestUnreachs", ICMP_MIB_INDESTUNREACHS),
+	SNMP_MIB_ITEM("InTimeExcds", ICMP_MIB_INTIMEEXCDS),
+	SNMP_MIB_ITEM("InParmProbs", ICMP_MIB_INPARMPROBS),
+	SNMP_MIB_ITEM("InSrcQuenchs", ICMP_MIB_INSRCQUENCHS),
+	SNMP_MIB_ITEM("InRedirects", ICMP_MIB_INREDIRECTS),
+	SNMP_MIB_ITEM("InEchos", ICMP_MIB_INECHOS),
+	SNMP_MIB_ITEM("InEchoReps", ICMP_MIB_INECHOREPS),
+	SNMP_MIB_ITEM("InTimestamps", ICMP_MIB_INTIMESTAMPS),
+	SNMP_MIB_ITEM("InTimestampReps", ICMP_MIB_INTIMESTAMPREPS),
+	SNMP_MIB_ITEM("InAddrMasks", ICMP_MIB_INADDRMASKS),
+	SNMP_MIB_ITEM("InAddrMaskReps", ICMP_MIB_INADDRMASKREPS),
+	SNMP_MIB_ITEM("OutMsgs", ICMP_MIB_OUTMSGS),
+	SNMP_MIB_ITEM("OutErrors", ICMP_MIB_OUTERRORS),
+	SNMP_MIB_ITEM("OutDestUnreachs", ICMP_MIB_OUTDESTUNREACHS),
+	SNMP_MIB_ITEM("OutTimeExcds", ICMP_MIB_OUTTIMEEXCDS),
+	SNMP_MIB_ITEM("OutParmProbs", ICMP_MIB_OUTPARMPROBS),
+	SNMP_MIB_ITEM("OutSrcQuenchs", ICMP_MIB_OUTSRCQUENCHS),
+	SNMP_MIB_ITEM("OutRedirects", ICMP_MIB_OUTREDIRECTS),
+	SNMP_MIB_ITEM("OutEchos", ICMP_MIB_OUTECHOS),
+	SNMP_MIB_ITEM("OutEchoReps", ICMP_MIB_OUTECHOREPS),
+	SNMP_MIB_ITEM("OutTimestamps", ICMP_MIB_OUTTIMESTAMPS),
+	SNMP_MIB_ITEM("OutTimestampReps", ICMP_MIB_OUTTIMESTAMPREPS),
+	SNMP_MIB_ITEM("OutAddrMasks", ICMP_MIB_OUTADDRMASKS),
+	SNMP_MIB_ITEM("OutAddrMaskReps", ICMP_MIB_OUTADDRMASKREPS),
+	SNMP_MIB_SENTINEL
+};
+
+static struct snmp_mib snmp4_tcp_list[] = {
+	SNMP_MIB_ITEM("RtoAlgorithm", TCP_MIB_RTOALGORITHM),
+	SNMP_MIB_ITEM("RtoMin", TCP_MIB_RTOMIN),
+	SNMP_MIB_ITEM("RtoMax", TCP_MIB_RTOMAX),
+	SNMP_MIB_ITEM("MaxConn", TCP_MIB_MAXCONN),
+	SNMP_MIB_ITEM("ActiveOpens", TCP_MIB_ACTIVEOPENS),
+	SNMP_MIB_ITEM("PassiveOpens", TCP_MIB_PASSIVEOPENS),
+	SNMP_MIB_ITEM("AttemptFails", TCP_MIB_ATTEMPTFAILS),
+	SNMP_MIB_ITEM("EstabResets", TCP_MIB_ESTABRESETS),
+	SNMP_MIB_ITEM("CurrEstab", TCP_MIB_CURRESTAB),
+	SNMP_MIB_ITEM("InSegs", TCP_MIB_INSEGS),
+	SNMP_MIB_ITEM("OutSegs", TCP_MIB_OUTSEGS),
+	SNMP_MIB_ITEM("RetransSegs", TCP_MIB_RETRANSSEGS),
+	SNMP_MIB_ITEM("InErrs", TCP_MIB_INERRS),
+	SNMP_MIB_ITEM("OutRsts", TCP_MIB_OUTRSTS),
+	SNMP_MIB_SENTINEL
+};
+
+static struct snmp_mib snmp4_udp_list[] = {
+	SNMP_MIB_ITEM("InDatagrams", UDP_MIB_INDATAGRAMS),
+	SNMP_MIB_ITEM("NoPorts", UDP_MIB_NOPORTS),
+	SNMP_MIB_ITEM("InErrors", UDP_MIB_INERRORS),
+	SNMP_MIB_ITEM("OutDatagrams", UDP_MIB_OUTDATAGRAMS),
+	SNMP_MIB_SENTINEL
+};
+
+static struct snmp_mib snmp4_net_list[] = {
+	SNMP_MIB_ITEM("SyncookiesSent", LINUX_MIB_SYNCOOKIESSENT),
+	SNMP_MIB_ITEM("SyncookiesRecv", LINUX_MIB_SYNCOOKIESRECV),
+	SNMP_MIB_ITEM("SyncookiesFailed", LINUX_MIB_SYNCOOKIESFAILED),
+	SNMP_MIB_ITEM("EmbryonicRsts", LINUX_MIB_EMBRYONICRSTS),
+	SNMP_MIB_ITEM("PruneCalled", LINUX_MIB_PRUNECALLED),
+	SNMP_MIB_ITEM("RcvPruned", LINUX_MIB_RCVPRUNED),
+	SNMP_MIB_ITEM("OfoPruned", LINUX_MIB_OFOPRUNED),
+	SNMP_MIB_ITEM("OutOfWindowIcmps", LINUX_MIB_OUTOFWINDOWICMPS),
+	SNMP_MIB_ITEM("LockDroppedIcmps", LINUX_MIB_LOCKDROPPEDICMPS),
+	SNMP_MIB_ITEM("ArpFilter", LINUX_MIB_ARPFILTER),
+	SNMP_MIB_ITEM("TW", LINUX_MIB_TIMEWAITED),
+	SNMP_MIB_ITEM("TWRecycled", LINUX_MIB_TIMEWAITRECYCLED),
+	SNMP_MIB_ITEM("TWKilled", LINUX_MIB_TIMEWAITKILLED),
+	SNMP_MIB_ITEM("PAWSPassive", LINUX_MIB_PAWSPASSIVEREJECTED),
+	SNMP_MIB_ITEM("PAWSActive", LINUX_MIB_PAWSACTIVEREJECTED),
+	SNMP_MIB_ITEM("PAWSEstab", LINUX_MIB_PAWSESTABREJECTED),
+	SNMP_MIB_ITEM("DelayedACKs", LINUX_MIB_DELAYEDACKS),
+	SNMP_MIB_ITEM("DelayedACKLocked", LINUX_MIB_DELAYEDACKLOCKED),
+	SNMP_MIB_ITEM("DelayedACKLost", LINUX_MIB_DELAYEDACKLOST),
+	SNMP_MIB_ITEM("ListenOverflows", LINUX_MIB_LISTENOVERFLOWS),
+	SNMP_MIB_ITEM("ListenDrops", LINUX_MIB_LISTENDROPS),
+	SNMP_MIB_ITEM("TCPPrequeued", LINUX_MIB_TCPPREQUEUED),
+	SNMP_MIB_ITEM("TCPDirectCopyFromBacklog", LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG),
+	SNMP_MIB_ITEM("TCPDirectCopyFromPrequeue", LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE),
+	SNMP_MIB_ITEM("TCPPrequeueDropped", LINUX_MIB_TCPPREQUEUEDROPPED),
+	SNMP_MIB_ITEM("TCPHPHits", LINUX_MIB_TCPHPHITS),
+	SNMP_MIB_ITEM("TCPHPHitsToUser", LINUX_MIB_TCPHPHITSTOUSER),
+	SNMP_MIB_ITEM("TCPPureAcks", LINUX_MIB_TCPPUREACKS),
+	SNMP_MIB_ITEM("TCPHPAcks", LINUX_MIB_TCPHPACKS),
+	SNMP_MIB_ITEM("TCPRenoRecovery", LINUX_MIB_TCPRENORECOVERY),
+	SNMP_MIB_ITEM("TCPSackRecovery", LINUX_MIB_TCPSACKRECOVERY),
+	SNMP_MIB_ITEM("TCPSACKReneging", LINUX_MIB_TCPSACKRENEGING),
+	SNMP_MIB_ITEM("TCPFACKReorder", LINUX_MIB_TCPFACKREORDER),
+	SNMP_MIB_ITEM("TCPSACKReorder", LINUX_MIB_TCPSACKREORDER),
+	SNMP_MIB_ITEM("TCPRenoReorder", LINUX_MIB_TCPRENOREORDER),
+	SNMP_MIB_ITEM("TCPTSReorder", LINUX_MIB_TCPTSREORDER),
+	SNMP_MIB_ITEM("TCPFullUndo", LINUX_MIB_TCPFULLUNDO),
+	SNMP_MIB_ITEM("TCPPartialUndo", LINUX_MIB_TCPPARTIALUNDO),
+	SNMP_MIB_ITEM("TCPDSACKUndo", LINUX_MIB_TCPDSACKUNDO),
+	SNMP_MIB_ITEM("TCPLossUndo", LINUX_MIB_TCPLOSSUNDO),
+	SNMP_MIB_ITEM("TCPLoss", LINUX_MIB_TCPLOSS),
+	SNMP_MIB_ITEM("TCPLostRetransmit", LINUX_MIB_TCPLOSTRETRANSMIT),
+	SNMP_MIB_ITEM("TCPRenoFailures", LINUX_MIB_TCPRENOFAILURES),
+	SNMP_MIB_ITEM("TCPSackFailures", LINUX_MIB_TCPSACKFAILURES),
+	SNMP_MIB_ITEM("TCPLossFailures", LINUX_MIB_TCPLOSSFAILURES),
+	SNMP_MIB_ITEM("TCPFastRetrans", LINUX_MIB_TCPFASTRETRANS),
+	SNMP_MIB_ITEM("TCPForwardRetrans", LINUX_MIB_TCPFORWARDRETRANS),
+	SNMP_MIB_ITEM("TCPSlowStartRetrans", LINUX_MIB_TCPSLOWSTARTRETRANS),
+	SNMP_MIB_ITEM("TCPTimeouts", LINUX_MIB_TCPTIMEOUTS),
+	SNMP_MIB_ITEM("TCPRenoRecoveryFail", LINUX_MIB_TCPRENORECOVERYFAIL),
+	SNMP_MIB_ITEM("TCPSackRecoveryFail", LINUX_MIB_TCPSACKRECOVERYFAIL),
+	SNMP_MIB_ITEM("TCPSchedulerFailed", LINUX_MIB_TCPSCHEDULERFAILED),
+	SNMP_MIB_ITEM("TCPRcvCollapsed", LINUX_MIB_TCPRCVCOLLAPSED),
+	SNMP_MIB_ITEM("TCPDSACKOldSent", LINUX_MIB_TCPDSACKOLDSENT),
+	SNMP_MIB_ITEM("TCPDSACKOfoSent", LINUX_MIB_TCPDSACKOFOSENT),
+	SNMP_MIB_ITEM("TCPDSACKRecv", LINUX_MIB_TCPDSACKRECV),
+	SNMP_MIB_ITEM("TCPDSACKOfoRecv", LINUX_MIB_TCPDSACKOFORECV),
+	SNMP_MIB_ITEM("TCPAbortOnSyn", LINUX_MIB_TCPABORTONSYN),
+	SNMP_MIB_ITEM("TCPAbortOnData", LINUX_MIB_TCPABORTONDATA),
+	SNMP_MIB_ITEM("TCPAbortOnClose", LINUX_MIB_TCPABORTONCLOSE),
+	SNMP_MIB_ITEM("TCPAbortOnMemory", LINUX_MIB_TCPABORTONMEMORY),
+	SNMP_MIB_ITEM("TCPAbortOnTimeout", LINUX_MIB_TCPABORTONTIMEOUT),
+	SNMP_MIB_ITEM("TCPAbortOnLinger", LINUX_MIB_TCPABORTONLINGER),
+	SNMP_MIB_ITEM("TCPAbortFailed", LINUX_MIB_TCPABORTFAILED),
+	SNMP_MIB_ITEM("TCPMemoryPressures", LINUX_MIB_TCPMEMORYPRESSURES),
+	SNMP_MIB_SENTINEL
 };
 
 /*
@@ -140,7 +256,7 @@
 {
 	int i;
 
-	seq_printf(seq, "Ip: Forwarding DefaultTTL");
+	seq_puts(seq, "Ip: Forwarding DefaultTTL");
 
 	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
 		seq_printf(seq, " %s", snmp4_ipstats_list[i].name);
@@ -150,44 +266,45 @@
 
 	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
 		seq_printf(seq, " %lu",
-			   __fold_field((void **) ip_statistics, 
-					snmp4_ipstats_list[i].offset));
+			   fold_field((void **) ip_statistics, 
+				      snmp4_ipstats_list[i].entry));
 
-	seq_printf(seq, "\nIcmp: InMsgs InErrors InDestUnreachs InTimeExcds "
-			"InParmProbs InSrcQuenchs InRedirects InEchos "
-			"InEchoReps InTimestamps InTimestampReps InAddrMasks "
-			"InAddrMaskReps OutMsgs OutErrors OutDestUnreachs "
-			"OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects "
-			"OutEchos OutEchoReps OutTimestamps OutTimestampReps "
-			"OutAddrMasks OutAddrMaskReps\nIcmp:");
+	seq_puts(seq, "\nIcmp:");
+	for (i = 0; snmp4_icmp_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_icmp_list[i].name);
 
-	for (i = 0;
-	     i < offsetof(struct icmp_mib, dummy) / sizeof(unsigned long); i++)
+	seq_puts(seq, "\nIcmp:");
+	for (i = 0; snmp4_icmp_list[i].name != NULL; i++)
 		seq_printf(seq, " %lu",
-			   fold_field((void **) icmp_statistics, i)); 
+			   fold_field((void **) icmp_statistics, 
+				      snmp4_icmp_list[i].entry));
 
-	seq_printf(seq, "\nTcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens "
-			"PassiveOpens AttemptFails EstabResets CurrEstab "
-			"InSegs OutSegs RetransSegs InErrs OutRsts\nTcp:");
-
-	for (i = 0;
-	     i < offsetof(struct tcp_mib, __pad) / sizeof(unsigned long); i++) {
-		if (i == (offsetof(struct tcp_mib, TcpMaxConn) / sizeof(unsigned long)))
-			/* MaxConn field is negative, RFC 2012 */
-			seq_printf(seq, " %ld", 
-				   fold_field((void **) tcp_statistics, i));
+	seq_puts(seq, "\nTcp:");
+	for (i = 0; snmp4_tcp_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_tcp_list[i].name);
+
+	seq_puts(seq, "\nTcp:");
+	for (i = 0; snmp4_tcp_list[i].name != NULL; i++) {
+		/* MaxConn field is signed, RFC 2012 */
+		if (snmp4_tcp_list[i].entry == TCP_MIB_MAXCONN)
+			seq_printf(seq, " %ld",
+				   fold_field((void **) tcp_statistics, 
+					      snmp4_tcp_list[i].entry));
 		else
-			seq_printf(seq, " %lu", 
-				   fold_field((void **) tcp_statistics, i));
+			seq_printf(seq, " %lu",
+				   fold_field((void **) tcp_statistics,
+					      snmp4_tcp_list[i].entry));
 	}
 
-	seq_printf(seq, "\nUdp: InDatagrams NoPorts InErrors OutDatagrams\n"
-			"Udp:");
+	seq_puts(seq, "\nUdp:");
+	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_udp_list[i].name);
 
-	for (i = 0;
-	     i < offsetof(struct udp_mib, __pad) / sizeof(unsigned long); i++)
-		seq_printf(seq, " %lu", 
-				fold_field((void **) udp_statistics, i));
+	seq_puts(seq, "\nUdp:");
+	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
+		seq_printf(seq, " %lu",
+			   fold_field((void **) udp_statistics, 
+				      snmp4_udp_list[i].entry));
 
 	seq_putc(seq, '\n');
 	return 0;
@@ -213,39 +330,16 @@
 {
 	int i;
 
-	seq_puts(seq, "TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed"
-		      " EmbryonicRsts PruneCalled RcvPruned OfoPruned"
-		      " OutOfWindowIcmps LockDroppedIcmps ArpFilter"
-		      " TW TWRecycled TWKilled"
-		      " PAWSPassive PAWSActive PAWSEstab"
-		      " DelayedACKs DelayedACKLocked DelayedACKLost"
-		      " ListenOverflows ListenDrops"
-		      " TCPPrequeued TCPDirectCopyFromBacklog"
-		      " TCPDirectCopyFromPrequeue TCPPrequeueDropped"
-		      " TCPHPHits TCPHPHitsToUser"
-		      " TCPPureAcks TCPHPAcks"
-		      " TCPRenoRecovery TCPSackRecovery"
-		      " TCPSACKReneging"
-		      " TCPFACKReorder TCPSACKReorder TCPRenoReorder"
-		      " TCPTSReorder"
-		      " TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo"
-		      " TCPLoss TCPLostRetransmit"
-		      " TCPRenoFailures TCPSackFailures TCPLossFailures"
-		      " TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans"
-		      " TCPTimeouts"
-		      " TCPRenoRecoveryFail TCPSackRecoveryFail"
-		      " TCPSchedulerFailed TCPRcvCollapsed"
-		      " TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv"
-		      " TCPDSACKOfoRecv"
-		      " TCPAbortOnSyn TCPAbortOnData TCPAbortOnClose"
-		      " TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger"
-		      " TCPAbortFailed TCPMemoryPressures\n"
-		      "TcpExt:");
-	for (i = 0;
-	     i < offsetof(struct linux_mib, __pad) / sizeof(unsigned long); 
-	     i++)
-		seq_printf(seq, " %lu", 
-		 	   fold_field((void **) net_statistics, i)); 
+	seq_puts(seq, "\nTcpExt:");
+	for (i = 0; snmp4_net_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_net_list[i].name);
+
+	seq_puts(seq, "\nTcpExt:");
+	for (i = 0; snmp4_net_list[i].name != NULL; i++)
+		seq_printf(seq, " %lu",
+			   fold_field((void **) net_statistics, 
+				      snmp4_net_list[i].entry));
+
 	seq_putc(seq, '\n');
 	return 0;
 }
diff -Nru a/net/ipv4/raw.c b/net/ipv4/raw.c
--- a/net/ipv4/raw.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/raw.c	2004-07-27 18:24:51 -07:00
@@ -319,7 +319,7 @@
 	err = -EFAULT;
 	kfree_skb(skb);
 error:
-	IP_INC_STATS(OutDiscards);
+	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err; 
 }
 
@@ -555,9 +555,11 @@
 	}
 	if (inet->cmsg_flags)
 		ip_cmsg_recv(msg, skb);
+	if (flags & MSG_TRUNC)
+		copied = skb->len;
 done:
 	skb_free_datagram(sk, skb);
-out:	return err ? : copied;
+out:	return err ? err : copied;
 }
 
 static int raw_init(struct sock *sk)
@@ -657,7 +659,7 @@
 struct proto raw_prot = {
 	.name =		"RAW",
 	.close =	raw_close,
-	.connect =	udp_connect,
+	.connect =	ip4_datagram_connect,
 	.disconnect =	udp_disconnect,
 	.ioctl =	raw_ioctl,
 	.init =		raw_init,
diff -Nru a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
--- a/net/ipv4/syncookies.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/syncookies.c	2004-07-27 18:24:51 -07:00
@@ -59,7 +59,7 @@
 		;
 	*mssp = msstab[mssind] + 1;
 
-	NET_INC_STATS_BH(SyncookiesSent);
+	NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESSENT);
 
 	return secure_tcp_syn_cookie(skb->nh.iph->saddr, skb->nh.iph->daddr,
 				     skb->h.th->source, skb->h.th->dest,
@@ -127,11 +127,11 @@
 
   	if (time_after(jiffies, tp->last_synq_overflow + TCP_TIMEOUT_INIT) ||
 	    (mss = cookie_check(skb, cookie)) == 0) {
-	 	NET_INC_STATS_BH(SyncookiesFailed);
+	 	NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESFAILED);
 		goto out;
 	}
 
-	NET_INC_STATS_BH(SyncookiesRecv);
+	NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESRECV);
 
 	req = tcp_openreq_alloc();
 	ret = NULL;
diff -Nru a/net/ipv4/tcp.c b/net/ipv4/tcp.c
--- a/net/ipv4/tcp.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/tcp.c	2004-07-27 18:24:51 -07:00
@@ -305,7 +305,7 @@
 void tcp_enter_memory_pressure(void)
 {
 	if (!tcp_memory_pressure) {
-		NET_INC_STATS(TCPMemoryPressures);
+		NET_INC_STATS(LINUX_MIB_TCPMEMORYPRESSURES);
 		tcp_memory_pressure = 1;
 	}
 }
@@ -1109,7 +1109,7 @@
 	struct sk_buff *skb;
 	struct tcp_opt *tp = tcp_sk(sk);
 
-	NET_ADD_STATS_USER(TCPPrequeued, skb_queue_len(&tp->ucopy.prequeue));
+	NET_ADD_STATS_USER(LINUX_MIB_TCPPREQUEUED, skb_queue_len(&tp->ucopy.prequeue));
 
 	/* RX process wants to run with disabled BHs, though it is not
 	 * necessary */
@@ -1392,7 +1392,7 @@
 			/* __ Restore normal policy in scheduler __ */
 
 			if ((chunk = len - tp->ucopy.len) != 0) {
-				NET_ADD_STATS_USER(TCPDirectCopyFromBacklog, chunk);
+				NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, chunk);
 				len -= chunk;
 				copied += chunk;
 			}
@@ -1403,7 +1403,7 @@
 				tcp_prequeue_process(sk);
 
 				if ((chunk = len - tp->ucopy.len) != 0) {
-					NET_ADD_STATS_USER(TCPDirectCopyFromPrequeue, chunk);
+					NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, chunk);
 					len -= chunk;
 					copied += chunk;
 				}
@@ -1488,7 +1488,7 @@
 			tcp_prequeue_process(sk);
 
 			if (copied > 0 && (chunk = len - tp->ucopy.len) != 0) {
-				NET_ADD_STATS_USER(TCPDirectCopyFromPrequeue, chunk);
+				NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, chunk);
 				len -= chunk;
 				copied += chunk;
 			}
@@ -1659,13 +1659,13 @@
 	 */
 	if (data_was_unread) {
 		/* Unread data was tossed, zap the connection. */
-		NET_INC_STATS_USER(TCPAbortOnClose);
+		NET_INC_STATS_USER(LINUX_MIB_TCPABORTONCLOSE);
 		tcp_set_state(sk, TCP_CLOSE);
 		tcp_send_active_reset(sk, GFP_KERNEL);
 	} else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
 		/* Check zero linger _after_ checking for unread data. */
 		sk->sk_prot->disconnect(sk, 0);
-		NET_INC_STATS_USER(TCPAbortOnData);
+		NET_INC_STATS_USER(LINUX_MIB_TCPABORTONDATA);
 	} else if (tcp_close_state(sk)) {
 		/* We FIN if the application ate all the data before
 		 * zapping the connection.
@@ -1731,7 +1731,7 @@
 		if (tp->linger2 < 0) {
 			tcp_set_state(sk, TCP_CLOSE);
 			tcp_send_active_reset(sk, GFP_ATOMIC);
-			NET_INC_STATS_BH(TCPAbortOnLinger);
+			NET_INC_STATS_BH(LINUX_MIB_TCPABORTONLINGER);
 		} else {
 			int tmo = tcp_fin_time(tp);
 
@@ -1754,7 +1754,7 @@
 				       "sockets\n");
 			tcp_set_state(sk, TCP_CLOSE);
 			tcp_send_active_reset(sk, GFP_ATOMIC);
-			NET_INC_STATS_BH(TCPAbortOnMemory);
+			NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
 		}
 	}
 	atomic_inc(&tcp_orphan_count);
diff -Nru a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
--- a/net/ipv4/tcp_input.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv4/tcp_input.c	2004-07-27 18:24:52 -07:00
@@ -876,13 +876,13 @@
 
 		/* This exciting event is worth to be remembered. 8) */
 		if (ts)
-			NET_INC_STATS_BH(TCPTSReorder);
+			NET_INC_STATS_BH(LINUX_MIB_TCPTSREORDER);
 		else if (IsReno(tp))
-			NET_INC_STATS_BH(TCPRenoReorder);
+			NET_INC_STATS_BH(LINUX_MIB_TCPRENOREORDER);
 		else if (IsFack(tp))
-			NET_INC_STATS_BH(TCPFACKReorder);
+			NET_INC_STATS_BH(LINUX_MIB_TCPFACKREORDER);
 		else
-			NET_INC_STATS_BH(TCPSACKReorder);
+			NET_INC_STATS_BH(LINUX_MIB_TCPSACKREORDER);
 #if FASTRETRANS_DEBUG > 1
 		printk(KERN_DEBUG "Disorder%d %d %u f%u s%u rr%d\n",
 		       tp->sack_ok, tp->ca_state,
@@ -981,13 +981,13 @@
 			if (before(start_seq, ack)) {
 				dup_sack = 1;
 				tp->sack_ok |= 4;
-				NET_INC_STATS_BH(TCPDSACKRecv);
+				NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV);
 			} else if (num_sacks > 1 &&
 				   !after(end_seq, ntohl(sp[1].end_seq)) &&
 				   !before(start_seq, ntohl(sp[1].start_seq))) {
 				dup_sack = 1;
 				tp->sack_ok |= 4;
-				NET_INC_STATS_BH(TCPDSACKOfoRecv);
+				NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV);
 			}
 
 			/* D-SACK for already forgotten data...
@@ -1131,7 +1131,7 @@
 					tp->lost_out++;
 					TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
 					flag |= FLAG_DATA_SACKED;
-					NET_INC_STATS_BH(TCPLostRetransmit);
+					NET_INC_STATS_BH(LINUX_MIB_TCPLOSTRETRANSMIT);
 				}
 			}
 		}
@@ -1310,7 +1310,7 @@
 	 */
 	if ((skb = skb_peek(&sk->sk_write_queue)) != NULL &&
 	    (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) {
-		NET_INC_STATS_BH(TCPSACKReneging);
+		NET_INC_STATS_BH(LINUX_MIB_TCPSACKRENEGING);
 
 		tcp_enter_loss(sk, 1);
 		tp->retransmits++;
@@ -1658,9 +1658,9 @@
 		DBGUNDO(sk, tp, tp->ca_state == TCP_CA_Loss ? "loss" : "retrans");
 		tcp_undo_cwr(tp, 1);
 		if (tp->ca_state == TCP_CA_Loss)
-			NET_INC_STATS_BH(TCPLossUndo);
+			NET_INC_STATS_BH(LINUX_MIB_TCPLOSSUNDO);
 		else
-			NET_INC_STATS_BH(TCPFullUndo);
+			NET_INC_STATS_BH(LINUX_MIB_TCPFULLUNDO);
 		tp->undo_marker = 0;
 	}
 	if (tp->snd_una == tp->high_seq && IsReno(tp)) {
@@ -1681,7 +1681,7 @@
 		DBGUNDO(sk, tp, "D-SACK");
 		tcp_undo_cwr(tp, 1);
 		tp->undo_marker = 0;
-		NET_INC_STATS_BH(TCPDSACKUndo);
+		NET_INC_STATS_BH(LINUX_MIB_TCPDSACKUNDO);
 	}
 }
 
@@ -1703,7 +1703,7 @@
 
 		DBGUNDO(sk, tp, "Hoe");
 		tcp_undo_cwr(tp, 0);
-		NET_INC_STATS_BH(TCPPartialUndo);
+		NET_INC_STATS_BH(LINUX_MIB_TCPPARTIALUNDO);
 
 		/* So... Do not make Hoe's retransmit yet.
 		 * If the first packet was delayed, the rest
@@ -1726,7 +1726,7 @@
 		tp->lost_out = 0;
 		tp->left_out = tp->sacked_out;
 		tcp_undo_cwr(tp, 1);
-		NET_INC_STATS_BH(TCPLossUndo);
+		NET_INC_STATS_BH(LINUX_MIB_TCPLOSSUNDO);
 		tp->retransmits = 0;
 		tp->undo_marker = 0;
 		if (!IsReno(tp))
@@ -1814,7 +1814,7 @@
 	    tp->ca_state != TCP_CA_Open &&
 	    tp->fackets_out > tp->reordering) {
 		tcp_mark_head_lost(sk, tp, tp->fackets_out-tp->reordering, tp->high_seq);
-		NET_INC_STATS_BH(TCPLoss);
+		NET_INC_STATS_BH(LINUX_MIB_TCPLOSS);
 	}
 
 	/* D. Synchronize left_out to current state. */
@@ -1907,9 +1907,9 @@
 		/* Otherwise enter Recovery state */
 
 		if (IsReno(tp))
-			NET_INC_STATS_BH(TCPRenoRecovery);
+			NET_INC_STATS_BH(LINUX_MIB_TCPRENORECOVERY);
 		else
-			NET_INC_STATS_BH(TCPSackRecovery);
+			NET_INC_STATS_BH(LINUX_MIB_TCPSACKRECOVERY);
 
 		tp->high_seq = tp->snd_nxt;
 		tp->prior_ssthresh = 0;
@@ -2797,12 +2797,12 @@
 		tcp_westwood_fast_bw(sk, skb);
 		flag |= FLAG_WIN_UPDATE;
 
-		NET_INC_STATS_BH(TCPHPAcks);
+		NET_INC_STATS_BH(LINUX_MIB_TCPHPACKS);
 	} else {
 		if (ack_seq != TCP_SKB_CB(skb)->end_seq)
 			flag |= FLAG_DATA;
 		else
-			NET_INC_STATS_BH(TCPPureAcks);
+			NET_INC_STATS_BH(LINUX_MIB_TCPPUREACKS);
 
 		flag |= tcp_ack_update_window(sk, tp, skb, ack, ack_seq);
 
@@ -3197,9 +3197,9 @@
 {
 	if (tp->sack_ok && sysctl_tcp_dsack) {
 		if (before(seq, tp->rcv_nxt))
-			NET_INC_STATS_BH(TCPDSACKOldSent);
+			NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOLDSENT);
 		else
-			NET_INC_STATS_BH(TCPDSACKOfoSent);
+			NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFOSENT);
 
 		tp->dsack = 1;
 		tp->duplicate_sack[0].start_seq = seq;
@@ -3222,7 +3222,7 @@
 
 	if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
 	    before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
-		NET_INC_STATS_BH(DelayedACKLost);
+		NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOST);
 		tcp_enter_quickack_mode(tp);
 
 		if (tp->sack_ok && sysctl_tcp_dsack) {
@@ -3489,7 +3489,7 @@
 
 	if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
 		/* A retransmit, 2nd most common case.  Force an immediate ack. */
-		NET_INC_STATS_BH(DelayedACKLost);
+		NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOST);
 		tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
 
 out_of_window:
@@ -3631,7 +3631,7 @@
 			struct sk_buff *next = skb->next;
 			__skb_unlink(skb, skb->list);
 			__kfree_skb(skb);
-			NET_INC_STATS_BH(TCPRcvCollapsed);
+			NET_INC_STATS_BH(LINUX_MIB_TCPRCVCOLLAPSED);
 			skb = next;
 			continue;
 		}
@@ -3697,7 +3697,7 @@
 				struct sk_buff *next = skb->next;
 				__skb_unlink(skb, skb->list);
 				__kfree_skb(skb);
-				NET_INC_STATS_BH(TCPRcvCollapsed);
+				NET_INC_STATS_BH(LINUX_MIB_TCPRCVCOLLAPSED);
 				skb = next;
 				if (skb == tail || skb->h.th->syn || skb->h.th->fin)
 					return;
@@ -3760,7 +3760,7 @@
 
 	SOCK_DEBUG(sk, "prune_queue: c=%x\n", tp->copied_seq);
 
-	NET_INC_STATS_BH(PruneCalled);
+	NET_INC_STATS_BH(LINUX_MIB_PRUNECALLED);
 
 	if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
 		tcp_clamp_window(sk, tp);
@@ -3781,7 +3781,7 @@
 
 	/* First, purge the out_of_order queue. */
 	if (skb_queue_len(&tp->out_of_order_queue)) {
-		NET_ADD_STATS_BH(OfoPruned,
+		NET_ADD_STATS_BH(LINUX_MIB_OFOPRUNED, 
 				 skb_queue_len(&tp->out_of_order_queue));
 		__skb_queue_purge(&tp->out_of_order_queue);
 
@@ -3802,7 +3802,7 @@
 	 * drop receive data on the floor.  It will get retransmitted
 	 * and hopefully then we'll have sufficient space.
 	 */
-	NET_INC_STATS_BH(RcvPruned);
+	NET_INC_STATS_BH(LINUX_MIB_RCVPRUNED);
 
 	/* Massive buffer overcommit. */
 	tp->pred_flags = 0;
@@ -4181,7 +4181,7 @@
 				tcp_data_snd_check(sk);
 				return 0;
 			} else { /* Header too small */
-				TCP_INC_STATS_BH(TcpInErrs);
+				TCP_INC_STATS_BH(TCP_MIB_INERRS);
 				goto discard;
 			}
 		} else {
@@ -4208,7 +4208,7 @@
 
 					__skb_pull(skb, tcp_header_len);
 					tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
-					NET_INC_STATS_BH(TCPHPHitsToUser);
+					NET_INC_STATS_BH(LINUX_MIB_TCPHPHITSTOUSER);
 					eaten = 1;
 				}
 			}
@@ -4230,7 +4230,7 @@
 				if ((int)skb->truesize > sk->sk_forward_alloc)
 					goto step5;
 
-				NET_INC_STATS_BH(TCPHPHits);
+				NET_INC_STATS_BH(LINUX_MIB_TCPHPHITS);
 
 				/* Bulk data transfer: receiver */
 				__skb_pull(skb,tcp_header_len);
@@ -4278,7 +4278,7 @@
 	if (tcp_fast_parse_options(skb, th, tp) && tp->saw_tstamp &&
 	    tcp_paws_discard(tp, skb)) {
 		if (!th->rst) {
-			NET_INC_STATS_BH(PAWSEstabRejected);
+			NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 			tcp_send_dupack(sk, skb);
 			goto discard;
 		}
@@ -4313,8 +4313,8 @@
 	tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
 
 	if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
-		TCP_INC_STATS_BH(TcpInErrs);
-		NET_INC_STATS_BH(TCPAbortOnSyn);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
+		NET_INC_STATS_BH(LINUX_MIB_TCPABORTONSYN);
 		tcp_reset(sk);
 		return 1;
 	}
@@ -4336,7 +4336,7 @@
 	return 0;
 
 csum_error:
-	TCP_INC_STATS_BH(TcpInErrs);
+	TCP_INC_STATS_BH(TCP_MIB_INERRS);
 
 discard:
 	__kfree_skb(skb);
@@ -4369,7 +4369,7 @@
 		if (tp->saw_tstamp && tp->rcv_tsecr &&
 		    !between(tp->rcv_tsecr, tp->retrans_stamp,
 			     tcp_time_stamp)) {
-			NET_INC_STATS_BH(PAWSActiveRejected);
+			NET_INC_STATS_BH(LINUX_MIB_PAWSACTIVEREJECTED);
 			goto reset_and_undo;
 		}
 
@@ -4650,7 +4650,7 @@
 	if (tcp_fast_parse_options(skb, th, tp) && tp->saw_tstamp &&
 	    tcp_paws_discard(tp, skb)) {
 		if (!th->rst) {
-			NET_INC_STATS_BH(PAWSEstabRejected);
+			NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 			tcp_send_dupack(sk, skb);
 			goto discard;
 		}
@@ -4679,7 +4679,7 @@
 	 *	Check for a SYN in window.
 	 */
 	if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
-		NET_INC_STATS_BH(TCPAbortOnSyn);
+		NET_INC_STATS_BH(LINUX_MIB_TCPABORTONSYN);
 		tcp_reset(sk);
 		return 1;
 	}
@@ -4758,7 +4758,7 @@
 					    (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
 					     after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) {
 						tcp_done(sk);
-						NET_INC_STATS_BH(TCPAbortOnData);
+						NET_INC_STATS_BH(LINUX_MIB_TCPABORTONDATA);
 						return 1;
 					}
 
@@ -4818,7 +4818,7 @@
 		if (sk->sk_shutdown & RCV_SHUTDOWN) {
 			if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
 			    after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) {
-				NET_INC_STATS_BH(TCPAbortOnData);
+				NET_INC_STATS_BH(LINUX_MIB_TCPABORTONDATA);
 				tcp_reset(sk);
 				return 1;
 			}
diff -Nru a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
--- a/net/ipv4/tcp_ipv4.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/tcp_ipv4.c	2004-07-27 18:24:51 -07:00
@@ -618,11 +618,11 @@
 
 	if (twp) {
 		*twp = tw;
-		NET_INC_STATS_BH(TimeWaitRecycled);
+		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
 	} else if (tw) {
 		/* Silly. Should hash-dance instead... */
 		tcp_tw_deschedule(tw);
-		NET_INC_STATS_BH(TimeWaitRecycled);
+		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
 
 		tcp_tw_put(tw);
 	}
@@ -998,14 +998,14 @@
 	int err;
 
 	if (skb->len < (iph->ihl << 2) + 8) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 
 	sk = tcp_v4_lookup(iph->daddr, th->dest, iph->saddr,
 			   th->source, tcp_v4_iif(skb));
 	if (!sk) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 	if (sk->sk_state == TCP_TIME_WAIT) {
@@ -1018,7 +1018,7 @@
 	 * servers this needs to be solved differently.
 	 */
 	if (sock_owned_by_user(sk))
-		NET_INC_STATS_BH(LockDroppedIcmps);
+		NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
 
 	if (sk->sk_state == TCP_CLOSE)
 		goto out;
@@ -1027,7 +1027,7 @@
 	seq = ntohl(th->seq);
 	if (sk->sk_state != TCP_LISTEN &&
 	    !between(seq, tp->snd_una, tp->snd_nxt)) {
-		NET_INC_STATS(OutOfWindowIcmps);
+		NET_INC_STATS(LINUX_MIB_OUTOFWINDOWICMPS);
 		goto out;
 	}
 
@@ -1078,7 +1078,7 @@
 		BUG_TRAP(!req->sk);
 
 		if (seq != req->snt_isn) {
-			NET_INC_STATS_BH(OutOfWindowIcmps);
+			NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
 			goto out;
 		}
 
@@ -1096,7 +1096,7 @@
 			       It can f.e. if SYNs crossed.
 			     */
 		if (!sock_owned_by_user(sk)) {
-			TCP_INC_STATS_BH(TcpAttemptFails);
+			TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
 			sk->sk_err = err;
 
 			sk->sk_error_report(sk);
@@ -1205,8 +1205,8 @@
 
 	ip_send_reply(tcp_socket->sk, skb, &arg, sizeof rth);
 
-	TCP_INC_STATS_BH(TcpOutSegs);
-	TCP_INC_STATS_BH(TcpOutRsts);
+	TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
+	TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
 }
 
 /* The code following below sending ACKs in SYN-RECV and TIME-WAIT states
@@ -1253,7 +1253,7 @@
 
 	ip_send_reply(tcp_socket->sk, skb, &arg, arg.iov[0].iov_len);
 
-	TCP_INC_STATS_BH(TcpOutSegs);
+	TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
 }
 
 static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb)
@@ -1290,12 +1290,12 @@
 					 .dport = req->rmt_port } } };
 
 	if (ip_route_output_flow(&rt, &fl, sk, 0)) {
-		IP_INC_STATS_BH(OutNoRoutes);
+		IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
 		return NULL;
 	}
 	if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway) {
 		ip_rt_put(rt);
-		IP_INC_STATS_BH(OutNoRoutes);
+		IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
 		return NULL;
 	}
 	return &rt->u.dst;
@@ -1505,7 +1505,7 @@
 			if (xtime.tv_sec < peer->tcp_ts_stamp + TCP_PAWS_MSL &&
 			    (s32)(peer->tcp_ts - req->ts_recent) >
 							TCP_PAWS_WINDOW) {
-				NET_INC_STATS_BH(PAWSPassiveRejected);
+				NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED);
 				dst_release(dst);
 				goto drop_and_free;
 			}
@@ -1550,7 +1550,7 @@
 drop_and_free:
 	tcp_openreq_free(req);
 drop:
-	TCP_INC_STATS_BH(TcpAttemptFails);
+	TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
 	return 0;
 }
 
@@ -1605,9 +1605,9 @@
 	return newsk;
 
 exit_overflow:
-	NET_INC_STATS_BH(ListenOverflows);
+	NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS);
 exit:
-	NET_INC_STATS_BH(ListenDrops);
+	NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS);
 	dst_release(dst);
 	return NULL;
 }
@@ -1725,7 +1725,7 @@
 	return 0;
 
 csum_err:
-	TCP_INC_STATS_BH(TcpInErrs);
+	TCP_INC_STATS_BH(TCP_MIB_INERRS);
 	goto discard;
 }
 
@@ -1743,7 +1743,7 @@
 		goto discard_it;
 
 	/* Count it even if it's bad */
-	TCP_INC_STATS_BH(TcpInSegs);
+	TCP_INC_STATS_BH(TCP_MIB_INSEGS);
 
 	if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
 		goto discard_it;
@@ -1810,7 +1810,7 @@
 
 	if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
 bad_packet:
-		TCP_INC_STATS_BH(TcpInErrs);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
 	} else {
 		tcp_v4_send_reset(skb);
 	}
@@ -1831,7 +1831,7 @@
 	}
 
 	if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
-		TCP_INC_STATS_BH(TcpInErrs);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
 		tcp_tw_put((struct tcp_tw_bucket *) sk);
 		goto discard_it;
 	}
diff -Nru a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
--- a/net/ipv4/tcp_minisocks.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv4/tcp_minisocks.c	2004-07-27 18:24:52 -07:00
@@ -266,7 +266,7 @@
 	}
 
 	if (paws_reject)
-		NET_INC_STATS_BH(PAWSEstabRejected);
+		NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 
 	if(!th->rst) {
 		/* In this case we must reset the TIMEWAIT timer.
@@ -462,7 +462,7 @@
 	}
 
 	tcp_tw_count -= killed;
-	NET_ADD_STATS_BH(TimeWaited, killed);
+	NET_ADD_STATS_BH(LINUX_MIB_TIMEWAITED, killed);
 
 	return ret;
 }
@@ -672,7 +672,7 @@
 out:
 	if ((tcp_tw_count -= killed) == 0)
 		del_timer(&tcp_tw_timer);
-	NET_ADD_STATS_BH(TimeWaitKilled, killed);
+	NET_ADD_STATS_BH(LINUX_MIB_TIMEWAITKILLED, killed);
 	spin_unlock(&tw_death_lock);
 }
 
@@ -845,7 +845,7 @@
 			newsk->sk_no_largesend = 1;
 
 		tcp_vegas_init(newtp);
-		TCP_INC_STATS_BH(TcpPassiveOpens);
+		TCP_INC_STATS_BH(TCP_MIB_PASSIVEOPENS);
 	}
 	return newsk;
 }
@@ -976,7 +976,7 @@
 		if (!(flg & TCP_FLAG_RST))
 			req->class->send_ack(skb, req);
 		if (paws_reject)
-			NET_INC_STATS_BH(PAWSEstabRejected);
+			NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 		return NULL;
 	}
 
@@ -1033,7 +1033,7 @@
 	}
 
 embryonic_reset:
-	NET_INC_STATS_BH(EmbryonicRsts);
+	NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS);
 	if (!(flg & TCP_FLAG_RST))
 		req->class->send_reset(skb);
 
diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
--- a/net/ipv4/tcp_output.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv4/tcp_output.c	2004-07-27 18:24:52 -07:00
@@ -168,6 +168,14 @@
 	tp->rcv_wnd = new_win;
 	tp->rcv_wup = tp->rcv_nxt;
 
+	/* Make sure we do not exceed the maximum possible
+	 * scaled window.
+	 */
+	if (!tp->rcv_wscale)
+		new_win = min(new_win, MAX_TCP_WINDOW);
+	else
+		new_win = min(new_win, (65535U << tp->rcv_wscale));
+
 	/* RFC1323 scaling applied */
 	new_win >>= tp->rcv_wscale;
 
@@ -291,7 +299,7 @@
 		if (skb->len != tcp_header_size)
 			tcp_event_data_sent(tp, skb, sk);
 
-		TCP_INC_STATS(TcpOutSegs);
+		TCP_INC_STATS(TCP_MIB_OUTSEGS);
 
 		err = tp->af_specific->queue_xmit(skb, 0);
 		if (err <= 0)
@@ -916,7 +924,7 @@
 
 	if (err == 0) {
 		/* Update global TCP statistics. */
-		TCP_INC_STATS(TcpRetransSegs);
+		TCP_INC_STATS(TCP_MIB_RETRANSSEGS);
 
 #if FASTRETRANS_DEBUG > 0
 		if (TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_RETRANS) {
@@ -968,9 +976,9 @@
 					if (tcp_retransmit_skb(sk, skb))
 						return;
 					if (tp->ca_state != TCP_CA_Loss)
-						NET_INC_STATS_BH(TCPFastRetrans);
+						NET_INC_STATS_BH(LINUX_MIB_TCPFASTRETRANS);
 					else
-						NET_INC_STATS_BH(TCPSlowStartRetrans);
+						NET_INC_STATS_BH(LINUX_MIB_TCPSLOWSTARTRETRANS);
 
 					if (skb ==
 					    skb_peek(&sk->sk_write_queue))
@@ -1022,7 +1030,7 @@
 		if (skb == skb_peek(&sk->sk_write_queue))
 			tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
 
-		NET_INC_STATS_BH(TCPForwardRetrans);
+		NET_INC_STATS_BH(LINUX_MIB_TCPFORWARDRETRANS);
 	}
 }
 
@@ -1082,7 +1090,7 @@
 	/* NOTE: No TCP options attached and we never retransmit this. */
 	skb = alloc_skb(MAX_TCP_HEADER, priority);
 	if (!skb) {
-		NET_INC_STATS(TCPAbortFailed);
+		NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);
 		return;
 	}
 
@@ -1097,7 +1105,7 @@
 	TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;
 	TCP_SKB_CB(skb)->when = tcp_time_stamp;
 	if (tcp_transmit_skb(sk, skb))
-		NET_INC_STATS(TCPAbortFailed);
+		NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);
 }
 
 /* WARNING: This routine must only be called when we have already sent
@@ -1197,7 +1205,7 @@
 
 	skb->csum = 0;
 	th->doff = (tcp_header_size >> 2);
-	TCP_INC_STATS(TcpOutSegs);
+	TCP_INC_STATS(TCP_MIB_OUTSEGS);
 	return skb;
 }
 
@@ -1285,7 +1293,7 @@
 	sk_charge_skb(sk, buff);
 	tp->packets_out++;
 	tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL));
-	TCP_INC_STATS(TcpActiveOpens);
+	TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);
 
 	/* Timer for repeating the SYN until an answer. */
 	tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
diff -Nru a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
--- a/net/ipv4/tcp_timer.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv4/tcp_timer.c	2004-07-27 18:24:52 -07:00
@@ -83,7 +83,7 @@
 	sk->sk_error_report(sk);
 
 	tcp_done(sk);
-	NET_INC_STATS_BH(TCPAbortOnTimeout);
+	NET_INC_STATS_BH(LINUX_MIB_TCPABORTONTIMEOUT);
 }
 
 /* Do not allow orphaned sockets to eat all our resources.
@@ -126,7 +126,7 @@
 		if (do_reset)
 			tcp_send_active_reset(sk, GFP_ATOMIC);
 		tcp_done(sk);
-		NET_INC_STATS_BH(TCPAbortOnMemory);
+		NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
 		return 1;
 	}
 	return 0;
@@ -212,7 +212,7 @@
 	if (sock_owned_by_user(sk)) {
 		/* Try again later. */
 		tp->ack.blocked = 1;
-		NET_INC_STATS_BH(DelayedACKLocked);
+		NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOCKED);
 		sk_reset_timer(sk, &tp->delack_timer, jiffies + TCP_DELACK_MIN);
 		goto out_unlock;
 	}
@@ -231,8 +231,8 @@
 	if (skb_queue_len(&tp->ucopy.prequeue)) {
 		struct sk_buff *skb;
 
-		NET_ADD_STATS_BH(TCPSchedulerFailed,
-				  skb_queue_len(&tp->ucopy.prequeue));
+		NET_ADD_STATS_BH(LINUX_MIB_TCPSCHEDULERFAILED, 
+				 skb_queue_len(&tp->ucopy.prequeue));
 
 		while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL)
 			sk->sk_backlog_rcv(sk, skb);
@@ -252,7 +252,7 @@
 			tp->ack.ato = TCP_ATO_MIN;
 		}
 		tcp_send_ack(sk);
-		NET_INC_STATS_BH(DelayedACKs);
+		NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKS);
 	}
 	TCP_CHECK_TIMER(sk);
 
@@ -353,19 +353,19 @@
 		if (tp->ca_state == TCP_CA_Disorder || tp->ca_state == TCP_CA_Recovery) {
 			if (tp->sack_ok) {
 				if (tp->ca_state == TCP_CA_Recovery)
-					NET_INC_STATS_BH(TCPSackRecoveryFail);
+					NET_INC_STATS_BH(LINUX_MIB_TCPSACKRECOVERYFAIL);
 				else
-					NET_INC_STATS_BH(TCPSackFailures);
+					NET_INC_STATS_BH(LINUX_MIB_TCPSACKFAILURES);
 			} else {
 				if (tp->ca_state == TCP_CA_Recovery)
-					NET_INC_STATS_BH(TCPRenoRecoveryFail);
+					NET_INC_STATS_BH(LINUX_MIB_TCPRENORECOVERYFAIL);
 				else
-					NET_INC_STATS_BH(TCPRenoFailures);
+					NET_INC_STATS_BH(LINUX_MIB_TCPRENOFAILURES);
 			}
 		} else if (tp->ca_state == TCP_CA_Loss) {
-			NET_INC_STATS_BH(TCPLossFailures);
+			NET_INC_STATS_BH(LINUX_MIB_TCPLOSSFAILURES);
 		} else {
-			NET_INC_STATS_BH(TCPTimeouts);
+			NET_INC_STATS_BH(LINUX_MIB_TCPTIMEOUTS);
 		}
 	}
 
diff -Nru a/net/ipv4/udp.c b/net/ipv4/udp.c
--- a/net/ipv4/udp.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv4/udp.c	2004-07-27 18:24:51 -07:00
@@ -327,7 +327,7 @@
 
 	sk = udp_v4_lookup(iph->daddr, uh->dest, iph->saddr, uh->source, skb->dev->ifindex);
 	if (sk == NULL) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
     	  	return;	/* No socket for error */
 	}
 
@@ -654,7 +654,7 @@
 	if (free)
 		kfree(ipc.opt);
 	if (!err) {
-		UDP_INC_STATS_USER(UdpOutDatagrams);
+		UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
 		return len;
 	}
 	return err;
@@ -828,7 +828,10 @@
   	}
 	if (inet->cmsg_flags)
 		ip_cmsg_recv(msg, skb);
+
 	err = copied;
+	if (flags & MSG_TRUNC)
+		err = skb->len - sizeof(struct udphdr);
   
 out_free:
   	skb_free_datagram(sk, skb);
@@ -836,7 +839,7 @@
   	return err;
 
 csum_copy_err:
-	UDP_INC_STATS_BH(UdpInErrors);
+	UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 
 	/* Clear queue. */
 	if (flags&MSG_PEEK) {
@@ -858,54 +861,6 @@
 	goto try_again;
 }
 
-int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
-{
-	struct inet_opt *inet = inet_sk(sk);
-	struct sockaddr_in *usin = (struct sockaddr_in *) uaddr;
-	struct rtable *rt;
-	u32 saddr;
-	int oif;
-	int err;
-
-	
-	if (addr_len < sizeof(*usin)) 
-	  	return -EINVAL;
-
-	if (usin->sin_family != AF_INET) 
-	  	return -EAFNOSUPPORT;
-
-	sk_dst_reset(sk);
-
-	oif = sk->sk_bound_dev_if;
-	saddr = inet->saddr;
-	if (MULTICAST(usin->sin_addr.s_addr)) {
-		if (!oif)
-			oif = inet->mc_index;
-		if (!saddr)
-			saddr = inet->mc_addr;
-	}
-	err = ip_route_connect(&rt, usin->sin_addr.s_addr, saddr,
-			       RT_CONN_FLAGS(sk), oif,
-			       IPPROTO_UDP,
-			       inet->sport, usin->sin_port, sk);
-	if (err)
-		return err;
-	if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) {
-		ip_rt_put(rt);
-		return -EACCES;
-	}
-  	if (!inet->saddr)
-	  	inet->saddr = rt->rt_src;	/* Update source address */
-	if (!inet->rcv_saddr)
-		inet->rcv_saddr = rt->rt_src;
-	inet->daddr = rt->rt_dst;
-	inet->dport = usin->sin_port;
-	sk->sk_state = TCP_ESTABLISHED;
-	inet->id = jiffies;
-
-	sk_dst_set(sk, &rt->u.dst);
-	return(0);
-}
 
 int udp_disconnect(struct sock *sk, int flags)
 {
@@ -1060,7 +1015,7 @@
 		if (ret < 0) {
 			/* process the ESP packet */
 			ret = xfrm4_rcv_encap(skb, up->encap_type);
-			UDP_INC_STATS_BH(UdpInDatagrams);
+			UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
 			return -ret;
 		}
 		/* FALLTHROUGH -- it's a UDP Packet */
@@ -1068,7 +1023,7 @@
 
 	if (sk->sk_filter && skb->ip_summed != CHECKSUM_UNNECESSARY) {
 		if (__udp_checksum_complete(skb)) {
-			UDP_INC_STATS_BH(UdpInErrors);
+			UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 			kfree_skb(skb);
 			return -1;
 		}
@@ -1076,11 +1031,11 @@
 	}
 
 	if (sock_queue_rcv_skb(sk,skb)<0) {
-		UDP_INC_STATS_BH(UdpInErrors);
+		UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
-	UDP_INC_STATS_BH(UdpInDatagrams);
+	UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
 	return 0;
 }
 
@@ -1208,7 +1163,7 @@
 	if (udp_checksum_complete(skb))
 		goto csum_error;
 
-	UDP_INC_STATS_BH(UdpNoPorts);
+	UDP_INC_STATS_BH(UDP_MIB_NOPORTS);
 	icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
 
 	/*
@@ -1228,7 +1183,7 @@
 			NIPQUAD(daddr),
 			ntohs(uh->dest)));
 no_header:
-	UDP_INC_STATS_BH(UdpInErrors);
+	UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 	kfree_skb(skb);
 	return(0);
 
@@ -1245,7 +1200,7 @@
 			ntohs(uh->dest),
 			ulen));
 drop:
-	UDP_INC_STATS_BH(UdpInErrors);
+	UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 	kfree_skb(skb);
 	return(0);
 }
@@ -1351,7 +1306,7 @@
 struct proto udp_prot = {
  	.name =		"UDP",
 	.close =	udp_close,
-	.connect =	udp_connect,
+	.connect =	ip4_datagram_connect,
 	.disconnect =	udp_disconnect,
 	.ioctl =	udp_ioctl,
 	.destroy =	udp_destroy_sock,
@@ -1552,7 +1507,6 @@
 }
 #endif /* CONFIG_PROC_FS */
 
-EXPORT_SYMBOL(udp_connect);
 EXPORT_SYMBOL(udp_disconnect);
 EXPORT_SYMBOL(udp_hash);
 EXPORT_SYMBOL(udp_hash_lock);
diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv6/addrconf.c	2004-07-27 18:24:52 -07:00
@@ -1544,7 +1544,7 @@
 		p.iph.ihl = 5;
 		p.iph.protocol = IPPROTO_IPV6;
 		p.iph.ttl = 64;
-		ifr.ifr_ifru.ifru_data = (void*)&p;
+		ifr.ifr_ifru.ifru_data = (void __user *)&p;
 
 		oldfs = get_fs(); set_fs(KERNEL_DS);
 		err = dev->do_ioctl(dev, &ifr, SIOCADDTUNNEL);
diff -Nru a/net/ipv6/ah6.c b/net/ipv6/ah6.c
--- a/net/ipv6/ah6.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv6/ah6.c	2004-07-27 18:24:52 -07:00
@@ -74,74 +74,45 @@
 	return 0;
 }
 
-static int ipv6_clear_mutable_options(struct sk_buff *skb, u16 *nh_offset, int dir)
+static int ipv6_clear_mutable_options(struct ipv6hdr *iph, int len)
 {
-	u16 offset = sizeof(struct ipv6hdr);
-	struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
-	unsigned int packet_len = skb->tail - skb->nh.raw;
-	u8 nexthdr = skb->nh.ipv6h->nexthdr;
-	u8 nextnexthdr = 0;
+	union {
+		struct ipv6hdr *iph;
+		struct ipv6_opt_hdr *opth;
+		struct ipv6_rt_hdr *rth;
+		char *raw;
+	} exthdr = { .iph = iph };
+	char *end = exthdr.raw + len;
+	int nexthdr = iph->nexthdr;
 
-	*nh_offset = ((unsigned char *)&skb->nh.ipv6h->nexthdr) - skb->nh.raw;
-
-	while (offset + 1 <= packet_len) {
+	exthdr.iph++;
 
+	while (exthdr.raw < end) {
 		switch (nexthdr) {
-
 		case NEXTHDR_HOP:
-			*nh_offset = offset;
-			offset += ipv6_optlen(exthdr);
-			if (!zero_out_mutable_opts(exthdr)) {
-				LIMIT_NETDEBUG(
-				printk(KERN_WARNING "overrun hopopts\n")); 
-				return 0;
+		case NEXTHDR_DEST:
+			if (!zero_out_mutable_opts(exthdr.opth)) {
+				LIMIT_NETDEBUG(printk(
+					KERN_WARNING "overrun %sopts\n",
+					nexthdr == NEXTHDR_HOP ?
+						"hop" : "dest"));
+				return -EINVAL;
 			}
-			nexthdr = exthdr->nexthdr;
-			exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
 			break;
 
 		case NEXTHDR_ROUTING:
-			*nh_offset = offset;
-			offset += ipv6_optlen(exthdr);
-			((struct ipv6_rt_hdr*)exthdr)->segments_left = 0; 
-			nexthdr = exthdr->nexthdr;
-			exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
-			break;
-
-		case NEXTHDR_DEST:
-			*nh_offset = offset;
-			offset += ipv6_optlen(exthdr);
-			if (!zero_out_mutable_opts(exthdr))  {
-				LIMIT_NETDEBUG(
-					printk(KERN_WARNING "overrun destopt\n")); 
-				return 0;
-			}
-			nexthdr = exthdr->nexthdr;
-			exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
+			exthdr.rth->segments_left = 0; 
 			break;
 
-		case NEXTHDR_AUTH:
-			if (dir == XFRM_POLICY_OUT) {
-				memset(((struct ipv6_auth_hdr*)exthdr)->auth_data, 0, 
-				       (((struct ipv6_auth_hdr*)exthdr)->hdrlen - 1) << 2);
-			}
-			if (exthdr->nexthdr == NEXTHDR_DEST) {
-				offset += (((struct ipv6_auth_hdr*)exthdr)->hdrlen + 2) << 2;
-				exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
-				nextnexthdr = exthdr->nexthdr;
-				if (!zero_out_mutable_opts(exthdr)) {
-					LIMIT_NETDEBUG(
-						printk(KERN_WARNING "overrun destopt\n"));
-					return 0;
-				}
-			}
-			return nexthdr;
 		default :
-			return nexthdr;
+			return 0;
 		}
+
+		nexthdr = exthdr.opth->nexthdr;
+		exthdr.raw += ipv6_optlen(exthdr.opth);
 	}
 
-	return nexthdr;
+	return 0;
 }
 
 int ah6_output(struct sk_buff **pskb)
@@ -153,7 +124,6 @@
 	struct ipv6hdr *iph = NULL;
 	struct ip_auth_hdr *ah;
 	struct ah_data *ahp;
-	u16 nh_offset = 0;
 	u8 nexthdr;
 
 	if ((*pskb)->ip_summed == CHECKSUM_HW) {
@@ -184,7 +154,11 @@
 		ah = (struct ip_auth_hdr*)((*pskb)->nh.ipv6h+1);
 		ah->nexthdr = IPPROTO_IPV6;
 	} else {
-		hdr_len = (*pskb)->h.raw - (*pskb)->nh.raw;
+		u8 *prevhdr;
+
+		hdr_len = ip6_find_1stfragopt(*pskb, &prevhdr);
+		nexthdr = *prevhdr;
+		*prevhdr = IPPROTO_AH;
 		iph = kmalloc(hdr_len, GFP_ATOMIC);
 		if (!iph) {
 			err = -ENOMEM;
@@ -192,13 +166,12 @@
 		}
 		memcpy(iph, (*pskb)->data, hdr_len);
 		(*pskb)->nh.ipv6h = (struct ipv6hdr*)skb_push(*pskb, x->props.header_len);
+		iph->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
 		memcpy((*pskb)->nh.ipv6h, iph, hdr_len);
-		nexthdr = ipv6_clear_mutable_options(*pskb, &nh_offset, XFRM_POLICY_OUT);
-		if (nexthdr == 0)
+		err = ipv6_clear_mutable_options((*pskb)->nh.ipv6h, hdr_len);
+		if (err)
 			goto error_free_iph;
 
-		(*pskb)->nh.raw[nh_offset] = IPPROTO_AH;
-		(*pskb)->nh.ipv6h->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
 		ah = (struct ip_auth_hdr*)((*pskb)->nh.raw+hdr_len);
 		(*pskb)->h.raw = (unsigned char*) ah;
 		ah->nexthdr = nexthdr;
@@ -229,8 +202,6 @@
 			IP6_ECN_clear((*pskb)->nh.ipv6h);
 	} else {
 		memcpy((*pskb)->nh.ipv6h, iph, hdr_len);
-		(*pskb)->nh.raw[nh_offset] = IPPROTO_AH;
-		(*pskb)->nh.ipv6h->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
 		kfree (iph);
 	}
 
@@ -259,7 +230,6 @@
 	 * Before process AH
 	 * [IPv6][Ext1][Ext2][AH][Dest][Payload]
 	 * |<-------------->| hdr_len
-	 * |<------------------------>| cleared_hlen
 	 *
 	 * To erase AH:
 	 * Keeping copy of cleared headers. After AH processing,
@@ -276,7 +246,6 @@
 	unsigned char *tmp_hdr = NULL;
 	u16 hdr_len;
 	u16 ah_hlen;
-	u16 cleared_hlen;
 	u16 nh_offset = 0;
 	u8 nexthdr = 0;
 	u8 *prevhdr;
@@ -291,17 +260,10 @@
 		goto out;
 
 	hdr_len = skb->data - skb->nh.raw;
-	cleared_hlen = hdr_len;
 	ah = (struct ipv6_auth_hdr*)skb->data;
 	ahp = x->data;
 	nexthdr = ah->nexthdr;
 	ah_hlen = (ah->hdrlen + 2) << 2;
-	cleared_hlen += ah_hlen;
-
-	if (nexthdr == NEXTHDR_DEST) {
-		struct ipv6_opt_hdr *dsthdr = (struct ipv6_opt_hdr*)(skb->data + ah_hlen);
-		cleared_hlen += ipv6_optlen(dsthdr);
-	}
 
         if (ah_hlen != XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + ahp->icv_full_len) &&
             ah_hlen != XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + ahp->icv_trunc_len))
@@ -310,11 +272,12 @@
 	if (!pskb_may_pull(skb, ah_hlen))
 		goto out;
 
-	tmp_hdr = kmalloc(cleared_hlen, GFP_ATOMIC);
+	tmp_hdr = kmalloc(hdr_len, GFP_ATOMIC);
 	if (!tmp_hdr)
 		goto out;
-	memcpy(tmp_hdr, skb->nh.raw, cleared_hlen);
-	ipv6_clear_mutable_options(skb, &nh_offset, XFRM_POLICY_IN);
+	memcpy(tmp_hdr, skb->nh.raw, hdr_len);
+	if (ipv6_clear_mutable_options(skb->nh.ipv6h, hdr_len))
+		goto out;
 	skb->nh.ipv6h->priority    = 0;
 	skb->nh.ipv6h->flow_lbl[0] = 0;
 	skb->nh.ipv6h->flow_lbl[1] = 0;
@@ -338,11 +301,6 @@
 
 	skb->nh.raw = skb_pull(skb, ah_hlen);
 	memcpy(skb->nh.raw, tmp_hdr, hdr_len);
-	if (nexthdr == NEXTHDR_DEST) {
-		memcpy(skb->nh.raw + hdr_len,
-		       tmp_hdr + hdr_len + ah_hlen,
-		       cleared_hlen - hdr_len - ah_hlen);
-	}
 	prevhdr = (u8*)(skb->nh.raw + nh_offset);
 	*prevhdr = nexthdr;
 	skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
diff -Nru a/net/ipv6/datagram.c b/net/ipv6/datagram.c
--- a/net/ipv6/datagram.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/datagram.c	2004-07-27 18:24:51 -07:00
@@ -28,9 +28,165 @@
 #include <net/ndisc.h>
 #include <net/addrconf.h>
 #include <net/transp_v6.h>
+#include <net/ip6_route.h>
 
 #include <linux/errqueue.h>
 #include <asm/uaccess.h>
+
+int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
+{
+	struct sockaddr_in6	*usin = (struct sockaddr_in6 *) uaddr;
+	struct inet_opt      	*inet = inet_sk(sk);
+	struct ipv6_pinfo      	*np = inet6_sk(sk);
+	struct in6_addr		*daddr;
+	struct dst_entry	*dst;
+	struct flowi		fl;
+	struct ip6_flowlabel	*flowlabel = NULL;
+	int			addr_type;
+	int			err;
+
+	if (usin->sin6_family == AF_INET) {
+		if (__ipv6_only_sock(sk))
+			return -EAFNOSUPPORT;
+		err = ip4_datagram_connect(sk, uaddr, addr_len);
+		goto ipv4_connected;
+	}
+
+	if (addr_len < SIN6_LEN_RFC2133)
+	  	return -EINVAL;
+
+	if (usin->sin6_family != AF_INET6) 
+	  	return -EAFNOSUPPORT;
+
+	memset(&fl, 0, sizeof(fl));
+	if (np->sndflow) {
+		fl.fl6_flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK;
+		if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) {
+			flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
+			if (flowlabel == NULL)
+				return -EINVAL;
+			ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
+		}
+	}
+
+	addr_type = ipv6_addr_type(&usin->sin6_addr);
+
+	if (addr_type == IPV6_ADDR_ANY) {
+		/*
+		 *	connect to self
+		 */
+		usin->sin6_addr.s6_addr[15] = 0x01;
+	}
+
+	daddr = &usin->sin6_addr;
+
+	if (addr_type == IPV6_ADDR_MAPPED) {
+		struct sockaddr_in sin;
+
+		if (__ipv6_only_sock(sk)) {
+			err = -ENETUNREACH;
+			goto out;
+		}
+		sin.sin_family = AF_INET;
+		sin.sin_addr.s_addr = daddr->s6_addr32[3];
+		sin.sin_port = usin->sin6_port;
+
+		err = ip4_datagram_connect(sk, 
+					   (struct sockaddr*) &sin, 
+					   sizeof(sin));
+
+ipv4_connected:
+		if (err)
+			goto out;
+		
+		ipv6_addr_set(&np->daddr, 0, 0, htonl(0x0000ffff), inet->daddr);
+
+		if (ipv6_addr_any(&np->saddr)) {
+			ipv6_addr_set(&np->saddr, 0, 0, htonl(0x0000ffff),
+				      inet->saddr);
+		}
+
+		if (ipv6_addr_any(&np->rcv_saddr)) {
+			ipv6_addr_set(&np->rcv_saddr, 0, 0, htonl(0x0000ffff),
+				      inet->rcv_saddr);
+		}
+		goto out;
+	}
+
+	if (addr_type&IPV6_ADDR_LINKLOCAL) {
+		if (addr_len >= sizeof(struct sockaddr_in6) &&
+		    usin->sin6_scope_id) {
+			if (sk->sk_bound_dev_if &&
+			    sk->sk_bound_dev_if != usin->sin6_scope_id) {
+				err = -EINVAL;
+				goto out;
+			}
+			sk->sk_bound_dev_if = usin->sin6_scope_id;
+			if (!sk->sk_bound_dev_if &&
+			    (addr_type & IPV6_ADDR_MULTICAST))
+				fl.oif = np->mcast_oif;
+		}
+
+		/* Connect to link-local address requires an interface */
+		if (!sk->sk_bound_dev_if) {
+			err = -EINVAL;
+			goto out;
+		}
+	}
+
+	ipv6_addr_copy(&np->daddr, daddr);
+	np->flow_label = fl.fl6_flowlabel;
+
+	inet->dport = usin->sin6_port;
+
+	/*
+	 *	Check for a route to destination an obtain the
+	 *	destination cache for it.
+	 */
+
+	fl.proto = sk->sk_protocol;
+	ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
+	ipv6_addr_copy(&fl.fl6_src, &np->saddr);
+	fl.oif = sk->sk_bound_dev_if;
+	fl.fl_ip_dport = inet->dport;
+	fl.fl_ip_sport = inet->sport;
+
+	if (!fl.oif && (addr_type&IPV6_ADDR_MULTICAST))
+		fl.oif = np->mcast_oif;
+
+	if (flowlabel) {
+		if (flowlabel->opt && flowlabel->opt->srcrt) {
+			struct rt0_hdr *rt0 = (struct rt0_hdr *) flowlabel->opt->srcrt;
+			ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
+		}
+	} else if (np->opt && np->opt->srcrt) {
+		struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt;
+		ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
+	}
+
+	err = ip6_dst_lookup(sk, &dst, &fl);
+	if (err)
+		goto out;
+
+	/* source address lookup done in ip6_dst_lookup */
+
+	if (ipv6_addr_any(&np->saddr))
+		ipv6_addr_copy(&np->saddr, &fl.fl6_src);
+
+	if (ipv6_addr_any(&np->rcv_saddr)) {
+		ipv6_addr_copy(&np->rcv_saddr, &fl.fl6_src);
+		inet->rcv_saddr = LOOPBACK4_IPV6;
+	}
+
+	ip6_dst_store(sk, dst,
+		      !ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
+		      &np->daddr : NULL);
+
+	sk->sk_state = TCP_ESTABLISHED;
+out:
+	fl6_sock_release(flowlabel);
+	return err;
+}
 
 void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, 
 		     u16 port, u32 info, u8 *payload)
diff -Nru a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
--- a/net/ipv6/exthdrs.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/exthdrs.c	2004-07-27 18:24:51 -07:00
@@ -159,7 +159,7 @@
 
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
 	    !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -172,7 +172,7 @@
 		return 1;
 	}
 
-	IP6_INC_STATS_BH(InHdrErrors);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 	return -1;
 }
 
@@ -227,7 +227,7 @@
 
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
 	    !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -236,7 +236,7 @@
 
 	if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr) ||
 	    skb->pkt_type != PACKET_HOST) {
-		IP6_INC_STATS_BH(InAddrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -252,13 +252,13 @@
 	}
 
 	if (hdr->type != IPV6_SRCRT_TYPE_0) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->type) - skb->nh.raw);
 		return -1;
 	}
 	
 	if (hdr->hdrlen & 0x01) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->hdrlen) - skb->nh.raw);
 		return -1;
 	}
@@ -271,7 +271,7 @@
 	n = hdr->hdrlen >> 1;
 
 	if (hdr->segments_left > n) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->segments_left) - skb->nh.raw);
 		return -1;
 	}
@@ -284,7 +284,7 @@
 		kfree_skb(skb);
 		/* the copy is a forwarded packet */
 		if (skb2 == NULL) {
-			IP6_INC_STATS_BH(OutDiscards);	
+			IP6_INC_STATS_BH(IPSTATS_MIB_OUTDISCARDS);	
 			return -1;
 		}
 		*skbp = skb = skb2;
@@ -302,7 +302,7 @@
 	addr += i - 1;
 
 	if (ipv6_addr_is_multicast(addr)) {
-		IP6_INC_STATS_BH(InAddrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -319,7 +319,7 @@
 	}
 	if (skb->dst->dev->flags&IFF_LOOPBACK) {
 		if (skb->nh.ipv6h->hop_limit <= 1) {
-			IP6_INC_STATS_BH(InHdrErrors);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 			icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
 				    0, skb->dev);
 			kfree_skb(skb);
@@ -436,24 +436,24 @@
 	if (skb->nh.raw[optoff+1] != 4 || (optoff&3) != 2) {
 		LIMIT_NETDEBUG(
 			 printk(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", skb->nh.raw[optoff+1]));
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		goto drop;
 	}
 
 	pkt_len = ntohl(*(u32*)(skb->nh.raw+optoff+2));
 	if (pkt_len <= IPV6_MAXPLEN) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
 		return 0;
 	}
 	if (skb->nh.ipv6h->payload_len) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff);
 		return 0;
 	}
 
 	if (pkt_len > skb->len - sizeof(struct ipv6hdr)) {
-		IP6_INC_STATS_BH(InTruncatedPkts);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS);
 		goto drop;
 	}
 	if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
diff -Nru a/net/ipv6/icmp.c b/net/ipv6/icmp.c
--- a/net/ipv6/icmp.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/icmp.c	2004-07-27 18:24:51 -07:00
@@ -174,7 +174,7 @@
 	 */
 	dst = ip6_route_output(sk, fl);
 	if (dst->error) {
-		IP6_INC_STATS(OutNoRoutes);
+		IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
 	} else if (dst->dev && (dst->dev->flags&IFF_LOOPBACK)) {
 		res = 1;
 	} else {
@@ -404,8 +404,8 @@
 	err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr));
 
 	if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB)
-		ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6OutDestUnreachs, type - ICMPV6_DEST_UNREACH);
-	ICMP6_INC_STATS_BH(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_OUTDESTUNREACHS, type - ICMPV6_DEST_UNREACH);
+	ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
 
 out_put:
 	if (likely(idev != NULL))
@@ -480,8 +480,8 @@
 	}
 	err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, skb->len + sizeof(struct icmp6hdr));
 
-        ICMP6_INC_STATS_BH(idev, Icmp6OutEchoReplies);
-        ICMP6_INC_STATS_BH(idev, Icmp6OutMsgs);
+        ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTECHOREPLIES);
+        ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
 
 out_put: 
 	if (likely(idev != NULL))
@@ -560,7 +560,7 @@
 	struct icmp6hdr *hdr;
 	int type;
 
-	ICMP6_INC_STATS_BH(idev, Icmp6InMsgs);
+	ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INMSGS);
 
 	saddr = &skb->nh.ipv6h->saddr;
 	daddr = &skb->nh.ipv6h->daddr;
@@ -593,9 +593,9 @@
 	type = hdr->icmp6_type;
 
 	if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB)
-		ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6InDestUnreachs, type - ICMPV6_DEST_UNREACH);
+		ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_INDESTUNREACHS, type - ICMPV6_DEST_UNREACH);
 	else if (type >= ICMPV6_ECHO_REQUEST && type <= NDISC_REDIRECT)
-		ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6InEchos, type - ICMPV6_ECHO_REQUEST);
+		ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_INECHOS, type - ICMPV6_ECHO_REQUEST);
 
 	switch (type) {
 	case ICMPV6_ECHO_REQUEST:
@@ -668,7 +668,7 @@
 	return 0;
 
 discard_it:
-	ICMP6_INC_STATS_BH(idev, Icmp6InErrors);
+	ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INERRORS);
 	kfree_skb(skb);
 	return 0;
 }
diff -Nru a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
--- a/net/ipv6/ip6_flowlabel.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/ip6_flowlabel.c	2004-07-27 18:24:51 -07:00
@@ -645,8 +645,8 @@
 static int ip6fl_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == SEQ_START_TOKEN)
-		seq_printf(seq, "Label S Owner  Users  Linger Expires  "
-				"Dst                              Opt\n");
+		seq_puts(seq, "Label S Owner  Users  Linger Expires  "
+			      "Dst                              Opt\n");
 	else
 		ip6fl_fl_seq_show(seq, v);
 	return 0;
diff -Nru a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
--- a/net/ipv6/ip6_input.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv6/ip6_input.c	2004-07-27 18:24:52 -07:00
@@ -64,10 +64,10 @@
 	if (skb->pkt_type == PACKET_OTHERHOST)
 		goto drop;
 
-	IP6_INC_STATS_BH(InReceives);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INRECEIVES);
 
 	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
-		IP6_INC_STATS_BH(InDiscards);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 		goto out;
 	}
 
@@ -80,7 +80,7 @@
 		goto err;
 
 	if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		goto drop;
 	}
 
@@ -97,7 +97,7 @@
 			goto truncated;
 		if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
 			if (__pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr))){
-				IP6_INC_STATS_BH(InHdrErrors);
+				IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 				goto drop;
 			}
 			hdr = skb->nh.ipv6h;
@@ -109,7 +109,7 @@
 	if (hdr->nexthdr == NEXTHDR_HOP) {
 		skb->h.raw = (u8*)(hdr+1);
 		if (ipv6_parse_hopopts(skb, offsetof(struct ipv6hdr, nexthdr)) < 0) {
-			IP6_INC_STATS_BH(InHdrErrors);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 			return 0;
 		}
 		hdr = skb->nh.ipv6h;
@@ -117,9 +117,9 @@
 
 	return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
 truncated:
-	IP6_INC_STATS_BH(InTruncatedPkts);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS);
 err:
-	IP6_INC_STATS_BH(InHdrErrors);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 drop:
 	kfree_skb(skb);
 out:
@@ -194,15 +194,15 @@
 		if (ret > 0)
 			goto resubmit;
 		else if (ret == 0)
-			IP6_INC_STATS_BH(InDelivers);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
 	} else {
 		if (!raw_sk) {
 			if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
-				IP6_INC_STATS_BH(InUnknownProtos);
+				IP6_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS);
 				icmpv6_param_prob(skb, ICMPV6_UNK_NEXTHDR, nhoff);
 			}
 		} else {
-			IP6_INC_STATS_BH(InDelivers);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
 			kfree_skb(skb);
 		}
 	}
@@ -210,7 +210,7 @@
 	return 0;
 
 discard:
-	IP6_INC_STATS_BH(InDiscards);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 	rcu_read_unlock();
 	kfree_skb(skb);
 	return 0;
@@ -227,7 +227,7 @@
 	struct ipv6hdr *hdr;
 	int deliver;
 
-	IP6_INC_STATS_BH(InMcastPkts);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INMCASTPKTS);
 
 	hdr = skb->nh.ipv6h;
 	deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
--- a/net/ipv6/ip6_output.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/ip6_output.c	2004-07-27 18:24:51 -07:00
@@ -87,7 +87,7 @@
 	} else if (dst->neighbour)
 		return dst->neighbour->output(skb);
 
-	IP6_INC_STATS_BH(OutNoRoutes);
+	IP6_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
 	kfree_skb(skb);
 	return -EINVAL;
 
@@ -133,13 +133,13 @@
 					ip6_dev_loopback_xmit);
 
 			if (skb->nh.ipv6h->hop_limit == 0) {
-				IP6_INC_STATS(OutDiscards);
+				IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 				kfree_skb(skb);
 				return 0;
 			}
 		}
 
-		IP6_INC_STATS(OutMcastPkts);
+		IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
 	}
 
 	return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish);
@@ -172,7 +172,7 @@
 	dst = ip6_route_output(skb->sk, &fl);
 
 	if (dst->error) {
-		IP6_INC_STATS(OutNoRoutes);
+		IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
 		LIMIT_NETDEBUG(
 			printk(KERN_DEBUG "ip6_route_me_harder: No more route.\n"));
 		dst_release(dst);
@@ -231,7 +231,7 @@
 			kfree_skb(skb);
 			skb = skb2;
 			if (skb == NULL) {	
-				IP6_INC_STATS(OutDiscards);
+				IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 				return -ENOBUFS;
 			}
 			if (sk)
@@ -265,7 +265,7 @@
 
 	mtu = dst_pmtu(dst);
 	if ((skb->len <= mtu) || ipfragok) {
-		IP6_INC_STATS(OutRequests);
+		IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 		return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute);
 	}
 
@@ -273,7 +273,7 @@
 		printk(KERN_DEBUG "IPv6: sending pkt_too_big to self\n");
 	skb->dev = dst->dev;
 	icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
-	IP6_INC_STATS(FragFails);
+	IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 	kfree_skb(skb);
 	return -EMSGSIZE;
 }
@@ -355,7 +355,7 @@
 		goto error;
 
 	if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) {
-		IP6_INC_STATS(InDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_INDISCARDS);
 		goto drop;
 	}
 
@@ -394,7 +394,7 @@
 	}
 
 	if (!xfrm6_route_forward(skb)) {
-		IP6_INC_STATS(InDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_INDISCARDS);
 		goto drop;
 	}
 
@@ -432,14 +432,14 @@
 		/* Again, force OUTPUT device used as source address */
 		skb->dev = dst->dev;
 		icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_pmtu(dst), skb->dev);
-		IP6_INC_STATS_BH(InTooBigErrors);
-		IP6_INC_STATS_BH(FragFails);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INTOOBIGERRORS);
+		IP6_INC_STATS_BH(IPSTATS_MIB_FRAGFAILS);
 		kfree_skb(skb);
 		return -EMSGSIZE;
 	}
 
 	if (skb_cow(skb, dst->dev->hard_header_len)) {
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 		goto drop;
 	}
 
@@ -449,11 +449,11 @@
  
 	hdr->hop_limit--;
 
-	IP6_INC_STATS_BH(OutForwDatagrams);
+	IP6_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
 	return NF_HOOK(PF_INET6,NF_IP6_FORWARD, skb, skb->dev, dst->dev, ip6_forward_finish);
 
 error:
-	IP6_INC_STATS_BH(InAddrErrors);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
 drop:
 	kfree_skb(skb);
 	return -EINVAL;
@@ -566,7 +566,7 @@
 
 		tmp_hdr = kmalloc(hlen, GFP_ATOMIC);
 		if (!tmp_hdr) {
-			IP6_INC_STATS(FragFails);
+			IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 			return -ENOMEM;
 		}
 
@@ -621,7 +621,7 @@
 			kfree(tmp_hdr);
 
 		if (err == 0) {
-			IP6_INC_STATS(FragOKs);
+			IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);
 			return 0;
 		}
 
@@ -631,7 +631,7 @@
 			frag = skb;
 		}
 
-		IP6_INC_STATS(FragFails);
+		IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 		return err;
 	}
 
@@ -664,7 +664,7 @@
 
 		if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) {
 			NETDEBUG(printk(KERN_INFO "IPv6: frag: no memory for new fragment!\n"));
-			IP6_INC_STATS(FragFails);
+			IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 			err = -ENOMEM;
 			goto fail;
 		}
@@ -722,19 +722,19 @@
 		 *	Put this fragment into the sending queue.
 		 */
 
-		IP6_INC_STATS(FragCreates);
+		IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
 
 		err = output(&frag);
 		if (err)
 			goto fail;
 	}
 	kfree_skb(skb);
-	IP6_INC_STATS(FragOKs);
+	IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);
 	return err;
 
 fail:
 	kfree_skb(skb); 
-	IP6_INC_STATS(FragFails);
+	IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 	return err;
 }
 
@@ -1019,7 +1019,7 @@
 	return 0;
 error:
 	inet->cork.length -= length;
-	IP6_INC_STATS(OutDiscards);
+	IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err;
 }
 
@@ -1079,7 +1079,7 @@
 	ipv6_addr_copy(&hdr->daddr, final_dst);
 
 	skb->dst = dst_clone(&rt->u.dst);
-	IP6_INC_STATS(OutRequests);	
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);	
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dst->dev, dst_output);
 	if (err) {
 		if (err > 0)
@@ -1111,7 +1111,7 @@
 	struct sk_buff *skb;
 
 	while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) {
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 		kfree_skb(skb);
 	}
 
diff -Nru a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
--- a/net/ipv6/ipcomp6.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/ipcomp6.c	2004-07-27 18:24:51 -07:00
@@ -240,7 +240,7 @@
 	struct ipv6_comp_hdr *ipcomph = (struct ipv6_comp_hdr*)(skb->data+offset);
 	struct xfrm_state *x;
 
-	if (type != ICMPV6_DEST_UNREACH || type != ICMPV6_PKT_TOOBIG)
+	if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG)
 		return;
 
 	spi = ntohl(ntohs(ipcomph->cpi));
diff -Nru a/net/ipv6/mcast.c b/net/ipv6/mcast.c
--- a/net/ipv6/mcast.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv6/mcast.c	2004-07-27 18:24:52 -07:00
@@ -1317,7 +1317,7 @@
 	struct inet6_dev *idev = in6_dev_get(skb->dev);
 	int err;
 
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	payload_len = skb->tail - (unsigned char *)skb->nh.ipv6h -
 		sizeof(struct ipv6hdr);
 	mldlen = skb->tail - skb->h.raw;
@@ -1328,10 +1328,10 @@
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dev,
 		dev_queue_xmit);
 	if (!err) {
-		ICMP6_INC_STATS(idev,Icmp6OutMsgs);
-		IP6_INC_STATS(OutMcastPkts);
+		ICMP6_INC_STATS(idev,ICMP6_MIB_OUTMSGS);
+		IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
 	} else
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 
 	if (likely(idev != NULL))
 		in6_dev_put(idev);
@@ -1613,7 +1613,7 @@
 		     IPV6_TLV_ROUTERALERT, 2, 0, 0,
 		     IPV6_TLV_PADN, 0 };
 
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	snd_addr = addr;
 	if (type == ICMPV6_MGM_REDUCTION) {
 		snd_addr = &all_routers;
@@ -1627,7 +1627,7 @@
 	skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err);
 
 	if (skb == NULL) {
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 		return;
 	}
 
@@ -1668,20 +1668,20 @@
 		dev_queue_xmit);
 	if (!err) {
 		if (type == ICMPV6_MGM_REDUCTION)
-			ICMP6_INC_STATS(idev, Icmp6OutGroupMembReductions);
+			ICMP6_INC_STATS(idev, ICMP6_MIB_OUTGROUPMEMBREDUCTIONS);
 		else
-			ICMP6_INC_STATS(idev, Icmp6OutGroupMembResponses);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
-		IP6_INC_STATS(OutMcastPkts);
+			ICMP6_INC_STATS(idev, ICMP6_MIB_OUTGROUPMEMBRESPONSES);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
+		IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
 	} else
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 
 	if (likely(idev != NULL))
 		in6_dev_put(idev);
 	return;
 
 out:
-	IP6_INC_STATS(OutDiscards);
+	IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	kfree_skb(skb);
 }
 
diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
--- a/net/ipv6/ndisc.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/ndisc.c	2004-07-27 18:24:52 -07:00
@@ -452,11 +452,11 @@
 
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
-		ICMP6_INC_STATS(idev, Icmp6OutNeighborAdvertisements);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
 	}
 
 	if (likely(idev != NULL))
@@ -536,11 +536,11 @@
 	/* send it! */
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
-		ICMP6_INC_STATS(idev, Icmp6OutNeighborSolicits);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTNEIGHBORSOLICITS);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
 	}
 
 	if (likely(idev != NULL))
@@ -609,11 +609,11 @@
 	/* send it! */
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(OutRequests);	
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);	
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
-		ICMP6_INC_STATS(idev, Icmp6OutRouterSolicits);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTROUTERSOLICITS);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
 	}
 
 	if (likely(idev != NULL))
@@ -1335,11 +1335,11 @@
 
 	buff->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, buff, NULL, dst->dev, dst_output);
 	if (!err) {
-		ICMP6_INC_STATS(idev, Icmp6OutRedirects);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTREDIRECTS);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
 	}
 
 	if (likely(idev != NULL))
diff -Nru a/net/ipv6/proc.c b/net/ipv6/proc.c
--- a/net/ipv6/proc.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/proc.c	2004-07-27 18:24:51 -07:00
@@ -57,36 +57,34 @@
 	return 0;
 }
 
-static struct snmp_item snmp6_ipstats_list[] = {
+static struct snmp_mib snmp6_ipstats_list[] = {
 /* ipv6 mib according to RFC 2465 */
-#define SNMP6_GEN(x)	SNMP_ITEM(struct ipstats_mib, x, "Ip6" #x)
-	SNMP6_GEN(InReceives),
-	SNMP6_GEN(InHdrErrors),
-	SNMP6_GEN(InTooBigErrors),
-	SNMP6_GEN(InNoRoutes),
-	SNMP6_GEN(InAddrErrors),
-	SNMP6_GEN(InUnknownProtos),
-	SNMP6_GEN(InTruncatedPkts),
-	SNMP6_GEN(InDiscards),
-	SNMP6_GEN(InDelivers),
-	SNMP6_GEN(OutForwDatagrams),
-	SNMP6_GEN(OutRequests),
-	SNMP6_GEN(OutDiscards),
-	SNMP6_GEN(OutNoRoutes),
-	SNMP6_GEN(ReasmTimeout),
-	SNMP6_GEN(ReasmReqds),
-	SNMP6_GEN(ReasmOKs),
-	SNMP6_GEN(ReasmFails),
-	SNMP6_GEN(FragOKs),
-	SNMP6_GEN(FragFails),
-	SNMP6_GEN(FragCreates),
-	SNMP6_GEN(InMcastPkts),
-	SNMP6_GEN(OutMcastPkts),
-#undef SNMP6_GEN
-	SNMP_ITEM_SENTINEL
+	SNMP_MIB_ITEM("Ip6InReceives", IPSTATS_MIB_INRECEIVES),
+	SNMP_MIB_ITEM("Ip6InHdrErrors", IPSTATS_MIB_INHDRERRORS),
+	SNMP_MIB_ITEM("Ip6InTooBigErrors", IPSTATS_MIB_INTOOBIGERRORS),
+	SNMP_MIB_ITEM("Ip6InNoRoutes", IPSTATS_MIB_INNOROUTES),
+	SNMP_MIB_ITEM("Ip6InAddrErrors", IPSTATS_MIB_INADDRERRORS),
+	SNMP_MIB_ITEM("Ip6InUnknownProtos", IPSTATS_MIB_INUNKNOWNPROTOS),
+	SNMP_MIB_ITEM("Ip6InTruncatedPkts", IPSTATS_MIB_INTRUNCATEDPKTS),
+	SNMP_MIB_ITEM("Ip6InDiscards", IPSTATS_MIB_INDISCARDS),
+	SNMP_MIB_ITEM("Ip6InDelivers", IPSTATS_MIB_INDELIVERS),
+	SNMP_MIB_ITEM("Ip6OutForwDatagrams", IPSTATS_MIB_OUTFORWDATAGRAMS),
+	SNMP_MIB_ITEM("Ip6OutRequests", IPSTATS_MIB_OUTREQUESTS),
+	SNMP_MIB_ITEM("Ip6OutDiscards", IPSTATS_MIB_OUTDISCARDS),
+	SNMP_MIB_ITEM("Ip6OutNoRoutes", IPSTATS_MIB_OUTNOROUTES),
+	SNMP_MIB_ITEM("Ip6ReasmTimeout", IPSTATS_MIB_REASMTIMEOUT),
+	SNMP_MIB_ITEM("Ip6ReasmReqds", IPSTATS_MIB_REASMREQDS),
+	SNMP_MIB_ITEM("Ip6ReasmOKs", IPSTATS_MIB_REASMOKS),
+	SNMP_MIB_ITEM("Ip6ReasmFails", IPSTATS_MIB_REASMFAILS),
+	SNMP_MIB_ITEM("Ip6FragOKs", IPSTATS_MIB_FRAGOKS),
+	SNMP_MIB_ITEM("Ip6FragFails", IPSTATS_MIB_FRAGFAILS),
+	SNMP_MIB_ITEM("Ip6FragCreates", IPSTATS_MIB_FRAGCREATES),
+	SNMP_MIB_ITEM("Ip6InMcastPkts", IPSTATS_MIB_INMCASTPKTS),
+	SNMP_MIB_ITEM("Ip6OutMcastPkts", IPSTATS_MIB_OUTMCASTPKTS),
+	SNMP_MIB_SENTINEL
 };
 
-static struct snmp_item snmp6_icmp6_list[] = {
+static struct snmp_mib snmp6_icmp6_list[] = {
 /* icmpv6 mib according to RFC 2466
 
    Exceptions:  {In|Out}AdminProhibs are removed, because I see
@@ -97,47 +95,43 @@
 		OutRouterAdvertisements too.
 		OutGroupMembQueries too.
  */
-#define SNMP6_GEN(x)	SNMP_ITEM(struct icmpv6_mib, x, #x)
-	SNMP6_GEN(Icmp6InMsgs),
-	SNMP6_GEN(Icmp6InErrors),
-	SNMP6_GEN(Icmp6InDestUnreachs),
-	SNMP6_GEN(Icmp6InPktTooBigs),
-	SNMP6_GEN(Icmp6InTimeExcds),
-	SNMP6_GEN(Icmp6InParmProblems),
-	SNMP6_GEN(Icmp6InEchos),
-	SNMP6_GEN(Icmp6InEchoReplies),
-	SNMP6_GEN(Icmp6InGroupMembQueries),
-	SNMP6_GEN(Icmp6InGroupMembResponses),
-	SNMP6_GEN(Icmp6InGroupMembReductions),
-	SNMP6_GEN(Icmp6InRouterSolicits),
-	SNMP6_GEN(Icmp6InRouterAdvertisements),
-	SNMP6_GEN(Icmp6InNeighborSolicits),
-	SNMP6_GEN(Icmp6InNeighborAdvertisements),
-	SNMP6_GEN(Icmp6InRedirects),
-	SNMP6_GEN(Icmp6OutMsgs),
-	SNMP6_GEN(Icmp6OutDestUnreachs),
-	SNMP6_GEN(Icmp6OutPktTooBigs),
-	SNMP6_GEN(Icmp6OutTimeExcds),
-	SNMP6_GEN(Icmp6OutParmProblems),
-	SNMP6_GEN(Icmp6OutEchoReplies),
-	SNMP6_GEN(Icmp6OutRouterSolicits),
-	SNMP6_GEN(Icmp6OutNeighborSolicits),
-	SNMP6_GEN(Icmp6OutNeighborAdvertisements),
-	SNMP6_GEN(Icmp6OutRedirects),
-	SNMP6_GEN(Icmp6OutGroupMembResponses),
-	SNMP6_GEN(Icmp6OutGroupMembReductions),
-#undef SNMP6_GEN
-	SNMP_ITEM_SENTINEL
+	SNMP_MIB_ITEM("Icmp6InMsgs", ICMP6_MIB_INMSGS),
+	SNMP_MIB_ITEM("Icmp6InErrors", ICMP6_MIB_INERRORS),
+	SNMP_MIB_ITEM("Icmp6InDestUnreachs", ICMP6_MIB_INDESTUNREACHS),
+	SNMP_MIB_ITEM("Icmp6InPktTooBigs", ICMP6_MIB_INPKTTOOBIGS),
+	SNMP_MIB_ITEM("Icmp6InTimeExcds", ICMP6_MIB_INTIMEEXCDS),
+	SNMP_MIB_ITEM("Icmp6InParmProblems", ICMP6_MIB_INPARMPROBLEMS),
+	SNMP_MIB_ITEM("Icmp6InEchos", ICMP6_MIB_INECHOS),
+	SNMP_MIB_ITEM("Icmp6InEchoReplies", ICMP6_MIB_INECHOREPLIES),
+	SNMP_MIB_ITEM("Icmp6InGroupMembQueries", ICMP6_MIB_INGROUPMEMBQUERIES),
+	SNMP_MIB_ITEM("Icmp6InGroupMembResponses", ICMP6_MIB_INGROUPMEMBRESPONSES),
+	SNMP_MIB_ITEM("Icmp6InGroupMembReductions", ICMP6_MIB_INGROUPMEMBREDUCTIONS),
+	SNMP_MIB_ITEM("Icmp6InRouterSolicits", ICMP6_MIB_INROUTERSOLICITS),
+	SNMP_MIB_ITEM("Icmp6InRouterAdvertisements", ICMP6_MIB_INROUTERADVERTISEMENTS),
+	SNMP_MIB_ITEM("Icmp6InNeighborSolicits", ICMP6_MIB_INNEIGHBORSOLICITS),
+	SNMP_MIB_ITEM("Icmp6InNeighborAdvertisements", ICMP6_MIB_INNEIGHBORADVERTISEMENTS),
+	SNMP_MIB_ITEM("Icmp6InRedirects", ICMP6_MIB_INREDIRECTS),
+	SNMP_MIB_ITEM("Icmp6OutMsgs", ICMP6_MIB_OUTMSGS),
+	SNMP_MIB_ITEM("Icmp6OutDestUnreachs", ICMP6_MIB_OUTDESTUNREACHS),
+	SNMP_MIB_ITEM("Icmp6OutPktTooBigs", ICMP6_MIB_OUTPKTTOOBIGS),
+	SNMP_MIB_ITEM("Icmp6OutTimeExcds", ICMP6_MIB_OUTTIMEEXCDS),
+	SNMP_MIB_ITEM("Icmp6OutParmProblems", ICMP6_MIB_OUTPARMPROBLEMS),
+	SNMP_MIB_ITEM("Icmp6OutEchoReplies", ICMP6_MIB_OUTECHOREPLIES),
+	SNMP_MIB_ITEM("Icmp6OutRouterSolicits", ICMP6_MIB_OUTROUTERSOLICITS),
+	SNMP_MIB_ITEM("Icmp6OutNeighborSolicits", ICMP6_MIB_OUTNEIGHBORSOLICITS),
+	SNMP_MIB_ITEM("Icmp6OutNeighborAdvertisements", ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS),
+	SNMP_MIB_ITEM("Icmp6OutRedirects", ICMP6_MIB_OUTREDIRECTS),
+	SNMP_MIB_ITEM("Icmp6OutGroupMembResponses", ICMP6_MIB_OUTGROUPMEMBRESPONSES),
+	SNMP_MIB_ITEM("Icmp6OutGroupMembReductions", ICMP6_MIB_OUTGROUPMEMBREDUCTIONS),
+	SNMP_MIB_SENTINEL
 };
 
-static struct snmp_item snmp6_udp6_list[] = {
-#define SNMP6_GEN(x)	SNMP_ITEM(struct udp_mib, Udp##x, "Udp6" #x)
-	SNMP6_GEN(InDatagrams),
-	SNMP6_GEN(NoPorts),
-	SNMP6_GEN(InErrors),
-	SNMP6_GEN(OutDatagrams),
-#undef SNMP6_GEN
-	SNMP_ITEM_SENTINEL
+static struct snmp_mib snmp6_udp6_list[] = {
+	SNMP_MIB_ITEM("Udp6InDatagrams", UDP_MIB_INDATAGRAMS),
+	SNMP_MIB_ITEM("Udp6NoPorts", UDP_MIB_NOPORTS),
+	SNMP_MIB_ITEM("Udp6InErrors", UDP_MIB_INERRORS),
+	SNMP_MIB_ITEM("Udp6OutDatagrams", UDP_MIB_OUTDATAGRAMS),
+	SNMP_MIB_SENTINEL
 };
 
 static unsigned long
@@ -149,23 +143,19 @@
         for (i = 0; i < NR_CPUS; i++) {
                 if (!cpu_possible(i))
                         continue;
-                res +=
-                    *((unsigned long *) (((void *)per_cpu_ptr(mib[0], i)) +
-                                         offt));
-                res +=
-                    *((unsigned long *) (((void *)per_cpu_ptr(mib[1], i)) +
-                                         offt));
+                res += *(((unsigned long *)per_cpu_ptr(mib[0], i)) + offt);
+                res += *(((unsigned long *)per_cpu_ptr(mib[1], i)) + offt);
         }
         return res;
 }
 
 static inline void
-snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_item *itemlist)
+snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_mib *itemlist)
 {
 	int i;
 	for (i=0; itemlist[i].name; i++)
 		seq_printf(seq, "%-32s\t%lu\n", itemlist[i].name, 
-				fold_field(mib, itemlist[i].offset));
+				fold_field(mib, itemlist[i].entry));
 }
 
 static int snmp6_seq_show(struct seq_file *seq, void *v)
diff -Nru a/net/ipv6/raw.c b/net/ipv6/raw.c
--- a/net/ipv6/raw.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/raw.c	2004-07-27 18:24:51 -07:00
@@ -419,7 +419,10 @@
 
 	if (np->rxopt.all)
 		datagram_recv_ctl(sk, msg, skb);
+
 	err = copied;
+	if (flags & MSG_TRUNC)
+		err = skb->len;
 
 out_free:
 	skb_free_datagram(sk, skb);
@@ -535,7 +538,7 @@
 	if (err)
 		goto error_fault;
 
-	IP6_INC_STATS(OutRequests);		
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);		
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
 		      dst_output);
 	if (err > 0)
@@ -549,7 +552,7 @@
 	err = -EFAULT;
 	kfree_skb(skb);
 error:
-	IP6_INC_STATS(OutDiscards);
+	IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err; 
 }
 static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
@@ -916,7 +919,7 @@
 struct proto rawv6_prot = {
 	.name =		"RAW",
 	.close =	rawv6_close,
-	.connect =	udpv6_connect,
+	.connect =	ip6_datagram_connect,
 	.disconnect =	udp_disconnect,
 	.ioctl =	rawv6_ioctl,
 	.init =		rawv6_init_sk,
diff -Nru a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
--- a/net/ipv6/reassembly.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/reassembly.c	2004-07-27 18:24:51 -07:00
@@ -284,7 +284,7 @@
 		spin_unlock(&fq->lock);
 
 		fq_put(fq);
-		IP6_INC_STATS_BH(ReasmFails);
+		IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	}
 }
 
@@ -299,8 +299,8 @@
 
 	fq_kill(fq);
 
-	IP6_INC_STATS_BH(ReasmTimeout);
-	IP6_INC_STATS_BH(ReasmFails);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 
 	/* Send error only if the first segment arrived. */
 	if (fq->last_in&FIRST_IN && fq->fragments) {
@@ -386,7 +386,7 @@
 	return ip6_frag_intern(hash, fq);
 
 oom:
-	IP6_INC_STATS_BH(ReasmFails);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	return NULL;
 }
 
@@ -426,7 +426,7 @@
 			((u8 *) (fhdr + 1) - (u8 *) (skb->nh.ipv6h + 1)));
 
 	if ((unsigned int)end > IPV6_MAXPLEN) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
  		icmpv6_param_prob(skb,ICMPV6_HDR_FIELD, (u8*)&fhdr->frag_off - skb->nh.raw);
  		return;
 	}
@@ -453,7 +453,7 @@
 			/* RFC2460 says always send parameter problem in
 			 * this case. -DaveM
 			 */
-			IP6_INC_STATS_BH(InHdrErrors);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 			icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, 
 					  offsetof(struct ipv6hdr, payload_len));
 			return;
@@ -572,7 +572,7 @@
 	return;
 
 err:
-	IP6_INC_STATS(ReasmFails);
+	IP6_INC_STATS(IPSTATS_MIB_REASMFAILS);
 	kfree_skb(skb);
 }
 
@@ -666,7 +666,7 @@
 	if (head->ip_summed == CHECKSUM_HW)
 		head->csum = csum_partial(head->nh.raw, head->h.raw-head->nh.raw, head->csum);
 
-	IP6_INC_STATS_BH(ReasmOKs);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
 	fq->fragments = NULL;
 	*nhoffp = nhoff;
 	return 1;
@@ -679,7 +679,7 @@
 	if (net_ratelimit())
 		printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
 out_fail:
-	IP6_INC_STATS_BH(ReasmFails);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	return -1;
 }
 
@@ -693,16 +693,16 @@
 
 	hdr = skb->nh.ipv6h;
 
-	IP6_INC_STATS_BH(ReasmReqds);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
 
 	/* Jumbo payload inhibits frag. header */
 	if (hdr->payload_len==0) {
-		IP6_INC_STATS(InHdrErrors);
+		IP6_INC_STATS(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
 		return -1;
 	}
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+sizeof(struct frag_hdr))) {
-		IP6_INC_STATS(InHdrErrors);
+		IP6_INC_STATS(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
 		return -1;
 	}
@@ -713,7 +713,7 @@
 	if (!(fhdr->frag_off & htons(0xFFF9))) {
 		/* It is not a fragmented frame */
 		skb->h.raw += sizeof(struct frag_hdr);
-		IP6_INC_STATS_BH(ReasmOKs);
+		IP6_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
 
 		*nhoffp = (u8*)fhdr - skb->nh.raw;
 		return 1;
@@ -738,7 +738,7 @@
 		return ret;
 	}
 
-	IP6_INC_STATS_BH(ReasmFails);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	kfree_skb(skb);
 	return -1;
 }
diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c
--- a/net/ipv6/route.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv6/route.c	2004-07-27 18:24:52 -07:00
@@ -584,7 +584,7 @@
 /* Protected by rt6_lock.  */
 static struct dst_entry *ndisc_dst_gc_list;
 static int ipv6_get_mtu(struct net_device *dev);
-static inline unsigned int ipv6_advmss(unsigned int mtu);
+static unsigned int ipv6_advmss(unsigned int mtu);
 
 struct dst_entry *ndisc_dst_alloc(struct net_device *dev, 
 				  struct neighbour *neigh,
@@ -1292,7 +1292,7 @@
 
 int ip6_pkt_discard(struct sk_buff *skb)
 {
-	IP6_INC_STATS(OutNoRoutes);
+	IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
 	icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_NOROUTE, 0, skb->dev);
 	kfree_skb(skb);
 	return 0;
diff -Nru a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
--- a/net/ipv6/tcp_ipv6.c	2004-07-27 18:24:51 -07:00
+++ b/net/ipv6/tcp_ipv6.c	2004-07-27 18:24:51 -07:00
@@ -55,6 +55,8 @@
 #include <net/inet_ecn.h>
 #include <net/protocol.h>
 #include <net/xfrm.h>
+#include <net/addrconf.h>
+#include <net/snmp.h>
 
 #include <asm/uaccess.h>
 
@@ -495,7 +497,7 @@
 		/* Silly. Should hash-dance instead... */
 		local_bh_disable();
 		tcp_tw_deschedule(tw);
-		NET_INC_STATS_BH(TimeWaitRecycled);
+		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
 		local_bh_enable();
 
 		tcp_tw_put(tw);
@@ -734,7 +736,7 @@
 	sk = tcp_v6_lookup(&hdr->daddr, th->dest, &hdr->saddr, th->source, skb->dev->ifindex);
 
 	if (sk == NULL) {
-		ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), Icmp6InErrors);
+		ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
 		return;
 	}
 
@@ -745,7 +747,7 @@
 
 	bh_lock_sock(sk);
 	if (sock_owned_by_user(sk))
-		NET_INC_STATS_BH(LockDroppedIcmps);
+		NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
 
 	if (sk->sk_state == TCP_CLOSE)
 		goto out;
@@ -754,7 +756,7 @@
 	seq = ntohl(th->seq); 
 	if (sk->sk_state != TCP_LISTEN &&
 	    !between(seq, tp->snd_una, tp->snd_nxt)) {
-		NET_INC_STATS_BH(OutOfWindowIcmps);
+		NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
 		goto out;
 	}
 
@@ -822,7 +824,7 @@
 		BUG_TRAP(req->sk == NULL);
 
 		if (seq != req->snt_isn) {
-			NET_INC_STATS_BH(OutOfWindowIcmps);
+			NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
 			goto out;
 		}
 
@@ -833,7 +835,7 @@
 	case TCP_SYN_RECV:  /* Cannot happen.
 			       It can, it SYNs are crossed. --ANK */ 
 		if (!sock_owned_by_user(sk)) {
-			TCP_INC_STATS_BH(TcpAttemptFails);
+			TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
 			sk->sk_err = err;
 			sk->sk_error_report(sk);		/* Wake people up to see the error (see connect in sock.c) */
 
@@ -1020,8 +1022,8 @@
 	/* sk = NULL, but it is safe for now. RST socket required. */
 	if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) {
 		ip6_xmit(NULL, buff, &fl, NULL, 0);
-		TCP_INC_STATS_BH(TcpOutSegs);
-		TCP_INC_STATS_BH(TcpOutRsts);
+		TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
+		TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
 		return;
 	}
 
@@ -1081,7 +1083,7 @@
 
 	if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) {
 		ip6_xmit(NULL, buff, &fl, NULL, 0);
-		TCP_INC_STATS_BH(TcpOutSegs);
+		TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
 		return;
 	}
 
@@ -1233,7 +1235,7 @@
 	if (req)
 		tcp_openreq_free(req);
 
-	TCP_INC_STATS_BH(TcpAttemptFails);
+	TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
 	return 0; /* don't send reset */
 }
 
@@ -1409,9 +1411,9 @@
 	return newsk;
 
 out_overflow:
-	NET_INC_STATS_BH(ListenOverflows);
+	NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS);
 out:
-	NET_INC_STATS_BH(ListenDrops);
+	NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS);
 	if (opt && opt != np->opt)
 		sock_kfree_s(sk, opt, opt->tot_len);
 	dst_release(dst);
@@ -1536,7 +1538,7 @@
 	kfree_skb(skb);
 	return 0;
 csum_err:
-	TCP_INC_STATS_BH(TcpInErrs);
+	TCP_INC_STATS_BH(TCP_MIB_INERRS);
 	goto discard;
 
 
@@ -1582,7 +1584,7 @@
 	/*
 	 *	Count it even if it's bad.
 	 */
-	TCP_INC_STATS_BH(TcpInSegs);
+	TCP_INC_STATS_BH(TCP_MIB_INSEGS);
 
 	if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
 		goto discard_it;
@@ -1643,7 +1645,7 @@
 
 	if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
 bad_packet:
-		TCP_INC_STATS_BH(TcpInErrs);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
 	} else {
 		tcp_v6_send_reset(skb);
 	}
@@ -1668,7 +1670,7 @@
 	}
 
 	if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
-		TCP_INC_STATS_BH(TcpInErrs);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
 		tcp_tw_put((struct tcp_tw_bucket *) sk);
 		goto discard_it;
 	}
@@ -2015,12 +2017,12 @@
 	struct tcp_iter_state *st;
 
 	if (v == SEQ_START_TOKEN) {
-		seq_printf(seq,
-			   "  sl  "
-			   "local_address                         "
-			   "remote_address                        "
-			   "st tx_queue rx_queue tr tm->when retrnsmt"
-			   "   uid  timeout inode\n");
+		seq_puts(seq,
+			 "  sl  "
+			 "local_address                         "
+			 "remote_address                        "
+			 "st tx_queue rx_queue tr tm->when retrnsmt"
+			 "   uid  timeout inode\n");
 		goto out;
 	}
 	st = seq->private;
diff -Nru a/net/ipv6/udp.c b/net/ipv6/udp.c
--- a/net/ipv6/udp.c	2004-07-27 18:24:52 -07:00
+++ b/net/ipv6/udp.c	2004-07-27 18:24:52 -07:00
@@ -49,6 +49,7 @@
 #include <net/addrconf.h>
 #include <net/ip.h>
 #include <net/udp.h>
+#include <net/raw.h>
 #include <net/inet_common.h>
 
 #include <net/ip6_checksum.h>
@@ -203,159 +204,6 @@
  *
  */
 
-int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
-{
-	struct sockaddr_in6	*usin = (struct sockaddr_in6 *) uaddr;
-	struct inet_opt      	*inet = inet_sk(sk);
-	struct ipv6_pinfo      	*np = inet6_sk(sk);
-	struct in6_addr		*daddr;
-	struct dst_entry	*dst;
-	struct flowi		fl;
-	struct ip6_flowlabel	*flowlabel = NULL;
-	int			addr_type;
-	int			err;
-
-	if (usin->sin6_family == AF_INET) {
-		if (__ipv6_only_sock(sk))
-			return -EAFNOSUPPORT;
-		err = udp_connect(sk, uaddr, addr_len);
-		goto ipv4_connected;
-	}
-
-	if (addr_len < SIN6_LEN_RFC2133)
-	  	return -EINVAL;
-
-	if (usin->sin6_family != AF_INET6) 
-	  	return -EAFNOSUPPORT;
-
-	memset(&fl, 0, sizeof(fl));
-	if (np->sndflow) {
-		fl.fl6_flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK;
-		if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) {
-			flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
-			if (flowlabel == NULL)
-				return -EINVAL;
-			ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
-		}
-	}
-
-	addr_type = ipv6_addr_type(&usin->sin6_addr);
-
-	if (addr_type == IPV6_ADDR_ANY) {
-		/*
-		 *	connect to self
-		 */
-		usin->sin6_addr.s6_addr[15] = 0x01;
-	}
-
-	daddr = &usin->sin6_addr;
-
-	if (addr_type == IPV6_ADDR_MAPPED) {
-		struct sockaddr_in sin;
-
-		if (__ipv6_only_sock(sk)) {
-			err = -ENETUNREACH;
-			goto out;
-		}
-		sin.sin_family = AF_INET;
-		sin.sin_addr.s_addr = daddr->s6_addr32[3];
-		sin.sin_port = usin->sin6_port;
-
-		err = udp_connect(sk, (struct sockaddr*) &sin, sizeof(sin));
-
-ipv4_connected:
-		if (err)
-			goto out;
-		
-		ipv6_addr_set(&np->daddr, 0, 0, htonl(0x0000ffff), inet->daddr);
-
-		if (ipv6_addr_any(&np->saddr)) {
-			ipv6_addr_set(&np->saddr, 0, 0, htonl(0x0000ffff),
-				      inet->saddr);
-		}
-
-		if (ipv6_addr_any(&np->rcv_saddr)) {
-			ipv6_addr_set(&np->rcv_saddr, 0, 0, htonl(0x0000ffff),
-				      inet->rcv_saddr);
-		}
-		goto out;
-	}
-
-	if (addr_type&IPV6_ADDR_LINKLOCAL) {
-		if (addr_len >= sizeof(struct sockaddr_in6) &&
-		    usin->sin6_scope_id) {
-			if (sk->sk_bound_dev_if &&
-			    sk->sk_bound_dev_if != usin->sin6_scope_id) {
-				err = -EINVAL;
-				goto out;
-			}
-			sk->sk_bound_dev_if = usin->sin6_scope_id;
-			if (!sk->sk_bound_dev_if &&
-			    (addr_type & IPV6_ADDR_MULTICAST))
-				fl.oif = np->mcast_oif;
-		}
-
-		/* Connect to link-local address requires an interface */
-		if (!sk->sk_bound_dev_if) {
-			err = -EINVAL;
-			goto out;
-		}
-	}
-
-	ipv6_addr_copy(&np->daddr, daddr);
-	np->flow_label = fl.fl6_flowlabel;
-
-	inet->dport = usin->sin6_port;
-
-	/*
-	 *	Check for a route to destination an obtain the
-	 *	destination cache for it.
-	 */
-
-	fl.proto = IPPROTO_UDP;
-	ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
-	ipv6_addr_copy(&fl.fl6_src, &np->saddr);
-	fl.oif = sk->sk_bound_dev_if;
-	fl.fl_ip_dport = inet->dport;
-	fl.fl_ip_sport = inet->sport;
-
-	if (!fl.oif && (addr_type&IPV6_ADDR_MULTICAST))
-		fl.oif = np->mcast_oif;
-
-	if (flowlabel) {
-		if (flowlabel->opt && flowlabel->opt->srcrt) {
-			struct rt0_hdr *rt0 = (struct rt0_hdr *) flowlabel->opt->srcrt;
-			ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
-		}
-	} else if (np->opt && np->opt->srcrt) {
-		struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt;
-		ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
-	}
-
-	err = ip6_dst_lookup(sk, &dst, &fl);
-	if (err)
-		goto out;
-
-	/* source address lookup done in ip6_dst_lookup */
-
-	if (ipv6_addr_any(&np->saddr))
-		ipv6_addr_copy(&np->saddr, &fl.fl6_src);
-
-	if (ipv6_addr_any(&np->rcv_saddr)) {
-		ipv6_addr_copy(&np->rcv_saddr, &fl.fl6_src);
-		inet->rcv_saddr = LOOPBACK4_IPV6;
-	}
-
-	ip6_dst_store(sk, dst,
-		      !ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
-		      &np->daddr : NULL);
-
-	sk->sk_state = TCP_ESTABLISHED;
-out:
-	fl6_sock_release(flowlabel);
-	return err;
-}
-
 static void udpv6_close(struct sock *sk, long timeout)
 {
 	sk_common_release(sk);
@@ -436,7 +284,10 @@
 				sin6->sin6_scope_id = IP6CB(skb)->iif;
 		}
   	}
+
 	err = copied;
+	if (flags & MSG_TRUNC)
+		err = skb->len - sizeof(struct udphdr);
 
 out_free:
 	skb_free_datagram(sk, skb);
@@ -460,7 +311,7 @@
 	skb_free_datagram(sk, skb);
 
 	if (flags & MSG_DONTWAIT) {
-		UDP6_INC_STATS_USER(UdpInErrors);
+		UDP6_INC_STATS_USER(UDP_MIB_INERRORS);
 		return -EAGAIN;
 	}
 	goto try_again;
@@ -509,7 +360,7 @@
 
 	if (skb->ip_summed != CHECKSUM_UNNECESSARY) {
 		if ((unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum))) {
-			UDP6_INC_STATS_BH(UdpInErrors);
+			UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
 			kfree_skb(skb);
 			return 0;
 		}
@@ -517,11 +368,11 @@
 	}
 
 	if (sock_queue_rcv_skb(sk,skb)<0) {
-		UDP6_INC_STATS_BH(UdpInErrors);
+		UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
 		kfree_skb(skb);
 		return 0;
 	}
-	UDP6_INC_STATS_BH(UdpInDatagrams);
+	UDP6_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
 	return 0;
 }
 
@@ -670,7 +521,7 @@
 		if (skb->ip_summed != CHECKSUM_UNNECESSARY &&
 		    (unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)))
 			goto discard;
-		UDP6_INC_STATS_BH(UdpNoPorts);
+		UDP6_INC_STATS_BH(UDP_MIB_NOPORTS);
 
 		icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev);
 
@@ -689,7 +540,7 @@
 		printk(KERN_DEBUG "UDP: short packet: %d/%u\n", ulen, skb->len);
 
 discard:
-	UDP6_INC_STATS_BH(UdpInErrors);
+	UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
 	kfree_skb(skb);
 	return(0);	
 }
@@ -988,7 +839,7 @@
 out:
 	fl6_sock_release(flowlabel);
 	if (!err) {
-		UDP6_INC_STATS_USER(UdpOutDatagrams);
+		UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
 		return len;
 	}
 	return err;
@@ -1174,7 +1025,7 @@
 struct proto udpv6_prot = {
 	.name =		"UDP",
 	.close =	udpv6_close,
-	.connect =	udpv6_connect,
+	.connect =	ip6_datagram_connect,
 	.disconnect =	udp_disconnect,
 	.ioctl =	udp_ioctl,
 	.destroy =	udpv6_destroy_sock,
diff -Nru a/net/irda/af_irda.c b/net/irda/af_irda.c
--- a/net/irda/af_irda.c	2004-07-27 18:24:51 -07:00
+++ b/net/irda/af_irda.c	2004-07-27 18:24:51 -07:00
@@ -1266,7 +1266,7 @@
 	unsigned char *asmptr;
 	int err;
 
-	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
+	IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
 
 	/* Note : socket.c set MSG_EOR on SEQPACKET sockets */
 	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
@@ -1295,7 +1295,7 @@
 
 	/* Check that we don't send out to big frames */
 	if (len > self->max_data_size) {
-		IRDA_DEBUG(2, "%s(), Chopping frame from %d to %d bytes!\n",
+		IRDA_DEBUG(2, "%s(), Chopping frame from %zd to %d bytes!\n",
 			   __FUNCTION__, len, self->max_data_size);
 		len = self->max_data_size;
 	}
@@ -1355,7 +1355,7 @@
 	copied     = skb->len;
 
 	if (copied > size) {
-		IRDA_DEBUG(2, "%s(), Received truncated frame (%d < %d)!\n",
+		IRDA_DEBUG(2, "%s(), Received truncated frame (%zd < %zd)!\n",
 			   __FUNCTION__, copied, size);
 		copied = size;
 		msg->msg_flags |= MSG_TRUNC;
@@ -1519,7 +1519,7 @@
 	unsigned char *asmptr;
 	int err;
 
-	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
+	IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
 
 	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
 		return -EINVAL;
@@ -1541,7 +1541,7 @@
 	 */
 	if (len > self->max_data_size) {
 		IRDA_DEBUG(0, "%s(), Warning to much data! "
-			   "Chopping frame from %d to %d bytes!\n",
+			   "Chopping frame from %zd to %d bytes!\n",
 			   __FUNCTION__, len, self->max_data_size);
 		len = self->max_data_size;
 	}
@@ -1591,7 +1591,7 @@
 	unsigned char *asmptr;
 	int err;
 
-	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
+	IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
 
 	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
 		return -EINVAL;
@@ -1637,7 +1637,7 @@
 	 */
 	if (len > self->max_data_size) {
 		IRDA_DEBUG(0, "%s(), Warning to much data! "
-			   "Chopping frame from %d to %d bytes!\n",
+			   "Chopping frame from %zd to %d bytes!\n",
 			   __FUNCTION__, len, self->max_data_size);
 		len = self->max_data_size;
 	}
diff -Nru a/net/sched/Kconfig b/net/sched/Kconfig
--- a/net/sched/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/net/sched/Kconfig	2004-07-27 18:24:52 -07:00
@@ -1,6 +1,61 @@
 #
 # Traffic control configuration.
 # 
+choice
+	prompt "Packet scheduler clock source"
+	depends on NET_SCHED
+	default NET_SCH_CLK_JIFFIES
+	help
+	  Packet schedulers need a monotonic clock that increments at a static
+	  rate. The kernel provides several suitable interfaces, each with
+	  different properties:
+	  
+	  - high resolution (us or better)
+	  - fast to read (minimal locking, no i/o access)
+	  - synchronized on all processors
+	  - handles cpu clock frequency changes
+
+	  but nothing provides all of the above.
+
+config NET_SCH_CLK_JIFFIES
+	bool "Timer interrupt"
+	help
+	  Say Y here if you want to use the timer interrupt (jiffies) as clock
+	  source. This clock source is fast, synchronized on all processors and
+	  handles cpu clock frequency changes, but its resolution is too low
+	  for accurate shaping except at very low speed.
+
+config NET_SCH_CLK_GETTIMEOFDAY
+	bool "gettimeofday"
+	help
+	  Say Y here if you want to use gettimeofday as clock source. This clock
+	  source has high resolution, is synchronized on all processors and
+	  handles cpu clock frequency changes, but it is slow.
+
+	  Choose this if you need a high resolution clock source but can't use
+	  the CPU's cycle counter.
+
+config NET_SCH_CLK_CPU
+	bool "CPU cycle counter"
+	depends on X86_TSC || X86_64 || ALPHA || SPARC64 || PPC64 || IA64
+	help
+	  Say Y here if you want to use the CPU's cycle counter as clock source.
+	  This is a cheap and high resolution clock source, but on some
+	  architectures it is not synchronized on all processors and doesn't
+	  handle cpu clock frequency changes.
+
+	  The useable cycle counters are:
+
+	  	x86/x86_64	- Timestamp Counter
+		alpha		- Cycle Counter
+		sparc64		- %ticks register
+		ppc64		- Time base
+		ia64		- Interval Time Counter
+
+	  Choose this if your CPU's cycle counter is working properly.
+
+endchoice
+
 config NET_SCH_CBQ
 	tristate "CBQ packet scheduler"
 	depends on NET_SCHED
diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c
--- a/net/sched/sch_api.c	2004-07-27 18:24:51 -07:00
+++ b/net/sched/sch_api.c	2004-07-27 18:24:51 -07:00
@@ -1088,7 +1088,7 @@
 };	
 #endif
 
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
 int psched_tod_diff(int delta_sec, int bound)
 {
 	int delta;
@@ -1103,42 +1103,34 @@
 EXPORT_SYMBOL(psched_tod_diff);
 #endif
 
-psched_time_t psched_time_base;
-
-#if PSCHED_CLOCK_SOURCE == PSCHED_CPU
+#ifdef CONFIG_NET_SCH_CLK_CPU
 psched_tdiff_t psched_clock_per_hz;
 int psched_clock_scale;
 EXPORT_SYMBOL(psched_clock_per_hz);
 EXPORT_SYMBOL(psched_clock_scale);
-#endif
 
-#ifdef PSCHED_WATCHER
-PSCHED_WATCHER psched_time_mark;
+psched_time_t psched_time_base;
+cycles_t psched_time_mark;
 EXPORT_SYMBOL(psched_time_mark);
 EXPORT_SYMBOL(psched_time_base);
 
+/*
+ * Periodically adjust psched_time_base to avoid overflow
+ * with 32-bit get_cycles(). Safe up to 4GHz CPU.
+ */
 static void psched_tick(unsigned long);
-
 static struct timer_list psched_timer = TIMER_INITIALIZER(psched_tick, 0, 0);
 
 static void psched_tick(unsigned long dummy)
 {
-#if PSCHED_CLOCK_SOURCE == PSCHED_CPU
-	psched_time_t dummy_stamp;
-	PSCHED_GET_TIME(dummy_stamp);
-	/* It is OK up to 4GHz cpu */
-	psched_timer.expires = jiffies + 1*HZ;
-#else
-	unsigned long now = jiffies;
-	psched_time_base += ((u64)(now-psched_time_mark))<<PSCHED_JSCALE;
-	psched_time_mark = now;
-	psched_timer.expires = now + 60*60*HZ;
-#endif
-	add_timer(&psched_timer);
+	if (sizeof(cycles_t) == sizeof(u32)) {
+		psched_time_t dummy_stamp;
+		PSCHED_GET_TIME(dummy_stamp);
+		psched_timer.expires = jiffies + 1*HZ;
+		add_timer(&psched_timer);
+	}
 }
-#endif
 
-#if PSCHED_CLOCK_SOURCE == PSCHED_CPU
 int __init psched_calibrate_clock(void)
 {
 	psched_time_t stamp, stamp1;
@@ -1147,9 +1139,7 @@
 	long rdelay;
 	unsigned long stop;
 
-#ifdef PSCHED_WATCHER
 	psched_tick(0);
-#endif
 	stop = jiffies + HZ/10;
 	PSCHED_GET_TIME(stamp);
 	do_gettimeofday(&tv);
@@ -1179,15 +1169,12 @@
 {
 	struct rtnetlink_link *link_p;
 
-#if PSCHED_CLOCK_SOURCE == PSCHED_CPU
+#ifdef CONFIG_NET_SCH_CLK_CPU
 	if (psched_calibrate_clock() < 0)
 		return -1;
-#elif PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES
+#elif defined(CONFIG_NET_SCH_CLK_JIFFIES)
 	psched_tick_per_us = HZ<<PSCHED_JSCALE;
 	psched_us_per_tick = 1000000;
-#ifdef PSCHED_WATCHER
-	psched_tick(0);
-#endif
 #endif
 
 	link_p = rtnetlink_links[PF_UNSPEC];
diff -Nru a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
--- a/net/sched/sch_hfsc.c	2004-07-27 18:24:51 -07:00
+++ b/net/sched/sch_hfsc.c	2004-07-27 18:24:51 -07:00
@@ -193,7 +193,7 @@
 /*
  * macros
  */
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
 #include <linux/time.h>
 #undef PSCHED_GET_TIME
 #define PSCHED_GET_TIME(stamp)						\
@@ -429,10 +429,10 @@
  *	ism: (psched_us/byte) << ISM_SHIFT
  *	dx: psched_us
  *
- * Time source resolution
- *  PSCHED_JIFFIES: for 48<=HZ<=1534 resolution is between 0.63us and 1.27us.
- *  PSCHED_CPU: resolution is between 0.5us and 1us.
- *  PSCHED_GETTIMEOFDAY: resolution is exactly 1us.
+ * Clock source resolution (CONFIG_NET_SCH_CLK_*)
+ *  JIFFIES: for 48<=HZ<=1534 resolution is between 0.63us and 1.27us.
+ *  CPU: resolution is between 0.5us and 1us.
+ *  GETTIMEOFDAY: resolution is exactly 1us.
  *
  * sm and ism are scaled in order to keep effective digits.
  * SM_SHIFT and ISM_SHIFT are selected to keep at least 4 effective
diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c
--- a/net/sched/sch_htb.c	2004-07-27 18:24:52 -07:00
+++ b/net/sched/sch_htb.c	2004-07-27 18:24:52 -07:00
@@ -856,8 +856,13 @@
 			if (net_ratelimit())
 				printk(KERN_ERR "HTB: bad diff in charge, cl=%X diff=%lX now=%Lu then=%Lu j=%lu\n",
 				       cl->classid, diff,
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
+				       q->now.tv_sec * 1000000ULL + q->now.tv_usec,
+				       cl->t_c.tv_sec * 1000000ULL + cl->t_c.tv_usec,
+#else
 				       (unsigned long long) q->now,
 				       (unsigned long long) cl->t_c,
+#endif
 				       q->jiffies);
 			diff = 1000;
 		}
@@ -927,8 +932,13 @@
 			if (net_ratelimit())
 				printk(KERN_ERR "HTB: bad diff in events, cl=%X diff=%lX now=%Lu then=%Lu j=%lu\n",
 				       cl->classid, diff,
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
+				       q->now.tv_sec * 1000000ULL + q->now.tv_usec,
+				       cl->t_c.tv_sec * 1000000ULL + cl->t_c.tv_usec,
+#else
 				       (unsigned long long) q->now,
 				       (unsigned long long) cl->t_c,
+#endif
 				       q->jiffies);
 			diff = 1000;
 		}
diff -Nru a/net/sched/sch_netem.c b/net/sched/sch_netem.c
--- a/net/sched/sch_netem.c	2004-07-27 18:24:52 -07:00
+++ b/net/sched/sch_netem.c	2004-07-27 18:24:52 -07:00
@@ -643,11 +643,17 @@
 	PSCHED_TADD2(now, delay, cb->time_to_send);
 	
 	/* Always queue at tail to keep packets in order */
-	__skb_queue_tail(&q->delayed, skb);
-	sch->q.qlen++;
-	sch->stats.bytes += skb->len;
-	sch->stats.packets++;
-	return 0;
+	if (likely(q->delayed.qlen < q->limit)) {
+		__skb_queue_tail(&q->delayed, skb);
+		sch->q.qlen++;
+		sch->stats.bytes += skb->len;
+		sch->stats.packets++;
+		return 0;
+	}
+
+	sch->stats.drops++;
+	kfree_skb(skb);
+	return NET_XMIT_DROP;
 }
 
 /* Requeue packets but don't change time stamp */
@@ -806,6 +812,9 @@
 	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
 
 	del_timer_sync(&q->timer);
+
+	qdisc_destroy(q->qdisc);
+	q->qdisc = &noop_qdisc;
 }
 
 static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
@@ -829,8 +838,95 @@
 	return -1;
 }
 
+static int netem_dump_class(struct Qdisc *sch, unsigned long cl,
+			  struct sk_buff *skb, struct tcmsg *tcm)
+{
+	struct netem_sched_data *q = (struct netem_sched_data*)sch->data;
+
+	if (cl != 1) 	/* only one class */
+		return -ENOENT;
+
+	tcm->tcm_handle |= TC_H_MIN(1);
+	tcm->tcm_info = q->qdisc->handle;
+
+	return 0;
+}
+
+static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
+		     struct Qdisc **old)
+{
+	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+
+	if (new == NULL)
+		new = &noop_qdisc;
+
+	sch_tree_lock(sch);
+	*old = xchg(&q->qdisc, new);
+	qdisc_reset(*old);
+	sch->q.qlen = 0;
+	sch_tree_unlock(sch);
+
+	return 0;
+}
+
+static struct Qdisc *netem_leaf(struct Qdisc *sch, unsigned long arg)
+{
+	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	return q->qdisc;
+}
+
+static unsigned long netem_get(struct Qdisc *sch, u32 classid)
+{
+	return 1;
+}
+
+static void netem_put(struct Qdisc *sch, unsigned long arg)
+{
+}
+
+static int netem_change_class(struct Qdisc *sch, u32 classid, u32 parentid, 
+			    struct rtattr **tca, unsigned long *arg)
+{
+	return -ENOSYS;
+}
+
+static int netem_delete(struct Qdisc *sch, unsigned long arg)
+{
+	return -ENOSYS;
+}
+
+static void netem_walk(struct Qdisc *sch, struct qdisc_walker *walker)
+{
+	if (!walker->stop) {
+		if (walker->count >= walker->skip)
+			if (walker->fn(sch, 1, walker) < 0) {
+				walker->stop = 1;
+				return;
+			}
+		walker->count++;
+	}
+}
+
+static struct tcf_proto **netem_find_tcf(struct Qdisc *sch, unsigned long cl)
+{
+	return NULL;
+}
+
+static struct Qdisc_class_ops netem_class_ops = {
+	.graft		=	netem_graft,
+	.leaf		=	netem_leaf,
+	.get		=	netem_get,
+	.put		=	netem_put,
+	.change		=	netem_change_class,
+	.delete		=	netem_delete,
+	.walk		=	netem_walk,
+	.tcf_chain	=	netem_find_tcf,
+	.dump		=	netem_dump_class,
+};
+
 static struct Qdisc_ops netem_qdisc_ops = {
 	.id		=	"netem",
+	.cl_ops		=	&netem_class_ops,
 	.priv_size	=	sizeof(struct netem_sched_data),
 	.enqueue	=	netem_enqueue,
 	.dequeue	=	netem_dequeue,
diff -Nru a/net/sctp/associola.c b/net/sctp/associola.c
--- a/net/sctp/associola.c	2004-07-27 18:24:51 -07:00
+++ b/net/sctp/associola.c	2004-07-27 18:24:51 -07:00
@@ -879,7 +879,7 @@
 		if (sctp_chunk_is_data(chunk))
 			asoc->peer.last_data_from = chunk->transport;
 		else
-			SCTP_INC_STATS(SctpInCtrlChunks);
+			SCTP_INC_STATS(SCTP_MIB_INCTRLCHUNKS);
 
 		if (chunk->transport)
 			chunk->transport->last_time_heard = jiffies;
@@ -1093,6 +1093,7 @@
 	case SCTP_STATE_ESTABLISHED:
 	case SCTP_STATE_SHUTDOWN_PENDING:
 	case SCTP_STATE_SHUTDOWN_RECEIVED:
+	case SCTP_STATE_SHUTDOWN_SENT:
 		if ((asoc->rwnd > asoc->a_rwnd) &&
 		    ((asoc->rwnd - asoc->a_rwnd) >=
 		     min_t(__u32, (asoc->base.sk->sk_rcvbuf >> 1), asoc->pmtu)))
diff -Nru a/net/sctp/chunk.c b/net/sctp/chunk.c
--- a/net/sctp/chunk.c	2004-07-27 18:24:52 -07:00
+++ b/net/sctp/chunk.c	2004-07-27 18:24:52 -07:00
@@ -215,7 +215,7 @@
 	offset = 0;
 
 	if ((whole > 1) || (whole && over))
-		SCTP_INC_STATS_USER(SctpFragUsrMsgs);
+		SCTP_INC_STATS_USER(SCTP_MIB_FRAGUSRMSGS);
 
 	/* Create chunks for all the full sized DATA chunks. */
 	for (i=0, len=first_len; i < whole; i++) {
diff -Nru a/net/sctp/endpointola.c b/net/sctp/endpointola.c
--- a/net/sctp/endpointola.c	2004-07-27 18:24:51 -07:00
+++ b/net/sctp/endpointola.c	2004-07-27 18:24:51 -07:00
@@ -369,7 +369,7 @@
 		if (asoc && sctp_chunk_is_data(chunk))
 			asoc->peer.last_data_from = chunk->transport;
 		else
-			SCTP_INC_STATS(SctpInCtrlChunks);
+			SCTP_INC_STATS(SCTP_MIB_INCTRLCHUNKS);
 
 		if (chunk->transport)
 			chunk->transport->last_time_heard = jiffies;
diff -Nru a/net/sctp/input.c b/net/sctp/input.c
--- a/net/sctp/input.c	2004-07-27 18:24:51 -07:00
+++ b/net/sctp/input.c	2004-07-27 18:24:51 -07:00
@@ -90,7 +90,7 @@
 
 	if (val != cmp) {
 		/* CRC failure, dump it. */
-		SCTP_INC_STATS_BH(SctpChecksumErrors);
+		SCTP_INC_STATS_BH(SCTP_MIB_CHECKSUMERRORS);
 		return -1;
 	}
 	return 0;
@@ -117,7 +117,7 @@
 	if (skb->pkt_type!=PACKET_HOST)
 		goto discard_it;
 
-	SCTP_INC_STATS_BH(SctpInSCTPPacks);
+	SCTP_INC_STATS_BH(SCTP_MIB_INSCTPPACKS);
 
 	sh = (struct sctphdr *) skb->h.raw;
 
@@ -166,7 +166,7 @@
 	if (!asoc) {
 		ep = __sctp_rcv_lookup_endpoint(&dest);
 		if (sctp_rcv_ootb(skb)) {
-			SCTP_INC_STATS_BH(SctpOutOfBlues);
+			SCTP_INC_STATS_BH(SCTP_MIB_OUTOFBLUES);
 			goto discard_release;
 		}
 	}
@@ -327,7 +327,7 @@
 
 	if (asoc) {
 		if (ntohl(sctphdr->vtag) != asoc->c.peer_vtag) {
-			ICMP_INC_STATS_BH(IcmpInErrors);
+			ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 			goto out;
 		}
 		sk = asoc->base.sk;
@@ -340,7 +340,7 @@
 	 * servers this needs to be solved differently.
 	 */
 	if (sock_owned_by_user(sk))
-		NET_INC_STATS_BH(LockDroppedIcmps);
+		NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
 
 	*epp = ep;
 	*app = asoc;
@@ -398,7 +398,7 @@
 	int err;
 
 	if (skb->len < ((iph->ihl << 2) + 8)) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 
@@ -412,7 +412,7 @@
 	skb->nh.raw = saveip;
 	skb->h.raw = savesctp;
 	if (!sk) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 	/* Warning:  The sock lock is held.  Remember to call
diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c
--- a/net/sctp/ipv6.c	2004-07-27 18:24:52 -07:00
+++ b/net/sctp/ipv6.c	2004-07-27 18:24:52 -07:00
@@ -107,7 +107,7 @@
 	skb->nh.raw = saveip;
 	skb->h.raw = savesctp;
 	if (!sk) {
-		ICMP6_INC_STATS_BH(idev, Icmp6InErrors);
+		ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INERRORS);
 		goto out;
 	}
 
@@ -177,7 +177,7 @@
 			  __FUNCTION__, skb, skb->len,
 			  NIP6(fl.fl6_src), NIP6(fl.fl6_dst));
 
-	SCTP_INC_STATS(SctpOutSCTPPacks);
+	SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
 
 	return ip6_xmit(sk, skb, &fl, np->opt, ipfragok);
 }
diff -Nru a/net/sctp/output.c b/net/sctp/output.c
--- a/net/sctp/output.c	2004-07-27 18:24:51 -07:00
+++ b/net/sctp/output.c	2004-07-27 18:24:51 -07:00
@@ -496,7 +496,7 @@
 	return err;
 no_route:
 	kfree_skb(nskb);
-	IP_INC_STATS_BH(OutNoRoutes);
+	IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
 
 	/* FIXME: Returning the 'err' will effect all the associations
 	 * associated with a socket, although only one of the paths of the
diff -Nru a/net/sctp/outqueue.c b/net/sctp/outqueue.c
--- a/net/sctp/outqueue.c	2004-07-27 18:24:51 -07:00
+++ b/net/sctp/outqueue.c	2004-07-27 18:24:51 -07:00
@@ -349,15 +349,15 @@
 
 			sctp_outq_tail_data(q, chunk);
 			if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
-				SCTP_INC_STATS(SctpOutUnorderChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTUNORDERCHUNKS);
 			else
-				SCTP_INC_STATS(SctpOutOrderChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTORDERCHUNKS);
 			q->empty = 0;
 			break;
 		};
 	} else {
 		__skb_queue_tail(&q->control, (struct sk_buff *) chunk);
-		SCTP_INC_STATS(SctpOutCtrlChunks);
+		SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 	}
 
 	if (error < 0)
@@ -525,10 +525,10 @@
 			       int rtx_timeout, int *start_timer)
 {
 	struct list_head *lqueue;
-	struct list_head *lchunk;
+	struct list_head *lchunk, *lchunk1;
 	struct sctp_transport *transport = pkt->transport;
 	sctp_xmit_t status;
-	struct sctp_chunk *chunk;
+	struct sctp_chunk *chunk, *chunk1;
 	struct sctp_association *asoc;
 	int error = 0;
 
@@ -615,6 +615,12 @@
 			 * the transmitted list.
 			 */
 			list_add_tail(lchunk, &transport->transmitted);
+
+			/* Mark the chunk as ineligible for fast retransmit 
+			 * after it is retransmitted.
+			 */
+			chunk->fast_retransmit = 0;
+
 			*start_timer = 1;
 			q->empty = 0;
 
@@ -622,6 +628,18 @@
 			lchunk = sctp_list_dequeue(lqueue);
 			break;
 		};
+
+		/* If we are here due to a retransmit timeout or a fast
+		 * retransmit and if there are any chunks left in the retransmit
+		 * queue that could not fit in the PMTU sized packet, they need			 * to be marked as ineligible for a subsequent fast retransmit.
+		 */
+		if (rtx_timeout && !lchunk) {
+			list_for_each(lchunk1, lqueue) {
+				chunk1 = list_entry(lchunk1, struct sctp_chunk,
+						    transmitted_list);
+				chunk1->fast_retransmit = 0;
+			}
+		}
 	}
 
 	return error;
@@ -1725,6 +1743,6 @@
 
 	if (ftsn_chunk) {
 		__skb_queue_tail(&q->control, (struct sk_buff *)ftsn_chunk);
-		SCTP_INC_STATS(SctpOutCtrlChunks);
+		SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 	}
 }
diff -Nru a/net/sctp/proc.c b/net/sctp/proc.c
--- a/net/sctp/proc.c	2004-07-27 18:24:51 -07:00
+++ b/net/sctp/proc.c	2004-07-27 18:24:51 -07:00
@@ -39,26 +39,24 @@
 #include <linux/init.h>
 #include <net/sctp/sctp.h>
 
-static char *sctp_snmp_list[] = {
-#define SCTP_SNMP_ENTRY(x) #x 
-	SCTP_SNMP_ENTRY(SctpCurrEstab),
-	SCTP_SNMP_ENTRY(SctpActiveEstabs),
-	SCTP_SNMP_ENTRY(SctpPassiveEstabs),
-	SCTP_SNMP_ENTRY(SctpAborteds),
-	SCTP_SNMP_ENTRY(SctpShutdowns),
-	SCTP_SNMP_ENTRY(SctpOutOfBlues),
-	SCTP_SNMP_ENTRY(SctpChecksumErrors),
-	SCTP_SNMP_ENTRY(SctpOutCtrlChunks),
-	SCTP_SNMP_ENTRY(SctpOutOrderChunks),
-	SCTP_SNMP_ENTRY(SctpOutUnorderChunks),
-	SCTP_SNMP_ENTRY(SctpInCtrlChunks),
-	SCTP_SNMP_ENTRY(SctpInOrderChunks),
-	SCTP_SNMP_ENTRY(SctpInUnorderChunks),
-	SCTP_SNMP_ENTRY(SctpFragUsrMsgs),
-	SCTP_SNMP_ENTRY(SctpReasmUsrMsgs),
-	SCTP_SNMP_ENTRY(SctpOutSCTPPacks),
-	SCTP_SNMP_ENTRY(SctpInSCTPPacks),
-#undef SCTP_SNMP_ENTRY
+struct snmp_mib sctp_snmp_list[] = {
+	SNMP_MIB_ITEM("SctpCurrEstab", SCTP_MIB_CURRESTAB),
+	SNMP_MIB_ITEM("SctpActiveEstabs", SCTP_MIB_ACTIVEESTABS),
+	SNMP_MIB_ITEM("SctpPassiveEstabs", SCTP_MIB_PASSIVEESTABS),
+	SNMP_MIB_ITEM("SctpAborteds", SCTP_MIB_ABORTEDS),
+	SNMP_MIB_ITEM("SctpShutdowns", SCTP_MIB_SHUTDOWNS),
+	SNMP_MIB_ITEM("SctpOutOfBlues", SCTP_MIB_OUTOFBLUES),
+	SNMP_MIB_ITEM("SctpChecksumErrors", SCTP_MIB_CHECKSUMERRORS),
+	SNMP_MIB_ITEM("SctpOutCtrlChunks", SCTP_MIB_OUTCTRLCHUNKS),
+	SNMP_MIB_ITEM("SctpOutOrderChunks", SCTP_MIB_OUTORDERCHUNKS),
+	SNMP_MIB_ITEM("SctpOutUnorderChunks", SCTP_MIB_OUTUNORDERCHUNKS),
+	SNMP_MIB_ITEM("SctpInCtrlChunks", SCTP_MIB_INCTRLCHUNKS),
+	SNMP_MIB_ITEM("SctpInOrderChunks", SCTP_MIB_INORDERCHUNKS),
+	SNMP_MIB_ITEM("SctpInUnorderChunks", SCTP_MIB_INUNORDERCHUNKS),
+	SNMP_MIB_ITEM("SctpFragUsrMsgs", SCTP_MIB_FRAGUSRMSGS),
+	SNMP_MIB_ITEM("SctpReasmUsrMsgs", SCTP_MIB_REASMUSRMSGS),
+	SNMP_MIB_ITEM("SctpOutSCTPPacks", SCTP_MIB_OUTSCTPPACKS),
+	SNMP_MIB_ITEM("SctpInSCTPPacks", SCTP_MIB_INSCTPPACKS),
 };
 
 /* Return the current value of a particular entry in the mib by adding its
@@ -88,9 +86,10 @@
 {
 	int i;
 
-	for (i = 0; i < sizeof(sctp_snmp_list) / sizeof(char *); i++)
-		seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i],
-			   fold_field((void **)sctp_statistics, i));
+	for (i = 0; sctp_snmp_list[i].name != NULL; i++)
+		seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name,
+			   fold_field((void **)sctp_statistics, 
+				      sctp_snmp_list[i].entry));
 
 	return 0;
 }
diff -Nru a/net/sctp/protocol.c b/net/sctp/protocol.c
--- a/net/sctp/protocol.c	2004-07-27 18:24:52 -07:00
+++ b/net/sctp/protocol.c	2004-07-27 18:24:52 -07:00
@@ -808,7 +808,7 @@
 			  NIPQUAD(((struct rtable *)skb->dst)->rt_src),
 			  NIPQUAD(((struct rtable *)skb->dst)->rt_dst));
 
-	SCTP_INC_STATS(SctpOutSCTPPacks);
+	SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
 	return ip_queue_xmit(skb, ipfragok);
 }
 
diff -Nru a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
--- a/net/sctp/sm_make_chunk.c	2004-07-27 18:24:51 -07:00
+++ b/net/sctp/sm_make_chunk.c	2004-07-27 18:24:51 -07:00
@@ -1846,9 +1846,8 @@
 		if (unlikely(!idr_pre_get(&sctp_assocs_id, gfp)))
 			goto clean_up;
 		spin_lock_bh(&sctp_assocs_id_lock);
-		error = idr_get_new(&sctp_assocs_id,
-				    (void *)asoc,
-				    &assoc_id);
+		error = idr_get_new_above(&sctp_assocs_id, (void *)asoc, 1,
+					  &assoc_id);
 		spin_unlock_bh(&sctp_assocs_id_lock);
 		if (error == -EAGAIN)
 			goto retry;
diff -Nru a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
--- a/net/sctp/sm_sideeffect.c	2004-07-27 18:24:52 -07:00
+++ b/net/sctp/sm_sideeffect.c	2004-07-27 18:24:52 -07:00
@@ -529,6 +529,23 @@
 	}
 }
 
+/* Helper function to stop any pending T3-RTX timers */
+static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds,
+				        struct sctp_association *asoc)
+{
+	struct sctp_transport *t;
+	struct list_head *pos;
+
+	list_for_each(pos, &asoc->peer.transport_addr_list) {
+		t = list_entry(pos, struct sctp_transport, transports);
+		if (timer_pending(&t->T3_rtx_timer) &&
+		    del_timer(&t->T3_rtx_timer)) {
+			sctp_transport_put(t);
+		}
+	}
+}
+
+
 /* Helper function to update the heartbeat timer. */
 static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds,
 				     struct sctp_association *asoc,
@@ -749,6 +766,26 @@
 	return;
 }
 
+/* Helper function to remove the association non-primary peer 
+ * transports.
+ */ 
+static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
+{
+	struct sctp_transport *t;
+	struct list_head *pos;
+	struct list_head *temp;
+
+	list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
+		t = list_entry(pos, struct sctp_transport, transports);
+		if (!sctp_cmp_addr_exact(&t->ipaddr,
+		                         &asoc->peer.primary_addr)) {
+			sctp_assoc_del_peer(asoc, &t->ipaddr);
+		}
+	}
+
+	return;
+}
+
 /* These three macros allow us to pull the debugging code out of the
  * main flow of sctp_do_sm() to keep attention focused on the real
  * functionality there.
@@ -1048,6 +1085,27 @@
 			if (cmd->obj.ptr)
 				sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
 						SCTP_CHUNK(cmd->obj.ptr));
+
+			/* FIXME - Eventually come up with a cleaner way to
+			 * enabling COOKIE-ECHO + DATA bundling during 
+			 * multihoming stale cookie scenarios, the following 
+			 * command plays with asoc->peer.retran_path to 
+			 * avoid the problem of sending the COOKIE-ECHO and 
+			 * DATA in different paths, which could result 
+			 * in the association being ABORTed if the DATA chunk 
+			 * is processed first by the server.  Checking the
+			 * init error counter simply causes this command
+			 * to be executed only during failed attempts of
+			 * association establishment.
+			 */
+			if ((asoc->peer.retran_path != 
+			     asoc->peer.primary_path) && 
+			    (asoc->counters[SCTP_COUNTER_INIT_ERROR] > 0)) {
+				sctp_add_cmd_sf(commands, 
+				                SCTP_CMD_FORCE_PRIM_RETRAN,
+						SCTP_NULL());
+			}
+
 			break;
 
 		case SCTP_CMD_GEN_SHUTDOWN:
@@ -1281,6 +1339,19 @@
 			break;
 		case SCTP_CMD_CLEAR_INIT_TAG:
 			asoc->peer.i.init_tag = 0;
+			break;
+		case SCTP_CMD_DEL_NON_PRIMARY:
+			sctp_cmd_del_non_primary(asoc);
+			break;
+		case SCTP_CMD_T3_RTX_TIMERS_STOP:
+			sctp_cmd_t3_rtx_timers_stop(commands, asoc);
+			break;
+		case SCTP_CMD_FORCE_PRIM_RETRAN:
+			t = asoc->peer.retran_path;
+			asoc->peer.retran_path = asoc->peer.primary_path;
+			error = sctp_outq_uncork(&asoc->outqueue);
+			local_cork = 0;
+			asoc->peer.retran_path = t;
 			break;
 		default:
 			printk(KERN_WARNING "Impossible command: %u, %p\n",
diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
--- a/net/sctp/sm_statefuns.c	2004-07-27 18:24:51 -07:00
+++ b/net/sctp/sm_statefuns.c	2004-07-27 18:24:51 -07:00
@@ -148,8 +148,8 @@
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
 
-	SCTP_INC_STATS(SctpShutdowns);
-	SCTP_DEC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_SHUTDOWNS);
+	SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 
 	sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
 
@@ -245,7 +245,7 @@
 			if (packet) {
 				sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 						SCTP_PACKET(packet));
-				SCTP_INC_STATS(SctpOutCtrlChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 				return SCTP_DISPOSITION_CONSUME;
 			} else {
 				return SCTP_DISPOSITION_NOMEM;
@@ -404,7 +404,7 @@
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply));
 		sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 				SCTP_STATE(SCTP_STATE_CLOSED));
-		SCTP_INC_STATS(SctpAborteds);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
 		sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
 		return SCTP_DISPOSITION_DELETE_TCB;
 	}
@@ -415,7 +415,7 @@
 			      (sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
 			      &err_chunk)) {
 
-		SCTP_INC_STATS(SctpAborteds);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
 
 		/* This chunk contains fatal error. It is to be discarded.
 		 * Send an ABORT, with causes if there is any.
@@ -432,7 +432,7 @@
 			if (packet) {
 				sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 						SCTP_PACKET(packet));
-				SCTP_INC_STATS(SctpOutCtrlChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 				sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 						SCTP_STATE(SCTP_STATE_CLOSED));
 				sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB,
@@ -472,8 +472,6 @@
 	 */
 	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
-	sctp_add_cmd_sf(commands, SCTP_CMD_COUNTER_RESET,
-			SCTP_COUNTER(SCTP_COUNTER_INIT_ERROR));
 	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
@@ -587,8 +585,8 @@
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_ESTABLISHED));
-	SCTP_INC_STATS(SctpCurrEstab);
-	SCTP_INC_STATS(SctpPassiveEstabs);
+	SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
+	SCTP_INC_STATS(SCTP_MIB_PASSIVEESTABS);
 	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_START, SCTP_NULL());
 
 	if (new_asoc->autoclose)
@@ -674,6 +672,15 @@
 	if (!sctp_vtag_verify(chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
+	/* Reset init error count upon receipt of COOKIE-ACK,
+	 * to avoid problems with the managemement of this
+	 * counter in stale cookie situations when a transition back
+	 * from the COOKIE-ECHOED state to the COOKIE-WAIT
+	 * state is performed.
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_COUNTER_RESET,
+	                SCTP_COUNTER(SCTP_COUNTER_INIT_ERROR));
+
 	/* RFC 2960 5.1 Normal Establishment of an Association
 	 *
 	 * E) Upon reception of the COOKIE ACK, endpoint "A" will move
@@ -684,8 +691,8 @@
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_ESTABLISHED));
-	SCTP_INC_STATS(SctpCurrEstab);
-	SCTP_INC_STATS(SctpActiveEstabs);
+	SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
+	SCTP_INC_STATS(SCTP_MIB_ACTIVEESTABS);
 	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_START, SCTP_NULL());
 	if (asoc->autoclose)
 		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START,
@@ -757,8 +764,8 @@
 		/* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_NO_ERROR));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_DELETE_TCB;
 	}
 
@@ -960,7 +967,7 @@
 		goto out;
 	sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT, SCTP_PACKET(pkt));
 
-	SCTP_INC_STATS(SctpOutCtrlChunks);
+	SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 
 	/* Discard the rest of the inbound packet. */
 	sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
@@ -1163,7 +1170,7 @@
 			if (packet) {
 				sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 						SCTP_PACKET(packet));
-				SCTP_INC_STATS(SctpOutCtrlChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 				retval = SCTP_DISPOSITION_CONSUME;
 			} else {
 				retval = SCTP_DISPOSITION_NOMEM;
@@ -1501,7 +1508,7 @@
 	sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_ESTABLISHED));
-	SCTP_INC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
 	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_START, SCTP_NULL());
 
 	repl = sctp_make_cookie_ack(new_asoc, chunk);
@@ -1585,7 +1592,7 @@
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE));
 		sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 				SCTP_STATE(SCTP_STATE_ESTABLISHED));
-		SCTP_INC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
 		sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_START,
 				SCTP_NULL());
 
@@ -1872,8 +1879,6 @@
 	time_t stale;
 	sctp_cookie_preserve_param_t bht;
 	sctp_errhdr_t *err;
-	struct list_head *pos;
-	struct sctp_transport *t;
 	struct sctp_chunk *reply;
 	struct sctp_bind_addr *bp;
 	int attempts;
@@ -1920,20 +1925,27 @@
 	/* Clear peer's init_tag cached in assoc as we are sending a new INIT */
 	sctp_add_cmd_sf(commands, SCTP_CMD_CLEAR_INIT_TAG, SCTP_NULL());
 
+	/* Stop pending T3-rtx and heartbeat timers */
+	sctp_add_cmd_sf(commands, SCTP_CMD_T3_RTX_TIMERS_STOP, SCTP_NULL());
+	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_STOP, SCTP_NULL());
+
+	/* Delete non-primary peer ip addresses since we are transitioning
+	 * back to the COOKIE-WAIT state
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_DEL_NON_PRIMARY, SCTP_NULL());
+
+	/* If we've sent any data bundled with COOKIE-ECHO we will need to 
+	 * resend 
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, 
+			SCTP_TRANSPORT(asoc->peer.primary_path));
+
 	/* Cast away the const modifier, as we want to just
 	 * rerun it through as a sideffect.
 	 */
 	sctp_add_cmd_sf(commands, SCTP_CMD_COUNTER_INC,
 			SCTP_COUNTER(SCTP_COUNTER_INIT_ERROR));
 
-	/* If we've sent any data bundled with COOKIE-ECHO we need to
-	 * resend.
-	 */
-	list_for_each(pos, &asoc->peer.transport_addr_list) {
-		t = list_entry(pos, struct sctp_transport, transports);
-		sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, SCTP_TRANSPORT(t));
-	}
-
 	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
@@ -2001,8 +2013,8 @@
 
  	/* ASSOC_FAILED will DELETE_TCB. */
 	sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(error));
-	SCTP_INC_STATS(SctpAborteds);
-	SCTP_DEC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+	SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 
 	return SCTP_DISPOSITION_ABORT;
 }
@@ -2027,7 +2039,7 @@
 
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
-	SCTP_INC_STATS(SctpAborteds);
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
 	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
 
@@ -2321,12 +2333,7 @@
 					sctp_cmd_seq_t *commands)
 {
 	struct sctp_chunk *chunk = arg;
-	sctp_datahdr_t *data_hdr;
-	struct sctp_chunk *err;
-	size_t datalen;
-	sctp_verb_t deliver;
-	int tmp;
-	__u32 tsn;
+	int error;
 
 	if (!sctp_vtag_verify(chunk, asoc)) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
@@ -2334,158 +2341,22 @@
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
         }
 
-	data_hdr = chunk->subh.data_hdr = (sctp_datahdr_t *)chunk->skb->data;
-	skb_pull(chunk->skb, sizeof(sctp_datahdr_t));
-
-	tsn = ntohl(data_hdr->tsn);
-	SCTP_DEBUG_PRINTK("eat_data: TSN 0x%x.\n", tsn);
-
-	/* ASSERT:  Now skb->data is really the user data.  */
-
-	/* Process ECN based congestion.
-	 *
-	 * Since the chunk structure is reused for all chunks within
-	 * a packet, we use ecn_ce_done to track if we've already
-	 * done CE processing for this packet.
-	 *
-	 * We need to do ECN processing even if we plan to discard the
-	 * chunk later.
-	 */
-
-	if (!chunk->ecn_ce_done) {
-		struct sctp_af *af;
-		chunk->ecn_ce_done = 1;
-
-		af = sctp_get_af_specific(
-			ipver2af(chunk->skb->nh.iph->version));
-
-		if (af && af->is_ce(chunk->skb) && asoc->peer.ecn_capable) {
-			/* Do real work as sideffect. */
-			sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
-					SCTP_U32(tsn));
-		}
-	}
-
-	tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
-	if (tmp < 0) {
-		/* The TSN is too high--silently discard the chunk and
-		 * count on it getting retransmitted later.
-		 */
+	error = sctp_eat_data(asoc, chunk, commands );
+	switch (error) {
+	case SCTP_IERROR_NO_ERROR:
+		break;
+	case SCTP_IERROR_HIGH_TSN:
+	case SCTP_IERROR_BAD_STREAM:
 		goto discard_noforce;
-	} else if (tmp > 0) {
-		/* This is a duplicate.  Record it.  */
-		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_DUP, SCTP_U32(tsn));
+	case SCTP_IERROR_DUP_TSN:
+	case SCTP_IERROR_IGNORE_TSN:
 		goto discard_force;
+	case SCTP_IERROR_NO_DATA:
+		goto consume;
+	default:
+		BUG();
 	}
 
-	/* This is a new TSN.  */
-
-	/* Discard if there is no room in the receive window.
-	 * Actually, allow a little bit of overflow (up to a MTU).
-	 */
-	datalen = ntohs(chunk->chunk_hdr->length);
-	datalen -= sizeof(sctp_data_chunk_t);
-
-	deliver = SCTP_CMD_CHUNK_ULP;
-
-	/* Think about partial delivery. */
-	if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
-
-		/* Even if we don't accept this chunk there is
-		 * memory pressure.
-		 */
-		sctp_add_cmd_sf(commands, SCTP_CMD_PART_DELIVER, SCTP_NULL());
-	}
-
-        /* Spill over rwnd a little bit.  Note: While allowed, this spill over
-	 * seems a bit troublesome in that frag_point varies based on
-	 * PMTU.  In cases, such as loopback, this might be a rather
-	 * large spill over.
-	 */
-	if (!asoc->rwnd || asoc->rwnd_over ||
-	    (datalen > asoc->rwnd + asoc->frag_point)) {
-
-		/* If this is the next TSN, consider reneging to make
-		 * room.   Note: Playing nice with a confused sender.  A
-		 * malicious sender can still eat up all our buffer
-		 * space and in the future we may want to detect and
-		 * do more drastic reneging.
-		 */
-		if (sctp_tsnmap_has_gap(&asoc->peer.tsn_map) &&
-		    (sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1) == tsn) {
-			SCTP_DEBUG_PRINTK("Reneging for tsn:%u\n", tsn);
-			deliver = SCTP_CMD_RENEGE;
-		} else {
-			SCTP_DEBUG_PRINTK("Discard tsn: %u len: %Zd, "
-					  "rwnd: %d\n", tsn, datalen,
-					  asoc->rwnd);
-			goto discard_force;
-		}
-	}
-
-	/*
-	 * Section 3.3.10.9 No User Data (9)
-	 *
-	 * Cause of error
-	 * ---------------
-	 * No User Data:  This error cause is returned to the originator of a
-	 * DATA chunk if a received DATA chunk has no user data.
-	 */
-	if (unlikely(0 == datalen)) {
-		err = sctp_make_abort_no_data(asoc, chunk, tsn);
-		if (err) {
-			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
-					SCTP_CHUNK(err));
-		}
-		/* We are going to ABORT, so we might as well stop
-		 * processing the rest of the chunks in the packet.
-		 */
-		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
-		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
-				SCTP_U32(SCTP_ERROR_NO_DATA));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
-		return SCTP_DISPOSITION_CONSUME;
-	}
-
-	/* If definately accepting the DATA chunk, record its TSN, otherwise
-	 * wait for renege processing.
-	 */
-	if (SCTP_CMD_CHUNK_ULP == deliver)
-		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));
-
-	/* Note: Some chunks may get overcounted (if we drop) or overcounted
-	 * if we renege and the chunk arrives again.
-	 */
-	if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
-		SCTP_INC_STATS(SctpInUnorderChunks);
-	else
-		SCTP_INC_STATS(SctpInOrderChunks);
-
-	/* RFC 2960 6.5 Stream Identifier and Stream Sequence Number
-	 *
-	 * If an endpoint receive a DATA chunk with an invalid stream
-	 * identifier, it shall acknowledge the reception of the DATA chunk
-	 * following the normal procedure, immediately send an ERROR chunk
-	 * with cause set to "Invalid Stream Identifier" (See Section 3.3.10)
-	 * and discard the DATA chunk.
-	 */
-	if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) {
-		err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
-					 &data_hdr->stream,
-					 sizeof(data_hdr->stream));
-		if (err)
-			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
-					SCTP_CHUNK(err));
-		goto discard_noforce;
-	}
-
-	/* Send the data up to the user.  Note:  Schedule  the
-	 * SCTP_CMD_CHUNK_ULP cmd before the SCTP_CMD_GEN_SACK, as the SACK
-	 * chunk needs the updated rwnd.
-	 */
-	sctp_add_cmd_sf(commands, deliver, SCTP_CHUNK(chunk));
-
 	if (asoc->autoclose) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
 				SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE));
@@ -2551,6 +2422,9 @@
 				SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
 	}
 	return SCTP_DISPOSITION_DISCARD;
+consume:
+	return SCTP_DISPOSITION_CONSUME;
+	
 }
 
 /*
@@ -2576,11 +2450,7 @@
 				     sctp_cmd_seq_t *commands)
 {
 	struct sctp_chunk *chunk = arg;
-	sctp_datahdr_t *data_hdr;
-	struct sctp_chunk *err;
-	size_t datalen;
-	int tmp;
-	__u32 tsn;
+	int error;
 
 	if (!sctp_vtag_verify(chunk, asoc)) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
@@ -2588,110 +2458,22 @@
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 	}
 
-	data_hdr = chunk->subh.data_hdr = (sctp_datahdr_t *) chunk->skb->data;
-	skb_pull(chunk->skb, sizeof(sctp_datahdr_t));
-
-	tsn = ntohl(data_hdr->tsn);
-
-	SCTP_DEBUG_PRINTK("eat_data: TSN 0x%x.\n", tsn);
-
-	/* ASSERT:  Now skb->data is really the user data.  */
-
-	/* Process ECN based congestion.
-	 *
-	 * Since the chunk structure is reused for all chunks within
-	 * a packet, we use ecn_ce_done to track if we've already
-	 * done CE processing for this packet.
-	 *
-	 * We need to do ECN processing even if we plan to discard the
-	 * chunk later.
-	 */
-	if (!chunk->ecn_ce_done) {
-		struct sctp_af *af;
-		chunk->ecn_ce_done = 1;
-
-		af = sctp_get_af_specific(
-			ipver2af(chunk->skb->nh.iph->version));
-
-		if (af && af->is_ce(chunk->skb) && asoc->peer.ecn_capable) {
-			/* Do real work as sideffect. */
-			sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
-					SCTP_U32(tsn));
-		}
-	}
-
-	tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
-	if (tmp < 0) {
-		/* The TSN is too high--silently discard the chunk and
-		 * count on it getting retransmitted later.
-		 */
-		goto gen_shutdown;
-	} else if (tmp > 0) {
-		/* This is a duplicate.  Record it.  */
-		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_DUP, SCTP_U32(tsn));
-		goto gen_shutdown;
-	}
-
-	/* This is a new TSN.  */
-
-	datalen = ntohs(chunk->chunk_hdr->length);
-	datalen -= sizeof(sctp_data_chunk_t);
-
-	/*
-	 * Section 3.3.10.9 No User Data (9)
-	 *
-	 * Cause of error
-	 * ---------------
-	 * No User Data:  This error cause is returned to the originator of a
-	 * DATA chunk if a received DATA chunk has no user data.
-	 */
-	if (unlikely(0 == datalen)) {
-		err = sctp_make_abort_no_data(asoc, chunk, tsn);
-		if (err) {
-			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
-					SCTP_CHUNK(err));
-		}
-		/* We are going to ABORT, so we might as well stop
-		 * processing the rest of the chunks in the packet.
-		 */
-		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
-		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
-				SCTP_U32(SCTP_ERROR_NO_DATA));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
-		return SCTP_DISPOSITION_CONSUME;
-	}
-
-	/* We are accepting this DATA chunk. */
-
-	/* Record the fact that we have received this TSN.  */
-	sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));
-
-	if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
-		SCTP_INC_STATS(SctpInUnorderChunks);
-	else
-		SCTP_INC_STATS(SctpInOrderChunks);
-
-	/* RFC 2960 6.5 Stream Identifier and Stream Sequence Number
-	 *
-	 * If an endpoint receive a DATA chunk with an invalid stream
-	 * identifier, it shall acknowledge the reception of the DATA chunk
-	 * following the normal procedure, immediately send an ERROR chunk
-	 * with cause set to "Invalid Stream Identifier" (See Section 3.3.10)
-	 * and discard the DATA chunk.
-	 */
-	if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) {
-		err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
-					 &data_hdr->stream,
-					 sizeof(data_hdr->stream));
-		if (err) {
-			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
-					SCTP_CHUNK(err));
-		}
+	error = sctp_eat_data(asoc, chunk, commands );
+	switch (error) {
+	case SCTP_IERROR_NO_ERROR:
+	case SCTP_IERROR_HIGH_TSN:
+	case SCTP_IERROR_DUP_TSN:
+	case SCTP_IERROR_IGNORE_TSN:
+	case SCTP_IERROR_BAD_STREAM:
+		break;
+	case SCTP_IERROR_NO_DATA:
+		goto consume;
+	default:
+		BUG();
 	}
 
 	/* Go a head and force a SACK, since we are shutting down. */
-gen_shutdown:
+
 	/* Implementor's Guide.
 	 *
 	 * While in SHUTDOWN-SENT state, the SHUTDOWN sender MUST immediately
@@ -2707,6 +2489,8 @@
 		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN));
 	}
+
+consume:
 	return SCTP_DISPOSITION_CONSUME;
 }
 
@@ -2832,7 +2616,7 @@
 		sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 				SCTP_PACKET(packet));
 
-		SCTP_INC_STATS(SctpOutCtrlChunks);
+		SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 
 		return SCTP_DISPOSITION_CONSUME;
 	}
@@ -2929,8 +2713,8 @@
 
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
-	SCTP_INC_STATS(SctpShutdowns);
-	SCTP_DEC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_SHUTDOWNS);
+	SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 	sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply));
 
 	/* ...and remove all record of the association. */
@@ -2971,7 +2755,7 @@
 	__u8 *ch_end;
 	int ootb_shut_ack = 0;
 
-	SCTP_INC_STATS(SctpOutOfBlues);
+	SCTP_INC_STATS(SCTP_MIB_OUTOFBLUES);
 
 	ch = (sctp_chunkhdr_t *) chunk->chunk_hdr;
 	do {
@@ -3040,7 +2824,7 @@
 		sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 				SCTP_PACKET(packet));
 
-		SCTP_INC_STATS(SctpOutCtrlChunks);
+		SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 
 		return SCTP_DISPOSITION_CONSUME;
 	}
@@ -3176,8 +2960,8 @@
 		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_ASCONF_ACK));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_ABORT;
 	}
 
@@ -3202,8 +2986,8 @@
 		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_ASCONF_ACK));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_ABORT;
 	}
 
@@ -3797,8 +3581,8 @@
 	sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 			SCTP_U32(SCTP_ERROR_USER_ABORT));
 
-	SCTP_INC_STATS(SctpAborteds);
-	SCTP_DEC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+	SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 
 	return retval;
 }
@@ -3855,7 +3639,7 @@
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
 
-	SCTP_INC_STATS(SctpShutdowns);
+	SCTP_INC_STATS(SCTP_MIB_SHUTDOWNS);
 
 	sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
 
@@ -3928,7 +3712,7 @@
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
 
-	SCTP_INC_STATS(SctpAborteds);
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
 
 	/* Even if we can't send the ABORT due to low memory delete the
 	 * TCB.  This is a departure from our typical NOMEM handling.
@@ -4288,8 +4072,8 @@
 		/* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_NO_ERROR));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_DELETE_TCB;
 	}
 
@@ -4458,8 +4242,8 @@
 		/* Note:  CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_NO_ERROR));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_DELETE_TCB;
 	}
 
@@ -4532,8 +4316,8 @@
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_NO_ERROR));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_INC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_ABORT;
 	}
 
@@ -4709,7 +4493,7 @@
 	num_blocks = ntohs(sack->num_gap_ack_blocks);
 	num_dup_tsns = ntohs(sack->num_dup_tsns);
 	len = sizeof(struct sctp_sackhdr);
-	len = (num_blocks + num_dup_tsns) * sizeof(__u32);
+	len += (num_blocks + num_dup_tsns) * sizeof(__u32);
 	if (len > chunk->skb->len)
 		return NULL;
 
@@ -4843,8 +4627,176 @@
 			sctp_packet_append_chunk(packet, err_chunk);
 			sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 					SCTP_PACKET(packet));
-			SCTP_INC_STATS(SctpOutCtrlChunks);
+			SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 		} else
 			sctp_chunk_free (err_chunk);
 	}
+}
+
+
+/* Process a data chunk */
+int sctp_eat_data(const struct sctp_association *asoc,
+		  struct sctp_chunk *chunk,
+		  sctp_cmd_seq_t *commands)
+{
+	sctp_datahdr_t *data_hdr;
+	struct sctp_chunk *err;
+	size_t datalen;
+	sctp_verb_t deliver;
+	int tmp;
+	__u32 tsn;
+
+	data_hdr = chunk->subh.data_hdr = (sctp_datahdr_t *)chunk->skb->data;
+	skb_pull(chunk->skb, sizeof(sctp_datahdr_t));
+
+	tsn = ntohl(data_hdr->tsn);
+	SCTP_DEBUG_PRINTK("eat_data: TSN 0x%x.\n", tsn);
+
+	/* ASSERT:  Now skb->data is really the user data.  */
+
+	/* Process ECN based congestion.
+	 *
+	 * Since the chunk structure is reused for all chunks within
+	 * a packet, we use ecn_ce_done to track if we've already
+	 * done CE processing for this packet.
+	 *
+	 * We need to do ECN processing even if we plan to discard the
+	 * chunk later.
+	 */
+
+	if (!chunk->ecn_ce_done) {
+		struct sctp_af *af;
+		chunk->ecn_ce_done = 1;
+
+		af = sctp_get_af_specific(
+			ipver2af(chunk->skb->nh.iph->version));
+
+		if (af && af->is_ce(chunk->skb) && asoc->peer.ecn_capable) {
+			/* Do real work as sideffect. */
+			sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
+					SCTP_U32(tsn));
+		}
+	}
+
+	tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
+	if (tmp < 0) {
+		/* The TSN is too high--silently discard the chunk and
+		 * count on it getting retransmitted later.
+		 */
+		return SCTP_IERROR_HIGH_TSN;
+	} else if (tmp > 0) {
+		/* This is a duplicate.  Record it.  */
+		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_DUP, SCTP_U32(tsn));
+		return SCTP_IERROR_DUP_TSN;
+	}
+
+	/* This is a new TSN.  */
+
+	/* Discard if there is no room in the receive window.
+	 * Actually, allow a little bit of overflow (up to a MTU).
+	 */
+	datalen = ntohs(chunk->chunk_hdr->length);
+	datalen -= sizeof(sctp_data_chunk_t);
+
+	deliver = SCTP_CMD_CHUNK_ULP;
+
+	/* Think about partial delivery. */
+	if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
+
+		/* Even if we don't accept this chunk there is
+		 * memory pressure.
+		 */
+		sctp_add_cmd_sf(commands, SCTP_CMD_PART_DELIVER, SCTP_NULL());
+	}
+
+        /* Spill over rwnd a little bit.  Note: While allowed, this spill over
+	 * seems a bit troublesome in that frag_point varies based on
+	 * PMTU.  In cases, such as loopback, this might be a rather
+	 * large spill over.
+	 */
+	if (!asoc->rwnd || asoc->rwnd_over ||
+	    (datalen > asoc->rwnd + asoc->frag_point)) {
+
+		/* If this is the next TSN, consider reneging to make
+		 * room.   Note: Playing nice with a confused sender.  A
+		 * malicious sender can still eat up all our buffer
+		 * space and in the future we may want to detect and
+		 * do more drastic reneging.
+		 */
+		if (sctp_tsnmap_has_gap(&asoc->peer.tsn_map) &&
+		    (sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1) == tsn) {
+			SCTP_DEBUG_PRINTK("Reneging for tsn:%u\n", tsn);
+			deliver = SCTP_CMD_RENEGE;
+		} else {
+			SCTP_DEBUG_PRINTK("Discard tsn: %u len: %Zd, "
+					  "rwnd: %d\n", tsn, datalen,
+					  asoc->rwnd);
+			return SCTP_IERROR_IGNORE_TSN;
+		}
+	}
+
+	/*
+	 * Section 3.3.10.9 No User Data (9)
+	 *
+	 * Cause of error
+	 * ---------------
+	 * No User Data:  This error cause is returned to the originator of a
+	 * DATA chunk if a received DATA chunk has no user data.
+	 */
+	if (unlikely(0 == datalen)) {
+		err = sctp_make_abort_no_data(asoc, chunk, tsn);
+		if (err) {
+			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+					SCTP_CHUNK(err));
+		}
+		/* We are going to ABORT, so we might as well stop
+		 * processing the rest of the chunks in the packet.
+		 */
+		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
+		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
+				SCTP_U32(SCTP_ERROR_NO_DATA));
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
+		return SCTP_IERROR_NO_DATA;
+	}
+
+	/* If definately accepting the DATA chunk, record its TSN, otherwise
+	 * wait for renege processing.
+	 */
+	if (SCTP_CMD_CHUNK_ULP == deliver)
+		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));
+
+	/* Note: Some chunks may get overcounted (if we drop) or overcounted
+	 * if we renege and the chunk arrives again.
+	 */
+	if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
+		SCTP_INC_STATS(SCTP_MIB_INUNORDERCHUNKS);
+	else
+		SCTP_INC_STATS(SCTP_MIB_INORDERCHUNKS);
+
+	/* RFC 2960 6.5 Stream Identifier and Stream Sequence Number
+	 *
+	 * If an endpoint receive a DATA chunk with an invalid stream
+	 * identifier, it shall acknowledge the reception of the DATA chunk
+	 * following the normal procedure, immediately send an ERROR chunk
+	 * with cause set to "Invalid Stream Identifier" (See Section 3.3.10)
+	 * and discard the DATA chunk.
+	 */
+	if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) {
+		err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
+					 &data_hdr->stream,
+					 sizeof(data_hdr->stream));
+		if (err)
+			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+					SCTP_CHUNK(err));
+		return SCTP_IERROR_BAD_STREAM;
+	}
+
+	/* Send the data up to the user.  Note:  Schedule  the
+	 * SCTP_CMD_CHUNK_ULP cmd before the SCTP_CMD_GEN_SACK, as the SACK
+	 * chunk needs the updated rwnd.
+	 */
+	sctp_add_cmd_sf(commands, deliver, SCTP_CHUNK(chunk));
+
+	return SCTP_IERROR_NO_ERROR;
 }
diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c
--- a/net/sctp/socket.c	2004-07-27 18:24:53 -07:00
+++ b/net/sctp/socket.c	2004-07-27 18:24:53 -07:00
@@ -1697,6 +1697,32 @@
 	if (copy_from_user(&params, optval, optlen))
 		return -EFAULT;
 
+	/*
+	 * API 7. Socket Options (setting the default value for the endpoint)
+	 * All options that support specific settings on an association by
+	 * filling in either an association id variable or a sockaddr_storage
+	 * SHOULD also support setting of the same value for the entire endpoint
+	 * (i.e. future associations). To accomplish this the following logic is
+	 * used when setting one of these options:
+
+	 * c) If neither the sockaddr_storage or association identification is
+	 *    set i.e. the sockaddr_storage is set to all 0's (INADDR_ANY) and
+	 *    the association identification is 0, the settings are a default
+	 *    and to be applied to the endpoint (all future associations).
+	 */
+
+	/* update default value for endpoint (all future associations) */
+	if (!params.spp_assoc_id && 
+	    sctp_is_any(( union sctp_addr *)&params.spp_address)) {
+		if (params.spp_hbinterval)
+			sctp_sk(sk)->paddrparam.spp_hbinterval =
+						params.spp_hbinterval;
+		if (sctp_max_retrans_path)
+			sctp_sk(sk)->paddrparam.spp_pathmaxrxt =
+						params.spp_pathmaxrxt;
+		return 0;
+	}
+
 	trans = sctp_addr_id2transport(sk, &params.spp_address,
 				       params.spp_assoc_id);
 	if (!trans)
@@ -2864,6 +2890,17 @@
 	if (copy_from_user(&params, optval, len))
 		return -EFAULT;
 
+	/* If no association id is specified retrieve the default value
+	 * for the endpoint that will be used for all future associations
+	 */
+	if (!params.spp_assoc_id &&
+	    sctp_is_any(( union sctp_addr *)&params.spp_address)) {
+		params.spp_hbinterval = sctp_sk(sk)->paddrparam.spp_hbinterval;
+		params.spp_pathmaxrxt = sctp_sk(sk)->paddrparam.spp_pathmaxrxt;
+
+		goto done;
+	}
+
 	trans = sctp_addr_id2transport(sk, &params.spp_address,
 				       params.spp_assoc_id);
 	if (!trans)
@@ -2883,6 +2920,7 @@
 	 */
 	params.spp_pathmaxrxt = trans->error_threshold;
 
+done:
 	if (copy_to_user(optval, &params, len))
 		return -EFAULT;
 
diff -Nru a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
--- a/net/sctp/ulpqueue.c	2004-07-27 18:24:52 -07:00
+++ b/net/sctp/ulpqueue.c	2004-07-27 18:24:52 -07:00
@@ -334,7 +334,7 @@
 	};
 
 	event = sctp_skb2event(f_frag);
-	SCTP_INC_STATS(SctpReasmUsrMsgs);
+	SCTP_INC_STATS(SCTP_MIB_REASMUSRMSGS);
 
 	return event;
 }
diff -Nru a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
--- a/net/xfrm/xfrm_policy.c	2004-07-27 18:24:51 -07:00
+++ b/net/xfrm/xfrm_policy.c	2004-07-27 18:24:51 -07:00
@@ -204,6 +204,7 @@
 	return;
 
 expired:
+	read_unlock(&xp->lock);
 	km_policy_expired(xp, dir, 1);
 	xfrm_policy_delete(xp, dir);
 	xfrm_pol_put(xp);
diff -Nru a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
--- a/net/xfrm/xfrm_state.c	2004-07-27 18:24:52 -07:00
+++ b/net/xfrm/xfrm_state.c	2004-07-27 18:24:52 -07:00
@@ -65,7 +65,6 @@
 		xfrm_put_type(x->type);
 	}
 	kfree(x);
-	wake_up(&km_waitq);
 }
 
 static void xfrm_state_gc_task(void *data)
@@ -82,6 +81,7 @@
 		x = list_entry(entry, struct xfrm_state, bydst);
 		xfrm_state_gc_destroy(x);
 	}
+	wake_up(&km_waitq);
 }
 
 static inline unsigned long make_jiffies(long secs)
diff -Nru a/security/selinux/hooks.c b/security/selinux/hooks.c
--- a/security/selinux/hooks.c	2004-07-27 18:24:52 -07:00
+++ b/security/selinux/hooks.c	2004-07-27 18:24:52 -07:00
@@ -63,6 +63,7 @@
 #include <net/ipv6.h>
 #include <linux/hugetlb.h>
 #include <linux/major.h>
+#include <linux/personality.h>
 
 #include "avc.h"
 #include "objsec.h"
@@ -1893,6 +1894,9 @@
 			tsec->sid = sid;
 			task_unlock(current);
 		}
+
+		/* Clear any possibly unsafe personality bits on exec: */
+		current->personality &= ~PER_CLEAR_ON_SETID;
 
 		/* Close files for which the new task SID is not authorized. */
 		flush_unauthorized_files(current->files);
diff -Nru a/sound/Kconfig b/sound/Kconfig
--- a/sound/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/sound/Kconfig	2004-07-27 18:24:52 -07:00
@@ -70,7 +70,7 @@
 endmenu
 
 menu "Open Sound System"
-	depends on SOUND!=n
+	depends on SOUND!=n && (BROKEN || !SPARC64)
 
 config SOUND_PRIME
 	tristate "Open Sound System (DEPRECATED)"
diff -Nru a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
--- a/sound/core/oss/pcm_oss.c	2004-07-27 18:24:52 -07:00
+++ b/sound/core/oss/pcm_oss.c	2004-07-27 18:24:52 -07:00
@@ -672,7 +672,7 @@
 			else
 				printk("pcm_oss: read: recovering from SUSPEND\n");
 #endif
-			ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, 0);
+			ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL);
 			if (ret < 0)
 				break;
 		} else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) {
@@ -693,7 +693,7 @@
 		}
 		if (ret == -EPIPE) {
 			if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
-				ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, 0);
+				ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
 				if (ret < 0)
 					break;
 			}
@@ -754,7 +754,7 @@
 			else
 				printk("pcm_oss: readv: recovering from SUSPEND\n");
 #endif
-			ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, 0);
+			ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL);
 			if (ret < 0)
 				break;
 		} else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) {
diff -Nru a/sound/core/pcm.c b/sound/core/pcm.c
--- a/sound/core/pcm.c	2004-07-27 18:24:53 -07:00
+++ b/sound/core/pcm.c	2004-07-27 18:24:53 -07:00
@@ -202,37 +202,37 @@
 
 const char *snd_pcm_stream_name(snd_pcm_stream_t stream)
 {
-	snd_assert(stream <= SNDRV_PCM_STREAM_LAST, return 0);
+	snd_assert(stream <= SNDRV_PCM_STREAM_LAST, return NULL);
 	return snd_pcm_stream_names[stream];
 }
 
 const char *snd_pcm_access_name(snd_pcm_access_t access)
 {
-	snd_assert(access <= SNDRV_PCM_ACCESS_LAST, return 0);
+	snd_assert(access <= SNDRV_PCM_ACCESS_LAST, return NULL);
 	return snd_pcm_access_names[access];
 }
 
 const char *snd_pcm_format_name(snd_pcm_format_t format)
 {
-	snd_assert(format <= SNDRV_PCM_FORMAT_LAST, return 0);
+	snd_assert(format <= SNDRV_PCM_FORMAT_LAST, return NULL);
 	return snd_pcm_format_names[format];
 }
 
 const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat)
 {
-	snd_assert(subformat <= SNDRV_PCM_SUBFORMAT_LAST, return 0);
+	snd_assert(subformat <= SNDRV_PCM_SUBFORMAT_LAST, return NULL);
 	return snd_pcm_subformat_names[subformat];
 }
 
 const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode)
 {
-	snd_assert(mode <= SNDRV_PCM_TSTAMP_LAST, return 0);
+	snd_assert(mode <= SNDRV_PCM_TSTAMP_LAST, return NULL);
 	return snd_pcm_tstamp_mode_names[mode];
 }
 
 const char *snd_pcm_state_name(snd_pcm_state_t state)
 {
-	snd_assert(state <= SNDRV_PCM_STATE_LAST, return 0);
+	snd_assert(state <= SNDRV_PCM_STATE_LAST, return NULL);
 	return snd_pcm_state_names[state];
 }
 
diff -Nru a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
--- a/sound/drivers/serial-u16550.c	2004-07-27 18:24:51 -07:00
+++ b/sound/drivers/serial-u16550.c	2004-07-27 18:24:51 -07:00
@@ -674,7 +674,7 @@
 				break;
 			if (snd_rawmidi_transmit(substream, &midi_byte, 1) != 1)
 				break;
-#if SNDRV_SERIAL_MS124W_MB_NOCOMBO
+#ifdef SNDRV_SERIAL_MS124W_MB_NOCOMBO
 			/* select exactly one of the four ports */
 			addr_byte = (1 << (substream->number + 4)) | 0x08;
 #else
diff -Nru a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
--- a/sound/drivers/vx/vx_pcm.c	2004-07-27 18:24:51 -07:00
+++ b/sound/drivers/vx/vx_pcm.c	2004-07-27 18:24:51 -07:00
@@ -465,7 +465,7 @@
 	struct vx_rmh rmh;
 	int data_mode;
 
-	*pipep = 0;
+	*pipep = NULL;
 	vx_init_rmh(&rmh, CMD_RES_PIPE);
 	vx_set_pipe_cmd_params(&rmh, capture, audioid, num_audio);
 #if 0	// NYI
@@ -581,7 +581,7 @@
 {
 	snd_pcm_runtime_t *runtime = subs->runtime;
 	vx_core_t *chip = snd_pcm_substream_chip(subs);
-	vx_pipe_t *pipe = 0;
+	vx_pipe_t *pipe = NULL;
 	unsigned int audio;
 	int err;
 
@@ -632,7 +632,7 @@
 	pipe = snd_magic_cast(vx_pipe_t, subs->runtime->private_data, return -EINVAL);
 
 	if (--pipe->references == 0) {
-		chip->playback_pipes[pipe->number] = 0;
+		chip->playback_pipes[pipe->number] = NULL;
 		vx_free_pipe(chip, pipe);
 	}
 
@@ -1038,7 +1038,7 @@
 	if (! subs->runtime->private_data)
 		return -EINVAL;
 	pipe = snd_magic_cast(vx_pipe_t, subs->runtime->private_data, return -EINVAL);
-	chip->capture_pipes[pipe->number] = 0;
+	chip->capture_pipes[pipe->number] = NULL;
 
 	pipe_out_monitoring = pipe->monitoring_pipe;
 
@@ -1049,8 +1049,8 @@
 	if (pipe_out_monitoring) {
 		if (--pipe_out_monitoring->references == 0) {
 			vx_free_pipe(chip, pipe_out_monitoring);
-			chip->playback_pipes[pipe->number] = 0;
-			pipe->monitoring_pipe = 0;
+			chip->playback_pipes[pipe->number] = NULL;
+			pipe->monitoring_pipe = NULL;
 		}
 	}
 	
@@ -1269,11 +1269,11 @@
 	chip->pcm[pcm->device] = NULL;
 	if (chip->playback_pipes) {
 		kfree(chip->playback_pipes);
-		chip->playback_pipes = 0;
+		chip->playback_pipes = NULL;
 	}
 	if (chip->capture_pipes) {
 		kfree(chip->capture_pipes);
-		chip->capture_pipes = 0;
+		chip->capture_pipes = NULL;
 	}
 }
 
diff -Nru a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
--- a/sound/i2c/other/tea575x-tuner.c	2004-07-27 18:24:51 -07:00
+++ b/sound/i2c/other/tea575x-tuner.c	2004-07-27 18:24:51 -07:00
@@ -85,11 +85,12 @@
  * Linux Video interface
  */
 
-static int snd_tea575x_do_ioctl(struct inode *inode, struct file *file,
-			        unsigned int cmd, void *arg)
+static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
+			     unsigned int cmd, unsigned long data)
 {
 	struct video_device *dev = video_devdata(file);
 	tea575x_t *tea = video_get_drvdata(dev);
+	void __user *arg = (void __user *)data;
 	
 	switch(cmd) {
 		case VIDIOCGCAP:
@@ -165,12 +166,6 @@
 		default:
 			return -ENOIOCTLCMD;
 	}
-}
-
-static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
-			     unsigned int cmd, unsigned long arg)
-{
-	return video_usercopy(inode, file, cmd, arg, snd_tea575x_do_ioctl);
 }
 
 /*
diff -Nru a/sound/isa/Kconfig b/sound/isa/Kconfig
--- a/sound/isa/Kconfig	2004-07-27 18:24:52 -07:00
+++ b/sound/isa/Kconfig	2004-07-27 18:24:52 -07:00
@@ -184,7 +184,7 @@
 
 config SND_SB16_CSP
 	bool "Sound Blaster 16/AWE CSP support"
-	depends on SND_SB16 || SND_SBAWE
+	depends on (SND_SB16 || SND_SBAWE) && (BROKEN || !PPC)
 	help
 	  Say 'Y' to include support for CSP core. This special coprocessor
 	  can do variable tasks like various compression and decompression
diff -Nru a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c
--- a/sound/isa/gus/gus_mem.c	2004-07-27 18:24:51 -07:00
+++ b/sound/isa/gus/gus_mem.c	2004-07-27 18:24:51 -07:00
@@ -59,7 +59,7 @@
 			else
 				nblock->prev->next = nblock;
 			up(&alloc->memory_mutex);
-			return 0;
+			return NULL;
 		}
 		pblock = pblock->next;
 	}
diff -Nru a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c
--- a/sound/isa/sb/emu8000_pcm.c	2004-07-27 18:24:52 -07:00
+++ b/sound/isa/sb/emu8000_pcm.c	2004-07-27 18:24:52 -07:00
@@ -264,7 +264,7 @@
 	emu8k_pcm_t *rec = subs->runtime->private_data;
 	if (rec)
 		kfree(rec);
-	subs->runtime->private_data = 0;
+	subs->runtime->private_data = NULL;
 	return 0;
 }
 
diff -Nru a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
--- a/sound/isa/sb/sb8_main.c	2004-07-27 18:24:51 -07:00
+++ b/sound/isa/sb/sb8_main.c	2004-07-27 18:24:51 -07:00
@@ -452,11 +452,11 @@
 		runtime->hw.rate_max = 44100;
 		runtime->hw.channels_max = 2;
 		snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
-				    snd_sb8_hw_constraint_rate_channels, 0,
+				    snd_sb8_hw_constraint_rate_channels, NULL,
 				    SNDRV_PCM_HW_PARAM_CHANNELS,
 				    SNDRV_PCM_HW_PARAM_RATE, -1);
 		snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
-				     snd_sb8_hw_constraint_channels_rate, 0,
+				     snd_sb8_hw_constraint_channels_rate, NULL,
 				     SNDRV_PCM_HW_PARAM_RATE, -1);
 		break;
 	case SB_HW_201:
diff -Nru a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
--- a/sound/isa/wavefront/wavefront_synth.c	2004-07-27 18:24:51 -07:00
+++ b/sound/isa/wavefront/wavefront_synth.c	2004-07-27 18:24:51 -07:00
@@ -123,7 +123,7 @@
 #else
 #define DPRINT(cond, args...) \
        if ((dev->debug & (cond)) == (cond)) { \
-	     snd_printk (##args); \
+	     snd_printk (args); \
        }
 #endif
 #else
@@ -165,7 +165,7 @@
 	{ 0x0E, "Bad MIDI channel number" },
 	{ 0x10, "Download Record Error" },
 	{ 0x80, "Success" },
-	{ 0x0, 0x0 }
+	{ 0x0 }
 };
 
 #define NEEDS_ACK 1
@@ -361,7 +361,7 @@
 
 	if (cmd == WFC_DOWNLOAD_MULTISAMPLE) {
 		wfcmd->write_cnt = (unsigned long) rbuf;
-		rbuf = 0;
+		rbuf = NULL;
 	}
 
 	DPRINT (WF_DEBUG_CMD, "0x%x [%s] (%d,%d,%d)\n",
@@ -612,7 +612,7 @@
 	wbuf[0] = sample_num & 0x7f;
 	wbuf[1] = sample_num >> 7;
 
-	if ((x = snd_wavefront_cmd (dev, WFC_DELETE_SAMPLE, 0, wbuf)) == 0) {
+	if ((x = snd_wavefront_cmd (dev, WFC_DELETE_SAMPLE, NULL, wbuf)) == 0) {
 		dev->sample_status[sample_num] = WF_ST_EMPTY;
 	}
 
@@ -798,7 +798,7 @@
 	bptr = munge_int32 (header->number, buf, 2);
 	munge_buf ((unsigned char *)&header->hdr.p, bptr, WF_PATCH_BYTES);
     
-	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PATCH, 0, buf)) {
+	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PATCH, NULL, buf)) {
 		snd_printk ("download patch failed\n");
 		return -(EIO);
 	}
@@ -836,7 +836,7 @@
 	buf[0] = header->number;
 	munge_buf ((unsigned char *)&header->hdr.pr, &buf[1], WF_PROGRAM_BYTES);
     
-	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PROGRAM, 0, buf)) {
+	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PROGRAM, NULL, buf)) {
 		snd_printk ("download patch failed\n");	
 		return -(EIO);
 	}
@@ -850,7 +850,7 @@
 {
 	char rbuf[8];
 
-	if (snd_wavefront_cmd (dev, WFC_REPORT_FREE_MEMORY, rbuf, 0)) {
+	if (snd_wavefront_cmd (dev, WFC_REPORT_FREE_MEMORY, rbuf, NULL)) {
 		snd_printk ("can't get memory stats.\n");
 		return -1;
 	} else {
@@ -876,7 +876,7 @@
 
 	u16 sample_short;
 	u32 length;
-	u16 __user *data_end = 0;
+	u16 __user *data_end = NULL;
 	unsigned int i;
 	const unsigned int max_blksize = 4096/2;
 	unsigned int written;
@@ -1053,7 +1053,7 @@
 	if (snd_wavefront_cmd (dev, 
 			   header->size ?
 			   WFC_DOWNLOAD_SAMPLE : WFC_DOWNLOAD_SAMPLE_HEADER,
-			   0, sample_hdr)) {
+			   NULL, sample_hdr)) {
 		snd_printk ("sample %sdownload refused.\n",
 			    header->size ? "" : "header ");
 		return -(EIO);
@@ -1079,7 +1079,7 @@
 			blocksize = ((length-written+7)&~0x7);
 		}
 
-		if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, 0, 0)) {
+		if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, NULL, NULL)) {
 			snd_printk ("download block "
 				    "request refused.\n");
 			return -(EIO);
@@ -1186,7 +1186,7 @@
 	munge_int32 (header->hdr.a.FrequencyBias, &alias_hdr[20], 3);
 	munge_int32 (*(&header->hdr.a.FrequencyBias+1), &alias_hdr[23], 2);
 
-	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_SAMPLE_ALIAS, 0, alias_hdr)) {
+	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_SAMPLE_ALIAS, NULL, alias_hdr)) {
 		snd_printk ("download alias failed.\n");
 		return -(EIO);
 	}
@@ -1314,7 +1314,7 @@
 		munge_int32 (((unsigned char *)drum)[i], &drumbuf[1+(i*2)], 2);
 	}
 
-	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_EDRUM_PROGRAM, 0, drumbuf)) {
+	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_EDRUM_PROGRAM, NULL, drumbuf)) {
 		snd_printk ("download drum failed.\n");
 		return -(EIO);
 	}
@@ -2085,7 +2085,7 @@
 
 	voices[0] = 32;
 
-	if (snd_wavefront_cmd (dev, WFC_SET_NVOICES, 0, voices)) {
+	if (snd_wavefront_cmd (dev, WFC_SET_NVOICES, NULL, voices)) {
 		snd_printk ("cannot set number of voices to 32.\n");
 		goto gone_bad;
 	}
diff -Nru a/sound/oss/aci.c b/sound/oss/aci.c
--- a/sound/oss/aci.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/aci.c	2004-07-27 18:24:51 -07:00
@@ -99,7 +99,7 @@
 MODULE_PARM_DESC(wss,"change between ACI/WSS-mixer; use 0 and 1 - untested"
 		 " default: do nothing; for PCM1-pro only");
 
-#if DEBUG
+#ifdef DEBUG
 static void print_bits(unsigned char c)
 {
 	int j;
@@ -184,7 +184,7 @@
 static inline int aci_rawwrite(unsigned char byte)
 {
 	if (busy_wait() >= 0) {
-#if DEBUG
+#ifdef DEBUG
 		printk(KERN_DEBUG "aci_rawwrite(%d)\n", byte);
 #endif
 		outb(byte, COMMAND_REGISTER);
@@ -199,7 +199,7 @@
 
 	if (busy_wait() >= 0) {
 		byte=inb(STATUS_REGISTER);
-#if DEBUG
+#ifdef DEBUG
 		printk(KERN_DEBUG "%d = aci_rawread()\n", byte);
 #endif
 		return byte;
diff -Nru a/sound/oss/ad1816.c b/sound/oss/ad1816.c
--- a/sound/oss/ad1816.c	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/ad1816.c	2004-07-27 18:24:52 -07:00
@@ -1235,10 +1235,10 @@
 } isapnp_ad1816_list[] __initdata = {
 	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
 		ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7150), 
-		0 },
+		NULL },
 	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
 		ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7180),
-		0 },
+		NULL },
 	{0}
 };
 
diff -Nru a/sound/oss/ad1848.c b/sound/oss/ad1848.c
--- a/sound/oss/ad1848.c	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/ad1848.c	2004-07-27 18:24:52 -07:00
@@ -2962,7 +2962,7 @@
 		ISAPNP_VENDOR('G','R','V'), ISAPNP_DEVICE(0x0001),
 		ISAPNP_VENDOR('G','R','V'), ISAPNP_FUNCTION(0x0000),
 		0, 0, 0, 1, 0},
-	{0}
+	{NULL}
 };
 
 static struct isapnp_device_id id_table[] __devinitdata = {
diff -Nru a/sound/oss/ad1889.c b/sound/oss/ad1889.c
--- a/sound/oss/ad1889.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/ad1889.c	2004-07-27 18:24:51 -07:00
@@ -338,7 +338,7 @@
 		{ "AC97_3D_CONTROL", 0x100 + AC97_3D_CONTROL, 16 },
 		{ "AC97_MODEM_RATE", 0x100 + AC97_MODEM_RATE, 16 },
 		{ "AC97_POWER_CONTROL", 0x100 + AC97_POWER_CONTROL, 16 },
-		{ 0 }
+		{ NULL }
 	};
 
 	if (dev == NULL)
@@ -1017,7 +1017,7 @@
 	if ((err = ad1889_ac97_init(dev, 0)) != 0)
 		goto err_free_dsp;
 
-	if (((proc_root = proc_mkdir("driver/ad1889", 0)) == NULL) ||
+	if (((proc_root = proc_mkdir("driver/ad1889", NULL)) == NULL) ||
 	    create_proc_read_entry("ac97", S_IFREG|S_IRUGO, proc_root, ac97_read_proc, dev->ac97_codec) == NULL ||
 	    create_proc_read_entry("info", S_IFREG|S_IRUGO, proc_root, ad1889_read_proc, dev) == NULL) 
 		goto err_free_dsp;
@@ -1038,7 +1038,7 @@
 
 err_free_mem:
 	ad1889_free_dev(dev);
-	pci_set_drvdata(pcidev, 0);
+	pci_set_drvdata(pcidev, NULL);
 
 	return -ENODEV;
 }
diff -Nru a/sound/oss/ali5455.c b/sound/oss/ali5455.c
--- a/sound/oss/ali5455.c	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/ali5455.c	2004-07-27 18:24:52 -07:00
@@ -1583,7 +1583,7 @@
 			size_t count, loff_t * ppos)
 {
 	struct ali_state *state = (struct ali_state *) file->private_data;
-	struct ali_card *card = state ? state->card : 0;
+	struct ali_card *card = state ? state->card : NULL;
 	struct dmabuf *dmabuf = &state->dmabuf;
 	ssize_t ret;
 	unsigned long flags;
@@ -1724,7 +1724,7 @@
 			 const char __user *buffer, size_t count, loff_t * ppos)
 {
 	struct ali_state *state = (struct ali_state *) file->private_data;
-	struct ali_card *card = state ? state->card : 0;
+	struct ali_card *card = state ? state->card : NULL;
 	struct dmabuf *dmabuf = &state->dmabuf;
 	ssize_t ret;
 	unsigned long flags;
diff -Nru a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
--- a/sound/oss/cs46xx.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/cs46xx.c	2004-07-27 18:24:51 -07:00
@@ -2480,7 +2480,7 @@
 {
 	struct cs_card *card = (struct cs_card *)file->private_data;
 	struct cs_state *state;
-	struct dmabuf *dmabuf=0;
+	struct dmabuf *dmabuf=NULL;
 	unsigned long flags;
 	audio_buf_info abinfo;
 	count_info cinfo;
@@ -4271,7 +4271,7 @@
 			CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO 
 				"cs46xx: cs_ac97_init()- codec number %d not found\n",
 					num_ac97) );
-			card->ac97_codec[num_ac97] = 0;
+			card->ac97_codec[num_ac97] = NULL;
 			break;
 		}
 		CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO 
diff -Nru a/sound/oss/cs46xxpm-24.h b/sound/oss/cs46xxpm-24.h
--- a/sound/oss/cs46xxpm-24.h	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/cs46xxpm-24.h	2004-07-27 18:24:52 -07:00
@@ -38,7 +38,7 @@
 */
 static int cs46xx_suspend_tbl(struct pci_dev *pcidev, u32 state);
 static int cs46xx_resume_tbl(struct pci_dev *pcidev);
-#define cs_pm_register(a, b, c)  0
+#define cs_pm_register(a, b, c)  NULL
 #define cs_pm_unregister_all(a) 
 #define CS46XX_SUSPEND_TBL cs46xx_suspend_tbl
 #define CS46XX_RESUME_TBL cs46xx_resume_tbl
diff -Nru a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h
--- a/sound/oss/dmasound/dmasound.h	2004-07-27 18:24:53 -07:00
+++ b/sound/oss/dmasound/dmasound.h	2004-07-27 18:24:53 -07:00
@@ -44,12 +44,12 @@
 #define le2be16dbl(x)	(((x)<<8 & 0xff00ff00) | ((x)>>8 & 0x00ff00ff))
 
 #define IOCTL_IN(arg, ret) \
-	do { int error = get_user(ret, (int *)(arg)); \
+	do { int error = get_user(ret, (int __user *)(arg)); \
 		if (error) return error; \
 	} while (0)
-#define IOCTL_OUT(arg, ret)	ioctl_return((int *)(arg), ret)
+#define IOCTL_OUT(arg, ret)	ioctl_return((int __user *)(arg), ret)
 
-static inline int ioctl_return(int *addr, int value)
+static inline int ioctl_return(int __user *addr, int value)
 {
 	return value < 0 ? value : put_user(value, addr);
 }
@@ -153,14 +153,14 @@
      */
 
 typedef struct {
-    ssize_t (*ct_ulaw)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_alaw)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_s8)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_u8)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_s16be)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_u16be)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_s16le)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_u16le)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_ulaw)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_alaw)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_s8)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_u8)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_s16be)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_u16be)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_s16le)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_u16le)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
 } TRANS;
 
 struct sound_settings {
diff -Nru a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
--- a/sound/oss/dmasound/dmasound_awacs.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/dmasound/dmasound_awacs.c	2004-07-27 18:24:51 -07:00
@@ -326,12 +326,12 @@
 #undef IOCTL_OUT
 
 #define IOCTL_IN(arg, ret)	\
-	rc = get_user(ret, (int *)(arg)); \
+	rc = get_user(ret, (int __user *)(arg)); \
 	if (rc) break;
 #define IOCTL_OUT(arg, ret)	\
-	ioctl_return2((int *)(arg), ret)
+	ioctl_return2((int __user *)(arg), ret)
 
-static inline int ioctl_return2(int *addr, int value)
+static inline int ioctl_return2(int __user *addr, int value)
 {
 	return value < 0 ? value : put_user(value, addr);
 }
@@ -461,7 +461,7 @@
 	write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
 	msleep(100);
   	if (gpio_headphone_irq) {
-		if (request_irq(gpio_headphone_irq,headphone_intr,0,"Headphone detect",0) < 0) {
+		if (request_irq(gpio_headphone_irq,headphone_intr,0,"Headphone detect",NULL) < 0) {
     			printk(KERN_ERR "tumbler: Can't request headphone interrupt\n");
     			gpio_headphone_irq = 0;
     		} else {
@@ -470,7 +470,7 @@
 			val = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio_headphone_detect, 0);
 			pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, gpio_headphone_detect, val | 0x80);
 			/* Trigger it */
-  			headphone_intr(0,0,0);
+  			headphone_intr(0,NULL,NULL);
   		}
   	}
   	if (!gpio_headphone_irq) {
@@ -487,7 +487,7 @@
 tas_dmasound_cleanup(void)
 {
 	if (gpio_headphone_irq)
-		free_irq(gpio_headphone_irq, 0);
+		free_irq(gpio_headphone_irq, NULL);
 	return 0;
 }
 
@@ -514,6 +514,7 @@
 static int
 tas_mixer_ioctl(u_int cmd, u_long arg)
 {
+	int __user *argp = (int __user *)arg;
 	int data;
 	int rc;
 
@@ -524,16 +525,16 @@
 
         if ((cmd & ~0xff) == MIXER_WRITE(0) &&
             tas_supported_mixers() & (1<<(cmd & 0xff))) {
-		rc = get_user(data, (int *)(arg));
+		rc = get_user(data, argp);
                 if (rc<0) return rc;
 		tas_set_mixer_level(cmd & 0xff, data);
 		tas_get_mixer_level(cmd & 0xff, &data);
-		return ioctl_return2((int *)(arg), data);
+		return ioctl_return2(argp, data);
         }
         if ((cmd & ~0xff) == MIXER_READ(0) &&
             tas_supported_mixers() & (1<<(cmd & 0xff))) {
 		tas_get_mixer_level(cmd & 0xff, &data);
-		return ioctl_return2((int *)(arg), data);
+		return ioctl_return2(argp, data);
         }
 
 	switch(cmd) {
@@ -627,10 +628,10 @@
 static int __init PMacIrqInit(void)
 {
 	if (awacs)
-		if (request_irq(awacs_irq, pmac_awacs_intr, 0, "Built-in Sound misc", 0))
+		if (request_irq(awacs_irq, pmac_awacs_intr, 0, "Built-in Sound misc", NULL))
 			return 0;
-	if (request_irq(awacs_tx_irq, pmac_awacs_tx_intr, 0, "Built-in Sound out", 0)
-	    || request_irq(awacs_rx_irq, pmac_awacs_rx_intr, 0, "Built-in Sound in", 0))
+	if (request_irq(awacs_tx_irq, pmac_awacs_tx_intr, 0, "Built-in Sound out", NULL)
+	    || request_irq(awacs_rx_irq, pmac_awacs_rx_intr, 0, "Built-in Sound in", NULL))
 		return 0;
 	return 1;
 }
@@ -656,9 +657,9 @@
 		msleep(200);
 	}
 	if (awacs)
-		free_irq(awacs_irq, 0);
-	free_irq(awacs_tx_irq, 0);
-	free_irq(awacs_rx_irq, 0);
+		free_irq(awacs_irq, NULL);
+	free_irq(awacs_tx_irq, NULL);
+	free_irq(awacs_rx_irq, NULL);
 	
 	if (awacs)
 		iounmap((void *)awacs);
@@ -1504,7 +1505,7 @@
 				write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
 				msleep(150);
 				tas_leave_sleep(); /* Stub for now */
-				headphone_intr(0,0,0);
+				headphone_intr(0,NULL,NULL);
 				break;
 			case AWACS_DACA:
 				msleep(10); /* Check this !!! */
@@ -2969,7 +2970,7 @@
 
 		sound_device_id = 0;
 		/* device ID appears post g3 b&w */
-		prop = (unsigned int *)get_property(info, "device-id", 0);
+		prop = (unsigned int *)get_property(info, "device-id", NULL);
 		if (prop != 0)
 			sound_device_id = *prop;
 
@@ -3080,7 +3081,7 @@
 
 	} else if (is_pbook_g3) {
 		struct device_node* mio;
-		macio_base = 0;
+		macio_base = NULL;
 		for (mio = io->parent; mio; mio = mio->parent) {
 			if (strcmp(mio->name, "mac-io") == 0
 			    && mio->n_addrs > 0) {
diff -Nru a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
--- a/sound/oss/dmasound/dmasound_core.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/dmasound/dmasound_core.c	2004-07-27 18:24:51 -07:00
@@ -279,11 +279,11 @@
 	return stereo;
 }
 
-static ssize_t sound_copy_translate(TRANS *trans, const u_char *userPtr,
+static ssize_t sound_copy_translate(TRANS *trans, const u_char __user *userPtr,
 				    size_t userCount, u_char frame[],
 				    ssize_t *frameUsed, ssize_t frameLeft)
 {
-	ssize_t (*ct_func)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
+	ssize_t (*ct_func)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
 
 	switch (dmasound.soft.format) {
 	    case AFMT_MU_LAW:
@@ -361,7 +361,7 @@
 		    strlcpy(info.id, dmasound.mach.name2, sizeof(info.id));
 		    strlcpy(info.name, dmasound.mach.name2, sizeof(info.name));
 		    info.modify_counter = mixer.modify_counter;
-		    if (copy_to_user((int *)arg, &info, sizeof(info)))
+		    if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			    return -EFAULT;
 		    return 0;
 		}
@@ -425,7 +425,7 @@
 			while (i--)
 				dmasound.mach.dma_free(sq->buffers[i], size);
 			kfree(sq->buffers);
-			sq->buffers = 0;
+			sq->buffers = NULL;
 			return -ENOMEM;
 		}
 	}
@@ -447,7 +447,7 @@
 
 static int sq_setup(struct sound_queue *sq)
 {
-	int (*setup_func)(void) = 0;
+	int (*setup_func)(void) = NULL;
 	int hard_frame ;
 
 	if (sq->locked) { /* are we already set? - and not changeable */
@@ -546,7 +546,7 @@
 	dmasound.mach.play();
 }
 
-static ssize_t sq_write(struct file *file, const char *src, size_t uLeft,
+static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft,
 			loff_t *ppos)
 {
 	ssize_t uWritten = 0;
@@ -703,7 +703,7 @@
      *  it and restart the DMA.
      */
 
-static ssize_t sq_read(struct file *file, char *dst, size_t uLeft,
+static ssize_t sq_read(struct file *file, char __user *dst, size_t uLeft,
 		       loff_t *ppos)
 {
 
@@ -1321,7 +1321,7 @@
 			info.fragstotal = write_sq.max_active;
 			info.fragsize = write_sq.user_frag_size;
 			info.bytes = info.fragments * info.fragsize;
-			if (copy_to_user((void *)arg, &info, sizeof(info)))
+			if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 				return -EFAULT;
 			return 0;
 		} else
@@ -1547,7 +1547,7 @@
 	return 0;
 }
 
-static ssize_t state_read(struct file *file, char *buf, size_t count,
+static ssize_t state_read(struct file *file, char __user *buf, size_t count,
 			  loff_t *ppos)
 {
 	int n = state.len - state.ptr;
diff -Nru a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c
--- a/sound/oss/dmasound/tas3001c.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/dmasound/tas3001c.c	2004-07-27 18:24:51 -07:00
@@ -452,8 +452,9 @@
 {
 	int rc;
 	struct tas_biquad_ctrl_t biquad;
+	void __user *argp = (void __user *)arg;
 
-	if (copy_from_user((void *)&biquad, (const void *)arg, sizeof(struct tas_biquad_ctrl_t))) {
+	if (copy_from_user(&biquad, argp, sizeof(struct tas_biquad_ctrl_t))) {
 		return -EFAULT;
 	}
 
@@ -466,7 +467,7 @@
 		rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
 		if (rc != 0) return rc;
 
-		if (copy_to_user((void *)arg, (const void *)&biquad, sizeof(struct tas_biquad_ctrl_t))) {
+		if (copy_to_user(argp, &biquad, sizeof(struct tas_biquad_ctrl_t))) {
 			return -EFAULT;
 		}
 
@@ -485,27 +486,21 @@
 	int i,j;
 	char sync_required[2][6];
 	struct tas_biquad_ctrl_t biquad;
+	struct tas_biquad_ctrl_list_t __user *argp = (void __user *)arg;
 
 	memset(sync_required,0,sizeof(sync_required));
 
-	if (copy_from_user((void *)&filter_count,
-			   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,filter_count),
-			   sizeof(int))) {
+	if (copy_from_user(&filter_count, &argp->filter_count, sizeof(int)))
 		return -EFAULT;
-	}
 
-	if (copy_from_user((void *)&flags,
-			   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,flags),
-			   sizeof(int))) {
+	if (copy_from_user(&flags, &argp->flags, sizeof(int)))
 		return -EFAULT;
-	}
 
 	if (cmd & SIOC_IN) {
 	}
 
 	for (i=0; i < filter_count; i++) {
-		if (copy_from_user((void *)&biquad,
-				   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
+		if (copy_from_user(&biquad, &argp->biquads[i],
 				   sizeof(struct tas_biquad_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -520,8 +515,7 @@
 			rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
 			if (rc != 0) return rc;
 
-			if (copy_to_user((void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
-					 (const void *)&biquad,
+			if (copy_to_user(&argp->biquads[i], &biquad,
 					 sizeof(struct tas_biquad_ctrl_t))) {
 				return -EFAULT;
 			}
@@ -596,12 +590,10 @@
 {
 	int rc;
 	struct tas_drce_ctrl_t drce_ctrl;
+	void __user *argp = (void __user *)arg;
 
-	if (copy_from_user((void *)&drce_ctrl,
-			   (const void *)arg,
-			   sizeof(struct tas_drce_ctrl_t))) {
+	if (copy_from_user(&drce_ctrl, argp, sizeof(struct tas_drce_ctrl_t)))
 		return -EFAULT;
-	}
 
 #ifdef DEBUG_DRCE
 	printk("DRCE IOCTL: input [ FLAGS:%x ENABLE:%x THRESH:%x\n",
@@ -623,8 +615,7 @@
 		if (drce_ctrl.flags & TAS_DRCE_THRESHOLD)
 			drce_ctrl.data.threshold = self->drce_state.threshold;
 
-		if (copy_to_user((void *)arg,
-				 (const void *)&drce_ctrl,
+		if (copy_to_user(argp, &drce_ctrl,
 				 sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -703,6 +694,7 @@
 			u_int cmd,
 			u_long arg)
 {
+	uint __user *argp = (void __user *)arg;
 	switch (cmd) {
 	case TAS_READ_EQ:
 	case TAS_WRITE_EQ:
@@ -713,11 +705,11 @@
 		return tas3001c_eq_list_rw(self, cmd, arg);
 
 	case TAS_READ_EQ_FILTER_COUNT:
-		put_user(TAS3001C_BIQUAD_FILTER_COUNT, (uint *)(arg));
+		put_user(TAS3001C_BIQUAD_FILTER_COUNT, argp);
 		return 0;
 
 	case TAS_READ_EQ_CHANNEL_COUNT:
-		put_user(TAS3001C_BIQUAD_CHANNEL_COUNT, (uint *)(arg));
+		put_user(TAS3001C_BIQUAD_CHANNEL_COUNT, argp);
 		return 0;
 
 	case TAS_READ_DRCE:
@@ -725,15 +717,14 @@
 		return tas3001c_drce_rw(self, cmd, arg);
 
 	case TAS_READ_DRCE_CAPS:
-		put_user(TAS_DRCE_ENABLE | TAS_DRCE_THRESHOLD, (uint *)(arg));
+		put_user(TAS_DRCE_ENABLE | TAS_DRCE_THRESHOLD, argp);
 		return 0;
 
 	case TAS_READ_DRCE_MIN:
 	case TAS_READ_DRCE_MAX: {
 		struct tas_drce_ctrl_t drce_ctrl;
 
-		if (copy_from_user((void *)&drce_ctrl,
-				   (const void *)arg,
+		if (copy_from_user(&drce_ctrl, argp,
 				   sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -746,8 +737,7 @@
 			}
 		}
 
-		if (copy_to_user((void *)arg,
-				 (const void *)&drce_ctrl,
+		if (copy_to_user(argp, &drce_ctrl,
 				 sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
diff -Nru a/sound/oss/dmasound/tas3001c_tables.c b/sound/oss/dmasound/tas3001c_tables.c
--- a/sound/oss/dmasound/tas3001c_tables.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/dmasound/tas3001c_tables.c	2004-07-27 18:24:51 -07:00
@@ -3,12 +3,12 @@
 
 static struct tas_drce_t eqp_0e_2_1_drce = {
   .enable     = 1,
-  .above      { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  -15.33  * (1<<8),
-  .energy     2.4     * (1<<12),
-  .attack     0.013   * (1<<12),
-  .decay      0.212   * (1<<12),
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -15.33  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_0e_2_1_biquads[]={
diff -Nru a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c
--- a/sound/oss/dmasound/tas3004.c	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/dmasound/tas3004.c	2004-07-27 18:24:52 -07:00
@@ -635,10 +635,11 @@
 		u_int cmd,
 		u_long arg)
 {
+	void __user *argp = (void __user *)arg;
 	int rc;
 	struct tas_biquad_ctrl_t biquad;
 
-	if (copy_from_user((void *)&biquad, (const void *)arg, sizeof(struct tas_biquad_ctrl_t))) {
+	if (copy_from_user((void *)&biquad, argp, sizeof(struct tas_biquad_ctrl_t))) {
 		return -EFAULT;
 	}
 
@@ -651,7 +652,7 @@
 		rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
 		if (rc != 0) return rc;
 
-		if (copy_to_user((void *)arg, (const void *)&biquad, sizeof(struct tas_biquad_ctrl_t))) {
+		if (copy_to_user(argp, &biquad, sizeof(struct tas_biquad_ctrl_t))) {
 			return -EFAULT;
 		}
 
@@ -670,27 +671,21 @@
 	int i,j;
 	char sync_required[TAS3004_BIQUAD_CHANNEL_COUNT][TAS3004_BIQUAD_FILTER_COUNT];
 	struct tas_biquad_ctrl_t biquad;
+	struct tas_biquad_ctrl_list_t __user *argp = (void __user *)arg;
 
 	memset(sync_required,0,sizeof(sync_required));
 
-	if (copy_from_user((void *)&filter_count,
-			   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,filter_count),
-			   sizeof(int))) {
+	if (copy_from_user(&filter_count, &argp->filter_count, sizeof(int)))
 		return -EFAULT;
-	}
 
-	if (copy_from_user((void *)&flags,
-			   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,flags),
-			   sizeof(int))) {
+	if (copy_from_user(&flags, &argp->flags, sizeof(int)))
 		return -EFAULT;
-	}
 
 	if (cmd & SIOC_IN) {
 	}
 
 	for (i=0; i < filter_count; i++) {
-		if (copy_from_user((void *)&biquad,
-				   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
+		if (copy_from_user(&biquad, &argp->biquads[i],
 				   sizeof(struct tas_biquad_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -705,8 +700,7 @@
 			rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
 			if (rc != 0) return rc;
 
-			if (copy_to_user((void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
-					 (const void *)&biquad,
+			if (copy_to_user(&argp->biquads[i], &biquad,
 					 sizeof(struct tas_biquad_ctrl_t))) {
 				return -EFAULT;
 			}
@@ -840,12 +834,10 @@
 {
 	int rc;
 	struct tas_drce_ctrl_t drce_ctrl;
+	void __user *argp = (void __user *)arg;
 
-	if (copy_from_user((void *)&drce_ctrl,
-			   (const void *)arg,
-			   sizeof(struct tas_drce_ctrl_t))) {
+	if (copy_from_user(&drce_ctrl, argp, sizeof(struct tas_drce_ctrl_t)))
 		return -EFAULT;
-	}
 
 #ifdef DEBUG_DRCE
 	printk("DRCE: input [ FLAGS:%x ENABLE:%x ABOVE:%x/%x BELOW:%x/%x THRESH:%x ENERGY:%x ATTACK:%x DECAY:%x\n",
@@ -880,8 +872,7 @@
 		if (drce_ctrl.flags & TAS_DRCE_DECAY)
 			drce_ctrl.data.decay = self->drce_state.decay;
 
-		if (copy_to_user((void *)arg,
-				 (const void *)&drce_ctrl,
+		if (copy_to_user(argp, &drce_ctrl,
 				 sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -952,6 +943,7 @@
 			u_int cmd,
 			u_long arg)
 {
+	uint __user *argp = (void __user *)arg;
 	switch (cmd) {
 	case TAS_READ_EQ:
 	case TAS_WRITE_EQ:
@@ -962,11 +954,11 @@
 		return tas3004_eq_list_rw(self, cmd, arg);
 
 	case TAS_READ_EQ_FILTER_COUNT:
-		put_user(TAS3004_BIQUAD_FILTER_COUNT, (uint *)(arg));
+		put_user(TAS3004_BIQUAD_FILTER_COUNT, argp);
 		return 0;
 
 	case TAS_READ_EQ_CHANNEL_COUNT:
-		put_user(TAS3004_BIQUAD_CHANNEL_COUNT, (uint *)(arg));
+		put_user(TAS3004_BIQUAD_CHANNEL_COUNT, argp);
 		return 0;
 
 	case TAS_READ_DRCE:
@@ -981,7 +973,7 @@
 			 TAS_DRCE_ENERGY         |
 			 TAS_DRCE_ATTACK         |
 			 TAS_DRCE_DECAY,
-			 (uint *)(arg));
+			 argp);
 		return 0;
 
 	case TAS_READ_DRCE_MIN:
@@ -989,8 +981,7 @@
 		struct tas_drce_ctrl_t drce_ctrl;
 		const struct tas_drce_t *drce_copy;
 
-		if (copy_from_user((void *)&drce_ctrl,
-				   (const void *)arg,
+		if (copy_from_user(&drce_ctrl, argp,
 				   sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -1020,8 +1011,7 @@
 			drce_ctrl.data.decay=drce_copy->decay;
 		}
 
-		if (copy_to_user((void *)arg,
-				 (const void *)&drce_ctrl,
+		if (copy_to_user(argp, &drce_ctrl,
 				 sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
diff -Nru a/sound/oss/dmasound/trans_16.c b/sound/oss/dmasound/trans_16.c
--- a/sound/oss/dmasound/trans_16.c	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/dmasound/trans_16.c	2004-07-27 18:24:52 -07:00
@@ -20,42 +20,42 @@
 static short dmasound_alaw2dma16[] ;
 static short dmasound_ulaw2dma16[] ;
 
-static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_law(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s8(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft);
-static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u8(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft);
-static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s16(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u16(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
 
-static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_law(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft);
-static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s8(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u8(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s16(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft);
-static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u16(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft);
 
-static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
 
@@ -63,7 +63,7 @@
 
 static int expand_data;	/* Data for expanding */
 
-static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_law(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -96,7 +96,7 @@
 }
 
 
-static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s8(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -127,7 +127,7 @@
 }
 
 
-static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u8(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -158,7 +158,7 @@
 }
 
 
-static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s16(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -170,7 +170,7 @@
 	userCount >>= (stereo? 2: 1);
 	used = count = min_t(unsigned long, userCount, frameLeft);
 	if (!stereo) {
-		short *up = (short *) userPtr;
+		short __user *up = (short __user *) userPtr;
 		while (count > 0) {
 			short data;
 			if (get_user(data, up++))
@@ -187,7 +187,7 @@
 	return stereo? used * 4: used * 2;
 }
 
-static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u16(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -195,7 +195,7 @@
 	int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
 	int stereo = dmasound.soft.stereo;
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 
 	frameLeft >>= 2;
 	userCount >>= (stereo? 2: 1);
@@ -219,7 +219,7 @@
 }
 
 
-static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_law(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft)
 {
@@ -266,7 +266,7 @@
 	return stereo? utotal * 2: utotal;
 }
 
-static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s8(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -311,7 +311,7 @@
 }
 
 
-static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u8(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -356,13 +356,13 @@
 }
 
 
-static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s16(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft)
 {
 	unsigned int *p = (unsigned int *) &frame[*frameUsed];
 	unsigned int data = expand_data;
-	unsigned short *up = (unsigned short *) userPtr;
+	unsigned short __user *up = (unsigned short __user *) userPtr;
 	int bal = expand_bal;
 	int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
 	int stereo = dmasound.soft.stereo;
@@ -400,14 +400,14 @@
 }
 
 
-static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u16(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft)
 {
 	int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
 	unsigned int *p = (unsigned int *) &frame[*frameUsed];
 	unsigned int data = expand_data;
-	unsigned short *up = (unsigned short *) userPtr;
+	unsigned short __user *up = (unsigned short __user *) userPtr;
 	int bal = expand_bal;
 	int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
 	int stereo = dmasound.soft.stereo;
@@ -447,7 +447,7 @@
 
 /* data in routines... */
 
-static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s8_read(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -465,13 +465,13 @@
 		val = *p++;
 		val = (val * software_input_volume) >> 7;
 		data = val >> 8;
-		if (put_user(data, (u_char *)userPtr++))
+		if (put_user(data, (u_char __user *)userPtr++))
 			return -EFAULT;
 		if (stereo) {
 			val = *p;
 			val = (val * software_input_volume) >> 7;
 			data = val >> 8;
-			if (put_user(data, (u_char *)userPtr++))
+			if (put_user(data, (u_char __user *)userPtr++))
 				return -EFAULT;
 		}
 		p++;
@@ -482,7 +482,7 @@
 }
 
 
-static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u8_read(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -500,13 +500,13 @@
 		val = *p++;
 		val = (val * software_input_volume) >> 7;
 		data = (val >> 8) ^ 0x80;
-		if (put_user(data, (u_char *)userPtr++))
+		if (put_user(data, (u_char __user *)userPtr++))
 			return -EFAULT;
 		if (stereo) {
 			val = *p;
 			val = (val * software_input_volume) >> 7;
 			data = (val >> 8) ^ 0x80;
-			if (put_user(data, (u_char *)userPtr++))
+			if (put_user(data, (u_char __user *)userPtr++))
 				return -EFAULT;
 		}
 		p++;
@@ -516,14 +516,14 @@
 	return stereo? used * 2: used;
 }
 
-static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
 	ssize_t count, used;
 	int stereo = dmasound.soft.stereo;
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 
 	frameLeft >>= 2;
 	userCount >>= (stereo? 2: 1);
@@ -548,7 +548,7 @@
 	return stereo? used * 4: used * 2;
 }
 
-static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -556,7 +556,7 @@
 	int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
 	int stereo = dmasound.soft.stereo;
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 
 	frameLeft >>= 2;
 	userCount >>= (stereo? 2: 1);
@@ -585,7 +585,7 @@
 
 /* data in routines (reducing speed)... */
 
-static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s8_read(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -614,11 +614,11 @@
 		p++;
 		if (bal < 0) {
 			data = vall >> 8;
-			if (put_user(data, (u_char *)userPtr++))
+			if (put_user(data, (u_char __user *)userPtr++))
 				return -EFAULT;
 			if (stereo) {
 				data = valr >> 8;
-				if (put_user(data, (u_char *)userPtr++))
+				if (put_user(data, (u_char __user *)userPtr++))
 					return -EFAULT;
 			}
 			userCount--;
@@ -634,7 +634,7 @@
 }
 
 
-static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u8_read(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -664,11 +664,11 @@
 		p++;
 		if (bal < 0) {
 			data = (vall >> 8) ^ 0x80;
-			if (put_user(data, (u_char *)userPtr++))
+			if (put_user(data, (u_char __user *)userPtr++))
 				return -EFAULT;
 			if (stereo) {
 				data = (valr >> 8) ^ 0x80;
-				if (put_user(data, (u_char *)userPtr++))
+				if (put_user(data, (u_char __user *)userPtr++))
 					return -EFAULT;
 			}
 			userCount--;
@@ -683,13 +683,13 @@
 	return stereo? utotal * 2: utotal;
 }
 
-static ssize_t pmac_ctx_s16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
 	int bal = expand_read_bal;
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 	int stereo = dmasound.soft.stereo;
 	int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
 	int utotal, ftotal;
@@ -730,14 +730,14 @@
 	return stereo? utotal * 4: utotal * 2;
 }
 
-static ssize_t pmac_ctx_u16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
 	int bal = expand_read_bal;
 	int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 	int stereo = dmasound.soft.stereo;
 	int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
 	int utotal, ftotal;
diff -Nru a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c
--- a/sound/oss/emu10k1/main.c	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/emu10k1/main.c	2004-07-27 18:24:52 -07:00
@@ -342,26 +342,26 @@
 {
 	char s[48];
 
-	if (!proc_mkdir ("driver/emu10k1", 0)) {
+	if (!proc_mkdir ("driver/emu10k1", NULL)) {
 		printk(KERN_ERR "emu10k1: unable to create proc directory driver/emu10k1\n");
 		goto err_out;
 	}
 
 	sprintf(s, "driver/emu10k1/%s", pci_name(card->pci_dev));
-	if (!proc_mkdir (s, 0)) {
+	if (!proc_mkdir (s, NULL)) {
 		printk(KERN_ERR "emu10k1: unable to create proc directory %s\n", s);
 		goto err_emu10k1_proc;
 	}
 
 	sprintf(s, "driver/emu10k1/%s/info", pci_name(card->pci_dev));
-	if (!create_proc_read_entry (s, 0, 0, emu10k1_info_proc, card)) {
+	if (!create_proc_read_entry (s, 0, NULL, emu10k1_info_proc, card)) {
 		printk(KERN_ERR "emu10k1: unable to create proc entry %s\n", s);
 		goto err_dev_proc;
 	}
 
 	if (!card->is_aps) {
 		sprintf(s, "driver/emu10k1/%s/ac97", pci_name(card->pci_dev));
-		if (!create_proc_read_entry (s, 0, 0, ac97_read_proc, card->ac97)) {
+		if (!create_proc_read_entry (s, 0, NULL, ac97_read_proc, card->ac97)) {
 			printk(KERN_ERR "emu10k1: unable to create proc entry %s\n", s);
 			goto err_proc_ac97;
 		}
diff -Nru a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
--- a/sound/oss/emu10k1/midi.c	2004-07-27 18:24:53 -07:00
+++ b/sound/oss/emu10k1/midi.c	2004-07-27 18:24:53 -07:00
@@ -532,7 +532,7 @@
 
 	if (card->seq_mididev) {
 		kfree(card->seq_mididev);
-		card->seq_mididev = 0;
+		card->seq_mididev = NULL;
 	}
 }
 
diff -Nru a/sound/oss/forte.c b/sound/oss/forte.c
--- a/sound/oss/forte.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/forte.c	2004-07-27 18:24:51 -07:00
@@ -1847,15 +1847,15 @@
 static int __init 
 forte_proc_init (void)
 {
-	if (!proc_mkdir ("driver/forte", 0))
+	if (!proc_mkdir ("driver/forte", NULL))
 		return -EIO;
 
-	if (!create_proc_read_entry ("driver/forte/chip", 0, 0, forte_proc_read, forte)) {
+	if (!create_proc_read_entry ("driver/forte/chip", 0, NULL, forte_proc_read, forte)) {
 		remove_proc_entry ("driver/forte", NULL);
 		return -EIO;
 	}
 
-	if (!create_proc_read_entry("driver/forte/ac97", 0, 0, ac97_read_proc, forte->ac97)) {
+	if (!create_proc_read_entry("driver/forte/ac97", 0, NULL, ac97_read_proc, forte->ac97)) {
 		remove_proc_entry ("driver/forte/chip", NULL);
 		remove_proc_entry ("driver/forte", NULL);
 		return -EIO;
diff -Nru a/sound/oss/gus_card.c b/sound/oss/gus_card.c
--- a/sound/oss/gus_card.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/gus_card.c	2004-07-27 18:24:51 -07:00
@@ -41,9 +41,6 @@
 {
 	gus_wave_init(hw_config);
 
-	request_region(hw_config->io_base, 16, "GUS");
-	request_region(hw_config->io_base + 0x100, 12, "GUS");	/* 0x10c-> is MAX */
-
 	if (sound_alloc_dma(hw_config->dma, "GUS"))
 		printk(KERN_ERR "gus_card.c: Can't allocate DMA channel %d\n", hw_config->dma);
 	if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma)
@@ -73,11 +70,7 @@
 			  printk(KERN_ERR "GUS: Unsupported IRQ %d\n", irq);
 			  return 0;
 		  }
-	if (check_region(hw_config->io_base, 16))
-		printk(KERN_ERR "GUS: I/O range conflict (1)\n");
-	else if (check_region(hw_config->io_base + 0x100, 16))
-		printk(KERN_ERR "GUS: I/O range conflict (2)\n");
-	else if (gus_wave_detect(hw_config->io_base))
+	if (gus_wave_detect(hw_config->io_base))
 		return 1;
 
 #ifndef EXCLUDE_GUS_IODETECT
@@ -86,17 +79,14 @@
 	 * Look at the possible base addresses (0x2X0, X=1, 2, 3, 4, 5, 6)
 	 */
 
-	for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10)
-		if (io_addr != hw_config->io_base)	/*
-							 * Already tested
-							 */
-			if (!check_region(io_addr, 16))
-				if (!check_region(io_addr + 0x100, 16))
-					if (gus_wave_detect(io_addr))
-					  {
-						  hw_config->io_base = io_addr;
-						  return 1;
-					  }
+	for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10) {
+		if (io_addr == hw_config->io_base)	/* Already tested */
+			continue;
+		if (gus_wave_detect(io_addr)) {
+			hw_config->io_base = io_addr;
+			return 1;
+		}
+	}
 #endif
 
 	printk("NO GUS card found !\n");
diff -Nru a/sound/oss/gus_wave.c b/sound/oss/gus_wave.c
--- a/sound/oss/gus_wave.c	2004-07-27 18:24:53 -07:00
+++ b/sound/oss/gus_wave.c	2004-07-27 18:24:53 -07:00
@@ -978,6 +978,13 @@
 	unsigned long   loc;
 	unsigned char   val;
 
+	if (!request_region(baseaddr, 16, "GUS"))
+		return 0;
+	if (!request_region(baseaddr + 0x100, 12, "GUS")) { /* 0x10c-> is MAX */
+		release_region(baseaddr, 16);
+		return 0;
+	}
+
 	gus_base = baseaddr;
 
 	gus_write8(0x4c, 0);	/* Reset GF1 */
@@ -1015,8 +1022,11 @@
 
 	/* See if there is first block there.... */
 	gus_poke(0L, 0xaa);
-	if (gus_peek(0L) != 0xaa)
-		return (0);
+	if (gus_peek(0L) != 0xaa) {
+		release_region(baseaddr + 0x100, 12);
+		release_region(baseaddr, 16);
+		return 0;
+	}
 
 	/* Now zero it out so that I can check for mirroring .. */
 	gus_poke(0L, 0x00);
diff -Nru a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
--- a/sound/oss/i810_audio.c	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/i810_audio.c	2004-07-27 18:24:52 -07:00
@@ -1396,7 +1396,7 @@
 static ssize_t i810_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct i810_state *state = (struct i810_state *)file->private_data;
-	struct i810_card *card=state ? state->card : 0;
+	struct i810_card *card=state ? state->card : NULL;
 	struct dmabuf *dmabuf = &state->dmabuf;
 	ssize_t ret;
 	unsigned long flags;
@@ -1536,7 +1536,7 @@
 static ssize_t i810_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct i810_state *state = (struct i810_state *)file->private_data;
-	struct i810_card *card=state ? state->card : 0;
+	struct i810_card *card=state ? state->card : NULL;
 	struct dmabuf *dmabuf = &state->dmabuf;
 	ssize_t ret;
 	unsigned long flags;
diff -Nru a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
--- a/sound/oss/msnd_pinnacle.c	2004-07-27 18:24:52 -07:00
+++ b/sound/oss/msnd_pinnacle.c	2004-07-27 18:24:52 -07:00
@@ -1145,11 +1145,10 @@
 	char *pinfiji = "Pinnacle/Fiji";
 #endif
 
-	if (check_region(dev.io, dev.numio)) {
+	if (!request_region(dev.io, dev.numio, "probing")) {
 		printk(KERN_ERR LOGNAME ": I/O port conflict\n");
 		return -ENODEV;
 	}
-	request_region(dev.io, dev.numio, "probing");
 
 	if (reset_dsp() < 0) {
 		release_region(dev.io, dev.numio);
@@ -1833,12 +1832,11 @@
 		/* Joystick */
 		pinnacle_devs[3].io0 = joystick_io;
 
-		if (check_region(cfg, 2)) {
+		if (!request_region(cfg, 2, "Pinnacle/Fiji Config")) {
 			printk(KERN_ERR LOGNAME ": Config port 0x%x conflict\n", cfg);
 			return -EIO;
 		}
 
-		request_region(cfg, 2, "Pinnacle/Fiji Config");
 		if (msnd_pinnacle_cfg_devices(cfg, reset, pinnacle_devs)) {
 			printk(KERN_ERR LOGNAME ": Device configuration error\n");
 			release_region(cfg, 2);
diff -Nru a/sound/oss/sb_common.c b/sound/oss/sb_common.c
--- a/sound/oss/sb_common.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/sb_common.c	2004-07-27 18:24:51 -07:00
@@ -1206,7 +1206,7 @@
 	if (last_devc == NULL)
 		return 0;
 
-	last_devc = 0;
+	last_devc = NULL;
 
 	if (hw_config->io_base <= 0)
 	{
diff -Nru a/sound/oss/wavfront.c b/sound/oss/wavfront.c
--- a/sound/oss/wavfront.c	2004-07-27 18:24:51 -07:00
+++ b/sound/oss/wavfront.c	2004-07-27 18:24:51 -07:00
@@ -312,7 +312,7 @@
 	{ 0x0E, "Bad MIDI channel number" },
 	{ 0x10, "Download Record Error" },
 	{ 0x80, "Success" },
-	{ 0x0, 0x0 }
+	{ 0 }
 };
 
 #define NEEDS_ACK 1
@@ -493,7 +493,7 @@
 
 	if (cmd == WFC_DOWNLOAD_MULTISAMPLE) {
 		wfcmd->write_cnt = (unsigned int) rbuf;
-		rbuf = 0;
+		rbuf = NULL;
 	}
 
 	DPRINT (WF_DEBUG_CMD, "0x%x [%s] (%d,%d,%d)\n",
@@ -745,7 +745,7 @@
 	wbuf[0] = sample_num & 0x7f;
 	wbuf[1] = sample_num >> 7;
 
-	if ((x = wavefront_cmd (WFC_DELETE_SAMPLE, 0, wbuf)) == 0) {
+	if ((x = wavefront_cmd (WFC_DELETE_SAMPLE, NULL, wbuf)) == 0) {
 		dev.sample_status[sample_num] = WF_ST_EMPTY;
 	}
 
@@ -934,7 +934,7 @@
 	bptr = munge_int32 (header->number, buf, 2);
 	munge_buf ((unsigned char *)&header->hdr.p, bptr, WF_PATCH_BYTES);
     
-	if (wavefront_cmd (WFC_DOWNLOAD_PATCH, 0, buf)) {
+	if (wavefront_cmd (WFC_DOWNLOAD_PATCH, NULL, buf)) {
 		printk (KERN_ERR LOGNAME "download patch failed\n");
 		return -(EIO);
 	}
@@ -972,7 +972,7 @@
 	buf[0] = header->number;
 	munge_buf ((unsigned char *)&header->hdr.pr, &buf[1], WF_PROGRAM_BYTES);
     
-	if (wavefront_cmd (WFC_DOWNLOAD_PROGRAM, 0, buf)) {
+	if (wavefront_cmd (WFC_DOWNLOAD_PROGRAM, NULL, buf)) {
 		printk (KERN_WARNING LOGNAME "download patch failed\n");	
 		return -(EIO);
 	}
@@ -986,7 +986,7 @@
 {
 	char rbuf[8];
 
-	if (wavefront_cmd (WFC_REPORT_FREE_MEMORY, rbuf, 0)) {
+	if (wavefront_cmd (WFC_REPORT_FREE_MEMORY, rbuf, NULL)) {
 		printk (KERN_WARNING LOGNAME "can't get memory stats.\n");
 		return -1;
 	} else {
@@ -1011,7 +1011,7 @@
 
 	UINT16 sample_short;
 	UINT32 length;
-	UINT16 __user *data_end = 0;
+	UINT16 __user *data_end = NULL;
 	unsigned int i;
 	const int max_blksize = 4096/2;
 	unsigned int written;
@@ -1188,7 +1188,7 @@
 
 	if (wavefront_cmd (header->size ?
 			   WFC_DOWNLOAD_SAMPLE : WFC_DOWNLOAD_SAMPLE_HEADER,
-			   0, sample_hdr)) {
+			   NULL, sample_hdr)) {
 		printk (KERN_WARNING LOGNAME "sample %sdownload refused.\n",
 			header->size ? "" : "header ");
 		return -(EIO);
@@ -1214,7 +1214,7 @@
 			blocksize = ((length-written+7)&~0x7);
 		}
 
-		if (wavefront_cmd (WFC_DOWNLOAD_BLOCK, 0, 0)) {
+		if (wavefront_cmd (WFC_DOWNLOAD_BLOCK, NULL, NULL)) {
 			printk (KERN_WARNING LOGNAME "download block "
 				"request refused.\n");
 			return -(EIO);
@@ -1321,7 +1321,7 @@
 	munge_int32 (header->hdr.a.FrequencyBias, &alias_hdr[20], 3);
 	munge_int32 (*(&header->hdr.a.FrequencyBias+1), &alias_hdr[23], 2);
 
-	if (wavefront_cmd (WFC_DOWNLOAD_SAMPLE_ALIAS, 0, alias_hdr)) {
+	if (wavefront_cmd (WFC_DOWNLOAD_SAMPLE_ALIAS, NULL, alias_hdr)) {
 		printk (KERN_ERR LOGNAME "download alias failed.\n");
 		return -(EIO);
 	}
@@ -1445,7 +1445,7 @@
 		munge_int32 (((unsigned char *)drum)[i], &drumbuf[1+(i*2)], 2);
 	}
 
-	if (wavefront_cmd (WFC_DOWNLOAD_EDRUM_PROGRAM, 0, drumbuf)) {
+	if (wavefront_cmd (WFC_DOWNLOAD_EDRUM_PROGRAM, NULL, drumbuf)) {
 		printk (KERN_ERR LOGNAME "download drum failed.\n");
 		return -(EIO);
 	}
@@ -2738,7 +2738,7 @@
 
 	voices[0] = 32;
 
-	if (wavefront_cmd (WFC_SET_NVOICES, 0, voices)) {
+	if (wavefront_cmd (WFC_SET_NVOICES, NULL, voices)) {
 		printk (KERN_WARNING LOGNAME
 			"cannot set number of voices to 32.\n");
 		goto gone_bad;
diff -Nru a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
--- a/sound/pci/au88x0/au88x0.h	2004-07-27 18:24:51 -07:00
+++ b/sound/pci/au88x0/au88x0.h	2004-07-27 18:24:51 -07:00
@@ -146,12 +146,12 @@
 #endif
 
 	/* Global resources */
-	char mixcapt[2];
-	char mixplayb[4];
+	s8 mixcapt[2];
+	s8 mixplayb[4];
 #ifndef CHIP_AU8820
-	char mixspdif[2];
-	char mixa3d[2];		/* mixers which collect all a3d streams. */
-	char mixxtlk[2];	/* crosstalk canceler mixer inputs. */
+	s8 mixspdif[2];
+	s8 mixa3d[2];	/* mixers which collect all a3d streams. */
+	s8 mixxtlk[2];	/* crosstalk canceler mixer inputs. */
 #endif
 	u32 fixed_res[5];
 
diff -Nru a/sound/pci/azt3328.c b/sound/pci/azt3328.c
--- a/sound/pci/azt3328.c	2004-07-27 18:24:51 -07:00
+++ b/sound/pci/azt3328.c	2004-07-27 18:24:51 -07:00
@@ -843,7 +843,7 @@
 		snd_azf3328_setdmaa(chip, runtime->dma_addr, snd_pcm_lib_period_bytes(substream), snd_pcm_lib_buffer_bytes(substream), 0);
 
 		spin_lock_irqsave(&chip->reg_lock, flags);
-#if WIN9X
+#ifdef WIN9X
 		/* FIXME: enable playback/recording??? */
 		status1 |= DMA_PLAY_SOMETHING1 | DMA_PLAY_SOMETHING2;
 		outw(status1, chip->codec_port+IDX_IO_PLAY_FLAGS);
@@ -933,7 +933,7 @@
 		snd_azf3328_setdmaa(chip, runtime->dma_addr, snd_pcm_lib_period_bytes(substream), snd_pcm_lib_buffer_bytes(substream), 1);
 
 		spin_lock_irqsave(&chip->reg_lock, flags);
-#if WIN9X
+#ifdef WIN9X
 		/* FIXME: enable playback/recording??? */
 		status1 |= DMA_PLAY_SOMETHING1 | DMA_PLAY_SOMETHING2;
 		outw(status1, chip->codec_port+IDX_IO_REC_FLAGS);
@@ -993,7 +993,7 @@
 	unsigned long flags;
 
 	spin_lock_irqsave(&chip->reg_lock, flags);
-#if QUERY_HARDWARE
+#ifdef QUERY_HARDWARE
 	bufptr = inl(chip->codec_port+IDX_IO_PLAY_DMA_START_1);
 #else
 	bufptr = substream->runtime->dma_addr;
@@ -1016,7 +1016,7 @@
 	unsigned long flags;
 
 	spin_lock_irqsave(&chip->reg_lock, flags);
-#if QUERY_HARDWARE
+#ifdef QUERY_HARDWARE
 	bufptr = inl(chip->codec_port+IDX_IO_REC_DMA_START_1);
 #else
 	bufptr = substream->runtime->dma_addr;
diff -Nru a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
--- a/sound/pci/ice1712/ice1712.c	2004-07-27 18:24:51 -07:00
+++ b/sound/pci/ice1712/ice1712.c	2004-07-27 18:24:51 -07:00
@@ -2295,7 +2295,7 @@
 	snd_ice1712_hoontech_cards,
 	snd_ice1712_delta_cards,
 	snd_ice1712_ews_cards,
-	0,
+	NULL,
 };
 
 static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice,
diff -Nru a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
--- a/sound/pci/ice1712/ice1724.c	2004-07-27 18:24:51 -07:00
+++ b/sound/pci/ice1712/ice1724.c	2004-07-27 18:24:51 -07:00
@@ -1815,7 +1815,7 @@
 	snd_vt1724_revo_cards,
 	snd_vt1724_amp_cards, 
 	snd_vt1724_aureon_cards,
-	0,
+	NULL,
 };
 
 
diff -Nru a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
--- a/sound/pci/intel8x0m.c	2004-07-27 18:24:51 -07:00
+++ b/sound/pci/intel8x0m.c	2004-07-27 18:24:51 -07:00
@@ -1328,7 +1328,7 @@
 	{ 0x5455, "ALi M5455" },
 	{ 0x746d, "AMD AMD8111" },
 #endif
-	{ 0, 0 },
+	{ 0 },
 };
 
 static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
diff -Nru a/sound/pci/maestro3.c b/sound/pci/maestro3.c
--- a/sound/pci/maestro3.c	2004-07-27 18:24:52 -07:00
+++ b/sound/pci/maestro3.c	2004-07-27 18:24:52 -07:00
@@ -968,7 +968,7 @@
 		.amp_gpio = 0x03,
 	},
 	/* END */
-	{ 0 }
+	{ NULL }
 };
 
 
diff -Nru a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
--- a/sound/pci/rme9652/hdsp.c	2004-07-27 18:24:51 -07:00
+++ b/sound/pci/rme9652/hdsp.c	2004-07-27 18:24:51 -07:00
@@ -4971,16 +4971,16 @@
 
 	hdsp->irq = -1;
 	hdsp->state = 0;
-	hdsp->midi[0].rmidi = 0;
-	hdsp->midi[1].rmidi = 0;
-	hdsp->midi[0].input = 0;
-	hdsp->midi[1].input = 0;
-	hdsp->midi[0].output = 0;
-	hdsp->midi[1].output = 0;
+	hdsp->midi[0].rmidi = NULL;
+	hdsp->midi[1].rmidi = NULL;
+	hdsp->midi[0].input = NULL;
+	hdsp->midi[1].input = NULL;
+	hdsp->midi[0].output = NULL;
+	hdsp->midi[1].output = NULL;
 	spin_lock_init(&hdsp->midi[0].lock);
 	spin_lock_init(&hdsp->midi[1].lock);
 	hdsp->iobase = 0;
-	hdsp->res_port = 0;
+	hdsp->res_port = NULL;
 	hdsp->control_register = 0;
 	hdsp->control2_register = 0;
 	hdsp->io_type = Undefined;
diff -Nru a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
--- a/sound/pci/sonicvibes.c	2004-07-27 18:24:52 -07:00
+++ b/sound/pci/sonicvibes.c	2004-07-27 18:24:52 -07:00
@@ -805,7 +805,7 @@
 	sonic->mode |= SV_MODE_PLAY;
 	sonic->playback_substream = substream;
 	runtime->hw = snd_sonicvibes_playback;
-	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_sonicvibes_hw_constraint_dac_rate, 0, SNDRV_PCM_HW_PARAM_RATE, -1);
+	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_sonicvibes_hw_constraint_dac_rate, NULL, SNDRV_PCM_HW_PARAM_RATE, -1);
 	return 0;
 }
 
diff -Nru a/sound/ppc/pmac.c b/sound/ppc/pmac.c
--- a/sound/ppc/pmac.c	2004-07-27 18:24:53 -07:00
+++ b/sound/ppc/pmac.c	2004-07-27 18:24:53 -07:00
@@ -896,7 +896,7 @@
 		sound = sound->next;
 	if (! sound)
 		return -ENODEV;
-	prop = (unsigned int *) get_property(sound, "sub-frame", 0);
+	prop = (unsigned int *) get_property(sound, "sub-frame", NULL);
 	if (prop && *prop < 16)
 		chip->subframe = *prop;
 	/* This should be verified on older screamers */
@@ -938,7 +938,7 @@
 		// chip->can_byte_swap = 0; /* FIXME: check this */
 		chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
 	}
-	prop = (unsigned int *)get_property(sound, "device-id", 0);
+	prop = (unsigned int *)get_property(sound, "device-id", NULL);
 	if (prop)
 		chip->device_id = *prop;
 	chip->has_iic = (find_devices("perch") != NULL);