http://linux.bkbits.net/linux-2.5 viro@parcelfarce.linux.theplanet.co.uk[torvalds]|ChangeSet|20040713183017|39795 viro # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/07/13 11:30:17-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] compat_fillonedir() warning fix # # access_ok() expects a pointer, not unsigned long. It's not a # problem on platforms that have this guy done as a macro (or ones that # do not use fs/compat.c at all), but that's still wrong and on some # platforms that care we actually have access_ok() as inlined function. # Bogus cast removed. # # fs/compat.c # 2004/07/13 07:09:43-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # compat_fillonedir() warning fix # # ChangeSet # 2004/07/13 11:16:58-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] __vfs_follow_link() made inline again # # __vfs_follow_link() really should be inline; that's a special case since # we are in the middle of recursion and really want to conserve stack # space. Moved before the first use, made inline again. # # fs/namei.c # 2004/07/13 07:08:53-07:00 viro@parcelfarce.linux.theplanet.co.uk +55 -55 # __vfs_follow_link() made inline again # # ChangeSet # 2004/07/13 11:16:47-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: more fs/* NULL noise removal # # (partially based on patch from Mika Kukkonen) # # fs/reiserfs/super.c # 2004/07/13 07:07:40-07:00 viro@parcelfarce.linux.theplanet.co.uk +21 -20 # sparse: more fs/* NULL noise removal # # fs/nfs/nfs4proc.c # 2004/07/13 07:07:30-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: more fs/* NULL noise removal # # fs/lockd/xdr4.c # 2004/07/13 07:07:17-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: more fs/* NULL noise removal # # fs/jffs/jffs_fm.c # 2004/07/13 07:07:03-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -3 # sparse: more fs/* NULL noise removal # # fs/ext2/xattr.c # 2004/07/13 07:07:10-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -1 # sparse: more fs/* NULL noise removal # # ChangeSet # 2004/07/13 11:04:12-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: assorted drivers/* NULL noise removal # # drivers/video/riva/riva_hw.c # 2004/07/13 06:49:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -8 # sparse: assorted drivers/* NULL noise removal # # drivers/video/kyro/fbdev.c # 2004/07/13 06:49:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/video/i810/i810_gtf.c # 2004/07/13 06:49:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/video/fbmem.c # 2004/07/13 06:49:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/video/cirrusfb.c # 2004/07/13 06:49:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/video/aty/mach64_cursor.c # 2004/07/13 06:49:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/scsi/sr.c # 2004/07/13 06:48:46-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/scsi/ppa.c # 2004/07/13 06:48:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/scsi/imm.c # 2004/07/13 06:48:29-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/scsi/i60uscsi.c # 2004/07/13 06:48:19-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/pnp/pnpbios/core.c # 2004/07/13 06:48:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: assorted drivers/* NULL noise removal # # drivers/pnp/pnpbios/bioscalls.c # 2004/07/13 06:47:52-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: assorted drivers/* NULL noise removal # # drivers/pcmcia/cardbus.c # 2004/07/13 06:47:42-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/pci/hotplug/shpchp_hpc.c # 2004/07/13 06:47:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: assorted drivers/* NULL noise removal # # drivers/pci/hotplug/shpchp_ctrl.c # 2004/07/13 06:47:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/pci/hotplug/pciehp_hpc.c # 2004/07/13 06:47:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: assorted drivers/* NULL noise removal # # drivers/pci/hotplug/pciehp_ctrl.c # 2004/07/13 06:47:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/pci/hotplug/ibmphp_hpc.c # 2004/07/13 06:47:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/07/13 06:47:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/pci/hotplug/cpci_hotplug_core.c # 2004/07/13 06:47:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: assorted drivers/* NULL noise removal # # drivers/pci/hotplug/acpiphp_glue.c # 2004/07/13 06:47:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/isdn/capi/capidrv.c # 2004/07/13 06:46:53-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/char/ipmi/ipmi_si_intf.c # 2004/07/13 06:46:29-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/char/ipmi/ipmi_msghandler.c # 2004/07/13 06:46:23-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/char/drm/sis_ds.c # 2004/07/13 06:45:51-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: assorted drivers/* NULL noise removal # # drivers/char/drm/radeon_state.c # 2004/07/13 06:45:36-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/char/drm/radeon_mem.c # 2004/07/13 06:46:04-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -7 # sparse: assorted drivers/* NULL noise removal # # drivers/char/drm/drm_drv.h # 2004/07/13 06:45:13-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: assorted drivers/* NULL noise removal # # drivers/char/drm/drm_bufs.h # 2004/07/13 06:45:07-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: assorted drivers/* NULL noise removal # # drivers/char/cyclades.c # 2004/07/13 06:46:36-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -7 # sparse: assorted drivers/* NULL noise removal # # ChangeSet # 2004/07/13 11:03:58-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: net/* NULL noise removal # # net/sctp/protocol.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/irda/irlmp.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: net/* NULL noise removal # # net/irda/ircomm/ircomm_tty.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: net/* NULL noise removal # # net/ipv6/mcast.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +34 -34 # sparse: net/* NULL noise removal # # net/ipv6/ip6_output.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/ipv6/anycast.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: net/* NULL noise removal # # net/ipv6/af_inet6.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: net/* NULL noise removal # # net/ipv6/addrconf.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/ipv4/netfilter/ip_nat_snmp_basic.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/ipv4/ipvs/ip_vs_xmit.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/ipv4/ipvs/ip_vs_sync.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/econet/af_econet.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/core/pktgen.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: net/* NULL noise removal # # net/bluetooth/hci_sysfs.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/bluetooth/af_bluetooth.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/atm/signaling.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # net/atm/clip.c # 2004/07/13 06:39:15-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # include/linux/netdevice.h # 2004/07/13 06:39:23-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: net/* NULL noise removal # # ChangeSet # 2004/07/13 11:03:46-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: drivers/usb NULL noise removal # # drivers/usb/storage/sddr09.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/serial/kobil_sct.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/serial/keyspan.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/net/usbnet.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +13 -13 # sparse: drivers/usb NULL noise removal # # drivers/usb/net/kaweth.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/misc/usbtest.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +12 -12 # sparse: drivers/usb NULL noise removal # # drivers/usb/misc/speedtch.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/misc/auerswald.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/media/pwc-if.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/media/pwc-ctrl.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/media/ov511.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/input/powermate.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/input/aiptek.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -5 # sparse: drivers/usb NULL noise removal # # drivers/usb/image/microtek.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/image/mdc800.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: drivers/usb NULL noise removal # # drivers/usb/host/ohci-q.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -7 # sparse: drivers/usb NULL noise removal # # drivers/usb/host/ohci-mem.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/usb NULL noise removal # # drivers/usb/host/ohci-hub.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/usb NULL noise removal # # drivers/usb/host/ohci-hcd.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -5 # sparse: drivers/usb NULL noise removal # # drivers/usb/host/ohci-dbg.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/usb NULL noise removal # # drivers/usb/host/ehci-sched.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: drivers/usb NULL noise removal # # drivers/usb/host/ehci-dbg.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/gadget/zero.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +10 -10 # sparse: drivers/usb NULL noise removal # # drivers/usb/gadget/net2280.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +28 -28 # sparse: drivers/usb NULL noise removal # # drivers/usb/gadget/inode.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +16 -16 # sparse: drivers/usb NULL noise removal # # drivers/usb/gadget/file_storage.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/usb NULL noise removal # # drivers/usb/gadget/ether.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +22 -22 # sparse: drivers/usb NULL noise removal # # drivers/usb/gadget/epautoconf.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/usb NULL noise removal # # drivers/usb/class/usb-midi.c # 2004/07/13 06:31:48-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -8 # sparse: drivers/usb NULL noise removal # # ChangeSet # 2004/07/13 11:03:33-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: drivers/net partial NULL noise removal # # drivers/net/wireless/strip.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/wireless/ray_cs.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/wireless/orinoco_tmd.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +0 -2 # sparse: drivers/net partial NULL noise removal # # drivers/net/wireless/orinoco_plx.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +0 -2 # sparse: drivers/net partial NULL noise removal # # drivers/net/wireless/atmel_cs.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/wireless/atmel.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/wireless/airo_cs.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/wireless/airo.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/net partial NULL noise removal # # drivers/net/wan/x25_asy.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/wan/syncppp.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: drivers/net partial NULL noise removal # # drivers/net/wan/sbni.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/net partial NULL noise removal # # drivers/net/wan/pc300_tty.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/net partial NULL noise removal # # drivers/net/wan/lmc/lmc_proto.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/wan/lmc/lmc_main.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: drivers/net partial NULL noise removal # # drivers/net/tulip/winbond-840.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: drivers/net partial NULL noise removal # # drivers/net/tulip/eeprom.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/net partial NULL noise removal # # drivers/net/tulip/de4x5.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: drivers/net partial NULL noise removal # # drivers/net/tokenring/smctr.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/tokenring/olympic.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/tokenring/lanstreamer.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/sk98lin/skvpd.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/net partial NULL noise removal # # drivers/net/sk98lin/sktimer.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/net partial NULL noise removal # # drivers/net/rrunner.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/net partial NULL noise removal # # drivers/net/pcnet32.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/ne2k-pci.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/net partial NULL noise removal # # drivers/net/dgrs.c # 2004/07/13 06:29:35-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/net partial NULL noise removal # # ChangeSet # 2004/07/13 11:03:20-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: drivers/media NULL noise removal # # drivers/media/dvb/ttusb-dec/ttusb_dec.c # 2004/07/13 06:27:50-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c # 2004/07/13 06:27:50-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/ttpci/av7110_ca.c # 2004/07/13 06:27:50-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/ttpci/av7110_av.c # 2004/07/13 06:27:50-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -5 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/ttpci/av7110.c # 2004/07/13 06:27:50-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/frontends/tda1004x.c # 2004/07/13 06:27:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/dvb-core/dvbdev.c # 2004/07/13 06:27:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/dvb-core/dvb_net.c # 2004/07/13 06:27:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +11 -14 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/dvb-core/dvb_demux.c # 2004/07/13 06:27:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +13 -13 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/dvb-core/dvb_ca_en50221.c # 2004/07/13 06:27:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/dvb-core/dmxdev.c # 2004/07/13 06:27:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +18 -18 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/bt8xx/dvb-bt8xx.c # 2004/07/13 06:27:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/media NULL noise removal # # drivers/media/dvb/b2c2/skystar2.c # 2004/07/13 06:27:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: drivers/media NULL noise removal # # ChangeSet # 2004/07/13 11:03:08-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: gemtek ioctl fix # # Dumb Typo(tm) - the first bug caught by 0/NULL checks (arg is # really a kernel pointer there, so memset() is actually OK - results # will be copied to userland by caller. Or would be, if we would not # oops ;-) # # drivers/media/radio/radio-gemtek.c # 2004/07/13 06:26:57-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: gemtek ioctl fix # # ChangeSet # 2004/07/13 11:02:57-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: ipc compat annotations and cleanups # # ipc compat code switched to compat_alloc_user_space() and annotated. # # ipc/compat_mq.c # 2004/07/13 06:13:59-07:00 viro@parcelfarce.linux.theplanet.co.uk +43 -80 # sparse: ipc compat annotations and cleanups # # ipc/compat.c # 2004/07/13 06:13:53-07:00 viro@parcelfarce.linux.theplanet.co.uk +83 -131 # sparse: ipc compat annotations and cleanups # # ChangeSet # 2004/07/13 11:02:45-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: arch/* NULL noise removal # # include/asm-sparc64/pgtable.h # 2004/07/13 06:10:20-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # include/asm-sparc64/pgalloc.h # 2004/07/13 06:10:09-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # include/asm-sparc/processor.h # 2004/07/13 06:09:51-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -14 # sparse: arch/* NULL noise removal # # arch/x86_64/kernel/traps.c # 2004/07/13 06:09:17-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/x86_64/kernel/smp.c # 2004/07/13 06:09:11-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/x86_64/kernel/pci-gart.c # 2004/07/13 06:09:02-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/x86_64/kernel/ldt.c # 2004/07/13 06:08:55-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/x86_64/kernel/irq.c # 2004/07/13 06:08:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/x86_64/kernel/i8259.c # 2004/07/13 06:08:43-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/sparc64/kernel/power.c # 2004/07/13 06:08:26-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/sparc64/kernel/irq.c # 2004/07/13 06:08:20-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/sparc64/kernel/ebus.c # 2004/07/13 06:08:14-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -9 # sparse: arch/* NULL noise removal # # arch/sparc64/kernel/auxio.c # 2004/07/13 06:07:55-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: arch/* NULL noise removal # # arch/sparc/mm/sun4c.c # 2004/07/13 06:07:37-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: arch/* NULL noise removal # # arch/sparc/mm/init.c # 2004/07/13 06:07:42-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/sparc/kernel/time.c # 2004/07/13 06:07:24-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: arch/* NULL noise removal # # arch/sparc/kernel/sys_sunos.c # 2004/07/13 06:07:16-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: arch/* NULL noise removal # # arch/sparc/kernel/sun4d_irq.c # 2004/07/13 06:06:59-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: arch/* NULL noise removal # # arch/sparc/kernel/sun4c_irq.c # 2004/07/13 06:06:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/sparc/kernel/signal.c # 2004/07/13 06:06:37-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: arch/* NULL noise removal # # arch/sparc/kernel/process.c # 2004/07/13 06:06:27-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/sparc/kernel/irq.c # 2004/07/13 06:06:21-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # arch/sparc/kernel/ioport.c # 2004/07/13 06:06:09-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: arch/* NULL noise removal # # arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c # 2004/07/13 06:05:57-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: arch/* NULL noise removal # # ChangeSet # 2004/07/13 11:02:33-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: signal annotation # # ss_sp in struct sigaltstack made __user # ->si_addr and ->sival_ptr made __user # your ->sa_restorer and ->sa_handler changes propagated # users of these guys annotated on i386/amd64/alpha/sparc/sparc64 # # kernel/exit.c # 2004/07/13 06:00:38-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: signal annotation # # include/asm-x86_64/vsyscall32.h # 2004/07/13 06:00:17-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # include/asm-x86_64/signal.h # 2004/07/13 05:52:12-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -3 # sparse: signal annotation # # include/asm-sparc64/signal.h # 2004/07/13 05:51:54-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -3 # sparse: signal annotation # # include/asm-generic/siginfo.h # 2004/07/13 05:52:28-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # include/asm-alpha/signal.h # 2004/07/13 05:52:39-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -4 # sparse: signal annotation # # drivers/usb/core/devio.c # 2004/07/13 05:59:52-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: signal annotation # # arch/x86_64/mm/fault.c # 2004/07/13 05:59:29-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # arch/x86_64/kernel/traps.c # 2004/07/13 05:59:13-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: signal annotation # # arch/x86_64/ia32/ia32_signal.c # 2004/07/13 05:58:13-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -9 # sparse: signal annotation # # arch/sparc64/mm/fault.c # 2004/07/13 05:57:45-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # arch/sparc64/kernel/traps.c # 2004/07/13 05:57:31-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -9 # sparse: signal annotation # # arch/sparc64/kernel/sys_sunos32.c # 2004/07/13 05:57:19-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # arch/sparc64/kernel/sys_sparc32.c # 2004/07/13 05:57:10-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: signal annotation # # arch/sparc64/kernel/sys_sparc.c # 2004/07/13 05:57:02-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: signal annotation # # arch/sparc64/kernel/signal32.c # 2004/07/13 05:56:55-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: signal annotation # # arch/sparc/mm/fault.c # 2004/07/13 05:56:23-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: signal annotation # # arch/sparc/kernel/unaligned.c # 2004/07/13 05:54:52-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: signal annotation # # arch/sparc/kernel/traps.c # 2004/07/13 05:55:02-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -9 # sparse: signal annotation # # arch/sparc/kernel/sys_sunos.c # 2004/07/13 05:55:27-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: signal annotation # # arch/sparc/kernel/sys_sparc.c # 2004/07/13 05:55:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: signal annotation # # arch/sparc/kernel/signal.c # 2004/07/13 05:56:08-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: signal annotation # # arch/i386/mm/fault.c # 2004/07/13 05:54:23-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # arch/i386/kernel/traps.c # 2004/07/13 05:54:11-07:00 viro@parcelfarce.linux.theplanet.co.uk +8 -8 # sparse: signal annotation # # arch/i386/kernel/signal.c # 2004/07/13 05:53:49-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -3 # sparse: signal annotation # # arch/i386/kernel/i8259.c # 2004/07/13 05:53:56-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # arch/alpha/mm/fault.c # 2004/07/13 05:53:26-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # arch/alpha/kernel/traps.c # 2004/07/13 05:53:18-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -9 # sparse: signal annotation # # arch/alpha/kernel/signal.c # 2004/07/13 05:53:05-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: signal annotation # # arch/alpha/kernel/osf_sys.c # 2004/07/13 05:52:56-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: signal annotation # # ChangeSet # 2004/07/13 11:02:21-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: alpha topology.h compile fix # # Missing bits of cpumask_t conversion # # include/asm-alpha/topology.h # 2004/07/13 05:45:12-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -4 # sparse: alpha topology.h compile fix # # ChangeSet # 2004/07/13 11:02:10-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: alpha sparse infrastructure # # * added usual CHECK assignment in Makefile # * switched uaccess.h to __check_uptr() # * added L on long constants (ones missed earlier) # * added __user in osf_sys.c (duh - I've added __user to cast in # the initializer, but forgot to add it in declaration) # # include/asm-alpha/uaccess.h # 2004/07/13 05:44:42-07:00 viro@parcelfarce.linux.theplanet.co.uk +49 -58 # sparse: alpha sparse infrastructure # # include/asm-alpha/fpu.h # 2004/07/13 05:44:17-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: alpha sparse infrastructure # # include/asm-alpha/core_lca.h # 2004/07/13 05:44:10-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: alpha sparse infrastructure # # arch/alpha/kernel/osf_sys.c # 2004/07/13 05:43:20-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: alpha sparse infrastructure # # arch/alpha/kernel/core_tsunami.c # 2004/07/13 05:42:52-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: alpha sparse infrastructure # # arch/alpha/Makefile # 2004/07/13 05:43:54-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -0 # sparse: alpha sparse infrastructure # # ChangeSet # 2004/07/13 11:01:58-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: alpha NULL noise removal # # include/asm-alpha/spinlock.h # 2004/07/13 05:37:59-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: alpha NULL noise removal # # include/asm-alpha/pgalloc.h # 2004/07/13 05:37:51-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: alpha NULL noise removal # # arch/alpha/kernel/traps.c # 2004/07/13 05:40:14-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -3 # sparse: alpha NULL noise removal # # arch/alpha/kernel/smp.c # 2004/07/13 05:39:39-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: alpha NULL noise removal # # arch/alpha/kernel/smc37c669.c # 2004/07/13 05:39:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: alpha NULL noise removal # # arch/alpha/kernel/process.c # 2004/07/13 05:39:20-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: alpha NULL noise removal # # arch/alpha/kernel/osf_sys.c # 2004/07/13 05:42:18-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: alpha NULL noise removal # # arch/alpha/kernel/irq.c # 2004/07/13 05:38:32-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: alpha NULL noise removal # # ChangeSet # 2004/07/13 11:01:46-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: drivers/sbus annotation # # include/asm-sparc/vfc_ioctls.h # 2004/07/13 05:20:50-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/sbus annotation # # drivers/sbus/char/vfc_dev.c # 2004/07/13 05:18:36-07:00 viro@parcelfarce.linux.theplanet.co.uk +16 -17 # sparse: drivers/sbus annotation # # drivers/sbus/char/rtc.c # 2004/07/13 05:17:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -2 # sparse: drivers/sbus annotation # # drivers/sbus/char/riowatchdog.c # 2004/07/13 05:17:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +7 -6 # sparse: drivers/sbus annotation # # drivers/sbus/char/openprom.c # 2004/07/13 05:17:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +26 -24 # sparse: drivers/sbus annotation # # drivers/sbus/char/flash.c # 2004/07/13 05:17:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: drivers/sbus annotation # # drivers/sbus/char/envctrl.c # 2004/07/13 05:17:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +13 -13 # sparse: drivers/sbus annotation # # drivers/sbus/char/display7seg.c # 2004/07/13 05:17:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/sbus annotation # # drivers/sbus/char/cpwatchdog.c # 2004/07/13 05:17:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +10 -11 # sparse: drivers/sbus annotation # # drivers/sbus/char/bpp.c # 2004/07/13 05:17:34-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: drivers/sbus annotation # # ChangeSet # 2004/07/13 11:01:35-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: drivers/sbus fixes # # a) vfc is not 64bit-clean, marked as such in Kconfig # b) aurora is simply broken - still uses tqueues. Marked as broken. # c) vfc does dereferencing of userland pointer, right after having # carefully copied the data to kernel space ;-) Fixed. # d) vfc ->mmap() had missed prototype change. Fixed. # e) BPP ioctls are misdeclared - they should've been _IO(...) instead # of _IOR(..., void). Too late to fix, but we can at least make them # _IOR(..., char) - same value, but doesn't try to find sizeof(void). # # include/asm-sparc64/bpp.h # 2004/07/13 05:20:08-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/sbus fixes # # include/asm-sparc/bpp.h # 2004/07/13 05:20:23-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/sbus fixes # # drivers/sbus/char/vfc_dev.c # 2004/07/13 05:16:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +3 -4 # sparse: drivers/sbus fixes # # drivers/sbus/char/Kconfig # 2004/07/13 05:19:46-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: drivers/sbus fixes # # ChangeSet # 2004/07/13 11:01:23-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: NULL noise removal in drivers/sbus # # drivers/sbus/sbus.c # 2004/07/13 05:09:52-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: NULL noise removal in drivers/sbus # # drivers/sbus/dvma.c # 2004/07/13 05:09:47-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: NULL noise removal in drivers/sbus # # drivers/sbus/char/flash.c # 2004/07/13 05:11:09-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: NULL noise removal in drivers/sbus # # drivers/sbus/char/envctrl.c # 2004/07/13 05:10:55-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: NULL noise removal in drivers/sbus # # drivers/sbus/char/display7seg.c # 2004/07/13 05:10:33-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: NULL noise removal in drivers/sbus # # ChangeSet # 2004/07/13 11:01:12-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: tms380tr.c fix # # tms380tr is used both by ISA and PCI drivers. Enabling/disabling # DMA is done only for ISA ones (it's protected by if (dev->dma > 0) and # PCI ones leave it 0), but it's compiled unconditionally. Which breaks # on platforms that don't have that ISA crap at all, but support PCI just # fine. Code in question placed under ifdef CONFIG_ISA. # # drivers/net/tokenring/tms380tr.c # 2004/07/13 05:05:19-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -0 # sparse: tms380tr.c fix # # ChangeSet # 2004/07/13 11:01:01-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: compile fix for rrunner on big-endian platforms # # bitrot strikes again... # # drivers/net/rrunner.c # 2004/07/13 05:03:13-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -1 # sparse: compile fix for rrunner on big-endian platforms # # ChangeSet # 2004/07/13 11:00:50-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: saa fix # # direct write to userland pointer. # # drivers/media/video/saa5246a.c # 2004/07/13 04:46:18-07:00 viro@parcelfarce.linux.theplanet.co.uk +50 -47 # sparse: saa fix # # ChangeSet # 2004/07/13 11:00:39-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: isdn compile fix for platforms with HZ > 1000 # # Division by zero is an ugly thing... We are safe wrt overflows, # since the maximal value we ever pass is 10000 - not enough to overflow # unless you've got a platform with HZ > 200000. # # drivers/isdn/sc/hardware.h # 2004/07/13 04:34:29-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: isdn compile fix for platforms with HZ > 1000 # # ChangeSet # 2004/07/13 11:00:27-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: usb ioctl cleanups # # usb ioctls in compat_ioctl.c switched to compat_alloc_user_space() # and cleaned up; ioctl structures annotated. # # include/linux/usbdevice_fs.h # 2004/07/13 04:31:23-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: usb ioctl cleanups # # fs/compat_ioctl.c # 2004/07/13 04:30:59-07:00 viro@parcelfarce.linux.theplanet.co.uk +20 -93 # sparse: usb ioctl cleanups # # ChangeSet # 2004/07/13 11:00:16-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: VIDIOCSWIN compat_ioctl fixes # # In handling of VIDIOCSWIN for 32bit on 64bit platforms: # * switched to compat_alloc_user_space() # * fixed memory corruption in copying arguments from userland # * fixed arithmetic overflows # * added missing checks for get_user() results # and corresponding returns with -EFAULT. # # fs/compat_ioctl.c # 2004/07/13 04:24:39-07:00 viro@parcelfarce.linux.theplanet.co.uk +61 -69 # sparse: VIDIOCSWIN compat_ioctl fixes # # ChangeSet # 2004/07/13 11:00:06-07:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] sparse: switching afs to kvec # # - afs and rxrpc switched to kvec; definition of kvec moved to uio.h (duh). # - afs/mntpt.c got missing cast added. # # at that point afs is sparse-clean and rxrpc has only one remaining warning # (setsockopt from local variable, protected by set_fs()). # # net/rxrpc/transport.c # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -2 # sparse: switching afs to kvec # # net/rxrpc/connection.c # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -2 # sparse: switching afs to kvec # # net/rxrpc/call.c # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +5 -5 # sparse: switching afs to kvec # # include/rxrpc/message.h # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +2 -2 # sparse: switching afs to kvec # # include/rxrpc/call.h # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: switching afs to kvec # # include/linux/uio.h # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +9 -0 # sparse: switching afs to kvec # # include/linux/mtd/mtd.h # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +0 -5 # sparse: switching afs to kvec # # fs/afs/vlclient.c # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +4 -4 # sparse: switching afs to kvec # # fs/afs/mntpt.c # 2004/07/13 04:17:42-07:00 viro@parcelfarce.linux.theplanet.co.uk +1 -1 # sparse: switching afs to kvec # # fs/afs/fsclient.c # 2004/07/13 04:15:00-07:00 viro@parcelfarce.linux.theplanet.co.uk +6 -6 # sparse: switching afs to kvec # # ChangeSet # 2004/07/13 00:42:45-05:00 stevef@smfhome.smfdom # Set DevMajor/DevMinor when querying info on remote char/block devices # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/inode.c # 2004/07/13 00:42:37-05:00 stevef@smfhome.smfdom +4 -0 # Set DevMajor/DevMinor when querying info on remote char/block devices # # fs/cifs/file.c # 2004/07/13 00:42:37-05:00 stevef@smfhome.smfdom +4 -0 # Set DevMajor/DevMinor when querying info on remote char/block devices # # fs/cifs/CHANGES # 2004/07/13 00:42:37-05:00 stevef@smfhome.smfdom +2 -1 # update cifs change log # # ChangeSet # 2004/07/12 23:47:18-05:00 stevef@smfhome1.smfdom # Set Type field when creating block/char/pipe e.g. via mknod. # Fixing problem mentioned by Jeremy Allison # # remove spurious warning message logged on mount with credentials file (pointed # out by Richard Hughes) # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/connect.c # 2004/07/12 23:47:11-05:00 stevef@smfhome1.smfdom +2 -0 # fix warning message logged when mount specifies credentials file # # fs/cifs/cifssmb.c # 2004/07/12 23:47:11-05:00 stevef@smfhome1.smfdom +17 -0 # Fix problem with mknod pointed out by jra (not passing the type field) # # fs/cifs/TODO # 2004/07/12 23:47:11-05:00 stevef@smfhome1.smfdom +2 -2 # update cifs todo list # # fs/cifs/README # 2004/07/12 23:47:11-05:00 stevef@smfhome1.smfdom +5 -4 # update cifs readme for info about mknod # # fs/cifs/CHANGES # 2004/07/12 23:47:10-05:00 stevef@smfhome1.smfdom +3 -1 # update cifs change log # # ChangeSet # 2004/07/12 21:41:31-05:00 stevef@smfhome.smfdom # fix the null pointer sparse warning al viros way (resolving potential merge conflict) # # Signed-off-by: Steve French (sfrench@us.ibm.com) # # fs/cifs/cifs_uniupr.h # 2004/07/12 21:41:24-05:00 stevef@smfhome.smfdom +0 -1 # fix the null pointer sparse warning al viros way (resolving potential merge conflict) # # fs/cifs/asn1.c # 2004/07/12 21:37:20-05:00 stevef@smfhome.smfdom +0 -1 # Auto merged # # ChangeSet # 2004/07/13 00:13:32+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 1962/1: S3C2410 - Rename MACH_VR1000 to Thorcom-VR1000 # # Patch from Ben Dooks # # Place correct machine name for VR1000 in machine # support file. # # arch/arm/mach-s3c2410/mach-vr1000.c # 2004/07/12 23:56:27+01:00 ben-linux@org.rmk.(none) +5 -3 # [PATCH] 1962/1: S3C2410 - Rename MACH_VR1000 to Thorcom-VR1000 # # ChangeSet # 2004/07/13 00:03:03+01:00 ben-linux@org.rmk.(none) # [ARM PATCH] 1961/1: S3C2410 - fix for UART FIFO size calculation # # Patch from Ben Dooks # # Fixes calculation of how many bytes in the RX/TX FIFOs. # # Previous code failed to check wether the full flags # where set before returning the byte counter. This # should ensure that the serial driver behaves correctly # when the FIFO fills, and not just ignore the input # data # # include/asm-arm/arch-s3c2410/regs-serial.h # 2004/07/12 23:35:45+01:00 ben-linux@org.rmk.(none) +17 -2 # [PATCH] 1961/1: S3C2410 - fix for UART FIFO size calculation # # ChangeSet # 2004/07/12 23:37:33+01:00 jelenz@edu.rmk.(none) # [ARM PATCH] 1958/1: make collie use INIT_MACHINE # # Patch from John Lenz # # make collie use the new INIT_MACHINE macro instead of arch_initcall. # # arch/arm/mach-sa1100/collie.c # 2004/07/12 01:00:00+01:00 jelenz@edu.rmk.(none) +2 -6 # [PATCH] 1958/1: make collie use INIT_MACHINE # # ChangeSet # 2004/07/12 14:27:49-07:00 steiner@sgi.com # [PATCH] ia64: Reduce TLB flushing during process migration # # This patch adds an architecture-specific callout after explicit # processor migrations. The callout allows architectures (or platforms) # to update TLB specific information (ex., cpu_vm_mask). # # Signed-off-by: Jack Steiner # Signed-off-by: David Mosberger # # kernel/sched.c # 2004/07/10 17:14:00-07:00 steiner@sgi.com +2 -0 # ia64: Reduce TLB flushing during process migration # # include/asm-ia64/tlb.h # 2004/07/10 17:14:00-07:00 steiner@sgi.com +3 -0 # ia64: Reduce TLB flushing during process migration # # include/asm-ia64/machvec_sn2.h # 2004/07/10 17:14:00-07:00 steiner@sgi.com +2 -0 # ia64: Reduce TLB flushing during process migration # # include/asm-ia64/machvec.h # 2004/07/10 17:14:00-07:00 steiner@sgi.com +14 -0 # ia64: Reduce TLB flushing during process migration # # include/asm-generic/tlb.h # 2004/07/10 17:14:00-07:00 steiner@sgi.com +2 -0 # ia64: Reduce TLB flushing during process migration # # arch/ia64/sn/kernel/sn2/sn2_smp.c # 2004/07/10 17:14:00-07:00 steiner@sgi.com +15 -0 # ia64: Reduce TLB flushing during process migration # # Documentation/cachetlb.txt # 2004/07/10 17:14:00-07:00 steiner@sgi.com +11 -0 # ia64: Reduce TLB flushing during process migration # # ChangeSet # 2004/07/12 13:28:17-07:00 kaos@sgi.com # [PATCH] ia64: build fixes for IA64_MCA_DEBUG_INFO # # Make mca.c build again with debug enabled. # # Signed-off-by: Keith Owens # Signed-off-by: David Mosberger # # arch/ia64/kernel/mca.c # 2004/07/12 05:48:52-07:00 kaos@sgi.com +2 -2 # ia64: build fixes for IA64_MCA_DEBUG_INFO # # ChangeSet # 2004/07/12 09:09:51-07:00 viro@www.linux.org.uk # [PATCH] sparse: drivers/media/* annotation # # include/media/video-buf.h # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/media/* annotation # # include/media/saa7146_vv.h # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # include/linux/videotext.h # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # include/linux/videodev2.h # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/media/* annotation # # include/linux/videodev.h # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # include/linux/dvb/video.h # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # include/linux/dvb/osd.h # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/video/zoran_procfs.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/video/zoran_driver.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +5 -5 # sparse: drivers/media/* annotation # # drivers/media/video/w9966.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +11 -11 # sparse: drivers/media/* annotation # # drivers/media/video/videodev.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +5 -5 # sparse: drivers/media/* annotation # # drivers/media/video/video-buf.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +3 -3 # sparse: drivers/media/* annotation # # drivers/media/video/v4l1-compat.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/video/tvmixer.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +7 -5 # sparse: drivers/media/* annotation # # drivers/media/video/stradis.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +6 -8 # sparse: drivers/media/* annotation # # drivers/media/video/saa7134/saa7134-video.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/video/saa7134/saa7134-ts.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/video/saa7134/saa7134-oss.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +36 -33 # sparse: drivers/media/* annotation # # drivers/media/video/pms.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/media/* annotation # # drivers/media/video/cx88/cx88-video.c # 2004/07/12 01:01:15-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/video/cpia.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/media/* annotation # # drivers/media/video/c-qcam.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/media/* annotation # # drivers/media/video/bw-qcam.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/media/* annotation # # drivers/media/video/bttv-driver.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +3 -3 # sparse: drivers/media/* annotation # # drivers/media/radio/radio-cadet.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/radio/miropcm20-rds.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/dvb/ttpci/av7110_ir.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/dvb/ttpci/av7110_ca.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +4 -4 # sparse: drivers/media/* annotation # # drivers/media/dvb/ttpci/av7110_av.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +4 -4 # sparse: drivers/media/* annotation # # drivers/media/dvb/dvb-core/dvb_functions.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +3 -3 # sparse: drivers/media/* annotation # # drivers/media/dvb/dvb-core/dvb_ca_en50221.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/media/* annotation # # drivers/media/dvb/dvb-core/dmxdev.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +5 -5 # sparse: drivers/media/* annotation # # drivers/media/common/saa7146_video.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # drivers/media/common/saa7146_vbi.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/media/* annotation # # ChangeSet # 2004/07/12 09:09:37-07:00 viro@www.linux.org.uk # [PATCH] sparse: blind dereference of userland pointers in ac7110 # # drivers/media/dvb/ttpci/av7110_hw.c # 2004/07/12 01:01:14-07:00 viro@www.linux.org.uk +20 -5 # sparse: blind dereference of userland pointers in ac7110 # # ChangeSet # 2004/07/12 09:09:26-07:00 viro@www.linux.org.uk # [PATCH] sparse: dvb_ringbuffer_pkt_write()/dvb_ringbuffer_write() annotation # # copy_from_user() moved from dvb_ringbuffer_{write,pkt_write}() to callers; # these functions are always getting kernel pointer now. "usermem" argument # killed, code annotated. # # drivers/media/dvb/ttpci/av7110_ca.c # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +22 -6 # sparse: dvb_ringbuffer_pkt_write()/dvb_ringbuffer_write() annotation # # drivers/media/dvb/ttpci/av7110_av.c # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +39 -14 # sparse: dvb_ringbuffer_pkt_write()/dvb_ringbuffer_write() annotation # # drivers/media/dvb/dvb-core/dvb_ringbuffer.h # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +3 -4 # sparse: dvb_ringbuffer_pkt_write()/dvb_ringbuffer_write() annotation # # drivers/media/dvb/dvb-core/dvb_ringbuffer.c # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +5 -16 # sparse: dvb_ringbuffer_pkt_write()/dvb_ringbuffer_write() annotation # # drivers/media/dvb/dvb-core/dvb_ca_en50221.c # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +1 -1 # sparse: dvb_ringbuffer_pkt_write()/dvb_ringbuffer_write() annotation # # ChangeSet # 2004/07/12 09:09:14-07:00 viro@www.linux.org.uk # [PATCH] sparse: drivers/isdn/* annotation # # include/linux/kernelcapi.h # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/isdn/* annotation # # include/linux/capi.h # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/isdn/* annotation # # drivers/isdn/tpam/tpam_memory.c # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/isdn/* annotation # # drivers/isdn/tpam/tpam_commands.c # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +4 -4 # sparse: drivers/isdn/* annotation # # drivers/isdn/tpam/tpam.h # 2004/07/12 01:01:13-07:00 viro@www.linux.org.uk +2 -2 # sparse: drivers/isdn/* annotation # # drivers/isdn/sc/scioc.h # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/isdn/* annotation # # drivers/isdn/sc/ioctl.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +9 -11 # sparse: drivers/isdn/* annotation # # drivers/isdn/sc/command.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/isdn/* annotation # # drivers/isdn/icn/icn.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +15 -13 # sparse: drivers/isdn/* annotation # # drivers/isdn/i4l/isdn_tty.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/isdn/* annotation # # drivers/isdn/hisax/isar.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +3 -3 # sparse: drivers/isdn/* annotation # # drivers/isdn/hardware/eicon/mntfunc.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +3 -3 # sparse: drivers/isdn/* annotation # # drivers/isdn/hardware/eicon/divasmain.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +4 -4 # sparse: drivers/isdn/* annotation # # drivers/isdn/hardware/eicon/divasi.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +4 -4 # sparse: drivers/isdn/* annotation # # drivers/isdn/hardware/eicon/divamnt.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +8 -8 # sparse: drivers/isdn/* annotation # # drivers/isdn/hardware/eicon/diva.h # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +5 -5 # sparse: drivers/isdn/* annotation # # drivers/isdn/hardware/eicon/diva.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +3 -3 # sparse: drivers/isdn/* annotation # # drivers/isdn/capi/kcapi.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +9 -10 # sparse: drivers/isdn/* annotation # # drivers/isdn/capi/capi.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +1 -2 # sparse: drivers/isdn/* annotation # # drivers/isdn/act2000/module.c # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +5 -3 # sparse: drivers/isdn/* annotation # # drivers/isdn/act2000/act2000_isa.h # 2004/07/12 01:01:12-07:00 viro@www.linux.org.uk +1 -1 # sparse: drivers/isdn/* annotation # # drivers/isdn/act2000/act2000_isa.c # 2004/07/12 01:01:11-07:00 viro@www.linux.org.uk +4 -4 # sparse: drivers/isdn/* annotation # # drivers/isdn/act2000/act2000.h # 2004/07/12 01:01:10-07:00 viro@www.linux.org.uk +3 -1 # sparse: drivers/isdn/* annotation # # ChangeSet # 2004/07/12 09:09:03-07:00 viro@www.linux.org.uk # [PATCH] sparse: blind dereference of userland pointers in divasproc # # drivers/isdn/hardware/eicon/divasproc.c # 2004/07/12 01:01:08-07:00 viro@www.linux.org.uk +21 -8 # sparse: blind dereference of userland pointers in divasproc # # ChangeSet # 2004/07/12 09:08:51-07:00 viro@www.linux.org.uk # [PATCH] sparse: ISDN ->readstat() and ->writecmd() annotation # # ->readstat() and ->writecmd() are always getting a userland pointer; # marked argument as such, killed "user" flag, killed dead code. # # include/linux/isdnif.h # 2004/07/12 01:01:07-07:00 viro@www.linux.org.uk +2 -10 # sparse: ISDN ->readstat() and ->writecmd() annotation # # drivers/isdn/pcbit/drv.c # 2004/07/12 01:01:07-07:00 viro@www.linux.org.uk +25 -46 # sparse: ISDN ->readstat() and ->writecmd() annotation # # drivers/isdn/isdnloop/isdnloop.c # 2004/07/12 01:01:07-07:00 viro@www.linux.org.uk +7 -10 # sparse: ISDN ->readstat() and ->writecmd() annotation # # drivers/isdn/icn/icn.c # 2004/07/12 01:01:07-07:00 viro@www.linux.org.uk +7 -10 # sparse: ISDN ->readstat() and ->writecmd() annotation # # drivers/isdn/i4l/isdn_common.c # 2004/07/12 01:01:07-07:00 viro@www.linux.org.uk +2 -2 # sparse: ISDN ->readstat() and ->writecmd() annotation # # drivers/isdn/hisax/config.c # 2004/07/12 01:01:07-07:00 viro@www.linux.org.uk +4 -10 # sparse: ISDN ->readstat() and ->writecmd() annotation # # drivers/isdn/capi/capidrv.c # 2004/07/12 01:01:07-07:00 viro@www.linux.org.uk +3 -6 # sparse: ISDN ->readstat() and ->writecmd() annotation # # drivers/isdn/act2000/module.c # 2004/07/12 01:01:07-07:00 viro@www.linux.org.uk +6 -9 # sparse: ISDN ->readstat() and ->writecmd() annotation # # ChangeSet # 2004/07/12 09:08:39-07:00 viro@www.linux.org.uk # [PATCH] sparse: misc NULL noise in drivers/* # # drivers/net/wan/cosa.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +5 -5 # sparse: misc NULL noise in drivers/* # # drivers/net/tokenring/ibmtr.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/net/pcmcia/xirc2ps_cs.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/net/pcmcia/smc91c92_cs.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/net/irda/vlsi_ir.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +3 -3 # sparse: misc NULL noise in drivers/* # # drivers/net/irda/irtty-sir.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/net/appletalk/ltpc.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/message/i2o/i2o_proc.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/message/i2o/i2o_config.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/message/fusion/mptscsih.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/media/video/zoran_procfs.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/media/video/zoran_driver.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +4 -6 # sparse: misc NULL noise in drivers/* # # drivers/media/video/videocodec.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/media/video/tea6415c.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/media/video/mxb.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/media/video/meye.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/media/video/hexium_orion.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/media/video/dpc7146.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/media/video/cpia.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +3 -3 # sparse: misc NULL noise in drivers/* # # drivers/media/video/bw-qcam.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/media/video/bttv-cards.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/media/radio/miropcm20-radio.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/md/kcopyd.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/input/joystick/grip_mp.c # 2004/07/12 01:01:06-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/input/joystick/grip.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/ide/pci/siimage.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/ide/legacy/ide-cs.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/char/rtc.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/char/rocket.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +4 -4 # sparse: misc NULL noise in drivers/* # # drivers/char/pcmcia/synclink_cs.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +4 -4 # sparse: misc NULL noise in drivers/* # # drivers/char/mwave/tp3780i.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +4 -4 # sparse: misc NULL noise in drivers/* # # drivers/char/mwave/mwavedd.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +4 -4 # sparse: misc NULL noise in drivers/* # # drivers/block/xd.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +11 -11 # sparse: misc NULL noise in drivers/* # # drivers/block/paride/pf.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/block/paride/pcd.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/block/paride/paride.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/block/cryptoloop.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +4 -4 # sparse: misc NULL noise in drivers/* # # drivers/atm/lanai.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/atm/iphase.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/atm/idt77252.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/atm/horizon.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +7 -7 # sparse: misc NULL noise in drivers/* # # drivers/atm/he.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/atm/firestream.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in drivers/* # # drivers/atm/ambassador.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in drivers/* # # drivers/acpi/toshiba_acpi.c # 2004/07/12 01:01:05-07:00 viro@www.linux.org.uk +5 -5 # sparse: misc NULL noise in drivers/* # # ChangeSet # 2004/07/12 09:08:24-07:00 viro@www.linux.org.uk # [PATCH] sparse: NULL noise in drivers/isdn # # drivers/isdn/sc/ioctl.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +4 -4 # sparse: NULL noise in drivers/isdn # # drivers/isdn/sc/command.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in drivers/isdn # # drivers/isdn/pcbit/module.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +3 -3 # sparse: NULL noise in drivers/isdn # # drivers/isdn/i4l/isdn_tty.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +6 -6 # sparse: NULL noise in drivers/isdn # # drivers/isdn/i4l/isdn_net.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +11 -12 # sparse: NULL noise in drivers/isdn # # drivers/isdn/i4l/isdn_common.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hisax/tei.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +3 -3 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hisax/hfc_usb.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hisax/elsa_ser.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hisax/diva.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hisax/config.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/um_idi.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +15 -15 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/os_pri.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +5 -5 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/os_bri.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +6 -6 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/os_4bri.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +13 -13 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/mntfunc.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/message.c # 2004/07/12 01:01:04-07:00 viro@www.linux.org.uk +45 -45 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/maintidi.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +4 -4 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/idifunc.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/dqueue.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +4 -4 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/divasmain.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/divasfunc.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/divamnt.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +6 -6 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/diva_dma.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +4 -5 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/diva.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +14 -14 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/diddfunc.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/di.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +3 -3 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/debug.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +46 -46 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/dadapter.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/capimain.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in drivers/isdn # # drivers/isdn/hardware/eicon/capifunc.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in drivers/isdn # # drivers/isdn/capi/kcapi_proc.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +3 -3 # sparse: NULL noise in drivers/isdn # # drivers/isdn/capi/kcapi.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +9 -9 # sparse: NULL noise in drivers/isdn # # drivers/isdn/capi/capiutil.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +100 -162 # sparse: NULL noise in drivers/isdn # # drivers/isdn/capi/capilib.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +4 -4 # sparse: NULL noise in drivers/isdn # # drivers/isdn/capi/capidrv.c # 2004/07/12 01:01:03-07:00 viro@www.linux.org.uk +110 -110 # sparse: NULL noise in drivers/isdn # # drivers/isdn/capi/capi.c # 2004/07/12 01:00:57-07:00 viro@www.linux.org.uk +20 -19 # sparse: NULL noise in drivers/isdn # # ChangeSet # 2004/07/12 09:08:11-07:00 viro@www.linux.org.uk # [PATCH] sparse: megaraid annotation # # drivers/scsi/megaraid.h # 2004/07/12 01:00:55-07:00 viro@www.linux.org.uk +4 -4 # sparse: megaraid annotation # # drivers/scsi/megaraid.c # 2004/07/12 01:00:55-07:00 viro@www.linux.org.uk +35 -35 # sparse: megaraid annotation # # ChangeSet # 2004/07/12 09:08:00-07:00 viro@www.linux.org.uk # [PATCH] sparse: megaraid inline fixes # # inlined functions moved, a couple of heavy-weight ones (issue_scb() # and meg_cmd_done()) uninlined. # # drivers/scsi/megaraid.h # 2004/07/12 01:00:55-07:00 viro@www.linux.org.uk +4 -12 # sparse: megaraid inline fixes # # drivers/scsi/megaraid.c # 2004/07/12 01:14:50-07:00 viro@www.linux.org.uk +156 -164 # sparse: megaraid inline fixes # # ChangeSet # 2004/07/12 09:07:49-07:00 viro@www.linux.org.uk # [PATCH] sparse: aacraid annotation # # drivers/scsi/aacraid/linit.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +2 -2 # sparse: aacraid annotation # # drivers/scsi/aacraid/commctrl.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +24 -24 # sparse: aacraid annotation # # drivers/scsi/aacraid/aacraid.h # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +3 -3 # sparse: aacraid annotation # # drivers/scsi/aacraid/aachba.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +4 -4 # sparse: aacraid annotation # # ChangeSet # 2004/07/12 09:07:37-07:00 viro@www.linux.org.uk # [PATCH] sparse: misc NULL noise in fs/* # # fs/sysv/inode.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in fs/* # # fs/qnx4/inode.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +3 -3 # sparse: misc NULL noise in fs/* # # fs/minix/inode.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in fs/* # # fs/isofs/compress.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # fs/hpfs/buffer.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +2 -2 # sparse: misc NULL noise in fs/* # # fs/hfsplus/inode.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # fs/ext3/acl.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # fs/ext2/acl.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # fs/coda/sysctl.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # fs/coda/psdev.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # fs/coda/inode.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # fs/cifs/cifs_uniupr.h # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # fs/cifs/asn1.c # 2004/07/12 01:00:54-07:00 viro@www.linux.org.uk +1 -1 # sparse: misc NULL noise in fs/* # # ChangeSet # 2004/07/12 09:07:25-07:00 viro@www.linux.org.uk # [PATCH] sparse: NULL noise in fs/reiserfs # # include/linux/reiserfs_fs.h # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/tail_conversion.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/super.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +3 -3 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/stree.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +7 -7 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/procfs.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/prints.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +7 -7 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/namei.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +12 -12 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/lbalance.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +7 -7 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/item_ops.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/inode.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +8 -8 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/ibalance.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +2 -2 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/fix_node.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +6 -6 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/file.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +1 -1 # sparse: NULL noise in fs/reiserfs # # fs/reiserfs/do_balan.c # 2004/07/12 01:00:53-07:00 viro@www.linux.org.uk +11 -11 # sparse: NULL noise in fs/reiserfs # # ChangeSet # 2004/07/12 02:01:59-07:00 davem@nuts.davemloft.net # [SPARC64]: Update defconfig. # # arch/sparc64/defconfig # 2004/07/12 02:01:41-07:00 davem@nuts.davemloft.net +7 -5 # [SPARC64]: Update defconfig. # # ChangeSet # 2004/07/11 23:56:52-07:00 wesolows@foobazco.org # [SPARC32]: Don't allow the kernel to read PAGE_NONE pages. # # include/asm-sparc/pgtsrmmu.h # 2004/07/11 23:53:22-07:00 wesolows@foobazco.org +1 -1 # [SPARC32]: Don't allow the kernel to read PAGE_NONE pages. # # ChangeSet # 2004/07/11 23:09:44-07:00 wesolows@foobazco.org # Merge foobazco.org:/sources/2.5-bk # into foobazco.org:/sources/2.5-sparc-todave # # arch/sparc/kernel/setup.c # 2004/07/11 23:09:37-07:00 wesolows@foobazco.org +0 -0 # Auto merged # # ChangeSet # 2004/07/11 20:34:31-07:00 torvalds@ppc970.osdl.org # x86: fix stackframe ownership confusion in sys_sigaltstack() # # gcc doesn't understand that "asmlinkage" routines have the # argument stack owned by the assembly-language caller, and the # recent sparse cleanup made gcc think it owns enough stack # frame space to make a tailcall by overwriting "struct pt_regs" # that is set up by the low-level system call code. # # Hide that problem again. # # The real fix would be to tell gcc that the caller owns the # stack frame that it set up, but we don't have any such # interfaces, so for now the best we can do is to hide it. # # arch/i386/kernel/signal.c # 2004/07/11 20:34:24-07:00 torvalds@ppc970.osdl.org +7 -4 # x86: fix stackframe ownership confusion in sys_sigaltstack() # # gcc doesn't understand that "asmlinkage" routines have the # argument stack owned by the assembly-language caller, and the # recent sparse cleanup made gcc think it owns enough stack # frame space to make a tailcall by overwriting "struct pt_regs" # that is set up by the low-level system call code. # # Hide that problem again. # # The real fix would be to tell gcc that the caller owns the # stack frame that it set up, but we don't have any such # interfaces, so for now the best we can do is to hide it. # # ChangeSet # 2004/07/11 17:49:02-07:00 gandalf@netfilter.org # [NETFILTER]: Add timestamping to ipt_ULOG # # After Andi's timestamp optimizations we don't have any timestamps on the # packets unless someone requested them. Here's a patch for 2.6 to # explicitly timestamp the packets before we log them. # # Harald approved it some time ago, he's pretty busy so I'm sending it # instead. # # Signed-off-by: Martin Josefsson # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_ULOG.c # 2004/07/11 17:48:47-07:00 gandalf@netfilter.org +4 -0 # [NETFILTER]: Add timestamping to ipt_ULOG # # After Andi's timestamp optimizations we don't have any timestamps on the # packets unless someone requested them. Here's a patch for 2.6 to # explicitly timestamp the packets before we log them. # # Harald approved it some time ago, he's pretty busy so I'm sending it # instead. # # Signed-off-by: Martin Josefsson # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/11 17:47:10-07:00 akpm@osdl.org # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/sctp/ulpqueue.c # 2004/07/11 17:46:55-07:00 akpm@osdl.org +12 -12 # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/sctp/ulpevent.c # 2004/07/11 17:46:55-07:00 akpm@osdl.org +37 -40 # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/sctp/socket.c # 2004/07/11 17:46:55-07:00 akpm@osdl.org +61 -62 # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/sctp/sm_statefuns.c # 2004/07/11 17:46:55-07:00 akpm@osdl.org +1 -1 # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/sctp/protocol.c # 2004/07/11 17:46:55-07:00 akpm@osdl.org +1 -1 # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/sctp/outqueue.c # 2004/07/11 17:46:55-07:00 akpm@osdl.org +6 -6 # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/sctp/output.c # 2004/07/11 17:46:55-07:00 akpm@osdl.org +3 -3 # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/sctp/inqueue.c # 2004/07/11 17:46:55-07:00 akpm@osdl.org +1 -1 # [SPARSE]: Fix warnings in net/sctp/ # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/11 17:41:54-07:00 bunk@fs.tum.de # [IPV4]: Remove no longer available URL. # # This patch solves Bugzilla #2445 by removing a no longer available URL # from the help text for NET_IPIP. # # Noted by Nils Hammar . # # Signed-off-by: Adrian Bunk # Signed-off-by: David S. Miller # # net/ipv4/Kconfig # 2004/07/11 17:41:39-07:00 bunk@fs.tum.de +1 -2 # [IPV4]: Remove no longer available URL. # # This patch solves Bugzilla #2445 by removing a no longer available URL # from the help text for NET_IPIP. # # Noted by Nils Hammar . # # Signed-off-by: Adrian Bunk # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/11 17:19:27-07:00 davem@nuts.davemloft.net # [SPARC64]: Add CMT register defines. # # include/asm-sparc64/asi.h # 2004/07/11 17:19:05-07:00 davem@nuts.davemloft.net +130 -117 # [SPARC64]: Add CMT register defines. # # include/asm-sparc64/cmt.h # 2004/07/11 17:18:59-07:00 davem@nuts.davemloft.net +59 -0 # [SPARC64]: Add CMT register defines. # # include/asm-sparc64/cmt.h # 2004/07/11 17:18:59-07:00 davem@nuts.davemloft.net +0 -0 # BitKeeper file /disk1/BK/sparc-2.6/include/asm-sparc64/cmt.h # # ChangeSet # 2004/07/11 18:34:22-05:00 stevef@smfhome.smfdom # clean up NULL vs. 0 warnings generated by sparse tool # # fs/cifs/misc.c # 2004/07/11 18:34:15-05:00 stevef@smfhome.smfdom +1 -1 # clean up NULL vs. 0 warnings generated by sparse tool # # fs/cifs/file.c # 2004/07/11 18:34:15-05:00 stevef@smfhome.smfdom +4 -4 # clean up NULL vs. 0 warnings generated by sparse tool # # fs/cifs/connect.c # 2004/07/11 18:34:15-05:00 stevef@smfhome.smfdom +5 -5 # clean up NULL vs. 0 warnings generated by sparse tool # # fs/cifs/cifssmb.c # 2004/07/11 18:34:15-05:00 stevef@smfhome.smfdom +3 -3 # clean up NULL vs. 0 warnings generated by sparse tool # # fs/cifs/cifs_uniupr.h # 2004/07/11 18:34:15-05:00 stevef@smfhome.smfdom +1 -1 # clean up NULL vs. 0 warnings generated by sparse tool # # fs/cifs/cifs_debug.c # 2004/07/11 18:34:15-05:00 stevef@smfhome.smfdom +12 -12 # clean up NULL vs. 0 warnings generated by sparse tool # # Signed-off-by: Steve French ()sfrench@us.ibm.com # # fs/cifs/asn1.c # 2004/07/11 18:34:15-05:00 stevef@smfhome.smfdom +1 -1 # clean up NULL vs. 0 warnings generated by sparse tool # # ChangeSet # 2004/07/12 00:16:21+01:00 rmk@flint.arm.linux.org.uk # [ARM] ohci-omap does not need asm/mach-types.h # # drivers/usb/host/ohci-omap.c # 2004/07/12 00:13:13+01:00 rmk@flint.arm.linux.org.uk +0 -1 # ohci-omap does not need asm/mach-types.h # # ChangeSet # 2004/07/11 14:54:01-07:00 torvalds@ppc970.osdl.org # Remove obsoleted drivers/char/h8.c drivers/char/h8.h. # # BitKeeper/deleted/.del-h8.h~4bba92103a47b655 # 2004/07/11 14:52:54-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/char/h8.h # # BitKeeper/deleted/.del-h8.c~542a1cae26f267c5 # 2004/07/11 14:52:54-07:00 torvalds@ppc970.osdl.org +0 -0 # Delete: drivers/char/h8.c # # ChangeSet # 2004/07/10 12:13:58-07:00 yoshfuji@linux-ipv6.org # [NET]: Fix dst_underflow_bug_msg printk args. # # include/net/dst.h # 2004/07/10 12:13:43-07:00 yoshfuji@linux-ipv6.org +3 -1 # [NET]: Fix dst_underflow_bug_msg printk args. # # ChangeSet # 2004/07/10 12:13:01-07:00 herbert@gondor.apana.org.au # [IPCOMP6]: Exclude IPCOMP header from props.header_len # # Now that the IPv4 encap stuff is out of the way, I'll be sending you # the IPv6 versions. # # Here is the one to remove the unnecessary extra space reserved for # IPCOMP. # # Signed-off-by: Herbert Xu # Signed-off-by: Yoshifuji Hideaki # Signed-off-by: David S. Miller # # net/ipv6/ipcomp6.c # 2004/07/10 12:12:45-07:00 herbert@gondor.apana.org.au +5 -13 # [IPCOMP6]: Exclude IPCOMP header from props.header_len # # Now that the IPv4 encap stuff is out of the way, I'll be sending you # the IPv6 versions. # # Here is the one to remove the unnecessary extra space reserved for # IPCOMP. # # Signed-off-by: Herbert Xu # Signed-off-by: Yoshifuji Hideaki # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/10 11:53:57-07:00 herbert@gondor.apana.org.au # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/xfrm4_tunnel.c # 2004/07/10 11:53:29-07:00 herbert@gondor.apana.org.au +5 -44 # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/xfrm4_policy.c # 2004/07/10 11:53:29-07:00 herbert@gondor.apana.org.au +1 -1 # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/ipcomp.c # 2004/07/10 11:53:29-07:00 herbert@gondor.apana.org.au +7 -69 # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/esp4.c # 2004/07/10 11:53:29-07:00 herbert@gondor.apana.org.au +10 -69 # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/ah4.c # 2004/07/10 11:53:29-07:00 herbert@gondor.apana.org.au +19 -59 # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/Makefile # 2004/07/10 11:53:29-07:00 herbert@gondor.apana.org.au +2 -1 # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # include/net/xfrm.h # 2004/07/10 11:53:29-07:00 herbert@gondor.apana.org.au +1 -0 # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/xfrm4_output.c # 2004/07/10 11:53:15-07:00 herbert@gondor.apana.org.au +120 -0 # [IPSEC]: Move generic encap code into xfrm4_output # # I've finally finished merging the general encapsulation code for IPv4. # Here is the patch. # # The idea is basically to make x->type->output similar in structure to # x->type->input. That means moving the tunnel encapsulation and other # generic code out. # # They have ended up in xfrm4_output.c. # # The advantage of this is that we have exactly one copy of the tunnel # encapsulation code. So if we need to change it (e.g., set the TTL # according to the route) then it's easier and less error-prone. # # In fact, in doing so I've already noticed that the ECN wasn't being # copied correctly in everything except xfrm4_tunnel. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/xfrm4_output.c # 2004/07/10 11:53:15-07:00 herbert@gondor.apana.org.au +0 -0 # BitKeeper file /disk1/BK/net-2.6/net/ipv4/xfrm4_output.c # # ChangeSet # 2004/07/09 22:11:36-07:00 davidm@tiger.hpl.hp.com # ia64: Nuke a warning due to the syscall auditing patch. # # arch/ia64/kernel/ptrace.c # 2004/07/09 22:11:26-07:00 davidm@tiger.hpl.hp.com +5 -9 # (syscall_trace_enter): Minor formatting fixes. # (syscall_trace_leave): Nuke a warning messages which shows when # syscall-auditing is disabled since in that case, the "regs" # argument was unused. # # ChangeSet # 2004/07/09 22:03:40-07:00 davidm@tiger.hpl.hp.com # ia64: Fix EFI physical-mode stubs to correctly calculate physical address # # This fixes a bug in which the Ski simulator ended up getting the wrong # time, since phys_get_time() ended up storing the correct time in the # wrong place if a region-5 virtual address was passed (as would happen # for stack variables of the init-task). On real machines, this bug # likely would have caused a crash on machines which don't support # switching EFI into virtual mode. # # arch/ia64/kernel/efi.c # 2004/07/09 22:03:28-07:00 davidm@tiger.hpl.hp.com +50 -34 # (prefix##_get_time): Allow for "tc" argument to be a NULL pointer. # (prefix##_set_wakeup_time): Likewise for "tm" argument. # (prefix##_get_variable): Likewise for "attr" argument. # (prefix##_reset_system): Likewise for "data" argument. # (STUB_*): Use ia64_tpa instead of __pa for physical-mode stubs and # an identity macro id() for virtual-mode stubs. # # ChangeSet # 2004/07/09 17:05:22-07:00 tomd@csds.uidaho.edu # [CRYPTO]: Set CRYPTO_TFM_RES_BAD_KEY_LEN in twofish. # # crypto/twofish.c # 2004/07/09 17:05:07-07:00 tomd@csds.uidaho.edu +3 -0 # [CRYPTO]: Set CRYPTO_TFM_RES_BAD_KEY_LEN in twofish. # # ChangeSet # 2004/07/09 16:56:37-07:00 herbert@gondor.apana.org.au # [IPSEC]: Fix uh->len when doing NATT with IP options. # # I just noticed that the UDP header length in esp4_output() is incorrect # when IP options are present (in transport mode). This patch fixes exactly # that. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/esp4.c # 2004/07/09 16:56:22-07:00 herbert@gondor.apana.org.au +1 -1 # [IPSEC]: Fix uh->len when doing NATT with IP options. # # I just noticed that the UDP header length in esp4_output() is incorrect # when IP options are present (in transport mode). This patch fixes exactly # that. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/09 16:51:35-07:00 herbert@gondor.apana.org.au # [XFRM]: Add FLUSHSA and FLUSHPOLICY. # # This patch adds FLUSHSA and FLUSHPOLICY to xfrm_user which are # analagous to SADB_FLUSH and SADB_X_SPDFLUSH in af_key. # # This is useful in KMs on startup/shutdown so that the system is # reset to a known state. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/xfrm/xfrm_user.c # 2004/07/09 16:51:20-07:00 herbert@gondor.apana.org.au +20 -0 # [XFRM]: Add FLUSHSA and FLUSHPOLICY. # # This patch adds FLUSHSA and FLUSHPOLICY to xfrm_user which are # analagous to SADB_FLUSH and SADB_X_SPDFLUSH in af_key. # # This is useful in KMs on startup/shutdown so that the system is # reset to a known state. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # include/linux/xfrm.h # 2004/07/09 16:51:20-07:00 herbert@gondor.apana.org.au +9 -0 # [XFRM]: Add FLUSHSA and FLUSHPOLICY. # # This patch adds FLUSHSA and FLUSHPOLICY to xfrm_user which are # analagous to SADB_FLUSH and SADB_X_SPDFLUSH in af_key. # # This is useful in KMs on startup/shutdown so that the system is # reset to a known state. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/09 16:50:29-07:00 jmorris@redhat.com # [CRYPTO]: Remove lazy allocation from deflate. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # crypto/deflate.c # 2004/07/09 16:50:14-07:00 jmorris@redhat.com +32 -45 # [CRYPTO]: Remove lazy allocation from deflate. # # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/09 16:46:16-07:00 shemminger@osdl.org # [PKT_SCHED]: Add jitter support to netem. # # This patch adds jitter if desired to the delayed packets in the # netem scheduler. I dropped the rate stuff out and reorganized so # that an underlying pfifo queue is used (next plan is to make it # have class ops). # # The jitter is given as sigma to a Gaussian normal distribution. The actual # implementation is a reduced form of the table driven stuff in NISTnet # (free). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/sched/sch_netem.c # 2004/07/09 16:45:49-07:00 shemminger@osdl.org +676 -74 # [PKT_SCHED]: Add jitter support to netem. # # This patch adds jitter if desired to the delayed packets in the # netem scheduler. I dropped the rate stuff out and reorganized so # that an underlying pfifo queue is used (next plan is to make it # have class ops). # # The jitter is given as sigma to a Gaussian normal distribution. The actual # implementation is a reduced form of the table driven stuff in NISTnet # (free). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # include/linux/pkt_sched.h # 2004/07/09 16:45:49-07:00 shemminger@osdl.org +1 -1 # [PKT_SCHED]: Add jitter support to netem. # # This patch adds jitter if desired to the delayed packets in the # netem scheduler. I dropped the rate stuff out and reorganized so # that an underlying pfifo queue is used (next plan is to make it # have class ops). # # The jitter is given as sigma to a Gaussian normal distribution. The actual # implementation is a reduced form of the table driven stuff in NISTnet # (free). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/09 16:37:16-07:00 shemminger@osdl.org # [BRIDGE]: Support different MTU sizes. # # This patch adds support for different size MTU's to bridging. # It is useful for bridging Ethernet's with jumbo frames, etc. # # The mtu of the bridge pseudo-device is maintained as the minimum # of all the underlying ports. And when forwarding a frame through # the bridge, it will drop the frame if the outgoing port's MTU # is less than the frame size (as per 802 standard). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_private.h # 2004/07/09 16:37:01-07:00 shemminger@osdl.org +1 -0 # [BRIDGE]: Support different MTU sizes. # # This patch adds support for different size MTU's to bridging. # It is useful for bridging Ethernet's with jumbo frames, etc. # # The mtu of the bridge pseudo-device is maintained as the minimum # of all the underlying ports. And when forwarding a frame through # the bridge, it will drop the frame if the outgoing port's MTU # is less than the frame size (as per 802 standard). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_notify.c # 2004/07/09 16:37:01-07:00 shemminger@osdl.org +4 -0 # [BRIDGE]: Support different MTU sizes. # # This patch adds support for different size MTU's to bridging. # It is useful for bridging Ethernet's with jumbo frames, etc. # # The mtu of the bridge pseudo-device is maintained as the minimum # of all the underlying ports. And when forwarding a frame through # the bridge, it will drop the frame if the outgoing port's MTU # is less than the frame size (as per 802 standard). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_if.c # 2004/07/09 16:37:01-07:00 shemminger@osdl.org +20 -0 # [BRIDGE]: Support different MTU sizes. # # This patch adds support for different size MTU's to bridging. # It is useful for bridging Ethernet's with jumbo frames, etc. # # The mtu of the bridge pseudo-device is maintained as the minimum # of all the underlying ports. And when forwarding a frame through # the bridge, it will drop the frame if the outgoing port's MTU # is less than the frame size (as per 802 standard). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_forward.c # 2004/07/09 16:37:01-07:00 shemminger@osdl.org +1 -0 # [BRIDGE]: Support different MTU sizes. # # This patch adds support for different size MTU's to bridging. # It is useful for bridging Ethernet's with jumbo frames, etc. # # The mtu of the bridge pseudo-device is maintained as the minimum # of all the underlying ports. And when forwarding a frame through # the bridge, it will drop the frame if the outgoing port's MTU # is less than the frame size (as per 802 standard). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/bridge/br_device.c # 2004/07/09 16:37:01-07:00 shemminger@osdl.org +10 -0 # [BRIDGE]: Support different MTU sizes. # # This patch adds support for different size MTU's to bridging. # It is useful for bridging Ethernet's with jumbo frames, etc. # # The mtu of the bridge pseudo-device is maintained as the minimum # of all the underlying ports. And when forwarding a frame through # the bridge, it will drop the frame if the outgoing port's MTU # is less than the frame size (as per 802 standard). # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/09 16:26:07-07:00 davem@nuts.davemloft.net # [PKT_SCHED]: Remove CSZ scheduler. # # It was an experimental hack and never finished off. # # Signed-off-by: David S. Miller # # net/sched/Makefile # 2004/07/09 16:25:38-07:00 davem@nuts.davemloft.net +0 -1 # [PKT_SCHED]: Remove CSZ scheduler. # # It was an experimental hack and never finished off. # # Signed-off-by: David S. Miller # # net/sched/Kconfig # 2004/07/09 16:25:38-07:00 davem@nuts.davemloft.net +0 -15 # [PKT_SCHED]: Remove CSZ scheduler. # # It was an experimental hack and never finished off. # # Signed-off-by: David S. Miller # # include/linux/pkt_sched.h # 2004/07/09 16:25:38-07:00 davem@nuts.davemloft.net +0 -28 # [PKT_SCHED]: Remove CSZ scheduler. # # It was an experimental hack and never finished off. # # Signed-off-by: David S. Miller # # BitKeeper/deleted/.del-sch_csz.c~486bab2bfa9bbf5f # 2004/07/09 16:25:06-07:00 davem@nuts.davemloft.net +0 -0 # Delete: net/sched/sch_csz.c # # ChangeSet # 2004/07/09 23:15:32+02:00 marcel@holtmann.org # [Bluetooth] Don't reset the USB halted bits # # The USB halted bits are useless and so there is no need to reset them # after changing the configuration. # # Signed-off-by: Marcel Holtmann # # ChangeSet # 2004/07/09 14:14:33-07:00 kenneth.w.chen@intel.com # [PATCH] ia64: fix interpolation-bug in fsys_gettimeofday() # # The order of reading ar.itc is incorrect with respect to all other # variables in fsys_gettimeofday. All variables involved in time # interpolation need to be protected by the sequence lock xtime_lock for # consistency check. However, the first time that fsys_gettimeofday() # takes a time stamp, it reads the count outside the seq lock leading to # the following possible time leap into the future scenario: # # fsys_gettimeofday: # read ar.itc # # .... .... # # read_seqbegin # read all other variables (last_nsec_offset, jiffies, xtime) # do time interpolation - elapsed_cycles become a large negative # number and converting it to nsec overflows and make it a # large positive number # read_seqretry success # updates last_nsec_offset (which is several seconds into the future). # # All subsequent gettimeofday() calls will be wrong as well because # monotonic property kicks in. It only self-corrects once that future # time actually arrives. # # This patch fixes the problem (and moves one instruction to make some room). # # Signed-off-by: Ken Chen # Signed-off-by: Asit Mallick # Signed-off-by: David Mosberger # # arch/ia64/kernel/fsys.S # 2004/07/09 06:08:17-07:00 kenneth.w.chen@intel.com +2 -3 # ia64: fix interpolation-bug in fsys_gettimeofday() # # drivers/bluetooth/bfusb.c # 2004/07/09 23:13:02+02:00 marcel@holtmann.org +0 -2 # Don't reset the USB halted bits # # ChangeSet # 2004/07/09 23:12:28+02:00 marcel@holtmann.org # [Bluetooth] Respond to L2CAP info requests # # This patch adds the correct behavior when a L2CAP info request is sent # by the peer. The answer should be a L2CAP info response with the result # code set to "not supported". # # Signed-off-by: Marcel Holtmann # # ChangeSet # 2004/07/09 14:09:21-07:00 peterm@redhat.com # [PATCH] ia64: add audit support # # This patch adds IA64 support to the audit infrastructure. The IA64 # audit patch complements the existing audit support for the i386, # PPC64, and x86_64 architectures. This patch is based on work by Ray # Lanza. # # Signed-off-by: Peter Martuccelli # Signed-off-by: David Mosberger # # init/Kconfig # 2004/07/07 11:11:34-07:00 peterm@redhat.com +1 -1 # ia64: add audit support # # include/asm-ia64/thread_info.h # 2004/07/07 11:11:34-07:00 peterm@redhat.com +4 -1 # ia64: add audit support # # arch/ia64/kernel/ptrace.c # 2004/07/08 14:36:47-07:00 peterm@redhat.com +40 -2 # ia64: add audit support # # arch/ia64/kernel/ivt.S # 2004/07/07 11:11:34-07:00 peterm@redhat.com +5 -2 # ia64: add audit support # # arch/ia64/kernel/entry.S # 2004/07/07 11:11:34-07:00 peterm@redhat.com +6 -4 # ia64: add audit support # # arch/ia64/ia32/ia32_entry.S # 2004/07/07 11:11:34-07:00 peterm@redhat.com +5 -3 # ia64: add audit support # # net/bluetooth/l2cap.c # 2004/07/09 23:06:43+02:00 marcel@holtmann.org +46 -12 # Respond to L2CAP info requests # # include/net/bluetooth/l2cap.h # 2004/07/09 23:05:56+02:00 marcel@holtmann.org +8 -0 # Respond to L2CAP info requests # # ChangeSet # 2004/07/09 12:26:41-07:00 tony.luck@intel.com # [PATCH] ia64: allow module core code calls to module init code again # # Drop the prohibition for module core code calls to module init code # (this breaks netfilter). # # Signed-off-by: # Signed-off-by: David Mosberger # # arch/ia64/kernel/module.c # 2004/07/09 10:35:59-07:00 tony.luck@intel.com +7 -15 # ia64: allow module core code calls to module init code again # # ChangeSet # 2004/07/09 12:05:47-07:00 rohit.seth@intel.com # [PATCH] ia64: nointroute option needs to be parsed early # # This patch does an early parsing of kernel command line to check if # no_int_route is present. Sal_init code depends on this option to # enable/disable interrupt routing. # # Signed-off-by: Rohit Seth # Signed-off-by: David Mosberger # # arch/ia64/kernel/sal.c # 2004/07/08 17:11:46-07:00 rohit.seth@intel.com +24 -0 # ia64: nointroute option needs to be parsed early # # ChangeSet # 2004/07/08 17:24:45-07:00 eranian@hpl.hp.com # [PATCH] ia64: fix various problems in pfm_check_task_state() # # Commands not requiring the monitored task to be stopped would spin in # wait_task_inactive() forever. After call to wait_task_inactive(), # state may have changed, therefore it needs to be rechecked. # # Signed-off-by: Stephane Eranian # Signed-off-by: David Mosberger # # arch/ia64/kernel/perfmon.c # 2004/07/07 04:27:48-07:00 eranian@hpl.hp.com +51 -20 # ia64: fix various problems in pfm_check_task_state() # # ChangeSet # 2004/07/08 16:35:10-07:00 davidm@tiger.hpl.hp.com # ia64: Define machvec_noop as "static inline" # # This way, non-GENERIC kernels can optimize away the no-op calls # while GENERIC kernels can still take the address of the function # to initialize the machvec vector. # # include/asm-ia64/machvec.h # 2004/07/08 16:35:02-07:00 davidm@tiger.hpl.hp.com +5 -1 # (machvec_noop): Define as "static inline". # # arch/ia64/kernel/machvec.c # 2004/07/08 16:35:02-07:00 davidm@tiger.hpl.hp.com +0 -6 # (machvec_noop): Remove. # # ChangeSet # 2004/07/08 16:34:29-07:00 davem@nuts.davemloft.net # [IPV4]: Fix multicast socket hangs. # # If a multicast packet gets looped back, the sending # socket can hang if a local read just sits and does # not empty its receive queue. # # The problem is that when an SKB clone is freed up, # the destructor is only invoked for the head SKB when # there is a fraglist (which is created for fragmentation). # # The solution is to account the fragment list SKB lengths # in the top-level head SKB, then it all works out. # # Signed-off-by: David S. Miller # # net/ipv4/ip_output.c # 2004/07/08 16:33:56-07:00 davem@nuts.davemloft.net +0 -6 # [IPV4]: Fix multicast socket hangs. # # If a multicast packet gets looped back, the sending # socket can hang if a local read just sits and does # not empty its receive queue. # # The problem is that when an SKB clone is freed up, # the destructor is only invoked for the head SKB when # there is a fraglist (which is created for fragmentation). # # The solution is to account the fragment list SKB lengths # in the top-level head SKB, then it all works out. # # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/08 16:17:47-07:00 bcasavan@sgi.com # [PATCH] ia64: Fix bug in ia64_atomic64_{add,sub} # # Hit this bug just yesterday. I hope the problem and fix require no # explanation. Patched kernel boots and runs just fine. # # Signed-off-by: Brent Casavant # Signed-off-by: David Mosberger # # include/asm-ia64/atomic.h # 2004/07/08 08:37:44-07:00 bcasavan@sgi.com +2 -2 # ia64: Fix bug in ia64_atomic64_{add,sub} # # ChangeSet # 2004/07/07 18:25:05-07:00 davidm@tiger.hpl.hp.com # ia64: Nuke two compiler warnings. # # include/asm-ia64/dma-mapping.h # 2004/07/07 18:24:57-07:00 davidm@tiger.hpl.hp.com +2 -0 # Include so platform_dma_supported() gets declared # before its first use in dma_set_mask(). # # arch/ia64/kernel/mca.c # 2004/07/07 18:24:57-07:00 davidm@tiger.hpl.hp.com +2 -0 # (ia64_mca_log_sal_error_record): Define rec_name[] only if debugging # is turned on. # # ChangeSet # 2004/07/07 15:22:10-07:00 jheffner@psc.edu # [TCP]: Do not round window to MSS if window scaling. # # Signed-off-by: John Heffner # Signed-off-by: David S. Miller # # net/ipv4/tcp_output.c # 2004/07/07 15:21:48-07:00 jheffner@psc.edu +24 -9 # [TCP]: Do not round window to MSS if window scaling. # # Signed-off-by: John Heffner # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/07 15:20:08-07:00 davem@nuts.davemloft.net # [TCP]: Type qualifiers, such as const, are ignored on function return type. # # include/net/tcp.h # 2004/07/07 15:19:50-07:00 davem@nuts.davemloft.net +3 -3 # [TCP]: Type qualifiers, such as const, are ignored on function return type. # # ChangeSet # 2004/07/07 15:19:10-07:00 hadi@znyx.com # [PKT_SCHED]: Another missed tc_stats spinlock conversion. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # include/net/pkt_act.h # 2004/07/07 15:18:47-07:00 hadi@znyx.com +1 -1 # [PKT_SCHED]: Another missed tc_stats spinlock conversion. # # Signed-off-by: Jamal Hadi Salim # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/07 14:33:56-07:00 peter@chubb.wattle.id.au # [PATCH] ia64: Fix OSDL BugMe report 2885: realtime process can't preempt low priority process in kernel # # Rearranged code to make it work. There were two problems: # # 1. The preempt flag was being tested only if code was leaving for # user space (the logic should be: test for RESCHEDULE if we're # switching to a kernel thread, test everything if switching to a # user thread) # # 2. The check of the user space flags was being repeated even if the # work had been done. # # There is one small change in semantics: when returning from a # preemption, the preemption flag will *not* be rechecked. Otherwise, I # found that it was easy to get into a livelock situation where no # forward progress was made. # # Signed-off-by: David Mosberger # # arch/ia64/kernel/entry.S # 2004/07/06 17:00:00-07:00 peter@chubb.wattle.id.au +32 -21 # ia64: Fix OSDL BugMe report 2885: realtime process can't preempt low priority process in kernel # # ChangeSet # 2004/07/07 14:06:11-07:00 hirofumi@mail.parknet.co.jp # [NET]: Cleanup mis-usage of seq_release_private # # These doesn't allocate memory and doesn't use seq->private. However # kfree() ignores NULL, so these are not the problem. # # This patch just cleans these up. # # Signed-off-by: OGAWA Hirofumi # Signed-off-by: David S. Miller # # net/irda/iriap.c # 2004/07/07 14:05:55-07:00 hirofumi@mail.parknet.co.jp +1 -1 # [NET]: Cleanup mis-usage of seq_release_private # # These doesn't allocate memory and doesn't use seq->private. However # kfree() ignores NULL, so these are not the problem. # # This patch just cleans these up. # # Signed-off-by: OGAWA Hirofumi # Signed-off-by: David S. Miller # # net/irda/ircomm/ircomm_core.c # 2004/07/07 14:05:55-07:00 hirofumi@mail.parknet.co.jp +1 -1 # [NET]: Cleanup mis-usage of seq_release_private # # These doesn't allocate memory and doesn't use seq->private. However # kfree() ignores NULL, so these are not the problem. # # This patch just cleans these up. # # Signed-off-by: OGAWA Hirofumi # Signed-off-by: David S. Miller # # net/irda/discovery.c # 2004/07/07 14:05:55-07:00 hirofumi@mail.parknet.co.jp +1 -1 # [NET]: Cleanup mis-usage of seq_release_private # # These doesn't allocate memory and doesn't use seq->private. However # kfree() ignores NULL, so these are not the problem. # # This patch just cleans these up. # # Signed-off-by: OGAWA Hirofumi # Signed-off-by: David S. Miller # # net/ipv4/route.c # 2004/07/07 14:05:55-07:00 hirofumi@mail.parknet.co.jp +1 -1 # [NET]: Cleanup mis-usage of seq_release_private # # These doesn't allocate memory and doesn't use seq->private. However # kfree() ignores NULL, so these are not the problem. # # This patch just cleans these up. # # Signed-off-by: OGAWA Hirofumi # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/07 14:05:03-07:00 hirofumi@mail.parknet.co.jp # [IPV4]: IPMR fixes. # # - pim_protocol warning fix # # - ipmr_vif_open() and ipmr_mfc_open() allocates the memory, so it # should use seq_release_private(). # # - ipmr_mfc_seq_xxx is using it->cache, in order to control whether # unlock should be do or not, but it->cache was not initialized in # ipmr_mfc_seq_start(). So it can point the previous state if user # did seek(). This become to the cause of twice unlock. # # Signed-off-by: OGAWA Hirofumi # Signed-off-by: David S. Miller # # net/ipv4/ipmr.c # 2004/07/07 14:04:48-07:00 hirofumi@mail.parknet.co.jp +7 -3 # [IPV4]: IPMR fixes. # # - pim_protocol warning fix # # - ipmr_vif_open() and ipmr_mfc_open() allocates the memory, so it # should use seq_release_private(). # # - ipmr_mfc_seq_xxx is using it->cache, in order to control whether # unlock should be do or not, but it->cache was not initialized in # ipmr_mfc_seq_start(). So it can point the previous state if user # did seek(). This become to the cause of twice unlock. # # Signed-off-by: OGAWA Hirofumi # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/07 14:02:02-07:00 shemminger@osdl.org # [NET]: Deinline sock_i_uid, sock_i_ino # # The sock_i_uid and sock_i_ino functions are only called by # /proc type interfaces, so they don't need to be inlined. # # Also, the inline functions writeable, rcvtimeo, sndtimeo are test # for value functions that don't change their argument. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # net/core/sock.c # 2004/07/07 14:01:47-07:00 shemminger@osdl.org +23 -0 # [NET]: Deinline sock_i_uid, sock_i_ino # # The sock_i_uid and sock_i_ino functions are only called by # /proc type interfaces, so they don't need to be inlined. # # Also, the inline functions writeable, rcvtimeo, sndtimeo are test # for value functions that don't change their argument. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # include/net/sock.h # 2004/07/07 14:01:47-07:00 shemminger@osdl.org +6 -23 # [NET]: Deinline sock_i_uid, sock_i_ino # # The sock_i_uid and sock_i_ino functions are only called by # /proc type interfaces, so they don't need to be inlined. # # Also, the inline functions writeable, rcvtimeo, sndtimeo are test # for value functions that don't change their argument. # # Signed-off-by: Stephen Hemminger # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/07 14:00:14-07:00 kaber@trash.net # [NETFILTER]: Fix two broken checks for options in ipt_LOG # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ipt_LOG.c # 2004/07/07 13:59:49-07:00 kaber@trash.net +2 -2 # [NETFILTER]: Fix two broken checks for options in ipt_LOG # # Signed-off-by: Patrick McHardy # Signed-off-by: Harald Welte # Signed-off-by: David S. Miller # # ChangeSet # 2004/07/07 07:27:18-05:00 stevef@steveft21.ltcsamba # fix oops in build_wildcard_path_from_dentry # # fs/cifs/file.c # 2004/07/07 07:26:57-05:00 stevef@steveft21.ltcsamba +7 -0 # fix oops in build_wildcard_path_from_dentry # # fs/cifs/dir.c # 2004/07/07 07:26:56-05:00 stevef@steveft21.ltcsamba +41 -10 # fix oops in build_wildcard_path_from_dentry # # fs/cifs/CHANGES # 2004/07/07 07:26:56-05:00 stevef@steveft21.ltcsamba +2 -1 # update cifs change log # # ChangeSet # 2004/07/06 22:09:59-07:00 davidm@tiger.hpl.hp.com # Merge tiger.hpl.hp.com:/data1/bk/vanilla/linux-2.5 # into tiger.hpl.hp.com:/data1/bk/lia64/to-linus-2.5 # # arch/ia64/ia32/ia32_entry.S # 2004/07/06 22:09:52-07:00 davidm@tiger.hpl.hp.com +0 -0 # Auto merged # # ChangeSet # 2004/07/06 14:59:30-07:00 kaos@sgi.com # [PATCH] ia64: Correct invalid unwind data # # ASM_UNW_PRLG_GRSAVE(n) must match the number of input registers in the # following alloc statement. Otherwise you get invalid backtraces :( # # Signed-off-by: Keith Owens # Signed-off-by: David Mosberger # # arch/ia64/kernel/pal.S # 2004/07/02 04:27:05-07:00 kaos@sgi.com +3 -3 # ia64: Correct invalid unwind data # # arch/ia64/ia32/ia32_entry.S # 2004/07/02 04:26:04-07:00 kaos@sgi.com +1 -1 # ia64: Correct invalid unwind data # # ChangeSet # 2004/07/06 11:57:29-07:00 arun.sharma@intel.com # [PATCH] ia64: IA-32 sigaltstack bug fix # # More code needs to be guarded by if (uss32) { ... }. Without this # patch, if (buf32..) may be checking uninitialized data and may result # in spurious ENOMEMs. # # Signed-off-by: Gordon Jin # Signed-off-by: Arun Sharma # Signed-off-by: David Mosberger # # arch/ia64/ia32/sys_ia32.c # 2004/04/29 00:03:01-07:00 arun.sharma@intel.com +10 -9 # ia64: IA-32 sigaltstack bug fix # # ChangeSet # 2004/07/06 11:11:11-07:00 kaos@sgi.com # [PATCH] ia64: Rename local move_irq to sn_move_irq # # Rename SN local function move_irq to sn_move_irq to remove conflict # with global move_irq. Needed since ashok.raj moved move_irq() from # iosapic.c to irq.c. # # Signed-off-by: Keith Owens # Signed-off-by: David Mosberger # # arch/ia64/sn/kernel/irq.c # 2004/06/30 06:31:06-07:00 kaos@sgi.com +2 -2 # ia64: Rename local move_irq to sn_move_irq # # ChangeSet # 2004/06/10 01:12:38-07:00 wesolows@foobazco.org # [SPARC32]: Fix CONFIG_SUN4 build # # include/asm-sparc/sun4prom.h # 2004/06/10 01:12:32-07:00 wesolows@foobazco.org +1 -1 # [SPARC32]: Fix CONFIG_SUN4 build # # include/asm-sparc/pgtsun4.h # 2004/06/10 01:12:31-07:00 wesolows@foobazco.org +16 -0 # [SPARC32]: Fix CONFIG_SUN4 build # # drivers/sbus/sbus.c # 2004/06/10 01:12:31-07:00 wesolows@foobazco.org +4 -0 # [SPARC32]: Fix CONFIG_SUN4 build # # arch/sparc/mm/nosrmmu.c # 2004/06/10 01:12:31-07:00 wesolows@foobazco.org +2 -5 # [SPARC32]: Fix CONFIG_SUN4 build # # arch/sparc/kernel/setup.c # 2004/06/10 01:12:31-07:00 wesolows@foobazco.org +0 -1 # [SPARC32]: Fix CONFIG_SUN4 build # # ChangeSet # 2004/06/10 00:53:21-07:00 wesolows@foobazco.org # [SPARC32]: Continue to avoid the use of __builtin_trap for BUG() # # gcc 3.3.3 continues to ICE on the BUG_ON() in mm/fremap.c. # # include/asm-sparc/bug.h # 2004/06/10 00:53:15-07:00 wesolows@foobazco.org +1 -1 # [SPARC32]: Continue to avoid the use of __builtin_trap for BUG() # # ChangeSet # 2004/06/10 00:51:43-07:00 wesolows@foobazco.org # [SPARC32]: Move non-PCI DMA definitions out of pgtable.h # # This also avoids a cyclic header inclusion problem with dma-mapping.h # and linux/mm.h triggered by the recent change to standard DMA definitions. # # include/asm-sparc/pgtable.h # 2004/06/10 00:51:37-07:00 wesolows@foobazco.org +0 -43 # [SPARC32]: Move non-PCI DMA definitions out of pgtable.h # # include/asm-sparc/pci.h # 2004/06/10 00:51:37-07:00 wesolows@foobazco.org +6 -0 # [SPARC32]: Move non-PCI DMA definitions out of pgtable.h # # include/asm-sparc/dma.h # 2004/06/10 00:51:37-07:00 wesolows@foobazco.org +43 -0 # [SPARC32]: Move non-PCI DMA definitions out of pgtable.h # # arch/sparc/mm/iommu.c # 2004/06/10 00:51:37-07:00 wesolows@foobazco.org +1 -0 # [SPARC32]: Move non-PCI DMA definitions out of pgtable.h # # arch/sparc/mm/io-unit.c # 2004/06/10 00:51:37-07:00 wesolows@foobazco.org +1 -0 # [SPARC32]: Move non-PCI DMA definitions out of pgtable.h # # arch/sparc/kernel/ioport.c # 2004/06/10 00:51:37-07:00 wesolows@foobazco.org +1 -1 # [SPARC32]: Move non-PCI DMA definitions out of pgtable.h # # ChangeSet # 2004/06/09 14:45:00-07:00 wesolows@foobazco.org # [SPARC32]: Regenerate defconfig # # arch/sparc/defconfig # 2004/06/09 14:44:54-07:00 wesolows@foobazco.org +34 -40 # [SPARC32]: Regenerate defconfig # diff -Nru a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt --- a/Documentation/cachetlb.txt 2004-07-13 12:24:00 -07:00 +++ b/Documentation/cachetlb.txt 2004-07-13 12:24:00 -07:00 @@ -132,6 +132,17 @@ translations for software managed TLB configurations. The sparc64 port currently does this. +7) void tlb_migrate_finish(struct mm_struct *mm) + + This interface is called at the end of an explicit + process migration. This interface provides a hook + to allow a platform to update TLB or context-specific + information for the address space. + + The ia64 sn2 platform is one example of a platform + that uses this interface. + + Next, we have the cache flushing interfaces. In general, when Linux is changing an existing virtual-->physical mapping to a new value, the sequence will be in one of the following forms: diff -Nru a/arch/alpha/Makefile b/arch/alpha/Makefile --- a/arch/alpha/Makefile 2004-07-13 12:24:01 -07:00 +++ b/arch/alpha/Makefile 2004-07-13 12:24:01 -07:00 @@ -11,6 +11,7 @@ NM := $(NM) -B LDFLAGS_vmlinux := -static -N #-relax +CHECK := $(CHECK) -D__alpha__=1 cflags-y := -pipe -mno-fp-regs -ffixed-8 # Determine if we can use the BWX instructions with GAS. diff -Nru a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c --- a/arch/alpha/kernel/core_tsunami.c 2004-07-13 12:24:00 -07:00 +++ b/arch/alpha/kernel/core_tsunami.c 2004-07-13 12:24:00 -07:00 @@ -263,9 +263,9 @@ hose->sparse_mem_base = 0; hose->sparse_io_base = 0; hose->dense_mem_base - = (TSUNAMI_MEM(index) & 0xffffffffff) | 0x80000000000; + = (TSUNAMI_MEM(index) & 0xffffffffffL) | 0x80000000000L; hose->dense_io_base - = (TSUNAMI_IO(index) & 0xffffffffff) | 0x80000000000; + = (TSUNAMI_IO(index) & 0xffffffffffL) | 0x80000000000L; hose->config_space_base = TSUNAMI_CONF(index); hose->index = index; diff -Nru a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c --- a/arch/alpha/kernel/irq.c 2004-07-13 12:24:01 -07:00 +++ b/arch/alpha/kernel/irq.c 2004-07-13 12:24:01 -07:00 @@ -361,7 +361,7 @@ int i; /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", 0); + root_irq_dir = proc_mkdir("irq", NULL); #ifdef CONFIG_SMP /* create /proc/irq/prof_cpu_mask */ diff -Nru a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c --- a/arch/alpha/kernel/osf_sys.c 2004-07-13 12:24:00 -07:00 +++ b/arch/alpha/kernel/osf_sys.c 2004-07-13 12:24:00 -07:00 @@ -588,7 +588,7 @@ int error; if (uss) { - void *ss_sp; + void __user *ss_sp; error = -EFAULT; if (get_user(ss_sp, &uss->ss_sp)) @@ -762,7 +762,7 @@ info.si_signo = SIGFPE; info.si_errno = 0; info.si_code = si_code; - info.si_addr = 0; /* FIXME */ + info.si_addr = NULL; /* FIXME */ send_sig_info(SIGFPE, &info, current); } @@ -956,7 +956,7 @@ return -EFAULT; } - return do_utimes(filename, tvs ? ktvs : 0); + return do_utimes(filename, tvs ? ktvs : NULL); } #define MAX_SELECT_SECONDS \ @@ -1303,7 +1303,7 @@ unsigned long i; for (i = 0 ; i < count ; i++) { - int *iov_len_high = (int __user *)&iov[i].iov_len + 1; + int __user *iov_len_high = (int __user *)&iov[i].iov_len + 1; if (put_user(0, iov_len_high)) return -EFAULT; diff -Nru a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c --- a/arch/alpha/kernel/process.c 2004-07-13 12:24:01 -07:00 +++ b/arch/alpha/kernel/process.c 2004-07-13 12:24:01 -07:00 @@ -189,7 +189,7 @@ void show_regs(struct pt_regs *regs) { - dik_show_regs(regs, 0); + dik_show_regs(regs, NULL); } /* diff -Nru a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c --- a/arch/alpha/kernel/signal.c 2004-07-13 12:24:01 -07:00 +++ b/arch/alpha/kernel/signal.c 2004-07-13 12:24:01 -07:00 @@ -304,7 +304,7 @@ info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = TRAP_BRKPT; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; info.si_trapno = 0; send_sig_info(SIGTRAP, &info, current); } @@ -342,7 +342,7 @@ info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = TRAP_BRKPT; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; info.si_trapno = 0; send_sig_info(SIGTRAP, &info, current); } diff -Nru a/arch/alpha/kernel/smc37c669.c b/arch/alpha/kernel/smc37c669.c --- a/arch/alpha/kernel/smc37c669.c 2004-07-13 12:24:01 -07:00 +++ b/arch/alpha/kernel/smc37c669.c 2004-07-13 12:24:01 -07:00 @@ -996,7 +996,7 @@ ** and standard ISA IRQs. ** */ -static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_table __initdata = 0; +static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_table __initdata; /* ** The following definition is for the default IRQ @@ -1045,7 +1045,7 @@ ** ISA DMA channels. ** */ -static SMC37c669_DRQ_TRANSLATION_ENTRY *SMC37c669_drq_table __initdata = 0; +static SMC37c669_DRQ_TRANSLATION_ENTRY *SMC37c669_drq_table __initdata; /* ** The following definition is the default DRQ diff -Nru a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c --- a/arch/alpha/kernel/smp.c 2004-07-13 12:24:00 -07:00 +++ b/arch/alpha/kernel/smp.c 2004-07-13 12:24:00 -07:00 @@ -864,7 +864,7 @@ /* We either got one or timed out -- clear the lock. */ mb(); - smp_call_function_data = 0; + smp_call_function_data = NULL; /* * If after both the initial and long timeout periods we still don't diff -Nru a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c --- a/arch/alpha/kernel/traps.c 2004-07-13 12:24:01 -07:00 +++ b/arch/alpha/kernel/traps.c 2004-07-13 12:24:01 -07:00 @@ -223,12 +223,12 @@ if (si_code == 0) return; } - die_if_kernel("Arithmetic fault", regs, 0, 0); + die_if_kernel("Arithmetic fault", regs, 0, NULL); info.si_signo = SIGFPE; info.si_errno = 0; info.si_code = si_code; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; send_sig_info(SIGFPE, &info, current); } @@ -247,7 +247,7 @@ data[0]); } die_if_kernel((type == 1 ? "Kernel Bug" : "Instruction fault"), - regs, type, 0); + regs, type, NULL); } switch (type) { @@ -256,7 +256,7 @@ info.si_errno = 0; info.si_code = TRAP_BRKPT; info.si_trapno = 0; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; if (ptrace_cancel_bpt(current)) { regs->pc -= 4; /* make pc point to former bpt */ @@ -269,13 +269,13 @@ info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = __SI_FAULT; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; info.si_trapno = 0; send_sig_info(SIGTRAP, &info, current); return; case 2: /* gentrap */ - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; info.si_trapno = regs->r16; switch ((long) regs->r16) { case GEN_INTOVF: @@ -337,7 +337,7 @@ info.si_signo = signo; info.si_errno = 0; info.si_code = code; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; send_sig_info(signo, &info, current); return; @@ -365,7 +365,7 @@ info.si_signo = SIGFPE; info.si_errno = 0; info.si_code = si_code; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; send_sig_info(SIGFPE, &info, current); return; } @@ -394,7 +394,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLOPC; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; send_sig_info(SIGILL, &info, current); } @@ -410,12 +410,12 @@ { siginfo_t info; - die_if_kernel("Instruction fault", regs, 0, 0); + die_if_kernel("Instruction fault", regs, 0, NULL); info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLOPC; - info.si_addr = (void *) regs->pc; + info.si_addr = (void __user *) regs->pc; force_sig_info(SIGILL, &info, current); } @@ -765,7 +765,7 @@ #undef R asmlinkage void -do_entUnaUser(void * va, unsigned long opcode, +do_entUnaUser(void __user * va, unsigned long opcode, unsigned long reg, struct pt_regs *regs) { static int cnt = 0; diff -Nru a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c --- a/arch/alpha/mm/fault.c 2004-07-13 12:24:00 -07:00 +++ b/arch/alpha/mm/fault.c 2004-07-13 12:24:00 -07:00 @@ -211,7 +211,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)) goto no_context; @@ -221,7 +221,7 @@ info.si_signo = SIGSEGV; info.si_errno = 0; info.si_code = si_code; - info.si_addr = (void *) address; + info.si_addr = (void __user *) address; force_sig_info(SIGSEGV, &info, current); return; diff -Nru a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c --- a/arch/arm/mach-s3c2410/mach-vr1000.c 2004-07-13 12:24:01 -07:00 +++ b/arch/arm/mach-s3c2410/mach-vr1000.c 2004-07-13 12:24:01 -07:00 @@ -1,15 +1,17 @@ /* linux/arch/arm/mach-s3c2410/mach-vr1000.c * - * Copyright (c) 2003 Simtec Electronics + * Copyright (c) 2003,2004 Simtec Electronics * Ben Dooks * - * http://www.simtec.co.uk/ + * Machine support for Thorcom VR1000 board. Designed for Thorcom by + * Simtec Electronics, http://www.simtec.co.uk/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Modifications: + * 12-Jul-2004 BJD Renamed machine * 16-May-2003 BJD Created initial version * 16-Aug-2003 BJD Fixed header files and copyright, added URL * 05-Sep-2003 BJD Moved to v2.6 kernel @@ -160,7 +162,7 @@ s3c2401_init_time(); } -MACHINE_START(VR1000, "Simtec-VR1000") +MACHINE_START(VR1000, "Thorcom-VR1000") MAINTAINER("Ben Dooks ") BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART) BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) diff -Nru a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c --- a/arch/arm/mach-sa1100/collie.c 2004-07-13 12:24:00 -07:00 +++ b/arch/arm/mach-sa1100/collie.c 2004-07-13 12:24:00 -07:00 @@ -89,7 +89,7 @@ &locomo_device, }; -static int __init collie_init(void) +static void __init collie_init(void) { int ret = 0; @@ -120,14 +120,9 @@ ret = platform_add_devices(devices, ARRAY_SIZE(devices)); if (ret) { printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); - return ret; } - - return ret; } -arch_initcall(collie_init); - static struct map_desc collie_io_desc[] __initdata = { /* virtual physical length type */ {0xe8000000, 0x00000000, 0x02000000, MT_DEVICE}, /* 32M main flash (cs0) */ @@ -145,4 +140,5 @@ BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(collie_map_io) INITIRQ(sa1100_init_irq) + INIT_MACHINE(collie_init) MACHINE_END diff -Nru a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c 2004-07-13 12:24:00 -07:00 +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c 2004-07-13 12:24:00 -07:00 @@ -214,7 +214,7 @@ BANIAS(1500), BANIAS(1600), BANIAS(1700), - { 0, } + { NULL, } }; #undef _BANIAS #undef BANIAS diff -Nru a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c --- a/arch/i386/kernel/i8259.c 2004-07-13 12:24:01 -07:00 +++ b/arch/i386/kernel/i8259.c 2004-07-13 12:24:01 -07:00 @@ -320,11 +320,11 @@ static irqreturn_t math_error_irq(int cpl, void *dev_id, struct pt_regs *regs) { - extern void math_error(void *); + extern void math_error(void __user *); outb(0,0xF0); if (ignore_fpu_irq || !boot_cpu_data.hard_math) return IRQ_NONE; - math_error((void *)regs->eip); + math_error((void __user *)regs->eip); return IRQ_HANDLED; } diff -Nru a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c --- a/arch/i386/kernel/signal.c 2004-07-13 12:24:01 -07:00 +++ b/arch/i386/kernel/signal.c 2004-07-13 12:24:01 -07:00 @@ -116,11 +116,14 @@ } asmlinkage int -sys_sigaltstack(struct pt_regs regs) +sys_sigaltstack(unsigned long ebx) { - const stack_t __user *uss = (const stack_t __user *)regs.ebx; - stack_t __user *uoss = (stack_t __user *)regs.ecx; - return do_sigaltstack(uss, uoss, regs.esp); + /* This is needed to make gcc realize it doesn't own the "struct pt_regs" */ + struct pt_regs *regs = (struct pt_regs *)&ebx; + const stack_t __user *uss = (const stack_t __user *)ebx; + stack_t __user *uoss = (stack_t __user *)regs->ecx; + + return do_sigaltstack(uss, uoss, regs->esp); } @@ -333,12 +336,13 @@ /* These symbols are defined with the addresses in the vsyscall page. See vsyscall-sigreturn.S. */ -extern void __kernel_sigreturn, __kernel_rt_sigreturn; +extern void __user __kernel_sigreturn; +extern void __user __kernel_rt_sigreturn; static void setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs * regs) { - void *restorer; + void __user *restorer; struct sigframe __user *frame; int err = 0; @@ -415,7 +419,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs * regs) { - void *restorer; + void __user *restorer; struct rt_sigframe __user *frame; int err = 0; diff -Nru a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c 2004-07-13 12:24:00 -07:00 +++ b/arch/i386/kernel/traps.c 2004-07-13 12:24:00 -07:00 @@ -397,7 +397,7 @@ info.si_signo = signr; \ info.si_errno = 0; \ info.si_code = sicode; \ - info.si_addr = (void *)siaddr; \ + info.si_addr = (void __user *)siaddr; \ do_trap(trapnr, signr, str, 0, regs, error_code, &info); \ } @@ -414,7 +414,7 @@ info.si_signo = signr; \ info.si_errno = 0; \ info.si_code = sicode; \ - info.si_addr = (void *)siaddr; \ + info.si_addr = (void __user *)siaddr; \ do_trap(trapnr, signr, str, 1, regs, error_code, &info); \ } @@ -630,8 +630,8 @@ /* If this is a kernel mode trap, save the user PC on entry to * the kernel, that's what the debugger can make sense of. */ - info.si_addr = ((regs->xcs & 3) == 0) ? (void *)tsk->thread.eip : - (void *)regs->eip; + info.si_addr = ((regs->xcs & 3) == 0) ? (void __user *)tsk->thread.eip + : (void __user *)regs->eip; force_sig_info(SIGTRAP, &info, tsk); /* Disable additional traps. They'll be re-enabled when @@ -659,7 +659,7 @@ * the correct behaviour even in the presence of the asynchronous * IRQ13 behaviour */ -void math_error(void *eip) +void math_error(void __user *eip) { struct task_struct * task; siginfo_t info; @@ -718,10 +718,10 @@ asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code) { ignore_fpu_irq = 1; - math_error((void *)regs->eip); + math_error((void __user *)regs->eip); } -void simd_math_error(void *eip) +void simd_math_error(void __user *eip) { struct task_struct * task; siginfo_t info; @@ -775,7 +775,7 @@ if (cpu_has_xmm) { /* Handle SIMD FPU exceptions on PIII+ processors. */ ignore_fpu_irq = 1; - simd_math_error((void *)regs->eip); + simd_math_error((void __user *)regs->eip); } else { /* * Handle strange cache flush from user space exception diff -Nru a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c --- a/arch/i386/mm/fault.c 2004-07-13 12:24:00 -07:00 +++ b/arch/i386/mm/fault.c 2004-07-13 12:24:00 -07:00 @@ -389,7 +389,7 @@ info.si_signo = SIGSEGV; info.si_errno = 0; /* info.si_code has been set above */ - info.si_addr = (void *)address; + info.si_addr = (void __user *)address; force_sig_info(SIGSEGV, &info, tsk); return; } @@ -499,7 +499,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, tsk); return; diff -Nru a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S --- a/arch/ia64/ia32/ia32_entry.S 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/ia32/ia32_entry.S 2004-07-13 12:24:01 -07:00 @@ -32,7 +32,7 @@ END(ia32_execve) ENTRY(ia32_clone) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) alloc r16=ar.pfs,5,2,6,0 DO_SAVE_SWITCH_STACK mov loc0=rp @@ -110,7 +110,9 @@ ld4 r2=[r2] ;; mov r8=0 - tbit.nz p6,p0=r2,TIF_SYSCALL_TRACE + and r2=_TIF_SYSCALL_TRACEAUDIT,r2 + ;; + cmp.ne p6,p0=r2,r0 (p6) br.cond.spnt .ia32_strace_check_retval ;; // prevent RAW on r8 END(ia32_ret_from_clone) @@ -142,7 +144,7 @@ adds r2=IA64_PT_REGS_R8_OFFSET+16,sp ;; st8 [r2]=r3 // initialize return code to -ENOSYS - br.call.sptk.few rp=syscall_trace // give parent a chance to catch syscall args + br.call.sptk.few rp=syscall_trace_enter // give parent a chance to catch syscall args .ret2: // Need to reload arguments (they may be changed by the tracing process) adds r2=IA64_PT_REGS_R1_OFFSET+16,sp // r2 = &pt_regs.r1 adds r3=IA64_PT_REGS_R13_OFFSET+16,sp // r3 = &pt_regs.r13 @@ -170,7 +172,7 @@ adds r2=IA64_PT_REGS_R8_OFFSET+16,sp // r2 = &pt_regs.r8 ;; st8.spill [r2]=r8 // store return value in slot for r8 - br.call.sptk.few rp=syscall_trace // give parent a chance to catch return value + br.call.sptk.few rp=syscall_trace_leave // give parent a chance to catch return value .ret4: alloc r2=ar.pfs,0,0,0,0 // drop the syscall argument frame br.cond.sptk.many ia64_leave_kernel END(ia32_trace_syscall) diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c --- a/arch/ia64/ia32/sys_ia32.c 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/ia32/sys_ia32.c 2004-07-13 12:24:01 -07:00 @@ -1996,18 +1996,19 @@ int ret; mm_segment_t old_fs = get_fs(); - if (uss32) + if (uss32) { if (copy_from_user(&buf32, uss32, sizeof(ia32_stack_t))) return -EFAULT; - uss.ss_sp = (void *) (long) buf32.ss_sp; - uss.ss_flags = buf32.ss_flags; - /* MINSIGSTKSZ is different for ia32 vs ia64. We lie here to pass the - check and set it to the user requested value later */ - if ((buf32.ss_flags != SS_DISABLE) && (buf32.ss_size < MINSIGSTKSZ_IA32)) { - ret = -ENOMEM; - goto out; + uss.ss_sp = (void *) (long) buf32.ss_sp; + uss.ss_flags = buf32.ss_flags; + /* MINSIGSTKSZ is different for ia32 vs ia64. We lie here to pass the + check and set it to the user requested value later */ + if ((buf32.ss_flags != SS_DISABLE) && (buf32.ss_size < MINSIGSTKSZ_IA32)) { + ret = -ENOMEM; + goto out; + } + uss.ss_size = MINSIGSTKSZ; } - uss.ss_size = MINSIGSTKSZ; set_fs(KERNEL_DS); ret = do_sigaltstack(uss32 ? &uss : NULL, &uoss, pt->r12); current->sas_ss_size = buf32.ss_size; diff -Nru a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c --- a/arch/ia64/kernel/efi.c 2004-07-13 12:24:00 -07:00 +++ b/arch/ia64/kernel/efi.c 2004-07-13 12:24:00 -07:00 @@ -43,18 +43,20 @@ #define efi_call_virt(f, args...) (*(f))(args) -#define STUB_GET_TIME(prefix, adjust_arg) \ -static efi_status_t \ -prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc) \ -{ \ - struct ia64_fpreg fr[6]; \ - efi_status_t ret; \ - \ - ia64_save_scratch_fpregs(fr); \ - ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), adjust_arg(tm), \ - adjust_arg(tc)); \ - ia64_load_scratch_fpregs(fr); \ - return ret; \ +#define STUB_GET_TIME(prefix, adjust_arg) \ +static efi_status_t \ +prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc) \ +{ \ + struct ia64_fpreg fr[6]; \ + efi_time_cap_t *atc = 0; \ + efi_status_t ret; \ + \ + if (tc) \ + atc = adjust_arg(tc); \ + ia64_save_scratch_fpregs(fr); \ + ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), adjust_arg(tm), atc); \ + ia64_load_scratch_fpregs(fr); \ + return ret; \ } #define STUB_SET_TIME(prefix, adjust_arg) \ @@ -89,11 +91,14 @@ prefix##_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm) \ { \ struct ia64_fpreg fr[6]; \ + efi_time_t *atm = 0; \ efi_status_t ret; \ \ + if (tm) \ + atm = adjust_arg(tm); \ ia64_save_scratch_fpregs(fr); \ ret = efi_call_##prefix((efi_set_wakeup_time_t *) __va(runtime->set_wakeup_time), \ - enabled, adjust_arg(tm)); \ + enabled, atm); \ ia64_load_scratch_fpregs(fr); \ return ret; \ } @@ -104,11 +109,14 @@ unsigned long *data_size, void *data) \ { \ struct ia64_fpreg fr[6]; \ + u32 *aattr = 0; \ efi_status_t ret; \ \ + if (attr) \ + aattr = adjust_arg(attr); \ ia64_save_scratch_fpregs(fr); \ ret = efi_call_##prefix((efi_get_variable_t *) __va(runtime->get_variable), \ - adjust_arg(name), adjust_arg(vendor), adjust_arg(attr), \ + adjust_arg(name), adjust_arg(vendor), aattr, \ adjust_arg(data_size), adjust_arg(data)); \ ia64_load_scratch_fpregs(fr); \ return ret; \ @@ -164,33 +172,41 @@ unsigned long data_size, efi_char16_t *data) \ { \ struct ia64_fpreg fr[6]; \ + efi_char16_t *adata = 0; \ + \ + if (data) \ + adata = adjust_arg(data); \ \ ia64_save_scratch_fpregs(fr); \ efi_call_##prefix((efi_reset_system_t *) __va(runtime->reset_system), \ - reset_type, status, data_size, adjust_arg(data)); \ + reset_type, status, data_size, adata); \ /* should not return, but just in case... */ \ ia64_load_scratch_fpregs(fr); \ } -STUB_GET_TIME(phys, __pa) -STUB_SET_TIME(phys, __pa) -STUB_GET_WAKEUP_TIME(phys, __pa) -STUB_SET_WAKEUP_TIME(phys, __pa) -STUB_GET_VARIABLE(phys, __pa) -STUB_GET_NEXT_VARIABLE(phys, __pa) -STUB_SET_VARIABLE(phys, __pa) -STUB_GET_NEXT_HIGH_MONO_COUNT(phys, __pa) -STUB_RESET_SYSTEM(phys, __pa) - -STUB_GET_TIME(virt, ) -STUB_SET_TIME(virt, ) -STUB_GET_WAKEUP_TIME(virt, ) -STUB_SET_WAKEUP_TIME(virt, ) -STUB_GET_VARIABLE(virt, ) -STUB_GET_NEXT_VARIABLE(virt, ) -STUB_SET_VARIABLE(virt, ) -STUB_GET_NEXT_HIGH_MONO_COUNT(virt, ) -STUB_RESET_SYSTEM(virt, ) +#define phys_ptr(arg) ((__typeof__(arg)) ia64_tpa(arg)) + +STUB_GET_TIME(phys, phys_ptr) +STUB_SET_TIME(phys, phys_ptr) +STUB_GET_WAKEUP_TIME(phys, phys_ptr) +STUB_SET_WAKEUP_TIME(phys, phys_ptr) +STUB_GET_VARIABLE(phys, phys_ptr) +STUB_GET_NEXT_VARIABLE(phys, phys_ptr) +STUB_SET_VARIABLE(phys, phys_ptr) +STUB_GET_NEXT_HIGH_MONO_COUNT(phys, phys_ptr) +STUB_RESET_SYSTEM(phys, phys_ptr) + +#define id(arg) arg + +STUB_GET_TIME(virt, id) +STUB_SET_TIME(virt, id) +STUB_GET_WAKEUP_TIME(virt, id) +STUB_SET_WAKEUP_TIME(virt, id) +STUB_GET_VARIABLE(virt, id) +STUB_GET_NEXT_VARIABLE(virt, id) +STUB_SET_VARIABLE(virt, id) +STUB_GET_NEXT_HIGH_MONO_COUNT(virt, id) +STUB_RESET_SYSTEM(virt, id) void efi_gettimeofday (struct timespec *ts) diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S --- a/arch/ia64/kernel/entry.S 2004-07-13 12:24:00 -07:00 +++ b/arch/ia64/kernel/entry.S 2004-07-13 12:24:00 -07:00 @@ -508,7 +508,7 @@ ;; stf.spill [r16]=f10 stf.spill [r17]=f11 - br.call.sptk.many rp=syscall_trace // give parent a chance to catch syscall args + br.call.sptk.many rp=syscall_trace_enter // give parent a chance to catch syscall args adds r16=PT(F6)+16,sp adds r17=PT(F7)+16,sp ;; @@ -548,7 +548,7 @@ .strace_save_retval: .mem.offset 0,0; st8.spill [r2]=r8 // store return value in slot for r8 .mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10 - br.call.sptk.many rp=syscall_trace // give parent a chance to catch return value + br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value .ret3: br.cond.sptk ia64_leave_syscall strace_error: @@ -575,7 +575,7 @@ */ nop.m 0 nop.i 0 - br.call.sptk.many rp=syscall_trace // give parent a chance to catch return value + br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value } .ret4: br.cond.sptk ia64_leave_kernel END(ia64_strace_leave_kernel) @@ -601,7 +601,9 @@ ld4 r2=[r2] ;; mov r8=0 - tbit.nz p6,p0=r2,TIF_SYSCALL_TRACE + and r2=_TIF_SYSCALL_TRACEAUDIT,r2 + ;; + cmp.ne p6,p0=r2,r0 (p6) br.cond.spnt .strace_check_retval ;; // added stop bits to prevent r8 dependency END(ia64_ret_from_clone) @@ -663,25 +665,31 @@ PT_REGS_UNWIND_INFO(0) /* * work.need_resched etc. mustn't get changed by this CPU before it returns to - * user- or fsys-mode, hence we disable interrupts early on: + * user- or fsys-mode, hence we disable interrupts early on. + * + * p6 controls whether current_thread_info()->flags needs to be check for + * extra work. We always check for extra work when returning to user-level. + * With CONFIG_PREEMPT, we also check for extra work when the preempt_count + * is 0. After extra work processing has been completed, execution + * resumes at .work_processed_syscall with p6 set to 1 if the extra-work-check + * needs to be redone. */ #ifdef CONFIG_PREEMPT rsm psr.i // disable interrupts -#else -(pUStk) rsm psr.i -#endif cmp.eq pLvSys,p0=r0,r0 // pLvSys=1: leave from syscall -(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk -.work_processed_syscall: -#ifdef CONFIG_PREEMPT (pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13 ;; .pred.rel.mutex pUStk,pKStk (pKStk) ld4 r21=[r20] // r21 <- preempt_count (pUStk) mov r21=0 // r21 <- 0 ;; -(p6) cmp.eq.unc p6,p0=r21,r0 // p6 <- p6 && (r21 == 0) -#endif /* CONFIG_PREEMPT */ + cmp.eq p6,p0=r21,r0 // p6 <- pUStk || (preempt_count == 0) +#else /* !CONFIG_PREEMPT */ +(pUStk) rsm psr.i + cmp.eq pLvSys,p0=r0,r0 // pLvSys=1: leave from syscall +(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk +#endif +.work_processed_syscall: adds r16=PT(LOADRS)+16,r12 adds r17=PT(AR_BSPSTORE)+16,r12 adds r18=TI_FLAGS+IA64_TASK_SIZE,r13 @@ -776,26 +784,31 @@ PT_REGS_UNWIND_INFO(0) /* * work.need_resched etc. mustn't get changed by this CPU before it returns to - * user- or fsys-mode, hence we disable interrupts early on: + * user- or fsys-mode, hence we disable interrupts early on. + * + * p6 controls whether current_thread_info()->flags needs to be check for + * extra work. We always check for extra work when returning to user-level. + * With CONFIG_PREEMPT, we also check for extra work when the preempt_count + * is 0. After extra work processing has been completed, execution + * resumes at .work_processed_syscall with p6 set to 1 if the extra-work-check + * needs to be redone. */ #ifdef CONFIG_PREEMPT rsm psr.i // disable interrupts -#else -(pUStk) rsm psr.i -#endif cmp.eq p0,pLvSys=r0,r0 // pLvSys=0: leave from kernel -(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk - ;; -.work_processed_kernel: -#ifdef CONFIG_PREEMPT - adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13 +(pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13 ;; .pred.rel.mutex pUStk,pKStk (pKStk) ld4 r21=[r20] // r21 <- preempt_count (pUStk) mov r21=0 // r21 <- 0 ;; -(p6) cmp.eq.unc p6,p0=r21,r0 // p6 <- p6 && (r21 == 0) -#endif /* CONFIG_PREEMPT */ + cmp.eq p6,p0=r21,r0 // p6 <- pUStk || (preempt_count == 0) +#else +(pUStk) rsm psr.i + cmp.eq p0,pLvSys=r0,r0 // pLvSys=0: leave from kernel +(pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk +#endif +.work_processed_kernel: adds r17=TI_FLAGS+IA64_TASK_SIZE,r13 ;; (p6) ld4 r31=[r17] // load current_thread_info()->flags @@ -1065,7 +1078,7 @@ br.cond.sptk.many .work_processed_kernel // re-check .notify: - br.call.spnt.many rp=notify_resume_user +(pUStk) br.call.spnt.many rp=notify_resume_user .ret10: cmp.ne p6,p0=r0,r0 // p6 <- 0 (pLvSys)br.cond.sptk.many .work_processed_syscall // don't re-check br.cond.sptk.many .work_processed_kernel // don't re-check diff -Nru a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S --- a/arch/ia64/kernel/fsys.S 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/kernel/fsys.S 2004-07-13 12:24:01 -07:00 @@ -165,7 +165,6 @@ add r9=TI_FLAGS+IA64_TASK_SIZE,r16 addl r3=THIS_CPU(cpu_info),r0 - mov.m r31=ar.itc // put time stamp into r31 (ITC) == now (35 cyc) #ifdef CONFIG_SMP movl r10=__per_cpu_offset movl r2=sal_platform_features @@ -240,12 +239,13 @@ ;; ldf8 f8=[r21] // f8 now contains itm_next + mov.m r31=ar.itc // put time stamp into r31 (ITC) == now sub r28=r29, r28, 1 // r28 now contains "-(lost + 1)" - tbit.nz p9, p10=r23, 0 // p9 <- is_odd(r23), p10 <- is_even(r23) ;; ld8 r2=[r19] // r2 = sec = xtime.tv_sec ld8 r29=[r20] // r29 = nsec = xtime.tv_nsec + tbit.nz p9, p10=r23, 0 // p9 <- is_odd(r23), p10 <- is_even(r23) setf.sig f6=r28 // f6 <- -(lost + 1) (6 cyc) ;; @@ -260,7 +260,6 @@ nop 0 ;; - mov r31=ar.itc // re-read ITC in case we .retry (35 cyc) xma.l f8=f11, f8, f12 // f8 (elapsed_cycles) <- (-1*last_tick + now) = (now - last_tick) nop 0 ;; diff -Nru a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S --- a/arch/ia64/kernel/ivt.S 2004-07-13 12:24:00 -07:00 +++ b/arch/ia64/kernel/ivt.S 2004-07-13 12:24:00 -07:00 @@ -752,7 +752,9 @@ ;; ld4 r2=[r2] // r2 = current_thread_info()->flags ;; - tbit.z p8,p0=r2,TIF_SYSCALL_TRACE + and r2=_TIF_SYSCALL_TRACEAUDIT,r2 // mask trace or audit + ;; + cmp.eq p8,p0=r2,r0 mov b6=r20 ;; (p8) br.call.sptk.many b6=b6 // ignore this return addr @@ -1573,10 +1575,11 @@ ld4 r2=[r2] // r2 = current_thread_info()->flags ;; ld8 r16=[r16] - tbit.z p8,p0=r2,TIF_SYSCALL_TRACE + and r2=_TIF_SYSCALL_TRACEAUDIT,r2 // mask trace or audit ;; mov b6=r16 movl r15=ia32_ret_from_syscall + cmp.eq p8,p0=r2,r0 ;; mov rp=r15 (p8) br.call.sptk.many b6=b6 diff -Nru a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c --- a/arch/ia64/kernel/machvec.c 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/kernel/machvec.c 2004-07-13 12:24:01 -07:00 @@ -44,12 +44,6 @@ #endif /* CONFIG_IA64_GENERIC */ void -machvec_noop (void) -{ -} -EXPORT_SYMBOL(machvec_noop); - -void machvec_setup (char **arg) { } diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c --- a/arch/ia64/kernel/mca.c 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/kernel/mca.c 2004-07-13 12:24:01 -07:00 @@ -247,7 +247,9 @@ u8 *buffer; u64 size; int irq_safe = sal_info_type != SAL_INFO_TYPE_MCA && sal_info_type != SAL_INFO_TYPE_INIT; +#ifdef IA64_MCA_DEBUG_INFO static const char * const rec_name[] = { "MCA", "INIT", "CMC", "CPE" }; +#endif size = ia64_log_get(sal_info_type, &buffer, irq_safe); if (!size) @@ -596,7 +598,7 @@ cmcv = (cmcv_reg_t)ia64_getreg(_IA64_REG_CR_CMCV); cmcv.cmcv_mask = 1; /* Mask/disable interrupt */ - ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval) + ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval); IA64_MCA_DEBUG("%s: CPU %d corrected " "machine check vector %#x disabled.\n", @@ -623,7 +625,7 @@ cmcv = (cmcv_reg_t)ia64_getreg(_IA64_REG_CR_CMCV); cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */ - ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval) + ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval); IA64_MCA_DEBUG("%s: CPU %d corrected " "machine check vector %#x enabled.\n", diff -Nru a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c --- a/arch/ia64/kernel/module.c 2004-07-13 12:24:00 -07:00 +++ b/arch/ia64/kernel/module.c 2004-07-13 12:24:00 -07:00 @@ -656,26 +656,18 @@ case RV_PCREL: switch (r_type) { case R_IA64_PCREL21B: - if (in_init(mod, val)) { - /* Calls to init code from core are bad news */ - if (in_core(mod, (uint64_t)location)) { - printk(KERN_ERR "%s: init symbol 0x%lx used in module code at %p\n", - mod->name, val, location); - return -ENOEXEC; - } - } else if (in_core(mod, val)) { + if ((in_init(mod, val) && in_core(mod, (uint64_t)location)) || + (in_core(mod, val) && in_init(mod, (uint64_t)location))) { /* * Init section may have been allocated far away from core, * if the branch won't reach, then allocate a plt for it. */ - if (in_init(mod, (uint64_t)location)) { - uint64_t delta = ((int64_t)val - (int64_t)location) / 16; - if (delta + (1 << 20) >= (1 << 21)) { - val = get_fdesc(mod, val, &ok); - val = get_plt(mod, location, val, &ok); - } + uint64_t delta = ((int64_t)val - (int64_t)location) / 16; + if (delta + (1 << 20) >= (1 << 21)) { + val = get_fdesc(mod, val, &ok); + val = get_plt(mod, location, val, &ok); } - } else + } else if (!is_internal(mod, val)) val = get_plt(mod, location, val, &ok); /* FALL THROUGH */ default: diff -Nru a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S --- a/arch/ia64/kernel/pal.S 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/kernel/pal.S 2004-07-13 12:24:01 -07:00 @@ -54,7 +54,7 @@ * */ GLOBAL_ENTRY(ia64_pal_call_static) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6) + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) alloc loc1 = ar.pfs,5,5,0,0 movl loc2 = pal_entry_point 1: { @@ -100,7 +100,7 @@ * in2 - in3 Remaning PAL arguments */ GLOBAL_ENTRY(ia64_pal_call_stacked) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4) alloc loc1 = ar.pfs,4,4,4,0 movl loc2 = pal_entry_point @@ -147,7 +147,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6) + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4) alloc loc1 = ar.pfs,4,7,0,0 movl loc2 = pal_entry_point 1: { diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c --- a/arch/ia64/kernel/perfmon.c 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/kernel/perfmon.c 2004-07-13 12:24:01 -07:00 @@ -4702,21 +4702,22 @@ pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags) { struct task_struct *task; - int state; + int state, old_state; +recheck: state = ctx->ctx_state; + task = ctx->ctx_task; - task = PFM_CTX_TASK(ctx); if (task == NULL) { DPRINT(("context %d no task, state=%d\n", ctx->ctx_fd, state)); return 0; } DPRINT(("context %d state=%d [%d] task_state=%ld must_stop=%d\n", - ctx->ctx_fd, - state, - task->pid, - task->state, PFM_CMD_STOPPED(cmd))); + ctx->ctx_fd, + state, + task->pid, + task->state, PFM_CMD_STOPPED(cmd))); /* * self-monitoring always ok. @@ -4728,31 +4729,61 @@ if (task == current || ctx->ctx_fl_system) return 0; /* - * context is UNLOADED, MASKED we are safe to go + * no command can operate on a zombie context */ - if (state != PFM_CTX_LOADED) return 0; + if (state == PFM_CTX_ZOMBIE) { + DPRINT(("cmd %d state zombie cannot operate on context\n", cmd)); + return -EINVAL; + } - if (state == PFM_CTX_ZOMBIE) return -EINVAL; + /* + * 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, we must make sure the task is 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. * If this user wants to ensure the task does not run, then * the task must be stopped. */ - if (PFM_CMD_STOPPED(cmd) && task->state != TASK_STOPPED) { - DPRINT(("[%d] task not in stopped state\n", task->pid)); - return -EBUSY; + if (PFM_CMD_STOPPED(cmd)) { + if (task->state != TASK_STOPPED) { + DPRINT(("[%d] task not in stopped state\n", task->pid)); + return -EBUSY; + } + /* + * task is now stopped, wait for ctxsw out + * + * This is an interesting point in the code. + * We need to unprotect the context because + * the pfm_save_regs() routines needs to grab + * the same lock. There are danger in doing + * this because it leaves a window open for + * another task to get access to the context + * and possibly change its state. The one thing + * that is not possible is for the context to disappear + * because we are protected by the VFS layer, i.e., + * get_fd()/put_fd(). + */ + old_state = state; + + UNPROTECT_CTX(ctx, flags); + + wait_task_inactive(task); + + PROTECT_CTX(ctx, flags); + + /* + * we must recheck to verify if state has changed + */ + if (ctx->ctx_state != old_state) { + DPRINT(("old_state=%d new_state=%d\n", old_state, ctx->ctx_state)); + goto recheck; + } } - - UNPROTECT_CTX(ctx, flags); - - wait_task_inactive(task); - - PROTECT_CTX(ctx, flags); - return 0; } diff -Nru a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c --- a/arch/ia64/kernel/ptrace.c 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/kernel/ptrace.c 2004-07-13 12:24:01 -07:00 @@ -1447,9 +1447,8 @@ return ret; } -/* "asmlinkage" so the input arguments are preserved... */ -asmlinkage void +void syscall_trace (void) { if (!test_thread_flag(TIF_SYSCALL_TRACE)) @@ -1471,4 +1470,39 @@ send_sig(current->exit_code, current, 1); current->exit_code = 0; } +} + +/* "asmlinkage" so the input arguments are preserved... */ + +asmlinkage void +syscall_trace_enter (long arg0, long arg1, long arg2, long arg3, + long arg4, long arg5, long arg6, long arg7, long stack) +{ + struct pt_regs *regs = (struct pt_regs *) &stack; + long syscall; + + if (unlikely(current->audit_context)) { + if (IS_IA32_PROCESS(regs)) + syscall = regs->r1; + else + syscall = regs->r15; + + audit_syscall_entry(current, syscall, arg0, arg1, arg2, arg3); + } + + if (test_thread_flag(TIF_SYSCALL_TRACE) && (current->ptrace & PT_PTRACED)) + syscall_trace(); +} + +/* "asmlinkage" so the input arguments are preserved... */ + +asmlinkage void +syscall_trace_leave (long arg0, long arg1, long arg2, long arg3, + long arg4, long arg5, long arg6, long arg7, long stack) +{ + if (unlikely(current->audit_context)) + audit_syscall_exit(current, ((struct pt_regs *) &stack)->r8); + + if (test_thread_flag(TIF_SYSCALL_TRACE) && (current->ptrace & PT_PTRACED)) + syscall_trace(); } diff -Nru a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c --- a/arch/ia64/kernel/sal.c 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/kernel/sal.c 2004-07-13 12:24:01 -07:00 @@ -188,6 +188,27 @@ break; } } + +static void __init +chk_nointroute_opt(void) +{ + char *cp; + extern char saved_command_line[]; + + for (cp = saved_command_line; *cp; ) { + if (memcmp(cp, "nointroute", 10) == 0) { + no_int_routing = 1; + printk ("no_int_routing on\n"); + break; + } else { + while (*cp != ' ' && *cp) + ++cp; + while (*cp == ' ') + ++cp; + } + } +} + #else static void __init sal_desc_ap_wakeup(void *p) { } #endif @@ -207,6 +228,9 @@ printk(KERN_ERR "bad signature in system table!"); check_versions(systab); +#ifdef CONFIG_SMP + chk_nointroute_opt(); +#endif /* revisions are coded in BCD, so %x does the job for us */ printk(KERN_INFO "SAL %x.%x: %.32s %.32s%sversion %x.%x\n", diff -Nru a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c --- a/arch/ia64/sn/kernel/irq.c 2004-07-13 12:24:00 -07:00 +++ b/arch/ia64/sn/kernel/irq.c 2004-07-13 12:24:00 -07:00 @@ -72,7 +72,7 @@ { } -static inline void move_irq(int irq) +static inline void sn_move_irq(int irq) { /* note - we hold desc->lock */ cpumask_t tmp; @@ -110,7 +110,7 @@ } HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED_ALIAS), mask ); __set_bit(irq, (volatile void *)pda->sn_in_service_ivecs); - move_irq(irq); + sn_move_irq(irq); } static void diff -Nru a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c 2004-07-13 12:24:01 -07:00 +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c 2004-07-13 12:24:01 -07:00 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,13 @@ } +void +sn_tlb_migrate_finish(struct mm_struct *mm) +{ + if (mm == current->mm) + flush_tlb_mm(mm); +} + /** * sn2_global_tlb_purge - globally purge translation cache of virtual address range @@ -113,6 +121,13 @@ preempt_enable(); return; } + + if (atomic_read(&mm->mm_users) == 1) { + flush_tlb_mm(mm); + preempt_enable(); + return; + } + nix = 0; for (cnode=find_first_bit(&nodes_flushed, NR_NODES); cnode < NR_NODES; diff -Nru a/arch/sparc/defconfig b/arch/sparc/defconfig --- a/arch/sparc/defconfig 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/defconfig 2004-07-13 12:24:01 -07:00 @@ -19,18 +19,22 @@ # CONFIG_SWAP=y CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # @@ -171,7 +175,6 @@ # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set -CONFIG_SCSI_REPORT_LUNS=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set @@ -190,11 +193,11 @@ # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set -# CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set @@ -203,6 +206,7 @@ # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set @@ -263,8 +267,6 @@ CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_IPV6_TUNNEL=m -# CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set # CONFIG_NETFILTER is not set CONFIG_XFRM=y CONFIG_XFRM_USER=m @@ -279,7 +281,9 @@ # CONFIG_SCTP_HMAC_SHA1 is not set CONFIG_SCTP_HMAC_MD5=y # CONFIG_ATM is not set +# CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set @@ -300,12 +304,12 @@ # Network testing # CONFIG_NET_PKTGEN=m +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set CONFIG_NETDEVICES=y - -# -# ARCnet devices -# -# CONFIG_ARCNET is not set CONFIG_DUMMY=m # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set @@ -313,6 +317,11 @@ # CONFIG_ETHERTAP is not set # +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y @@ -342,7 +351,6 @@ # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set -# CONFIG_SIS190 is not set # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set @@ -350,46 +358,29 @@ # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -# -# Wireless LAN (non-hamradio) -# -# CONFIG_NET_RADIO is not set +# CONFIG_S2IO is not set # # Token Ring devices # # CONFIG_TR is not set -# CONFIG_NET_FC is not set -# CONFIG_RCPCI is not set -# CONFIG_SHAPER is not set -# CONFIG_NETCONSOLE is not set - -# -# Wan interfaces -# -# CONFIG_WAN is not set # -# Amateur Radio support -# -# CONFIG_HAMRADIO is not set - -# -# IrDA (infrared) support +# Wireless LAN (non-hamradio) # -# CONFIG_IRDA is not set +# CONFIG_NET_RADIO is not set # -# Bluetooth support +# Wan interfaces # -# CONFIG_BT is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_NET_FC is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set # # Unix98 PTY support @@ -486,6 +477,7 @@ # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS_XATTR=y # CONFIG_DEVPTS_FS_SECURITY is not set @@ -527,9 +519,9 @@ CONFIG_RPCSEC_GSS_KRB5=m # CONFIG_SMB_FS is not set CONFIG_CIFS=m +# CONFIG_CIFS_STATS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set -# CONFIG_INTERMEZZO_FS is not set CONFIG_AFS_FS=m CONFIG_RXRPC=m @@ -641,11 +633,13 @@ CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=m +CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set # # Library routines # CONFIG_CRC32=y +CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y diff -Nru a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c --- a/arch/sparc/kernel/ioport.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/kernel/ioport.c 2004-07-13 12:24:01 -07:00 @@ -41,7 +41,7 @@ #include #include #include -#include +#include #define mmu_inval_dma_area(p, l) /* Anton pulled it out for 2.4.0-xx */ @@ -725,7 +725,7 @@ void register_proc_sparc_ioport(void) { #ifdef CONFIG_PROC_FS - create_proc_read_entry("io_map",0,0,_sparc_io_get_info,&sparc_iomap); - create_proc_read_entry("dvma_map",0,0,_sparc_io_get_info,&_sparc_dvma); + create_proc_read_entry("io_map",0,NULL,_sparc_io_get_info,&sparc_iomap); + create_proc_read_entry("dvma_map",0,NULL,_sparc_io_get_info,&_sparc_dvma); #endif } diff -Nru a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c --- a/arch/sparc/kernel/irq.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/kernel/irq.c 2004-07-13 12:24:00 -07:00 @@ -336,7 +336,7 @@ kstat_cpu(cpu).irqs[irq]++; do { if (!action || !action->handler) - unexpected_irq(irq, 0, regs); + unexpected_irq(irq, NULL, regs); action->handler(irq, action->dev_id, regs); action = action->next; } while (action); diff -Nru a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c --- a/arch/sparc/kernel/process.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/kernel/process.c 2004-07-13 12:24:00 -07:00 @@ -628,7 +628,7 @@ ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); if (regs != NULL) { regs->psr &= ~(PSR_EF); - last_task_used_math = 0; + last_task_used_math = NULL; } } #endif diff -Nru a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c --- a/arch/sparc/kernel/setup.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/kernel/setup.c 2004-07-13 12:24:00 -07:00 @@ -234,7 +234,6 @@ extern char cputypval; extern unsigned long start, end; extern void panic_setup(char *, int *); -extern void srmmu_end_memory(unsigned long, unsigned long *); extern unsigned short root_flags; extern unsigned short root_dev; diff -Nru a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c --- a/arch/sparc/kernel/signal.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/kernel/signal.c 2004-07-13 12:24:01 -07:00 @@ -198,7 +198,7 @@ regs->psr &= ~PSR_EF; #else if (current == last_task_used_math) { - last_task_used_math = 0; + last_task_used_math = NULL; regs->psr &= ~PSR_EF; } #endif @@ -439,7 +439,7 @@ unsigned long pc = regs->pc; unsigned long npc = regs->npc; struct thread_info *tp = current_thread_info(); - void *sig_address; + void __user *sig_address; int sig_code; synchronize_user_stack(); @@ -570,7 +570,7 @@ put_psr(get_psr() | PSR_EF); fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); - last_task_used_math = 0; + last_task_used_math = NULL; regs->psr &= ~(PSR_EF); } #endif diff -Nru a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c --- a/arch/sparc/kernel/sun4c_irq.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/kernel/sun4c_irq.c 2004-07-13 12:24:00 -07:00 @@ -50,7 +50,7 @@ * * so don't go making it static, like I tried. sigh. */ -unsigned char *interrupt_enable = 0; +unsigned char *interrupt_enable = NULL; static int sun4c_pil_map[] = { 0, 1, 2, 3, 5, 7, 8, 9 }; diff -Nru a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c --- a/arch/sparc/kernel/sun4d_irq.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/kernel/sun4d_irq.c 2004-07-13 12:24:00 -07:00 @@ -216,7 +216,7 @@ if (!sbusl) { action = *(irq + irq_action); if (!action) - unexpected_irq(irq, 0, regs); + unexpected_irq(irq, NULL, regs); do { action->handler(irq, action->dev_id, regs); action = action->next; @@ -243,7 +243,7 @@ action = actionp->action; if (!action) - unexpected_irq(irq, 0, regs); + unexpected_irq(irq, NULL, regs); do { action->handler(irq, action->dev_id, regs); action = action->next; diff -Nru a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c --- a/arch/sparc/kernel/sys_sparc.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/kernel/sys_sparc.c 2004-07-13 12:24:00 -07:00 @@ -375,7 +375,7 @@ info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = TRAP_BRKPT; - info.si_addr = (void *)regs->pc; + info.si_addr = (void __user *)regs->pc; info.si_trapno = 0; force_sig_info(SIGTRAP, &info, current); diff -Nru a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c --- a/arch/sparc/kernel/sys_sunos.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/kernel/sys_sunos.c 2004-07-13 12:24:00 -07:00 @@ -97,7 +97,7 @@ iminor(file->f_dentry->d_inode) == 5) { flags |= MAP_ANONYMOUS; fput(file); - file = 0; + file = NULL; } } ret_type = flags & _MAP_NEW; @@ -505,7 +505,7 @@ info.si_signo = SIGSYS; info.si_errno = 0; info.si_code = __SI_FAULT|0x100; - info.si_addr = (void *)regs->pc; + info.si_addr = (void __user *)regs->pc; info.si_trapno = regs->u_regs[UREG_G1]; send_sig_info(SIGSYS, &info, current); if (cnt++ < 4) { @@ -755,7 +755,7 @@ { int linux_flags = 0; int ret = -EINVAL; - char *dev_fname = 0; + char *dev_fname = NULL; char *dir_page, *type_page; if (!capable (CAP_SYS_ADMIN)) diff -Nru a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c --- a/arch/sparc/kernel/time.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/kernel/time.c 2004-07-13 12:24:01 -07:00 @@ -54,7 +54,7 @@ enum sparc_clock_type sp_clock_typ; spinlock_t mostek_lock = SPIN_LOCK_UNLOCKED; unsigned long mstk48t02_regs = 0UL; -static struct mostek48t08 *mstk48t08_regs = 0; +static struct mostek48t08 *mstk48t08_regs = NULL; static int set_rtc_mmss(unsigned long); static int sbus_do_settimeofday(struct timespec *tv); @@ -251,9 +251,9 @@ sp_clock_typ = MSTK48T02; r.start = sun4_clock_physaddr; mstk48t02_regs = sbus_ioremap(&r, 0, - sizeof(struct mostek48t02), 0); - mstk48t08_regs = 0; /* To catch weirdness */ - intersil_clock = 0; /* just in case */ + sizeof(struct mostek48t02), NULL); + mstk48t08_regs = NULL; /* To catch weirdness */ + intersil_clock = NULL; /* just in case */ /* Kick start the clock if it is completely stopped. */ if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP) @@ -266,7 +266,7 @@ intersil_clock = (struct intersil *) sbus_ioremap(&r, 0, sizeof(*intersil_clock), "intersil"); mstk48t02_regs = 0; /* just be sure */ - mstk48t08_regs = 0; /* ditto */ + mstk48t08_regs = NULL; /* ditto */ /* initialise the clock */ intersil_intr(intersil_clock,INTERSIL_INT_100HZ); @@ -340,7 +340,7 @@ r.start = clk_reg[0].phys_addr; mstk48t02_regs = sbus_ioremap(&r, 0, sizeof(struct mostek48t02), "mk48t02"); - mstk48t08_regs = 0; /* To catch weirdness */ + mstk48t08_regs = NULL; /* To catch weirdness */ } else if (strcmp(model, "mk48t08") == 0) { sp_clock_typ = MSTK48T08; if(prom_getproperty(node, "reg", (char *) clk_reg, diff -Nru a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c --- a/arch/sparc/kernel/traps.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/kernel/traps.c 2004-07-13 12:24:01 -07:00 @@ -147,7 +147,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLTRP; - info.si_addr = (void *)regs->pc; + info.si_addr = (void __user *)regs->pc; info.si_trapno = type - 0x80; force_sig_info(SIGILL, &info, current); } @@ -170,7 +170,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLOPC; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; send_sig_info(SIGILL, &info, current); } @@ -185,7 +185,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_PRVOPC; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; send_sig_info(SIGILL, &info, current); } @@ -354,7 +354,7 @@ fsr = fpt->thread.fsr; info.si_signo = SIGFPE; info.si_errno = 0; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; info.si_code = __SI_FAULT; if ((fsr & 0x1c000) == (1 << 14)) { @@ -388,7 +388,7 @@ info.si_signo = SIGEMT; info.si_errno = 0; info.si_code = EMT_TAGOVF; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; send_sig_info(SIGEMT, &info, current); } @@ -417,7 +417,7 @@ info.si_signo = SIGBUS; info.si_errno = 0; info.si_code = BUS_OBJERR; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; force_sig_info(SIGBUS, &info, current); } @@ -430,7 +430,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_COPROC; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; send_sig_info(SIGILL, &info, current); } @@ -447,7 +447,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_COPROC; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; send_sig_info(SIGILL, &info, current); } @@ -460,7 +460,7 @@ info.si_signo = SIGFPE; info.si_errno = 0; info.si_code = FPE_INTDIV; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; send_sig_info(SIGFPE, &info, current); } diff -Nru a/arch/sparc/kernel/unaligned.c b/arch/sparc/kernel/unaligned.c --- a/arch/sparc/kernel/unaligned.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/kernel/unaligned.c 2004-07-13 12:24:01 -07:00 @@ -473,7 +473,7 @@ info.si_signo = SIGBUS; info.si_errno = 0; info.si_code = BUS_ADRALN; - info.si_addr = (void *)safe_compute_effective_address(regs, insn); + info.si_addr = (void __user *)safe_compute_effective_address(regs, insn); info.si_trapno = 0; send_sig_info(SIGBUS, &info, current); } diff -Nru a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c --- a/arch/sparc/mm/fault.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/mm/fault.c 2004-07-13 12:24:00 -07:00 @@ -326,7 +326,7 @@ info.si_errno = 0; /* info.si_code set above to make clear whether this was a SEGV_MAPERR or SEGV_ACCERR fault. */ - info.si_addr = (void *) compute_si_addr(regs, text_fault); + info.si_addr = (void __user *)compute_si_addr(regs, text_fault); info.si_trapno = 0; force_sig_info (SIGSEGV, &info, tsk); return; @@ -380,7 +380,7 @@ info.si_signo = SIGBUS; info.si_errno = 0; info.si_code = BUS_ADRERR; - info.si_addr = (void *) compute_si_addr(regs, text_fault); + info.si_addr = (void __user *) compute_si_addr(regs, text_fault); info.si_trapno = 0; force_sig_info (SIGBUS, &info, tsk); if (!from_user) @@ -549,7 +549,7 @@ info.si_errno = 0; /* info.si_code set above to make clear whether this was a SEGV_MAPERR or SEGV_ACCERR fault. */ - info.si_addr = (void *) address; + info.si_addr = (void __user *) address; info.si_trapno = 0; force_sig_info (SIGSEGV, &info, tsk); return; @@ -559,7 +559,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; info.si_trapno = 0; force_sig_info (SIGBUS, &info, tsk); } diff -Nru a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c --- a/arch/sparc/mm/init.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/mm/init.c 2004-07-13 12:24:00 -07:00 @@ -100,7 +100,7 @@ clist = (ctx_list_pool + ctx); clist->ctx_number = ctx; - clist->ctx_mm = 0; + clist->ctx_mm = NULL; } ctx_free.next = ctx_free.prev = &ctx_free; ctx_used.next = ctx_used.prev = &ctx_used; diff -Nru a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c --- a/arch/sparc/mm/io-unit.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/mm/io-unit.c 2004-07-13 12:24:01 -07:00 @@ -22,6 +22,7 @@ #include #include #include +#include /* #define IOUNIT_DEBUG */ #ifdef IOUNIT_DEBUG diff -Nru a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c --- a/arch/sparc/mm/iommu.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/mm/iommu.c 2004-07-13 12:24:01 -07:00 @@ -25,6 +25,7 @@ #include #include #include +#include /* * This can be sized dynamically, but we will do this diff -Nru a/arch/sparc/mm/nosrmmu.c b/arch/sparc/mm/nosrmmu.c --- a/arch/sparc/mm/nosrmmu.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc/mm/nosrmmu.c 2004-07-13 12:24:00 -07:00 @@ -9,10 +9,12 @@ #include #include #include +#include static char shouldnothappen[] __initdata = "SUN4 kernel can only run on SUN4\n"; enum mbus_module srmmu_modtype; +void *srmmu_nocache_pool; int vac_cache_size = 0; @@ -44,11 +46,6 @@ void srmmu_unmapioaddr(unsigned long virt_addr) { -} - -void __init srmmu_end_memory(unsigned long memory_size, unsigned long *mem_end_p) -{ - return 0; } __u32 iounit_map_dma_init(struct sbus_bus *sbus, int size) diff -Nru a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c --- a/arch/sparc/mm/sun4c.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc/mm/sun4c.c 2004-07-13 12:24:01 -07:00 @@ -497,7 +497,7 @@ patch_kernel_fault_handler(); } -volatile unsigned long *sun4c_memerr_reg = 0; +volatile unsigned long *sun4c_memerr_reg = NULL; void __init sun4c_probe_memerr_reg(void) { @@ -599,13 +599,13 @@ for (i=0; i < SUN4C_MAX_SEGMAPS; i++) { mmu_entry_pool[i].pseg = i; - mmu_entry_pool[i].next = 0; - mmu_entry_pool[i].prev = 0; + mmu_entry_pool[i].next = NULL; + mmu_entry_pool[i].prev = NULL; mmu_entry_pool[i].vaddr = 0; mmu_entry_pool[i].locked = 0; mmu_entry_pool[i].ctx = 0; - mmu_entry_pool[i].lru_next = 0; - mmu_entry_pool[i].lru_prev = 0; + mmu_entry_pool[i].lru_next = NULL; + mmu_entry_pool[i].lru_prev = NULL; } mmu_entry_pool[invalid_segment].locked = 1; } @@ -1170,7 +1170,7 @@ local_irq_restore(flags); printk("DMA vaddr=0x%p size=%08lx\n", vaddr, size); panic("Out of iobuffer table"); - return 0; + return NULL; } static void sun4c_unlockarea(char *vaddr, unsigned long size) diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig --- a/arch/sparc64/defconfig 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc64/defconfig 2004-07-13 12:24:00 -07:00 @@ -26,6 +26,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 @@ -158,7 +159,6 @@ # CONFIG_PROM_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_PCI_CONSOLE=y CONFIG_FONTS=y # CONFIG_FONT_8x8 is not set # CONFIG_FONT_8x16 is not set @@ -333,7 +333,6 @@ # CONFIG_AIC79XX_DEBUG_ENABLE is not set CONFIG_AIC79XX_DEBUG_MASK=0 # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set -# CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_MEGARAID is not set CONFIG_SCSI_SATA=y CONFIG_SCSI_SATA_SVW=m @@ -687,7 +686,6 @@ CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m -CONFIG_NET_SCH_CSZ=m CONFIG_NET_SCH_ATM=y CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m @@ -696,7 +694,7 @@ CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m -CONFIG_NET_SCH_DELAY=m +CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y @@ -782,7 +780,6 @@ # # CONFIG_USB_IRDA is not set CONFIG_SIGMATEL_FIR=m -# CONFIG_TOSHIBA_FIR is not set # CONFIG_VLSI_FIR is not set CONFIG_BT=m CONFIG_BT_L2CAP=m @@ -793,6 +790,7 @@ CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_CMTP=m +CONFIG_BT_HIDP=m # # Bluetooth device drivers @@ -1202,6 +1200,7 @@ CONFIG_JOLIET=y # CONFIG_ZISOFS is not set CONFIG_UDF_FS=m +CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems @@ -1605,6 +1604,7 @@ # CONFIG_USB_IBMCAM is not set # CONFIG_USB_KONICAWC is not set # CONFIG_USB_OV511 is not set +CONFIG_USB_PWC=m # CONFIG_USB_SE401 is not set # CONFIG_USB_STV680 is not set CONFIG_USB_W9968CF=m @@ -1775,6 +1775,7 @@ CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=m @@ -1784,6 +1785,7 @@ # # Library routines # +CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y diff -Nru a/arch/sparc64/kernel/auxio.c b/arch/sparc64/kernel/auxio.c --- a/arch/sparc64/kernel/auxio.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc64/kernel/auxio.c 2004-07-13 12:24:01 -07:00 @@ -113,7 +113,7 @@ void __init auxio_probe(void) { struct sbus_bus *sbus; - struct sbus_dev *sdev = 0; + struct sbus_dev *sdev = NULL; for_each_sbus(sbus) { for_each_sbusdev(sdev, sbus) { @@ -131,7 +131,7 @@ #ifdef CONFIG_PCI else { struct linux_ebus *ebus; - struct linux_ebus_device *edev = 0; + struct linux_ebus_device *edev = NULL; for_each_ebus(ebus) { for_each_ebusdev(edev, ebus) { diff -Nru a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c --- a/arch/sparc64/kernel/ebus.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc64/kernel/ebus.c 2004-07-13 12:24:00 -07:00 @@ -267,7 +267,7 @@ } EXPORT_SYMBOL(ebus_dma_enable); -struct linux_ebus *ebus_chain = 0; +struct linux_ebus *ebus_chain = NULL; #ifdef CONFIG_SUN_AUXIO extern void auxio_probe(void); @@ -503,7 +503,7 @@ dev->children = ebus_alloc(sizeof(struct linux_ebus_child)); child = dev->children; - child->next = 0; + child->next = NULL; child->parent = dev; child->bus = dev->bus; fill_ebus_child(node, ®s[0], @@ -513,7 +513,7 @@ child->next = ebus_alloc(sizeof(struct linux_ebus_child)); child = child->next; - child->next = 0; + child->next = NULL; child->parent = dev; child->bus = dev->bus; fill_ebus_child(node, ®s[0], @@ -563,7 +563,7 @@ ebusnd = cookie->prom_node; ebus_chain = ebus = ebus_alloc(sizeof(struct linux_ebus)); - ebus->next = 0; + ebus->next = NULL; ebus->is_rio = is_rio; while (ebusnd) { @@ -606,8 +606,8 @@ ebus->devices = ebus_alloc(sizeof(struct linux_ebus_device)); dev = ebus->devices; - dev->next = 0; - dev->children = 0; + dev->next = NULL; + dev->children = NULL; dev->bus = ebus; fill_ebus_device(nd, dev); @@ -615,8 +615,8 @@ dev->next = ebus_alloc(sizeof(struct linux_ebus_device)); dev = dev->next; - dev->next = 0; - dev->children = 0; + dev->next = NULL; + dev->children = NULL; dev->bus = ebus; fill_ebus_device(nd, dev); } @@ -633,7 +633,7 @@ ebus->next = ebus_alloc(sizeof(struct linux_ebus)); ebus = ebus->next; - ebus->next = 0; + ebus->next = NULL; ebus->is_rio = is_rio; ++num_ebus; } diff -Nru a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c --- a/arch/sparc64/kernel/irq.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc64/kernel/irq.c 2004-07-13 12:24:01 -07:00 @@ -1256,6 +1256,6 @@ void init_irq_proc (void) { /* create /proc/irq */ - root_irq_dir = proc_mkdir("irq", 0); + root_irq_dir = proc_mkdir("irq", NULL); } diff -Nru a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c --- a/arch/sparc64/kernel/power.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc64/kernel/power.c 2004-07-13 12:24:01 -07:00 @@ -134,7 +134,7 @@ printk("power: Control reg at %016lx ... ", power_reg); poweroff_method = machine_halt; /* able to use the standard halt */ if (has_button_interrupt(edev)) { - if (kernel_thread(powerd, 0, CLONE_FS) < 0) { + if (kernel_thread(powerd, NULL, CLONE_FS) < 0) { printk("Failed to start power daemon.\n"); return; } diff -Nru a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c --- a/arch/sparc64/kernel/signal32.c 2004-07-13 12:24:00 -07:00 +++ b/arch/sparc64/kernel/signal32.c 2004-07-13 12:24:00 -07:00 @@ -461,7 +461,7 @@ err |= restore_fpu_state32(regs, &sf->fpu_state); err |= copy_from_user(&seta, &sf->mask, sizeof(compat_sigset_t)); err |= __get_user(u_ss_sp, &sf->stack.ss_sp); - st.ss_sp = (void *) (long) u_ss_sp; + st.ss_sp = compat_ptr(u_ss_sp); err |= __get_user(st.ss_flags, &sf->stack.ss_flags); err |= __get_user(st.ss_size, &sf->stack.ss_size); if (err) @@ -520,7 +520,7 @@ struct sigcontext32 __user *sc; unsigned int seta[_COMPAT_NSIG_WORDS]; int err = 0; - void *sig_address; + void __user *sig_address; int sig_code; unsigned long pc = regs->tpc; unsigned long npc = regs->tnpc; @@ -1031,7 +1031,7 @@ set.sig[1] = setv.sigbits[2] | (((long)setv.sigbits[3]) << 32); err |= __get_user(u_ss_sp, &c->stack.sp); - st.ss_sp = (void *) (long) u_ss_sp; + st.ss_sp = compat_ptr(u_ss_sp); err |= __get_user(st.ss_flags, &c->stack.flags); err |= __get_user(st.ss_size, &c->stack.size); if (err) @@ -1360,7 +1360,7 @@ __get_user(uss.ss_flags, &((stack_t32 __user *)(long)ussa)->ss_flags) || __get_user(uss.ss_size, &((stack_t32 __user *)(long)ussa)->ss_size))) return -EFAULT; - uss.ss_sp = (void *) (long) u_ss_sp; + uss.ss_sp = compat_ptr(u_ss_sp); old_fs = get_fs(); set_fs(KERNEL_DS); ret = do_sigaltstack(ussa ? (stack_t __user *) &uss : NULL, diff -Nru a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c --- a/arch/sparc64/kernel/sys_sparc.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc64/kernel/sys_sparc.c 2004-07-13 12:24:01 -07:00 @@ -448,7 +448,7 @@ info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = TRAP_BRKPT; - info.si_addr = (void *)regs->tpc; + info.si_addr = (void __user *)regs->tpc; info.si_trapno = 0; force_sig_info(SIGTRAP, &info, current); #ifdef DEBUG_SPARC_BREAKPOINT diff -Nru a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c --- a/arch/sparc64/kernel/sys_sparc32.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc64/kernel/sys_sparc32.c 2004-07-13 12:24:01 -07:00 @@ -1293,9 +1293,9 @@ u32 u_handler, u_restorer; ret = get_user(u_handler, &act->sa_handler); - new_ka.sa.sa_handler = (void *) (long) u_handler; + new_ka.sa.sa_handler = compat_ptr(u_handler); ret |= __get_user(u_restorer, &act->sa_restorer); - new_ka.sa.sa_restorer = (void *) (long) u_restorer; + new_ka.sa.sa_restorer = compat_ptr(u_restorer); ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); ret |= __get_user(mask, &act->sa_mask); if (ret) @@ -1340,7 +1340,7 @@ new_ka.ka_restorer = restorer; ret = get_user(u_handler, &act->sa_handler); - new_ka.sa.sa_handler = (void *) (long) u_handler; + new_ka.sa.sa_handler = compat_ptr(u_handler); ret |= __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t)); switch (_NSIG_WORDS) { case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6] | (((long)set32.sig[7]) << 32); @@ -1350,7 +1350,7 @@ } ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); ret |= __get_user(u_restorer, &act->sa_restorer); - new_ka.sa.sa_restorer = (void *) (long) u_restorer; + new_ka.sa.sa_restorer = compat_ptr(u_restorer); if (ret) return -EFAULT; } diff -Nru a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c --- a/arch/sparc64/kernel/sys_sunos32.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc64/kernel/sys_sunos32.c 2004-07-13 12:24:01 -07:00 @@ -465,7 +465,7 @@ info.si_signo = SIGSYS; info.si_errno = 0; info.si_code = __SI_FAULT|0x100; - info.si_addr = (void *)regs->tpc; + info.si_addr = (void __user *)regs->tpc; info.si_trapno = regs->u_regs[UREG_G1]; send_sig_info(SIGSYS, &info, current); if (cnt++ < 4) { @@ -1280,7 +1280,7 @@ if (get_user(u_handler, &act->sa_handler) || __get_user(new_ka.sa.sa_flags, &act->sa_flags)) return -EFAULT; - new_ka.sa.sa_handler = (void *) (long) u_handler; + new_ka.sa.sa_handler = compat_ptr(u_handler); __get_user(mask, &act->sa_mask); new_ka.sa.sa_restorer = NULL; new_ka.ka_restorer = NULL; diff -Nru a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c --- a/arch/sparc64/kernel/traps.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc64/kernel/traps.c 2004-07-13 12:24:01 -07:00 @@ -93,7 +93,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLTRP; - info.si_addr = (void *)regs->tpc; + info.si_addr = (void __user *)regs->tpc; info.si_trapno = lvl; force_sig_info(SIGILL, &info, current); } @@ -133,7 +133,7 @@ info.si_signo = SIGSEGV; info.si_errno = 0; info.si_code = SEGV_MAPERR; - info.si_addr = (void *)regs->tpc; + info.si_addr = (void __user *)regs->tpc; info.si_trapno = 0; force_sig_info(SIGSEGV, &info, current); } @@ -176,7 +176,7 @@ info.si_signo = SIGSEGV; info.si_errno = 0; info.si_code = SEGV_MAPERR; - info.si_addr = (void *)sfar; + info.si_addr = (void __user *)sfar; info.si_trapno = 0; force_sig_info(SIGSEGV, &info, current); } @@ -1617,7 +1617,7 @@ } info.si_signo = SIGFPE; info.si_errno = 0; - info.si_addr = (void *)regs->tpc; + info.si_addr = (void __user *)regs->tpc; info.si_trapno = 0; info.si_code = __SI_FAULT; if ((fsr & 0x1c000) == (1 << 14)) { @@ -1672,7 +1672,7 @@ info.si_signo = SIGEMT; info.si_errno = 0; info.si_code = EMT_TAGOVF; - info.si_addr = (void *)regs->tpc; + info.si_addr = (void __user *)regs->tpc; info.si_trapno = 0; force_sig_info(SIGEMT, &info, current); } @@ -1690,7 +1690,7 @@ info.si_signo = SIGFPE; info.si_errno = 0; info.si_code = FPE_INTDIV; - info.si_addr = (void *)regs->tpc; + info.si_addr = (void __user *)regs->tpc; info.si_trapno = 0; force_sig_info(SIGFPE, &info, current); } @@ -1850,7 +1850,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_ILLOPC; - info.si_addr = (void *)pc; + info.si_addr = (void __user *)pc; info.si_trapno = 0; force_sig_info(SIGILL, &info, current); } @@ -1872,7 +1872,7 @@ info.si_signo = SIGBUS; info.si_errno = 0; info.si_code = BUS_ADRALN; - info.si_addr = (void *)sfar; + info.si_addr = (void __user *)sfar; info.si_trapno = 0; force_sig_info(SIGBUS, &info, current); } @@ -1888,7 +1888,7 @@ info.si_signo = SIGILL; info.si_errno = 0; info.si_code = ILL_PRVOPC; - info.si_addr = (void *)regs->tpc; + info.si_addr = (void __user *)regs->tpc; info.si_trapno = 0; force_sig_info(SIGILL, &info, current); } diff -Nru a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c --- a/arch/sparc64/mm/fault.c 2004-07-13 12:24:01 -07:00 +++ b/arch/sparc64/mm/fault.c 2004-07-13 12:24:01 -07:00 @@ -218,9 +218,9 @@ info.si_signo = sig; info.si_errno = 0; if (fault_code & FAULT_CODE_ITLB) - info.si_addr = (void *) regs->tpc; + info.si_addr = (void __user *) regs->tpc; else - info.si_addr = (void *) + info.si_addr = (void __user *) compute_effective_address(regs, insn, 0); info.si_trapno = 0; force_sig_info(sig, &info, current); diff -Nru a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c --- a/arch/x86_64/ia32/ia32_signal.c 2004-07-13 12:24:01 -07:00 +++ b/arch/x86_64/ia32/ia32_signal.c 2004-07-13 12:24:01 -07:00 @@ -109,7 +109,7 @@ err |= __get_user(to->si_pid, &from->si_pid); err |= __get_user(to->si_uid, &from->si_uid); err |= __get_user(ptr32, &from->si_ptr); - to->si_ptr = (void*)(u64)ptr32; + to->si_ptr = compat_ptr(ptr32); return err; } @@ -146,12 +146,12 @@ if (uss_ptr) { u32 ptr; memset(&uss,0,sizeof(stack_t)); - if (!access_ok(VERIFY_READ,uss_ptr,sizeof(stack_ia32_t)) || - __get_user(ptr, &uss_ptr->ss_sp) || - __get_user(uss.ss_flags, &uss_ptr->ss_flags) || - __get_user(uss.ss_size, &uss_ptr->ss_size)) - return -EFAULT; - uss.ss_sp = (void *)(u64)ptr; + if (!access_ok(VERIFY_READ,uss_ptr,sizeof(stack_ia32_t)) || + __get_user(ptr, &uss_ptr->ss_sp) || + __get_user(uss.ss_flags, &uss_ptr->ss_flags) || + __get_user(uss.ss_size, &uss_ptr->ss_size)) + return -EFAULT; + uss.ss_sp = compat_ptr(ptr); } seg = get_fs(); set_fs(KERNEL_DS); @@ -448,7 +448,7 @@ /* Return stub is in 32bit vsyscall page */ { - void *restorer = VSYSCALL32_SIGRETURN; + void __user *restorer = VSYSCALL32_SIGRETURN; if (ka->sa.sa_flags & SA_RESTORER) restorer = ka->sa.sa_restorer; err |= __put_user(ptr_to_u32(restorer), &frame->pretcode); @@ -541,7 +541,7 @@ { - void *restorer = VSYSCALL32_RTSIGRETURN; + void __user *restorer = VSYSCALL32_RTSIGRETURN; if (ka->sa.sa_flags & SA_RESTORER) restorer = ka->sa.sa_restorer; err |= __put_user(ptr_to_u32(restorer), &frame->pretcode); diff -Nru a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c --- a/arch/x86_64/kernel/i8259.c 2004-07-13 12:24:00 -07:00 +++ b/arch/x86_64/kernel/i8259.c 2004-07-13 12:24:00 -07:00 @@ -402,7 +402,7 @@ for (i = 0; i < NR_IRQS; i++) { irq_desc[i].status = IRQ_DISABLED; - irq_desc[i].action = 0; + irq_desc[i].action = NULL; irq_desc[i].depth = 1; if (i < 16) { diff -Nru a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c --- a/arch/x86_64/kernel/irq.c 2004-07-13 12:24:00 -07:00 +++ b/arch/x86_64/kernel/irq.c 2004-07-13 12:24:00 -07:00 @@ -930,7 +930,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/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c --- a/arch/x86_64/kernel/ldt.c 2004-07-13 12:24:01 -07:00 +++ b/arch/x86_64/kernel/ldt.c 2004-07-13 12:24:01 -07:00 @@ -66,7 +66,7 @@ mask = cpumask_of_cpu(smp_processor_id()); load_LDT(pc); if (!cpus_equal(current->mm->cpu_vm_mask, mask)) - smp_call_function(flush_ldt, 0, 1, 1); + smp_call_function(flush_ldt, NULL, 1, 1); preempt_enable(); #else load_LDT(pc); diff -Nru a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c --- a/arch/x86_64/kernel/pci-gart.c 2004-07-13 12:24:00 -07:00 +++ b/arch/x86_64/kernel/pci-gart.c 2004-07-13 12:24:00 -07:00 @@ -255,7 +255,7 @@ #define SET_LEAK(x) if (iommu_leak_tab) \ iommu_leak_tab[x] = __builtin_return_address(0); #define CLEAR_LEAK(x) if (iommu_leak_tab) \ - iommu_leak_tab[x] = 0; + iommu_leak_tab[x] = NULL; /* Debugging aid for drivers that don't free their IOMMU tables */ static void **iommu_leak_tab; diff -Nru a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c --- a/arch/x86_64/kernel/smp.c 2004-07-13 12:24:02 -07:00 +++ b/arch/x86_64/kernel/smp.c 2004-07-13 12:24:02 -07:00 @@ -343,7 +343,7 @@ void flush_tlb_all(void) { - on_each_cpu(do_flush_tlb_all, 0, 1, 1); + on_each_cpu(do_flush_tlb_all, NULL, 1, 1); } void smp_kdb_stop(void) diff -Nru a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c --- a/arch/x86_64/kernel/traps.c 2004-07-13 12:24:00 -07:00 +++ b/arch/x86_64/kernel/traps.c 2004-07-13 12:24:00 -07:00 @@ -115,7 +115,7 @@ if (stack >= init_tss[cpu].ist[k] && stack <= end) return (unsigned long *)end; } - return 0; + return NULL; } /* @@ -448,7 +448,7 @@ info.si_signo = signr; \ info.si_errno = 0; \ info.si_code = sicode; \ - info.si_addr = (void *)siaddr; \ + info.si_addr = (void __user *)siaddr; \ if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) == NOTIFY_BAD) \ return; \ do_trap(trapnr, signr, str, regs, error_code, &info); \ @@ -662,7 +662,7 @@ if ((regs->cs & 3) == 0) goto clear_dr7; - info.si_addr = (void *)regs->rip; + info.si_addr = (void __user *)regs->rip; force_sig_info(SIGTRAP, &info, tsk); clear_dr7: asm volatile("movq %0,%%db7"::"r"(0UL)); @@ -686,7 +686,7 @@ * the correct behaviour even in the presence of the asynchronous * IRQ13 behaviour */ -void math_error(void *rip) +void math_error(void __user *rip) { struct task_struct * task; siginfo_t info; @@ -743,7 +743,7 @@ asmlinkage void do_coprocessor_error(struct pt_regs * regs) { conditional_sti(regs); - math_error((void *)regs->rip); + math_error((void __user *)regs->rip); } asmlinkage void bad_intr(void) @@ -751,7 +751,7 @@ printk("bad interrupt"); } -static inline void simd_math_error(void *rip) +static inline void simd_math_error(void __user *rip) { struct task_struct * task; siginfo_t info; @@ -802,7 +802,7 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs) { conditional_sti(regs); - simd_math_error((void *)regs->rip); + simd_math_error((void __user *)regs->rip); } asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs) diff -Nru a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c --- a/arch/x86_64/mm/fault.c 2004-07-13 12:24:00 -07:00 +++ b/arch/x86_64/mm/fault.c 2004-07-13 12:24:00 -07:00 @@ -389,7 +389,7 @@ info.si_signo = SIGSEGV; info.si_errno = 0; /* info.si_code has been set above */ - info.si_addr = (void *)address; + info.si_addr = (void __user *)address; force_sig_info(SIGSEGV, &info, tsk); return; } @@ -463,7 +463,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, tsk); return; diff -Nru a/crypto/deflate.c b/crypto/deflate.c --- a/crypto/deflate.c 2004-07-13 12:24:01 -07:00 +++ b/crypto/deflate.c 2004-07-13 12:24:01 -07:00 @@ -39,44 +39,16 @@ #define DEFLATE_DEF_MEMLEVEL MAX_MEM_LEVEL struct deflate_ctx { - int comp_initialized; - int decomp_initialized; struct z_stream_s comp_stream; struct z_stream_s decomp_stream; }; -static inline int deflate_gfp(void) -{ - return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; -} - -static int deflate_init(void *ctx) -{ - return 0; -} - -static void deflate_exit(void *ctx) -{ - struct deflate_ctx *dctx = ctx; - - if (dctx->comp_initialized) - vfree(dctx->comp_stream.workspace); - if (dctx->decomp_initialized) - kfree(dctx->decomp_stream.workspace); -} - -/* - * Lazy initialization to make interface simple without allocating - * un-needed workspaces. Thus can be called in softirq context. - */ static int deflate_comp_init(struct deflate_ctx *ctx) { int ret = 0; struct z_stream_s *stream = &ctx->comp_stream; - stream->workspace = __vmalloc(zlib_deflate_workspacesize(), - deflate_gfp()|__GFP_HIGHMEM, - PAGE_KERNEL); + stream->workspace = vmalloc(zlib_deflate_workspacesize()); if (!stream->workspace ) { ret = -ENOMEM; goto out; @@ -89,7 +61,6 @@ ret = -EINVAL; goto out_free; } - ctx->comp_initialized = 1; out: return ret; out_free: @@ -102,8 +73,7 @@ int ret = 0; struct z_stream_s *stream = &ctx->decomp_stream; - stream->workspace = kmalloc(zlib_inflate_workspacesize(), - deflate_gfp()); + stream->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); if (!stream->workspace ) { ret = -ENOMEM; goto out; @@ -114,7 +84,6 @@ ret = -EINVAL; goto out_free; } - ctx->decomp_initialized = 1; out: return ret; out_free: @@ -122,6 +91,36 @@ goto out; } +static void deflate_comp_exit(struct deflate_ctx *ctx) +{ + vfree(ctx->comp_stream.workspace); +} + +static void deflate_decomp_exit(struct deflate_ctx *ctx) +{ + kfree(ctx->decomp_stream.workspace); +} + +static int deflate_init(void *ctx) +{ + int ret; + + ret = deflate_comp_init(ctx); + if (ret) + goto out; + ret = deflate_decomp_init(ctx); + if (ret) + deflate_comp_exit(ctx); +out: + return ret; +} + +static void deflate_exit(void *ctx) +{ + deflate_comp_exit(ctx); + deflate_decomp_exit(ctx); +} + static int deflate_compress(void *ctx, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen) { @@ -129,12 +128,6 @@ struct deflate_ctx *dctx = ctx; struct z_stream_s *stream = &dctx->comp_stream; - if (!dctx->comp_initialized) { - ret = deflate_comp_init(dctx); - if (ret) - goto out; - } - ret = zlib_deflateReset(stream); if (ret != Z_OK) { ret = -EINVAL; @@ -164,12 +157,6 @@ int ret = 0; struct deflate_ctx *dctx = ctx; struct z_stream_s *stream = &dctx->decomp_stream; - - if (!dctx->decomp_initialized) { - ret = deflate_decomp_init(dctx); - if (ret) - goto out; - } ret = zlib_inflateReset(stream); if (ret != Z_OK) { diff -Nru a/crypto/twofish.c b/crypto/twofish.c --- a/crypto/twofish.c 2004-07-13 12:24:01 -07:00 +++ b/crypto/twofish.c 2004-07-13 12:24:01 -07:00 @@ -663,7 +663,10 @@ /* Check key length. */ if (key_len != 16 && key_len != 24 && key_len != 32) + { + *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; return -EINVAL; /* unsupported key length */ + } /* Compute the first two words of the S vector. The magic numbers are * the entries of the RS matrix, preprocessed through poly_to_exp. The diff -Nru a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c --- a/drivers/acpi/toshiba_acpi.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/acpi/toshiba_acpi.c 2004-07-13 12:24:00 -07:00 @@ -115,7 +115,7 @@ acpi_handle handle; acpi_status status; - status = acpi_get_handle(0, (char*)methodName, &handle); + status = acpi_get_handle(NULL, (char*)methodName, &handle); return !ACPI_FAILURE(status); } @@ -131,7 +131,7 @@ in_objs[0].type = ACPI_TYPE_INTEGER; in_objs[0].integer.value = val; - status = acpi_evaluate_object(0, (char*)methodName, ¶ms, 0); + status = acpi_evaluate_object(NULL, (char*)methodName, ¶ms, NULL); return (status == AE_OK); } @@ -178,7 +178,7 @@ results.length = sizeof(out_objs); results.pointer = out_objs; - status = acpi_evaluate_object(0, (char*)method_hci, ¶ms, + status = acpi_evaluate_object(NULL, (char*)method_hci, ¶ms, &results); if ((status == AE_OK) && (out_objs->package.count <= HCI_WORDS)) { for (i = 0; i < out_objs->package.count; ++i) { @@ -487,8 +487,8 @@ { "video" , read_video , write_video }, { "fan" , read_fan , write_fan }, { "keys" , read_keys , write_keys }, - { "version" , read_version , 0 }, - { 0 , 0 , 0 }, + { "version" , read_version , NULL }, + { NULL } }; static acpi_status __init diff -Nru a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c --- a/drivers/atm/ambassador.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/atm/ambassador.c 2004-07-13 12:24:00 -07:00 @@ -1126,7 +1126,7 @@ } else { r = round_up; } - error = make_rate (pcr, r, &tx_rate_bits, 0); + error = make_rate (pcr, r, &tx_rate_bits, NULL); tx_vc_bits = TX_UBR_CAPPED; tx_frame_bits = TX_FRAME_CAPPED; } @@ -1333,7 +1333,7 @@ PRINTK (KERN_ERR, "%s vcc=%p rxer[vci]=%p", "arghhh! we're going to die!", vcc, dev->rxer[vci]); - dev->rxer[vci] = 0; + dev->rxer[vci] = NULL; while (command_do (dev, &cmd)) schedule(); diff -Nru a/drivers/atm/firestream.c b/drivers/atm/firestream.c --- a/drivers/atm/firestream.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/atm/firestream.c 2004-07-13 12:24:00 -07:00 @@ -1000,7 +1000,7 @@ } else { r = ROUND_UP; } - error = make_rate (pcr, r, &tmc0, 0); + error = make_rate (pcr, r, &tmc0, NULL); } fs_dprintk (FS_DEBUG_OPEN, "pcr = %d.\n", pcr); } diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/atm/he.c 2004-07-13 12:24:00 -07:00 @@ -360,7 +360,7 @@ goto init_one_failure; } - atm_dev = atm_dev_register(DEV_LABEL, &he_ops, -1, 0); + atm_dev = atm_dev_register(DEV_LABEL, &he_ops, -1, NULL); if (!atm_dev) { err = -ENODEV; goto init_one_failure; diff -Nru a/drivers/atm/horizon.c b/drivers/atm/horizon.c --- a/drivers/atm/horizon.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/atm/horizon.c 2004-07-13 12:24:00 -07:00 @@ -1184,7 +1184,7 @@ // tx_regions == 0 // that's all folks - end of frame struct sk_buff * skb = dev->tx_skb; - dev->tx_iovec = 0; + dev->tx_iovec = NULL; // VC layer stats atomic_inc(&ATM_SKB(skb)->vcc->stats->tx); @@ -1761,7 +1761,7 @@ if (tx_iovcnt) { // scatter gather transfer dev->tx_regions = tx_iovcnt; - dev->tx_iovec = 0; /* @@@ needs rewritten */ + dev->tx_iovec = NULL; /* @@@ needs rewritten */ dev->tx_bytes = 0; PRINTD (DBG_TX|DBG_BUS, "TX start scatter-gather transfer (iovec %p, len %d)", skb->data, tx_len); @@ -1771,7 +1771,7 @@ } else { // simple transfer dev->tx_regions = 0; - dev->tx_iovec = 0; + dev->tx_iovec = NULL; dev->tx_bytes = tx_len; dev->tx_addr = skb->data; PRINTD (DBG_TX|DBG_BUS, "TX start simple transfer (addr %p, len %d)", @@ -2278,7 +2278,7 @@ // we take "the PCR" as a rate-cap // not reserved vcc.tx_rate = 0; - make_rate (dev, 1<<30, round_nearest, &vcc.tx_pcr_bits, 0); + make_rate (dev, 1<<30, round_nearest, &vcc.tx_pcr_bits, NULL); vcc.tx_xbr_bits = ABR_RATE_TYPE; break; } @@ -2583,7 +2583,7 @@ PRINTK (KERN_ERR, "%s atm_vcc=%p rxer[channel]=%p", "arghhh! we're going to die!", atm_vcc, dev->rxer[channel]); - dev->rxer[channel] = 0; + dev->rxer[channel] = NULL; } // atomically release our rate reservation @@ -2806,8 +2806,8 @@ dev->tx_regions = 0; dev->tx_bytes = 0; - dev->tx_skb = 0; - dev->tx_iovec = 0; + dev->tx_skb = NULL; + dev->tx_iovec = NULL; dev->tx_cell_count = 0; dev->rx_cell_count = 0; diff -Nru a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c --- a/drivers/atm/idt77252.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/atm/idt77252.c 2004-07-13 12:24:01 -07:00 @@ -3729,7 +3729,7 @@ return -EIO; } - dev = atm_dev_register("idt77252", &idt77252_ops, -1, 0); + dev = atm_dev_register("idt77252", &idt77252_ops, -1, NULL); if (!dev) { printk("%s: can't register atm device\n", card->name); iounmap((void *) card->membase); diff -Nru a/drivers/atm/iphase.c b/drivers/atm/iphase.c --- a/drivers/atm/iphase.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/atm/iphase.c 2004-07-13 12:24:01 -07:00 @@ -2667,7 +2667,7 @@ } // Drain the packets rx_dle_intr(vcc->dev); - iadev->rx_open[vcc->vci] = 0; + iadev->rx_open[vcc->vci] = NULL; } kfree(INPH_IA_VCC(vcc)); ia_vcc = NULL; diff -Nru a/drivers/atm/lanai.c b/drivers/atm/lanai.c --- a/drivers/atm/lanai.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/atm/lanai.c 2004-07-13 12:24:00 -07:00 @@ -2702,7 +2702,7 @@ return -ENOMEM; } - atmdev = atm_dev_register(DEV_LABEL, &ops, -1, 0); + atmdev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); if (atmdev == NULL) { printk(KERN_ERR DEV_LABEL ": couldn't register atm device!\n"); diff -Nru a/drivers/block/cryptoloop.c b/drivers/block/cryptoloop.c --- a/drivers/block/cryptoloop.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/block/cryptoloop.c 2004-07-13 12:24:01 -07:00 @@ -93,8 +93,8 @@ int size, sector_t IV) { struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data; - struct scatterlist sg_out = { 0, }; - struct scatterlist sg_in = { 0, }; + struct scatterlist sg_out = { NULL, }; + struct scatterlist sg_in = { NULL, }; encdec_ecb_t encdecfunc; struct page *in_page, *out_page; @@ -147,8 +147,8 @@ int size, sector_t IV) { struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data; - struct scatterlist sg_out = { 0, }; - struct scatterlist sg_in = { 0, }; + struct scatterlist sg_out = { NULL, }; + struct scatterlist sg_in = { NULL, }; encdec_cbc_t encdecfunc; struct page *in_page, *out_page; diff -Nru a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c --- a/drivers/block/paride/paride.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/block/paride/paride.c 2004-07-13 12:24:00 -07:00 @@ -264,7 +264,7 @@ printk("paride: %s not registered\n", pr->name); return; } - protocols[pr->index] = 0; + protocols[pr->index] = NULL; } EXPORT_SYMBOL(pi_unregister); diff -Nru a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c --- a/drivers/block/paride/pcd.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/block/paride/pcd.c 2004-07-13 12:24:01 -07:00 @@ -752,7 +752,7 @@ pcd_count = pcd_req->current_nr_sectors; pcd_buf = pcd_req->buffer; pcd_busy = 1; - ps_set_intr(do_pcd_read, 0, 0, nice); + ps_set_intr(do_pcd_read, NULL, 0, nice); return; } else end_request(pcd_req, 0); diff -Nru a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c --- a/drivers/block/paride/pf.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/block/paride/pf.c 2004-07-13 12:24:01 -07:00 @@ -841,7 +841,7 @@ /* detach from the calling context - in case the spinlock is held */ static void do_pf_read(void) { - ps_set_intr(do_pf_read_start, 0, 0, nice); + ps_set_intr(do_pf_read_start, NULL, 0, nice); } static void do_pf_read_start(void) @@ -887,7 +887,7 @@ static void do_pf_write(void) { - ps_set_intr(do_pf_write_start, 0, 0, nice); + ps_set_intr(do_pf_write_start, NULL, 0, nice); } static void do_pf_write_start(void) diff -Nru a/drivers/block/xd.c b/drivers/block/xd.c --- a/drivers/block/xd.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/block/xd.c 2004-07-13 12:24:01 -07:00 @@ -96,7 +96,7 @@ #include #define xd_dma_mem_alloc(size) __get_dma_pages(GFP_KERNEL,get_order(size)) #define xd_dma_mem_free(addr, size) free_pages(addr, get_order(size)) -static char *xd_dma_buffer = 0; +static char *xd_dma_buffer; static XD_SIGNATURE xd_sigs[] __initdata = { { 0x0000,"Override geometry handler",NULL,xd_override_init_drive,"n unknown" }, /* Pat Mackinlay, pat@it.com.au */ @@ -344,7 +344,7 @@ if (nodma && xd_dma_buffer) { xd_dma_mem_free((unsigned long)xd_dma_buffer, xd_maxsectors * 0x200); - xd_dma_buffer = 0; + xd_dma_buffer = NULL; } else if (!nodma && !xd_dma_buffer) { xd_dma_buffer = (char *)xd_dma_mem_alloc(xd_maxsectors * 0x200); if (!xd_dma_buffer) { @@ -448,7 +448,7 @@ u_char cmdblk[6]; xd_build(cmdblk,CMD_RECALIBRATE,drive,0,0,0,0,0); - if (xd_command(cmdblk,PIO_MODE,0,0,0,XD_TIMEOUT * 8)) + if (xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT * 8)) printk("xd%c: warning! error recalibrating, controller may be unstable\n", 'a'+drive); } @@ -607,7 +607,7 @@ if (csb & CSB_ERROR) { /* read sense data if error */ xd_build(cmdblk,CMD_SENSE,(csb & CSB_LUN) >> 5,0,0,0,0,0); - if (xd_command(cmdblk,0,sense,0,0,XD_TIMEOUT)) + if (xd_command(cmdblk,0,sense,NULL,NULL,XD_TIMEOUT)) printk("xd: warning! sense command failed!\n"); } @@ -624,7 +624,7 @@ for (i = 0; i < XD_MAXDRIVES; i++) { xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0); - if (!xd_command(cmdblk,PIO_MODE,0,0,0,XD_TIMEOUT * 8)) { + if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(XD_INIT_DISK_DELAY); @@ -714,7 +714,7 @@ u_char cmdblk[6],buf[64]; xd_build(cmdblk,CMD_DTCGETGEOM,drive,0,0,0,0,0); - if (!xd_command(cmdblk,PIO_MODE,buf,0,0,XD_TIMEOUT * 2)) { + if (!xd_command(cmdblk,PIO_MODE,buf,NULL,NULL,XD_TIMEOUT * 2)) { xd_info[drive].heads = buf[0x0A]; /* heads */ xd_info[drive].cylinders = ((u_short *) (buf))[0x04]; /* cylinders */ xd_info[drive].sectors = 17; /* sectors */ @@ -729,7 +729,7 @@ xd_setparam(CMD_DTCSETPARAM,drive,xd_info[drive].heads,xd_info[drive].cylinders,((u_short *) (buf + 1))[0x05],((u_short *) (buf + 1))[0x06],buf[0x0F]); xd_build(cmdblk,CMD_DTCSETSTEP,drive,0,0,0,0,7); - if (xd_command(cmdblk,PIO_MODE,0,0,0,XD_TIMEOUT * 2)) + if (xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT * 2)) printk("xd_dtc_init_drive: error setting step rate for xd%c\n", 'a'+drive); } else @@ -785,7 +785,7 @@ xd_irq = 9; rll = (jumper_state & 0x30) ? (0x04 << wd_1002) : 0; xd_build(cmdblk,CMD_READ,drive,0,0,0,1,0); - if (!xd_command(cmdblk,PIO_MODE,buf,0,0,XD_TIMEOUT * 2)) { + if (!xd_command(cmdblk,PIO_MODE,buf,NULL,NULL,XD_TIMEOUT * 2)) { xd_info[drive].heads = buf[0x1AF]; /* heads */ xd_info[drive].cylinders = ((u_short *) (buf + 1))[0xD6]; /* cylinders */ xd_info[drive].sectors = 17; /* sectors */ @@ -862,7 +862,7 @@ u_char cmdblk[6],buf[0x200]; xd_build(cmdblk,CMD_ST11GETGEOM,drive,0,0,0,1,0); - if (!xd_command(cmdblk,PIO_MODE,buf,0,0,XD_TIMEOUT * 2)) { + if (!xd_command(cmdblk,PIO_MODE,buf,NULL,NULL,XD_TIMEOUT * 2)) { xd_info[drive].heads = buf[0x04]; /* heads */ xd_info[drive].cylinders = (buf[0x02] << 8) | buf[0x03]; /* cylinders */ xd_info[drive].sectors = buf[0x05]; /* sectors */ @@ -987,7 +987,7 @@ while (min[i] != max[i] - 1) { test[i] = (min[i] + max[i]) / 2; xd_build(cmdblk,CMD_SEEK,drive,(u_char) test[0],(u_short) test[1],(u_char) test[2],0,0); - if (!xd_command(cmdblk,PIO_MODE,0,0,0,XD_TIMEOUT * 2)) + if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT * 2)) min[i] = test[i]; else max[i] = test[i]; @@ -1039,7 +1039,7 @@ /* Some controllers require geometry info as data, not command */ - if (xd_command(cmdblk,PIO_MODE,0,&cmdblk[6],0,XD_TIMEOUT * 2)) + if (xd_command(cmdblk,PIO_MODE,NULL,&cmdblk[6],NULL,XD_TIMEOUT * 2)) printk("xd: error setting characteristics for xd%c\n", 'a'+drive); } diff -Nru a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c --- a/drivers/bluetooth/bfusb.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/bluetooth/bfusb.c 2004-07-13 12:24:01 -07:00 @@ -586,7 +586,6 @@ } bfusb->udev->toggle[0] = bfusb->udev->toggle[1] = 0; - bfusb->udev->halted[0] = bfusb->udev->halted[1] = 0; buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_ATOMIC); if (!buf) { @@ -628,7 +627,6 @@ } bfusb->udev->toggle[0] = bfusb->udev->toggle[1] = 0; - bfusb->udev->halted[0] = bfusb->udev->halted[1] = 0; BT_INFO("BlueFRITZ! USB device ready"); diff -Nru a/drivers/char/cyclades.c b/drivers/char/cyclades.c --- a/drivers/char/cyclades.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/char/cyclades.c 2004-07-13 12:24:00 -07:00 @@ -721,7 +721,7 @@ (unsigned char *) 0xDA000, (unsigned char *) 0xDC000, (unsigned char *) 0xDE000, - 0,0,0,0,0,0,0,0 + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL }; #define NR_ISA_ADDRS (sizeof(cy_isa_addresses)/sizeof(unsigned char*)) @@ -2236,7 +2236,7 @@ if (info->xmit_buf){ unsigned char * temp; temp = info->xmit_buf; - info->xmit_buf = 0; + info->xmit_buf = NULL; free_page((unsigned long) temp); } cy_writeb((u_long)base_addr+(CyCAR<xmit_buf){ unsigned char * temp; temp = info->xmit_buf; - info->xmit_buf = 0; + info->xmit_buf = NULL; free_page((unsigned long) temp); } @@ -2856,7 +2856,7 @@ tty->closing = 0; info->event = 0; - info->tty = 0; + info->tty = NULL; if (info->blocked_open) { CY_UNLOCK(info, flags); if (info->close_delay) { @@ -4583,7 +4583,7 @@ #ifdef CY_DEBUG_COUNT printk("cyc:cy_hangup (%d): setting count to 0\n", current->pid); #endif - info->tty = 0; + info->tty = NULL; info->flags &= ~ASYNC_NORMAL_ACTIVE; wake_up_interruptible(&info->open_wait); } /* cy_hangup */ @@ -5471,7 +5471,7 @@ info->line = port; info->chip_rev = 0; info->flags = STD_COM_FLAGS; - info->tty = 0; + info->tty = NULL; if (mailbox == ZO_V1) info->xmit_fifo_size = CYZ_FIFO_SIZE; else @@ -5533,7 +5533,7 @@ info->card = board; info->line = port; info->flags = STD_COM_FLAGS; - info->tty = 0; + info->tty = NULL; info->xmit_fifo_size = CyMAX_CHAR_FIFO; info->cor1 = CyPARITY_NONE|Cy_1_STOP|Cy_8_BITS; info->cor2 = CyETC; diff -Nru a/drivers/char/drm/drm_bufs.h b/drivers/char/drm/drm_bufs.h --- a/drivers/char/drm/drm_bufs.h 2004-07-13 12:24:00 -07:00 +++ b/drivers/char/drm/drm_bufs.h 2004-07-13 12:24:00 -07:00 @@ -125,7 +125,7 @@ return -EINVAL; } map->mtrr = -1; - map->handle = 0; + map->handle = NULL; switch ( map->type ) { case _DRM_REGISTERS: @@ -468,7 +468,7 @@ buf->waiting = 0; buf->pending = 0; init_waitqueue_head( &buf->dma_wait ); - buf->filp = 0; + buf->filp = NULL; buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T); buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T), @@ -692,7 +692,7 @@ buf->waiting = 0; buf->pending = 0; init_waitqueue_head( &buf->dma_wait ); - buf->filp = 0; + buf->filp = NULL; buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T); buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T), 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-13 12:24:01 -07:00 +++ b/drivers/char/drm/drm_drv.h 2004-07-13 12:24:01 -07:00 @@ -532,7 +532,7 @@ #endif if ( dev->lock.hw_lock ) { dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */ - dev->lock.filp = 0; + dev->lock.filp = NULL; wake_up_interruptible( &dev->lock.lock_queue ); } up( &dev->struct_sem ); diff -Nru a/drivers/char/drm/radeon_mem.c b/drivers/char/drm/radeon_mem.c --- a/drivers/char/drm/radeon_mem.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/char/drm/radeon_mem.c 2004-07-13 12:24:01 -07:00 @@ -49,7 +49,7 @@ goto out; newblock->start = start; newblock->size = p->size - (start - p->start); - newblock->filp = 0; + newblock->filp = NULL; newblock->next = p->next; newblock->prev = p; p->next->prev = newblock; @@ -65,7 +65,7 @@ goto out; newblock->start = start + size; newblock->size = p->size - size; - newblock->filp = 0; + newblock->filp = NULL; newblock->next = p->next; newblock->prev = p; p->next->prev = newblock; @@ -108,7 +108,7 @@ static void free_block( struct mem_block *p ) { - p->filp = 0; + p->filp = NULL; /* Assumes a single contiguous range. Needs a special filp in * 'heap' to stop it being subsumed. @@ -147,7 +147,7 @@ blocks->start = start; blocks->size = size; - blocks->filp = 0; + blocks->filp = NULL; blocks->next = blocks->prev = *heap; memset( *heap, 0, sizeof(**heap) ); @@ -168,7 +168,7 @@ for (p = heap->next ; p != heap ; p = p->next) { if (p->filp == filp) - p->filp = 0; + p->filp = NULL; } /* Assumes a single contiguous range. Needs a special filp in @@ -201,7 +201,7 @@ } DRM_FREE( *heap, sizeof(**heap) ); - *heap = 0; + *heap = NULL; } @@ -217,7 +217,7 @@ case RADEON_MEM_REGION_FB: return &dev_priv->fb_heap; default: - return 0; + return NULL; } } diff -Nru a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c --- a/drivers/char/drm/radeon_state.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/char/drm/radeon_state.c 2004-07-13 12:24:01 -07:00 @@ -2310,7 +2310,7 @@ drm_radeon_private_t *dev_priv = dev->dev_private; drm_file_t *filp_priv; drm_device_dma_t *dma = dev->dma; - drm_buf_t *buf = 0; + drm_buf_t *buf = NULL; int idx; drm_radeon_cmd_buffer_t cmdbuf; drm_radeon_cmd_header_t header; diff -Nru a/drivers/char/drm/sis_ds.c b/drivers/char/drm/sis_ds.c --- a/drivers/char/drm/sis_ds.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/char/drm/sis_ds.c 2004-07-13 12:24:01 -07:00 @@ -165,7 +165,7 @@ PMemBlock blocks; if (size <= 0) - return 0; + return NULL; blocks = (TMemBlock *)DRM(calloc)(1, sizeof(TMemBlock), DRM_MEM_DRIVER); if (blocks != NULL) { @@ -174,7 +174,7 @@ blocks->free = 1; return (memHeap_t *)blocks; } else - return 0; + return NULL; } /* Checks if a pointer 'b' is part of the heap 'heap' */ diff -Nru a/drivers/char/h8.c b/drivers/char/h8.c --- a/drivers/char/h8.c 2004-07-13 12:24:00 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,1180 +0,0 @@ -/* - * Hitachi H8/337 Microcontroller driver - * - * The H8 is used to deal with the power and thermal environment - * of a system. - * - * Fixes: - * June 1999, AV added releasing /proc/driver/h8 - * Feb 2000, Borislav Deianov - * changed queues to use list.h instead of lists.h - */ - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "h8.h" - -#define DEBUG_H8 - -#ifdef DEBUG_H8 -#define Dprintk printk -#else -#define Dprintk -#endif - -#define XDprintk if(h8_debug==-1)printk - -/* - * The h8 device is one of the misc char devices. - */ -#define H8_MINOR_DEV 140 - -/* - * Forward declarations. - */ -static int h8_init(void); -static int h8_display_blank(void); -static int h8_display_unblank(void); - -static void h8_intr(int irq, void *dev_id, struct pt_regs *regs); - -static int h8_get_info(char *, char **, off_t, int); - -/* - * Support Routines. - */ -static void h8_hw_init(void); -static void h8_start_new_cmd(void); -static void h8_send_next_cmd_byte(void); -static void h8_read_event_status(void); -static void h8_sync(void); -static void h8_q_cmd(u_char *, int, int); -static void h8_cmd_done(h8_cmd_q_t *qp); -static int h8_alloc_queues(void); - -static u_long h8_get_cpu_speed(void); -static int h8_get_curr_temp(u_char curr_temp[]); -static void h8_get_max_temp(void); -static void h8_get_upper_therm_thold(void); -static void h8_set_upper_therm_thold(int); -static int h8_get_ext_status(u_char stat_word[]); - -static int h8_monitor_thread(void *); - -static int h8_manage_therm(void); -static void h8_set_cpu_speed(int speed_divisor); - -static void h8_start_monitor_timer(unsigned long secs); -static void h8_activate_monitor(unsigned long unused); - -/* in arch/alpha/kernel/lca.c */ -extern void lca_clock_print(void); -extern int lca_get_clock(void); -extern void lca_clock_fiddle(int); - -static void h8_set_event_mask(int); -static void h8_clear_event_mask(int); - -/* - * Driver structures - */ - -static struct timer_list h8_monitor_timer; -static int h8_monitor_timer_active = 0; - -static char driver_version[] = "X0.0";/* no spaces */ - -static union intr_buf intrbuf; -static int intr_buf_ptr; -static union intr_buf xx; -static u_char last_temp; - -/* - * I/O Macros for register reads and writes. - */ -#define H8_READ(a) inb((a)) -#define H8_WRITE(d,a) outb((d),(a)) - -#define H8_GET_STATUS H8_READ((h8_base) + H8_STATUS_REG_OFF) -#define H8_READ_DATA H8_READ((h8_base) + H8_DATA_REG_OFF) -#define WRITE_DATA(d) H8_WRITE((d), h8_base + H8_DATA_REG_OFF) -#define WRITE_CMD(d) H8_WRITE((d), h8_base + H8_CMD_REG_OFF) - -static unsigned int h8_base = H8_BASE_ADDR; -static unsigned int h8_irq = H8_IRQ; -static unsigned int h8_state = H8_IDLE; -static unsigned int h8_index = -1; -static unsigned int h8_enabled = 0; - -static LIST_HEAD(h8_actq); -static LIST_HEAD(h8_cmdq); -static LIST_HEAD(h8_freeq); - -/* - * Globals used in thermal control of Alphabook1. - */ -static int cpu_speed_divisor = -1; -static int h8_event_mask = 0; -static DECLARE_WAIT_QUEUE_HEAD(h8_monitor_wait); -static unsigned int h8_command_mask = 0; -static int h8_uthermal_threshold = DEFAULT_UTHERMAL_THRESHOLD; -static int h8_uthermal_window = UTH_HYSTERESIS; -static int h8_debug = 0xfffffdfc; -static int h8_ldamp = MHZ_115; -static int h8_udamp = MHZ_57; -static u_char h8_current_temp = 0; -static u_char h8_system_temp = 0; -static int h8_sync_channel = 0; -static DECLARE_WAIT_QUEUE_HEAD(h8_sync_wait); -static int h8_init_performed; - -/* CPU speeds and clock divisor values */ -static int speed_tab[6] = {230, 153, 115, 57, 28, 14}; - -/* - * H8 interrupt handler - */ -static void h8_intr(int irq, void *dev_id, struct pt_regs *regs) -{ - u_char stat_reg, data_reg; - h8_cmd_q_t *qp = list_entry(h8_actq.next, h8_cmd_q_t, link); - - stat_reg = H8_GET_STATUS; - data_reg = H8_READ_DATA; - - XDprintk("h8_intr: state %d status 0x%x data 0x%x\n", h8_state, stat_reg, data_reg); - - switch (h8_state) { - /* Response to an asynchronous event. */ - case H8_IDLE: { /* H8_IDLE */ - if (stat_reg & H8_OFULL) { - if (data_reg == H8_INTR) { - h8_state = H8_INTR_MODE; - /* Executing a command to determine what happened. */ - WRITE_CMD(H8_RD_EVENT_STATUS); - intr_buf_ptr = 1; - WRITE_CMD(H8_RD_EVENT_STATUS); - } else { - Dprintk("h8_intr: idle stat 0x%x data 0x%x\n", - stat_reg, data_reg); - } - } else { - Dprintk("h8_intr: bogus interrupt\n"); - } - break; - } - case H8_INTR_MODE: { /* H8_INTR_MODE */ - XDprintk("H8 intr/intr_mode\n"); - if (data_reg == H8_BYTE_LEVEL_ACK) { - return; - } else if (data_reg == H8_CMD_ACK) { - return; - } else { - intrbuf.byte[intr_buf_ptr] = data_reg; - if(!intr_buf_ptr) { - h8_state = H8_IDLE; - h8_read_event_status(); - } - intr_buf_ptr--; - } - break; - } - /* Placed in this state by h8_start_new_cmd(). */ - case H8_XMIT: { /* H8_XMIT */ - XDprintk("H8 intr/xmit\n"); - /* If a byte level acknowledgement has been received */ - if (data_reg == H8_BYTE_LEVEL_ACK) { - XDprintk("H8 intr/xmit BYTE ACK\n"); - qp->nacks++; - if (qp->nacks > qp->ncmd) - if(h8_debug & 0x1) - Dprintk("h8intr: bogus # of acks!\n"); - /* - * If the number of bytes sent is less than the total - * number of bytes in the command. - */ - if (qp->cnt < qp->ncmd) { - h8_send_next_cmd_byte(); - } - return; - /* If the complete command has produced an acknowledgement. */ - } else if (data_reg == H8_CMD_ACK) { - XDprintk("H8 intr/xmit CMD ACK\n"); - /* If there are response bytes */ - if (qp->nrsp) - h8_state = H8_RCV; - else - h8_state = H8_IDLE; - qp->cnt = 0; - return; - /* Error, need to start over with a clean slate. */ - } else if (data_reg == H8_NACK) { - XDprintk("h8_intr: NACK received restarting command\n"); - qp->nacks = 0; - qp->cnt = 0; - h8_state = H8_IDLE; - WRITE_CMD(H8_SYNC); - return; - } else { - Dprintk ("h8intr: xmit unknown data 0x%x \n", data_reg); - return; - } - break; - } - case H8_RESYNC: { /* H8_RESYNC */ - XDprintk("H8 intr/resync\n"); - if (data_reg == H8_BYTE_LEVEL_ACK) { - return; - } else if (data_reg == H8_SYNC_BYTE) { - h8_state = H8_IDLE; - if (!list_empty(&h8_actq)) - h8_send_next_cmd_byte(); - } else { - Dprintk ("h8_intr: resync unknown data 0x%x \n", data_reg); - return; - } - break; - } - case H8_RCV: { /* H8_RCV */ - XDprintk("H8 intr/rcv\n"); - if (qp->cnt < qp->nrsp) { - qp->rcvbuf[qp->cnt] = data_reg; - qp->cnt++; - /* If command reception finished. */ - if (qp->cnt == qp->nrsp) { - h8_state = H8_IDLE; - list_del(&qp->link); - h8_cmd_done (qp); - /* More commands to send over? */ - if (!list_empty(&h8_cmdq)) - h8_start_new_cmd(); - } - return; - } else { - Dprintk ("h8intr: rcv overflow cmd 0x%x\n", qp->cmdbuf[0]); - } - break; - } - default: /* default */ - Dprintk("H8 intr/unknown\n"); - break; - } - return; -} - -static void __exit h8_cleanup (void) -{ - remove_proc_entry("driver/h8", NULL); - release_region(h8_base, 8); - free_irq(h8_irq, NULL); -} - -static int __init h8_init(void) -{ - if(request_irq(h8_irq, h8_intr, SA_INTERRUPT, "h8", NULL)) - { - printk(KERN_ERR "H8: error: IRQ %d is not free\n", h8_irq); - return -EIO; - } - printk(KERN_INFO "H8 at 0x%x IRQ %d\n", h8_base, h8_irq); - - if (!request_region(h8_base, 8, "h8")) - { - free_irq(h8_irq, NULL); - return -EIO; - } - - create_proc_info_entry("driver/h8", 0, NULL, h8_get_info); - - h8_alloc_queues(); - - h8_hw_init(); - - kernel_thread(h8_monitor_thread, NULL, 0); - - return 0; -} - -module_init(h8_init); -module_exit(h8_cleanup); - -static void __init h8_hw_init(void) -{ - u_char buf[H8_MAX_CMD_SIZE]; - - /* set CPU speed to max for booting */ - h8_set_cpu_speed(MHZ_230); - - /* - * Initialize the H8 - */ - h8_sync(); /* activate interrupts */ - - /* To clear conditions left by console */ - h8_read_event_status(); - - /* Perform a conditioning read */ - buf[0] = H8_DEVICE_CONTROL; - buf[1] = 0xff; - buf[2] = 0x0; - h8_q_cmd(buf, 3, 1); - - /* Turn on built-in and external mice, capture power switch */ - buf[0] = H8_DEVICE_CONTROL; - buf[1] = 0x0; - buf[2] = H8_ENAB_INT_PTR | H8_ENAB_EXT_PTR | - /*H8_DISAB_PWR_OFF_SW |*/ H8_ENAB_LOW_SPD_IND; - h8_q_cmd(buf, 3, 1); - - h8_enabled = 1; - return; -} - -static int h8_get_info(char *buf, char **start, off_t fpos, int length) -{ -#ifdef CONFIG_PROC_FS - char *p; - - if (!h8_enabled) - return 0; - p = buf; - - - /* - 0) Linux driver version (this will change if format changes) - 1) - 2) - 3) - 4) - */ - - p += sprintf(p, "%s \n", - driver_version - ); - - return p - buf; -#else - return 0; -#endif -} - -/* Called from console driver -- must make sure h8_enabled. */ -static int h8_display_blank(void) -{ -#ifdef CONFIG_H8_DISPLAY_BLANK - int error; - - if (!h8_enabled) - return 0; - error = h8_set_display_power_state(H8_STATE_STANDBY); - if (error == H8_SUCCESS) - return 1; - h8_error("set display standby", error); -#endif - return 0; -} - -/* Called from console driver -- must make sure h8_enabled. */ -static int h8_display_unblank(void) -{ -#ifdef CONFIG_H8_DISPLAY_BLANK - int error; - - if (!h8_enabled) - return 0; - error = h8_set_display_power_state(H8_STATE_READY); - if (error == H8_SUCCESS) - return 1; - h8_error("set display ready", error); -#endif - return 0; -} - -static int h8_alloc_queues(void) -{ - h8_cmd_q_t *qp; - unsigned long flags; - int i; - - qp = (h8_cmd_q_t *)kmalloc((sizeof (h8_cmd_q_t) * H8_Q_ALLOC_AMOUNT), - GFP_KERNEL); - - if (!qp) { - printk(KERN_ERR "H8: could not allocate memory for command queue\n"); - return(0); - } - /* add to the free queue */ - save_flags(flags); cli(); - for (i = 0; i < H8_Q_ALLOC_AMOUNT; i++) { - /* place each at front of freeq */ - list_add(&qp[i].link, &h8_freeq); - } - restore_flags(flags); - return (1); -} - -/* - * Basic means by which commands are sent to the H8. - */ -void -h8_q_cmd(u_char *cmd, int cmd_size, int resp_size) -{ - h8_cmd_q_t *qp; - unsigned long flags; - int i; - - /* get cmd buf */ - save_flags(flags); cli(); - while (list_empty(&h8_freeq)) { - Dprintk("H8: need to allocate more cmd buffers\n"); - restore_flags(flags); - h8_alloc_queues(); - save_flags(flags); cli(); - } - /* get first element from queue */ - qp = list_entry(h8_freeq.next, h8_cmd_q_t, link); - list_del(&qp->link); - - restore_flags(flags); - - /* fill it in */ - for (i = 0; i < cmd_size; i++) - qp->cmdbuf[i] = cmd[i]; - qp->ncmd = cmd_size; - qp->nrsp = resp_size; - - /* queue it at the end of the cmd queue */ - save_flags(flags); cli(); - - /* XXX this actually puts it at the start of cmd queue, bug? */ - list_add(&qp->link, &h8_cmdq); - - restore_flags(flags); - - h8_start_new_cmd(); -} - -void -h8_start_new_cmd(void) -{ - unsigned long flags; - h8_cmd_q_t *qp; - - save_flags(flags); cli(); - if (h8_state != H8_IDLE) { - if (h8_debug & 0x1) - Dprintk("h8_start_new_cmd: not idle\n"); - restore_flags(flags); - return; - } - - if (!list_empty(&h8_actq)) { - Dprintk("h8_start_new_cmd: inconsistency: IDLE with non-empty active queue!\n"); - restore_flags(flags); - return; - } - - if (list_empty(&h8_cmdq)) { - Dprintk("h8_start_new_cmd: no command to dequeue\n"); - restore_flags(flags); - return; - } - /* - * Take first command off of the command queue and put - * it on the active queue. - */ - qp = list_entry(h8_cmdq.next, h8_cmd_q_t, link); - list_del(&qp->link); - /* XXX should this go to the end of the active queue? */ - list_add(&qp->link, &h8_actq); - h8_state = H8_XMIT; - if (h8_debug & 0x1) - Dprintk("h8_start_new_cmd: Starting a command\n"); - - qp->cnt = 1; - WRITE_CMD(qp->cmdbuf[0]); /* Kick it off */ - - restore_flags(flags); - return; -} - -void -h8_send_next_cmd_byte(void) -{ - h8_cmd_q_t *qp = list_entry(h8_actq.next, h8_cmd_q_t, link); - int cnt; - - cnt = qp->cnt; - qp->cnt++; - - if (h8_debug & 0x1) - Dprintk("h8 sending next cmd byte 0x%x (0x%x)\n", - cnt, qp->cmdbuf[cnt]); - - if (cnt) { - WRITE_DATA(qp->cmdbuf[cnt]); - } else { - WRITE_CMD(qp->cmdbuf[cnt]); - } - return; -} - -/* - * Synchronize H8 communications channel for command transmission. - */ -void -h8_sync(void) -{ - u_char buf[H8_MAX_CMD_SIZE]; - - buf[0] = H8_SYNC; - buf[1] = H8_SYNC_BYTE; - h8_q_cmd(buf, 2, 1); -} - -/* - * Responds to external interrupt. Reads event status word and - * decodes type of interrupt. - */ -void -h8_read_event_status(void) -{ - - if(h8_debug & 0x200) - printk(KERN_DEBUG "h8_read_event_status: value 0x%x\n", intrbuf.word); - - /* - * Power related items - */ - if (intrbuf.word & H8_DC_CHANGE) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: DC_CHANGE\n"); - /* see if dc added or removed, set batt/dc flag, send event */ - - h8_set_event_mask(H8_MANAGE_BATTERY); - wake_up(&h8_monitor_wait); - } - - if (intrbuf.word & H8_POWER_BUTTON) { - printk(KERN_CRIT "Power switch pressed - please wait - preparing to power -off\n"); - h8_set_event_mask(H8_POWER_BUTTON); - wake_up(&h8_monitor_wait); - } - - /* - * Thermal related items - */ - if (intrbuf.word & H8_THERMAL_THRESHOLD) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: THERMAL_THRESHOLD\n"); - h8_set_event_mask(H8_MANAGE_UTHERM); - wake_up(&h8_monitor_wait); - } - - /* - * nops -for now - */ - if (intrbuf.word & H8_DOCKING_STATION_STATUS) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: DOCKING_STATION_STATUS\n"); - /* read_ext_status */ - } - if (intrbuf.word & H8_EXT_BATT_STATUS) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: EXT_BATT_STATUS\n"); - - } - if (intrbuf.word & H8_EXT_BATT_CHARGE_STATE) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: EXT_BATT_CHARGE_STATE\n"); - - } - if (intrbuf.word & H8_BATT_CHANGE_OVER) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: BATT_CHANGE_OVER\n"); - - } - if (intrbuf.word & H8_WATCHDOG) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: WATCHDOG\n"); - /* nop */ - } - if (intrbuf.word & H8_SHUTDOWN) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: SHUTDOWN\n"); - /* nop */ - } - if (intrbuf.word & H8_KEYBOARD) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: KEYBOARD\n"); - /* nop */ - } - if (intrbuf.word & H8_EXT_MOUSE_OR_CASE_SWITCH) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: EXT_MOUSE_OR_CASE_SWITCH\n"); - /* read_ext_status*/ - } - if (intrbuf.word & H8_INT_BATT_LOW) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: INT_BATT_LOW\n"); post - /* event, warn user */ - } - if (intrbuf.word & H8_INT_BATT_CHARGE_STATE) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: INT_BATT_CHARGE_STATE\n"); - /* nop - happens often */ - } - if (intrbuf.word & H8_INT_BATT_STATUS) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: INT_BATT_STATUS\n"); - - } - if (intrbuf.word & H8_INT_BATT_CHARGE_THRESHOLD) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: INT_BATT_CHARGE_THRESHOLD\n"); - /* nop - happens often */ - } - if (intrbuf.word & H8_EXT_BATT_LOW) { - if(h8_debug & 0x4) - printk(KERN_DEBUG "h8_read_event_status: EXT_BATT_LOW\n"); - /*if no internal, post event, warn user */ - /* else nop */ - } - - return; -} - -/* - * Function called when H8 has performed requested command. - */ -static void -h8_cmd_done(h8_cmd_q_t *qp) -{ - - /* what to do */ - switch (qp->cmdbuf[0]) { - case H8_SYNC: - if (h8_debug & 0x40000) - printk(KERN_DEBUG "H8: Sync command done - byte returned was 0x%x\n", - qp->rcvbuf[0]); - list_add(&qp->link, &h8_freeq); - break; - - case H8_RD_SN: - case H8_RD_ENET_ADDR: - printk(KERN_DEBUG "H8: read Ethernet address: command done - address: %x - %x - %x - %x - %x - %x \n", - qp->rcvbuf[0], qp->rcvbuf[1], qp->rcvbuf[2], - qp->rcvbuf[3], qp->rcvbuf[4], qp->rcvbuf[5]); - list_add(&qp->link, &h8_freeq); - break; - - case H8_RD_HW_VER: - case H8_RD_MIC_VER: - case H8_RD_MAX_TEMP: - printk(KERN_DEBUG "H8: Max recorded CPU temp %d, Sys temp %d\n", - qp->rcvbuf[0], qp->rcvbuf[1]); - list_add(&qp->link, &h8_freeq); - break; - - case H8_RD_MIN_TEMP: - printk(KERN_DEBUG "H8: Min recorded CPU temp %d, Sys temp %d\n", - qp->rcvbuf[0], qp->rcvbuf[1]); - list_add(&qp->link, &h8_freeq); - break; - - case H8_RD_CURR_TEMP: - h8_sync_channel |= H8_RD_CURR_TEMP; - xx.byte[0] = qp->rcvbuf[0]; - xx.byte[1] = qp->rcvbuf[1]; - wake_up(&h8_sync_wait); - list_add(&qp->link, &h8_freeq); - break; - - case H8_RD_SYS_VARIENT: - case H8_RD_PWR_ON_CYCLES: - printk(KERN_DEBUG " H8: RD_PWR_ON_CYCLES command done\n"); - break; - - case H8_RD_PWR_ON_SECS: - printk(KERN_DEBUG "H8: RD_PWR_ON_SECS command done\n"); - break; - - case H8_RD_RESET_STATUS: - case H8_RD_PWR_DN_STATUS: - case H8_RD_EVENT_STATUS: - case H8_RD_ROM_CKSM: - case H8_RD_EXT_STATUS: - xx.byte[1] = qp->rcvbuf[0]; - xx.byte[0] = qp->rcvbuf[1]; - h8_sync_channel |= H8_GET_EXT_STATUS; - wake_up(&h8_sync_wait); - list_add(&qp->link, &h8_freeq); - break; - - case H8_RD_USER_CFG: - case H8_RD_INT_BATT_VOLT: - case H8_RD_DC_INPUT_VOLT: - case H8_RD_HORIZ_PTR_VOLT: - case H8_RD_VERT_PTR_VOLT: - case H8_RD_EEPROM_STATUS: - case H8_RD_ERR_STATUS: - case H8_RD_NEW_BUSY_SPEED: - case H8_RD_CONFIG_INTERFACE: - case H8_RD_INT_BATT_STATUS: - printk(KERN_DEBUG "H8: Read int batt status cmd done - returned was %x %x %x\n", - qp->rcvbuf[0], qp->rcvbuf[1], qp->rcvbuf[2]); - list_add(&qp->link, &h8_freeq); - break; - - case H8_RD_EXT_BATT_STATUS: - case H8_RD_PWR_UP_STATUS: - case H8_RD_EVENT_STATUS_MASK: - case H8_CTL_EMU_BITPORT: - case H8_DEVICE_CONTROL: - if(h8_debug & 0x20000) { - printk(KERN_DEBUG "H8: Device control cmd done - byte returned was 0x%x\n", - qp->rcvbuf[0]); - } - list_add(&qp->link, &h8_freeq); - break; - - case H8_CTL_TFT_BRT_DC: - case H8_CTL_WATCHDOG: - case H8_CTL_MIC_PROT: - case H8_CTL_INT_BATT_CHG: - case H8_CTL_EXT_BATT_CHG: - case H8_CTL_MARK_SPACE: - case H8_CTL_MOUSE_SENSITIVITY: - case H8_CTL_DIAG_MODE: - case H8_CTL_IDLE_AND_BUSY_SPDS: - printk(KERN_DEBUG "H8: Idle and busy speed command done\n"); - break; - - case H8_CTL_TFT_BRT_BATT: - case H8_CTL_UPPER_TEMP: - if(h8_debug & 0x10) { - XDprintk("H8: ctl upper thermal thresh cmd done - returned was %d\n", - qp->rcvbuf[0]); - } - list_add(&qp->link, &h8_freeq); - break; - - case H8_CTL_LOWER_TEMP: - case H8_CTL_TEMP_CUTOUT: - case H8_CTL_WAKEUP: - case H8_CTL_CHG_THRESHOLD: - case H8_CTL_TURBO_MODE: - case H8_SET_DIAG_STATUS: - case H8_SOFTWARE_RESET: - case H8_RECAL_PTR: - case H8_SET_INT_BATT_PERCENT: - case H8_WRT_CFG_INTERFACE_REG: - case H8_WRT_EVENT_STATUS_MASK: - case H8_ENTER_POST_MODE: - case H8_EXIT_POST_MODE: - case H8_RD_EEPROM: - case H8_WRT_EEPROM: - case H8_WRT_TO_STATUS_DISP: - printk("H8: Write IO status display command done\n"); - break; - - case H8_DEFINE_SPC_CHAR: - case H8_DEFINE_TABLE_STRING_ENTRY: - case H8_PERFORM_EMU_CMD: - case H8_EMU_RD_REG: - case H8_EMU_WRT_REG: - case H8_EMU_RD_RAM: - case H8_EMU_WRT_RAM: - case H8_BQ_RD_REG: - case H8_BQ_WRT_REG: - case H8_PWR_OFF: - printk (KERN_DEBUG "H8: misc command completed\n"); - break; - } - return; -} - -/* - * Retrieve the current CPU temperature and case temperature. Provides - * the feedback for the thermal control algorithm. Synchcronized via - * sleep() for priority so that no other actions in the process will take - * place before the data becomes available. - */ -int -h8_get_curr_temp(u_char curr_temp[]) -{ - u_char buf[H8_MAX_CMD_SIZE]; - unsigned long flags; - - memset(buf, 0, H8_MAX_CMD_SIZE); - buf[0] = H8_RD_CURR_TEMP; - - h8_q_cmd(buf, 1, 2); - - save_flags(flags); cli(); - - while((h8_sync_channel & H8_RD_CURR_TEMP) == 0) - sleep_on(&h8_sync_wait); - - restore_flags(flags); - - h8_sync_channel &= ~H8_RD_CURR_TEMP; - curr_temp[0] = xx.byte[0]; - curr_temp[1] = xx.byte[1]; - xx.word = 0; - - if(h8_debug & 0x8) - printk("H8: curr CPU temp %d, Sys temp %d\n", - curr_temp[0], curr_temp[1]); - return 0; -} - -static void -h8_get_max_temp(void) -{ - u_char buf[H8_MAX_CMD_SIZE]; - - buf[0] = H8_RD_MAX_TEMP; - h8_q_cmd(buf, 1, 2); -} - -/* - * Assigns an upper limit to the value of the H8 thermal interrupt. - * As an example setting a value of 115 F here will cause the - * interrupt to trigger when the CPU temperature reaches 115 F. - */ -static void -h8_set_upper_therm_thold(int thold) -{ - u_char buf[H8_MAX_CMD_SIZE]; - - /* write 0 to reinitialize interrupt */ - buf[0] = H8_CTL_UPPER_TEMP; - buf[1] = 0x0; - buf[2] = 0x0; - h8_q_cmd(buf, 3, 1); - - /* Do it for real */ - buf[0] = H8_CTL_UPPER_TEMP; - buf[1] = 0x0; - buf[2] = thold; - h8_q_cmd(buf, 3, 1); -} - -static void -h8_get_upper_therm_thold(void) -{ - u_char buf[H8_MAX_CMD_SIZE]; - - buf[0] = H8_CTL_UPPER_TEMP; - buf[1] = 0xff; - buf[2] = 0; - h8_q_cmd(buf, 3, 1); -} - -/* - * The external status word contains information on keyboard controller, - * power button, changes in external batt status, change in DC state, - * docking station, etc. General purpose querying use. - */ -int -h8_get_ext_status(u_char stat_word[]) -{ - u_char buf[H8_MAX_CMD_SIZE]; - unsigned long flags; - - memset(buf, 0, H8_MAX_CMD_SIZE); - buf[0] = H8_RD_EXT_STATUS; - - h8_q_cmd(buf, 1, 2); - - save_flags(flags); cli(); - - while((h8_sync_channel & H8_GET_EXT_STATUS) == 0) - sleep_on(&h8_sync_wait); - - restore_flags(flags); - - h8_sync_channel &= ~H8_GET_EXT_STATUS; - stat_word[0] = xx.byte[0]; - stat_word[1] = xx.byte[1]; - xx.word = 0; - - if(h8_debug & 0x8) - printk("H8: curr ext status %x, %x\n", - stat_word[0], stat_word[1]); - - return 0; -} - -/* - * Thread attached to task 0 manages thermal/physcial state of Alphabook. - * When a condition is detected by the interrupt service routine, the - * isr does a wakeup() on h8_monitor_wait. The mask value is then - * screened for the appropriate action. - */ - -int -h8_monitor_thread(void * unused) -{ - u_char curr_temp[2]; - - /* - * Need a logic based safety valve here. During boot when this thread is - * started and the thermal interrupt is not yet initialized this logic - * checks the temperature and acts accordingly. When this path is acted - * upon system boot is painfully slow, however, the priority associated - * with overheating is high enough to warrant this action. - */ - h8_get_curr_temp(curr_temp); - - printk(KERN_INFO "H8: Initial CPU temp: %d\n", curr_temp[0]); - - if(curr_temp[0] >= h8_uthermal_threshold) { - h8_set_event_mask(H8_MANAGE_UTHERM); - h8_manage_therm(); - } else { - /* - * Arm the upper thermal limit of the H8 so that any temp in - * excess will trigger the thermal control mechanism. - */ - h8_set_upper_therm_thold(h8_uthermal_threshold); - } - - for(;;) { - sleep_on(&h8_monitor_wait); - - if(h8_debug & 0x2) - printk(KERN_DEBUG "h8_monitor_thread awakened, mask:%x\n", - h8_event_mask); - - if (h8_event_mask & (H8_MANAGE_UTHERM|H8_MANAGE_LTHERM)) { - h8_manage_therm(); - } - -#if 0 - if (h8_event_mask & H8_POWER_BUTTON) { - h8_system_down(); - } - - /* - * If an external DC supply is removed or added make - * appropriate CPU speed adjustments. - */ - if (h8_event_mask & H8_MANAGE_BATTERY) { - h8_run_level_3_manage(H8_RUN); - h8_clear_event_mask(H8_MANAGE_BATTERY); - } -#endif - } -} - -/* - * Function implements the following policy. When the machine is booted - * the system is set to run at full clock speed. When the upper thermal - * threshold is reached as a result of full clock a damping factor is - * applied to cool off the cpu. The default value is one quarter clock - * (57 Mhz). When as a result of this cooling a temperature lower by - * hmc_uthermal_window is reached, the machine is reset to a higher - * speed, one half clock (115 Mhz). One half clock is maintained until - * the upper thermal threshold is again reached restarting the cycle. - */ - -int -h8_manage_therm(void) -{ - u_char curr_temp[2]; - - if(h8_event_mask & H8_MANAGE_UTHERM) { - /* Upper thermal interrupt received, need to cool down. */ - if(h8_debug & 0x10) - printk(KERN_WARNING "H8: Thermal threshold %d F reached\n", - h8_uthermal_threshold); - h8_set_cpu_speed(h8_udamp); - h8_clear_event_mask(H8_MANAGE_UTHERM); - h8_set_event_mask(H8_MANAGE_LTHERM); - /* Check again in 30 seconds for CPU temperature */ - h8_start_monitor_timer(H8_TIMEOUT_INTERVAL); - } else if (h8_event_mask & H8_MANAGE_LTHERM) { - /* See how cool the system has become as a result - of the reduction in speed. */ - h8_get_curr_temp(curr_temp); - last_temp = curr_temp[0]; - if (curr_temp[0] < (h8_uthermal_threshold - h8_uthermal_window)) - { - /* System cooling has progressed to a point - that the CPU may be sped up. */ - h8_set_upper_therm_thold(h8_uthermal_threshold); - h8_set_cpu_speed(h8_ldamp); /* adjustable */ - if(h8_debug & 0x10) - printk(KERN_WARNING "H8: CPU cool, applying cpu_divisor: %d \n", - h8_ldamp); - h8_clear_event_mask(H8_MANAGE_LTHERM); - } - else /* Not cool enough yet, check again in 30 seconds. */ - h8_start_monitor_timer(H8_TIMEOUT_INTERVAL); - } else { - - } - return 0; -} - -/* - * Function conditions the value of global_rpb_counter before - * calling the primitive which causes the actual speed change. - */ -void -h8_set_cpu_speed(int speed_divisor) -{ - -#ifdef NOT_YET -/* - * global_rpb_counter is consumed by alpha_delay() in determining just - * how much time to delay. It is necessary that the number of microseconds - * in DELAY(n) be kept consistent over a variety of CPU clock speeds. - * To that end global_rpb_counter is here adjusted. - */ - - switch (speed_divisor) { - case 0: - global_rpb_counter = rpb->rpb_counter * 2L; - break; - case 1: - global_rpb_counter = rpb->rpb_counter * 4L / 3L ; - break; - case 3: - global_rpb_counter = rpb->rpb_counter / 2L; - break; - case 4: - global_rpb_counter = rpb->rpb_counter / 4L; - break; - case 5: - global_rpb_counter = rpb->rpb_counter / 8L; - break; - /* - * This case most commonly needed for cpu_speed_divisor - * of 2 which is the value assigned by the firmware. - */ - default: - global_rpb_counter = rpb->rpb_counter; - break; - } -#endif /* NOT_YET */ - - if(h8_debug & 0x8) - printk(KERN_DEBUG "H8: Setting CPU speed to %d MHz\n", - speed_tab[speed_divisor]); - - /* Make the actual speed change */ - lca_clock_fiddle(speed_divisor); -} - -/* - * Gets value stored in rpb representing CPU clock speed and adjusts this - * value based on the current clock speed divisor. - */ -u_long -h8_get_cpu_speed(void) -{ - u_long speed = 0; - u_long counter; - -#ifdef NOT_YET - counter = rpb->rpb_counter / 1000000L; - - switch (alphabook_get_clock()) { - case 0: - speed = counter * 2L; - break; - case 1: - speed = counter * 4L / 3L ; - break; - case 2: - speed = counter; - break; - case 3: - speed = counter / 2L; - break; - case 4: - speed = counter / 4L; - break; - case 5: - speed = counter / 8L; - break; - default: - break; - } - if(h8_debug & 0x8) - printk(KERN_DEBUG "H8: CPU speed current setting: %d MHz\n", speed); -#endif /* NOT_YET */ - return speed; -} - -static void -h8_activate_monitor(unsigned long unused) -{ - unsigned long flags; - - save_flags(flags); cli(); - h8_monitor_timer_active = 0; - restore_flags(flags); - - wake_up(&h8_monitor_wait); -} - -static void -h8_start_monitor_timer(unsigned long secs) -{ - unsigned long flags; - - if (h8_monitor_timer_active) - return; - - save_flags(flags); cli(); - h8_monitor_timer_active = 1; - restore_flags(flags); - - init_timer(&h8_monitor_timer); - h8_monitor_timer.function = h8_activate_monitor; - h8_monitor_timer.expires = secs * HZ + jiffies; - add_timer(&h8_monitor_timer); -} - -static void h8_set_event_mask(int mask) -{ - unsigned long flags; - - save_flags(flags); cli(); - h8_event_mask |= mask; - restore_flags(flags); -} - -static void h8_clear_event_mask(int mask) -{ - unsigned long flags; - - save_flags(flags); cli(); - h8_event_mask &= (~mask); - restore_flags(flags); -} - -MODULE_LICENSE("GPL"); diff -Nru a/drivers/char/h8.h b/drivers/char/h8.h --- a/drivers/char/h8.h 2004-07-13 12:24:00 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,246 +0,0 @@ -/* - */ - -#ifndef __H8_H__ -#define __H8_H__ - -/* - * Register address and offsets - */ -#define H8_BASE_ADDR 0x170 /* default */ -#define H8_IRQ 9 /* default */ -#define H8_STATUS_REG_OFF 0x4 -#define H8_CMD_REG_OFF 0x4 -#define H8_DATA_REG_OFF 0x0 - - -/* H8 register bit definitions */ -/* status register */ -#define H8_OFULL 0x1 /* output data register full */ -#define H8_IFULL 0x2 /* input data register full */ -#define H8_CMD 0x8 /* command / not data */ - -#define H8_INTR 0xfa -#define H8_NACK 0xfc -#define H8_BYTE_LEVEL_ACK 0xfd -#define H8_CMD_ACK 0xfe -#define H8_SYNC_BYTE 0x99 - -/* - * H8 command definitions - */ -/* System info commands */ -#define H8_SYNC 0x0 -#define H8_RD_SN 0x1 -#define H8_RD_ENET_ADDR 0x2 -#define H8_RD_HW_VER 0x3 -#define H8_RD_MIC_VER 0x4 -#define H8_RD_MAX_TEMP 0x5 -#define H8_RD_MIN_TEMP 0x6 -#define H8_RD_CURR_TEMP 0x7 -#define H8_RD_SYS_VARIENT 0x8 -#define H8_RD_PWR_ON_CYCLES 0x9 -#define H8_RD_PWR_ON_SECS 0xa -#define H8_RD_RESET_STATUS 0xb -#define H8_RD_PWR_DN_STATUS 0xc -#define H8_RD_EVENT_STATUS 0xd -#define H8_RD_ROM_CKSM 0xe -#define H8_RD_EXT_STATUS 0xf -#define H8_RD_USER_CFG 0x10 -#define H8_RD_INT_BATT_VOLT 0x11 -#define H8_RD_DC_INPUT_VOLT 0x12 -#define H8_RD_HORIZ_PTR_VOLT 0x13 -#define H8_RD_VERT_PTR_VOLT 0x14 -#define H8_RD_EEPROM_STATUS 0x15 -#define H8_RD_ERR_STATUS 0x16 -#define H8_RD_NEW_BUSY_SPEED 0x17 -#define H8_RD_CONFIG_INTERFACE 0x18 -#define H8_RD_INT_BATT_STATUS 0x19 -#define H8_RD_EXT_BATT_STATUS 0x1a -#define H8_RD_PWR_UP_STATUS 0x1b -#define H8_RD_EVENT_STATUS_MASK 0x56 - -/* Read/write/modify commands */ -#define H8_CTL_EMU_BITPORT 0x32 -#define H8_DEVICE_CONTROL 0x21 -#define H8_CTL_TFT_BRT_DC 0x22 -#define H8_CTL_WATCHDOG 0x23 -#define H8_CTL_MIC_PROT 0x24 -#define H8_CTL_INT_BATT_CHG 0x25 -#define H8_CTL_EXT_BATT_CHG 0x26 -#define H8_CTL_MARK_SPACE 0x27 -#define H8_CTL_MOUSE_SENSITIVITY 0x28 -#define H8_CTL_DIAG_MODE 0x29 -#define H8_CTL_IDLE_AND_BUSY_SPDS 0x2a -#define H8_CTL_TFT_BRT_BATT 0x2b -#define H8_CTL_UPPER_TEMP 0x2c -#define H8_CTL_LOWER_TEMP 0x2d -#define H8_CTL_TEMP_CUTOUT 0x2e -#define H8_CTL_WAKEUP 0x2f -#define H8_CTL_CHG_THRESHOLD 0x30 -#define H8_CTL_TURBO_MODE 0x31 -#define H8_SET_DIAG_STATUS 0x40 -#define H8_SOFTWARE_RESET 0x41 -#define H8_RECAL_PTR 0x42 -#define H8_SET_INT_BATT_PERCENT 0x43 -#define H8_WRT_CFG_INTERFACE_REG 0x45 -#define H8_WRT_EVENT_STATUS_MASK 0x57 -#define H8_ENTER_POST_MODE 0x46 -#define H8_EXIT_POST_MODE 0x47 - -/* Block transfer commands */ -#define H8_RD_EEPROM 0x50 -#define H8_WRT_EEPROM 0x51 -#define H8_WRT_TO_STATUS_DISP 0x52 -#define H8_DEFINE_SPC_CHAR 0x53 - -/* Generic commands */ -#define H8_DEFINE_TABLE_STRING_ENTRY 0x60 - -/* Battery control commands */ -#define H8_PERFORM_EMU_CMD 0x70 -#define H8_EMU_RD_REG 0x71 -#define H8_EMU_WRT_REG 0x72 -#define H8_EMU_RD_RAM 0x73 -#define H8_EMU_WRT_RAM 0x74 -#define H8_BQ_RD_REG 0x75 -#define H8_BQ_WRT_REG 0x76 - -/* System admin commands */ -#define H8_PWR_OFF 0x80 - -/* - * H8 command related definitions - */ - -/* device control argument bits */ -#define H8_ENAB_EXTSMI 0x1 -#define H8_DISAB_IRQ 0x2 -#define H8_ENAB_FLASH_WRT 0x4 -#define H8_ENAB_THERM 0x8 -#define H8_ENAB_INT_PTR 0x10 -#define H8_ENAB_LOW_SPD_IND 0x20 -#define H8_ENAB_EXT_PTR 0x40 -#define H8_DISAB_PWR_OFF_SW 0x80 -#define H8_POWER_OFF 0x80 - -/* H8 read event status bits */ -#define H8_DC_CHANGE 0x1 -#define H8_INT_BATT_LOW 0x2 -#define H8_INT_BATT_CHARGE_THRESHOLD 0x4 -#define H8_INT_BATT_CHARGE_STATE 0x8 -#define H8_INT_BATT_STATUS 0x10 -#define H8_EXT_BATT_CHARGE_STATE 0x20 -#define H8_EXT_BATT_LOW 0x40 -#define H8_EXT_BATT_STATUS 0x80 -#define H8_THERMAL_THRESHOLD 0x100 -#define H8_WATCHDOG 0x200 -#define H8_DOCKING_STATION_STATUS 0x400 -#define H8_EXT_MOUSE_OR_CASE_SWITCH 0x800 -#define H8_KEYBOARD 0x1000 -#define H8_BATT_CHANGE_OVER 0x2000 -#define H8_POWER_BUTTON 0x4000 -#define H8_SHUTDOWN 0x8000 - -/* H8 control idle and busy speeds */ -#define H8_SPEED_LOW 0x1 -#define H8_SPEED_MED 0x2 -#define H8_SPEED_HI 0x3 -#define H8_SPEED_LOCKED 0x80 - -#define H8_MAX_CMD_SIZE 18 -#define H8_Q_ALLOC_AMOUNT 10 - -/* H8 state field values */ -#define H8_IDLE 1 -#define H8_XMIT 2 -#define H8_RCV 3 -#define H8_RESYNC 4 -#define H8_INTR_MODE 5 - -/* Mask values for control functions */ -#define UTH_HYSTERESIS 5 -#define DEFAULT_UTHERMAL_THRESHOLD 115 -#define H8_TIMEOUT_INTERVAL 30 -#define H8_RUN 4 - -#define H8_GET_MAX_TEMP 0x1 -#define H8_GET_CURR_TEMP 0x2 -#define H8_GET_UPPR_THRMAL_THOLD 0x4 -#define H8_GET_ETHERNET_ADDR 0x8 -#define H8_SYNC_OP 0x10 -#define H8_SET_UPPR_THRMAL_THOLD 0x20 -#define H8_GET_INT_BATT_STAT 0x40 -#define H8_GET_CPU_SPD 0x80 -#define H8_MANAGE_UTHERM 0x100 -#define H8_MANAGE_LTHERM 0x200 -#define H8_HALT 0x400 -#define H8_CRASH 0x800 -#define H8_GET_EXT_STATUS 0x10000 -#define H8_MANAGE_QUIET 0x20000 -#define H8_MANAGE_SPEEDUP 0x40000 -#define H8_MANAGE_BATTERY 0x80000 -#define H8_SYSTEM_DELAY_TEST 0x100000 -#define H8_POWER_SWITCH_TEST 0x200000 - -/* CPU speeds and clock divisor values */ -#define MHZ_14 5 -#define MHZ_28 4 -#define MHZ_57 3 -#define MHZ_115 2 -#define MHZ_230 0 - -/* - * H8 data - */ -struct h8_data { - u_int ser_num; - u_char ether_add[6]; - u_short hw_ver; - u_short mic_ver; - u_short max_tmp; - u_short min_tmp; - u_short cur_tmp; - u_int sys_var; - u_int pow_on; - u_int pow_on_secs; - u_char reset_status; - u_char pwr_dn_status; - u_short event_status; - u_short rom_cksm; - u_short ext_status; - u_short u_cfg; - u_char ibatt_volt; - u_char dc_volt; - u_char ptr_horiz; - u_char ptr_vert; - u_char eeprom_status; - u_char error_status; - u_char new_busy_speed; - u_char cfg_interface; - u_short int_batt_status; - u_short ext_batt_status; - u_char pow_up_status; - u_char event_status_mask; -}; - - -/* - * H8 command buffers - */ -typedef struct h8_cmd_q { - struct list_head link; /* double linked list */ - int ncmd; /* number of bytes in command */ - int nrsp; /* number of bytes in response */ - int cnt; /* number of bytes sent/received */ - int nacks; /* number of byte level acks */ - u_char cmdbuf[H8_MAX_CMD_SIZE]; /* buffer to store command */ - u_char rcvbuf[H8_MAX_CMD_SIZE]; /* buffer to store response */ -} h8_cmd_q_t; - -union intr_buf { - u_char byte[2]; - u_int word; -}; - -#endif /* __H8_H_ */ 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-13 12:24:01 -07:00 +++ b/drivers/char/ipmi/ipmi_msghandler.c 2004-07-13 12:24:01 -07:00 @@ -3112,7 +3112,7 @@ ipmi_interfaces[i] = NULL; } - proc_ipmi_root = proc_mkdir("ipmi", 0); + proc_ipmi_root = proc_mkdir("ipmi", NULL); if (!proc_ipmi_root) { printk("Unable to create IPMI proc dir"); return -ENOMEM; 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-13 12:24:00 -07:00 +++ b/drivers/char/ipmi/ipmi_si_intf.c 2004-07-13 12:24:00 -07:00 @@ -1781,7 +1781,7 @@ /* So we know not to free it unless we have allocated one. */ new_smi->intf = NULL; new_smi->si_sm = NULL; - new_smi->handlers = 0; + new_smi->handlers = NULL; if (!new_smi->irq_setup) { new_smi->irq = irqs[intf_num]; diff -Nru a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c --- a/drivers/char/mwave/mwavedd.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/char/mwave/mwavedd.c 2004-07-13 12:24:00 -07:00 @@ -179,7 +179,7 @@ case IOCTL_MW_READ_DATA: case IOCTL_MW_READCLEAR_DATA: { MW_READWRITE rReadData; - unsigned short __user *pusBuffer = 0; + unsigned short __user *pusBuffer = NULL; if( copy_from_user(&rReadData, arg, sizeof(MW_READWRITE)) ) @@ -200,7 +200,7 @@ case IOCTL_MW_READ_INST: { MW_READWRITE rReadData; - unsigned short __user *pusBuffer = 0; + unsigned short __user *pusBuffer = NULL; if( copy_from_user(&rReadData, arg, sizeof(MW_READWRITE)) ) @@ -221,7 +221,7 @@ case IOCTL_MW_WRITE_DATA: { MW_READWRITE rWriteData; - unsigned short __user *pusBuffer = 0; + unsigned short __user *pusBuffer = NULL; if( copy_from_user(&rWriteData, arg, sizeof(MW_READWRITE)) ) @@ -242,7 +242,7 @@ case IOCTL_MW_WRITE_INST: { MW_READWRITE rWriteData; - unsigned short __user *pusBuffer = 0; + unsigned short __user *pusBuffer = NULL; if( copy_from_user(&rWriteData, arg, sizeof(MW_READWRITE)) ) diff -Nru a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c --- a/drivers/char/mwave/tp3780i.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/char/mwave/tp3780i.c 2004-07-13 12:24:00 -07:00 @@ -277,7 +277,7 @@ release_region(pSettings->usDspBaseIO & (~3), 16); if (pSettings->bInterruptClaimed) { - free_irq(pSettings->usDspIrq, 0); + free_irq(pSettings->usDspIrq, NULL); pSettings->bInterruptClaimed = FALSE; } @@ -372,7 +372,7 @@ 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, 0); + free_irq(pSettings->usUartIrq, NULL); } if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", 0)) { @@ -416,7 +416,7 @@ if (bDSPPoweredUp) smapi_set_DSP_power_state(FALSE); if (bInterruptAllocated) { - free_irq(pSettings->usDspIrq, 0); + free_irq(pSettings->usDspIrq, NULL); pSettings->bInterruptClaimed = FALSE; } return -EIO; @@ -433,7 +433,7 @@ if (pBDData->bDSPEnabled) { dsp3780I_DisableDSP(&pBDData->rDspSettings); if (pSettings->bInterruptClaimed) { - free_irq(pSettings->usDspIrq, 0); + free_irq(pSettings->usDspIrq, NULL); pSettings->bInterruptClaimed = FALSE; } smapi_set_DSP_power_state(FALSE); 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-13 12:24:00 -07:00 +++ b/drivers/char/pcmcia/synclink_cs.c 2004-07-13 12:24:00 -07:00 @@ -1513,7 +1513,7 @@ if (info->tx_buf) { free_page((unsigned long) info->tx_buf); - info->tx_buf = 0; + info->tx_buf = NULL; } spin_lock_irqsave(&info->lock,flags); @@ -2591,7 +2591,7 @@ shutdown(info); tty->closing = 0; - info->tty = 0; + info->tty = NULL; if (info->blocked_open) { if (info->close_delay) { @@ -2695,7 +2695,7 @@ info->count = 0; info->flags &= ~ASYNC_NORMAL_ACTIVE; - info->tty = 0; + info->tty = NULL; wake_up_interruptible(&info->open_wait); } @@ -2872,7 +2872,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--; } diff -Nru a/drivers/char/rocket.c b/drivers/char/rocket.c --- a/drivers/char/rocket.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/char/rocket.c 2004-07-13 12:24:01 -07:00 @@ -1115,7 +1115,7 @@ } else { if (info->xmit_buf) { free_page((unsigned long) info->xmit_buf); - info->xmit_buf = 0; + info->xmit_buf = NULL; } } info->flags &= ~(ROCKET_INITIALIZED | ROCKET_CLOSING | ROCKET_NORMAL_ACTIVE); @@ -1292,7 +1292,7 @@ if ((new_serial.flags & ~ROCKET_USR_MASK) != (info->flags & ~ROCKET_USR_MASK)) return -EPERM; info->flags = ((info->flags & ~ROCKET_USR_MASK) | (new_serial.flags & ROCKET_USR_MASK)); - configure_r_port(info, 0); + configure_r_port(info, NULL); return 0; } @@ -1309,7 +1309,7 @@ if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_WARP) info->tty->alt_speed = 460800; - configure_r_port(info, 0); + configure_r_port(info, NULL); return 0; } @@ -1572,7 +1572,7 @@ info->count = 0; info->flags &= ~ROCKET_NORMAL_ACTIVE; - info->tty = 0; + info->tty = NULL; cp = &info->channel; sDisRxFIFO(cp); diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c --- a/drivers/char/rtc.c 2004-07-13 12:24:02 -07:00 +++ b/drivers/char/rtc.c 2004-07-13 12:24:02 -07:00 @@ -974,7 +974,7 @@ release_region(RTC_PORT(0), RTC_IO_EXTENT); return -ENODEV; } - 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)) { #ifdef RTC_IRQ free_irq(RTC_IRQ, NULL); #endif diff -Nru a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c --- a/drivers/ide/legacy/ide-cs.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/ide/legacy/ide-cs.c 2004-07-13 12:24:01 -07:00 @@ -230,7 +230,7 @@ cisparse_t parse; config_info_t conf; cistpl_cftable_entry_t dflt; - } *stk = 0; + } *stk = NULL; cistpl_cftable_entry_t *cfg; int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; unsigned long io_base, ctl_base; diff -Nru a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c --- a/drivers/ide/pci/siimage.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/ide/pci/siimage.c 2004-07-13 12:24:00 -07:00 @@ -1007,7 +1007,7 @@ pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); class_rev &= 0xff; - hwif->hwif_data = 0; + hwif->hwif_data = NULL; hwif->rqsize = 128; if (is_sata(hwif) && is_dev_seagate_sata(&hwif->drives[0])) diff -Nru a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c --- a/drivers/input/joystick/grip.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/input/joystick/grip.c 2004-07-13 12:24:00 -07:00 @@ -76,8 +76,8 @@ static char *grip_name[] = { NULL, "Gravis GamePad Pro", "Gravis Blackhawk Digital", "Gravis Xterminator Digital", "Gravis Xterminator DualControl" }; -static int *grip_abs[] = { 0, grip_abs_gpp, grip_abs_bd, grip_abs_xt, grip_abs_dc }; -static int *grip_btn[] = { 0, grip_btn_gpp, grip_btn_bd, grip_btn_xt, grip_btn_dc }; +static int *grip_abs[] = { NULL, grip_abs_gpp, grip_abs_bd, grip_abs_xt, grip_abs_dc }; +static int *grip_btn[] = { NULL, grip_btn_gpp, grip_btn_bd, grip_btn_xt, grip_btn_dc }; static char grip_anx[] = { 0, 0, 3, 5, 5 }; static char grip_cen[] = { 0, 0, 2, 2, 4 }; diff -Nru a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c --- a/drivers/input/joystick/grip_mp.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/input/joystick/grip_mp.c 2004-07-13 12:24:01 -07:00 @@ -92,8 +92,8 @@ static int grip_abs_gp[] = { ABS_X, ABS_Y, -1 }; static int grip_abs_c64[] = { ABS_X, ABS_Y, -1 }; -static int *grip_abs[] = { 0, 0, grip_abs_gp, grip_abs_c64 }; -static int *grip_btn[] = { 0, 0, grip_btn_gp, grip_btn_c64 }; +static int *grip_abs[] = { NULL, NULL, grip_abs_gp, grip_abs_c64 }; +static int *grip_btn[] = { NULL, NULL, grip_btn_gp, grip_btn_c64 }; static char *grip_name[] = { NULL, NULL, "Gravis Grip Pad", "Commodore 64 Joystick" }; diff -Nru a/drivers/isdn/act2000/act2000.h b/drivers/isdn/act2000/act2000.h --- a/drivers/isdn/act2000/act2000.h 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/act2000/act2000.h 2004-07-13 12:24:01 -07:00 @@ -15,6 +15,8 @@ #ifndef act2000_h #define act2000_h +#include + #define ACT2000_IOCTL_SETPORT 1 #define ACT2000_IOCTL_GETPORT 2 #define ACT2000_IOCTL_SETIRQ 3 @@ -46,7 +48,7 @@ /* Struct for downloading firmware */ typedef struct act2000_ddef { int length; /* Length of code */ - char *buffer; /* Ptr. to code */ + char __user *buffer; /* Ptr. to code */ } act2000_ddef; typedef struct act2000_fwid { diff -Nru a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c --- a/drivers/isdn/act2000/act2000_isa.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/act2000/act2000_isa.c 2004-07-13 12:24:00 -07:00 @@ -405,7 +405,7 @@ * Download microcode into card, check Firmware signature. */ int -act2000_isa_download(act2000_card * card, act2000_ddef * cb) +act2000_isa_download(act2000_card * card, act2000_ddef __user * cb) { unsigned int length; int ret; @@ -413,18 +413,18 @@ int c; long timeout; u_char *b; - u_char *p; + u_char __user *p; u_char *buf; act2000_ddef cblock; if (!act2000_isa_reset(card->port)) return -ENXIO; act2000_isa_delay(HZ / 2); - if(copy_from_user(&cblock, (char *) cb, sizeof(cblock))) + if(copy_from_user(&cblock, cb, sizeof(cblock))) return -EFAULT; length = cblock.length; p = cblock.buffer; - if ((ret = verify_area(VERIFY_READ, (void *) p, length))) + if ((ret = verify_area(VERIFY_READ, p, length))) return ret; buf = (u_char *) kmalloc(1024, GFP_KERNEL); if (!buf) diff -Nru a/drivers/isdn/act2000/act2000_isa.h b/drivers/isdn/act2000/act2000_isa.h --- a/drivers/isdn/act2000/act2000_isa.h 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/act2000/act2000_isa.h 2004-07-13 12:24:01 -07:00 @@ -128,7 +128,7 @@ extern int act2000_isa_detect(unsigned short portbase); extern int act2000_isa_config_irq(act2000_card * card, short irq); extern int act2000_isa_config_port(act2000_card * card, unsigned short portbase); -extern int act2000_isa_download(act2000_card * card, act2000_ddef * cb); +extern int act2000_isa_download(act2000_card * card, act2000_ddef __user * cb); extern void act2000_isa_release(act2000_card * card); extern void act2000_isa_receive(act2000_card *card); extern void act2000_isa_send(act2000_card *card); diff -Nru a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c --- a/drivers/isdn/act2000/module.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/act2000/module.c 2004-07-13 12:24:01 -07:00 @@ -243,16 +243,18 @@ char tmp[17]; int ret; unsigned long flags; + void __user *arg; switch (c->command) { case ISDN_CMD_IOCTL: memcpy(&a, c->parm.num, sizeof(ulong)); + arg = (void __user *)a; switch (c->arg) { case ACT2000_IOCTL_LOADBOOT: switch (card->bus) { case ACT2000_BUS_ISA: ret = act2000_isa_download(card, - (act2000_ddef *)a); + arg); if (!ret) { card->flags |= ACT2000_FLAGS_LOADED; if (!(card->flags & ACT2000_FLAGS_IVALID)) { @@ -278,7 +280,7 @@ actcapi_manufacturer_req_net(card); return 0; case ACT2000_IOCTL_SETMSN: - if (copy_from_user(tmp, (char *)a, + if (copy_from_user(tmp, arg, sizeof(tmp))) return -EFAULT; if ((ret = act2000_set_msn(card, tmp))) @@ -287,7 +289,7 @@ return(actcapi_manufacturer_req_msn(card)); return 0; case ACT2000_IOCTL_ADDCARD: - if (copy_from_user(&cdef, (char *)a, + if (copy_from_user(&cdef, arg, sizeof(cdef))) return -EFAULT; if (act2000_addcard(cdef.bus, cdef.port, cdef.irq, cdef.id)) @@ -463,18 +465,15 @@ /* Read the Status-replies from the Interface */ static int -act2000_readstatus(u_char * buf, int len, int user, act2000_card * card) +act2000_readstatus(u_char __user * buf, int len, act2000_card * card) { int count; - u_char *p; + u_char __user *p; for (p = buf, count = 0; count < len; p++, count++) { if (card->status_buf_read == card->status_buf_write) return count; - if (user) - put_user(*card->status_buf_read++, p); - else - *p = *card->status_buf_read++; + put_user(*card->status_buf_read++, p); if (card->status_buf_read > card->status_buf_end) card->status_buf_read = card->status_buf; } @@ -514,7 +513,7 @@ } static int -if_writecmd(const u_char * buf, int len, int user, int id, int channel) +if_writecmd(const u_char __user *buf, int len, int id, int channel) { act2000_card *card = act2000_findcard(id); @@ -529,14 +528,14 @@ } static int -if_readstatus(u_char * buf, int len, int user, int id, int channel) +if_readstatus(u_char __user * buf, int len, int id, int channel) { act2000_card *card = act2000_findcard(id); if (card) { if (!card->flags & ACT2000_FLAGS_RUNNING) return -ENODEV; - return (act2000_readstatus(buf, len, user, card)); + return (act2000_readstatus(buf, len, card)); } printk(KERN_ERR "act2000: if_readstatus called with invalid driverId!\n"); diff -Nru a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c --- a/drivers/isdn/capi/capi.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/capi/capi.c 2004-07-13 12:24:01 -07:00 @@ -162,7 +162,7 @@ printk(KERN_ERR "capi: alloc datahandle failed\n"); return -1; } - n->next = 0; + n->next = NULL; n->datahandle = datahandle; for (pp = &mp->ackqueue; *pp; pp = &(*pp)->next) ; *pp = n; @@ -211,7 +211,7 @@ mp = kmalloc(sizeof(*mp), GFP_ATOMIC); if (!mp) { printk(KERN_ERR "capi: can't alloc capiminor\n"); - return 0; + return NULL; } memset(mp, 0, sizeof(struct capiminor)); @@ -245,7 +245,7 @@ if (!(minor < capi_ttyminors)) { printk(KERN_NOTICE "capi: out of minors\n"); kfree(mp); - return 0; + return NULL; } return mp; @@ -260,7 +260,7 @@ write_unlock_irqrestore(&capiminor_list_lock, flags); if (mp->ttyskb) kfree_skb(mp->ttyskb); - mp->ttyskb = 0; + mp->ttyskb = NULL; skb_queue_purge(&mp->inqueue); skb_queue_purge(&mp->outqueue); capiminor_del_all_ack(mp); @@ -292,17 +292,17 @@ { struct capincci *np, **pp; #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE - struct capiminor *mp = 0; + struct capiminor *mp = NULL; #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ np = kmalloc(sizeof(*np), GFP_ATOMIC); if (!np) - return 0; + return NULL; memset(np, 0, sizeof(struct capincci)); np->ncci = ncci; np->cdev = cdev; #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE - mp = 0; + mp = NULL; if (cdev->userflags & CAPIFLAG_HIGHJACKING) mp = np->minorp = capiminor_alloc(&cdev->ap, ncci); if (mp) { @@ -339,7 +339,7 @@ capifs_free_ncci(mp->minor); #endif if (mp->tty) { - mp->nccip = 0; + mp->nccip = NULL; #ifdef _DEBUG_REFCOUNT printk(KERN_DEBUG "reset mp->nccip\n"); #endif @@ -377,7 +377,7 @@ cdev = kmalloc(sizeof(*cdev), GFP_KERNEL); if (!cdev) - return 0; + return NULL; memset(cdev, 0, sizeof(struct capidev)); init_MUTEX(&cdev->ncci_list_sem); @@ -473,7 +473,7 @@ printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ldisc\n", datahandle, skb->len); #endif - mp->tty->ldisc.receive_buf(mp->tty, skb->data, 0, skb->len); + mp->tty->ldisc.receive_buf(mp->tty, skb->data, NULL, skb->len); kfree_skb(skb); return 0; @@ -878,8 +878,7 @@ struct capi_manufacturer_cmd mcmd; if (!capable(CAP_SYS_ADMIN)) return -EPERM; - if (copy_from_user(&mcmd, argp, - sizeof(mcmd))) + if (copy_from_user(&mcmd, argp, sizeof(mcmd))) return -EFAULT; return capi20_manufacturer(mcmd.cmd, mcmd.data); } @@ -1026,8 +1025,8 @@ #ifdef _DEBUG_REFCOUNT printk(KERN_DEBUG "capinc_tty_close lastclose\n"); #endif - tty->driver_data = (void *)0; - mp->tty = 0; + tty->driver_data = NULL; + mp->tty = NULL; } #ifdef _DEBUG_REFCOUNT printk(KERN_DEBUG "capinc_tty_close ocount=%d\n", atomic_read(&mp->ttyopencount)); @@ -1062,7 +1061,7 @@ skb = mp->ttyskb; if (skb) { - mp->ttyskb = 0; + mp->ttyskb = NULL; skb_queue_tail(&mp->outqueue, skb); mp->outbytes += skb->len; } @@ -1075,7 +1074,8 @@ skb_reserve(skb, CAPI_DATA_B3_REQ_LEN); if (from_user) { - if ((retval = copy_from_user(skb_put(skb, count), buf, count))) { + retval = copy_from_user(skb_put(skb, count), buf, count); + if (retval) { kfree_skb(skb); #ifdef _DEBUG_TTYFUNCS printk(KERN_DEBUG "capinc_tty_write: copy_from_user=%d\n", retval); @@ -1115,7 +1115,7 @@ *(skb_put(skb, 1)) = ch; return; } - mp->ttyskb = 0; + mp->ttyskb = NULL; skb_queue_tail(&mp->outqueue, skb); mp->outbytes += skb->len; (void)handle_minor_send(mp); @@ -1148,7 +1148,7 @@ skb = mp->ttyskb; if (skb) { - mp->ttyskb = 0; + mp->ttyskb = NULL; skb_queue_tail(&mp->outqueue, skb); mp->outbytes += skb->len; (void)handle_minor_send(mp); @@ -1466,7 +1466,7 @@ for (i=0; i < nelem; i++) { struct procfsentries *p = procfsentries + i; - p->procent = create_proc_entry(p->name, p->mode, 0); + p->procent = create_proc_entry(p->name, p->mode, NULL); if (p->procent) p->procent->read_proc = p->read_proc; } } @@ -1479,8 +1479,8 @@ for (i=nelem-1; i >= 0; i--) { struct procfsentries *p = procfsentries + i; if (p->procent) { - remove_proc_entry(p->name, 0); - p->procent = 0; + remove_proc_entry(p->name, NULL); + p->procent = NULL; } } } diff -Nru a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c --- a/drivers/isdn/capi/capidrv.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/capi/capidrv.c 2004-07-13 12:24:00 -07:00 @@ -230,7 +230,7 @@ case ISDN_PROTO_L2_HDLC: case ISDN_PROTO_L2_TRANS: default: - return 0; + return NULL; case ISDN_PROTO_L2_V11096: return b1config_async_v110(9600); case ISDN_PROTO_L2_V11019: @@ -336,7 +336,7 @@ plcip = (capidrv_plci *) kmalloc(sizeof(capidrv_plci), GFP_ATOMIC); if (plcip == 0) - return 0; + return NULL; memset(plcip, 0, sizeof(capidrv_plci)); plcip->state = ST_PLCI_NONE; @@ -356,7 +356,7 @@ for (p = card->plci_list; p; p = p->next) if (p->plci == plci) return p; - return 0; + return NULL; } static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid) @@ -365,7 +365,7 @@ for (p = card->plci_list; p; p = p->next) if (p->msgid == msgid) return p; - return 0; + return NULL; } static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci) @@ -374,7 +374,7 @@ for (p = card->plci_list; p; p = p->next) if (p->plci == (ncci & 0xffff)) return p; - return 0; + return NULL; } static void free_plci(capidrv_contr * card, capidrv_plci * plcip) @@ -384,7 +384,7 @@ for (pp = &card->plci_list; *pp; pp = &(*pp)->next) { if (*pp == plcip) { *pp = (*pp)->next; - card->bchans[plcip->chan].plcip = 0; + card->bchans[plcip->chan].plcip = NULL; card->bchans[plcip->chan].disconnecting = 0; card->bchans[plcip->chan].incoming = 0; kfree(plcip); @@ -406,7 +406,7 @@ nccip = (capidrv_ncci *) kmalloc(sizeof(capidrv_ncci), GFP_ATOMIC); if (nccip == 0) - return 0; + return NULL; memset(nccip, 0, sizeof(capidrv_ncci)); nccip->ncci = ncci; @@ -429,12 +429,12 @@ capidrv_ncci *p; if ((plcip = find_plci_by_ncci(card, ncci)) == 0) - return 0; + return NULL; for (p = plcip->ncci_list; p; p = p->next) if (p->ncci == ncci) return p; - return 0; + return NULL; } static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card, @@ -444,12 +444,12 @@ capidrv_ncci *p; if ((plcip = find_plci_by_ncci(card, ncci)) == 0) - return 0; + return NULL; for (p = plcip->ncci_list; p; p = p->next) if (p->msgid == msgid) return p; - return 0; + return NULL; } static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip) @@ -462,7 +462,7 @@ break; } } - card->bchans[nccip->chan].nccip = 0; + card->bchans[nccip->chan].nccip = NULL; kfree(nccip); } @@ -477,7 +477,7 @@ printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n"); return -1; } - n->next = 0; + n->next = NULL; n->datahandle = datahandle; n->len = len; for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ; @@ -560,7 +560,7 @@ { isdn_ctrl cmd; - card->bchans[plci->chan].contr = 0; + card->bchans[plci->chan].contr = NULL; cmd.command = ISDN_STAT_DHUP; cmd.driver = card->myid; cmd.arg = plci->chan; @@ -580,54 +580,54 @@ static struct plcistatechange plcitable[] = { /* P-0 */ - {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, 0}, - {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, 0}, - {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, 0}, - {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, 0}, + {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, NULL}, + {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, NULL}, + {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, NULL}, + {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, NULL}, /* P-0.1 */ {ST_PLCI_OUTGOING, ST_PLCI_NONE, EV_PLCI_CONNECT_CONF_ERROR, p0}, - {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, 0}, + {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, NULL}, /* P-1 */ - {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, 0}, - {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0}, - {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0}, - {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0}, + {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, + {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, + {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, + {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, /* P-ACT */ - {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0}, - {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0}, - {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0}, - {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, 0}, - {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, 0}, + {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, + {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, + {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, + {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, NULL}, + {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, NULL}, /* P-2 */ - {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, 0}, - {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, 0}, - {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, 0}, - {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0}, - {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0}, - {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0}, - {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, 0}, + {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL}, + {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, NULL}, + {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, NULL}, + {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, + {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, + {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, + {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, NULL}, /* P-3 */ - {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, 0}, - {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, 0}, - {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0}, - {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0}, - {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0}, + {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL}, + {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, + {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, + {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, + {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, /* P-4 */ - {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, 0}, - {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0}, - {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0}, - {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0}, + {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL}, + {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL}, + {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL}, + {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, /* P-5 */ - {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0}, + {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL}, /* P-6 */ {ST_PLCI_DISCONNECTED, ST_PLCI_NONE, EV_PLCI_DISCONNECT_RESP, p0}, /* P-0.Res */ {ST_PLCI_RESUMEING, ST_PLCI_NONE, EV_PLCI_RESUME_CONF_ERROR, p0}, - {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, 0}, + {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, NULL}, /* P-RES */ - {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, 0}, + {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, NULL}, /* P-HELD */ - {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, 0}, + {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, NULL}, {}, }; @@ -662,10 +662,10 @@ global.ap.applid, card->msgid++, ncci->plcip->plci, - 0, /* BChannelinformation */ - 0, /* Keypadfacility */ - 0, /* Useruserdata */ /* $$$$ */ - 0 /* Facilitydataarray */ + NULL, /* BChannelinformation */ + NULL, /* Keypadfacility */ + NULL, /* Useruserdata */ /* $$$$ */ + NULL /* Facilitydataarray */ ); send_message(card, &cmsg); plci_change_state(card, ncci->plcip, EV_PLCI_DISCONNECT_REQ); @@ -689,32 +689,32 @@ static struct nccistatechange nccitable[] = { /* N-0 */ - {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, 0}, - {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, 0}, + {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, NULL}, + {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, NULL}, /* N-0.1 */ - {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, 0}, + {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, NULL}, {ST_NCCI_OUTGOING, ST_NCCI_NONE, EV_NCCI_CONNECT_B3_CONF_ERROR, n0}, /* N-1 */ - {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, 0}, - {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, 0}, - {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0}, - {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0}, + {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, NULL}, + {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, NULL}, + {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, + {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, /* N-2 */ - {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, 0}, - {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0}, - {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0}, + {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, NULL}, + {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, + {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, /* N-ACT */ - {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, 0}, - {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, 0}, - {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0}, - {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0}, + {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL}, + {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, NULL}, + {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, + {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, /* N-3 */ - {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, 0}, - {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0}, - {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0}, + {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL}, + {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, + {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL}, /* N-4 */ - {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0}, - {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,0}, + {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL}, + {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,NULL}, /* N-5 */ {ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0}, {}, @@ -821,7 +821,7 @@ goto ignored; case CAPI_MANUFACTURER_CONF: /* Controller */ if (cmsg->ManuID == 0x214D5641) { - char *s = 0; + char *s = NULL; switch (cmsg->Class) { case 0: break; case 1: s = "unknown class"; break; @@ -950,10 +950,10 @@ global.ap.applid, card->msgid++, plcip->plci, /* adr */ - 0, /* BChannelinformation */ - 0, /* Keypadfacility */ - 0, /* Useruserdata */ - 0 /* Facilitydataarray */ + NULL,/* BChannelinformation */ + NULL,/* Keypadfacility */ + NULL,/* Useruserdata */ + NULL /* Facilitydataarray */ ); plcip->msgid = cmsg->Messagenumber; send_message(card, cmsg); @@ -1090,7 +1090,7 @@ global.ap.applid, card->msgid++, plcip->plci, /* adr */ - 0 /* NCPI */ + NULL /* NCPI */ ); nccip->msgid = cmsg->Messagenumber; send_message(card, cmsg); @@ -1208,7 +1208,7 @@ card->msgid++, nccip->ncci, /* adr */ 0, /* Reject */ - 0 /* NCPI */ + NULL /* NCPI */ ); send_message(card, cmsg); ncci_change_state(card, nccip, EV_NCCI_CONNECT_B3_RESP); @@ -1226,7 +1226,7 @@ card->msgid++, cmsg->adr.adrNCCI, 2, /* Reject */ - 0 /* NCPI */ + NULL /* NCPI */ ); send_message(card, cmsg); break; @@ -1624,22 +1624,22 @@ si2cip(bchan->si1, bchan->si2), /* cipvalue */ called, /* CalledPartyNumber */ calling, /* CallingPartyNumber */ - 0, /* CalledPartySubaddress */ - 0, /* CallingPartySubaddress */ + NULL, /* CalledPartySubaddress */ + NULL, /* CallingPartySubaddress */ b1prot(bchan->l2, bchan->l3), /* B1protocol */ b2prot(bchan->l2, bchan->l3), /* B2protocol */ b3prot(bchan->l2, bchan->l3), /* B3protocol */ b1config(bchan->l2, bchan->l3), /* B1configuration */ - 0, /* B2configuration */ - 0, /* B3configuration */ - 0, /* BC */ - 0, /* LLC */ - 0, /* HLC */ + NULL, /* B2configuration */ + NULL, /* B3configuration */ + NULL, /* BC */ + NULL, /* LLC */ + NULL, /* HLC */ /* BChannelinformation */ - isleasedline ? AdditionalInfo : 0, - 0, /* Keypadfacility */ - 0, /* Useruserdata */ - 0 /* Facilitydataarray */ + isleasedline ? AdditionalInfo : NULL, + NULL, /* Keypadfacility */ + NULL, /* Useruserdata */ + NULL /* Facilitydataarray */ ); if ((plcip = new_plci(card, (c->arg % card->nbchan))) == 0) { cmd.command = ISDN_STAT_DHUP; @@ -1672,15 +1672,15 @@ b2prot(bchan->l2, bchan->l3), /* B2protocol */ b3prot(bchan->l2, bchan->l3), /* B3protocol */ b1config(bchan->l2, bchan->l3), /* B1configuration */ - 0, /* B2configuration */ - 0, /* B3configuration */ - 0, /* ConnectedNumber */ - 0, /* ConnectedSubaddress */ - 0, /* LLC */ - 0, /* BChannelinformation */ - 0, /* Keypadfacility */ - 0, /* Useruserdata */ - 0 /* Facilitydataarray */ + NULL, /* B2configuration */ + NULL, /* B3configuration */ + NULL, /* ConnectedNumber */ + NULL, /* ConnectedSubaddress */ + NULL, /* LLC */ + NULL, /* BChannelinformation */ + NULL, /* Keypadfacility */ + NULL, /* Useruserdata */ + NULL /* Facilitydataarray */ ); capi_cmsg2message(&cmdcmsg, cmdcmsg.buf); plci_change_state(card, bchan->plcip, EV_PLCI_CONNECT_RESP); @@ -1714,7 +1714,7 @@ global.ap.applid, card->msgid++, bchan->nccip->ncci, - 0 /* NCPI */ + NULL /* NCPI */ ); ncci_change_state(card, bchan->nccip, EV_NCCI_DISCONNECT_B3_REQ); send_message(card, &cmdcmsg); @@ -1735,10 +1735,10 @@ global.ap.applid, card->msgid++, bchan->plcip->plci, - 0, /* BChannelinformation */ - 0, /* Keypadfacility */ - 0, /* Useruserdata */ - 0 /* Facilitydataarray */ + NULL, /* BChannelinformation */ + NULL, /* Keypadfacility */ + NULL, /* Useruserdata */ + NULL /* Facilitydataarray */ ); plci_change_state(card, bchan->plcip, EV_PLCI_DISCONNECT_REQ); send_message(card, &cmdcmsg); @@ -1892,11 +1892,11 @@ } } -static int if_readstat(u8 *buf, int len, int user, int id, int channel) +static int if_readstat(u8 __user *buf, int len, int id, int channel) { capidrv_contr *card = findcontrbydriverid(id); int count; - u8 *p; + u8 __user *p; if (!card) { printk(KERN_ERR "capidrv: if_readstat called with invalid driverId %d!\n", @@ -1905,10 +1905,7 @@ } for (p=buf, count=0; count < len; p++, count++) { - if (user) - put_user(*card->q931_read++, p); - else - *p = *card->q931_read++; + put_user(*card->q931_read++, p); if (card->q931_read > card->q931_end) card->q931_read = card->q931_buf; } @@ -1977,7 +1974,7 @@ 1 << 6, /* Infomask */ card->cipmask, card->cipmask2, - 0, 0); + NULL, NULL); send_message(card, &cmdcmsg); listen_change_state(card, EV_LISTEN_REQ); } @@ -2028,7 +2025,7 @@ card->interface.maxbufsize = 2048; card->interface.command = if_command; card->interface.writebuf_skb = if_sendbuf; - card->interface.writecmd = 0; + card->interface.writecmd = NULL; card->interface.readstat = if_readstat; card->interface.features = ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L2_TRANS | @@ -2141,7 +2138,7 @@ card->nbchan--; } kfree(card->bchans); - card->bchans = 0; + card->bchans = NULL; if (debugmode) printk(KERN_DEBUG "capidrv-%d: id=%d isdn unload\n", @@ -2159,7 +2156,7 @@ for (pp = &global.contr_list; *pp; pp = &(*pp)->next) { if (*pp == card) { *pp = (*pp)->next; - card->next = 0; + card->next = NULL; global.ncontr--; break; } @@ -2228,7 +2225,7 @@ for (i=0; i < nelem; i++) { struct procfsentries *p = procfsentries + i; - p->procent = create_proc_entry(p->name, p->mode, 0); + p->procent = create_proc_entry(p->name, p->mode, NULL); if (p->procent) p->procent->read_proc = p->read_proc; } } @@ -2241,8 +2238,8 @@ for (i=nelem-1; i >= 0; i--) { struct procfsentries *p = procfsentries + i; if (p->procent) { - remove_proc_entry(p->name, 0); - p->procent = 0; + remove_proc_entry(p->name, NULL); + p->procent = NULL; } } } diff -Nru a/drivers/isdn/capi/capilib.c b/drivers/isdn/capi/capilib.c --- a/drivers/isdn/capi/capilib.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/capi/capilib.c 2004-07-13 12:24:01 -07:00 @@ -30,8 +30,8 @@ static inline void mq_init(struct capilib_ncci * np) { u_int i; - np->msgidqueue = 0; - np->msgidlast = 0; + np->msgidqueue = NULL; + np->msgidlast = NULL; np->nmsg = 0; memset(np->msgidpool, 0, sizeof(np->msgidpool)); np->msgidfree = &np->msgidpool[0]; @@ -48,7 +48,7 @@ return 0; np->msgidfree = mq->next; mq->msgid = msgid; - mq->next = 0; + mq->next = NULL; if (np->msgidlast) np->msgidlast->next = mq; np->msgidlast = mq; @@ -66,7 +66,7 @@ struct capilib_msgidqueue *mq = *pp; *pp = mq->next; if (mq == np->msgidlast) - np->msgidlast = 0; + np->msgidlast = NULL; mq->next = np->msgidfree; np->msgidfree = mq; np->nmsg--; diff -Nru a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c --- a/drivers/isdn/capi/capiutil.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/capi/capiutil.c 2004-07-13 12:24:01 -07:00 @@ -335,85 +335,54 @@ static unsigned char *cpars[] = { - /*00 */ 0, - /*01 ALERT_REQ */ (unsigned char *) "\x03\x04\x0c\x27\x2f\x1c\x01\x01", - /*02 CONNECT_REQ */ (unsigned char *) "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01", - /*03 */ 0, - /*04 DISCONNECT_REQ */ (unsigned char *) "\x03\x04\x0c\x27\x2f\x1c\x01\x01", - /*05 LISTEN_REQ */ (unsigned char *) "\x03\x25\x12\x13\x10\x11\x01", - /*06 */ 0, - /*07 */ 0, - /*08 INFO_REQ */ (unsigned char *) "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01", - /*09 FACILITY_REQ */ (unsigned char *) "\x03\x1f\x1e\x01", - /*0a SELECT_B_PROTOCOL_REQ */ (unsigned char *) "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01", - /*0b CONNECT_B3_REQ */ (unsigned char *) "\x03\x2b\x01", - /*0c */ 0, - /*0d DISCONNECT_B3_REQ */ (unsigned char *) "\x03\x2b\x01", - /*0e */ 0, - /*0f DATA_B3_REQ */ (unsigned char *) "\x03\x18\x1a\x19\x20\x01", - /*10 RESET_B3_REQ */ (unsigned char *) "\x03\x2b\x01", - /*11 */ 0, - /*12 */ 0, - /*13 ALERT_CONF */ (unsigned char *) "\x03\x23\x01", - /*14 CONNECT_CONF */ (unsigned char *) "\x03\x23\x01", - /*15 */ 0, - /*16 DISCONNECT_CONF */ (unsigned char *) "\x03\x23\x01", - /*17 LISTEN_CONF */ (unsigned char *) "\x03\x23\x01", - /*18 MANUFACTURER_REQ */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01", - /*19 */ 0, - /*1a INFO_CONF */ (unsigned char *) "\x03\x23\x01", - /*1b FACILITY_CONF */ (unsigned char *) "\x03\x23\x1f\x1b\x01", - /*1c SELECT_B_PROTOCOL_CONF */ (unsigned char *) "\x03\x23\x01", - /*1d CONNECT_B3_CONF */ (unsigned char *) "\x03\x23\x01", - /*1e */ 0, - /*1f DISCONNECT_B3_CONF */ (unsigned char *) "\x03\x23\x01", - /*20 */ 0, - /*21 DATA_B3_CONF */ (unsigned char *) "\x03\x19\x23\x01", - /*22 RESET_B3_CONF */ (unsigned char *) "\x03\x23\x01", - /*23 */ 0, - /*24 */ 0, - /*25 */ 0, - /*26 CONNECT_IND */ (unsigned char *) "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01", - /*27 CONNECT_ACTIVE_IND */ (unsigned char *) "\x03\x16\x17\x28\x01", - /*28 DISCONNECT_IND */ (unsigned char *) "\x03\x2c\x01", - /*29 */ 0, - /*2a MANUFACTURER_CONF */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01", - /*2b */ 0, - /*2c INFO_IND */ (unsigned char *) "\x03\x26\x24\x01", - /*2d FACILITY_IND */ (unsigned char *) "\x03\x1f\x1d\x01", - /*2e */ 0, - /*2f CONNECT_B3_IND */ (unsigned char *) "\x03\x2b\x01", - /*30 CONNECT_B3_ACTIVE_IND */ (unsigned char *) "\x03\x2b\x01", - /*31 DISCONNECT_B3_IND */ (unsigned char *) "\x03\x2d\x2b\x01", - /*32 */ 0, - /*33 DATA_B3_IND */ (unsigned char *) "\x03\x18\x1a\x19\x20\x01", - /*34 RESET_B3_IND */ (unsigned char *) "\x03\x2b\x01", - /*35 CONNECT_B3_T90_ACTIVE_IND */ (unsigned char *) "\x03\x2b\x01", - /*36 */ 0, - /*37 */ 0, - /*38 CONNECT_RESP */ (unsigned char *) "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01", - /*39 CONNECT_ACTIVE_RESP */ (unsigned char *) "\x03\x01", - /*3a DISCONNECT_RESP */ (unsigned char *) "\x03\x01", - /*3b */ 0, - /*3c MANUFACTURER_IND */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01", - /*3d */ 0, - /*3e INFO_RESP */ (unsigned char *) "\x03\x01", - /*3f FACILITY_RESP */ (unsigned char *) "\x03\x1f\x01", - /*40 */ 0, - /*41 CONNECT_B3_RESP */ (unsigned char *) "\x03\x2e\x2b\x01", - /*42 CONNECT_B3_ACTIVE_RESP */ (unsigned char *) "\x03\x01", - /*43 DISCONNECT_B3_RESP */ (unsigned char *) "\x03\x01", - /*44 */ 0, - /*45 DATA_B3_RESP */ (unsigned char *) "\x03\x19\x01", - /*46 RESET_B3_RESP */ (unsigned char *) "\x03\x01", - /*47 CONNECT_B3_T90_ACTIVE_RESP */ (unsigned char *) "\x03\x01", - /*48 */ 0, - /*49 */ 0, - /*4a */ 0, - /*4b */ 0, - /*4c */ 0, - /*4d */ 0, - /*4e MANUFACTURER_RESP */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01", + /* ALERT_REQ */ [0x01] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01", + /* CONNECT_REQ */ [0x02] = "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01", + /* DISCONNECT_REQ */ [0x04] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01", + /* LISTEN_REQ */ [0x05] = "\x03\x25\x12\x13\x10\x11\x01", + /* INFO_REQ */ [0x08] = "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01", + /* FACILITY_REQ */ [0x09] = "\x03\x1f\x1e\x01", + /* SELECT_B_PROTOCOL_REQ */ [0x0a] = "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01", + /* CONNECT_B3_REQ */ [0x0b] = "\x03\x2b\x01", + /* DISCONNECT_B3_REQ */ [0x0d] = "\x03\x2b\x01", + /* DATA_B3_REQ */ [0x0f] = "\x03\x18\x1a\x19\x20\x01", + /* RESET_B3_REQ */ [0x10] = "\x03\x2b\x01", + /* ALERT_CONF */ [0x13] = "\x03\x23\x01", + /* CONNECT_CONF */ [0x14] = "\x03\x23\x01", + /* DISCONNECT_CONF */ [0x16] = "\x03\x23\x01", + /* LISTEN_CONF */ [0x17] = "\x03\x23\x01", + /* MANUFACTURER_REQ */ [0x18] = "\x03\x2a\x15\x21\x29\x01", + /* INFO_CONF */ [0x1a] = "\x03\x23\x01", + /* FACILITY_CONF */ [0x1b] = "\x03\x23\x1f\x1b\x01", + /* SELECT_B_PROTOCOL_CONF */ [0x1c] = "\x03\x23\x01", + /* CONNECT_B3_CONF */ [0x1d] = "\x03\x23\x01", + /* DISCONNECT_B3_CONF */ [0x1f] = "\x03\x23\x01", + /* DATA_B3_CONF */ [0x21] = "\x03\x19\x23\x01", + /* RESET_B3_CONF */ [0x22] = "\x03\x23\x01", + /* CONNECT_IND */ [0x26] = "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01", + /* CONNECT_ACTIVE_IND */ [0x27] = "\x03\x16\x17\x28\x01", + /* DISCONNECT_IND */ [0x28] = "\x03\x2c\x01", + /* MANUFACTURER_CONF */ [0x2a] = "\x03\x2a\x15\x21\x29\x01", + /* INFO_IND */ [0x2c] = "\x03\x26\x24\x01", + /* FACILITY_IND */ [0x2d] = "\x03\x1f\x1d\x01", + /* CONNECT_B3_IND */ [0x2f] = "\x03\x2b\x01", + /* CONNECT_B3_ACTIVE_IND */ [0x30] = "\x03\x2b\x01", + /* DISCONNECT_B3_IND */ [0x31] = "\x03\x2d\x2b\x01", + /* DATA_B3_IND */ [0x33] = "\x03\x18\x1a\x19\x20\x01", + /* RESET_B3_IND */ [0x34] = "\x03\x2b\x01", + /* CONNECT_B3_T90_ACTIVE_IND */ [0x35] = "\x03\x2b\x01", + /* CONNECT_RESP */ [0x38] = "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01", + /* CONNECT_ACTIVE_RESP */ [0x39] = "\x03\x01", + /* DISCONNECT_RESP */ [0x3a] = "\x03\x01", + /* MANUFACTURER_IND */ [0x3c] = "\x03\x2a\x15\x21\x29\x01", + /* INFO_RESP */ [0x3e] = "\x03\x01", + /* FACILITY_RESP */ [0x3f] = "\x03\x1f\x01", + /* CONNECT_B3_RESP */ [0x41] = "\x03\x2e\x2b\x01", + /* CONNECT_B3_ACTIVE_RESP */ [0x42] = "\x03\x01", + /* DISCONNECT_B3_RESP */ [0x43] = "\x03\x01", + /* DATA_B3_RESP */ [0x45] = "\x03\x19\x01", + /* RESET_B3_RESP */ [0x46] = "\x03\x01", + /* CONNECT_B3_T90_ACTIVE_RESP */ [0x47] = "\x03\x01", + /* MANUFACTURER_RESP */ [0x4e] = "\x03\x2a\x15\x21\x29\x01", }; /*-------------------------------------------------------*/ @@ -623,85 +592,54 @@ static char *mnames[] = { - 0, - "ALERT_REQ", - "CONNECT_REQ", - 0, - "DISCONNECT_REQ", - "LISTEN_REQ", - 0, - 0, - "INFO_REQ", - "FACILITY_REQ", - "SELECT_B_PROTOCOL_REQ", - "CONNECT_B3_REQ", - 0, - "DISCONNECT_B3_REQ", - 0, - "DATA_B3_REQ", - "RESET_B3_REQ", - 0, - 0, - "ALERT_CONF", - "CONNECT_CONF", - 0, - "DISCONNECT_CONF", - "LISTEN_CONF", - "MANUFACTURER_REQ", - 0, - "INFO_CONF", - "FACILITY_CONF", - "SELECT_B_PROTOCOL_CONF", - "CONNECT_B3_CONF", - 0, - "DISCONNECT_B3_CONF", - 0, - "DATA_B3_CONF", - "RESET_B3_CONF", - 0, - 0, - 0, - "CONNECT_IND", - "CONNECT_ACTIVE_IND", - "DISCONNECT_IND", - 0, - "MANUFACTURER_CONF", - 0, - "INFO_IND", - "FACILITY_IND", - 0, - "CONNECT_B3_IND", - "CONNECT_B3_ACTIVE_IND", - "DISCONNECT_B3_IND", - 0, - "DATA_B3_IND", - "RESET_B3_IND", - "CONNECT_B3_T90_ACTIVE_IND", - 0, - 0, - "CONNECT_RESP", - "CONNECT_ACTIVE_RESP", - "DISCONNECT_RESP", - 0, - "MANUFACTURER_IND", - 0, - "INFO_RESP", - "FACILITY_RESP", - 0, - "CONNECT_B3_RESP", - "CONNECT_B3_ACTIVE_RESP", - "DISCONNECT_B3_RESP", - 0, - "DATA_B3_RESP", - "RESET_B3_RESP", - "CONNECT_B3_T90_ACTIVE_RESP", - 0, - 0, - 0, - 0, - 0, - 0, - "MANUFACTURER_RESP" + [0x01] = "ALERT_REQ", + [0x02] = "CONNECT_REQ", + [0x04] = "DISCONNECT_REQ", + [0x05] = "LISTEN_REQ", + [0x08] = "INFO_REQ", + [0x09] = "FACILITY_REQ", + [0x0a] = "SELECT_B_PROTOCOL_REQ", + [0x0b] = "CONNECT_B3_REQ", + [0x0d] = "DISCONNECT_B3_REQ", + [0x0f] = "DATA_B3_REQ", + [0x10] = "RESET_B3_REQ", + [0x13] = "ALERT_CONF", + [0x14] = "CONNECT_CONF", + [0x16] = "DISCONNECT_CONF", + [0x17] = "LISTEN_CONF", + [0x18] = "MANUFACTURER_REQ", + [0x1a] = "INFO_CONF", + [0x1b] = "FACILITY_CONF", + [0x1c] = "SELECT_B_PROTOCOL_CONF", + [0x1d] = "CONNECT_B3_CONF", + [0x1f] = "DISCONNECT_B3_CONF", + [0x21] = "DATA_B3_CONF", + [0x22] = "RESET_B3_CONF", + [0x26] = "CONNECT_IND", + [0x27] = "CONNECT_ACTIVE_IND", + [0x28] = "DISCONNECT_IND", + [0x2a] = "MANUFACTURER_CONF", + [0x2c] = "INFO_IND", + [0x2d] = "FACILITY_IND", + [0x2f] = "CONNECT_B3_IND", + [0x30] = "CONNECT_B3_ACTIVE_IND", + [0x31] = "DISCONNECT_B3_IND", + [0x33] = "DATA_B3_IND", + [0x34] = "RESET_B3_IND", + [0x35] = "CONNECT_B3_T90_ACTIVE_IND", + [0x38] = "CONNECT_RESP", + [0x39] = "CONNECT_ACTIVE_RESP", + [0x3a] = "DISCONNECT_RESP", + [0x3c] = "MANUFACTURER_IND", + [0x3e] = "INFO_RESP", + [0x3f] = "FACILITY_RESP", + [0x41] = "CONNECT_B3_RESP", + [0x42] = "CONNECT_B3_ACTIVE_RESP", + [0x43] = "DISCONNECT_B3_RESP", + [0x45] = "DATA_B3_RESP", + [0x46] = "RESET_B3_RESP", + [0x47] = "CONNECT_B3_T90_ACTIVE_RESP", + [0x4e] = "MANUFACTURER_RESP" }; char *capi_cmd2str(u8 cmd, u8 subcmd) @@ -715,9 +653,9 @@ static char *pnames[] = { - /*00 */ 0, - /*01 */ 0, - /*02 */ 0, + /*00 */ NULL, + /*01 */ NULL, + /*02 */ NULL, /*03 */ "Controller/PLCI/NCCI", /*04 */ "AdditionalInfo", /*05 */ "B1configuration", @@ -767,7 +705,7 @@ static char buf[8192]; -static char *p = 0; +static char *p = NULL; #include diff -Nru a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c --- a/drivers/isdn/capi/kcapi.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/capi/kcapi.c 2004-07-13 12:24:01 -07:00 @@ -193,7 +193,7 @@ for (applid = 1; applid <= CAPI_MAXAPPL; applid++) { ap = get_capi_appl_by_nr(applid); if (ap && ap->callback && !ap->release_in_progress) - ap->callback(KCI_CONTRDOWN, contr, 0); + ap->callback(KCI_CONTRDOWN, contr, NULL); } } @@ -421,7 +421,7 @@ card->traceflag = showcapimsgs; sprintf(card->procfn, "capi/controllers/%d", card->cnr); - card->procent = create_proc_entry(card->procfn, 0, 0); + card->procent = create_proc_entry(card->procfn, 0, NULL); if (card->procent) { card->procent->read_proc = (int (*)(char *,char **,off_t,int,int *,void *)) @@ -445,8 +445,8 @@ ncards--; if (card->procent) { - remove_proc_entry(card->procfn, 0); - card->procent = 0; + remove_proc_entry(card->procfn, NULL); + card->procent = NULL; } capi_cards[card->cnr - 1] = NULL; printk(KERN_NOTICE "kcapi: Controller %d: %s unregistered\n", @@ -524,7 +524,7 @@ ap->nrecvdatapkt = 0; ap->nsentctlpkt = 0; ap->nsentdatapkt = 0; - ap->callback = 0; + ap->callback = NULL; init_MUTEX(&ap->recv_sem); skb_queue_head_init(&ap->recv_queue); INIT_WORK(&ap->recv_work, recv_handler, (void *)ap); @@ -711,14 +711,14 @@ EXPORT_SYMBOL(capi20_get_profile); #ifdef CONFIG_AVMB1_COMPAT -static int old_capi_manufacturer(unsigned int cmd, void *data) +static int old_capi_manufacturer(unsigned int cmd, void __user *data) { avmb1_loadandconfigdef ldef; avmb1_extcarddef cdef; avmb1_resetdef rdef; capicardparams cparams; struct capi_ctr *card; - struct capi_driver *driver = 0; + struct capi_driver *driver = NULL; capiloaddata ldata; struct list_head *l; unsigned long flags; @@ -728,12 +728,12 @@ case AVMB1_ADDCARD: case AVMB1_ADDCARD_WITH_TYPE: if (cmd == AVMB1_ADDCARD) { - if ((retval = copy_from_user((void *) &cdef, data, + if ((retval = copy_from_user(&cdef, data, sizeof(avmb1_carddef)))) return retval; cdef.cardtype = AVM_CARDTYPE_B1; } else { - if ((retval = copy_from_user((void *) &cdef, data, + if ((retval = copy_from_user(&cdef, data, sizeof(avmb1_extcarddef)))) return retval; } @@ -758,7 +758,7 @@ } break; default: - driver = 0; + driver = NULL; break; } if (!driver) { @@ -780,13 +780,13 @@ case AVMB1_LOAD_AND_CONFIG: if (cmd == AVMB1_LOAD) { - if (copy_from_user((void *)&ldef, data, + if (copy_from_user(&ldef, data, sizeof(avmb1_loaddef))) return -EFAULT; ldef.t4config.len = 0; - ldef.t4config.data = 0; + ldef.t4config.data = NULL; } else { - if (copy_from_user((void *)&ldef, data, + if (copy_from_user(&ldef, data, sizeof(avmb1_loadandconfigdef))) return -EFAULT; } @@ -843,7 +843,7 @@ return 0; case AVMB1_RESETCARD: - if (copy_from_user((void *)&rdef, data, sizeof(avmb1_resetdef))) + if (copy_from_user(&rdef, data, sizeof(avmb1_resetdef))) return -EFAULT; card = get_capi_ctr_by_nr(rdef.contr); if (!card) @@ -869,7 +869,7 @@ } #endif -int capi20_manufacturer(unsigned int cmd, void *data) +int capi20_manufacturer(unsigned int cmd, void __user *data) { struct capi_ctr *card; @@ -886,7 +886,7 @@ { kcapi_flagdef fdef; - if (copy_from_user((void *)&fdef, data, sizeof(kcapi_flagdef))) + if (copy_from_user(&fdef, data, sizeof(kcapi_flagdef))) return -EFAULT; card = get_capi_ctr_by_nr(fdef.contr); @@ -901,13 +901,12 @@ case KCAPI_CMD_ADDCARD: { struct list_head *l; - struct capi_driver *driver = 0; + struct capi_driver *driver = NULL; capicardparams cparams; kcapi_carddef cdef; int retval; - if ((retval = copy_from_user((void *) &cdef, data, - sizeof(cdef)))) + if ((retval = copy_from_user(&cdef, data, sizeof(cdef)))) return retval; cparams.port = cdef.port; diff -Nru a/drivers/isdn/capi/kcapi_proc.c b/drivers/isdn/capi/kcapi_proc.c --- a/drivers/isdn/capi/kcapi_proc.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/capi/kcapi_proc.c 2004-07-13 12:24:01 -07:00 @@ -246,7 +246,7 @@ static __inline__ struct capi_driver *capi_driver_get_idx(loff_t pos) { - struct capi_driver *drv = 0; + struct capi_driver *drv = NULL; struct list_head *l; loff_t i; @@ -256,7 +256,7 @@ if (i++ == pos) return drv; } - return 0; + return NULL; } static void *capi_driver_start(struct seq_file *seq, loff_t *pos) @@ -271,7 +271,7 @@ { struct capi_driver *drv = (struct capi_driver *)v; ++*pos; - if (drv->list.next == &capi_drivers) return 0; + if (drv->list.next == &capi_drivers) return NULL; return list_entry(drv->list.next, struct capi_driver, list); } diff -Nru a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c --- a/drivers/isdn/hardware/eicon/capifunc.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/capifunc.c 2004-07-13 12:24:01 -07:00 @@ -228,7 +228,7 @@ word length = 12, dlength = 0; byte *write; CAPI_MSG msg; - byte *string = 0; + byte *string = NULL; va_list ap; diva_os_message_buffer_s *dmb; diva_card *card = NULL; @@ -1072,7 +1072,7 @@ req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; req.didd_notify.info.callback = (void *)didd_callback; - req.didd_notify.info.context = 0; + req.didd_notify.info.context = NULL; DAdapter.request((ENTITY *) & req); if (req.didd_notify.e.Rc != 0xff) { stop_dbg(); diff -Nru a/drivers/isdn/hardware/eicon/capimain.c b/drivers/isdn/hardware/eicon/capimain.c --- a/drivers/isdn/hardware/eicon/capimain.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/capimain.c 2004-07-13 12:24:00 -07:00 @@ -102,8 +102,8 @@ void diva_os_set_controller_struct(struct capi_ctr *ctrl) { ctrl->driver_name = DRIVERLNAME; - ctrl->load_firmware = 0; - ctrl->reset_ctr = 0; + ctrl->load_firmware = NULL; + ctrl->reset_ctr = NULL; ctrl->ctr_read_proc = diva_ctl_read_proc; ctrl->owner = THIS_MODULE; } diff -Nru a/drivers/isdn/hardware/eicon/dadapter.c b/drivers/isdn/hardware/eicon/dadapter.c --- a/drivers/isdn/hardware/eicon/dadapter.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/dadapter.c 2004-07-13 12:24:01 -07:00 @@ -293,8 +293,8 @@ diva_os_spin_lock_magic_t irql; if (handle && ((--handle) < DIVA_DIDD_MAX_NOTIFICATIONS)) { diva_os_enter_spin_lock (&didd_spin, &irql, "didd_nfy_rm"); - NotificationTable[handle].callback = 0; - NotificationTable[handle].context = 0; + NotificationTable[handle].callback = NULL; + NotificationTable[handle].context = NULL; diva_os_leave_spin_lock (&didd_spin, &irql, "didd_nfy_rm"); DBG_TRC(("Remove adapter notification[%d]", (int)(handle+1))) return; diff -Nru a/drivers/isdn/hardware/eicon/debug.c b/drivers/isdn/hardware/eicon/debug.c --- a/drivers/isdn/hardware/eicon/debug.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/debug.c 2004-07-13 12:24:01 -07:00 @@ -89,7 +89,7 @@ Q->Size = sizeBuffer; Q->Base = Q->Head = Q->Tail = Buffer; Q->High = Buffer + sizeBuffer; - Q->Wrap = 0; + Q->Wrap = NULL; Q->Count= 0; } @@ -107,7 +107,7 @@ if (Q->Tail == Q->Head) { if (Q->Wrap || need > Q->Size) { - return(0); /* full */ + return NULL; /* full */ } goto alloc; /* empty */ } @@ -115,7 +115,7 @@ if (Q->Tail > Q->Head) { if (Q->Tail + need <= Q->High) goto alloc; /* append */ if (Q->Base + need > Q->Head) { - return (0); /* too much */ + return NULL; /* too much */ } /* wraparound the queue (but not the message) */ Q->Wrap = Q->Tail; @@ -124,7 +124,7 @@ } if (Q->Tail + need > Q->Head) { - return (0); /* too much */ + return NULL; /* too much */ } alloc: @@ -151,7 +151,7 @@ if (Q->Wrap) { if (Q->Head >= Q->Wrap) { Q->Head = Q->Base; - Q->Wrap = 0; + Q->Wrap = NULL; } } else if (Q->Head >= Q->Tail) { Q->Head = Q->Tail = Q->Base; @@ -167,7 +167,7 @@ if (((byte *)Msg == Q->Tail && !Q->Wrap) || (Msg->Size & MSG_INCOMPLETE)) { - return (0); + return NULL; } else { *size = Msg->Size; return ((byte *)(Msg + 1)); @@ -177,13 +177,13 @@ /* Message queue header */ -static MSG_QUEUE* dbg_queue = 0; -static byte* dbg_base = 0; -static int external_dbg_queue = 0; +static MSG_QUEUE* dbg_queue; +static byte* dbg_base; +static int external_dbg_queue; static diva_os_spin_lock_t dbg_q_lock; static diva_os_spin_lock_t dbg_adapter_lock; -static int dbg_q_busy = 0; -static volatile dword dbg_sequence = 0; +static int dbg_q_busy; +static volatile dword dbg_sequence; static dword start_sec; static dword start_usec; @@ -235,16 +235,16 @@ if (diva_os_initialize_spin_lock (&dbg_q_lock, "dbg_init")) { - dbg_queue = 0; - dbg_base = 0; + dbg_queue = NULL; + dbg_base = NULL; external_dbg_queue = 0; return (-1); } if (diva_os_initialize_spin_lock (&dbg_adapter_lock, "dbg_init")) { diva_os_destroy_spin_lock(&dbg_q_lock, "dbg_init"); - dbg_queue = 0; - dbg_base = 0; + dbg_queue = NULL; + dbg_base = NULL; external_dbg_queue = 0; return (-1); } @@ -263,8 +263,8 @@ void* ret = (void*)dbg_base; int i; - dbg_queue = 0; - dbg_base = 0; + dbg_queue = NULL; + dbg_base = NULL; if (ret) { diva_os_destroy_spin_lock(&dbg_q_lock, "dbg_finit"); @@ -272,7 +272,7 @@ } if (external_dbg_queue) { - ret = 0; + ret = NULL; } external_dbg_queue = 0; @@ -300,12 +300,12 @@ */ diva_dbg_entry_head_t* diva_maint_get_message (word* size, diva_os_spin_lock_magic_t* old_irql) { - diva_dbg_entry_head_t* pmsg = 0; + diva_dbg_entry_head_t* pmsg = NULL; diva_os_enter_spin_lock_hard (&dbg_q_lock, old_irql, "read"); if (dbg_q_busy) { diva_os_leave_spin_lock_hard (&dbg_q_lock, old_irql, "read_busy"); - return (0); + return NULL; } dbg_q_busy = 1; @@ -406,7 +406,7 @@ } if (free_id != -1) { - diva_dbg_entry_head_t* pmsg = 0; + diva_dbg_entry_head_t* pmsg = NULL; int len; char tmp[256]; word size; @@ -476,7 +476,7 @@ dword sec, usec; int i; word size; - byte* pmem = 0; + byte* pmem = NULL; diva_os_get_time (&sec, &usec); @@ -489,24 +489,24 @@ char tmp[256]; int len; - clients[i].hDbg = 0; + clients[i].hDbg = NULL; hDbg->id = -1; hDbg->dbgMask = 0; - hDbg->dbg_end = 0; - hDbg->dbg_prt = 0; - hDbg->dbg_irq = 0; + hDbg->dbg_end = NULL; + hDbg->dbg_prt = NULL; + hDbg->dbg_irq = NULL; if (hDbg->Version > 0) - hDbg->dbg_old = 0; + hDbg->dbg_old = NULL; hDbg->Registered = 0; - hDbg->next = 0; + hDbg->next = NULL; if (clients[i].pIdiLib) { (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib); - clients[i].pIdiLib = 0; + clients[i].pIdiLib = NULL; pmem = clients[i].pmem; - clients[i].pmem = 0; + clients[i].pmem = NULL; } /* @@ -565,7 +565,7 @@ va_list ap) { diva_os_spin_lock_magic_t old_irql; dword sec, usec; - diva_dbg_entry_head_t* pmsg = 0; + diva_dbg_entry_head_t* pmsg = NULL; dword length; word size; static char fmtBuf[MSG_FRAME_MAX_SIZE+sizeof(*pmsg)+1]; @@ -843,7 +843,7 @@ dword sec, usec, logical, serial, org_mask; int id, best_id = 0, free_id = -1; char tmp[256]; - diva_dbg_entry_head_t* pmsg = 0; + diva_dbg_entry_head_t* pmsg = NULL; int len; word size; byte* pmem; @@ -938,7 +938,7 @@ if (((*(clients[id].pIdiLib->DivaSTraceLibraryStart))(clients[id].pIdiLib->hLib))) { diva_mnt_internal_dprintf (0, DLI_ERR, "Adapter(%d) Start failed", (int)logical); (*(clients[id].pIdiLib->DivaSTraceLibraryFinit))(clients[id].pIdiLib->hLib); - clients[id].pIdiLib = 0; + clients[id].pIdiLib = NULL; } } else { diva_mnt_internal_dprintf (0, DLI_ERR, "A(%d) management init failed", (int)logical); @@ -946,9 +946,9 @@ } if (!clients[id].pIdiLib) { - clients[id].request = 0; + clients[id].request = NULL; clients[id].request_pending = 0; - clients[id].hDbg = 0; + clients[id].hDbg = NULL; diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register"); diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "register"); diva_os_free (0, pmem); @@ -1008,7 +1008,7 @@ dword sec, usec; int i; word size; - byte* pmem = 0; + byte* pmem = NULL; diva_os_get_time (&sec, &usec); @@ -1023,14 +1023,14 @@ if (clients[i].pIdiLib) { (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib); - clients[i].pIdiLib = 0; + clients[i].pIdiLib = NULL; pmem = clients[i].pmem; - clients[i].pmem = 0; + clients[i].pmem = NULL; } - clients[i].hDbg = 0; - clients[i].request = 0; + clients[i].hDbg = NULL; + clients[i].request = NULL; clients[i].request_pending = 0; /* @@ -1092,7 +1092,7 @@ } } - return (0); + return NULL; } int SuperTraceCloseAdapter (void* AdapterHandle) { @@ -1741,7 +1741,7 @@ for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) { - pmem = 0; + pmem = NULL; diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "unload"); diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "unload"); @@ -1753,13 +1753,13 @@ */ if (clients[i].pIdiLib) { (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib); - clients[i].pIdiLib = 0; + clients[i].pIdiLib = NULL; pmem = clients[i].pmem; - clients[i].pmem = 0; + clients[i].pmem = NULL; } - clients[i].hDbg = 0; - clients[i].request = 0; + clients[i].hDbg = NULL; + clients[i].request = NULL; clients[i].request_pending = 0; } else { fret = -1; diff -Nru a/drivers/isdn/hardware/eicon/di.c b/drivers/isdn/hardware/eicon/di.c --- a/drivers/isdn/hardware/eicon/di.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/di.c 2004-07-13 12:24:00 -07:00 @@ -81,7 +81,7 @@ void pr_out(ADAPTER * a) { byte e_no; - ENTITY * this = 0; + ENTITY * this = NULL; BUFFERS *X; word length; word i; @@ -761,7 +761,7 @@ word clength; word offset; BUFFERS *R; - byte* cma = 0; + byte* cma = NULL; #ifdef USE_EXTENDED_DEBUGS { DBG_TRC(("io)->ANum, Id, Ind)) @@ -814,7 +814,7 @@ Id, cma, sizeof(a->stream_buffer), - &final, 0, 0); + &final, NULL, NULL); } IoAdapter->RBuffer.length = MIN(MLength, 270); if (IoAdapter->RBuffer.length != MLength) { diff -Nru a/drivers/isdn/hardware/eicon/diddfunc.c b/drivers/isdn/hardware/eicon/diddfunc.c --- a/drivers/isdn/hardware/eicon/diddfunc.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/diddfunc.c 2004-07-13 12:24:01 -07:00 @@ -66,7 +66,7 @@ req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; req.didd_notify.info.callback = (void *)didd_callback; - req.didd_notify.info.context = 0; + req.didd_notify.info.context = NULL; _DAdapter.request((ENTITY *) & req); if (req.didd_notify.e.Rc != 0xff) return (0); diff -Nru a/drivers/isdn/hardware/eicon/diva.c b/drivers/isdn/hardware/eicon/diva.c --- a/drivers/isdn/hardware/eicon/diva.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/diva.c 2004-07-13 12:24:01 -07:00 @@ -131,7 +131,7 @@ /* EOL */ - {-1, 0} + {-1} }; static void diva_init_request_array(void); @@ -174,7 +174,7 @@ for (i = 0; divas_supported_cards[i].CardOrdinal != -1; i++) { if (divas_supported_cards[i].CardOrdinal == CardOrdinal) { if (!(pdiva = divas_create_pci_card(i, pdev))) { - return (0); + return NULL; } switch (CardOrdinal) { case CARDTYPE_DIVASRV_Q_8M_PCI: @@ -237,11 +237,11 @@ DBG_ERR(("can not alloc request array")) diva_driver_remove_card(pdiva); - return (0); + return NULL; } } - return (0); + return NULL; } /* -------------------------------------------------------------------------- @@ -286,7 +286,7 @@ int i; pa = a[0] = (diva_os_xdi_adapter_t *) pdiva; - a[1] = a[2] = a[3] = 0; + a[1] = a[2] = a[3] = NULL; diva_os_enter_spin_lock(&adapter_lock, &old_irql, "remode adapter"); @@ -311,7 +311,7 @@ if (a[i]) { if (a[i]->controller) { DBG_LOG(("remove adapter (%d)", - a[i]->controller)) IoAdapters[a[i]->controller - 1] = 0; + a[i]->controller)) IoAdapters[a[i]->controller - 1] = NULL; remove_adapter_proc(a[i]); } diva_os_free(0, a[i]); @@ -332,7 +332,7 @@ if (!(a = (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a)))) { DBG_ERR(("A: can't alloc adapter")); - return (0); + return NULL; } memset(a, 0x00, sizeof(*a)); @@ -359,7 +359,7 @@ diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card"); diva_os_free(0, a); DBG_ERR(("A: can't get adapter resources")); - return (0); + return NULL; } return (a); @@ -377,7 +377,7 @@ (*(a->interface.cleanup_adapter_proc)) (a); } if (a->controller) { - IoAdapters[a->controller - 1] = 0; + IoAdapters[a->controller - 1] = NULL; remove_adapter_proc(a); } diva_os_free(0, a); @@ -388,7 +388,7 @@ /* ** Receive and process command from user mode utility */ -void *diva_xdi_open_adapter(void *os_handle, const void *src, +void *diva_xdi_open_adapter(void *os_handle, const void __user *src, int length, divas_xdi_copy_from_user_fn_t cp_fn) { @@ -400,11 +400,11 @@ if (length < sizeof(diva_xdi_um_cfg_cmd_t)) { DBG_ERR(("A: A(?) open, msg too small (%d < %d)", length, sizeof(diva_xdi_um_cfg_cmd_t))) - return (0); + return NULL; } if ((*cp_fn) (os_handle, &msg, src, sizeof(msg)) <= 0) { DBG_ERR(("A: A(?) open, write error")) - return (0); + return NULL; } diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter"); list_for_each(tmp, &adapter_queue) { @@ -432,12 +432,12 @@ a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY; if (a->xdi_mbox.data) { diva_os_free(0, a->xdi_mbox.data); - a->xdi_mbox.data = 0; + a->xdi_mbox.data = NULL; } } int -diva_xdi_write(void *adapter, void *os_handle, const void *src, +diva_xdi_write(void *adapter, void *os_handle, const void __user *src, int length, divas_xdi_copy_from_user_fn_t cp_fn) { diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter; @@ -480,7 +480,7 @@ ** Write answers to user mode utility, if any */ int -diva_xdi_read(void *adapter, void *os_handle, void *dst, +diva_xdi_read(void *adapter, void *os_handle, void __user *dst, int max_length, divas_xdi_copy_to_user_fn_t cp_fn) { diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter; @@ -507,7 +507,7 @@ a->xdi_mbox.data_length); if (ret > 0) { diva_os_free(0, a->xdi_mbox.data); - a->xdi_mbox.data = 0; + a->xdi_mbox.data = NULL; a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY; } @@ -526,7 +526,7 @@ if ((clear_int_proc = a->clear_interrupts_proc)) { (*clear_int_proc) (a); - a->clear_interrupts_proc = 0; + a->clear_interrupts_proc = NULL; return IRQ_HANDLED; } diff -Nru a/drivers/isdn/hardware/eicon/diva.h b/drivers/isdn/hardware/eicon/diva.h --- a/drivers/isdn/hardware/eicon/diva.h 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/diva.h 2004-07-13 12:24:00 -07:00 @@ -9,19 +9,19 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal); void diva_driver_remove_card(void *pdiva); -typedef int (*divas_xdi_copy_to_user_fn_t) (void *os_handle, void *dst, +typedef int (*divas_xdi_copy_to_user_fn_t) (void *os_handle, void __user *dst, const void *src, int length); typedef int (*divas_xdi_copy_from_user_fn_t) (void *os_handle, void *dst, - const void *src, int length); + const void __user *src, int length); -int diva_xdi_read(void *adapter, void *os_handle, void *dst, +int diva_xdi_read(void *adapter, void *os_handle, void __user *dst, int max_length, divas_xdi_copy_to_user_fn_t cp_fn); -int diva_xdi_write(void *adapter, void *os_handle, const void *src, +int diva_xdi_write(void *adapter, void *os_handle, const void __user *src, int length, divas_xdi_copy_from_user_fn_t cp_fn); -void *diva_xdi_open_adapter(void *os_handle, const void *src, +void *diva_xdi_open_adapter(void *os_handle, const void __user *src, int length, divas_xdi_copy_from_user_fn_t cp_fn); diff -Nru a/drivers/isdn/hardware/eicon/diva_dma.c b/drivers/isdn/hardware/eicon/diva_dma.c --- a/drivers/isdn/hardware/eicon/diva_dma.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/diva_dma.c 2004-07-13 12:24:01 -07:00 @@ -39,11 +39,10 @@ Create local mapping structure and init it to default state */ struct _diva_dma_map_entry* diva_alloc_dma_map (void* os_context, int nentries) { - diva_dma_map_entry_t* pmap; - if (!(pmap = diva_os_malloc (0, sizeof(*pmap)*(nentries+1)))) - return (0); - memset (pmap, 0x00, sizeof(*pmap)*(nentries+1)); - return (pmap); + diva_dma_map_entry_t* pmap = diva_os_malloc(0, sizeof(*pmap)*(nentries+1)); + if (pmap) + memset (pmap, 0, sizeof(*pmap)*(nentries+1)); + return pmap; } /* Free local map (context should be freed before) if any diff -Nru a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c --- a/drivers/isdn/hardware/eicon/divamnt.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/divamnt.c 2004-07-13 12:24:01 -07:00 @@ -53,7 +53,7 @@ extern int mntfunc_init(int *, void **, unsigned long); extern void mntfunc_finit(void); -extern int maint_read_write(void *buf, int count); +extern int maint_read_write(void __user *buf, int count); /* * helper functions @@ -90,12 +90,12 @@ /* * kernel/user space copy functions */ -int diva_os_copy_to_user(void *os_handle, void *dst, const void *src, +int diva_os_copy_to_user(void *os_handle, void __user *dst, const void *src, int length) { return (copy_to_user(dst, src, length)); } -int diva_os_copy_from_user(void *os_handle, void *dst, const void *src, +int diva_os_copy_from_user(void *os_handle, void *dst, const void __user *src, int length) { return (copy_from_user(dst, src, length)); @@ -142,9 +142,9 @@ to read unstructured traces, formated as ascii string only */ static ssize_t -maint_read(struct file *file, char *buf, size_t count, loff_t * off) +maint_read(struct file *file, char __user *buf, size_t count, loff_t * off) { - diva_dbg_entry_head_t *pmsg = 0; + diva_dbg_entry_head_t *pmsg = NULL; diva_os_spin_lock_magic_t old_irql; word size; char *pstr, *dli_label = "UNK"; @@ -264,20 +264,20 @@ if (diva_os_copy_to_user(NULL, buf, pstr, str_length)) { diva_os_free_tbuffer(0, str_msg); - file->private_data = 0; + file->private_data = NULL; return (-EFAULT); } str_msg[1] += str_length; if ((str_msg[0] - str_msg[1]) <= 0) { diva_os_free_tbuffer(0, str_msg); - file->private_data = 0; + file->private_data = NULL; } return (str_length); } static ssize_t -maint_write(struct file *file, const char *buf, size_t count, loff_t * off) +maint_write(struct file *file, const char __user *buf, size_t count, loff_t * off) { return (-ENODEV); } @@ -304,7 +304,7 @@ opened++; up(&opened_sem); - filep->private_data = 0; + filep->private_data = NULL; return (0); } @@ -313,7 +313,7 @@ { if (filep->private_data) { diva_os_free_tbuffer(0, filep->private_data); - filep->private_data = 0; + filep->private_data = NULL; } down(&opened_sem); @@ -360,13 +360,13 @@ /* * device node operations */ -static ssize_t divas_maint_write(struct file *file, const char *buf, +static ssize_t divas_maint_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos) { - return (maint_read_write((char *) buf, (int) count)); + return (maint_read_write((char __user *) buf, (int) count)); } -static ssize_t divas_maint_read(struct file *file, char *buf, +static ssize_t divas_maint_read(struct file *file, char __user *buf, size_t count, loff_t * ppos) { return (maint_read_write(buf, (int) count)); @@ -416,7 +416,7 @@ { char tmprev[50]; int ret = 0; - void *buffer = 0; + void *buffer = NULL; do_gettimeofday(&start_time); init_waitqueue_head(&msgwaitq); diff -Nru a/drivers/isdn/hardware/eicon/divasfunc.c b/drivers/isdn/hardware/eicon/divasfunc.c --- a/drivers/isdn/hardware/eicon/divasfunc.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/divasfunc.c 2004-07-13 12:24:01 -07:00 @@ -173,7 +173,7 @@ req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; req.didd_notify.info.callback = (void *)didd_callback; - req.didd_notify.info.context = 0; + req.didd_notify.info.context = NULL; DAdapter.request((ENTITY *) & req); if (req.didd_notify.e.Rc != 0xff) { stop_dbg(); diff -Nru a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c --- a/drivers/isdn/hardware/eicon/divasi.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/divasi.c 2004-07-13 12:24:00 -07:00 @@ -71,9 +71,9 @@ /* * LOCALS */ -static ssize_t um_idi_read(struct file *file, char *buf, size_t count, +static ssize_t um_idi_read(struct file *file, char __user *buf, size_t count, loff_t * offset); -static ssize_t um_idi_write(struct file *file, const char *buf, +static ssize_t um_idi_write(struct file *file, const char __user *buf, size_t count, loff_t * offset); static unsigned int um_idi_poll(struct file *file, poll_table * wait); static int um_idi_open(struct inode *inode, struct file *file); @@ -231,7 +231,7 @@ } static ssize_t -um_idi_read(struct file *file, char *buf, size_t count, loff_t * offset) +um_idi_read(struct file *file, char __user *buf, size_t count, loff_t * offset) { diva_um_idi_os_context_t *p_os; int ret = -EINVAL; @@ -312,7 +312,7 @@ } static ssize_t -um_idi_write(struct file *file, const char *buf, size_t count, +um_idi_write(struct file *file, const char __user *buf, size_t count, loff_t * offset) { diva_um_idi_os_context_t *p_os; diff -Nru a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c --- a/drivers/isdn/hardware/eicon/divasmain.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/divasmain.c 2004-07-13 12:24:00 -07:00 @@ -556,7 +556,7 @@ tasklet_kill(&pdpc->divas_task); flush_scheduled_work(); mem = psoft_isr->object; - psoft_isr->object = 0; + psoft_isr->object = NULL; diva_os_free(0, mem); } } @@ -565,7 +565,7 @@ * kernel/user space copy functions */ static int -xdi_copy_to_user(void *os_handle, void *dst, const void *src, int length) +xdi_copy_to_user(void *os_handle, void __user *dst, const void *src, int length) { if (copy_to_user(dst, src, length)) { return (-EFAULT); @@ -574,7 +574,7 @@ } static int -xdi_copy_from_user(void *os_handle, void *dst, const void *src, int length) +xdi_copy_from_user(void *os_handle, void *dst, const void __user *src, int length) { if (copy_from_user(dst, src, length)) { return (-EFAULT); @@ -598,7 +598,7 @@ return (0); } -static ssize_t divas_write(struct file *file, const char *buf, +static ssize_t divas_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos) { int ret = -EINVAL; @@ -629,7 +629,7 @@ return (ret); } -static ssize_t divas_read(struct file *file, char *buf, +static ssize_t divas_read(struct file *file, char __user *buf, size_t count, loff_t * ppos) { int ret = -EINVAL; @@ -703,7 +703,7 @@ static int __devinit divas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { - void *pdiva = 0; + void *pdiva = NULL; u8 pci_latency; u8 new_latency = 32; diff -Nru a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c --- a/drivers/isdn/hardware/eicon/divasproc.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/divasproc.c 2004-07-13 12:24:01 -07:00 @@ -54,7 +54,7 @@ static struct proc_dir_entry *divas_proc_entry = NULL; static ssize_t -divas_read(struct file *file, char *buf, size_t count, loff_t * off) +divas_read(struct file *file, char __user *buf, size_t count, loff_t * off) { int len = 0; int cadapter; @@ -95,7 +95,7 @@ } static ssize_t -divas_write(struct file *file, const char *buf, size_t count, loff_t * off) +divas_write(struct file *file, const char __user *buf, size_t count, loff_t * off) { return (-ENODEV); } @@ -151,14 +151,17 @@ ** write group_optimization */ static int -write_grp_opt(struct file *file, const char *buffer, unsigned long count, +write_grp_opt(struct file *file, const char __user *buffer, unsigned long count, void *data) { diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) data; PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; if ((count == 1) || (count == 2)) { - switch (buffer[0]) { + char c; + if (get_user(c, buffer)) + return -EFAULT; + switch (c) { case '0': IoAdapter->capi_cfg.cfg_1 &= ~DIVA_XDI_CAPI_CFG_1_GROUP_POPTIMIZATION_ON; @@ -179,14 +182,17 @@ ** write dynamic_l1_down */ static int -write_d_l1_down(struct file *file, const char *buffer, unsigned long count, +write_d_l1_down(struct file *file, const char __user *buffer, unsigned long count, void *data) { diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) data; PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; if ((count == 1) || (count == 2)) { - switch (buffer[0]) { + char c; + if (get_user(c, buffer)) + return -EFAULT; + switch (c) { case '0': IoAdapter->capi_cfg.cfg_1 &= ~DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON; @@ -256,14 +262,21 @@ ** info write */ static int -info_write(struct file *file, const char *buffer, unsigned long count, +info_write(struct file *file, const char __user *buffer, unsigned long count, void *data) { diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) data; PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; + char c[4]; + + if (count <= 4) + return -EINVAL; + + if (copy_from_user(c, buffer, 4)) + return -EFAULT; /* this is for test purposes only */ - if ((count > 4) && (!memcmp(buffer, "trap", 4))) { + if (!memcmp(c, "trap", 4)) { (*(IoAdapter->os_trap_nfy_Fnc)) (IoAdapter, IoAdapter->ANum); return (count); } diff -Nru a/drivers/isdn/hardware/eicon/dqueue.c b/drivers/isdn/hardware/eicon/dqueue.c --- a/drivers/isdn/hardware/eicon/dqueue.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/dqueue.c 2004-07-13 12:24:01 -07:00 @@ -23,7 +23,7 @@ q->segments = max_segments; for (i = 0; i < q->segments; i++) { - q->data[i] = 0; + q->data[i] = NULL; q->length[i] = 0; } q->read = q->write = q->count = q->segment_pending = 0; @@ -46,7 +46,7 @@ if (q->data[i]) { diva_os_free(0, q->data[i]); } - q->data[i] = 0; + q->data[i] = NULL; q->length[i] = 0; } q->read = q->write = q->count = q->segment_pending = 0; @@ -66,7 +66,7 @@ return (q->data[q->write]); } - return (0); + return NULL; } void @@ -89,7 +89,7 @@ if (q->count) { return (q->data[q->read]); } - return (0); + return NULL; } int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t * q) diff -Nru a/drivers/isdn/hardware/eicon/idifunc.c b/drivers/isdn/hardware/eicon/idifunc.c --- a/drivers/isdn/hardware/eicon/idifunc.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/idifunc.c 2004-07-13 12:24:01 -07:00 @@ -199,7 +199,7 @@ req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; req.didd_notify.info.callback = (void *)didd_callback; - req.didd_notify.info.context = 0; + req.didd_notify.info.context = NULL; DAdapter.request((ENTITY *) & req); if (req.didd_notify.e.Rc != 0xff) { stop_dbg(); diff -Nru a/drivers/isdn/hardware/eicon/maintidi.c b/drivers/isdn/hardware/eicon/maintidi.c --- a/drivers/isdn/hardware/eicon/maintidi.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/maintidi.c 2004-07-13 12:24:00 -07:00 @@ -112,7 +112,7 @@ int i; if (!pLib) { - return (0); + return NULL; } pmem += sizeof(*pLib); @@ -161,7 +161,7 @@ if (!(pLib->hAdapter = SuperTraceOpenAdapter (Adapter))) { diva_mnt_internal_dprintf (0, DLI_ERR, "Can not open XDI adapter"); - return (0); + return NULL; } pLib->Channels = SuperTraceGetNumberOfChannels (pLib->hAdapter); @@ -1170,13 +1170,13 @@ byte* start; int msg_length; - if (*msg != ESC) return (0); + if (*msg != ESC) return NULL; start = msg + 2; msg_length = *(msg+1); msg = (start+msg_length); - if (*msg != ESC) return (0); + if (*msg != ESC) return NULL; return ((diva_man_var_header_t*)msg); } diff -Nru a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c --- a/drivers/isdn/hardware/eicon/message.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/message.c 2004-07-13 12:24:01 -07:00 @@ -414,7 +414,7 @@ } a = &adapter[controller]; - plci = 0; + plci = NULL; if ((msg->header.plci != 0) && (msg->header.plci <= a->max_plci) && !a->adapter_disabled) { dbug(1,dprintf("plci=%x",msg->header.plci)); @@ -547,7 +547,7 @@ } else { - plci = 0; + plci = NULL; } } dbug(1,dprintf("com=%x",msg->header.command)); @@ -629,7 +629,7 @@ if(p>length) return TRUE; } - if(parms) parms[i].info = 0; + if(parms) parms[i].info = NULL; return FALSE; } @@ -661,7 +661,7 @@ for (j = 0; j < n; j++) *(p++) = in[i].info[j]; } - out->parms[i].info = 0; + out->parms[i].info = NULL; out->parms[i].length = 0; } @@ -725,7 +725,7 @@ plci->internal_command = 0; for (i = 0; i < MAX_INTERNAL_COMMAND_LEVELS; i++) - plci->internal_command_queue[i] = 0; + plci->internal_command_queue[i] = NULL; } @@ -759,16 +759,16 @@ UnMapId (Id), (char *)(FILE_), __LINE__)); plci->internal_command = 0; - plci->internal_command_queue[0] = 0; + plci->internal_command_queue[0] = NULL; while (plci->internal_command_queue[1] != 0) { for (i = 0; i < MAX_INTERNAL_COMMAND_LEVELS - 1; i++) plci->internal_command_queue[i] = plci->internal_command_queue[i+1]; - plci->internal_command_queue[MAX_INTERNAL_COMMAND_LEVELS - 1] = 0; + plci->internal_command_queue[MAX_INTERNAL_COMMAND_LEVELS - 1] = NULL; (*(plci->internal_command_queue[0]))(Id, plci, OK); if (plci->internal_command != 0) return; - plci->internal_command_queue[0] = 0; + plci->internal_command_queue[0] = NULL; } } @@ -1085,7 +1085,7 @@ plci_free_msg_in_queue (plci); plci->channels = 0; - plci->appl = 0; + plci->appl = NULL; if ((plci->State == INC_CON_PENDING) || (plci->State == INC_CON_ALERT)) plci->State = OUTG_DIS_PENDING; } @@ -1715,7 +1715,7 @@ { word i; API_PARSE * ai; - PLCI * rc_plci = 0; + PLCI * rc_plci = NULL; API_PARSE ai_parms[5]; word Info = 0; @@ -2195,7 +2195,7 @@ relatedadapter = &adapter[MapController ((byte)(relatedPLCIvalue & 0x7f))-1]; relatedPLCIvalue >>=8; /* find PLCI PTR*/ - for(i=0,rplci=0;imax_plci;i++) + for(i=0,rplci=NULL;imax_plci;i++) { if(relatedadapter->plci[i].Id == (byte)relatedPLCIvalue) { @@ -4355,7 +4355,7 @@ if(rc!=OK) { Info = 0x300E; /* not supported */ - plci->relatedPTYPLCI = 0; + plci->relatedPTYPLCI = NULL; plci->ptyState = 0; } sendf(rplci->appl, @@ -4376,7 +4376,7 @@ if(rc!=OK) { Info = 0x300E; /* not supported */ - plci->relatedPTYPLCI = 0; + plci->relatedPTYPLCI = NULL; plci->ptyState = 0; } sendf(rplci->appl, @@ -4560,7 +4560,7 @@ if(rc!=OK) { Info = 0x300E; /* not supported */ - plci->relatedPTYPLCI = 0; + plci->relatedPTYPLCI = NULL; plci->ptyState = 0; } sendf(rplci->appl, @@ -4722,7 +4722,7 @@ dbug(1,dprintf("Auto-Law assign failed")); a->automatic_law = 3; plci->internal_command = 0; - a->automatic_lawPLCI = 0; + a->automatic_lawPLCI = NULL; } break; } @@ -4739,7 +4739,7 @@ plci->internal_command = 0; sig_req(plci,REMOVE,0); send_req(plci); - a->automatic_lawPLCI = 0; + a->automatic_lawPLCI = NULL; } break; } @@ -4839,7 +4839,7 @@ byte *esc_profile = ""; byte facility[256]; - PLCI * tplci = 0; + PLCI * tplci = NULL; byte chi[] = "\x02\x18\x01"; byte voice_cai[] = "\x06\x14\x00\x00\x00\x00\x08"; byte resume_cau[] = "\x05\x05\x00\x02\x00\x00"; @@ -4981,7 +4981,7 @@ plci->internal_command = 0; sig_req(plci,REMOVE,0); send_req(plci); - a->automatic_lawPLCI = 0; + a->automatic_lawPLCI = NULL; } } if (esc_profile[0]) @@ -5073,7 +5073,7 @@ { force_mt_info = SendMultiIE(plci,Id,multi_fac_parms, FTY, 0x20, 0); force_mt_info |= SendMultiIE(plci,Id,multi_pi_parms, PI, 0x210, 0); - SendSSExtInd(0,plci,Id,multi_ssext_parms); + SendSSExtInd(NULL,plci,Id,multi_ssext_parms); SendInfo(plci,Id, parms, force_mt_info); VSwitchReqInd(plci,Id,multi_vswitch_parms); @@ -5144,7 +5144,7 @@ { WRITE_WORD(&SS_Ind[4],0x300E); } - plci->relatedPTYPLCI = 0; + plci->relatedPTYPLCI = NULL; plci->ptyState = 0; sendf(tplci->appl,_FACILITY_I,rId,0,"ws",3, SS_Ind); break; @@ -5298,7 +5298,7 @@ break; case CONF_ADD: WRITE_WORD(&CONF_Ind[1],S_CONF_ADD); - plci->relatedPTYPLCI = 0; + plci->relatedPTYPLCI = NULL; tplci=plci->relatedPTYPLCI; if(tplci) tplci->ptyState = CONNECTED; plci->ptyState = CONNECTED; @@ -5342,7 +5342,7 @@ { plci->ptyState = IDLE; - plci->relatedPTYPLCI = 0; + plci->relatedPTYPLCI = NULL; plci->ptyState = 0; } @@ -5364,7 +5364,7 @@ case S_3PTY_END: plci->ptyState = IDLE; - plci->relatedPTYPLCI = 0; + plci->relatedPTYPLCI = NULL; plci->ptyState = 0; dbug(1,dprintf("3PTY OFF")); break; @@ -5904,7 +5904,7 @@ /* and signal '+'.Appl must decide */ /* with connect_res if call must */ /* accepted or not */ - for(i=0, tplci=0;icodec_listen[i] && (a->codec_listen[i]->State==INC_CON_PENDING ||a->codec_listen[i]->State==INC_CON_ALERT) ){ @@ -5927,7 +5927,7 @@ add_p(tplci, CAI, voice_cai); add_p(tplci, OAD, a->TelOAD); add_p(tplci, OSA, a->TelOSA); - add_p(tplci,SHIFT|6,0); + add_p(tplci,SHIFT|6,NULL); add_p(tplci,SIN,"\x02\x01\x00"); add_p(tplci,UID,"\x06\x43\x61\x70\x69\x32\x30"); sig_req(tplci,ASSIGN,DSIG_ID); @@ -6080,7 +6080,7 @@ break; case SSEXT_IND: - SendSSExtInd(0,plci,Id,multi_ssext_parms); + SendSSExtInd(NULL,plci,Id,multi_ssext_parms); break; case VSWITCH_REQ: @@ -6218,7 +6218,7 @@ Info_Number = 0x0008; Info_Mask = 0x00; cause[2] = ie[2]; - Info_Element = 0; + Info_Element = NULL; break; case 8: /* display */ dbug(1,dprintf("display(%d)",i)); @@ -7273,8 +7273,8 @@ plci->sig_req = 0; plci->nl_req = 0; - plci->appl = 0; - plci->relatedPTYPLCI = 0; + plci->appl = NULL; + plci->relatedPTYPLCI = NULL; plci->State = IDLE; plci->SuppState = IDLE; plci->channels = 0; @@ -8899,7 +8899,7 @@ add_p(plci,CAI,"\x01\xc0"); add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30"); add_p(plci,LLI,"\x01\xc4"); /* support Dummy CR FAC + MWI + SpoofNotify */ - add_p(plci,SHIFT|6,0); + add_p(plci,SHIFT|6,NULL); add_p(plci,SIN,"\x02\x00\x00"); plci->internal_command = LISTEN_SIG_ASSIGN_PEND; /* do indicate_req if OK */ sig_req(plci,ASSIGN,DSIG_ID); @@ -9216,10 +9216,10 @@ dbug(1,dprintf("remove temp codec PLCI")); plci_remove(a->AdvCodecPLCI); a->AdvCodecFLAG = 0; - a->AdvCodecPLCI = 0; - a->AdvSignalAppl = 0; + a->AdvCodecPLCI = NULL; + a->AdvSignalAppl = NULL; } - a->AdvSignalPLCI = 0; + a->AdvSignalPLCI = NULL; } } @@ -9351,7 +9351,7 @@ a->Info_Mask[Id-1] = 0; a->CIP_Mask[Id-1] = 0; a->Notification_Mask[Id-1] = 0; - a->codec_listen[Id-1] = 0; + a->codec_listen[Id-1] = NULL; a->requested_options_table[Id-1] = 0; for(j=0; jmax_plci; j++) /* and all PLCIs connected */ { /* with this application */ @@ -9386,7 +9386,7 @@ } if(plci->appl==this) { - plci->appl = 0; + plci->appl = NULL; plci_remove(plci); plci->State = IDLE; } @@ -9405,7 +9405,7 @@ add_p(plci,OAD,"\x01\xfd"); add_p(plci,CAI,"\x01\x80"); add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30"); - add_p(plci,SHIFT|6,0); + add_p(plci,SHIFT|6,NULL); add_p(plci,SIN,"\x02\x00\x00"); plci->internal_command = REM_L1_SIG_ASSIGN_PEND; sig_req(plci,ASSIGN,DSIG_ID); @@ -9424,10 +9424,10 @@ a->AdvCodecPLCI->tel = 0; a->AdvCodecPLCI->adv_nl = 0; } - a->AdvSignalAppl = 0; - a->AdvSignalPLCI = 0; + a->AdvSignalAppl = NULL; + a->AdvSignalPLCI = NULL; a->AdvCodecFLAG = 0; - a->AdvCodecPLCI = 0; + a->AdvCodecPLCI = NULL; } } } @@ -9458,7 +9458,7 @@ plci->Id = 0; plci->State = IDLE; plci->channels = 0; - plci->appl = 0; + plci->appl = NULL; plci->notifiedcall = 0; } listen_check(plci->adapter); @@ -10265,8 +10265,8 @@ /*------------------------------------------------------------------*/ -LI_CONFIG *li_config_table = 0; -word li_total_channels = 0; +LI_CONFIG *li_config_table; +word li_total_channels; /*------------------------------------------------------------------*/ @@ -14948,7 +14948,7 @@ add_p(plci,OAD,"\x01\xfd"); add_p(plci,CAI,"\x01\x80"); add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30"); - add_p(plci,SHIFT|6,0); + add_p(plci,SHIFT|6,NULL); add_p(plci,SIN,"\x02\x00\x00"); plci->internal_command = START_L1_SIG_ASSIGN_PEND; sig_req(plci,ASSIGN,DSIG_ID); @@ -15068,7 +15068,7 @@ pReq->xdi_dma_descriptor_operation.info.operation = IDI_SYNC_REQ_DMA_DESCRIPTOR_ALLOC; pReq->xdi_dma_descriptor_operation.info.descriptor_number = -1; - pReq->xdi_dma_descriptor_operation.info.descriptor_address = 0; + pReq->xdi_dma_descriptor_operation.info.descriptor_address = NULL; pReq->xdi_dma_descriptor_operation.info.descriptor_magic = 0; e.user[0] = plci->adapter->Id - 1; @@ -15102,7 +15102,7 @@ pReq->xdi_dma_descriptor_operation.info.operation = IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE; pReq->xdi_dma_descriptor_operation.info.descriptor_number = nr; - pReq->xdi_dma_descriptor_operation.info.descriptor_address = 0; + pReq->xdi_dma_descriptor_operation.info.descriptor_address = NULL; pReq->xdi_dma_descriptor_operation.info.descriptor_magic = 0; e.user[0] = plci->adapter->Id - 1; diff -Nru a/drivers/isdn/hardware/eicon/mntfunc.c b/drivers/isdn/hardware/eicon/mntfunc.c --- a/drivers/isdn/hardware/eicon/mntfunc.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/mntfunc.c 2004-07-13 12:24:00 -07:00 @@ -34,10 +34,10 @@ extern void *diva_os_malloc_tbuffer(unsigned long flags, unsigned long size); extern void diva_os_free_tbuffer(unsigned long flags, void *ptr); -extern int diva_os_copy_to_user(void *os_handle, void *dst, +extern int diva_os_copy_to_user(void *os_handle, void __user *dst, const void *src, int length); extern int diva_os_copy_from_user(void *os_handle, void *dst, - const void *src, int length); + const void __user *src, int length); static void no_printf(unsigned char *x, ...) { @@ -102,7 +102,7 @@ req.didd_notify.e.Rc = IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY; req.didd_notify.info.callback = (void *)didd_callback; - req.didd_notify.info.context = 0; + req.didd_notify.info.context = NULL; DAdapter.request((ENTITY *) & req); if (req.didd_notify.e.Rc != 0xff) return (0); @@ -148,7 +148,7 @@ /* * read/write maint */ -int maint_read_write(void *buf, int count) +int maint_read_write(void __user *buf, int count) { byte data[128]; dword cmd, id, mask; @@ -228,7 +228,7 @@ diva_os_spin_lock_magic_t old_irql; word size; diva_dbg_entry_head_t *pmsg; - byte *pbuf = 0; + byte *pbuf = NULL; int written = 0; if (mask < 4096) { diff -Nru a/drivers/isdn/hardware/eicon/os_4bri.c b/drivers/isdn/hardware/eicon/os_4bri.c --- a/drivers/isdn/hardware/eicon/os_4bri.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/os_4bri.c 2004-07-13 12:24:00 -07:00 @@ -17,7 +17,7 @@ #include "mi_pc.h" #include "dsrv4bri.h" -void *diva_xdiLoadFileFile = 0; +void *diva_xdiLoadFileFile = NULL; dword diva_xdiLoadFileLength = 0; /* @@ -268,7 +268,7 @@ (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a)))) { diva_os_free(0, a->slave_adapters[0]); - a->slave_adapters[0] = 0; + a->slave_adapters[0] = NULL; diva_4bri_cleanup_adapter(a); return (-1); } @@ -277,8 +277,8 @@ { diva_os_free(0, a->slave_adapters[0]); diva_os_free(0, a->slave_adapters[1]); - a->slave_adapters[0] = 0; - a->slave_adapters[1] = 0; + a->slave_adapters[0] = NULL; + a->slave_adapters[1] = NULL; diva_4bri_cleanup_adapter(a); return (-1); } @@ -300,7 +300,7 @@ if (!(a->slave_list = quadro_list)) { for (i = 0; i < (tasks - 1); i++) { diva_os_free(0, a->slave_adapters[i]); - a->slave_adapters[i] = 0; + a->slave_adapters[i] = NULL; } diva_4bri_cleanup_adapter(a); return (-1); @@ -499,7 +499,7 @@ && a->resources.pci.addr[bar]) { divasa_unmap_pci_bar(a->resources.pci.addr[bar]); a->resources.pci.bar[bar] = 0; - a->resources.pci.addr[bar] = 0; + a->resources.pci.addr[bar] = NULL; } } } @@ -515,12 +515,12 @@ _4bri_bar_length[1], &a->port_name[0], 1); a->resources.pci.bar[1] = 0; - a->resources.pci.addr[1] = 0; + a->resources.pci.addr[1] = NULL; } if (a->slave_list) { diva_os_free(0, a->slave_list); - a->slave_list = 0; + a->slave_list = NULL; } return (0); @@ -607,14 +607,14 @@ diva_os_remove_soft_isr(&diva_current->xdi_adapter. req_soft_isr); - diva_current->xdi_adapter.isr_soft_isr.object = 0; + diva_current->xdi_adapter.isr_soft_isr.object = NULL; if (diva_current->xdi_adapter.e_tbl) { diva_os_free(0, diva_current->xdi_adapter. e_tbl); } - diva_current->xdi_adapter.e_tbl = 0; + diva_current->xdi_adapter.e_tbl = NULL; diva_current->xdi_adapter.e_max = 0; diva_current->xdi_adapter.e_count = 0; } @@ -823,7 +823,7 @@ if (FileLength) { *FileLength = diva_xdiLoadFileLength; } - diva_xdiLoadFileFile = 0; + diva_xdiLoadFileFile = NULL; diva_xdiLoadFileLength = 0; return (ret); @@ -848,7 +848,7 @@ ret = qBri_FPGA_download(&a->xdi_adapter); - diva_xdiLoadFileFile = 0; + diva_xdiLoadFileFile = NULL; diva_xdiLoadFileLength = 0; return (ret ? 0 : -1); @@ -1116,7 +1116,7 @@ if (a->clear_interrupts_proc) { diva_4bri_clear_interrupts(a); - a->clear_interrupts_proc = 0; + a->clear_interrupts_proc = NULL; DBG_ERR(("A: A(%d) no final interrupt from 4BRI adapter", IoAdapter->ANum)) } diff -Nru a/drivers/isdn/hardware/eicon/os_bri.c b/drivers/isdn/hardware/eicon/os_bri.c --- a/drivers/isdn/hardware/eicon/os_bri.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hardware/eicon/os_bri.c 2004-07-13 12:24:00 -07:00 @@ -282,7 +282,7 @@ if (a->resources.pci.addr[0] && a->resources.pci.bar[0]) { divasa_unmap_pci_bar(a->resources.pci.addr[0]); - a->resources.pci.addr[0] = 0; + a->resources.pci.addr[0] = NULL; a->resources.pci.bar[0] = 0; } @@ -293,7 +293,7 @@ a->resources.pci. length[i], &a->port_name[0], i); - a->resources.pci.addr[i] = 0; + a->resources.pci.addr[i] = NULL; a->resources.pci.bar[i] = 0; } } @@ -305,7 +305,7 @@ diva_os_cancel_soft_isr(&a->xdi_adapter.isr_soft_isr); diva_os_remove_soft_isr(&a->xdi_adapter.req_soft_isr); - a->xdi_adapter.isr_soft_isr.object = 0; + a->xdi_adapter.isr_soft_isr.object = NULL; diva_os_destroy_spin_lock(&a->xdi_adapter.isr_spin_lock, "rm"); diva_os_destroy_spin_lock(&a->xdi_adapter.data_spin_lock, "rm"); @@ -315,7 +315,7 @@ */ if (a->xdi_adapter.e_tbl) { diva_os_free(0, a->xdi_adapter.e_tbl); - a->xdi_adapter.e_tbl = 0; + a->xdi_adapter.e_tbl = NULL; } return (0); @@ -367,7 +367,7 @@ diva_os_register_io_port(a, 0, a->resources.pci.bar[i], a->resources.pci.length[i], &a->port_name[0], i); - a->resources.pci.addr[i] = 0; + a->resources.pci.addr[i] = NULL; } sprintf(a->port_name, "DIVA BRI %ld", @@ -797,7 +797,7 @@ } while (i-- && a->clear_interrupts_proc); if (a->clear_interrupts_proc) { diva_bri_clear_interrupts(a); - a->clear_interrupts_proc = 0; + a->clear_interrupts_proc = NULL; DBG_ERR(("A: A(%d) no final interrupt from BRI adapter", IoAdapter->ANum)) } diff -Nru a/drivers/isdn/hardware/eicon/os_pri.c b/drivers/isdn/hardware/eicon/os_pri.c --- a/drivers/isdn/hardware/eicon/os_pri.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/os_pri.c 2004-07-13 12:24:01 -07:00 @@ -283,7 +283,7 @@ && a->resources.pci.addr[bar]) { divasa_unmap_pci_bar(a->resources.pci.addr[bar]); a->resources.pci.bar[bar] = 0; - a->resources.pci.addr[bar] = 0; + a->resources.pci.addr[bar] = NULL; } } @@ -294,7 +294,7 @@ diva_os_cancel_soft_isr(&a->xdi_adapter.req_soft_isr); diva_os_remove_soft_isr(&a->xdi_adapter.req_soft_isr); - a->xdi_adapter.isr_soft_isr.object = 0; + a->xdi_adapter.isr_soft_isr.object = NULL; diva_os_destroy_spin_lock(&a->xdi_adapter.isr_spin_lock, "rm"); diva_os_destroy_spin_lock(&a->xdi_adapter.data_spin_lock, "rm"); @@ -304,7 +304,7 @@ */ if (a->xdi_adapter.e_tbl) { diva_os_free(0, a->xdi_adapter.e_tbl); - a->xdi_adapter.e_tbl = 0; + a->xdi_adapter.e_tbl = NULL; } a->xdi_adapter.Channels = 0; a->xdi_adapter.e_max = 0; @@ -316,7 +316,7 @@ diva_free_dma_map(a->resources.pci.hdev, (struct _diva_dma_map_entry *) a->xdi_adapter. dma_map); - a->xdi_adapter.dma_map = 0; + a->xdi_adapter.dma_map = NULL; /* @@ -576,7 +576,7 @@ if (a->clear_interrupts_proc) { diva_pri_clear_interrupts(a); - a->clear_interrupts_proc = 0; + a->clear_interrupts_proc = NULL; DBG_ERR(("A: A(%d) no final interrupt from PRI adapter", IoAdapter->ANum)) } diff -Nru a/drivers/isdn/hardware/eicon/um_idi.c b/drivers/isdn/hardware/eicon/um_idi.c --- a/drivers/isdn/hardware/eicon/um_idi.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hardware/eicon/um_idi.c 2004-07-13 12:24:01 -07:00 @@ -188,9 +188,9 @@ ------------------------------------------------------------------------ */ static void cleanup_entity(divas_um_idi_entity_t * e) { - e->os_ref = 0; + e->os_ref = NULL; e->status = 0; - e->adapter = 0; + e->adapter = NULL; e->e.Id = 0; e->rc_count = 0; @@ -218,20 +218,20 @@ diva_os_malloc(0, diva_os_get_context_size()))) { DBG_LOG(("E(%08x) no memory for os context", e)); diva_os_free(0, e); - return (0); + return NULL; } memset(e->os_context, 0x00, diva_os_get_context_size()); if ((diva_data_q_init(&e->data, 2048 + 512, 16))) { diva_os_free(0, e->os_context); diva_os_free(0, e); - return (0); + return NULL; } if ((diva_data_q_init(&e->rc, sizeof(diva_um_idi_ind_hdr_t), 2))) { diva_data_q_finit(&e->data); diva_os_free(0, e->os_context); diva_os_free(0, e); - return (0); + return NULL; } diva_os_enter_spin_lock(&adapter_lock, &old_irql, "create_entity"); @@ -250,7 +250,7 @@ diva_os_free(0, e->os_context); diva_os_free(0, e); - return (0); + return NULL; } e->os_ref = file; /* link to os handle */ @@ -608,9 +608,9 @@ e->e.IndCh = 0; e->e.XNum = 0; e->e.RNum = 0; - e->e.callback = 0; - e->e.X = 0; - e->e.R = 0; + e->e.callback = NULL; + e->e.X = NULL; + e->e.R = NULL; write_return_code(e, ASSIGN_RC | OUT_OF_RESOURCES); return (-2); } else { @@ -631,7 +631,7 @@ if (rc != ASSIGN_OK) { DBG_ERR(("A: A(%d) E(%08x) ASSIGN failed", e->adapter->adapter_nr, e)); - e->e.callback = 0; + e->e.callback = NULL; e->e.Id = 0; e->e.Req = 0; e->e.ReqCh = 0; @@ -639,8 +639,8 @@ e->e.RcCh = 0; e->e.Ind = 0; e->e.IndCh = 0; - e->e.X = 0; - e->e.R = 0; + e->e.X = NULL; + e->e.R = NULL; e->e.XNum = 0; e->e.RNum = 0; } @@ -651,7 +651,7 @@ return (0); /* let us do it in the driver */ } if ((e->e.Req == REMOVE) && (!e->e.Id)) { /* REMOVE COMPLETE */ - e->e.callback = 0; + e->e.callback = NULL; e->e.Id = 0; e->e.Req = 0; e->e.ReqCh = 0; @@ -659,8 +659,8 @@ e->e.RcCh = 0; e->e.Ind = 0; e->e.IndCh = 0; - e->e.X = 0; - e->e.R = 0; + e->e.X = NULL; + e->e.R = NULL; e->e.XNum = 0; e->e.RNum = 0; e->rc_count = 0; diff -Nru a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c --- a/drivers/isdn/hisax/config.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hisax/config.c 2004-07-13 12:24:01 -07:00 @@ -618,10 +618,10 @@ return NULL; } -int HiSax_readstatus(u_char * buf, int len, int user, int id, int channel) +int HiSax_readstatus(u_char __user *buf, int len, int id, int channel) { int count, cnt; - u_char *p = buf; + u_char __user *p = buf; struct IsdnCardState *cs = hisax_findcard(id); if (cs) { @@ -633,10 +633,7 @@ count = cs->status_end - cs->status_read + 1; if (count >= len) count = len; - if (user) - copy_to_user(p, cs->status_read, count); - else - memcpy(p, cs->status_read, count); + copy_to_user(p, cs->status_read, count); cs->status_read += count; if (cs->status_read > cs->status_end) cs->status_read = cs->status_buf; @@ -647,10 +644,7 @@ cnt = HISAX_STATUS_BUFSIZE; else cnt = count; - if (user) - copy_to_user(p, cs->status_read, cnt); - else - memcpy(p, cs->status_read, cnt); + copy_to_user(p, cs->status_read, cnt); p += cnt; cs->status_read += cnt % HISAX_STATUS_BUFSIZE; count -= cnt; @@ -1586,7 +1580,7 @@ cards[i].protocol = protocol; sprintf(id, "%s%d", name, i); nrcards++; - retval = checkcard(i, id, 0, hisax_d_if->owner); + retval = checkcard(i, id, NULL, hisax_d_if->owner); if (retval == 0) { // yuck cards[i].typ = 0; nrcards--; diff -Nru a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c --- a/drivers/isdn/hisax/diva.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hisax/diva.c 2004-07-13 12:24:01 -07:00 @@ -1158,7 +1158,7 @@ cs->writeisacfifo = &MemWriteISACfifo_IPACX; cs->BC_Read_Reg = &MemReadHSCX_IPACX; cs->BC_Write_Reg = &MemWriteHSCX_IPACX; - cs->BC_Send_Data = 0; // function located in ipacx module + cs->BC_Send_Data = NULL; // function located in ipacx module cs->irq_func = &diva_irq_ipacx_pci; printk(KERN_INFO "Diva: IPACX Design Id: %x\n", MemReadISAC_IPACX(cs, IPACX_ID) &0x3F); diff -Nru a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c --- a/drivers/isdn/hisax/elsa_ser.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hisax/elsa_ser.c 2004-07-13 12:24:00 -07:00 @@ -401,7 +401,7 @@ if (status & UART_LSR_DR) receive_chars(cs, &status); if (status & UART_LSR_THRE) - transmit_chars(cs, 0); + transmit_chars(cs, NULL); if (pass_counter++ > RS_ISR_PASS_LIMIT) { printk("rs_single loop break.\n"); break; diff -Nru a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c --- a/drivers/isdn/hisax/hfc_usb.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hisax/hfc_usb.c 2004-07-13 12:24:00 -07:00 @@ -133,7 +133,7 @@ /**********/ /* macros */ /**********/ -#define write_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),0,0,HFC_CTRL_TIMEOUT) +#define write_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),NULL,0,HFC_CTRL_TIMEOUT) #define read_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT) /*************************************************/ @@ -353,7 +353,7 @@ {0x8e3, 0x0301, "Olitec USB RNIS", LED_SCHEME1, LED_NORMAL, {2,0,1,4}}, /* Olitec TA */ {0x675, 0x1688, "DrayTec USB ISDN TA", LED_SCHEME1, LED_NORMAL, {4,0,2,1}}, /* Draytec TA */ {0x7fa, 0x0846, "Bewan Modem RNIS USB", LED_SCHEME1, LED_INVERTED, {8,0x40,0x20,0x10}}, /* Bewan TA */ - {0,0,0} // EOL element + {0} // EOL element }; /***************************************************/ diff -Nru a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c --- a/drivers/isdn/hisax/isar.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/hisax/isar.c 2004-07-13 12:24:00 -07:00 @@ -186,12 +186,12 @@ } int -isar_load_firmware(struct IsdnCardState *cs, u_char *buf) +isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) { int ret, size, cnt, debug; u_char len, nom, noc; u_short sadr, left, *sp; - u_char *p = buf; + u_char __user *p = buf; u_char *msg, *tmpmsg, *mp, tmp[64]; u_long flags; struct isar_reg *ireg = cs->bcs[0].hw.isar.reg; @@ -1856,7 +1856,7 @@ ISDN_FEATURE_L2_FAX | ISDN_FEATURE_L3_FCLASS1; memcpy(&adr, ic->parm.num, sizeof(ulong)); - if (isar_load_firmware(cs, (u_char *)adr)) + if (isar_load_firmware(cs, (u_char __user *)adr)) return(1); else ll_run(cs, features); diff -Nru a/drivers/isdn/hisax/tei.c b/drivers/isdn/hisax/tei.c --- a/drivers/isdn/hisax/tei.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/hisax/tei.c 2004-07-13 12:24:01 -07:00 @@ -239,7 +239,7 @@ if ((st->l2.tei != -1) && ((tei == GROUP_TEI) || (tei == st->l2.tei))) { FsmDelTimer(&st->ma.t202, 5); FsmChangeState(&st->ma.tei_m, ST_TEI_NOP); - st->l3.l3l2(st, MDL_REMOVE | REQUEST, 0); + st->l3.l3l2(st, MDL_REMOVE | REQUEST, NULL); cs = (struct IsdnCardState *) st->l1.hardware; cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL); } @@ -275,7 +275,7 @@ FsmAddTimer(&st->ma.t202, st->ma.T202, EV_T202, NULL, 3); } else { st->ma.tei_m.printdebug(&st->ma.tei_m, "assign req failed"); - st->l3.l3l2(st, MDL_ERROR | RESPONSE, 0); + st->l3.l3l2(st, MDL_ERROR | RESPONSE, NULL); cs = (struct IsdnCardState *) st->l1.hardware; cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL); FsmChangeState(fi, ST_TEI_NOP); @@ -298,7 +298,7 @@ } else { st->ma.tei_m.printdebug(&st->ma.tei_m, "verify req for tei %d failed", st->l2.tei); - st->l3.l3l2(st, MDL_REMOVE | REQUEST, 0); + st->l3.l3l2(st, MDL_REMOVE | REQUEST, NULL); cs = (struct IsdnCardState *) st->l1.hardware; cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL); FsmChangeState(fi, ST_TEI_NOP); diff -Nru a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c --- a/drivers/isdn/i4l/isdn_common.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/i4l/isdn_common.c 2004-07-13 12:24:00 -07:00 @@ -959,7 +959,7 @@ interruptible_sleep_on(&(dev->info_waitq)); } p = isdn_statstr(); - file->private_data = 0; + file->private_data = NULL; if ((len = strlen(p)) <= count) { if (copy_to_user(buf, p, len)) { retval = -EFAULT; @@ -992,7 +992,7 @@ retval = -ENOMEM; goto out; } - len = isdn_readbchan(drvidx, chidx, p, 0, count, + len = isdn_readbchan(drvidx, chidx, p, NULL, count, &dev->drv[drvidx]->rcv_waitq[chidx]); *off += len; if (copy_to_user(buf,p,len)) @@ -1018,7 +1018,7 @@ if (count > dev->drv[drvidx]->stavail) count = dev->drv[drvidx]->stavail; len = dev->drv[drvidx]->interface-> - readstat(buf, count, 1, drvidx, + readstat(buf, count, drvidx, isdn_minor2chan(minor)); } else { len = 0; @@ -1091,7 +1091,7 @@ */ if (dev->drv[drvidx]->interface->writecmd) retval = dev->drv[drvidx]->interface-> - writecmd(buf, count, 1, drvidx, isdn_minor2chan(minor)); + writecmd(buf, count, drvidx, isdn_minor2chan(minor)); else retval = count; goto out; 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-13 12:24:01 -07:00 +++ b/drivers/isdn/i4l/isdn_net.c 2004-07-13 12:24:01 -07:00 @@ -396,8 +396,8 @@ if (p) { isdn_net_local *lp = p->local; #ifdef CONFIG_ISDN_X25 - struct concap_proto *cprot = lp -> netdev -> cprot; - struct concap_proto_ops *pops = cprot ? cprot -> pops : 0; + struct concap_proto *cprot = lp->netdev->cprot; + struct concap_proto_ops *pops = cprot ? cprot->pops : NULL; #endif switch (cmd) { case ISDN_STAT_BSENT: @@ -617,7 +617,7 @@ s = "dial suppressed: isdn system stopped"; else s = "dial suppressed: dialmode `off'"; - isdn_net_unreachable(&p->dev, 0, s); + isdn_net_unreachable(&p->dev, NULL, s); isdn_net_hangup(&p->dev); break; } @@ -645,7 +645,7 @@ if (time_after(jiffies, lp->dialstarted + lp->dialtimeout)) { lp->dialwait_timer = jiffies + lp->dialwait; lp->dialstarted = 0; - isdn_net_unreachable(&p->dev, 0, "dial: timed out"); + isdn_net_unreachable(&p->dev, NULL, "dial: timed out"); isdn_net_hangup(&p->dev); break; } @@ -675,7 +675,7 @@ if (lp->dialtimeout == 0) { lp->dialwait_timer = jiffies + lp->dialwait; lp->dialstarted = 0; - isdn_net_unreachable(&p->dev, 0, "dial: tried all numbers dialmax times"); + isdn_net_unreachable(&p->dev, NULL, "dial: tried all numbers dialmax times"); } isdn_net_hangup(&p->dev); break; @@ -827,8 +827,8 @@ isdn_net_local *lp = (isdn_net_local *) d->priv; isdn_ctrl cmd; #ifdef CONFIG_ISDN_X25 - struct concap_proto *cprot = lp -> netdev -> cprot; - struct concap_proto_ops *pops = cprot ? cprot -> pops : 0; + struct concap_proto *cprot = lp->netdev->cprot; + struct concap_proto_ops *pops = cprot ? cprot->pops : NULL; #endif if (lp->flags & ISDN_NET_CONNECTED) { @@ -1416,11 +1416,10 @@ struct sk_buff *skb; skb = alloc_skb(hl + len, GFP_ATOMIC); - if (!skb) { + if (skb) + skb_reserve(skb, hl); + else printk("isdn out of mem at %s:%d!\n", __FILE__, __LINE__); - return 0; - } - skb_reserve(skb, hl); return skb; } @@ -2182,7 +2181,7 @@ *my_eaz == 'b' || *my_eaz == 'B') my_eaz++; /* skip to allow a match */ else - my_eaz = 0; /* force non match */ + my_eaz = NULL; /* force non match */ } else { /* it's a DATA call, check if we allow it */ if (*my_eaz == 'b' || *my_eaz == 'B') my_eaz++; /* skip to allow a match */ diff -Nru a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c --- a/drivers/isdn/i4l/isdn_tty.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/i4l/isdn_tty.c 2004-07-13 12:24:01 -07:00 @@ -134,7 +134,7 @@ if (c > 0) { r = isdn_readbchan(info->isdn_driver, info->isdn_channel, tty->flip.char_buf_ptr, - tty->flip.flag_buf_ptr, c, 0); + tty->flip.flag_buf_ptr, c, NULL); /* CISCO AsyncPPP Hack */ if (!(info->emu.mdmreg[REG_CPPP] & BIT_CPPP)) memset(tty->flip.flag_buf_ptr, 0, r); @@ -1483,7 +1483,7 @@ #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line); #endif - return isdn_tty_get_lsr_info(info, (uint *) arg); + return isdn_tty_get_lsr_info(info, (uint __user *) arg); default: #ifdef ISDN_DEBUG_MODEM_IOCTL printk(KERN_DEBUG "UNKNOWN ioctl 0x%08x on ttyi%d\n", cmd, info->line); @@ -1751,7 +1751,7 @@ tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); - info->tty = 0; + info->tty = NULL; info->ncarrier = 0; tty->closing = 0; module_put(info->owner); @@ -1780,7 +1780,7 @@ isdn_tty_shutdown(info); info->count = 0; info->flags &= ~(ISDN_ASYNC_NORMAL_ACTIVE | ISDN_ASYNC_CALLOUT_ACTIVE); - info->tty = 0; + info->tty = NULL; wake_up_interruptible(&info->open_wait); } @@ -1959,7 +1959,7 @@ isdn_tty_modem_reset_regs(info, 1); info->magic = ISDN_ASYNC_MAGIC; info->line = i; - info->tty = 0; + info->tty = NULL; info->x_char = 0; info->count = 0; info->blocked_open = 0; @@ -2373,8 +2373,8 @@ char *p; char c; u_long flags; - struct sk_buff *skb = 0; - char *sp = 0; + struct sk_buff *skb = NULL; + char *sp = NULL; if (!msg) { printk(KERN_WARNING "isdn_tty: Null-Message in isdn_tty_at_cout\n"); diff -Nru a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c --- a/drivers/isdn/icn/icn.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/icn/icn.c 2004-07-13 12:24:01 -07:00 @@ -798,7 +798,7 @@ #endif static int -icn_loadboot(u_char * buffer, icn_card * card) +icn_loadboot(u_char __user * buffer, icn_card * card) { int ret; u_char *codebuf; @@ -903,9 +903,9 @@ } static int -icn_loadproto(u_char * buffer, icn_card * card) +icn_loadproto(u_char __user * buffer, icn_card * card) { - register u_char *p = buffer; + register u_char __user *p = buffer; u_char codebuf[256]; uint left = ICN_CODE_STAGE2; uint cnt; @@ -916,7 +916,7 @@ #ifdef BOOT_DEBUG printk(KERN_DEBUG "icn_loadproto called\n"); #endif - if ((ret = verify_area(VERIFY_READ, (void *) buffer, ICN_CODE_STAGE2))) + if ((ret = verify_area(VERIFY_READ, buffer, ICN_CODE_STAGE2))) return ret; timer = 0; spin_lock_irqsave(&dev.devlock, flags); @@ -1007,18 +1007,15 @@ /* Read the Status-replies from the Interface */ static int -icn_readstatus(u_char * buf, int len, int user, icn_card * card) +icn_readstatus(u_char __user *buf, int len, icn_card * card) { int count; - u_char *p; + u_char __user *p; for (p = buf, count = 0; count < len; p++, count++) { if (card->msg_buf_read == card->msg_buf_write) return count; - if (user) - put_user(*card->msg_buf_read++, p); - else - *p = *card->msg_buf_read++; + put_user(*card->msg_buf_read++, p); if (card->msg_buf_read > card->msg_buf_end) card->msg_buf_read = card->msg_buf; } @@ -1163,10 +1160,12 @@ char cbuf[60]; isdn_ctrl cmd; icn_cdef cdef; + char __user *arg; switch (c->command) { case ISDN_CMD_IOCTL: memcpy(&a, c->parm.num, sizeof(ulong)); + arg = (char __user *)a; switch (c->arg) { case ICN_IOCTL_SETMMIO: if (dev.memaddr != (a & 0x0ffc000)) { @@ -1230,15 +1229,15 @@ case ICN_IOCTL_GETDOUBLE: return (int) card->doubleS0; case ICN_IOCTL_DEBUGVAR: - if (copy_to_user((char *)a, - (char *)&card, + if (copy_to_user(arg, + &card, sizeof(ulong))) return -EFAULT; a += sizeof(ulong); { ulong l = (ulong) & dev; - if (copy_to_user((char *)a, - (char *)&l, + if (copy_to_user(arg, + &l, sizeof(ulong))) return -EFAULT; } @@ -1249,20 +1248,20 @@ dev.firstload = 0; } icn_stopcard(card); - return (icn_loadboot((u_char *) a, card)); + return (icn_loadboot(arg, card)); case ICN_IOCTL_LOADPROTO: icn_stopcard(card); - if ((i = (icn_loadproto((u_char *) a, card)))) + if ((i = (icn_loadproto(arg, card)))) return i; if (card->doubleS0) - i = icn_loadproto((u_char *) (a + ICN_CODE_STAGE2), card->other); + i = icn_loadproto(arg + ICN_CODE_STAGE2, card->other); return i; break; case ICN_IOCTL_ADDCARD: if (!dev.firstload) return -EBUSY; - if (copy_from_user((char *)&cdef, - (char *)a, + if (copy_from_user(&cdef, + arg, sizeof(cdef))) return -EFAULT; return (icn_addcard(cdef.port, cdef.id1, cdef.id2)); @@ -1470,14 +1469,14 @@ } static int -if_writecmd(const u_char * buf, int len, int user, int id, int channel) +if_writecmd(const u_char __user *buf, int len, int id, int channel) { icn_card *card = icn_findcard(id); if (card) { if (!card->flags & ICN_FLAGS_RUNNING) return -ENODEV; - return (icn_writecmd(buf, len, user, card)); + return (icn_writecmd(buf, len, 1, card)); } printk(KERN_ERR "icn: if_writecmd called with invalid driverId!\n"); @@ -1485,14 +1484,14 @@ } static int -if_readstatus(u_char * buf, int len, int user, int id, int channel) +if_readstatus(u_char __user *buf, int len, int id, int channel) { icn_card *card = icn_findcard(id); if (card) { if (!card->flags & ICN_FLAGS_RUNNING) return -ENODEV; - return (icn_readstatus(buf, len, user, card)); + return (icn_readstatus(buf, len, card)); } printk(KERN_ERR "icn: if_readstatus called with invalid driverId!\n"); diff -Nru a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c --- a/drivers/isdn/isdnloop/isdnloop.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/isdnloop/isdnloop.c 2004-07-13 12:24:00 -07:00 @@ -443,18 +443,15 @@ * number of bytes actually transferred. */ static int -isdnloop_readstatus(u_char * buf, int len, int user, isdnloop_card * card) +isdnloop_readstatus(u_char __user *buf, int len, isdnloop_card * card) { int count; - u_char *p; + u_char __user *p; for (p = buf, count = 0; count < len; p++, count++) { if (card->msg_buf_read == card->msg_buf_write) return count; - if (user) - put_user(*card->msg_buf_read++, p); - else - *p = *card->msg_buf_read++; + put_user(*card->msg_buf_read++, p); if (card->msg_buf_read > card->msg_buf_end) card->msg_buf_read = card->msg_buf; } @@ -1388,14 +1385,14 @@ } static int -if_writecmd(const u_char * buf, int len, int user, int id, int channel) +if_writecmd(const u_char __user *buf, int len, int id, int channel) { isdnloop_card *card = isdnloop_findcard(id); if (card) { if (!card->flags & ISDNLOOP_FLAGS_RUNNING) return -ENODEV; - return (isdnloop_writecmd(buf, len, user, card)); + return (isdnloop_writecmd(buf, len, 1, card)); } printk(KERN_ERR "isdnloop: if_writecmd called with invalid driverId!\n"); @@ -1403,14 +1400,14 @@ } static int -if_readstatus(u_char * buf, int len, int user, int id, int channel) +if_readstatus(u_char __user *buf, int len, int id, int channel) { isdnloop_card *card = isdnloop_findcard(id); if (card) { if (!card->flags & ISDNLOOP_FLAGS_RUNNING) return -ENODEV; - return (isdnloop_readstatus(buf, len, user, card)); + return (isdnloop_readstatus(buf, len, card)); } printk(KERN_ERR "isdnloop: if_readstatus called with invalid driverId!\n"); diff -Nru a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c --- a/drivers/isdn/pcbit/drv.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/pcbit/drv.c 2004-07-13 12:24:01 -07:00 @@ -57,9 +57,9 @@ */ int pcbit_command(isdn_ctrl* ctl); -int pcbit_stat(u_char* buf, int len, int user, int, int); +int pcbit_stat(u_char __user * buf, int len, int, int); int pcbit_xmit(int driver, int chan, int ack, struct sk_buff *skb); -int pcbit_writecmd(const u_char*, int, int, int, int); +int pcbit_writecmd(const u_char __user *, int, int, int); static int set_protocol_running(struct pcbit_dev * dev); @@ -389,12 +389,13 @@ return len; } -int pcbit_writecmd(const u_char* buf, int len, int user, int driver, int channel) +int pcbit_writecmd(const u_char __user *buf, int len, int driver, int channel) { struct pcbit_dev * dev; int i, j; const u_char * loadbuf; u_char * ptr = NULL; + u_char *cbuf; int errstat; @@ -415,37 +416,28 @@ return -EINVAL; } - if (user) - { - u_char *cbuf = kmalloc(len, GFP_KERNEL); - if (!cbuf) - return -ENOMEM; - - if (copy_from_user(cbuf, buf, len)) { - kfree(cbuf); - return -EFAULT; - } - memcpy_toio(dev->sh_mem, cbuf, len); + cbuf = kmalloc(len, GFP_KERNEL); + if (!cbuf) + return -ENOMEM; + + if (copy_from_user(cbuf, buf, len)) { kfree(cbuf); + return -EFAULT; } - else - memcpy_toio(dev->sh_mem, buf, len); + memcpy_toio(dev->sh_mem, cbuf, len); + kfree(cbuf); return len; case L2_FWMODE: /* this is the hard part */ /* dumb board */ - if (user) { - /* get it into kernel space */ - if ((ptr = kmalloc(len, GFP_KERNEL))==NULL) - return -ENOMEM; - if (copy_from_user(ptr, buf, len)) { - kfree(ptr); - return -EFAULT; - } - loadbuf = ptr; + /* get it into kernel space */ + if ((ptr = kmalloc(len, GFP_KERNEL))==NULL) + return -ENOMEM; + if (copy_from_user(ptr, buf, len)) { + kfree(ptr); + return -EFAULT; } - else - loadbuf = buf; + loadbuf = ptr; errstat = 0; @@ -468,9 +460,7 @@ if (dev->loadptr > LOAD_ZONE_END) dev->loadptr = LOAD_ZONE_START; } - - if (user) - kfree(ptr); + kfree(ptr); return errstat ? errstat : len; default: @@ -723,17 +713,7 @@ static int stat_st = 0; static int stat_end = 0; - -static __inline void -memcpy_to_COND(int flag, char *d, const char *s, int len) { - if (flag) - copy_to_user(d, s, len); - else - memcpy(d, s, len); -} - - -int pcbit_stat(u_char* buf, int len, int user, int driver, int channel) +int pcbit_stat(u_char __user *buf, int len, int driver, int channel) { int stat_count; stat_count = stat_end - stat_st; @@ -747,24 +727,23 @@ if (stat_st < stat_end) { - memcpy_to_COND(user, buf, statbuf + stat_st, len); + copy_to_user(buf, statbuf + stat_st, len); stat_st += len; } else { if (len > STATBUF_LEN - stat_st) { - memcpy_to_COND(user, buf, statbuf + stat_st, + copy_to_user(buf, statbuf + stat_st, STATBUF_LEN - stat_st); - memcpy_to_COND(user, buf, statbuf, + copy_to_user(buf, statbuf, len - (STATBUF_LEN - stat_st)); stat_st = len - (STATBUF_LEN - stat_st); } else { - memcpy_to_COND(user, buf, statbuf + stat_st, - len); + copy_to_user(buf, statbuf + stat_st, len); stat_st += len; diff -Nru a/drivers/isdn/pcbit/module.c b/drivers/isdn/pcbit/module.c --- a/drivers/isdn/pcbit/module.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/pcbit/module.c 2004-07-13 12:24:01 -07:00 @@ -25,11 +25,11 @@ MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i"); -static int mem[MAX_PCBIT_CARDS] = {0, }; -static int irq[MAX_PCBIT_CARDS] = {0, }; +static int mem[MAX_PCBIT_CARDS]; +static int irq[MAX_PCBIT_CARDS]; static int num_boards; -struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, }; +struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS]; extern void pcbit_terminate(int board); extern int pcbit_init_dev(int board, int mem_base, int irq); diff -Nru a/drivers/isdn/sc/command.c b/drivers/isdn/sc/command.c --- a/drivers/isdn/sc/command.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/sc/command.c 2004-07-13 12:24:00 -07:00 @@ -117,7 +117,7 @@ scs_ioctl ioc; memcpy(&cmdptr, cmd->parm.num, sizeof(unsigned long)); - if (copy_from_user(&ioc, (scs_ioctl *)cmdptr, + if (copy_from_user(&ioc, (scs_ioctl __user *)cmdptr, sizeof(scs_ioctl))) { pr_debug("%s: Failed to verify user space 0x%x\n", sc_adapter[card]->devicename, cmdptr); @@ -215,7 +215,7 @@ status = sendmessage(card, CMPID,cmReqType2, cmReqClass0, cmReqStartProc, - 0,0,0); + 0,0,NULL); pr_debug("%s: Sent startProc\n", sc_adapter[card]->devicename); return status; diff -Nru a/drivers/isdn/sc/hardware.h b/drivers/isdn/sc/hardware.h --- a/drivers/isdn/sc/hardware.h 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/sc/hardware.h 2004-07-13 12:24:01 -07:00 @@ -105,7 +105,7 @@ */ /* Return the number of jiffies in a given number of msecs */ -#define milliseconds(x) (x/(1000/HZ)) +#define milliseconds(x) (((x)*HZ)/1000) /* Determine if a channel number is valid for the adapter */ #define IS_VALID_CHANNEL(y,x) ((x>0) && (x <= sc_adapter[y]->channels)) diff -Nru a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c --- a/drivers/isdn/sc/ioctl.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/sc/ioctl.c 2004-07-13 12:24:01 -07:00 @@ -72,7 +72,7 @@ /* * Get the SRec from user space */ - if (copy_from_user(srec, (char *) data->dataptr, sizeof(srec))) { + if (copy_from_user(srec, data->dataptr, sizeof(srec))) { kfree(rcvmsg); kfree(srec); return -EFAULT; @@ -118,8 +118,7 @@ /* * Get the switch type from user space */ - if (copy_from_user(&switchtype, (char *)data->dataptr, - sizeof(char))) { + if (copy_from_user(&switchtype, data->dataptr, sizeof(char))) { kfree(rcvmsg); return -EFAULT; } @@ -152,7 +151,7 @@ * Get the switch type from the board */ status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, - ceReqCallGetSwitchType, 0, 0, 0, rcvmsg, SAR_TIMEOUT); + ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT); if (!status && !(rcvmsg->rsp_status)) { pr_debug("%s: SCIOCGETSWITCH: command successful\n", sc_adapter[card]->devicename); @@ -169,7 +168,7 @@ /* * Package the switch type and send to user space */ - if (copy_to_user((char *)data->dataptr, &switchtype, + if (copy_to_user(data->dataptr, &switchtype, sizeof(char))) { kfree(rcvmsg); return -EFAULT; @@ -193,7 +192,7 @@ * Get the spid from the board */ status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSPID, - data->channel, 0, 0, rcvmsg, SAR_TIMEOUT); + data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); if (!status) { pr_debug("%s: SCIOCGETSPID: command successful\n", sc_adapter[card]->devicename); @@ -209,7 +208,7 @@ /* * Package the switch type and send to user space */ - if (copy_to_user((char *)data->dataptr, spid, SCIOC_SPIDSIZE)) { + if (copy_to_user(data->dataptr, spid, SCIOC_SPIDSIZE)) { kfree(spid); kfree(rcvmsg); return -EFAULT; @@ -234,7 +233,7 @@ /* * Get the spid from user space */ - if (copy_from_user(spid, (char *) data->dataptr, SCIOC_SPIDSIZE)) { + if (copy_from_user(spid, data->dataptr, SCIOC_SPIDSIZE)) { kfree(rcvmsg); return -EFAULT; } @@ -269,7 +268,7 @@ * Get the dn from the board */ status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber, - data->channel, 0, 0, rcvmsg, SAR_TIMEOUT); + data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); if (!status) { pr_debug("%s: SCIOCGETDN: command successful\n", sc_adapter[card]->devicename); @@ -292,7 +291,7 @@ /* * Package the dn and send to user space */ - if (copy_to_user((char *)data->dataptr, dn, SCIOC_DNSIZE)) { + if (copy_to_user(data->dataptr, dn, SCIOC_DNSIZE)) { kfree(dn); return -EFAULT; } @@ -313,7 +312,7 @@ /* * Get the spid from user space */ - if (copy_from_user(dn, (char *)data->dataptr, SCIOC_DNSIZE)) { + if (copy_from_user(dn, data->dataptr, SCIOC_DNSIZE)) { kfree(rcvmsg); kfree(dn); return -EFAULT; @@ -366,8 +365,7 @@ kfree(rcvmsg); GetStatus(card, bi); - if (copy_to_user((boardInfo *)data->dataptr, bi, - sizeof(boardInfo))) { + if (copy_to_user(data->dataptr, bi, sizeof(boardInfo))) { kfree(bi); return -EFAULT; } @@ -385,7 +383,7 @@ * Get the speed from the board */ status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, - ceReqCallGetCallType, data->channel, 0, 0, rcvmsg, SAR_TIMEOUT); + ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT); if (!status && !(rcvmsg->rsp_status)) { pr_debug("%s: SCIOCGETSPEED: command successful\n", sc_adapter[card]->devicename); @@ -405,7 +403,7 @@ * Package the switch type and send to user space */ - if (copy_to_user((char *) data->dataptr, &speed, sizeof(char))) + if (copy_to_user(data->dataptr, &speed, sizeof(char))) return -EFAULT; return 0; diff -Nru a/drivers/isdn/sc/scioc.h b/drivers/isdn/sc/scioc.h --- a/drivers/isdn/sc/scioc.h 2004-07-13 12:24:01 -07:00 +++ b/drivers/isdn/sc/scioc.h 2004-07-13 12:24:01 -07:00 @@ -27,7 +27,7 @@ int device; int channel; unsigned long command; - void *dataptr; + void __user *dataptr; } scs_ioctl; /* Size of strings */ diff -Nru a/drivers/isdn/tpam/tpam.h b/drivers/isdn/tpam/tpam.h --- a/drivers/isdn/tpam/tpam.h 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/tpam/tpam.h 2004-07-13 12:24:00 -07:00 @@ -173,8 +173,8 @@ extern void copy_to_pam(tpam_card *, void *, const void *, u32); extern u32 copy_from_pam_dword(tpam_card *, const void *); extern void copy_from_pam(tpam_card *, void *, const void *, u32); -extern int copy_from_pam_to_user(tpam_card *, void *, const void *, u32); -extern int copy_from_user_to_pam(tpam_card *, void *, const void *, u32); +extern int copy_from_pam_to_user(tpam_card *, void __user *, const void *, u32); +extern int copy_from_user_to_pam(tpam_card *, void *, const void __user *, u32); extern int tpam_verify_area(u32, u32); /* Function prototypes from tpam_nco.c */ diff -Nru a/drivers/isdn/tpam/tpam_commands.c b/drivers/isdn/tpam/tpam_commands.c --- a/drivers/isdn/tpam/tpam_commands.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/isdn/tpam/tpam_commands.c 2004-07-13 12:24:00 -07:00 @@ -120,7 +120,7 @@ dprintk("TurboPAM(tpam_command_ioctl_dspload): card=%d\n", card->id); /* get the IOCTL parameter from userspace */ - if (copy_from_user(&tdl, (void *)arg, sizeof(tpam_dsp_ioctl))) + if (copy_from_user(&tdl, (void __user *)arg, sizeof(tpam_dsp_ioctl))) return -EFAULT; /* if the board's firmware was started, protect against writes @@ -131,7 +131,7 @@ /* write the data in the board's memory */ return copy_from_user_to_pam(card, (void *)tdl.address, - (void *)arg + sizeof(tpam_dsp_ioctl), + (void __user *)arg + sizeof(tpam_dsp_ioctl), tdl.data_len); } @@ -150,7 +150,7 @@ dprintk("TurboPAM(tpam_command_ioctl_dspsave): card=%d\n", card->id); /* get the IOCTL parameter from userspace */ - if (copy_from_user(&tdl, (void *)arg, sizeof(tpam_dsp_ioctl))) + if (copy_from_user(&tdl, (void __user *)arg, sizeof(tpam_dsp_ioctl))) return -EFAULT; /* protect against read from unallowed memory areas */ @@ -158,7 +158,7 @@ return -EPERM; /* read the data from the board's memory */ - return copy_from_pam_to_user(card, (void *)arg + sizeof(tpam_dsp_ioctl), + return copy_from_pam_to_user(card, (void __user *)arg + sizeof(tpam_dsp_ioctl), (void *)tdl.address, tdl.data_len); } 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-13 12:24:00 -07:00 +++ b/drivers/isdn/tpam/tpam_memory.c 2004-07-13 12:24:00 -07:00 @@ -125,7 +125,7 @@ * * Return: 0 if OK, <0 if error. */ -int copy_from_pam_to_user(tpam_card *card, void *to, const void *from, u32 n) { +int copy_from_pam_to_user(tpam_card *card, void __user *to, const void *from, u32 n) { void *page; u32 count; @@ -171,7 +171,7 @@ * * Return: 0 if OK, <0 if error. */ -int copy_from_user_to_pam(tpam_card *card, void *to, const void *from, u32 n) { +int copy_from_user_to_pam(tpam_card *card, void *to, const void __user *from, u32 n) { void *page; u32 count; diff -Nru a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c --- a/drivers/md/kcopyd.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/md/kcopyd.c 2004-07-13 12:24:00 -07:00 @@ -84,7 +84,7 @@ ; kc->pages = pl->next; - pl->next = 0; + pl->next = NULL; spin_unlock(&kc->lock); diff -Nru a/drivers/media/common/saa7146_vbi.c b/drivers/media/common/saa7146_vbi.c --- a/drivers/media/common/saa7146_vbi.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/common/saa7146_vbi.c 2004-07-13 12:24:00 -07:00 @@ -459,7 +459,7 @@ spin_unlock(&dev->slock); } -static ssize_t vbi_read(struct file *file, char *data, size_t count, loff_t *ppos) +static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; diff -Nru a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c --- a/drivers/media/common/saa7146_video.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/common/saa7146_video.c 2004-07-13 12:24:01 -07:00 @@ -1450,7 +1450,7 @@ spin_unlock(&dev->slock); } -static ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos) +static ssize_t video_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; diff -Nru a/drivers/media/dvb/b2c2/skystar2.c b/drivers/media/dvb/b2c2/skystar2.c --- a/drivers/media/dvb/b2c2/skystar2.c 2004-07-13 12:24:02 -07:00 +++ b/drivers/media/dvb/b2c2/skystar2.c 2004-07-13 12:24:02 -07:00 @@ -208,7 +208,7 @@ i2c_main_setup(device, chip_addr, 0, addr, buf[0], len, &command); - return i2c_main_write_for_flex2(adapter, command, 0, 100000); + return i2c_main_write_for_flex2(adapter, command, NULL, 100000); } static void fixchipaddr(u32 device, u32 bus, u32 addr, u32 *ret) @@ -1681,7 +1681,7 @@ adapter->dmaq1.head = 0; adapter->dmaq1.tail = 0; - adapter->dmaq1.buffer = 0; + adapter->dmaq1.buffer = NULL; adapter->dmaq1.buffer = pci_alloc_consistent(adapter->pdev, SIZE_OF_BUF_DMA1 + 0x80, &dma_addr); @@ -1707,7 +1707,7 @@ adapter->dmaq2.head = 0; adapter->dmaq2.tail = 0; - adapter->dmaq2.buffer = 0; + adapter->dmaq2.buffer = NULL; adapter->dmaq2.buffer = pci_alloc_consistent(adapter->pdev, SIZE_OF_BUF_DMA2 + 0x80, &dma_addr); @@ -1738,7 +1738,7 @@ adapter->dmaq1.head = 0; adapter->dmaq1.tail = 0; adapter->dmaq1.buffer_size = 0; - adapter->dmaq1.buffer = 0; + adapter->dmaq1.buffer = NULL; } if (adapter->dmaq2.buffer != 0) { @@ -1748,7 +1748,7 @@ adapter->dmaq2.head = 0; adapter->dmaq2.tail = 0; adapter->dmaq2.buffer_size = 0; - adapter->dmaq2.buffer = 0; + adapter->dmaq2.buffer = NULL; } } @@ -2272,7 +2272,7 @@ dvbdemux->feednum = N_PID_SLOTS; dvbdemux->start_feed = dvb_start_feed; dvbdemux->stop_feed = dvb_stop_feed; - dvbdemux->write_to_decoder = 0; + dvbdemux->write_to_decoder = NULL; dvbdemux->dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING); dvb_dmx_init(&adapter->demux); diff -Nru a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c 2004-07-13 12:24:00 -07:00 @@ -205,7 +205,7 @@ if (NULL == dev) { /* shoudn't happen with 2.6.0-test7 + newer */ printk("attach: Huh? i2c adapter not in sysfs tree?\n"); - return 0; + return NULL; } pci = to_pci_dev(dev); list_for_each(item, &card_list) { diff -Nru a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c --- a/drivers/media/dvb/dvb-core/dmxdev.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/dvb-core/dmxdev.c 2004-07-13 12:24:01 -07:00 @@ -54,7 +54,7 @@ static inline void dvb_dmxdev_buffer_init(struct dmxdev_buffer *buffer) { - buffer->data=0; + buffer->data=NULL; buffer->size=8192; buffer->pread=0; buffer->pwrite=0; @@ -97,7 +97,7 @@ } static ssize_t dvb_dmxdev_buffer_read(struct dmxdev_buffer *src, - int non_blocking, char *buf, size_t count, loff_t *ppos) + int non_blocking, char __user *buf, size_t count, loff_t *ppos) { unsigned long todo=count; int split, avail, error; @@ -162,12 +162,12 @@ head=demux->get_frontends(demux); if (!head) - return 0; + return NULL; list_for_each(pos, head) if (DMX_FE_ENTRY(pos)->source==type) return DMX_FE_ENTRY(pos); - return 0; + return NULL; } static inline void dvb_dmxdev_dvr_state_set(struct dmxdev_dvr *dmxdevdvr, int state) @@ -244,7 +244,7 @@ void *mem=dmxdev->dvr_buffer.data; mb(); spin_lock_irq(&dmxdev->lock); - dmxdev->dvr_buffer.data=0; + dmxdev->dvr_buffer.data=NULL; spin_unlock_irq(&dmxdev->lock); vfree(mem); } @@ -253,7 +253,7 @@ return 0; } -static ssize_t dvb_dvr_write(struct file *file, const char *buf, +static ssize_t dvb_dvr_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; @@ -271,7 +271,7 @@ return ret; } -static ssize_t dvb_dvr_read(struct file *file, char *buf, size_t count, +static ssize_t dvb_dvr_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; @@ -304,7 +304,7 @@ return -EBUSY; spin_lock_irq(&dmxdevfilter->dev->lock); mem=buf->data; - buf->data=0; + buf->data=NULL; buf->size=size; buf->pwrite=buf->pread=0; spin_unlock_irq(&dmxdevfilter->dev->lock); @@ -497,7 +497,7 @@ release_filter(dmxdevfilter->feed.sec, dmxdevfilter->filter.sec); dvb_dmxdev_feed_restart(dmxdevfilter); - dmxdevfilter->feed.sec=0; + dmxdevfilter->feed.sec=NULL; break; case DMXDEV_TYPE_PES: if (!dmxdevfilter->feed.ts) @@ -506,7 +506,7 @@ dmxdevfilter->dev->demux-> release_ts_feed(dmxdevfilter->dev->demux, dmxdevfilter->feed.ts); - dmxdevfilter->feed.ts=0; + dmxdevfilter->feed.ts=NULL; break; default: if (dmxdevfilter->state==DMXDEV_STATE_ALLOCATED) @@ -558,8 +558,8 @@ struct dmx_section_filter **secfilter=&filter->filter.sec; struct dmx_section_feed **secfeed=&filter->feed.sec; - *secfilter=0; - *secfeed=0; + *secfilter=NULL; + *secfeed=NULL; /* find active filter/feed with same PID */ for (i=0; ifilternum; i++) { @@ -640,7 +640,7 @@ enum dmx_ts_pes ts_pes; struct dmx_ts_feed **tsfeed = &filter->feed.ts; - filter->feed.ts = 0; + filter->feed.ts = NULL; otype=para->output; ts_pes=(enum dmx_ts_pes) para->pes_type; @@ -717,7 +717,7 @@ dvb_dmxdev_buffer_init(&dmxdevfilter->buffer); dmxdevfilter->type=DMXDEV_TYPE_NONE; dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_ALLOCATED); - dmxdevfilter->feed.ts=0; + dmxdevfilter->feed.ts=NULL; init_timer(&dmxdevfilter->timer); up(&dmxdev->mutex); @@ -742,7 +742,7 @@ void *mem=dmxdevfilter->buffer.data; spin_lock_irq(&dmxdev->lock); - dmxdevfilter->buffer.data=0; + dmxdevfilter->buffer.data=NULL; spin_unlock_irq(&dmxdev->lock); vfree(mem); } @@ -806,7 +806,7 @@ } static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil, - struct file *file, char *buf, size_t count, loff_t *ppos) + struct file *file, char __user *buf, size_t count, loff_t *ppos) { int result, hcount; int done=0; @@ -845,7 +845,7 @@ ssize_t -dvb_demux_read(struct file *file, char *buf, size_t count, loff_t *ppos) +dvb_demux_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct dmxdev_filter *dmxdevfilter=dvb_dmxdev_file_to_filter(file); int ret=0; @@ -1006,7 +1006,7 @@ }; static struct dvb_device dvbdev_demux = { - .priv = 0, + .priv = NULL, .users = 1, .writers = 1, .fops = &dvb_demux_fops @@ -1077,7 +1077,7 @@ }; static struct dvb_device dvbdev_dvr = { - .priv = 0, + .priv = NULL, .users = 1, .writers = 1, .fops = &dvb_dvr_fops @@ -1106,10 +1106,10 @@ spin_lock_init(&dmxdev->lock); for (i=0; ifilternum; i++) { dmxdev->filter[i].dev=dmxdev; - dmxdev->filter[i].buffer.data=0; + dmxdev->filter[i].buffer.data=NULL; dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE); dmxdev->dvr[i].dev=dmxdev; - dmxdev->dvr[i].buffer.data=0; + dmxdev->dvr[i].buffer.data=NULL; dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE); dvb_dmxdev_dvr_state_set(&dmxdev->dvr[i], DMXDEV_STATE_FREE); } @@ -1128,11 +1128,11 @@ dvb_unregister_device(dmxdev->dvr_dvbdev); if (dmxdev->filter) { vfree(dmxdev->filter); - dmxdev->filter=0; + dmxdev->filter=NULL; } if (dmxdev->dvr) { vfree(dmxdev->dvr); - dmxdev->dvr=0; + dmxdev->dvr=NULL; } dmxdev->demux->close(dmxdev->demux); } diff -Nru a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 2004-07-13 12:24:00 -07:00 @@ -621,7 +621,7 @@ /* OK, add it to the receive buffer, or copy into external buffer if supplied */ if (ebuf == NULL) { - dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read, 0); + dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read); } else { memcpy(ebuf, buf, bytes_read); } @@ -1188,7 +1188,7 @@ * * @return Number of bytes read, or <0 on error. */ -static ssize_t dvb_ca_en50221_io_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +static ssize_t dvb_ca_en50221_io_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; struct dvb_ca_private *ca=(struct dvb_ca_private*) dvbdev->priv; @@ -1303,7 +1303,7 @@ * * @return Number of bytes read, or <0 on error. */ -static ssize_t dvb_ca_en50221_io_read(struct file *file, char *buf, size_t count, loff_t *ppos) +static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; struct dvb_ca_private *ca=(struct dvb_ca_private*) dvbdev->priv; @@ -1494,7 +1494,7 @@ }; static struct dvb_device dvbdev_ca = { - priv: 0, + priv: NULL, users: 1, readers: 1, writers: 1, diff -Nru a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c --- a/drivers/media/dvb/dvb-core/dvb_demux.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/dvb/dvb-core/dvb_demux.c 2004-07-13 12:24:00 -07:00 @@ -160,7 +160,7 @@ feed->peslen += count; - return feed->cb.ts (&buf[p], count, 0, 0, &feed->feed.ts, DMX_OK); + return feed->cb.ts (&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK); } @@ -183,7 +183,7 @@ return 0; return feed->cb.sec (feed->feed.sec.secbuf, feed->feed.sec.seclen, - 0, 0, &f->filter, DMX_OK); + NULL, 0, &f->filter, DMX_OK); } @@ -373,7 +373,7 @@ if (feed->ts_type & TS_PAYLOAD_ONLY) dvb_dmx_swfilter_payload(feed, buf); else - feed->cb.ts(buf, 188, 0, 0, &feed->feed.ts, DMX_OK); + feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); } if (feed->ts_type & TS_DECODER) if (feed->demux->write_to_decoder) @@ -422,7 +422,7 @@ } if (feed->pid == 0x2000) - feed->cb.ts(buf, 188, 0, 0, &feed->feed.ts, DMX_OK); + feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); } } @@ -637,7 +637,7 @@ if (feed->buffer_size) { #ifdef NOBUFS - feed->buffer=0; + feed->buffer=NULL; #else feed->buffer = vmalloc(feed->buffer_size); if (!feed->buffer) { @@ -736,11 +736,11 @@ feed->demux = demux; feed->pid = 0xffff; feed->peslen = 0xfffa; - feed->buffer = 0; + feed->buffer = NULL; (*ts_feed) = &feed->feed.ts; (*ts_feed)->parent = dmx; - (*ts_feed)->priv = 0; + (*ts_feed)->priv = NULL; (*ts_feed)->is_filtering = 0; (*ts_feed)->start_filtering = dmx_ts_feed_start_filtering; (*ts_feed)->stop_filtering = dmx_ts_feed_stop_filtering; @@ -820,7 +820,7 @@ spin_lock_irq(&dvbdemux->lock); *filter=&dvbdmxfilter->filter; (*filter)->parent=feed; - (*filter)->priv=0; + (*filter)->priv=NULL; dvbdmxfilter->feed=dvbdmxfeed; dvbdmxfilter->type=DMX_TYPE_SEC; dvbdmxfilter->state=DMX_STATE_READY; @@ -858,7 +858,7 @@ dvbdmxfeed->feed.sec.check_crc=check_crc; #ifdef NOBUFS - dvbdmxfeed->buffer=0; + dvbdmxfeed->buffer=NULL; #else dvbdmxfeed->buffer=vmalloc(dvbdmxfeed->buffer_size); if (!dvbdmxfeed->buffer) { @@ -1015,13 +1015,13 @@ dvbdmxfeed->feed.sec.secbuf = dvbdmxfeed->feed.sec.secbuf_base; dvbdmxfeed->feed.sec.secbufp = dvbdmxfeed->feed.sec.seclen = 0; dvbdmxfeed->feed.sec.tsfeedp = 0; - dvbdmxfeed->filter=0; - dvbdmxfeed->buffer=0; + dvbdmxfeed->filter=NULL; + dvbdmxfeed->buffer=NULL; (*feed)=&dvbdmxfeed->feed.sec; (*feed)->is_filtering=0; (*feed)->parent=demux; - (*feed)->priv=0; + (*feed)->priv=NULL; (*feed)->set=dmx_section_feed_set; (*feed)->allocate_filter=dmx_section_feed_allocate_filter; @@ -1223,7 +1223,7 @@ if (!dvbdemux->memcopy) dvbdemux->memcopy = dvb_dmx_memcopy; - dmx->frontend=0; + dmx->frontend=NULL; dmx->reg_list.prev = dmx->reg_list.next = &dmx->reg_list; dmx->priv=(void *) dvbdemux; dmx->open=dvbdmx_open; diff -Nru a/drivers/media/dvb/dvb-core/dvb_functions.c b/drivers/media/dvb/dvb-core/dvb_functions.c --- a/drivers/media/dvb/dvb-core/dvb_functions.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/dvb-core/dvb_functions.c 2004-07-13 12:24:01 -07:00 @@ -36,7 +36,7 @@ /* Copy arguments into temp kernel buffer */ switch (_IOC_DIR(cmd)) { case _IOC_NONE: - parg = (void *)arg; + parg = NULL; break; case _IOC_READ: /* some v4l ioctls are marked wrong ... */ case _IOC_WRITE: @@ -52,7 +52,7 @@ } err = -EFAULT; - if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd))) + if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) goto out; break; } @@ -69,7 +69,7 @@ { case _IOC_READ: case (_IOC_WRITE | _IOC_READ): - if (copy_to_user((void *)arg, parg, _IOC_SIZE(cmd))) + if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) err = -EFAULT; break; } diff -Nru a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c --- a/drivers/media/dvb/dvb-core/dvb_net.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/dvb/dvb-core/dvb_net.c 2004-07-13 12:24:00 -07:00 @@ -677,7 +677,7 @@ struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv; int ret; - *secfilter=0; + *secfilter=NULL; ret = priv->secfeed->allocate_filter(priv->secfeed, secfilter); if (ret<0) { printk("%s: could not get filter\n", dev->name); @@ -726,9 +726,9 @@ if (priv->secfeed || priv->secfilter || priv->multi_secfilter[0]) printk("%s: BUG %d\n", __FUNCTION__, __LINE__); - priv->secfeed=0; - priv->secfilter=0; - priv->tsfeed = 0; + priv->secfeed=NULL; + priv->secfilter=NULL; + priv->tsfeed = NULL; if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { dprintk("%s: alloc secfeed\n", __FUNCTION__); @@ -744,7 +744,7 @@ if (ret<0) { printk("%s: could not set section feed\n", dev->name); priv->demux->release_section_feed(priv->demux, priv->secfeed); - priv->secfeed=0; + priv->secfeed=NULL; return ret; } @@ -799,7 +799,7 @@ if (ret < 0) { printk("%s: could not set ts feed\n", dev->name); priv->demux->release_ts_feed(priv->demux, priv->tsfeed); - priv->tsfeed = 0; + priv->tsfeed = NULL; return ret; } @@ -828,7 +828,7 @@ dprintk("%s: release secfilter\n", __FUNCTION__); priv->secfeed->release_filter(priv->secfeed, priv->secfilter); - priv->secfilter=0; + priv->secfilter=NULL; } for (i=0; imulti_num; i++) { @@ -837,12 +837,12 @@ __FUNCTION__, i); priv->secfeed->release_filter(priv->secfeed, priv->multi_secfilter[i]); - priv->multi_secfilter[i]=0; + priv->multi_secfilter[i]=NULL; } } priv->demux->release_section_feed(priv->demux, priv->secfeed); - priv->secfeed=0; + priv->secfeed=NULL; } else printk("%s: no feed to stop\n", dev->name); } else if (priv->feedtype == DVB_NET_FEEDTYPE_ULE) { @@ -852,7 +852,7 @@ priv->tsfeed->stop_filtering(priv->tsfeed); } priv->demux->release_ts_feed(priv->demux, priv->tsfeed); - priv->tsfeed = 0; + priv->tsfeed = NULL; } else printk("%s: no ts feed to stop\n", dev->name); @@ -1178,16 +1178,13 @@ static struct file_operations dvb_net_fops = { .owner = THIS_MODULE, - .read = 0, - .write = 0, .ioctl = dvb_net_ioctl, .open = dvb_generic_open, .release = dvb_generic_release, - .poll = 0, }; static struct dvb_device dvbdev_net = { - .priv = 0, + .priv = NULL, .users = 1, .writers = 1, .fops = &dvb_net_fops, diff -Nru a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c --- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c 2004-07-13 12:24:01 -07:00 @@ -133,8 +133,7 @@ -ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, - size_t len, int usermem) +ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len) { size_t todo = len; size_t split; @@ -142,28 +141,18 @@ split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0; if (split > 0) { - if (!usermem) - memcpy(rbuf->data+rbuf->pwrite, buf, split); - else - if (copy_from_user(rbuf->data+rbuf->pwrite, - buf, split)) - return -EFAULT; + memcpy(rbuf->data+rbuf->pwrite, buf, split); buf += split; todo -= split; rbuf->pwrite = 0; } - if (!usermem) - memcpy(rbuf->data+rbuf->pwrite, buf, todo); - else - if (copy_from_user(rbuf->data+rbuf->pwrite, buf, todo)) - return -EFAULT; - + memcpy(rbuf->data+rbuf->pwrite, buf, todo); rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size; return len; } -ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len, int usermem) +ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len) { int status; ssize_t oldpwrite = rbuf->pwrite; @@ -171,7 +160,7 @@ DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8); DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff); DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY); - status = dvb_ringbuffer_write(rbuf, buf, len, usermem); + status = dvb_ringbuffer_write(rbuf, buf, len); if (status < 0) rbuf->pwrite = oldpwrite; return status; diff -Nru a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h --- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h 2004-07-13 12:24:01 -07:00 @@ -53,7 +53,7 @@ ** *** write bytes *** ** free = dvb_ringbuffer_free(rbuf); ** if (free >= buflen) -** count = dvb_ringbuffer_write(rbuf, buffer, buflen, 0); +** count = dvb_ringbuffer_write(rbuf, buffer, buflen); ** else ** ... ** @@ -121,7 +121,7 @@ ** returns number of bytes transferred or -EFAULT */ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, - size_t len, int usermem); + size_t len); /** @@ -130,11 +130,10 @@ * Ringbuffer to write to. * Buffer to write. * Length of buffer (currently limited to 65535 bytes max). - * Set to 1 if is in userspace. * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL. */ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, - size_t len, int usermem); + size_t len); /** * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c --- a/drivers/media/dvb/dvb-core/dvbdev.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/dvb/dvb-core/dvbdev.c 2004-07-13 12:24:00 -07:00 @@ -191,7 +191,7 @@ if ((id = dvbdev_get_free_id (adap, type)) < 0) { up (&dvbdev_register_lock); - *pdvbdev = 0; + *pdvbdev = NULL; printk ("%s: could get find free device id...\n", __FUNCTION__); return -ENFILE; } diff -Nru a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c --- a/drivers/media/dvb/frontends/tda1004x.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/dvb/frontends/tda1004x.c 2004-07-13 12:24:00 -07:00 @@ -538,7 +538,7 @@ static int tda10045h_init(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda_state) { - struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = 0,.len = 0 }; + struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = NULL,.len = 0 }; static u8 disable_mc44BC374c[] = { 0x1d, 0x74, 0xa0, 0x68 }; dprintk("%s\n", __FUNCTION__); @@ -576,7 +576,7 @@ static int tda10046h_init(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda_state) { - struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = 0,.len = 0 }; + struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = NULL,.len = 0 }; static u8 disable_mc44BC374c[] = { 0x1d, 0x74, 0xa0, 0x68 }; dprintk("%s\n", __FUNCTION__); @@ -1393,7 +1393,7 @@ int tuner_type = -1; struct tda1004x_state tda_state; struct tda1004x_state* ptda_state; - struct i2c_msg tuner_msg = {.addr=0, .flags=0, .buf=0, .len=0 }; + struct i2c_msg tuner_msg = {.addr=0, .flags=0, .buf=NULL, .len=0 }; static u8 td1344_init[] = { 0x0b, 0xf5, 0x88, 0xab }; static u8 td1316_init[] = { 0x0b, 0xf5, 0x85, 0xab }; static u8 td1316_init_tda10046h[] = { 0x0b, 0xf5, 0x80, 0xab }; diff -Nru a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c --- a/drivers/media/dvb/ttpci/av7110.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/ttpci/av7110.c 2004-07-13 12:24:01 -07:00 @@ -320,7 +320,7 @@ case DATA_PIPING: if (av7110->handle2filter[handle]) DvbDmxFilterCallback((u8 *)av7110->debi_virt, - av7110->debilen, 0, 0, + av7110->debilen, NULL, 0, av7110->handle2filter[handle], DMX_OK, av7110); spin_lock(&av7110->debilock); @@ -651,7 +651,7 @@ }; static struct dvb_device dvbdev_osd = { - .priv = 0, + .priv = NULL, .users = 1, .writers = 1, .fops = &dvb_osd_fops, @@ -928,7 +928,7 @@ !demux->pesfilter[feed->pes_type]) return -EINVAL; demux->pids[feed->pes_type] |= 0x8000; - demux->pesfilter[feed->pes_type] = 0; + demux->pesfilter[feed->pes_type] = NULL; } if (feed->ts_type & TS_DECODER && feed->pes_type < DMX_TS_PES_OTHER) { @@ -1402,7 +1402,7 @@ /* ARM "watchdog" */ init_waitqueue_head(&av7110->arm_wait); - av7110->arm_thread=0; + av7110->arm_thread=NULL; /* allocate and init buffers */ av7110->debi_virt = pci_alloc_consistent(dev->pci, 8192, diff -Nru a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c --- a/drivers/media/dvb/ttpci/av7110_av.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/dvb/ttpci/av7110_av.c 2004-07-13 12:24:00 -07:00 @@ -109,7 +109,7 @@ if (buf[3] == 0xe0) // video PES do not have a length in TS buf[4] = buf[5] = 0; if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY) - return dvbdmxfeed->cb.ts(buf, len, 0, 0, + return dvbdmxfeed->cb.ts(buf, len, NULL, 0, &dvbdmxfeed->feed.ts, DMX_OK); else return dvb_filter_pes2ts(p2t, buf, len, 1); @@ -121,7 +121,7 @@ // DEB_EE(("dvb_demux_feed:%p\n", dvbdmxfeed)); - dvbdmxfeed->cb.ts(data, 188, 0, 0, + dvbdmxfeed->cb.ts(data, 188, NULL, 0, &dvbdmxfeed->feed.ts, DMX_OK); return 0; } @@ -393,7 +393,7 @@ free = dvb_ringbuffer_free(rbuf); if (free > todo) free = todo; - dvb_ringbuffer_write(rbuf, buf, free, 0); + dvb_ringbuffer_write(rbuf, buf, free); todo -= free; buf += free; } @@ -424,8 +424,8 @@ #define FREE_COND (dvb_ringbuffer_free(&av7110->avout) >= 20 * 1024 && \ dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024) -static ssize_t dvb_play(struct av7110 *av7110, const u8 *buf, - unsigned long count, int nonblock, int type, int umem) +static ssize_t dvb_play(struct av7110 *av7110, const u8 __user *buf, + unsigned long count, int nonblock, int type) { unsigned long todo = count, n; DEB_EE(("av7110: %p\n", av7110)); @@ -447,22 +447,47 @@ n = todo; if (n > IPACKS * 2) n = IPACKS * 2; - if (umem) { - if (copy_from_user(av7110->kbuf[type], buf, n)) - return -EFAULT; - av7110_ipack_instant_repack(av7110->kbuf[type], n, - &av7110->ipack[type]); - } else { - av7110_ipack_instant_repack(buf, n, - &av7110->ipack[type]); + if (copy_from_user(av7110->kbuf[type], buf, n)) + return -EFAULT; + av7110_ipack_instant_repack(av7110->kbuf[type], n, + &av7110->ipack[type]); + todo -= n; + buf += n; + } + return count - todo; +} + +static ssize_t dvb_play_kernel(struct av7110 *av7110, const u8 *buf, + unsigned long count, int nonblock, int type) +{ + unsigned long todo = count, n; + DEB_EE(("av7110: %p\n", av7110)); + + if (!av7110->kbuf[type]) + return -ENOBUFS; + + if (nonblock && !FREE_COND) + return -EWOULDBLOCK; + + while (todo > 0) { + if (!FREE_COND) { + if (nonblock) + return count - todo; + if (wait_event_interruptible(av7110->avout.queue, + FREE_COND)) + return count - todo; } + n = todo; + if (n > IPACKS * 2) + n = IPACKS * 2; + av7110_ipack_instant_repack(buf, n, &av7110->ipack[type]); todo -= n; buf += n; } return count - todo; } -static ssize_t dvb_aplay(struct av7110 *av7110, const u8 *buf, +static ssize_t dvb_aplay(struct av7110 *av7110, const u8 __user *buf, unsigned long count, int nonblock, int type) { unsigned long todo = count, n; @@ -733,7 +758,7 @@ memcpy(obuf + l, buf + c, TS_SIZE - l); c = length; } - feed->cb.ts(obuf, 188, 0, 0, &feed->feed.ts, DMX_OK); + feed->cb.ts(obuf, 188, NULL, 0, &feed->feed.ts, DMX_OK); pes_start = 0; } } @@ -871,7 +896,7 @@ return mask; } -static ssize_t dvb_video_write(struct file *file, const char *buf, +static ssize_t dvb_video_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; @@ -885,7 +910,7 @@ if (av7110->videostate.stream_source != VIDEO_SOURCE_MEMORY) return -EPERM; - return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1, 1); + return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1); } static unsigned int dvb_audio_poll(struct file *file, poll_table *wait) @@ -907,7 +932,7 @@ return mask; } -static ssize_t dvb_audio_write(struct file *file, const char *buf, +static ssize_t dvb_audio_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; @@ -926,7 +951,7 @@ #define MIN_IFRAME 400000 -static int play_iframe(struct av7110 *av7110, u8 *buf, unsigned int len, int nonblock) +static int play_iframe(struct av7110 *av7110, u8 __user *buf, unsigned int len, int nonblock) { int i, n; @@ -942,10 +967,10 @@ n = MIN_IFRAME / len + 1; /* FIXME: nonblock? */ - dvb_play(av7110, iframe_header, sizeof(iframe_header), 0, 1, 0); + dvb_play_kernel(av7110, iframe_header, sizeof(iframe_header), 0, 1); for (i = 0; i < n; i++) - dvb_play(av7110, buf, len, 0, 1, 1); + dvb_play(av7110, buf, len, 0, 1); av7110_ipack_flush(&av7110->ipack[1]); return 0; @@ -1347,7 +1372,7 @@ }; static struct dvb_device dvbdev_video = { - .priv = 0, + .priv = NULL, .users = 6, .readers = 5, /* arbitrary */ .writers = 1, @@ -1365,7 +1390,7 @@ }; static struct dvb_device dvbdev_audio = { - .priv = 0, + .priv = NULL, .users = 1, .writers = 1, .fops = &dvb_audio_fops, diff -Nru a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c --- a/drivers/media/dvb/ttpci/av7110_ca.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/ttpci/av7110_ca.c 2004-07-13 12:24:01 -07:00 @@ -85,7 +85,7 @@ DVB_RINGBUFFER_WRITE_BYTE(cibuf, len >> 8); DVB_RINGBUFFER_WRITE_BYTE(cibuf, len & 0xff); - dvb_ringbuffer_write(cibuf, data, len, 0); + dvb_ringbuffer_write(cibuf, data, len); wake_up_interruptible(&cibuf->queue); } @@ -110,9 +110,9 @@ void ci_ll_release(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf) { vfree(cirbuf->data); - cirbuf->data = 0; + cirbuf->data = NULL; vfree(ciwbuf->data); - ciwbuf->data = 0; + ciwbuf->data = NULL; } int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file, @@ -133,7 +133,7 @@ for (i = 0; i < 2; i++) { if (slots & (1 << i)) { msg[2] = i; - dvb_ringbuffer_write(cibuf, msg, 8, 0); + dvb_ringbuffer_write(cibuf, msg, 8); slot[i].flags = 0; } } @@ -142,30 +142,46 @@ } static ssize_t ci_ll_write(struct dvb_ringbuffer *cibuf, struct file *file, - const char *buf, size_t count, loff_t *ppos) + const char __user *buf, size_t count, loff_t *ppos) { int free; int non_blocking = file->f_flags & O_NONBLOCK; + char *page = (char *)__get_free_page(GFP_USER); + int res; + if (!page) + return -ENOMEM; + + res = -EINVAL; if (count > 2048) - return -EINVAL; + goto out; + + res = -EFAULT; + if (copy_from_user(page, buf, count)) + goto out; + free = dvb_ringbuffer_free(cibuf); if (count + 2 > free) { + res = -EWOULDBLOCK; if (non_blocking) - return -EWOULDBLOCK; + goto out; + res = -ERESTARTSYS; if (wait_event_interruptible(cibuf->queue, (dvb_ringbuffer_free(cibuf) >= count + 2))) - return -ERESTARTSYS; + goto out; } DVB_RINGBUFFER_WRITE_BYTE(cibuf, count >> 8); DVB_RINGBUFFER_WRITE_BYTE(cibuf, count & 0xff); - return dvb_ringbuffer_write(cibuf, buf, count, 1); + res = dvb_ringbuffer_write(cibuf, page, count); +out: + free_page((unsigned long)page); + return res; } static ssize_t ci_ll_read(struct dvb_ringbuffer *cibuf, struct file *file, - char *buf, size_t count, loff_t *ppos) + char __user *buf, size_t count, loff_t *ppos) { int avail; int non_blocking = file->f_flags & O_NONBLOCK; @@ -301,7 +317,7 @@ return 0; } -static ssize_t dvb_ca_write(struct file *file, const char *buf, +static ssize_t dvb_ca_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; @@ -311,7 +327,7 @@ return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos); } -static ssize_t dvb_ca_read(struct file *file, char *buf, +static ssize_t dvb_ca_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; @@ -334,7 +350,7 @@ }; static struct dvb_device dvbdev_ca = { - .priv = 0, + .priv = NULL, .users = 1, .writers = 1, .fops = &dvb_ca_fops, diff -Nru a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c --- a/drivers/media/dvb/ttpci/av7110_hw.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/ttpci/av7110_hw.c 2004-07-13 12:24:01 -07:00 @@ -737,7 +737,7 @@ }; static inline int LoadBitmap(struct av7110 *av7110, u16 format, - u16 dx, u16 dy, int inc, u8* data) + u16 dx, u16 dy, int inc, u8 __user * data) { int bpp; int i; @@ -887,7 +887,7 @@ } static int OSDSetBlock(struct av7110 *av7110, int x0, int y0, - int x1, int y1, int inc, u8 *data) + int x1, int y1, int inc, u8 __user *data) { uint w, h, bpp, bpl, size, lpb, bnum, brest; int i; @@ -953,17 +953,32 @@ return 0; case OSD_SetPalette: { + int len = dc->x0-dc->color+1; + void *buf; + if (len <= 0) + return 0; + + buf = kmalloc(len * 4, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + if (copy_from_user(buf, dc->data, len * 4)) { + kfree(buf); + return -EFAULT; + } + if (FW_VERSION(av7110->arm_app) >= 0x2618) - OSDSetPalette(av7110, (u32 *)dc->data, dc->color, dc->x0); + OSDSetPalette(av7110, buf, dc->color, dc->x0); else { - int i, len = dc->x0-dc->color+1; - u8 *colors = (u8 *)dc->data; + int i; + u8 *colors = buf; for (i = 0; icolor + i, colors[i * 4], colors[i * 4 + 1], colors[i * 4 + 2], colors[i * 4 + 3]); } + kfree(buf); return 0; } case OSD_SetTrans: diff -Nru a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c --- a/drivers/media/dvb/ttpci/av7110_ir.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/dvb/ttpci/av7110_ir.c 2004-07-13 12:24:00 -07:00 @@ -138,7 +138,7 @@ } -static int av7110_ir_write_proc (struct file *file, const char *buffer, +static int av7110_ir_write_proc (struct file *file, const char __user *buffer, unsigned long count, void *data) { char *page; diff -Nru a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 2004-07-13 12:24:01 -07:00 @@ -1125,7 +1125,7 @@ ttusb->dvb_demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING; - ttusb->dvb_demux.priv = 0; + ttusb->dvb_demux.priv = NULL; #ifdef TTUSB_HWSECTIONS ttusb->dvb_demux.filternum = TTUSB_MAXFILTER; #else @@ -1134,7 +1134,7 @@ ttusb->dvb_demux.feednum = TTUSB_MAXCHANNEL; ttusb->dvb_demux.start_feed = ttusb_start_feed; ttusb->dvb_demux.stop_feed = ttusb_stop_feed; - ttusb->dvb_demux.write_to_decoder = 0; + ttusb->dvb_demux.write_to_decoder = NULL; if ((result = dvb_dmx_init(&ttusb->dvb_demux)) < 0) { printk("ttusb_dvb: dvb_dmx_init failed (errno = %d)\n", diff -Nru a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2004-07-13 12:24:01 -07:00 @@ -314,7 +314,7 @@ { struct ttusb_dec *dec = (struct ttusb_dec *)priv; - dec->audio_filter->feed->cb.ts(data, 188, 0, 0, + dec->audio_filter->feed->cb.ts(data, 188, NULL, 0, &dec->audio_filter->feed->feed.ts, DMX_OK); @@ -325,7 +325,7 @@ { struct ttusb_dec *dec = (struct ttusb_dec *)priv; - dec->video_filter->feed->cb.ts(data, 188, 0, 0, + dec->video_filter->feed->cb.ts(data, 188, NULL, 0, &dec->video_filter->feed->feed.ts, DMX_OK); @@ -378,7 +378,7 @@ u16 v_pes_payload_length; if (output_pva) { - dec->video_filter->feed->cb.ts(pva, length, 0, 0, + dec->video_filter->feed->cb.ts(pva, length, NULL, 0, &dec->video_filter->feed->feed.ts, DMX_OK); return; } @@ -439,7 +439,7 @@ case 0x02: /* MainAudioStream */ if (output_pva) { - dec->audio_filter->feed->cb.ts(pva, length, 0, 0, + dec->audio_filter->feed->cb.ts(pva, length, NULL, 0, &dec->audio_filter->feed->feed.ts, DMX_OK); return; } 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-13 12:24:00 -07:00 +++ b/drivers/media/radio/miropcm20-radio.c 2004-07-13 12:24:00 -07:00 @@ -61,7 +61,7 @@ freql = freq & 0xff; freqh = freq >> 8; - aci_rds_cmd(RDS_RESET, 0, 0); + aci_rds_cmd(RDS_RESET, NULL, 0); pcm20_stereo(dev, 1); return aci_rw_cmd(ACI_WRITE_TUNE, freql, freqh); diff -Nru a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c --- a/drivers/media/radio/miropcm20-rds.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/radio/miropcm20-rds.c 2004-07-13 12:24:00 -07:00 @@ -53,7 +53,7 @@ } } -static ssize_t rds_f_read(struct file *file, char *buffer, size_t length, loff_t *offset) +static ssize_t rds_f_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) { // i = sprintf(text_buffer, "length: %d, offset: %d\n", length, *offset); diff -Nru a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c --- a/drivers/media/radio/radio-cadet.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/radio/radio-cadet.c 2004-07-13 12:24:00 -07:00 @@ -323,7 +323,7 @@ -static ssize_t cadet_read(struct file *file, char *data, +static ssize_t cadet_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { int i=0; diff -Nru a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c --- a/drivers/media/radio/radio-gemtek.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/radio/radio-gemtek.c 2004-07-13 12:24:00 -07:00 @@ -194,7 +194,7 @@ } case VIDIOCGAUDIO: { - struct video_audio *v = 0; + struct video_audio *v = arg; memset(v,0, sizeof(*v)); v->flags|=VIDEO_AUDIO_MUTABLE; v->volume=1; diff -Nru a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c --- a/drivers/media/video/bttv-cards.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/bttv-cards.c 2004-07-13 12:24:01 -07:00 @@ -4063,7 +4063,7 @@ return; } - rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),0); + rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL); if (!(rc & PX_CFG_PXC200F)) { printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc); return; diff -Nru a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c --- a/drivers/media/video/bttv-driver.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/bttv-driver.c 2004-07-13 12:24:01 -07:00 @@ -1068,7 +1068,7 @@ init_irqreg(btv); } -extern void bttv_reinit_bt848(struct bttv *btv) +void bttv_reinit_bt848(struct bttv *btv) { unsigned long flags; @@ -2261,7 +2261,7 @@ w2.w.width = win->width; w2.w.height = win->height; w2.clipcount = win->clipcount; - w2.clips = (struct v4l2_clip*)win->clips; + w2.clips = (struct v4l2_clip __user *)win->clips; retval = setup_window(fh, btv, &w2, 0); if (0 == retval) { /* on v4l1 this ioctl affects the read() size too */ @@ -2821,7 +2821,7 @@ } } -static ssize_t bttv_read(struct file *file, char *data, +static ssize_t bttv_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { struct bttv_fh *fh = file->private_data; diff -Nru a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c --- a/drivers/media/video/bw-qcam.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/video/bw-qcam.c 2004-07-13 12:24:00 -07:00 @@ -599,7 +599,7 @@ * n=2^(bit depth)-1. Ask me for more details if you don't understand * this. */ -long qc_capture(struct qcam_device * q, char *buf, unsigned long len) +long qc_capture(struct qcam_device * q, char __user *buf, unsigned long len) { int i, j, k, yield; int bytes; @@ -660,7 +660,7 @@ } pixels_read += bytes; } - (void) qc_readbytes(q, 0); /* reset state machine */ + (void) qc_readbytes(q, NULL); /* reset state machine */ /* Grabbing an entire frame from the quickcam is a lengthy process. We don't (usually) want to busy-block the @@ -855,7 +855,7 @@ return video_usercopy(inode, file, cmd, arg, qcam_do_ioctl); } -static ssize_t qcam_read(struct file *file, char *buf, +static ssize_t qcam_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct video_device *v = video_devdata(file); diff -Nru a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c --- a/drivers/media/video/c-qcam.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/c-qcam.c 2004-07-13 12:24:01 -07:00 @@ -358,7 +358,7 @@ #define BUFSZ 150 -static long qc_capture(struct qcam_device *q, char *buf, unsigned long len) +static long qc_capture(struct qcam_device *q, char __user *buf, unsigned long len) { unsigned lines, pixelsperline, bitsperxfer; unsigned int is_bi_dir = q->bidirectional; @@ -667,7 +667,7 @@ return video_usercopy(inode, file, cmd, arg, qcam_do_ioctl); } -static ssize_t qcam_read(struct file *file, char *buf, +static ssize_t qcam_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct video_device *v = video_devdata(file); diff -Nru a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c --- a/drivers/media/video/cpia.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/cpia.c 2004-07-13 12:24:01 -07:00 @@ -585,7 +585,7 @@ return ret; } -static int cpia_write_proc(struct file *file, const char *buf, +static int cpia_write_proc(struct file *file, const char __user *buf, unsigned long count, void *data) { struct cam_data *cam = data; @@ -1400,7 +1400,7 @@ static void proc_cpia_create(void) { - cpia_proc_root = create_proc_entry("cpia", S_IFDIR, 0); + cpia_proc_root = create_proc_entry("cpia", S_IFDIR, NULL); if (cpia_proc_root) cpia_proc_root->owner = THIS_MODULE; @@ -1410,7 +1410,7 @@ static void __exit proc_cpia_destroy(void) { - remove_proc_entry("cpia", 0); + remove_proc_entry("cpia", NULL); } #endif /* CONFIG_PROC_FS */ @@ -1624,7 +1624,7 @@ int i; rvfree(cam->frame_buf, FRAME_NUM*CPIA_MAX_FRAME_SIZE); - cam->frame_buf = 0; + cam->frame_buf = NULL; for (i=0; i < FRAME_NUM; i++) cam->frame[i].data = NULL; @@ -3299,7 +3299,7 @@ return 0; } -static ssize_t cpia_read(struct file *file, char *buf, +static ssize_t cpia_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct video_device *dev = file->private_data; diff -Nru a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c --- a/drivers/media/video/cx88/cx88-video.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/cx88/cx88-video.c 2004-07-13 12:24:01 -07:00 @@ -1279,7 +1279,7 @@ } static ssize_t -video_read(struct file *file, char *data, size_t count, loff_t *ppos) +video_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { struct cx8800_fh *fh = file->private_data; diff -Nru a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c --- a/drivers/media/video/dpc7146.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/video/dpc7146.c 2004-07-13 12:24:00 -07:00 @@ -91,7 +91,7 @@ /* fixme: add vbi stuff here */ static int dpc_probe(struct saa7146_dev* dev) { - struct dpc* dpc = 0; + struct dpc* dpc = NULL; struct i2c_client *client; struct list_head *item; diff -Nru a/drivers/media/video/hexium_orion.c b/drivers/media/video/hexium_orion.c --- a/drivers/media/video/hexium_orion.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/hexium_orion.c 2004-07-13 12:24:01 -07:00 @@ -212,7 +212,7 @@ without eeprom */ static int hexium_probe(struct saa7146_dev *dev) { - struct hexium *hexium = 0; + struct hexium *hexium = NULL; union i2c_smbus_data data; int err = 0; diff -Nru a/drivers/media/video/meye.c b/drivers/media/video/meye.c --- a/drivers/media/video/meye.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/meye.c 2004-07-13 12:24:01 -07:00 @@ -203,7 +203,7 @@ PAGE_SIZE, meye.mchip_ptable_toc, meye.mchip_dmahandle); - meye.mchip_ptable_toc = 0; + meye.mchip_ptable_toc = NULL; meye.mchip_dmahandle = 0; return -1; } @@ -232,7 +232,7 @@ meye.mchip_dmahandle); memset(meye.mchip_ptable, 0, sizeof(meye.mchip_ptable)); - meye.mchip_ptable_toc = 0; + meye.mchip_ptable_toc = NULL; meye.mchip_dmahandle = 0; } diff -Nru a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c --- a/drivers/media/video/mxb.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/video/mxb.c 2004-07-13 12:24:00 -07:00 @@ -150,7 +150,7 @@ static int mxb_probe(struct saa7146_dev* dev) { - struct mxb* mxb = 0; + struct mxb* mxb = NULL; struct i2c_client *client; struct list_head *item; int result; diff -Nru a/drivers/media/video/pms.c b/drivers/media/video/pms.c --- a/drivers/media/video/pms.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/pms.c 2004-07-13 12:24:01 -07:00 @@ -625,7 +625,7 @@ } -static int pms_capture(struct pms_device *dev, char *buf, int rgb555, int count) +static int pms_capture(struct pms_device *dev, char __user *buf, int rgb555, int count) { int y; int dw = 2*dev->width; @@ -865,7 +865,7 @@ return video_usercopy(inode, file, cmd, arg, pms_do_ioctl); } -static int pms_read(struct file *file, char *buf, +static int pms_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct video_device *v = video_devdata(file); diff -Nru a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c --- a/drivers/media/video/saa5246a.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/video/saa5246a.c 2004-07-13 12:24:01 -07:00 @@ -485,73 +485,76 @@ static inline int saa5246a_get_page(struct saa5246a_device *t, vtx_pagereq_t *req) { - int start, end; + int start, end, size; + char *buf; + int err; if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS || req->start < 0 || req->start > req->end || req->end >= VTX_PAGESIZE) return -EINVAL; - /* Read "normal" part of page */ - end = min(req->end, VTX_PAGESIZE - 1); - if (i2c_senddata(t, SAA5246A_REGISTER_R8, - req->pgbuf | - R8_DO_NOT_CLEAR_MEMORY, + buf = kmalloc(VTX_PAGESIZE, GFP_KERNEL); + if (!buf) + return -ENOMEM; - ROW(req->start), + /* Read "normal" part of page */ + err = -EIO; - COLUMN(req->start), + end = min(req->end, VTX_PAGESIZE - 1); + if (i2c_senddata(t, SAA5246A_REGISTER_R8, + req->pgbuf | R8_DO_NOT_CLEAR_MEMORY, + ROW(req->start), COLUMN(req->start), COMMAND_END)) + goto out; + if (i2c_getdata(t, end - req->start + 1, buf)) + goto out; + err = -EFAULT; + if (copy_to_user(req->buffer, buf, end - req->start + 1)) + goto out; - COMMAND_END) || - i2c_getdata(t, end - req->start + 1, req->buffer)) - { - return -EIO; - } /* Always get the time from buffer 4, since this stupid SAA5246A only * updates the currently displayed buffer... */ - if (REQ_CONTAINS_TIME(req)) - { + if (REQ_CONTAINS_TIME(req)) { start = max(req->start, POS_TIME_START); end = min(req->end, POS_TIME_END); + size = end - start + 1; + err = -EINVAL; + if (size < 0) + goto out; + err = -EIO; if (i2c_senddata(t, SAA5246A_REGISTER_R8, - - R8_ACTIVE_CHAPTER_4 | - R8_DO_NOT_CLEAR_MEMORY, - - R9_CURSER_ROW_0, - - start, - - COMMAND_END) || - i2c_getdata(t, end - start + 1, - req->buffer + start - req->start)) - { - return -EIO; - } + R8_ACTIVE_CHAPTER_4 | R8_DO_NOT_CLEAR_MEMORY, + R9_CURSER_ROW_0, start, COMMAND_END)) + goto out; + if (i2c_getdata(t, size, buf)) + goto out; + err = -EFAULT; + if (copy_to_user(req->buffer + start - req->start, buf, size)) + goto out; } /* Insert the header from buffer 4 only, if acquisition circuit is still searching for a page */ - if (REQ_CONTAINS_HEADER(req) && t->is_searching[req->pgbuf]) - { + if (REQ_CONTAINS_HEADER(req) && t->is_searching[req->pgbuf]) { start = max(req->start, POS_HEADER_START); end = min(req->end, POS_HEADER_END); + size = end - start + 1; + err = -EINVAL; + if (size < 0) + goto out; + err = -EIO; if (i2c_senddata(t, SAA5246A_REGISTER_R8, - - R8_ACTIVE_CHAPTER_4 | - R8_DO_NOT_CLEAR_MEMORY, - - R9_CURSER_ROW_0, - - start, - - COMMAND_END) || - i2c_getdata(t, end - start + 1, - req->buffer + start - req->start)) - { - return -EIO; - } + R8_ACTIVE_CHAPTER_4 | R8_DO_NOT_CLEAR_MEMORY, + R9_CURSER_ROW_0, start, COMMAND_END)) + goto out; + if (i2c_getdata(t, end - start + 1, buf)) + goto out; + err = -EFAULT; + if (copy_to_user(req->buffer + start - req->start, buf, size)) + goto out; } - - return 0; + err = 0; +out: + kfree(buf); + return err; } /* Stops the acquisition circuit given in dau_no. The page buffer associated diff -Nru a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c --- a/drivers/media/video/saa7134/saa7134-oss.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/saa7134/saa7134-oss.c 2004-07-13 12:24:01 -07:00 @@ -281,7 +281,7 @@ return 0; } -static ssize_t dsp_read(struct file *file, char *buffer, +static ssize_t dsp_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) { struct saa7134_dev *dev = file->private_data; @@ -354,7 +354,7 @@ return ret; } -static ssize_t dsp_write(struct file *file, const char *buffer, +static ssize_t dsp_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { return -EINVAL; @@ -364,25 +364,27 @@ unsigned int cmd, unsigned long arg) { struct saa7134_dev *dev = file->private_data; + void __user *argp = (void __user *) arg; + int __user *p = argp; int val = 0; if (oss_debug > 1) saa7134_print_ioctl(dev->name,cmd); switch (cmd) { case OSS_GETVERSION: - return put_user(SOUND_VERSION, (int *)arg); + return put_user(SOUND_VERSION, p); case SNDCTL_DSP_GETCAPS: return 0; case SNDCTL_DSP_SPEED: - if (get_user(val, (int*)arg)) + if (get_user(val, p)) return -EFAULT; /* fall through */ case SOUND_PCM_READ_RATE: - return put_user(dev->oss.rate, (int*)arg); + return put_user(dev->oss.rate, p); case SNDCTL_DSP_STEREO: - if (get_user(val, (int*)arg)) + if (get_user(val, p)) return -EFAULT; down(&dev->oss.lock); dev->oss.channels = val ? 2 : 1; @@ -391,10 +393,10 @@ dsp_rec_start(dev); } up(&dev->oss.lock); - return put_user(dev->oss.channels-1, (int *)arg); + return put_user(dev->oss.channels-1, p); case SNDCTL_DSP_CHANNELS: - if (get_user(val, (int*)arg)) + if (get_user(val, p)) return -EFAULT; if (val != 1 && val != 2) return -EINVAL; @@ -407,15 +409,15 @@ up(&dev->oss.lock); /* fall through */ case SOUND_PCM_READ_CHANNELS: - return put_user(dev->oss.channels, (int *)arg); + return put_user(dev->oss.channels, p); case SNDCTL_DSP_GETFMTS: /* Returns a mask */ return put_user(AFMT_U8 | AFMT_S8 | AFMT_U16_LE | AFMT_U16_BE | - AFMT_S16_LE | AFMT_S16_BE, (int*)arg); + AFMT_S16_LE | AFMT_S16_BE, p); case SNDCTL_DSP_SETFMT: /* Selects ONE fmt */ - if (get_user(val, (int*)arg)) + if (get_user(val, p)) return -EFAULT; switch (val) { case AFMT_QUERY: @@ -434,7 +436,7 @@ dsp_rec_start(dev); } up(&dev->oss.lock); - return put_user(dev->oss.afmt,(int*)arg); + return put_user(dev->oss.afmt, p); default: return -EINVAL; } @@ -443,12 +445,12 @@ switch (dev->oss.afmt) { case AFMT_U8: case AFMT_S8: - return put_user(8, (int*)arg); + return put_user(8, p); case AFMT_U16_LE: case AFMT_U16_BE: case AFMT_S16_LE: case AFMT_S16_BE: - return put_user(16, (int*)arg); + return put_user(16, p); default: return -EINVAL; } @@ -464,15 +466,16 @@ up(&dev->oss.lock); return 0; case SNDCTL_DSP_GETBLKSIZE: - return put_user(dev->oss.blksize,(int*)arg); + return put_user(dev->oss.blksize, p); case SNDCTL_DSP_SETFRAGMENT: - if (get_user(val, (int*)arg)) + if (get_user(val, p)) return -EFAULT; if (dev->oss.recording_on) return -EBUSY; dsp_buffer_free(dev); - dsp_buffer_conf(dev,1 << (val & 0xffff), (arg >> 16) & 0xffff); + /* used to be arg >> 16 instead of val >> 16; fixed */ + dsp_buffer_conf(dev,1 << (val & 0xffff), (val >> 16) & 0xffff); dsp_buffer_init(dev); return 0; @@ -487,7 +490,7 @@ info.fragstotal = dev->oss.blocks; info.bytes = dev->oss.read_count; info.fragments = info.bytes / info.fragsize; - if (copy_to_user((void *)arg, &info, sizeof(info))) + if (copy_to_user(argp, &info, sizeof(info))) return -EFAULT; return 0; } @@ -648,12 +651,14 @@ struct saa7134_dev *dev = file->private_data; enum saa7134_audio_in input; int val,ret; + void __user *argp = (void __user *) arg; + int __user *p = argp; if (oss_debug > 1) saa7134_print_ioctl(dev->name,cmd); switch (cmd) { case OSS_GETVERSION: - return put_user(SOUND_VERSION, (int *)arg); + return put_user(SOUND_VERSION, p); case SOUND_MIXER_INFO: { mixer_info info; @@ -661,7 +666,7 @@ strlcpy(info.id, "TV audio", sizeof(info.id)); strlcpy(info.name, dev->name, sizeof(info.name)); info.modify_counter = dev->oss.count; - if (copy_to_user((void *)arg, &info, sizeof(info))) + if (copy_to_user(argp, &info, sizeof(info))) return -EFAULT; return 0; } @@ -671,23 +676,23 @@ memset(&info,0,sizeof(info)); strlcpy(info.id, "TV audio", sizeof(info.id)); strlcpy(info.name, dev->name, sizeof(info.name)); - if (copy_to_user((void *)arg, &info, sizeof(info))) + if (copy_to_user(argp, &info, sizeof(info))) return -EFAULT; return 0; } case MIXER_READ(SOUND_MIXER_CAPS): - return put_user(SOUND_CAP_EXCL_INPUT,(int*)arg); + return put_user(SOUND_CAP_EXCL_INPUT, p); case MIXER_READ(SOUND_MIXER_STEREODEVS): - return put_user(0,(int*)arg); + return put_user(0, p); case MIXER_READ(SOUND_MIXER_RECMASK): case MIXER_READ(SOUND_MIXER_DEVMASK): val = SOUND_MASK_LINE1 | SOUND_MASK_LINE2; if (32000 == dev->oss.rate) val |= SOUND_MASK_VIDEO; - return put_user(val,(int*)arg); + return put_user(val, p); case MIXER_WRITE(SOUND_MIXER_RECSRC): - if (get_user(val, (int *)arg)) + if (get_user(val, p)) return -EFAULT; input = dev->oss.input; if (32000 == dev->oss.rate && @@ -707,16 +712,16 @@ case LINE2: ret = SOUND_MASK_LINE2; break; default: ret = 0; } - return put_user(ret,(int*)arg); + return put_user(ret, p); case MIXER_WRITE(SOUND_MIXER_VIDEO): case MIXER_READ(SOUND_MIXER_VIDEO): if (32000 != dev->oss.rate) return -EINVAL; - return put_user(100 | 100 << 8,(int*)arg); + return put_user(100 | 100 << 8, p); case MIXER_WRITE(SOUND_MIXER_LINE1): - if (get_user(val, (int *)arg)) + if (get_user(val, p)) return -EFAULT; val &= 0xff; val = (val <= 50) ? 50 : 100; @@ -724,11 +729,10 @@ mixer_level(dev,LINE1,dev->oss.line1); /* fall throuth */ case MIXER_READ(SOUND_MIXER_LINE1): - return put_user(dev->oss.line1 | dev->oss.line1 << 8, - (int*)arg); + return put_user(dev->oss.line1 | dev->oss.line1 << 8, p); case MIXER_WRITE(SOUND_MIXER_LINE2): - if (get_user(val, (int *)arg)) + if (get_user(val, p)) return -EFAULT; val &= 0xff; val = (val <= 50) ? 50 : 100; @@ -736,8 +740,7 @@ mixer_level(dev,LINE2,dev->oss.line2); /* fall throuth */ case MIXER_READ(SOUND_MIXER_LINE2): - return put_user(dev->oss.line2 | dev->oss.line2 << 8, - (int*)arg); + return put_user(dev->oss.line2 | dev->oss.line2 << 8, p); default: return -EINVAL; diff -Nru a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c --- a/drivers/media/video/saa7134/saa7134-ts.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/video/saa7134/saa7134-ts.c 2004-07-13 12:24:00 -07:00 @@ -241,7 +241,7 @@ } static ssize_t -ts_read(struct file *file, char *data, size_t count, loff_t *ppos) +ts_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { struct saa7134_dev *dev = file->private_data; diff -Nru a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c --- a/drivers/media/video/saa7134/saa7134-video.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/video/saa7134/saa7134-video.c 2004-07-13 12:24:00 -07:00 @@ -1238,7 +1238,7 @@ } static ssize_t -video_read(struct file *file, char *data, size_t count, loff_t *ppos) +video_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { struct saa7134_fh *fh = file->private_data; diff -Nru a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c --- a/drivers/media/video/stradis.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/stradis.c 2004-07-13 12:24:01 -07:00 @@ -1322,7 +1322,7 @@ unsigned int cmd, unsigned long argl) { struct saa7146 *saa = file->private_data; - void *arg = (void *)argl; + void __user *arg = (void __user *)argl; switch (cmd) { case VIDIOCGCAP: @@ -1580,7 +1580,7 @@ vu.radio = VIDEO_NO_UNIT; vu.audio = VIDEO_NO_UNIT; vu.teletext = VIDEO_NO_UNIT; - if (copy_to_user((void *) arg, (void *) &vu, sizeof(vu))) + if (copy_to_user(arg, &vu, sizeof(vu))) return -EFAULT; return 0; } @@ -1754,16 +1754,14 @@ struct video_code ucode; __u8 *udata; int i; - if (copy_from_user((void *) &ucode, arg, - sizeof(ucode))) + if (copy_from_user(&ucode, arg, sizeof(ucode))) return -EFAULT; if (ucode.datasize > 65536 || ucode.datasize < 1024 || strncmp(ucode.loadwhat, "dec", 3)) return -EINVAL; if ((udata = vmalloc(ucode.datasize)) == NULL) return -ENOMEM; - if (copy_from_user((void *) udata, ucode.data, - ucode.datasize)) { + if (copy_from_user(udata, ucode.data, ucode.datasize)) { vfree(udata); return -EFAULT; } @@ -1814,13 +1812,13 @@ return -EINVAL; } -static ssize_t saa_read(struct file *file, char *buf, +static ssize_t saa_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { return -EINVAL; } -static ssize_t saa_write(struct file *file, const char *buf, +static ssize_t saa_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct saa7146 *saa = file->private_data; diff -Nru a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c --- a/drivers/media/video/tea6415c.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/tea6415c.c 2004-07-13 12:24:01 -07:00 @@ -57,7 +57,7 @@ /* this function is called by i2c_probe */ static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind) { - struct i2c_client *client = 0; + struct i2c_client *client = NULL; int err = 0; /* let's see whether this adapter can support what we need */ diff -Nru a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c --- a/drivers/media/video/tvmixer.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/tvmixer.c 2004-07-13 12:24:01 -07:00 @@ -77,6 +77,8 @@ int left,right,ret,val = 0; struct TVMIXER *mix = file->private_data; struct i2c_client *client = mix->dev; + void __user *argp = (void __user *)arg; + int __user *p = argp; if (NULL == client) return -ENODEV; @@ -86,7 +88,7 @@ strlcpy(info.id, "tv card", sizeof(info.id)); strlcpy(info.name, i2c_clientname(client), sizeof(info.name)); info.modify_counter = 42 /* FIXME */; - if (copy_to_user((void *)arg, &info, sizeof(info))) + if (copy_to_user(argp, &info, sizeof(info))) return -EFAULT; return 0; } @@ -94,15 +96,15 @@ _old_mixer_info info; strlcpy(info.id, "tv card", sizeof(info.id)); strlcpy(info.name, i2c_clientname(client), sizeof(info.name)); - if (copy_to_user((void *)arg, &info, sizeof(info))) + if (copy_to_user(argp, &info, sizeof(info))) return -EFAULT; return 0; } if (cmd == OSS_GETVERSION) - return put_user(SOUND_VERSION, (int *)arg); + return put_user(SOUND_VERSION, p); if (_SIOC_DIR(cmd) & _SIOC_WRITE) - if (get_user(val, (int *)arg)) + if (get_user(val, p)) return -EFAULT; /* read state */ @@ -168,7 +170,7 @@ default: return -EINVAL; } - if (put_user(ret, (int *)arg)) + if (put_user(ret, p)) return -EFAULT; return 0; } diff -Nru a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c --- a/drivers/media/video/v4l1-compat.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/v4l1-compat.c 2004-07-13 12:24:01 -07:00 @@ -490,7 +490,7 @@ fmt2->fmt.win.w.width = win->width; fmt2->fmt.win.w.height = win->height; fmt2->fmt.win.chromakey = win->chromakey; - fmt2->fmt.win.clips = (void *)win->clips; + fmt2->fmt.win.clips = (void __user *)win->clips; fmt2->fmt.win.clipcount = win->clipcount; err2 = drv(inode, file, VIDIOC_S_FMT, fmt2); if (err2 < 0) diff -Nru a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c --- a/drivers/media/video/video-buf.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/video-buf.c 2004-07-13 12:24:01 -07:00 @@ -735,7 +735,7 @@ static ssize_t videobuf_read_zerocopy(struct file *file, struct videobuf_queue *q, - char *data, size_t count, loff_t *ppos) + char __user *data, size_t count, loff_t *ppos) { enum v4l2_field field; unsigned long flags; @@ -777,7 +777,7 @@ } ssize_t videobuf_read_one(struct file *file, struct videobuf_queue *q, - char *data, size_t count, loff_t *ppos) + char __user *data, size_t count, loff_t *ppos) { enum v4l2_field field; unsigned long flags; @@ -901,7 +901,7 @@ } ssize_t videobuf_read_stream(struct file *file, struct videobuf_queue *q, - char *data, size_t count, loff_t *ppos, + char __user *data, size_t count, loff_t *ppos, int vbihack) { unsigned int *fc, bytes; diff -Nru a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c --- a/drivers/media/video/videocodec.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/videocodec.c 2004-07-13 12:24:01 -07:00 @@ -458,7 +458,7 @@ videocodec_buf = NULL; videocodec_bufsize = 0; - videocodec_proc_entry = create_proc_entry("videocodecs", 0, 0); + videocodec_proc_entry = create_proc_entry("videocodecs", 0, NULL); if (videocodec_proc_entry) { videocodec_proc_entry->read_proc = videocodec_info; videocodec_proc_entry->write_proc = NULL; @@ -475,7 +475,7 @@ videocodec_exit (void) { #ifdef CONFIG_PROC_FS - remove_proc_entry("videocodecs", 0); + remove_proc_entry("videocodecs", NULL); if (videocodec_buf) kfree(videocodec_buf); #endif diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c --- a/drivers/media/video/videodev.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/video/videodev.c 2004-07-13 12:24:00 -07:00 @@ -183,7 +183,7 @@ /* Copy arguments into temp kernel buffer */ switch (_IOC_DIR(cmd)) { case _IOC_NONE: - parg = (void *)arg; + parg = NULL; break; case _IOC_READ: case _IOC_WRITE: @@ -200,7 +200,7 @@ err = -EFAULT; if (_IOC_DIR(cmd) & _IOC_WRITE) - if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd))) + if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) goto out; break; } @@ -217,7 +217,7 @@ { case _IOC_READ: case (_IOC_WRITE | _IOC_READ): - if (copy_to_user((void *)arg, parg, _IOC_SIZE(cmd))) + if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd))) err = -EFAULT; break; } @@ -231,7 +231,7 @@ /* * open/release helper functions -- handle exclusive opens */ -extern int video_exclusive_open(struct inode *inode, struct file *file) +int video_exclusive_open(struct inode *inode, struct file *file) { struct video_device *vfl = video_devdata(file); int retval = 0; @@ -246,7 +246,7 @@ return retval; } -extern int video_exclusive_release(struct inode *inode, struct file *file) +int video_exclusive_release(struct inode *inode, struct file *file) { struct video_device *vfl = video_devdata(file); diff -Nru a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c --- a/drivers/media/video/w9966.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/media/video/w9966.c 2004-07-13 12:24:00 -07:00 @@ -179,7 +179,7 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static ssize_t w9966_v4l_read(struct file *file, char *buf, +static ssize_t w9966_v4l_read(struct file *file, char __user *buf, size_t count, loff_t *ppos); static struct file_operations w9966_fops = { @@ -555,6 +555,14 @@ udelay(5); } +// Get peripheral clock line +// Expects a claimed pdev. +static inline int w9966_i2c_getscl(struct w9966_dev* cam) +{ + const unsigned char state = w9966_rReg(cam, 0x18); + return ((state & W9966_I2C_R_CLOCK) > 0); +} + // Sets the clock line on the i2c bus. // Expects a claimed pdev. -1 on error static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state) @@ -588,14 +596,6 @@ return ((state & W9966_I2C_R_DATA) > 0); } -// Get peripheral clock line -// Expects a claimed pdev. -static inline int w9966_i2c_getscl(struct w9966_dev* cam) -{ - const unsigned char state = w9966_rReg(cam, 0x18); - return ((state & W9966_I2C_R_CLOCK) > 0); -} - // Write a byte with ack to the i2c bus. // Expects a claimed pdev. -1 on error static int w9966_i2c_wbyte(struct w9966_dev* cam, int data) @@ -867,13 +867,13 @@ } // Capture data -static ssize_t w9966_v4l_read(struct file *file, char *buf, +static ssize_t w9966_v4l_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct video_device *vdev = video_devdata(file); struct w9966_dev *cam = (struct w9966_dev *)vdev->priv; unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000 - unsigned char* dest = (unsigned char*)buf; + unsigned char __user *dest = (unsigned char __user *)buf; unsigned long dleft = count; unsigned char *tbuf; diff -Nru a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c --- a/drivers/media/video/zoran_driver.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/media/video/zoran_driver.c 2004-07-13 12:24:01 -07:00 @@ -424,17 +424,15 @@ ZR_DEVNAME(zr), size >> 10); return -ENOBUFS; } - fh->v4l_buffers.buffer[0].fbuffer = 0; - fh->v4l_buffers.buffer[0].fbuffer_phys = - pmem; - fh->v4l_buffers.buffer[0].fbuffer_bus = - pmem; + fh->v4l_buffers.buffer[0].fbuffer = NULL; + fh->v4l_buffers.buffer[0].fbuffer_phys = pmem; + fh->v4l_buffers.buffer[0].fbuffer_bus = pmem; dprintk(4, KERN_INFO "%s: v4l_fbuffer_alloc() - using %d KB high memory\n", ZR_DEVNAME(zr), size >> 10); } else { - fh->v4l_buffers.buffer[i].fbuffer = 0; + fh->v4l_buffers.buffer[i].fbuffer = NULL; fh->v4l_buffers.buffer[i].fbuffer_phys = pmem + i * fh->v4l_buffers.buffer_size; fh->v4l_buffers.buffer[i].fbuffer_bus = @@ -1472,7 +1470,7 @@ static ssize_t zoran_read (struct file *file, - char *data, + char __user *data, size_t count, loff_t *ppos) { @@ -1483,7 +1481,7 @@ static ssize_t zoran_write (struct file *file, - const char *data, + const char __user *data, size_t count, loff_t *ppos) { @@ -1569,9 +1567,9 @@ int y, int width, int height, - struct video_clip *clips, + struct video_clip __user *clips, int clipcount, - void *bitmap) + void __user *bitmap) { struct zoran_fh *fh = file->private_data; struct zoran *zr = fh->zr; @@ -2873,7 +2871,7 @@ fmt->fmt.win.w.top, fmt->fmt.win.w.width, fmt->fmt.win.w.height, - (struct video_clip *) + (struct video_clip __user *) fmt->fmt.win.clips, fmt->fmt.win.clipcount, fmt->fmt.win.bitmap); 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-13 12:24:01 -07:00 +++ b/drivers/media/video/zoran_procfs.c 2004-07-13 12:24:01 -07:00 @@ -196,7 +196,7 @@ static int zoran_write_proc (struct file *file, - const char *buffer, + const char __user *buffer, unsigned long count, void *data) { @@ -252,7 +252,7 @@ char name[8]; snprintf(name, 7, "zoran%d", zr->id); - if ((zr->zoran_proc = create_proc_entry(name, 0, 0))) { + 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; @@ -278,7 +278,7 @@ snprintf(name, 7, "zoran%d", zr->id); if (zr->zoran_proc) { - remove_proc_entry(name, 0); + remove_proc_entry(name, NULL); } zr->zoran_proc = NULL; #endif diff -Nru a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c --- a/drivers/message/fusion/mptscsih.c 2004-07-13 12:24:02 -07:00 +++ b/drivers/message/fusion/mptscsih.c 2004-07-13 12:24:02 -07:00 @@ -99,7 +99,7 @@ /* Set string for command line args from insmod */ #ifdef MODULE -char *mptscsih = 0; +char *mptscsih = NULL; #endif /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ diff -Nru a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c --- a/drivers/message/i2o/i2o_config.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/message/i2o/i2o_config.c 2004-07-13 12:24:01 -07:00 @@ -857,7 +857,7 @@ u32 sg_count = 0; int sg_index = 0; u32 i = 0; - void *p = 0; + void *p = NULL; unsigned int iop; if (get_user(iop, &cmd->iop) || get_user(user_msg, &cmd->msg)) diff -Nru a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c --- a/drivers/message/i2o/i2o_proc.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/message/i2o/i2o_proc.c 2004-07-13 12:24:01 -07:00 @@ -3337,7 +3337,7 @@ struct i2o_controller *pctrl = NULL; int i; - i2o_proc_dir_root = proc_mkdir("i2o", 0); + i2o_proc_dir_root = proc_mkdir("i2o", NULL); if(!i2o_proc_dir_root) return -1; i2o_proc_dir_root->owner = THIS_MODULE; @@ -3371,7 +3371,7 @@ } if(!atomic_read(&i2o_proc_dir_root->count)) - remove_proc_entry("i2o", 0); + remove_proc_entry("i2o", NULL); else return -1; diff -Nru a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c --- a/drivers/net/appletalk/ltpc.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/appletalk/ltpc.c 2004-07-13 12:24:00 -07:00 @@ -501,7 +501,7 @@ /* FIXME This is initialized to shut the warning up, but I need to * think this through again. */ - struct xmitQel *q=0; + struct xmitQel *q = NULL; int oops; int i; int base = dev->base_addr; @@ -1203,7 +1203,7 @@ if (err) goto out4; - return 0; + return NULL; out4: del_timer_sync(<pc_timer); if (dev->irq) diff -Nru a/drivers/net/dgrs.c b/drivers/net/dgrs.c --- a/drivers/net/dgrs.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/dgrs.c 2004-07-13 12:24:00 -07:00 @@ -1311,8 +1311,8 @@ *privN = *priv; /* ... and zero out VM areas */ - privN->vmem = 0; - privN->vplxdma = 0; + privN->vmem = NULL; + privN->vplxdma = NULL; /* ... and zero out IRQ */ devN->irq = 0; /* ... and base MAC address off address of 1st port */ diff -Nru a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c --- a/drivers/net/irda/irtty-sir.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/irda/irtty-sir.c 2004-07-13 12:24:00 -07:00 @@ -584,7 +584,7 @@ */ /* we are dead now */ - tty->disc_data = 0; + tty->disc_data = NULL; sirdev_put_instance(priv->dev); diff -Nru a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c --- a/drivers/net/irda/vlsi_ir.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/irda/vlsi_ir.c 2004-07-13 12:24:00 -07:00 @@ -1876,7 +1876,7 @@ * Failure to create the procfs entry is handled like running * without procfs - it's not required for the driver to work. */ - vlsi_proc_root = create_proc_entry(PROC_DIR, S_IFDIR, 0); + vlsi_proc_root = create_proc_entry(PROC_DIR, S_IFDIR, NULL); if (vlsi_proc_root) { /* protect registered procdir against module removal. * Because we are in the module init path there's no race @@ -1888,7 +1888,7 @@ ret = pci_module_init(&vlsi_irda_driver); if (ret && vlsi_proc_root) - remove_proc_entry(PROC_DIR, 0); + remove_proc_entry(PROC_DIR, NULL); return ret; } @@ -1897,7 +1897,7 @@ { pci_unregister_driver(&vlsi_irda_driver); if (vlsi_proc_root) - remove_proc_entry(PROC_DIR, 0); + remove_proc_entry(PROC_DIR, NULL); } module_init(vlsi_mod_init); diff -Nru a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c --- a/drivers/net/ne2k-pci.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/ne2k-pci.c 2004-07-13 12:24:00 -07:00 @@ -132,7 +132,7 @@ {"Holtek HT80232", ONLY_16BIT_IO | HOLTEK_FDX}, {"Holtek HT80229", ONLY_32BIT_IO | HOLTEK_FDX | STOP_PG_0x60 }, {"Winbond W89C940(misprogrammed)", 0}, - {0,} + {NULL,} }; diff -Nru a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c --- a/drivers/net/pcmcia/smc91c92_cs.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/pcmcia/smc91c92_cs.c 2004-07-13 12:24:01 -07:00 @@ -1272,7 +1272,7 @@ link->open++; netif_start_queue(dev); - smc->saved_skb = 0; + smc->saved_skb = NULL; smc->packets_waiting = 0; smc_reset(dev); diff -Nru a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c --- a/drivers/net/pcmcia/xirc2ps_cs.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/pcmcia/xirc2ps_cs.c 2004-07-13 12:24:00 -07:00 @@ -815,7 +815,7 @@ cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data; cistpl_cftable_entry_t *cf = &parse.cftable_entry; - local->dingo_ccr = 0; + local->dingo_ccr = NULL; DEBUG(0, "config(0x%p)\n", link); diff -Nru a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c --- a/drivers/net/pcnet32.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/pcnet32.c 2004-07-13 12:24:00 -07:00 @@ -1839,7 +1839,7 @@ pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[entry], lp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE); dev_kfree_skb_irq(lp->tx_skbuff[entry]); - lp->tx_skbuff[entry] = 0; + lp->tx_skbuff[entry] = NULL; lp->tx_dma_addr[entry] = 0; } dirty_tx++; diff -Nru a/drivers/net/rrunner.c b/drivers/net/rrunner.c --- a/drivers/net/rrunner.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/rrunner.c 2004-07-13 12:24:00 -07:00 @@ -197,7 +197,8 @@ * Don't access any register before this point! */ #ifdef __BIG_ENDIAN - writel(readl(®s->HostCtrl) | NO_SWAP, ®s->HostCtrl); + writel(readl(&rrpriv->regs->HostCtrl) | NO_SWAP, + &rrpriv->regs->HostCtrl); #endif /* * Need to add a case for little-endian 64-bit hosts here. @@ -633,7 +634,7 @@ for (i = 0; i < TX_RING_ENTRIES; i++) { rrpriv->tx_ring[i].size = 0; set_rraddr(&rrpriv->tx_ring[i].addr, 0); - rrpriv->tx_skbuff[i] = 0; + rrpriv->tx_skbuff[i] = NULL; } rrpriv->info->tx_ctrl.entry_size = sizeof(struct tx_desc); rrpriv->info->tx_ctrl.entries = TX_RING_ENTRIES; @@ -743,7 +744,7 @@ rrpriv->rx_ring[i].size = 0; set_rraddr(&rrpriv->rx_ring[i].addr, 0); dev_kfree_skb(skb); - rrpriv->rx_skbuff[i] = 0; + rrpriv->rx_skbuff[i] = NULL; } } return ecode; diff -Nru a/drivers/net/sk98lin/sktimer.c b/drivers/net/sk98lin/sktimer.c --- a/drivers/net/sk98lin/sktimer.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/sk98lin/sktimer.c 2004-07-13 12:24:00 -07:00 @@ -62,7 +62,7 @@ { switch (Level) { case SK_INIT_DATA: - pAC->Tim.StQueue = 0; + pAC->Tim.StQueue = NULL; break; case SK_INIT_IO: SkHwtInit(pAC, Ioc); @@ -145,7 +145,7 @@ if (!pAC->Tim.StQueue) { /* First Timer to be started */ pAC->Tim.StQueue = pTimer; - pTimer->TmNext = 0; + pTimer->TmNext = NULL; pTimer->TmDelta = Time; SkHwtStart(pAC, Ioc, Time); @@ -228,7 +228,7 @@ Done = 1; } } - *ppLast = 0; + *ppLast = NULL; /* * pTm points to the first Timer that did not run out. * StQueue points to the first Timer that run out. diff -Nru a/drivers/net/sk98lin/skvpd.c b/drivers/net/sk98lin/skvpd.c --- a/drivers/net/sk98lin/skvpd.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/sk98lin/skvpd.c 2004-07-13 12:24:01 -07:00 @@ -556,7 +556,7 @@ if (*v != (char)RES_ID) { SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR | SK_DBGCAT_FATAL, ("Error: 0x%x missing\n", RES_ID)); - return(0); + return NULL; } if (strcmp(key, VPD_NAME) == 0) { @@ -600,7 +600,7 @@ ("Key/Len Encoding error\n")); } #endif /* DEBUG */ - return(0); + return NULL; } /* @@ -751,7 +751,7 @@ vpd_size = pAC->vpd.vpd_size; rtv = 0; - ip = 0; + ip = NULL; if (type == VPD_RW_KEY) { /* end tag is "RW" */ free = pAC->vpd.v.vpd_free_rw; diff -Nru a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c --- a/drivers/net/tokenring/ibmtr.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/tokenring/ibmtr.c 2004-07-13 12:24:01 -07:00 @@ -383,7 +383,7 @@ { unsigned char segment, intr=0, irq=0, i, j, cardpresent=NOTOK, temp=0; - void * t_mmio = 0; + void * t_mmio = NULL; struct tok_info *ti = dev->priv; void *cd_chanid; unsigned char *tchanid, ctemp; diff -Nru a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c --- a/drivers/net/tokenring/lanstreamer.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/tokenring/lanstreamer.c 2004-07-13 12:24:01 -07:00 @@ -446,7 +446,7 @@ __u8 *streamer_mmio; unsigned long t; unsigned int uaa_addr; - struct sk_buff *skb = 0; + struct sk_buff *skb = NULL; __u16 misr; streamer_priv = (struct streamer_private *) dev->priv; diff -Nru a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c --- a/drivers/net/tokenring/olympic.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/tokenring/olympic.c 2004-07-13 12:24:01 -07:00 @@ -268,7 +268,7 @@ char proc_name[20] ; strcpy(proc_name,"net/olympic_") ; strcat(proc_name,dev->name) ; - create_proc_read_entry(proc_name,0,0,olympic_proc_info,(void *)dev) ; + create_proc_read_entry(proc_name,0,NULL,olympic_proc_info,(void *)dev) ; printk("Olympic: Network Monitor information: /proc/%s\n",proc_name); } return 0 ; diff -Nru a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c --- a/drivers/net/tokenring/smctr.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/tokenring/smctr.c 2004-07-13 12:24:01 -07:00 @@ -4939,7 +4939,7 @@ tmf->dc_sc = DC_RPS | SC_RS; tmf->vl = 4; - smctr_make_8025_hdr(dev, 0L, tmf, AC_FC_RQ_INIT); + smctr_make_8025_hdr(dev, NULL, tmf, AC_FC_RQ_INIT); tsv = (MAC_SUB_VECTOR *)((__u32)tmf + sizeof(MAC_HEADER)); smctr_make_product_id(dev, tsv); diff -Nru a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c --- a/drivers/net/tokenring/tms380tr.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/tokenring/tms380tr.c 2004-07-13 12:24:01 -07:00 @@ -252,6 +252,7 @@ /* Reset the hardware here. Don't forget to set the station address. */ +#ifdef CONFIG_ISA if(dev->dma > 0) { unsigned long flags=claim_dma_lock(); @@ -260,6 +261,7 @@ enable_dma(dev->dma); release_dma_lock(flags); } +#endif err = tms380tr_chipset_init(dev); if(err) @@ -1149,12 +1151,14 @@ del_timer(&tp->timer); tms380tr_disable_interrupts(dev); +#ifdef CONFIG_ISA if(dev->dma > 0) { unsigned long flags=claim_dma_lock(); disable_dma(dev->dma); release_dma_lock(flags); } +#endif SIFWRITEW(0xFF00, SIFCMD); #if 0 diff -Nru a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c --- a/drivers/net/tulip/de4x5.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/tulip/de4x5.c 2004-07-13 12:24:00 -07:00 @@ -4721,8 +4721,8 @@ if (lp->state == INITIALISED) { lp->ibn = 1; lp->active = *p++; - lp->phy[lp->active].gep = (*p ? p : 0); p += (*p + 1); - lp->phy[lp->active].rst = (*p ? p : 0); p += (*p + 1); + lp->phy[lp->active].gep = (*p ? p : NULL); p += (*p + 1); + lp->phy[lp->active].rst = (*p ? p : NULL); p += (*p + 1); lp->phy[lp->active].mc = TWIDDLE(p); p += 2; lp->phy[lp->active].ana = TWIDDLE(p); p += 2; lp->phy[lp->active].fdx = TWIDDLE(p); p += 2; @@ -4802,8 +4802,8 @@ lp->ibn = 3; lp->active = *p++; if (MOTO_SROM_BUG) lp->active = 0; - lp->phy[lp->active].gep = (*p ? p : 0); p += (2 * (*p) + 1); - lp->phy[lp->active].rst = (*p ? p : 0); p += (2 * (*p) + 1); + lp->phy[lp->active].gep = (*p ? p : NULL); p += (2 * (*p) + 1); + lp->phy[lp->active].rst = (*p ? p : NULL); p += (2 * (*p) + 1); lp->phy[lp->active].mc = TWIDDLE(p); p += 2; lp->phy[lp->active].ana = TWIDDLE(p); p += 2; lp->phy[lp->active].fdx = TWIDDLE(p); p += 2; diff -Nru a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c --- a/drivers/net/tulip/eeprom.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/tulip/eeprom.c 2004-07-13 12:24:01 -07:00 @@ -62,7 +62,7 @@ */ { 0x1e00, 0x0000, 0x000b, 0x8f01, 0x0103, 0x0300, 0x0821, 0x000, 0x0001, 0x0000, 0x01e1 } }, - {0, 0, 0, 0, {}}}; + {NULL}}; static const char *block_name[] __devinitdata = { @@ -136,7 +136,7 @@ unsigned char *ee_data = tp->eeprom; int i; - tp->mtable = 0; + tp->mtable = NULL; /* Detect an old-style (SA only) EEPROM layout: memcmp(eedata, eedata+16, 8). */ for (i = 0; i < 8; i ++) diff -Nru a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c --- a/drivers/net/tulip/winbond-840.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/tulip/winbond-840.c 2004-07-13 12:24:00 -07:00 @@ -251,7 +251,7 @@ W840_FLAGS, 128, CanHaveMII | HasBrokenTx}, {"Compex RL100-ATX", { 0x201111F6, 0xffffffff,}, W840_FLAGS, 128, CanHaveMII | HasBrokenTx}, - {0,}, /* 0 terminated list. */ + {NULL,}, /* 0 terminated list. */ }; /* This driver was written to use PCI memory space, however some x86 systems @@ -851,7 +851,7 @@ for (i = 0; i < RX_RING_SIZE; i++) { np->rx_ring[i].length = np->rx_buf_sz; np->rx_ring[i].status = 0; - np->rx_skbuff[i] = 0; + np->rx_skbuff[i] = NULL; } /* Mark the last entry as wrapping the ring. */ np->rx_ring[i-1].length |= DescEndRing; @@ -875,7 +875,7 @@ /* Initialize the Tx descriptors */ for (i = 0; i < TX_RING_SIZE; i++) { - np->tx_skbuff[i] = 0; + np->tx_skbuff[i] = NULL; np->tx_ring[i].status = 0; } np->tx_full = 0; @@ -900,7 +900,7 @@ PCI_DMA_FROMDEVICE); dev_kfree_skb(np->rx_skbuff[i]); } - np->rx_skbuff[i] = 0; + np->rx_skbuff[i] = NULL; } for (i = 0; i < TX_RING_SIZE; i++) { if (np->tx_skbuff[i]) { @@ -910,7 +910,7 @@ PCI_DMA_TODEVICE); dev_kfree_skb(np->tx_skbuff[i]); } - np->tx_skbuff[i] = 0; + np->tx_skbuff[i] = NULL; } } @@ -1145,7 +1145,7 @@ PCI_DMA_TODEVICE); np->tx_q_bytes -= np->tx_skbuff[entry]->len; dev_kfree_skb_irq(np->tx_skbuff[entry]); - np->tx_skbuff[entry] = 0; + np->tx_skbuff[entry] = NULL; } if (np->tx_full && np->cur_tx - np->dirty_tx < TX_QUEUE_LEN_RESTART && diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wan/cosa.c 2004-07-13 12:24:00 -07:00 @@ -729,7 +729,7 @@ cosa_kick(chan->cosa); if (chan->tx_skb) { dev_kfree_skb(chan->tx_skb); - chan->tx_skb = 0; + chan->tx_skb = NULL; } netif_wake_queue(dev); } @@ -745,11 +745,11 @@ spin_lock_irqsave(&chan->cosa->lock, flags); if (chan->rx_skb) { kfree_skb(chan->rx_skb); - chan->rx_skb = 0; + chan->rx_skb = NULL; } if (chan->tx_skb) { kfree_skb(chan->tx_skb); - chan->tx_skb = 0; + chan->tx_skb = NULL; } chan->usage=0; chan->cosa->usage--; @@ -791,7 +791,7 @@ chan->stats.rx_packets++; chan->stats.rx_bytes += chan->cosa->rxsize; netif_rx(chan->rx_skb); - chan->rx_skb = 0; + chan->rx_skb = NULL; chan->pppdev.dev->last_rx = jiffies; return 0; } @@ -807,7 +807,7 @@ return 1; } dev_kfree_skb_irq(chan->tx_skb); - chan->tx_skb = 0; + chan->tx_skb = NULL; chan->stats.tx_packets++; chan->stats.tx_bytes += size; netif_wake_queue(chan->pppdev.dev); diff -Nru a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c --- a/drivers/net/wan/lmc/lmc_main.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wan/lmc/lmc_main.c 2004-07-13 12:24:00 -07:00 @@ -1250,7 +1250,7 @@ for (i = 0; i < LMC_RXDESCS; i++) { struct sk_buff *skb = sc->lmc_rxq[i]; - sc->lmc_rxq[i] = 0; + sc->lmc_rxq[i] = NULL; sc->lmc_rxring[i].status = 0; sc->lmc_rxring[i].length = 0; sc->lmc_rxring[i].buffer1 = 0xDEADBEEF; @@ -1394,7 +1394,7 @@ // dev_kfree_skb(sc->lmc_txq[i]); dev_kfree_skb_irq(sc->lmc_txq[i]); - sc->lmc_txq[i] = 0; + sc->lmc_txq[i] = NULL; badtx++; i = badtx % LMC_TXDESCS; @@ -1667,7 +1667,7 @@ */ give_it_anyways: - sc->lmc_rxq[i] = 0x0; + sc->lmc_rxq[i] = NULL; sc->lmc_rxring[i].buffer1 = 0x0; skb_put (skb, len); @@ -1965,7 +1965,7 @@ dev_kfree_skb(sc->lmc_txq[i]); /* free it */ sc->stats.tx_dropped++; /* We just dropped a packet */ } - sc->lmc_txq[i] = 0; + sc->lmc_txq[i] = NULL; sc->lmc_txring[i].status = 0x00000000; sc->lmc_txring[i].buffer2 = virt_to_bus (&sc->lmc_txring[i + 1]); } diff -Nru a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c --- a/drivers/net/wan/lmc/lmc_proto.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/wan/lmc/lmc_proto.c 2004-07-13 12:24:01 -07:00 @@ -112,7 +112,7 @@ * They set a few basics because they don't use sync_ppp */ dev->flags |= IFF_POINTOPOINT; - dev->hard_header = 0; + dev->hard_header = NULL; dev->hard_header_len = 0; dev->addr_len = 0; } diff -Nru a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c --- a/drivers/net/wan/pc300_tty.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wan/pc300_tty.c 2004-07-13 12:24:00 -07:00 @@ -264,7 +264,7 @@ INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work, (void *)cpc_tty); INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work, (void *)port); - cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = 0; + cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = NULL; pc300dev->cpc_tty = (void *)cpc_tty; @@ -878,7 +878,7 @@ cpc_tty_trace(pc300dev, new->data,rx_len, 'R'); } new->size = rx_len; - new->next = 0; + new->next = NULL; if (cpc_tty->buf_rx.first == 0) { cpc_tty->buf_rx.first = new; cpc_tty->buf_rx.last = new; diff -Nru a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c --- a/drivers/net/wan/sbni.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wan/sbni.c 2004-07-13 12:24:00 -07:00 @@ -349,7 +349,7 @@ if( sbni_card_probe( ioaddr ) ) { release_region( ioaddr, SBNI_IO_EXTENT ); - return 0; + return NULL; } outb( 0, ioaddr + CSR0 ); @@ -368,7 +368,7 @@ printk( KERN_ERR "%s: can't detect device irq!\n", dev->name ); release_region( ioaddr, SBNI_IO_EXTENT ); - return 0; + return NULL; } } else if( irq == 2 ) irq = 9; @@ -381,7 +381,7 @@ if( !nl ) { printk( KERN_ERR "%s: unable to get memory!\n", dev->name ); release_region( ioaddr, SBNI_IO_EXTENT ); - return 0; + return NULL; } dev->priv = nl; diff -Nru a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c --- a/drivers/net/wan/syncppp.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wan/syncppp.c 2004-07-13 12:24:00 -07:00 @@ -643,7 +643,7 @@ case LCP_TERM_REQ: sppp_clear_timeout (sp); /* Send Terminate-Ack packet. */ - sppp_cp_send (sp, PPP_LCP, LCP_TERM_ACK, h->ident, 0, 0); + sppp_cp_send (sp, PPP_LCP, LCP_TERM_ACK, h->ident, 0, NULL); /* Go to closed state. */ sp->lcp.state = LCP_STATE_CLOSED; sp->ipcp.state = IPCP_STATE_CLOSED; @@ -1262,7 +1262,7 @@ } else { /* Send Configure-Ack packet. */ sppp_cp_send (sp, PPP_IPCP, IPCP_CONF_ACK, h->ident, - 0, 0); + 0, NULL); /* Change the state. */ if (sp->ipcp.state == IPCP_STATE_ACK_RCVD) sp->ipcp.state = IPCP_STATE_OPENED; @@ -1297,7 +1297,7 @@ break; case IPCP_TERM_REQ: /* Send Terminate-Ack packet. */ - sppp_cp_send (sp, PPP_IPCP, IPCP_TERM_ACK, h->ident, 0, 0); + sppp_cp_send (sp, PPP_IPCP, IPCP_TERM_ACK, h->ident, 0, NULL); /* Go to closed state. */ sp->ipcp.state = IPCP_STATE_CLOSED; /* Initiate renegotiation. */ @@ -1332,7 +1332,7 @@ static void sppp_ipcp_open (struct sppp *sp) { sp->ipcp.confid = ++sp->pp_seq; - sppp_cp_send (sp, PPP_IPCP, IPCP_CONF_REQ, sp->ipcp.confid, 0, 0); + sppp_cp_send (sp, PPP_IPCP, IPCP_CONF_REQ, sp->ipcp.confid, 0, NULL); sppp_set_timeout (sp, 2); } diff -Nru a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c --- a/drivers/net/wan/x25_asy.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wan/x25_asy.c 2004-07-13 12:24:00 -07:00 @@ -627,7 +627,7 @@ (void) dev_close(sl->dev); } - tty->disc_data = 0; + tty->disc_data = NULL; sl->tty = NULL; x25_asy_free(sl); } diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c --- a/drivers/net/wireless/airo.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wireless/airo.c 2004-07-13 12:24:00 -07:00 @@ -101,7 +101,7 @@ infront of the label, that statistic will not be included in the list of statistics in the /proc filesystem */ -#define IGNLABEL(comment) 0 +#define IGNLABEL(comment) NULL static char *statsLabels[] = { "RxOverrun", IGNLABEL("RxPlcpCrcErr"), @@ -2346,7 +2346,7 @@ if (ai->wifidev) { unregister_netdev(ai->wifidev); free_netdev(ai->wifidev); - ai->wifidev = 0; + ai->wifidev = NULL; } clear_bit(FLAG_REGISTERED, &ai->flags); } @@ -2358,7 +2358,7 @@ * Clean out tx queue */ if (test_bit(FLAG_MPI, &ai->flags) && skb_queue_len (&ai->txq) > 0) { - struct sk_buff *skb = 0; + struct sk_buff *skb = NULL; for (;(skb = skb_dequeue(&ai->txq));) dev_kfree_skb(skb); } diff -Nru a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c --- a/drivers/net/wireless/airo_cs.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/wireless/airo_cs.c 2004-07-13 12:24:01 -07:00 @@ -270,7 +270,7 @@ if ( ((local_info_t*)link->priv)->eth_dev ) { stop_airo_card( ((local_info_t*)link->priv)->eth_dev, 0 ); } - ((local_info_t*)link->priv)->eth_dev = 0; + ((local_info_t*)link->priv)->eth_dev = NULL; /* Break the link with Card Services */ if (link->handle) diff -Nru a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c --- a/drivers/net/wireless/atmel.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wireless/atmel.c 2004-07-13 12:24:00 -07:00 @@ -1599,7 +1599,7 @@ netif_carrier_off(dev); - create_proc_read_entry ("driver/atmel", 0, 0, atmel_read_proc, priv); + create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv); printk(KERN_INFO "%s: Atmel at76c50x wireless. Version %d.%d simon@thekelleys.org.uk\n", dev->name, DRIVER_MAJOR, DRIVER_MINOR); diff -Nru a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c --- a/drivers/net/wireless/atmel_cs.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/wireless/atmel_cs.c 2004-07-13 12:24:01 -07:00 @@ -612,7 +612,7 @@ if (dev) stop_atmel_card(dev, 0); - ((local_info_t*)link->priv)->eth_dev = 0; + ((local_info_t*)link->priv)->eth_dev = NULL; /* Don't bother checking to see if these succeed or not */ pcmcia_release_configuration(link->handle); diff -Nru a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c --- a/drivers/net/wireless/orinoco_plx.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/wireless/orinoco_plx.c 2004-07-13 12:24:01 -07:00 @@ -324,8 +324,6 @@ .id_table = orinoco_plx_pci_id_table, .probe = orinoco_plx_init_one, .remove = __devexit_p(orinoco_plx_remove_one), - .suspend = 0, - .resume = 0, }; static char version[] __initdata = "orinoco_plx.c 0.13e (Daniel Barlow , David Gibson )"; diff -Nru a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c --- a/drivers/net/wireless/orinoco_tmd.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wireless/orinoco_tmd.c 2004-07-13 12:24:00 -07:00 @@ -202,8 +202,6 @@ .id_table = orinoco_tmd_pci_id_table, .probe = orinoco_tmd_init_one, .remove = __devexit_p(orinoco_tmd_remove_one), - .suspend = 0, - .resume = 0, }; static char version[] __initdata = "orinoco_tmd.c 0.01 (Joerg Dorchain )"; diff -Nru a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c --- a/drivers/net/wireless/ray_cs.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/net/wireless/ray_cs.c 2004-07-13 12:24:00 -07:00 @@ -2914,7 +2914,7 @@ DEBUG(1, "raylink init_module register_pcmcia_driver returns 0x%x\n",rc); #ifdef CONFIG_PROC_FS - proc_mkdir("driver/ray_cs", 0); + proc_mkdir("driver/ray_cs", NULL); create_proc_info_entry("driver/ray_cs/ray_cs", 0, NULL, &ray_cs_proc_read); raycs_write("driver/ray_cs/essid", write_essid, NULL); diff -Nru a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c --- a/drivers/net/wireless/strip.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/net/wireless/strip.c 2004-07-13 12:24:01 -07:00 @@ -2707,7 +2707,7 @@ unregister_netdev(strip_info->dev); - tty->disc_data = 0; + tty->disc_data = NULL; strip_info->tty = NULL; printk(KERN_INFO "STRIP: device \"%s\" closed down\n", strip_info->dev->name); diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c --- a/drivers/pci/hotplug/acpiphp_glue.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/pci/hotplug/acpiphp_glue.c 2004-07-13 12:24:00 -07:00 @@ -1227,7 +1227,7 @@ /* should never happen! */ err("%s: no object for id %d\n", __FUNCTION__, id); WARN_ON(1); - return 0; + return NULL; } diff -Nru a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c --- a/drivers/pci/hotplug/cpci_hotplug_core.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/pci/hotplug/cpci_hotplug_core.c 2004-07-13 12:24:00 -07:00 @@ -614,9 +614,9 @@ thread_finished = 0; if(controller->irq) { - pid = kernel_thread(event_thread, 0, 0); + pid = kernel_thread(event_thread, NULL, 0); } else { - pid = kernel_thread(poll_thread, 0, 0); + pid = kernel_thread(poll_thread, NULL, 0); } if(pid < 0) { err("Can't start up our thread"); diff -Nru a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c --- a/drivers/pci/hotplug/cpqphp_ctrl.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/pci/hotplug/cpqphp_ctrl.c 2004-07-13 12:24:00 -07:00 @@ -1829,7 +1829,7 @@ init_MUTEX_LOCKED(&event_exit); event_finished=0; - pid = kernel_thread(event_thread, 0, 0); + pid = kernel_thread(event_thread, NULL, 0); if (pid < 0) { err ("Can't start up our event thread\n"); return -1; diff -Nru a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c --- a/drivers/pci/hotplug/ibmphp_hpc.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/pci/hotplug/ibmphp_hpc.c 2004-07-13 12:24:00 -07:00 @@ -1081,7 +1081,7 @@ debug ("%s - Entry\n", __FUNCTION__); - tid_poll = kernel_thread (hpc_poll_thread, 0, 0); + tid_poll = kernel_thread (hpc_poll_thread, NULL, 0); if (tid_poll < 0) { err ("%s - Error, thread not started\n", __FUNCTION__); rc = -1; diff -Nru a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c --- a/drivers/pci/hotplug/pciehp_ctrl.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/pci/hotplug/pciehp_ctrl.c 2004-07-13 12:24:00 -07:00 @@ -1454,7 +1454,7 @@ event_finished=0; init_MUTEX_LOCKED(&event_semaphore); - pid = kernel_thread(event_thread, 0, 0); + pid = kernel_thread(event_thread, NULL, 0); if (pid < 0) { err ("Can't start up our event thread\n"); diff -Nru a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c --- a/drivers/pci/hotplug/pciehp_hpc.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/pci/hotplug/pciehp_hpc.c 2004-07-13 12:24:01 -07:00 @@ -237,8 +237,8 @@ static spinlock_t hpc_event_lock; DEFINE_DBG_BUFFER /* Debug string buffer for entire HPC defined here */ -static struct php_ctlr_state_s *php_ctlr_list_head = 0; /* HPC state linked list */ -static int ctlr_seq_num = 0; /* Controller sequence # */ +static struct php_ctlr_state_s *php_ctlr_list_head; /* HPC state linked list */ +static int ctlr_seq_num; /* Controller sequence # */ static spinlock_t list_lock; static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs); @@ -744,7 +744,7 @@ } } if (php_ctlr->pci_dev) - php_ctlr->pci_dev = 0; + php_ctlr->pci_dev = NULL; spin_lock(&list_lock); p = php_ctlr_list_head; @@ -1467,7 +1467,7 @@ if (php_ctlr_list_head == 0) { php_ctlr_list_head = php_ctlr; p = php_ctlr_list_head; - p->pnext = 0; + p->pnext = NULL; } else { p = php_ctlr_list_head; diff -Nru a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c --- a/drivers/pci/hotplug/shpchp_ctrl.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/pci/hotplug/shpchp_ctrl.c 2004-07-13 12:24:01 -07:00 @@ -1890,7 +1890,7 @@ event_finished=0; init_MUTEX_LOCKED(&event_semaphore); - pid = kernel_thread(event_thread, 0, 0); + pid = kernel_thread(event_thread, NULL, 0); if (pid < 0) { err ("Can't start up our event thread\n"); diff -Nru a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c --- a/drivers/pci/hotplug/shpchp_hpc.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/pci/hotplug/shpchp_hpc.c 2004-07-13 12:24:00 -07:00 @@ -228,7 +228,7 @@ static spinlock_t hpc_event_lock; DEFINE_DBG_BUFFER /* Debug string buffer for entire HPC defined here */ -static struct php_ctlr_state_s *php_ctlr_list_head = 0; /* HPC state linked list */ +static struct php_ctlr_state_s *php_ctlr_list_head; /* HPC state linked list */ static int ctlr_seq_num = 0; /* Controller sequenc # */ static spinlock_t list_lock; @@ -799,7 +799,7 @@ iounmap(php_ctlr->creg); release_mem_region(pci_resource_start(php_ctlr->pci_dev, 0), pci_resource_len(php_ctlr->pci_dev, 0)); dbg("%s: before calling iounmap & release_mem_region\n", __FUNCTION__); - php_ctlr->pci_dev = 0; + php_ctlr->pci_dev = NULL; } spin_lock(&list_lock); @@ -1572,7 +1572,7 @@ if (php_ctlr_list_head == 0) { php_ctlr_list_head = php_ctlr; p = php_ctlr_list_head; - p->pnext = 0; + p->pnext = NULL; } else { p = php_ctlr_list_head; diff -Nru a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c --- a/drivers/pcmcia/cardbus.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/pcmcia/cardbus.c 2004-07-13 12:24:00 -07:00 @@ -118,7 +118,7 @@ cs_dbg(s, 1, "cb_release_cis_mem()\n"); iounmap(s->cb_cis_virt); s->cb_cis_virt = NULL; - s->cb_cis_res = 0; + s->cb_cis_res = NULL; } } diff -Nru a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c --- a/drivers/pnp/pnpbios/bioscalls.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/pnp/pnpbios/bioscalls.c 2004-07-13 12:24:01 -07:00 @@ -260,7 +260,7 @@ if (!pnp_bios_present()) return PNP_FUNCTION_NOT_SUPPORTED; status = call_pnp_bios(PNP_GET_NUM_SYS_DEV_NODES, 0, PNP_TS1, 2, PNP_TS1, PNP_DS, 0, 0, - data, sizeof(struct pnp_dev_node_info), 0, 0); + data, sizeof(struct pnp_dev_node_info), NULL, 0); data->no_nodes &= 0xff; return status; } @@ -323,7 +323,7 @@ if ( !boot && pnpbios_dont_use_current_config ) return PNP_FUNCTION_NOT_SUPPORTED; status = call_pnp_bios(PNP_SET_SYS_DEV_NODE, nodenum, 0, PNP_TS1, boot ? 2 : 1, PNP_DS, 0, 0, - data, 65536, 0, 0); + data, 65536, NULL, 0); return status; } @@ -381,7 +381,7 @@ if (!pnp_bios_present()) return PNP_FUNCTION_NOT_SUPPORTED; status = call_pnp_bios(PNP_GET_DOCKING_STATION_INFORMATION, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0, - data, sizeof(struct pnp_docking_station_info), 0, 0); + data, sizeof(struct pnp_docking_station_info), NULL, 0); return status; } diff -Nru a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c --- a/drivers/pnp/pnpbios/core.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/pnp/pnpbios/core.c 2004-07-13 12:24:00 -07:00 @@ -130,7 +130,7 @@ /* only one standardized param to hotplug command: type */ argv [0] = hotplug_path; argv [1] = "dock"; - argv [2] = 0; + argv [2] = NULL; /* minimal command environment */ envp [i++] = "HOME=/"; @@ -153,7 +153,7 @@ envp [i++] = scratch; scratch += sprintf (scratch, "DOCK=%x/%x/%x", info->location_id, info->serial, info->capabilities); - envp[i] = 0; + envp[i] = NULL; value = call_usermodehelper (argv [0], argv, envp, 0); kfree (buf); diff -Nru a/drivers/sbus/char/Kconfig b/drivers/sbus/char/Kconfig --- a/drivers/sbus/char/Kconfig 2004-07-13 12:24:01 -07:00 +++ b/drivers/sbus/char/Kconfig 2004-07-13 12:24:01 -07:00 @@ -39,7 +39,7 @@ config SUN_VIDEOPIX tristate "Videopix Frame Grabber (EXPERIMENTAL)" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && (BROKEN || !64BIT) help Say Y here to support the Videopix Frame Grabber from Sun Microsystems, commonly found on SPARCstations. This card, which is @@ -48,7 +48,7 @@ config SUN_AURORA tristate "Aurora Multiboard 1600se (EXPERIMENTAL)" - depends on EXPERIMENTAL + depends on EXPERIMENTAL && BROKEN help The Aurora Multiboard is a multi-port high-speed serial controller. If you have one of these, say Y. diff -Nru a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c --- a/drivers/sbus/char/bpp.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/sbus/char/bpp.c 2004-07-13 12:24:00 -07:00 @@ -482,7 +482,7 @@ return 0; } -static long read_nibble(unsigned minor, char *c, unsigned long cnt) +static long read_nibble(unsigned minor, char __user *c, unsigned long cnt) { unsigned long remaining = cnt; long rc; @@ -535,7 +535,7 @@ return cnt - remaining; } -static long read_ecp(unsigned minor, char *c, unsigned long cnt) +static long read_ecp(unsigned minor, char __user *c, unsigned long cnt) { unsigned long remaining; long rc; @@ -630,7 +630,7 @@ return cnt - remaining; } -static ssize_t bpp_read(struct file *f, char *c, size_t cnt, loff_t * ppos) +static ssize_t bpp_read(struct file *f, char __user *c, size_t cnt, loff_t * ppos) { long rc; unsigned minor = iminor(f->f_dentry->d_inode); @@ -692,7 +692,7 @@ * Compatibility mode handshaking is a matter of writing data, * strobing it, and waiting for the printer to stop being busy. */ -static long write_compat(unsigned minor, const char *c, unsigned long cnt) +static long write_compat(unsigned minor, const char __user *c, unsigned long cnt) { long rc; unsigned short pins = get_pins(minor); @@ -730,7 +730,7 @@ * Write data using ECP mode. Watch out that the port may be set up * for reading. If so, turn the port around. */ -static long write_ecp(unsigned minor, const char *c, unsigned long cnt) +static long write_ecp(unsigned minor, const char __user *c, unsigned long cnt) { unsigned short pins = get_pins(minor); unsigned long remaining = cnt; @@ -783,7 +783,7 @@ * that. Otherwise, terminate and do my writing in compat mode. This * is the safest course as any device can handle it. */ -static ssize_t bpp_write(struct file *f, const char *c, size_t cnt, loff_t * ppos) +static ssize_t bpp_write(struct file *f, const char __user *c, size_t cnt, loff_t * ppos) { long errno = 0; unsigned minor = iminor(f->f_dentry->d_inode); diff -Nru a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c --- a/drivers/sbus/char/cpwatchdog.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/sbus/char/cpwatchdog.c 2004-07-13 12:24:01 -07:00 @@ -337,6 +337,7 @@ { int setopt = 0; struct wd_timer* pTimer = (struct wd_timer*)file->private_data; + void __user *argp = (void __user *)arg; struct watchdog_info info = { 0, 0, @@ -351,22 +352,20 @@ { /* Generic Linux IOCTLs */ case WDIOC_GETSUPPORT: - if(copy_to_user((struct watchdog_info *)arg, - (struct watchdog_info *)&info, - sizeof(struct watchdog_info))) { + if(copy_to_user(argp, &info, sizeof(struct watchdog_info))) { return(-EFAULT); } break; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - if (put_user(0, (int *) arg)) + if (put_user(0, (int __user *)argp)) return -EFAULT; break; case WDIOC_KEEPALIVE: wd_pingtimer(pTimer); break; case WDIOC_SETOPTIONS: - if(copy_from_user(&setopt, (void*) arg, sizeof(unsigned int))) { + if(copy_from_user(&setopt, argp, sizeof(unsigned int))) { return -EFAULT; } if(setopt & WDIOS_DISABLECARD) { @@ -388,7 +387,7 @@ /* Solaris-compatible IOCTLs */ case WIOCGSTAT: setopt = wd_getstatus(pTimer); - if(copy_to_user((void*)arg, &setopt, sizeof(unsigned int))) { + if(copy_to_user(argp, &setopt, sizeof(unsigned int))) { return(-EFAULT); } break; @@ -409,10 +408,10 @@ return(0); } -static ssize_t wd_write( struct file *file, - const char *buf, - size_t count, - loff_t *ppos) +static ssize_t wd_write(struct file *file, + const char __user *buf, + size_t count, + loff_t *ppos) { struct wd_timer* pTimer = (struct wd_timer*)file->private_data; @@ -430,7 +429,7 @@ return 0; } -static ssize_t wd_read(struct file * file, char * buffer, +static ssize_t wd_read(struct file * file, char __user *buffer, size_t count, loff_t *ppos) { #ifdef WD_DEBUG diff -Nru a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c --- a/drivers/sbus/char/display7seg.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/sbus/char/display7seg.c 2004-07-13 12:24:01 -07:00 @@ -70,7 +70,7 @@ * FLIP - Inverts display for upside-down mounted board * bits 0-4 - 7-segment display contents */ -volatile u8* d7s_regs = 0; +volatile u8* d7s_regs = NULL; static inline void d7s_free(void) { @@ -128,7 +128,7 @@ /* assign device register values * we mask-out D7S_FLIP if in sol_compat mode */ - if (get_user(ireg, (int *) arg)) + if (get_user(ireg, (int __user *) arg)) return -EFAULT; if (0 != sol_compat) { (regs & D7S_FLIP) ? @@ -144,7 +144,7 @@ * This driver will not misinform you about the state * of your hardware while in sol_compat mode */ - if (put_user(regs, (int *) arg)) + if (put_user(regs, (int __user *) arg)) return -EFAULT; break; diff -Nru a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c --- a/drivers/sbus/char/envctrl.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/sbus/char/envctrl.c 2004-07-13 12:24:00 -07:00 @@ -556,7 +556,7 @@ * Return: Number of read bytes. 0 for error. */ static ssize_t -envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos) +envctrl_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct i2c_child_t *pchild; unsigned char data[10]; @@ -574,7 +574,7 @@ data[0] = (unsigned char)(warning_temperature); ret = 1; - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -584,7 +584,7 @@ data[0] = (unsigned char)(shutdown_temperature); ret = 1; - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -592,7 +592,7 @@ if (!(pchild = envctrl_get_i2c_child(ENVCTRL_MTHRBDTEMP_MON))) return 0; ret = envctrl_read_noncpu_info(pchild, ENVCTRL_MTHRBDTEMP_MON, data); - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -602,7 +602,7 @@ ret = envctrl_read_cpu_info(read_cpu, pchild, ENVCTRL_CPUTEMP_MON, data); /* Reset cpu to the default cpu0. */ - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -612,7 +612,7 @@ ret = envctrl_read_cpu_info(read_cpu, pchild, ENVCTRL_CPUVOLTAGE_MON, data); /* Reset cpu to the default cpu0. */ - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -620,7 +620,7 @@ if (!(pchild = envctrl_get_i2c_child(ENVCTRL_SCSITEMP_MON))) return 0; ret = envctrl_read_noncpu_info(pchild, ENVCTRL_SCSITEMP_MON, data); - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -628,7 +628,7 @@ if (!(pchild = envctrl_get_i2c_child(ENVCTRL_ETHERTEMP_MON))) return 0; ret = envctrl_read_noncpu_info(pchild, ENVCTRL_ETHERTEMP_MON, data); - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -637,7 +637,7 @@ return 0; data[0] = envctrl_i2c_read_8574(pchild->addr); ret = envctrl_i2c_fan_status(pchild,data[0], data); - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -646,7 +646,7 @@ return 0; data[0] = envctrl_i2c_read_8574(pchild->addr); ret = envctrl_i2c_globaladdr(pchild, data[0], data); - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -657,7 +657,7 @@ return 0; data[0] = envctrl_i2c_read_8574(pchild->addr); ret = envctrl_i2c_voltage_status(pchild, data[0], data); - if (copy_to_user((unsigned char *)buf, data, ret)) + if (copy_to_user(buf, data, ret)) ret = -EFAULT; break; @@ -676,7 +676,7 @@ envctrl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - char *infobuf; + char __user *infobuf; switch (cmd) { case ENVCTRL_RD_WARNING_TEMPERATURE: @@ -695,7 +695,7 @@ /* Check to see if application passes in any cpu number, * the default is cpu0. */ - infobuf = (char *) arg; + infobuf = (char __user *) arg; if (infobuf == NULL) { read_cpu = 0; }else { @@ -719,7 +719,7 @@ static int envctrl_open(struct inode *inode, struct file *file) { - file->private_data = 0; + file->private_data = NULL; return 0; } diff -Nru a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c --- a/drivers/sbus/char/flash.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/sbus/char/flash.c 2004-07-13 12:24:01 -07:00 @@ -105,7 +105,7 @@ } static ssize_t -flash_read(struct file * file, char * buf, +flash_read(struct file * file, char __user * buf, size_t count, loff_t *ppos) { unsigned long p = file->f_pos; @@ -161,10 +161,10 @@ static int __init flash_init(void) { struct sbus_bus *sbus; - struct sbus_dev *sdev = 0; + struct sbus_dev *sdev = NULL; #ifdef CONFIG_PCI struct linux_ebus *ebus; - struct linux_ebus_device *edev = 0; + struct linux_ebus_device *edev = NULL; struct linux_prom_registers regs[2]; int len, nregs; #endif diff -Nru a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c --- a/drivers/sbus/char/openprom.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/sbus/char/openprom.c 2004-07-13 12:24:01 -07:00 @@ -67,7 +67,7 @@ * structure will be placed in "*opp_p". Return value is the length * of the user supplied buffer. */ -static int copyin(struct openpromio *info, struct openpromio **opp_p) +static int copyin(struct openpromio __user *info, struct openpromio **opp_p) { unsigned int bufsize; @@ -98,7 +98,7 @@ return bufsize; } -static int getstrings(struct openpromio *info, struct openpromio **opp_p) +static int getstrings(struct openpromio __user *info, struct openpromio **opp_p) { int n, bufsize; char c; @@ -132,7 +132,7 @@ /* * Copy an openpromio structure in kernel space back to user space. */ -static int copyout(void *info, struct openpromio *opp, int len) +static int copyout(void __user *info, struct openpromio *opp, int len) { if (copy_to_user(info, opp, len)) return -EFAULT; @@ -150,11 +150,12 @@ struct openpromio *opp; int bufsize, len, error = 0; static int cnt; + void __user *argp = (void __user *)arg; if (cmd == OPROMSETOPT) - bufsize = getstrings((void *)arg, &opp); + bufsize = getstrings(argp, &opp); else - bufsize = copyin((void *)arg, &opp); + bufsize = copyin(argp, &opp); if (bufsize < 0) return bufsize; @@ -165,7 +166,7 @@ len = prom_getproplen(node, opp->oprom_array); if (len <= 0 || len > bufsize) { - error = copyout((void *)arg, opp, sizeof(int)); + error = copyout(argp, opp, sizeof(int)); break; } @@ -175,7 +176,7 @@ opp->oprom_array[len] = '\0'; opp->oprom_size = len; - error = copyout((void *)arg, opp, sizeof(int) + bufsize); + error = copyout(argp, opp, sizeof(int) + bufsize); break; case OPROMNXTOPT: @@ -184,7 +185,7 @@ len = strlen(buf); if (len == 0 || len + 1 > bufsize) { - error = copyout((void *)arg, opp, sizeof(int)); + error = copyout(argp, opp, sizeof(int)); break; } @@ -192,7 +193,7 @@ opp->oprom_array[len] = '\0'; opp->oprom_size = ++len; - error = copyout((void *)arg, opp, sizeof(int) + bufsize); + error = copyout(argp, opp, sizeof(int) + bufsize); break; case OPROMSETOPT: @@ -227,7 +228,7 @@ *((int *)opp->oprom_array) = node; opp->oprom_size = sizeof(int); - error = copyout((void *)arg, opp, bufsize + sizeof(int)); + error = copyout(argp, opp, bufsize + sizeof(int)); break; case OPROMPCI2NODE: @@ -246,7 +247,7 @@ data->current_node = node; *((int *)opp->oprom_array) = node; opp->oprom_size = sizeof(int); - error = copyout((void *)arg, opp, bufsize + sizeof(int)); + error = copyout(argp, opp, bufsize + sizeof(int)); } #endif } @@ -258,7 +259,7 @@ *((int *)opp->oprom_array) = node; opp->oprom_size = sizeof(int); - error = copyout((void *)arg, opp, bufsize + sizeof(int)); + error = copyout(argp, opp, bufsize + sizeof(int)); break; case OPROMGETBOOTARGS: @@ -274,7 +275,7 @@ strcpy(opp->oprom_array, buf); opp->oprom_size = len; - error = copyout((void *)arg, opp, bufsize + sizeof(int)); + error = copyout(argp, opp, bufsize + sizeof(int)); break; case OPROMU2P: @@ -317,7 +318,7 @@ } /* Copy in a whole string from userspace into kernelspace. */ -static int copyin_string(char *user, size_t len, char **ptr) +static int copyin_string(char __user *user, size_t len, char **ptr) { char *tmp; @@ -347,6 +348,7 @@ unsigned int cmd, unsigned long arg) { DATA *data = (DATA *) file->private_data; + void __user *argp = (void __user *)arg; struct opiocdesc op; int error, node, len; char *str, *tmp; @@ -355,7 +357,7 @@ switch (cmd) { case OPIOCGET: - if (copy_from_user(&op, (void *)arg, sizeof(op))) + if (copy_from_user(&op, argp, sizeof(op))) return -EFAULT; if (!goodnode(op.op_nodeid,data)) @@ -377,7 +379,7 @@ if (len <= 0) { kfree(str); /* Verified by the above copy_from_user */ - if (__copy_to_user((void *)arg, &op, + if (__copy_to_user(argp, &op, sizeof(op))) return -EFAULT; return 0; @@ -393,7 +395,7 @@ tmp[len] = '\0'; - if (__copy_to_user((void *)arg, &op, sizeof(op)) != 0 + if (__copy_to_user(argp, &op, sizeof(op)) != 0 || copy_to_user(op.op_buf, tmp, len) != 0) error = -EFAULT; @@ -403,7 +405,7 @@ return error; case OPIOCNEXTPROP: - if (copy_from_user(&op, (void *)arg, sizeof(op))) + if (copy_from_user(&op, argp, sizeof(op))) return -EFAULT; if (!goodnode(op.op_nodeid,data)) @@ -425,7 +427,7 @@ len = op.op_buflen = 0; } - error = verify_area(VERIFY_WRITE, (void *)arg, sizeof(op)); + error = verify_area(VERIFY_WRITE, argp, sizeof(op)); if (error) { kfree(str); return error; @@ -437,7 +439,7 @@ return error; } - error = __copy_to_user((void *)arg, &op, sizeof(op)); + error = __copy_to_user(argp, &op, sizeof(op)); if (!error) error = __copy_to_user(op.op_buf, tmp, len); kfree(str); @@ -445,7 +447,7 @@ return error; case OPIOCSET: - if (copy_from_user(&op, (void *)arg, sizeof(op))) + if (copy_from_user(&op, argp, sizeof(op))) return -EFAULT; if (!goodnode(op.op_nodeid,data)) @@ -472,13 +474,13 @@ return 0; case OPIOCGETOPTNODE: - if (copy_to_user((void *)arg, &options_node, sizeof(int))) + if (copy_to_user(argp, &options_node, sizeof(int))) return -EFAULT; return 0; case OPIOCGETNEXT: case OPIOCGETCHILD: - if (copy_from_user(&node, (void *)arg, sizeof(int))) + if (copy_from_user(&node, argp, sizeof(int))) return -EFAULT; if (cmd == OPIOCGETNEXT) @@ -486,7 +488,7 @@ else node = __prom_getchild(node); - if (__copy_to_user((void *)arg, &node, sizeof(int))) + if (__copy_to_user(argp, &node, sizeof(int))) return -EFAULT; return 0; diff -Nru a/drivers/sbus/char/riowatchdog.c b/drivers/sbus/char/riowatchdog.c --- a/drivers/sbus/char/riowatchdog.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/sbus/char/riowatchdog.c 2004-07-13 12:24:01 -07:00 @@ -130,18 +130,19 @@ static struct watchdog_info info = { WDIOF_SETTIMEOUT, 0, "Natl. Semiconductor PC97317" }; + void __user *argp = (void __user *)arg; unsigned int options; int new_margin; switch (cmd) { case WDIOC_GETSUPPORT: - if (copy_to_user((struct watchdog_info *) arg, &info, sizeof(info))) + if (copy_to_user(argp, &info, sizeof(info))) return -EFAULT; break; case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: - if (put_user(0, (int *) arg)) + if (put_user(0, (int __user *)argp)) return -EFAULT; break; @@ -150,7 +151,7 @@ break; case WDIOC_SETOPTIONS: - if (copy_from_user(&options, (void *) arg, sizeof(options))) + if (copy_from_user(&options, argp, sizeof(options))) return -EFAULT; if (options & WDIOS_DISABLECARD) @@ -163,7 +164,7 @@ break; case WDIOC_SETTIMEOUT: - if (get_user(new_margin, (int *)arg)) + if (get_user(new_margin, (int __user *)argp)) return -EFAULT; if ((new_margin < 60) || (new_margin > (255 * 60))) return -EINVAL; @@ -172,7 +173,7 @@ /* Fall */ case WDIOC_GETTIMEOUT: - return put_user(riowd_timeout * 60, (int *)arg); + return put_user(riowd_timeout * 60, (int __user *)argp); default: return -EINVAL; @@ -181,7 +182,7 @@ return 0; } -static ssize_t riowd_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +static ssize_t riowd_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { if (ppos != &file->f_pos) return -ESPIPE; diff -Nru a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c --- a/drivers/sbus/char/rtc.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/sbus/char/rtc.c 2004-07-13 12:24:00 -07:00 @@ -85,6 +85,7 @@ unsigned long arg) { struct rtc_time rtc_tm; + void __user *argp = (void __user *)arg; switch (cmd) { @@ -92,7 +93,7 @@ memset(&rtc_tm, 0, sizeof(struct rtc_time)); get_rtc_time(&rtc_tm); - if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time))) + if (copy_to_user(argp, &rtc_tm, sizeof(struct rtc_time))) return -EFAULT; return 0; @@ -102,7 +103,7 @@ if (!capable(CAP_SYS_TIME)) return -EPERM; - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, sizeof(struct rtc_time))) + if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) return -EFAULT; set_rtc_time(&rtc_tm); diff -Nru a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c --- a/drivers/sbus/char/vfc_dev.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/sbus/char/vfc_dev.c 2004-07-13 12:24:01 -07:00 @@ -226,7 +226,7 @@ return 0; } -static int vfc_debug(struct vfc_dev *dev, int cmd, unsigned long arg) +static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp) { struct vfc_debug_inout inout; unsigned char *buffer; @@ -236,15 +236,14 @@ switch(cmd) { case VFC_I2C_SEND: - if(copy_from_user(&inout, (void *)arg, sizeof(inout))) + if(copy_from_user(&inout, argp, sizeof(inout))) return -EFAULT; - buffer = kmalloc(inout.len*sizeof(char), GFP_KERNEL); + buffer = kmalloc(inout.len, GFP_KERNEL); if (buffer == NULL) return -ENOMEM; - if(copy_from_user(buffer, inout.buffer, - inout.len*sizeof(char))) { + if(copy_from_user(buffer, inout.buffer, inout.len)) { kfree(buffer); return -EFAULT; } @@ -253,9 +252,9 @@ vfc_lock_device(dev); inout.ret= vfc_i2c_sendbuf(dev,inout.addr & 0xff, - inout.buffer,inout.len); + buffer,inout.len); - if (copy_to_user((void *)arg,&inout,sizeof(inout))) { + if (copy_to_user(argp,&inout,sizeof(inout))) { kfree(buffer); return -EFAULT; } @@ -263,14 +262,14 @@ break; case VFC_I2C_RECV: - if (copy_from_user(&inout, (void *)arg, sizeof(inout))) + if (copy_from_user(&inout, argp, sizeof(inout))) return -EFAULT; buffer = kmalloc(inout.len, GFP_KERNEL); if (buffer == NULL) return -ENOMEM; - memset(buffer,0,inout.len*sizeof(char)); + memset(buffer,0,inout.len); vfc_lock_device(dev); inout.ret= vfc_i2c_recvbuf(dev,inout.addr & 0xff @@ -281,7 +280,7 @@ kfree(buffer); return -EFAULT; } - if (copy_to_user((void *)arg,&inout,sizeof(inout))) { + if (copy_to_user(argp,&inout,sizeof(inout))) { kfree(buffer); return -EFAULT; } @@ -340,7 +339,7 @@ { int setcmd, ret = 0; - if (copy_from_user(&setcmd,(void *)arg,sizeof(unsigned int))) + if (copy_from_user(&setcmd,(void __user *)arg,sizeof(unsigned int))) return -EFAULT; VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCSCTRL) arg=0x%x\n", @@ -398,7 +397,7 @@ int ret = 0; int cmd; - if(copy_from_user(&cmd, (void *)arg, sizeof(unsigned int))) { + if(copy_from_user(&cmd, (void __user *)arg, sizeof(unsigned int))) { VFC_IOCTL_DEBUG_PRINTK(("vfc%d: User passed bogus pointer to " "vfc_port_change_ioctl\n", dev->instance)); @@ -468,7 +467,7 @@ int ret = 0; int cmd; - if(copy_from_user(&cmd, (void *)arg, sizeof(unsigned int))) { + if(copy_from_user(&cmd, (void __user *)arg, sizeof(unsigned int))) { VFC_IOCTL_DEBUG_PRINTK(("vfc%d: User passed bogus pointer to " "vfc_set_video_ioctl\n", dev->instance)); @@ -542,7 +541,7 @@ VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCGVID) returning status 0x%x; " "buf[0]=%x\n", dev->instance, status, buf[0])); - if (copy_to_user((void *)arg,&status,sizeof(unsigned int))) { + if (copy_to_user((void __user *)arg,&status,sizeof(unsigned int))) { VFC_IOCTL_DEBUG_PRINTK(("vfc%d: User passed bogus pointer to " "vfc_get_video_ioctl\n", dev->instance)); @@ -557,6 +556,7 @@ int ret = 0; unsigned int tmp; struct vfc_dev *dev; + void __user *argp = (void __user *)arg; dev = vfc_get_dev_ptr(iminor(inode)); if(dev == NULL) @@ -568,7 +568,7 @@ VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCGCTRL)\n", dev->instance)); #endif tmp = sbus_readl(&dev->regs->control); - if(copy_to_user((void *)arg, &tmp, sizeof(unsigned int))) { + if(copy_to_user(argp, &tmp, sizeof(unsigned int))) { ret = -EFAULT; break; } @@ -585,7 +585,7 @@ break; case VFCHUE: VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCHUE)\n", dev->instance)); - if(copy_from_user(&tmp,(void *)arg,sizeof(unsigned int))) { + if(copy_from_user(&tmp,argp,sizeof(unsigned int))) { VFC_IOCTL_DEBUG_PRINTK(("vfc%d: User passed bogus pointer " "to IOCTL(VFCHUE)", dev->instance)); ret = -EFAULT; @@ -603,21 +603,19 @@ VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCRDINFO)\n", dev->instance)); break; default: - ret = vfc_debug(vfc_get_dev_ptr(iminor(inode)), - cmd, arg); + ret = vfc_debug(vfc_get_dev_ptr(iminor(inode)), cmd, argp); break; }; return ret; } -static int vfc_mmap(struct inode *inode, struct file *file, - struct vm_area_struct *vma) +static int vfc_mmap(struct file *file, struct vm_area_struct *vma) { unsigned int map_size, ret, map_offset; struct vfc_dev *dev; - dev = vfc_get_dev_ptr(iminor(inode)); + dev = vfc_get_dev_ptr(iminor(file->f_dentry->d_inode)); if(dev == NULL) return -ENODEV; diff -Nru a/drivers/sbus/dvma.c b/drivers/sbus/dvma.c --- a/drivers/sbus/dvma.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/sbus/dvma.c 2004-07-13 12:24:01 -07:00 @@ -29,7 +29,7 @@ { printk("dma%d: ", num_dma); - dma->next = 0; + dma->next = NULL; dma->running = 0; /* No transfers going on as of yet */ dma->allocated = 0; /* No one has allocated us yet */ switch(sbus_readl(dma->regs + DMA_CSR)&DMA_DEVICE_ID) { diff -Nru a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c --- a/drivers/sbus/sbus.c 2004-07-13 12:24:02 -07:00 +++ b/drivers/sbus/sbus.c 2004-07-13 12:24:02 -07:00 @@ -192,7 +192,7 @@ while((this_node = prom_getsibling(this_node)) != 0) { this_dev->next = kmalloc(sizeof(struct sbus_dev), GFP_ATOMIC); this_dev = this_dev->next; - this_dev->next = 0; + this_dev->next = NULL; this_dev->parent = parent; this_dev->bus = sbus; @@ -202,7 +202,7 @@ this_dev->child = kmalloc(sizeof(struct sbus_dev), GFP_ATOMIC); this_dev->child->bus = sbus; - this_dev->child->next = 0; + this_dev->child->next = NULL; fill_sbus_device(prom_getchild(this_node), this_dev->child); sbus_do_child_siblings(prom_getchild(this_node), this_dev->child, this_dev, sbus); @@ -309,6 +309,10 @@ extern void register_proc_sparc_ioport(void); extern void firetruck_init(void); +#ifdef CONFIG_SUN4 +extern void sun4_dvma_init(void); +#endif + static int __init sbus_init(void) { int nd, this_sbus, sbus_devs, topnd, iommund; @@ -439,7 +443,7 @@ GFP_ATOMIC); /* Fill it */ this_dev->child->bus = sbus; - this_dev->child->next = 0; + this_dev->child->next = NULL; fill_sbus_device(prom_getchild(sbus_devs), this_dev->child); sbus_do_child_siblings(prom_getchild(sbus_devs), @@ -469,7 +473,7 @@ GFP_ATOMIC); /* Fill it */ this_dev->child->bus = sbus; - this_dev->child->next = 0; + this_dev->child->next = NULL; fill_sbus_device(prom_getchild(sbus_devs), this_dev->child); sbus_do_child_siblings(prom_getchild(sbus_devs), diff -Nru a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c --- a/drivers/scsi/aacraid/aachba.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/scsi/aacraid/aachba.c 2004-07-13 12:24:00 -07:00 @@ -1080,7 +1080,7 @@ } } -static int query_disk(struct aac_dev *dev, void *arg) +static int query_disk(struct aac_dev *dev, void __user *arg) { struct aac_query_disk qd; struct fsa_scsi_hba *fsa_dev_ptr; @@ -1117,7 +1117,7 @@ return 0; } -static int force_delete_disk(struct aac_dev *dev, void *arg) +static int force_delete_disk(struct aac_dev *dev, void __user *arg) { struct aac_delete_disk dd; struct fsa_scsi_hba *fsa_dev_ptr; @@ -1140,7 +1140,7 @@ return 0; } -static int delete_disk(struct aac_dev *dev, void *arg) +static int delete_disk(struct aac_dev *dev, void __user *arg) { struct aac_delete_disk dd; struct fsa_scsi_hba *fsa_dev_ptr; @@ -1167,7 +1167,7 @@ } } -int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg) +int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg) { switch (cmd) { case FSACTL_QUERY_DISK: diff -Nru a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h --- a/drivers/scsi/aacraid/aacraid.h 2004-07-13 12:24:00 -07:00 +++ b/drivers/scsi/aacraid/aacraid.h 2004-07-13 12:24:00 -07:00 @@ -1237,7 +1237,7 @@ { u32 fibctx; s32 wait; - char *fib; + char __user *fib; }; struct revision @@ -1448,8 +1448,8 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev); int aac_get_containers(struct aac_dev *dev); int aac_scsi_cmd(struct scsi_cmnd *cmd); -int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg); -int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg); +int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg); +int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg); int aac_rx_init(struct aac_dev *dev); int aac_rkt_init(struct aac_dev *dev); int aac_sa_init(struct aac_dev *dev); diff -Nru a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c --- a/drivers/scsi/aacraid/commctrl.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/scsi/aacraid/commctrl.c 2004-07-13 12:24:00 -07:00 @@ -52,7 +52,7 @@ * program. */ -static int ioctl_send_fib(struct aac_dev * dev, void *arg) +static int ioctl_send_fib(struct aac_dev * dev, void __user *arg) { struct hw_fib * kfib; struct fib *fibptr; @@ -127,7 +127,7 @@ * passed in from the user. */ -static int open_getadapter_fib(struct aac_dev * dev, void *arg) +static int open_getadapter_fib(struct aac_dev * dev, void __user *arg) { struct aac_fib_context * fibctx; int status; @@ -199,7 +199,7 @@ * passed in from the user. */ -static int next_getadapter_fib(struct aac_dev * dev, void *arg) +static int next_getadapter_fib(struct aac_dev * dev, void __user *arg) { struct fib_ioctl f; struct fib *fib; @@ -332,7 +332,7 @@ * This routine will close down the fibctx passed in from the user. */ -static int close_getadapter_fib(struct aac_dev * dev, void *arg) +static int close_getadapter_fib(struct aac_dev * dev, void __user *arg) { struct aac_fib_context *fibctx; int status; @@ -384,7 +384,7 @@ * simple! */ -static int check_revision(struct aac_dev *dev, void *arg) +static int check_revision(struct aac_dev *dev, void __user *arg) { struct revision response; @@ -403,20 +403,20 @@ * */ -int aac_send_raw_srb(struct aac_dev* dev, void* arg) +int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) { struct fib* srbfib; int status; struct aac_srb *srbcmd; - struct aac_srb *user_srb = arg; - struct aac_srb_reply* user_reply; + struct aac_srb __user *user_srb = arg; + struct aac_srb_reply __user *user_reply; struct aac_srb_reply* reply; u32 fibsize = 0; u32 flags = 0; s32 rcode = 0; u32 data_dir; - ulong sg_user[32]; - ulong sg_list[32]; + void __user *sg_user[32]; + void *sg_list[32]; u32 sg_indx = 0; u32 byte_count = 0; u32 actual_fibsize = 0; @@ -437,7 +437,7 @@ srbcmd = (struct aac_srb*) fib_data(srbfib); - if(copy_from_user((void*)&fibsize, (void*)&user_srb->count,sizeof(u32))){ + if(copy_from_user(&fibsize, &user_srb->count,sizeof(u32))){ printk(KERN_DEBUG"aacraid: Could not copy data size from user\n"); rcode = -EFAULT; goto cleanup; @@ -512,12 +512,12 @@ rcode = -ENOMEM; goto cleanup; } - sg_user[i] = (ulong)psg->sg[i].addr; - sg_list[i] = (ulong)p; // save so we can clean up later + sg_user[i] = (void __user *)psg->sg[i].addr; + sg_list[i] = p; // save so we can clean up later sg_indx = i; if( flags & SRB_DataOut ){ - if(copy_from_user(p,psg->sg[i].addr,psg->sg[i].count)){ + if(copy_from_user(p,sg_user[i],psg->sg[i].count)){ printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n"); rcode = -EFAULT; goto cleanup; @@ -533,7 +533,7 @@ } srbcmd->count = cpu_to_le32(byte_count); - status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,0,0); + status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL); } else { struct sgmap* psg = &srbcmd->sg; byte_count = 0; @@ -559,12 +559,12 @@ rcode = -ENOMEM; goto cleanup; } - sg_user[i] = (ulong)(psg->sg[i].addr); - sg_list[i] = (ulong)p; // save so we can clean up later + sg_user[i] = (void __user *)(psg->sg[i].addr); + sg_list[i] = p; // save so we can clean up later sg_indx = i; if( flags & SRB_DataOut ){ - if(copy_from_user((void*)p,(void*)(ulong)(psg->sg[i].addr),psg->sg[i].count)){ + if(copy_from_user(p,sg_user[i],psg->sg[i].count)){ printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n"); rcode = -EFAULT; goto cleanup; @@ -577,7 +577,7 @@ byte_count += psg->sg[i].count; } srbcmd->count = cpu_to_le32(byte_count); - status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, 0, 0); + status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL); } if (status != 0){ @@ -588,7 +588,7 @@ if( flags & SRB_DataIn ) { for(i = 0 ; i <= sg_indx; i++){ - if(copy_to_user((void*)(sg_user[i]),(void*)(sg_list[i]),le32_to_cpu(srbcmd->sg.sg[i].count))){ + if(copy_to_user(sg_user[i],sg_list[i],le32_to_cpu(srbcmd->sg.sg[i].count))){ printk(KERN_DEBUG"aacraid: Could not copy sg data to user\n"); rcode = -EFAULT; goto cleanup; @@ -606,7 +606,7 @@ cleanup: for(i=0; i <= sg_indx; i++){ - kfree((void*)sg_list[i]); + kfree(sg_list[i]); } fib_complete(srbfib); fib_free(srbfib); @@ -621,14 +621,14 @@ }; -int aac_get_pci_info(struct aac_dev* dev, void* arg) +int aac_get_pci_info(struct aac_dev* dev, void __user *arg) { struct aac_pci_info pci_info; pci_info.bus = dev->pdev->bus->number; pci_info.slot = PCI_SLOT(dev->pdev->devfn); - if(copy_to_user( arg, (void*)&pci_info, sizeof(struct aac_pci_info))){ + if (copy_to_user(arg, &pci_info, sizeof(struct aac_pci_info))) { printk(KERN_DEBUG "aacraid: Could not copy pci info\n"); return -EFAULT; } @@ -636,7 +636,7 @@ } -int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg) +int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg) { int status; diff -Nru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c --- a/drivers/scsi/aacraid/linit.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/scsi/aacraid/linit.c 2004-07-13 12:24:00 -07:00 @@ -356,7 +356,7 @@ return 0; } -static int aac_ioctl(struct scsi_device *sdev, int cmd, void * arg) +static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg) { struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; return aac_do_ioctl(dev, cmd, arg); @@ -463,7 +463,7 @@ static int aac_cfg_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - return aac_do_ioctl(file->private_data, cmd, (void *)arg); + return aac_do_ioctl(file->private_data, cmd, (void __user *)arg); } static struct file_operations aac_cfg_fops = { diff -Nru a/drivers/scsi/i60uscsi.c b/drivers/scsi/i60uscsi.c --- a/drivers/scsi/i60uscsi.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/scsi/i60uscsi.c 2004-07-13 12:24:00 -07:00 @@ -621,7 +621,7 @@ pScb->SCB_XferLen = 0; pScb->SCB_SGLen = 0; - pVirEscb->SCB_Srb = 0; + pVirEscb->SCB_Srb = NULL; pVirEscb->SCB_Srb = SCpnt; orc_exec_scb(pHCB, pScb); /* Start execute SCB */ spin_unlock_irqrestore(&(pHCB->BitAllocFlagLock), flags); diff -Nru a/drivers/scsi/imm.c b/drivers/scsi/imm.c --- a/drivers/scsi/imm.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/scsi/imm.c 2004-07-13 12:24:01 -07:00 @@ -793,7 +793,7 @@ imm_pb_dismiss(dev); spin_lock_irqsave(host->host_lock, flags); - dev->cur_cmd = 0; + dev->cur_cmd = NULL; cmd->scsi_done(cmd); spin_unlock_irqrestore(host->host_lock, flags); return; diff -Nru a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c --- a/drivers/scsi/megaraid.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/scsi/megaraid.c 2004-07-13 12:24:00 -07:00 @@ -335,6 +335,18 @@ return 0; } +/** + * mega_runpendq() + * @adapter - pointer to our soft state + * + * Runs through the list of pending requests. + */ +static inline void +mega_runpendq(adapter_t *adapter) +{ + if(!list_empty(&adapter->pending_list)) + __mega_runpendq(adapter); +} /* * megaraid_queue() @@ -384,6 +396,95 @@ return busy; } +/** + * mega_allocate_scb() + * @adapter - pointer to our soft state + * @cmd - scsi command from the mid-layer + * + * Allocate a SCB structure. This is the central structure for controller + * commands. + */ +static inline scb_t * +mega_allocate_scb(adapter_t *adapter, Scsi_Cmnd *cmd) +{ + struct list_head *head = &adapter->free_list; + scb_t *scb; + + /* Unlink command from Free List */ + if( !list_empty(head) ) { + + scb = list_entry(head->next, scb_t, list); + + list_del_init(head->next); + + scb->state = SCB_ACTIVE; + scb->cmd = cmd; + scb->dma_type = MEGA_DMA_TYPE_NONE; + + return scb; + } + + return NULL; +} + +/** + * mega_get_ldrv_num() + * @adapter - pointer to our soft state + * @cmd - scsi mid layer command + * @channel - channel on the controller + * + * Calculate the logical drive number based on the information in scsi command + * and the channel number. + */ +static inline int +mega_get_ldrv_num(adapter_t *adapter, Scsi_Cmnd *cmd, int channel) +{ + int tgt; + int ldrv_num; + + tgt = cmd->device->id; + + if ( tgt > adapter->this_id ) + tgt--; /* we do not get inquires for initiator id */ + + ldrv_num = (channel * 15) + tgt; + + + /* + * If we have a logical drive with boot enabled, project it first + */ + if( adapter->boot_ldrv_enabled ) { + if( ldrv_num == 0 ) { + ldrv_num = adapter->boot_ldrv; + } + else { + if( ldrv_num <= adapter->boot_ldrv ) { + ldrv_num--; + } + } + } + + /* + * If "delete logical drive" feature is enabled on this controller. + * Do only if at least one delete logical drive operation was done. + * + * Also, after logical drive deletion, instead of logical drive number, + * the value returned should be 0x80+logical drive id. + * + * These is valid only for IO commands. + */ + + if (adapter->support_random_del && adapter->read_ldidmap ) + switch (cmd->cmnd[0]) { + case READ_6: /* fall through */ + case WRITE_6: /* fall through */ + case READ_10: /* fall through */ + case WRITE_10: + ldrv_num += 0x80; + } + + return ldrv_num; +} /** * mega_build_cmd() @@ -966,52 +1067,6 @@ return epthru; } - -/** - * mega_allocate_scb() - * @adapter - pointer to our soft state - * @cmd - scsi command from the mid-layer - * - * Allocate a SCB structure. This is the central structure for controller - * commands. - */ -static inline scb_t * -mega_allocate_scb(adapter_t *adapter, Scsi_Cmnd *cmd) -{ - struct list_head *head = &adapter->free_list; - scb_t *scb; - - /* Unlink command from Free List */ - if( !list_empty(head) ) { - - scb = list_entry(head->next, scb_t, list); - - list_del_init(head->next); - - scb->state = SCB_ACTIVE; - scb->cmd = cmd; - scb->dma_type = MEGA_DMA_TYPE_NONE; - - return scb; - } - - return NULL; -} - - -/** - * mega_runpendq() - * @adapter - pointer to our soft state - * - * Runs through the list of pending requests. - */ -static inline void -mega_runpendq(adapter_t *adapter) -{ - if(!list_empty(&adapter->pending_list)) - __mega_runpendq(adapter); -} - static void __mega_runpendq(adapter_t *adapter) { @@ -1043,7 +1098,7 @@ * busy. We also take the scb from the pending list if the mailbox is * available. */ -static inline int +static int issue_scb(adapter_t *adapter, scb_t *scb) { volatile mbox64_t *mbox64 = adapter->mbox64; @@ -1104,6 +1159,16 @@ return 0; } +/* + * Wait until the controller's mailbox is available + */ +static inline int +mega_busywait_mbox (adapter_t *adapter) +{ + if (adapter->mbox->m_in.busy) + return __mega_busywait_mbox(adapter); + return 0; +} /** * issue_scb_block() @@ -1350,7 +1415,7 @@ * * Complete the comamnds and call the scsi mid-layer callback hooks. */ -static inline void +static void mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) { mega_ext_passthru *epthru = NULL; @@ -1671,17 +1736,6 @@ } -/* - * Wait until the controller's mailbox is available - */ -static inline int -mega_busywait_mbox (adapter_t *adapter) -{ - if (adapter->mbox->m_in.busy) - return __mega_busywait_mbox(adapter); - return 0; -} - static int __mega_busywait_mbox (adapter_t *adapter) { @@ -2017,6 +2071,49 @@ return FALSE; } +static inline int +make_local_pdev(adapter_t *adapter, struct pci_dev **pdev) +{ + *pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); + + if( *pdev == NULL ) return -1; + + memcpy(*pdev, adapter->dev, sizeof(struct pci_dev)); + + if( pci_set_dma_mask(*pdev, 0xffffffff) != 0 ) { + kfree(*pdev); + return -1; + } + + return 0; +} + +static inline void +free_local_pdev(struct pci_dev *pdev) +{ + kfree(pdev); +} + +/** + * mega_allocate_inquiry() + * @dma_handle - handle returned for dma address + * @pdev - handle to pci device + * + * allocates memory for inquiry structure + */ +static inline void * +mega_allocate_inquiry(dma_addr_t *dma_handle, struct pci_dev *pdev) +{ + return pci_alloc_consistent(pdev, sizeof(mega_inquiry3), dma_handle); +} + + +static inline void +mega_free_inquiry(void *inquiry, dma_addr_t dma_handle, struct pci_dev *pdev) +{ + pci_free_consistent(pdev, sizeof(mega_inquiry3), inquiry, dma_handle); +} + #ifdef CONFIG_PROC_FS /* Following code handles /proc fs */ @@ -3269,13 +3366,13 @@ nitioctl_t uioc; int adapno; int rval; - mega_passthru *upthru; /* user address for passthru */ + mega_passthru __user *upthru; /* user address for passthru */ mega_passthru *pthru; /* copy user passthru here */ dma_addr_t pthru_dma_hndl; void *data = NULL; /* data to be transferred */ dma_addr_t data_dma_hndl; /* dma handle for data xfer area */ megacmd_t mc; - megastat_t *ustats; + megastat_t __user *ustats; int num_ldrv; u32 uxferaddr = 0; struct pci_dev *pdev; @@ -3300,20 +3397,20 @@ * addresses. */ memset(&uioc, 0, sizeof(nitioctl_t)); - if( (rval = mega_m_to_n( (void *)arg, &uioc)) != 0 ) + if( (rval = mega_m_to_n( (void __user *)arg, &uioc)) != 0 ) return rval; switch( uioc.opcode ) { case GET_DRIVER_VER: - if( put_user(driver_ver, (u32 *)uioc.uioc_uaddr) ) + if( put_user(driver_ver, (u32 __user *)uioc.uioc_uaddr) ) return (-EFAULT); break; case GET_N_ADAP: - if( put_user(hba_count, (u32 *)uioc.uioc_uaddr) ) + if( put_user(hba_count, (u32 __user *)uioc.uioc_uaddr) ) return (-EFAULT); /* @@ -3347,7 +3444,7 @@ adapter = hba_soft_state[adapno]; - ustats = (megastat_t *)uioc.uioc_uaddr; + ustats = uioc.uioc_uaddr; if( copy_from_user(&num_ldrv, &ustats->num_ldrv, sizeof(int)) ) return (-EFAULT); @@ -3418,7 +3515,7 @@ mc.status = rval; - rval = mega_n_to_m((void *)arg, &mc); + rval = mega_n_to_m((void __user *)arg, &mc); } return rval; @@ -3458,12 +3555,12 @@ /* * The user passthru structure */ - upthru = (mega_passthru *)MBOX(uioc)->xferaddr; + upthru = (mega_passthru __user *)MBOX(uioc)->xferaddr; /* * Copy in the user passthru here. */ - if( copy_from_user(pthru, (char *)upthru, + if( copy_from_user(pthru, upthru, sizeof(mega_passthru)) ) { pci_free_consistent(pdev, @@ -3510,7 +3607,7 @@ /* * Get the user data */ - if( copy_from_user(data, (char *)uxferaddr, + if( copy_from_user(data, (char __user *)uxferaddr, pthru->dataxferlen) ) { rval = (-EFAULT); goto freemem_and_return; @@ -3527,7 +3624,7 @@ */ mega_internal_command(adapter, LOCK_INT, &mc, pthru); - rval = mega_n_to_m((void *)arg, &mc); + rval = mega_n_to_m((void __user *)arg, &mc); if( rval ) goto freemem_and_return; @@ -3536,7 +3633,7 @@ * Is data going up-stream */ if( pthru->dataxferlen && (uioc.flags & UIOC_RD) ) { - if( copy_to_user((char *)uxferaddr, data, + if( copy_to_user((char __user *)uxferaddr, data, pthru->dataxferlen) ) { rval = (-EFAULT); } @@ -3588,7 +3685,7 @@ /* * Get the user data */ - if( copy_from_user(data, (char *)uxferaddr, + if( copy_from_user(data, (char __user *)uxferaddr, uioc.xferlen) ) { pci_free_consistent(pdev, @@ -3610,7 +3707,7 @@ */ mega_internal_command(adapter, LOCK_INT, &mc, NULL); - rval = mega_n_to_m((void *)arg, &mc); + rval = mega_n_to_m((void __user *)arg, &mc); if( rval ) { if( uioc.xferlen ) { @@ -3628,7 +3725,7 @@ * Is data going up-stream */ if( uioc.xferlen && (uioc.flags & UIOC_RD) ) { - if( copy_to_user((char *)uxferaddr, data, + if( copy_to_user((char __user *)uxferaddr, data, uioc.xferlen) ) { rval = (-EFAULT); @@ -3664,7 +3761,7 @@ * Converts the older mimd ioctl structure to newer NIT structure */ static int -mega_m_to_n(void *arg, nitioctl_t *uioc) +mega_m_to_n(void __user *arg, nitioctl_t *uioc) { struct uioctl_t uioc_mimd; char signature[8] = {0}; @@ -3679,7 +3776,7 @@ * begining of the structure. */ - if( copy_from_user(signature, (char *)arg, 7) ) + if( copy_from_user(signature, arg, 7) ) return (-EFAULT); if( memcmp(signature, "MEGANIT", 7) == 0 ) { @@ -3692,7 +3789,7 @@ */ return -EINVAL; #if 0 - if( copy_from_user(uioc, (char *)arg, sizeof(nitioctl_t)) ) + if( copy_from_user(uioc, arg, sizeof(nitioctl_t)) ) return (-EFAULT); return 0; #endif @@ -3703,7 +3800,7 @@ * * Get the user ioctl structure */ - if( copy_from_user(&uioc_mimd, (char *)arg, sizeof(struct uioctl_t)) ) + if( copy_from_user(&uioc_mimd, arg, sizeof(struct uioctl_t)) ) return (-EFAULT); @@ -3790,52 +3887,52 @@ * conforms to older mimd ioctl interface or newer NIT ioctl interface */ static int -mega_n_to_m(void *arg, megacmd_t *mc) +mega_n_to_m(void __user *arg, megacmd_t *mc) { - nitioctl_t *uiocp; - megacmd_t *umc; - mega_passthru *upthru; - struct uioctl_t *uioc_mimd; + nitioctl_t __user *uiocp; + megacmd_t __user *umc; + mega_passthru __user *upthru; + struct uioctl_t __user *uioc_mimd; char signature[8] = {0}; /* * check is the application conforms to NIT. */ - if( copy_from_user(signature, (char *)arg, 7) ) + if( copy_from_user(signature, arg, 7) ) return -EFAULT; if( memcmp(signature, "MEGANIT", 7) == 0 ) { - uiocp = (nitioctl_t *)arg; + uiocp = arg; - if( put_user(mc->status, (u8 *)&MBOX_P(uiocp)->status) ) + if( put_user(mc->status, (u8 __user *)&MBOX_P(uiocp)->status) ) return (-EFAULT); if( mc->cmd == MEGA_MBOXCMD_PASSTHRU ) { umc = MBOX_P(uiocp); - if (get_user(upthru, (mega_passthru **)&umc->xferaddr)) - return (-EFAULT); + if (get_user(upthru, (mega_passthru __user * __user *)&umc->xferaddr)) + return -EFAULT; - if( put_user(mc->status, (u8 *)&upthru->scsistatus) ) + if( put_user(mc->status, (u8 __user *)&upthru->scsistatus)) return (-EFAULT); } } else { - uioc_mimd = (struct uioctl_t *)arg; + uioc_mimd = arg; - if( put_user(mc->status, (u8 *)&uioc_mimd->mbox[17]) ) + if( put_user(mc->status, (u8 __user *)&uioc_mimd->mbox[17]) ) return (-EFAULT); if( mc->cmd == MEGA_MBOXCMD_PASSTHRU ) { - umc = (megacmd_t *)uioc_mimd->mbox; + umc = (megacmd_t __user *)uioc_mimd->mbox; - if (get_user(upthru, (mega_passthru **)&umc->xferaddr)) + if (get_user(upthru, (mega_passthru __user * __user *)&umc->xferaddr)) return (-EFAULT); - if( put_user(mc->status, (u8 *)&upthru->scsistatus) ) + if( put_user(mc->status, (u8 __user *)&upthru->scsistatus) ) return (-EFAULT); } } @@ -4233,67 +4330,6 @@ } - -/** - * mega_get_ldrv_num() - * @adapter - pointer to our soft state - * @cmd - scsi mid layer command - * @channel - channel on the controller - * - * Calculate the logical drive number based on the information in scsi command - * and the channel number. - */ -static inline int -mega_get_ldrv_num(adapter_t *adapter, Scsi_Cmnd *cmd, int channel) -{ - int tgt; - int ldrv_num; - - tgt = cmd->device->id; - - if ( tgt > adapter->this_id ) - tgt--; /* we do not get inquires for initiator id */ - - ldrv_num = (channel * 15) + tgt; - - - /* - * If we have a logical drive with boot enabled, project it first - */ - if( adapter->boot_ldrv_enabled ) { - if( ldrv_num == 0 ) { - ldrv_num = adapter->boot_ldrv; - } - else { - if( ldrv_num <= adapter->boot_ldrv ) { - ldrv_num--; - } - } - } - - /* - * If "delete logical drive" feature is enabled on this controller. - * Do only if at least one delete logical drive operation was done. - * - * Also, after logical drive deletion, instead of logical drive number, - * the value returned should be 0x80+logical drive id. - * - * These is valid only for IO commands. - */ - - if (adapter->support_random_del && adapter->read_ldidmap ) - switch (cmd->cmnd[0]) { - case READ_6: /* fall through */ - case WRITE_6: /* fall through */ - case READ_10: /* fall through */ - case WRITE_10: - ldrv_num += 0x80; - } - - return ldrv_num; -} - - /** * mega_adapinq() * @adapter - pointer to our soft state @@ -4329,27 +4365,6 @@ } -/** - * mega_allocate_inquiry() - * @dma_handle - handle returned for dma address - * @pdev - handle to pci device - * - * allocates memory for inquiry structure - */ -static inline caddr_t -mega_allocate_inquiry(dma_addr_t *dma_handle, struct pci_dev *pdev) -{ - return pci_alloc_consistent(pdev, sizeof(mega_inquiry3), dma_handle); -} - - -static inline void -mega_free_inquiry(caddr_t inquiry, dma_addr_t dma_handle, struct pci_dev *pdev) -{ - pci_free_consistent(pdev, sizeof(mega_inquiry3), inquiry, dma_handle); -} - - /** mega_internal_dev_inquiry() * @adapter - pointer to our soft state * @ch - channel for this device @@ -4549,29 +4564,6 @@ } - -static inline int -make_local_pdev(adapter_t *adapter, struct pci_dev **pdev) -{ - *pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); - - if( *pdev == NULL ) return -1; - - memcpy(*pdev, adapter->dev, sizeof(struct pci_dev)); - - if( pci_set_dma_mask(*pdev, 0xffffffff) != 0 ) { - kfree(*pdev); - return -1; - } - - return 0; -} - -static inline void -free_local_pdev(struct pci_dev *pdev) -{ - kfree(pdev); -} static struct scsi_host_template megaraid_template = { .module = THIS_MODULE, diff -Nru a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h --- a/drivers/scsi/megaraid.h 2004-07-13 12:24:01 -07:00 +++ b/drivers/scsi/megaraid.h 2004-07-13 12:24:01 -07:00 @@ -522,11 +522,11 @@ u8 mbox[18]; /* 16 bytes + 2 status bytes */ mega_passthru pthru; #if BITS_PER_LONG == 32 - char *data; /* buffer <= 4096 for 0x80 commands */ + char __user *data; /* buffer <= 4096 for 0x80 commands */ char pad[4]; #endif #if BITS_PER_LONG == 64 - char *data; + char __user *data; #endif } __attribute__ ((packed)); @@ -622,12 +622,12 @@ u32 adapno; /* adapter number */ union { u8 __raw_mbox[18]; - caddr_t __uaddr; /* xferaddr for non-mbox cmds */ + void __user *__uaddr; /* xferaddr for non-mbox cmds */ }__ua; #define uioc_rmbox __ua.__raw_mbox #define MBOX(uioc) ((megacmd_t *)&((uioc).__ua.__raw_mbox[0])) -#define MBOX_P(uioc) ((megacmd_t *)&((uioc)->__ua.__raw_mbox[0])) +#define MBOX_P(uioc) ((megacmd_t __user *)&((uioc)->__ua.__raw_mbox[0])) #define uioc_uaddr __ua.__uaddr u32 xferlen; /* xferlen for DCMD and non-mbox @@ -990,14 +990,12 @@ const char *megaraid_info (struct Scsi_Host *); static int mega_query_adapter(adapter_t *); -static inline int issue_scb(adapter_t *, scb_t *); +static int issue_scb(adapter_t *, scb_t *); static int mega_setup_mailbox(adapter_t *); static int megaraid_queue (Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *); -static inline scb_t *mega_allocate_scb(adapter_t *, Scsi_Cmnd *); static void __mega_runpendq(adapter_t *); -static inline void mega_runpendq(adapter_t *); static int issue_scb_block(adapter_t *, u_char *); static irqreturn_t megaraid_isr_memmapped(int, void *, struct pt_regs *); @@ -1014,10 +1012,9 @@ static int mega_build_sglist (adapter_t *adapter, scb_t *scb, u32 *buffer, u32 *length); -static inline int mega_busywait_mbox (adapter_t *); static int __mega_busywait_mbox (adapter_t *); static void mega_rundoneq (adapter_t *); -static inline void mega_cmd_done(adapter_t *, u8 [], int, int); +static void mega_cmd_done(adapter_t *, u8 [], int, int); static inline void mega_free_sgl (adapter_t *adapter); static void mega_8_to_40ld (mraid_inquiry *inquiry, mega_inquiry3 *enquiry3, mega_product_info *); @@ -1025,8 +1022,8 @@ static int megadev_open (struct inode *, struct file *); static int megadev_ioctl (struct inode *, struct file *, unsigned int, unsigned long); -static int mega_m_to_n(void *, nitioctl_t *); -static int mega_n_to_m(void *, megacmd_t *); +static int mega_m_to_n(void __user *, nitioctl_t *); +static int mega_n_to_m(void __user *, megacmd_t *); static int mega_init_scb (adapter_t *); @@ -1053,10 +1050,6 @@ static int mega_adapinq(adapter_t *, dma_addr_t); static int mega_internal_dev_inquiry(adapter_t *, u8, u8, dma_addr_t); -static inline caddr_t mega_allocate_inquiry(dma_addr_t *, struct pci_dev *); -static inline void mega_free_inquiry(caddr_t, dma_addr_t, struct pci_dev *); -static inline int make_local_pdev(adapter_t *, struct pci_dev **); -static inline void free_local_pdev(struct pci_dev *); static int mega_support_ext_cdb(adapter_t *); static mega_passthru* mega_prepare_passthru(adapter_t *, scb_t *, @@ -1065,7 +1058,6 @@ scb_t *, Scsi_Cmnd *, int, int); static void mega_enum_raid_scsi(adapter_t *); static void mega_get_boot_drv(adapter_t *); -static inline int mega_get_ldrv_num(adapter_t *, Scsi_Cmnd *, int); static int mega_support_random_del(adapter_t *); static int mega_del_logdrv(adapter_t *, int); static int mega_do_del_logdrv(adapter_t *, int); diff -Nru a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c --- a/drivers/scsi/ppa.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/scsi/ppa.c 2004-07-13 12:24:01 -07:00 @@ -682,7 +682,7 @@ ppa_pb_dismiss(dev); - dev->cur_cmd = 0; + dev->cur_cmd = NULL; cmd->scsi_done(cmd); } diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c --- a/drivers/scsi/sr.c 2004-07-13 12:24:02 -07:00 +++ b/drivers/scsi/sr.c 2004-07-13 12:24:02 -07:00 @@ -183,7 +183,7 @@ return -EINVAL; } - retval = scsi_ioctl(cd->device, SCSI_IOCTL_TEST_UNIT_READY, 0); + retval = scsi_ioctl(cd->device, SCSI_IOCTL_TEST_UNIT_READY, NULL); if (retval) { /* Unable to test, unit probably not ready. This usually * means there is no disc in the drive. Mark as changed, diff -Nru a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c --- a/drivers/usb/class/usb-midi.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/class/usb-midi.c 2004-07-13 12:24:00 -07:00 @@ -951,7 +951,7 @@ if ( m->open_mode & FMODE_READ ) { unsigned long int flagsep; spin_lock_irqsave( &m->min.ep->lock, flagsep ); - m->min.ep->cables[m->min.cableId] = 0; // discard cable + m->min.ep->cables[m->min.cableId] = NULL; // discard cable m->min.ep->readers -= 1; m->open_mode &= ~FMODE_READ; if ( m->min.ep->readers == 0 && @@ -967,7 +967,7 @@ up(&open_sem); wake_up(&open_wait); - file->private_data = 0; + file->private_data = NULL; return 0; } @@ -1294,7 +1294,7 @@ unsigned char jack2string[256]; #endif - u = 0; + u = NULL; /* find audiocontrol interface */ p1 = find_csinterface_descriptor( buffer, bufSize, NULL, MS_HEADER, ifnum, altSetting); @@ -1314,7 +1314,7 @@ if ( !u ) { return NULL; } - u->deviceName = 0; + u->deviceName = NULL; u->idVendor = d->descriptor.idVendor; u->idProduct = d->descriptor.idProduct; u->interface = ifnum; @@ -1388,7 +1388,7 @@ if (quirks==0) { /* MIDISTREAM */ - p2 = 0; + p2 = NULL; for (p1 = find_descriptor(buffer, bufSize, NULL, USB_DT_ENDPOINT, ifnum, altSetting ); p1; p1 = next ) { next = find_descriptor(buffer, bufSize, p1, USB_DT_ENDPOINT, @@ -1397,7 +1397,7 @@ ifnum, altSetting ); if ( p2 && next && ( p2 > next ) ) - p2 = 0; + p2 = NULL; if ( p1[0] < 9 || !p2 || p2[0] < 4 ) continue; @@ -1940,8 +1940,8 @@ if ( ucable < 0 || ucable > 15 ) ucable = 0; - u.deviceName = 0; /* A flag for alloc_usb_midi_device to get device name - from device. */ + u.deviceName = NULL; /* A flag for alloc_usb_midi_device to get device + name from device. */ u.idVendor = uvendor; u.idProduct = uproduct; u.interface = uinterface; diff -Nru a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c --- a/drivers/usb/core/devio.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/core/devio.c 2004-07-13 12:24:01 -07:00 @@ -269,7 +269,7 @@ sinfo.si_signo = as->signr; sinfo.si_errno = as->urb->status; sinfo.si_code = SI_ASYNCIO; - sinfo.si_addr = (void *)as->userurb; + sinfo.si_addr = as->userurb; send_sig_info(as->signr, &sinfo, as->task); } wake_up(&ps->wait); diff -Nru a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c --- a/drivers/usb/gadget/epautoconf.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/gadget/epautoconf.c 2004-07-13 12:24:01 -07:00 @@ -192,7 +192,7 @@ if (0 == strcmp (ep->name, name)) return ep; } - return 0; + return NULL; } /** @@ -280,7 +280,7 @@ } /* Fail */ - return 0; + return NULL; } /** @@ -297,7 +297,7 @@ struct usb_ep *ep; list_for_each_entry (ep, &gadget->ep_list, ep_list) { - ep->driver_data = 0; + ep->driver_data = NULL; } #ifdef MANY_ENDPOINTS in_epnum = 0; diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c --- a/drivers/usb/gadget/ether.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/gadget/ether.c 2004-07-13 12:24:01 -07:00 @@ -685,7 +685,7 @@ (struct usb_descriptor_header *) &data_intf, (struct usb_descriptor_header *) &fs_source_desc, (struct usb_descriptor_header *) &fs_sink_desc, - 0, + NULL, #endif /* DEV_CONFIG_CDC */ }; @@ -695,9 +695,9 @@ fs_eth_function[0] = (struct usb_descriptor_header *) &subset_data_intf; fs_eth_function[1] = (struct usb_descriptor_header *) &fs_source_desc; fs_eth_function[2] = (struct usb_descriptor_header *) &fs_sink_desc; - fs_eth_function[3] = 0; + fs_eth_function[3] = NULL; #else - fs_eth_function[0] = 0; + fs_eth_function[0] = NULL; #endif } @@ -714,7 +714,7 @@ (struct usb_descriptor_header *) &rndis_data_intf, (struct usb_descriptor_header *) &fs_source_desc, (struct usb_descriptor_header *) &fs_sink_desc, - 0, + NULL, }; #endif @@ -780,7 +780,7 @@ (struct usb_descriptor_header *) &data_intf, (struct usb_descriptor_header *) &hs_source_desc, (struct usb_descriptor_header *) &hs_sink_desc, - 0, + NULL, #endif /* DEV_CONFIG_CDC */ }; @@ -790,9 +790,9 @@ hs_eth_function[0] = (struct usb_descriptor_header *) &subset_data_intf; hs_eth_function[1] = (struct usb_descriptor_header *) &fs_source_desc; hs_eth_function[2] = (struct usb_descriptor_header *) &fs_sink_desc; - hs_eth_function[3] = 0; + hs_eth_function[3] = NULL; #else - hs_eth_function[0] = 0; + hs_eth_function[0] = NULL; #endif } @@ -809,7 +809,7 @@ (struct usb_descriptor_header *) &rndis_data_intf, (struct usb_descriptor_header *) &hs_source_desc, (struct usb_descriptor_header *) &hs_sink_desc, - 0, + NULL, }; #endif @@ -1051,8 +1051,8 @@ if (dev->status_ep) (void) usb_ep_disable (dev->status_ep); #endif - dev->status_ep = 0; - dev->status = 0; + dev->status_ep = NULL; + dev->status = NULL; #if defined(DEV_CONFIG_SUBSET) || defined(CONFIG_USB_ETH_RNDIS) if (dev->rndis || !dev->cdc) { if (dev->in_ep) @@ -1061,10 +1061,10 @@ (void) usb_ep_disable (dev->out_ep); } #endif - dev->in_ep = 0; - dev->in = 0; - dev->out_ep = 0; - dev->out = 0; + dev->in_ep = NULL; + dev->in = NULL; + dev->out_ep = NULL; + dev->out = NULL; } else /* activate non-CDC configs right away @@ -1111,7 +1111,7 @@ list_del (&req->list); usb_ep_free_request (dev->in_ep, req); } - dev->in_ep = 0; + dev->in_ep = NULL; } if (dev->out_ep) { usb_ep_disable (dev->out_ep); @@ -1121,12 +1121,12 @@ list_del (&req->list); usb_ep_free_request (dev->out_ep, req); } - dev->out_ep = 0; + dev->out_ep = NULL; } if (dev->status_ep) { usb_ep_disable (dev->status_ep); - dev->status_ep = 0; + dev->status_ep = NULL; } dev->config = 0; } @@ -1800,7 +1800,7 @@ * use skb buffers. */ status = netif_rx (skb); - skb = 0; + skb = NULL; break; /* software-driven interface shutdown */ @@ -1834,7 +1834,7 @@ clean: /* nobody reading rx_reqs, so no dev->lock */ list_add (&req->list, &dev->rx_reqs); - req = 0; + req = NULL; } if (req) rx_submit (dev, req, GFP_ATOMIC); @@ -1969,7 +1969,7 @@ struct eth_dev *dev = (struct eth_dev *) net->priv; int length = skb->len; int retval; - struct usb_request *req = 0; + struct usb_request *req = NULL; unsigned long flags; /* FIXME check dev->cdc_filter to decide whether to send this, @@ -2212,7 +2212,7 @@ dev->req->buf, dev->req->dma, USB_BUFSIZ); usb_ep_free_request (gadget->ep0, dev->req); - dev->req = 0; + dev->req = NULL; } unregister_netdev (dev->net); @@ -2220,7 +2220,7 @@ /* assuming we used keventd, it must quiesce too */ flush_scheduled_work (); - set_gadget_data (gadget, 0); + set_gadget_data (gadget, NULL); } static u8 __init nibble (unsigned char c) diff -Nru a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c --- a/drivers/usb/gadget/file_storage.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/gadget/file_storage.c 2004-07-13 12:24:01 -07:00 @@ -3673,7 +3673,7 @@ usb_ep_free_request(fsg->ep0, req); } - set_gadget_data(gadget, 0); + set_gadget_data(gadget, NULL); } diff -Nru a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c --- a/drivers/usb/gadget/inode.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/gadget/inode.c 2004-07-13 12:24:01 -07:00 @@ -171,7 +171,7 @@ dev = kmalloc (sizeof *dev, GFP_KERNEL); if (!dev) - return 0; + return NULL; memset (dev, 0, sizeof *dev); dev->state = STATE_DEV_DISABLED; atomic_set (&dev->count, 1); @@ -597,8 +597,8 @@ /* lock against disconnect (and ideally, cancel) */ spin_lock(&epdata->dev->lock); - priv->req = 0; - priv->epdata = 0; + priv->req = NULL; + priv->epdata = NULL; if (NULL == iocb->ki_retry || unlikely(0 == req->actual) || unlikely(kiocbIsCancelled(iocb))) { @@ -1204,7 +1204,7 @@ fasync_helper (-1, fd, 0, &dev->fasync); kfree (dev->buf); - dev->buf = 0; + dev->buf = NULL; put_dev (dev); /* other endpoints were all decoupled from this device */ @@ -1356,7 +1356,7 @@ req->buf = dev->rbuf; req->dma = DMA_ADDR_INVALID; - req->context = 0; + req->context = NULL; value = -EOPNOTSUPP; switch (ctrl->bRequest) { @@ -1524,7 +1524,7 @@ ep = list_entry (entry, struct ep_data, epfiles); list_del_init (&ep->epfiles); dentry = ep->dentry; - ep->dentry = 0; + ep->dentry = NULL; parent = dentry->d_parent->d_inode; /* break link to controller */ @@ -1532,7 +1532,7 @@ (void) usb_ep_disable (ep->ep); ep->state = STATE_EP_UNBOUND; usb_ep_free_request (ep->ep, ep->req); - ep->ep = 0; + ep->ep = NULL; wake_up (&ep->wait); put_ep (ep); @@ -1612,8 +1612,8 @@ spin_unlock_irq (&dev->lock); destroy_ep_files (dev); - gadget->ep0->driver_data = 0; - set_gadget_data (gadget, 0); + gadget->ep0->driver_data = NULL; + set_gadget_data (gadget, NULL); /* we've already been disconnected ... no i/o is active */ if (dev->req) @@ -1646,7 +1646,7 @@ dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL); if (!dev->req) goto enomem; - dev->req->context = 0; + dev->req->context = NULL; dev->req->complete = epio_complete; if (activate_ep_files (dev) < 0) @@ -1835,7 +1835,7 @@ value = usb_gadget_register_driver (&gadgetfs_driver); if (value != 0) { kfree (dev->buf); - dev->buf = 0; + dev->buf = NULL; } else { /* at this point "good" hardware has for the first time * let the USB the host see us. alternatively, if users @@ -1855,7 +1855,7 @@ spin_unlock_irq (&dev->lock); pr_debug ("%s: %s fail %Zd, %p\n", shortname, __FUNCTION__, value, dev); kfree (dev->buf); - dev->buf = 0; + dev->buf = NULL; return value; } @@ -1944,13 +1944,13 @@ qname.hash = full_name_hash (qname.name, qname.len); dentry = d_alloc (sb->s_root, &qname); if (!dentry) - return 0; + return NULL; inode = gadgetfs_make_inode (sb, data, fops, S_IFREG | (default_perm & S_IRWXUGO)); if (!inode) { dput(dentry); - return 0; + return NULL; } d_add (dentry, inode); *dentry_p = dentry; @@ -1980,7 +1980,7 @@ /* root inode */ inode = gadgetfs_make_inode (sb, - 0, &simple_dir_operations, + NULL, &simple_dir_operations, S_IFDIR | S_IRUGO | S_IXUGO); if (!inode) return -ENOMEM; @@ -2027,7 +2027,7 @@ kill_litter_super (sb); if (the_device) { put_dev (the_device); - the_device = 0; + the_device = NULL; } } diff -Nru a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c --- a/drivers/usb/gadget/net2280.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/gadget/net2280.c 2004-07-13 12:24:00 -07:00 @@ -182,7 +182,7 @@ if (ep->dma && (max % 4) != 0 && use_dma_chaining) { DEBUG (ep->dev, "%s, no dma for maxpacket %d\n", ep->ep.name, ep->ep.maxpacket); - ep->dma = 0; + ep->dma = NULL; } /* set type, direction, address; reset fifo counters */ @@ -280,7 +280,7 @@ { u32 tmp; - ep->desc = 0; + ep->desc = NULL; INIT_LIST_HEAD (&ep->queue); ep->ep.maxpacket = ~0; @@ -374,12 +374,12 @@ struct net2280_request *req; if (!_ep) - return 0; + return NULL; ep = container_of (_ep, struct net2280_ep, ep); req = kmalloc (sizeof *req, gfp_flags); if (!req) - return 0; + return NULL; memset (req, 0, sizeof *req); req->req.dma = DMA_ADDR_INVALID; @@ -393,7 +393,7 @@ &req->td_dma); if (!td) { kfree (req); - return 0; + return NULL; } td->dmacount = 0; /* not VALID */ td->dmaaddr = __constant_cpu_to_le32 (DMA_ADDR_INVALID); @@ -463,7 +463,7 @@ ep = container_of (_ep, struct net2280_ep, ep); if (!_ep) - return 0; + return NULL; *dma = DMA_ADDR_INVALID; #if defined(USE_KMALLOC) @@ -530,7 +530,7 @@ total = req->length - req->actual; } else { total = 0; - buf = 0; + buf = NULL; } /* write just one packet at a time */ @@ -966,7 +966,7 @@ if (ep->num == 0) allow_status (ep); /* don't queue it */ - req = 0; + req = NULL; } else s = readl (&ep->regs->ep_stat); } @@ -1095,7 +1095,7 @@ * OUT: was "usb-short", we must restart. */ if (ep->is_in && !req->valid) { - struct net2280_request *entry, *prev = 0; + struct net2280_request *entry, *prev = NULL; int reqmode, done = 0; DEBUG (ep->dev, "%s dma hiccup td %p\n", ep->ep.name, req->td); @@ -1220,7 +1220,7 @@ DEBUG (ep->dev, "unlink (%s) pio\n", _ep->name); done (ep, req, -ECONNRESET); } - req = 0; + req = NULL; /* patch up hardware chaining data */ } else if (ep->dma && use_dma_chaining) { @@ -1957,15 +1957,15 @@ dev->ep [i].irqs = 0; /* hook up the driver ... */ - driver->driver.bus = 0; + driver->driver.bus = NULL; dev->driver = driver; dev->gadget.dev.driver = &driver->driver; retval = driver->bind (&dev->gadget); if (retval) { DEBUG (dev, "bind to driver %s --> %d\n", driver->driver.name, retval); - dev->driver = 0; - dev->gadget.dev.driver = 0; + dev->driver = NULL; + dev->gadget.dev.driver = NULL; return retval; } @@ -1995,7 +1995,7 @@ /* don't disconnect if it's not connected */ if (dev->gadget.speed == USB_SPEED_UNKNOWN) - driver = 0; + driver = NULL; /* stop hardware; prevent new request submissions; * and kill any outstanding requests. @@ -2029,8 +2029,8 @@ spin_unlock_irqrestore (&dev->lock, flags); driver->unbind (&dev->gadget); - dev->gadget.dev.driver = 0; - dev->driver = 0; + dev->gadget.dev.driver = NULL; + dev->driver = NULL; net2280_led_active (dev, 0); device_remove_file (&dev->pdev->dev, &dev_attr_function); @@ -2059,7 +2059,7 @@ req = list_entry (ep->queue.next, struct net2280_request, queue); else - req = 0; + req = NULL; /* ack all, and handle what we care about */ t = readl (&ep->regs->ep_stat); @@ -2098,7 +2098,7 @@ set_halt (ep); mode = 2; } else if (!req && ep->stopped) - write_fifo (ep, 0); + write_fifo (ep, NULL); } } else { /* status; stop NAKing */ @@ -2118,7 +2118,7 @@ ep->stopped = 1; if (req) done (ep, req, -EOVERFLOW); - req = 0; + req = NULL; } } } @@ -2145,7 +2145,7 @@ scan_dma_completions (ep); if (unlikely (list_empty (&ep->queue) || ep->out_overflow)) { - req = 0; + req = NULL; break; } req = list_entry (ep->queue.next, @@ -2159,7 +2159,7 @@ count &= DMA_BYTE_COUNT_MASK; if (readl (&ep->dma->dmadesc) != req->td_dma) - req = 0; + req = NULL; break; } udelay(1); @@ -2212,7 +2212,7 @@ if (ep->num == 0) { /* wait for control status */ if (mode != 2) - req = 0; + req = NULL; } else if (!req->req.zero || len != ep->ep.maxpacket) mode = 2; } @@ -2234,13 +2234,13 @@ */ if (!ep->stopped) allow_status (ep); - req = 0; + req = NULL; } else { if (!list_empty (&ep->queue) && !ep->stopped) req = list_entry (ep->queue.next, struct net2280_request, queue); else - req = 0; + req = NULL; if (req && !ep->is_in) stop_out_naking (ep); } @@ -2275,7 +2275,7 @@ if ((wIndex & 0x0f) == (bEndpointAddress & 0x0f)) return ep; } - return 0; + return NULL; } static void handle_stat0_irqs (struct net2280 *dev, u32 stat) @@ -2707,11 +2707,11 @@ pci_disable_device (pdev); device_unregister (&dev->gadget.dev); device_remove_file (&pdev->dev, &dev_attr_registers); - pci_set_drvdata (pdev, 0); + pci_set_drvdata (pdev, NULL); INFO (dev, "unbind\n"); - the_controller = 0; + the_controller = NULL; } /* wrap this driver around the specified device, but @@ -2722,7 +2722,7 @@ { struct net2280 *dev; unsigned long resource, len; - void *base = 0; + void *base = NULL; int retval, i; char buf [8], *bufp; diff -Nru a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c --- a/drivers/usb/gadget/zero.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/gadget/zero.c 2004-07-13 12:24:00 -07:00 @@ -305,14 +305,14 @@ (struct usb_descriptor_header *) &source_sink_intf, (struct usb_descriptor_header *) &fs_sink_desc, (struct usb_descriptor_header *) &fs_source_desc, - 0, + NULL, }; static const struct usb_descriptor_header *fs_loopback_function [] = { (struct usb_descriptor_header *) &loopback_intf, (struct usb_descriptor_header *) &fs_sink_desc, (struct usb_descriptor_header *) &fs_source_desc, - 0, + NULL, }; #ifdef CONFIG_USB_GADGET_DUALSPEED @@ -359,14 +359,14 @@ (struct usb_descriptor_header *) &source_sink_intf, (struct usb_descriptor_header *) &hs_source_desc, (struct usb_descriptor_header *) &hs_sink_desc, - 0, + NULL, }; static const struct usb_descriptor_header *hs_loopback_function [] = { (struct usb_descriptor_header *) &loopback_intf, (struct usb_descriptor_header *) &hs_source_desc, (struct usb_descriptor_header *) &hs_sink_desc, - 0, + NULL, }; /* maxpacket and other transfer characteristics vary by speed. */ @@ -468,7 +468,7 @@ &req->dma, GFP_ATOMIC); if (!req->buf) { usb_ep_free_request (ep, req); - req = 0; + req = NULL; } } return req; @@ -599,7 +599,7 @@ req = alloc_ep_req (ep, buflen); if (!req) - return 0; + return NULL; memset (req->buf, 0, req->length); req->complete = source_sink_complete; @@ -613,7 +613,7 @@ ERROR (dev, "start %s --> %d\n", ep->name, status); free_ep_req (ep, req); - req = 0; + req = NULL; } return req; @@ -804,11 +804,11 @@ */ if (dev->in_ep) { usb_ep_disable (dev->in_ep); - dev->in_ep = 0; + dev->in_ep = NULL; } if (dev->out_ep) { usb_ep_disable (dev->out_ep); - dev->out_ep = 0; + dev->out_ep = NULL; } dev->config = 0; } @@ -1098,7 +1098,7 @@ free_ep_req (gadget->ep0, dev->req); del_timer_sync (&dev->resume); kfree (dev); - set_gadget_data (gadget, 0); + set_gadget_data (gadget, NULL); } static int diff -Nru a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c --- a/drivers/usb/host/ehci-dbg.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/host/ehci-dbg.c 2004-07-13 12:24:01 -07:00 @@ -536,7 +536,7 @@ if (p.qh->qh_next.ptr) temp = scnprintf (next, size, " ..."); - p.ptr = 0; + p.ptr = NULL; break; } /* show more info the first time around */ diff -Nru a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c --- a/drivers/usb/host/ehci-sched.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/host/ehci-sched.c 2004-07-13 12:24:00 -07:00 @@ -1499,7 +1499,7 @@ list_del (&sitd->sitd_list); sitd_dma = sitd->sitd_dma; } else - sitd = 0; + sitd = NULL; if (!sitd) { spin_unlock_irqrestore (&ehci->lock, flags); @@ -1600,7 +1600,7 @@ hcd_to_bus (&ehci->hcd)->bandwidth_isoc_reqs++; /* fill sITDs frame by frame */ - for (packet = 0, sitd = 0; + for (packet = 0, sitd = NULL; packet < urb->number_of_packets; packet++) { @@ -1626,7 +1626,7 @@ /* don't need that schedule data any more */ iso_sched_free (stream, sched); - urb->hcpriv = 0; + urb->hcpriv = NULL; timer_action (ehci, TIMER_IO_WATCHDOG); if (!ehci->periodic_sched++) @@ -1673,8 +1673,8 @@ } usb_put_urb (urb); - sitd->urb = 0; - sitd->stream = 0; + sitd->urb = NULL; + sitd->stream = NULL; list_move (&sitd->sitd_list, &stream->free_list); stream->depth -= stream->interval << 3; iso_stream_put (ehci, stream); @@ -1691,7 +1691,7 @@ /* give urb back to the driver */ dev = usb_get_dev (urb->dev); ehci_urb_done (ehci, urb, regs); - urb = 0; + urb = NULL; /* defer stopping schedule; completion can submit */ ehci->periodic_sched--; diff -Nru a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c --- a/drivers/usb/host/ohci-dbg.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/host/ohci-dbg.c 2004-07-13 12:24:01 -07:00 @@ -266,11 +266,11 @@ ohci_dbg (controller, "OHCI controller state\n"); // dumps some of the state we know about - ohci_dump_status (controller, NULL, 0); + ohci_dump_status (controller, NULL, NULL); if (controller->hcca) ohci_dbg (controller, "hcca frame #%04x\n", OHCI_FRAME_NO(controller->hcca)); - ohci_dump_roothub (controller, 1, NULL, 0); + ohci_dump_roothub (controller, 1, NULL, NULL); } static const char data0 [] = "DATA0"; @@ -574,7 +574,7 @@ } else { /* we've seen it and what's after */ temp = 0; - ed = 0; + ed = NULL; } } while (ed); diff -Nru a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c --- a/drivers/usb/host/ohci-hcd.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/host/ohci-hcd.c 2004-07-13 12:24:00 -07:00 @@ -229,7 +229,7 @@ if (urb->status != -EINPROGRESS) { spin_unlock (&urb->lock); urb->hcpriv = urb_priv; - finish_urb (ohci, urb, 0); + finish_urb (ohci, urb, NULL); retval = 0; goto fail; } @@ -341,7 +341,7 @@ if (!HCD_IS_RUNNING (ohci->hcd.state)) { ed->state = ED_IDLE; - finish_unlinks (ohci, 0, 0); + finish_unlinks (ohci, 0, NULL); } switch (ed->state) { @@ -369,7 +369,7 @@ td_free (ohci, ed->dummy); break; } - dev->ep [epnum] = 0; + dev->ep [epnum] = NULL; done: spin_unlock_irqrestore (&ohci->lock, flags); return; @@ -728,7 +728,7 @@ ed_deschedule (ohci, ed); ed->ed_next = ohci->ed_rm_list; - ed->ed_prev = 0; + ed->ed_prev = NULL; ohci->ed_rm_list = ed; /* FALLTHROUGH */ case ED_UNLINK: @@ -742,7 +742,7 @@ urb->status = -ESHUTDOWN; spin_unlock (&urb->lock); } - finish_unlinks (ohci, 0, 0); + finish_unlinks (ohci, 0, NULL); spin_unlock_irq(&ohci->lock); /* paranoia, in case that didn't work: */ diff -Nru a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c --- a/drivers/usb/host/ohci-hub.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/host/ohci-hub.c 2004-07-13 12:24:00 -07:00 @@ -123,11 +123,11 @@ if (ohci_readl (&ohci->regs->intrstatus) & OHCI_INTR_SF) break; } - dl_done_list (ohci, 0); + dl_done_list (ohci, NULL); mdelay (7); } - dl_done_list (ohci, 0); - finish_unlinks (ohci, OHCI_FRAME_NO(ohci->hcca), 0); + dl_done_list (ohci, NULL); + finish_unlinks (ohci, OHCI_FRAME_NO(ohci->hcca), NULL); writel (ohci_readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus); /* maybe resume can wake root hub */ diff -Nru a/drivers/usb/host/ohci-mem.c b/drivers/usb/host/ohci-mem.c --- a/drivers/usb/host/ohci-mem.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/host/ohci-mem.c 2004-07-13 12:24:01 -07:00 @@ -36,7 +36,7 @@ INIT_WORK (&ohci->rh_resume, ohci_rh_resume, &ohci->hcd); return &ohci->hcd; } - return 0; + return NULL; } static void ohci_hcd_free (struct usb_hcd *hcd) @@ -69,11 +69,11 @@ { if (ohci->td_cache) { dma_pool_destroy (ohci->td_cache); - ohci->td_cache = 0; + ohci->td_cache = NULL; } if (ohci->ed_cache) { dma_pool_destroy (ohci->ed_cache); - ohci->ed_cache = 0; + ohci->ed_cache = NULL; } } diff -Nru a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c --- a/drivers/usb/host/ohci-omap.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/host/ohci-omap.c 2004-07-13 12:24:01 -07:00 @@ -17,7 +17,6 @@ */ #include -#include #include #include diff -Nru a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c --- a/drivers/usb/host/ohci-q.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/host/ohci-q.c 2004-07-13 12:24:01 -07:00 @@ -174,8 +174,8 @@ return -EAGAIN; ed->state = ED_OPER; - ed->ed_prev = 0; - ed->ed_next = 0; + ed->ed_prev = NULL; + ed->ed_next = NULL; ed->hwNextED = 0; wmb (); @@ -333,7 +333,7 @@ if (ohci->ed_controltail == ed) { ohci->ed_controltail = ed->ed_prev; if (ohci->ed_controltail) - ohci->ed_controltail->ed_next = 0; + ohci->ed_controltail->ed_next = NULL; } else if (ed->ed_next) { ed->ed_next->ed_prev = ed->ed_prev; } @@ -357,7 +357,7 @@ if (ohci->ed_bulktail == ed) { ohci->ed_bulktail = ed->ed_prev; if (ohci->ed_bulktail) - ohci->ed_bulktail->ed_next = 0; + ohci->ed_bulktail->ed_next = NULL; } else if (ed->ed_next) { ed->ed_next->ed_prev = ed->ed_prev; } @@ -412,7 +412,7 @@ if (!td) { /* out of memory */ ed_free (ohci, ed); - ed = 0; + ed = NULL; goto done; } ed->dummy = td; @@ -474,7 +474,7 @@ /* rm_list is just singly linked, for simplicity */ ed->ed_next = ohci->ed_rm_list; - ed->ed_prev = 0; + ed->ed_prev = NULL; ohci->ed_rm_list = ed; /* enable SOF interrupt */ @@ -950,7 +950,7 @@ * entries (which we'd ignore), but paranoia won't hurt. */ *last = ed->ed_next; - ed->ed_next = 0; + ed->ed_next = NULL; modified = 0; /* unlink urbs as requested, but rescan the list after diff -Nru a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c --- a/drivers/usb/image/mdc800.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/image/mdc800.c 2004-07-13 12:24:01 -07:00 @@ -190,7 +190,7 @@ /* The Variable used by the driver */ -static struct mdc800_data* mdc800=0; +static struct mdc800_data* mdc800; /*************************************************************************** @@ -547,7 +547,7 @@ usb_unlink_urb (mdc800->write_urb); usb_unlink_urb (mdc800->download_urb); - mdc800->dev=0; + mdc800->dev=NULL; usb_set_intfdata(intf, NULL); } info ("Mustek MDC800 disconnected from USB."); @@ -971,9 +971,9 @@ Init and Cleanup this driver (Main Functions) *************************************************************************/ -#define try(A) if ((A) == 0) goto cleanup_on_fail; -#define try_free_mem(A) if (A != 0) { kfree (A); A=0; } -#define try_free_urb(A) if (A != 0) { usb_free_urb (A); A=0; } +#define try(A) if (!(A)) goto cleanup_on_fail; +#define try_free_mem(A) if (A) { kfree (A); A=NULL; } +#define try_free_urb(A) if (A) { usb_free_urb (A); A=NULL; } static int __init usb_mdc800_init (void) { @@ -982,7 +982,7 @@ try (mdc800=kmalloc (sizeof (struct mdc800_data), GFP_KERNEL)); memset(mdc800, 0, sizeof(struct mdc800_data)); - mdc800->dev=0; + mdc800->dev=NULL; mdc800->open=0; mdc800->state=NOT_CONNECTED; init_MUTEX (&mdc800->io_lock); diff -Nru a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c --- a/drivers/usb/image/microtek.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/image/microtek.c 2004-07-13 12:24:01 -07:00 @@ -534,7 +534,7 @@ if (!srb->use_sg) { if ( !srb->bufflen ){ - desc->context.data = 0; + desc->context.data = NULL; desc->context.data_length = 0; return; } else { diff -Nru a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c --- a/drivers/usb/input/aiptek.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/input/aiptek.c 2004-07-13 12:24:01 -07:00 @@ -1324,7 +1324,7 @@ if (strcmp(buf, "disable") == 0) { aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE; } else { - x = (int)simple_strtol(buf, 0, 10); + x = (int)simple_strtol(buf, NULL, 10); if (x >= AIPTEK_TILT_MIN && x <= AIPTEK_TILT_MAX) { aiptek->newSetting.xTilt = x; } @@ -1366,7 +1366,7 @@ if (strcmp(buf, "disable") == 0) { aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE; } else { - y = (int)simple_strtol(buf, 0, 10); + y = (int)simple_strtol(buf, NULL, 10); if (y >= AIPTEK_TILT_MIN && y <= AIPTEK_TILT_MAX) { aiptek->newSetting.yTilt = y; } @@ -1399,7 +1399,7 @@ if (aiptek == NULL) return 0; - aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, 0, 10); + aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10); return count; } @@ -1430,7 +1430,7 @@ if (aiptek == NULL) return 0; - aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, 0, 10); + aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10); return count; } @@ -1805,7 +1805,7 @@ if (aiptek == NULL) return 0; - aiptek->newSetting.wheel = (int)simple_strtol(buf, 0, 10); + aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10); return count; } diff -Nru a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c --- a/drivers/usb/input/powermate.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/input/powermate.c 2004-07-13 12:24:01 -07:00 @@ -182,7 +182,7 @@ pm->configcr->wLength = 0; usb_fill_control_urb(pm->config, pm->udev, usb_sndctrlpipe(pm->udev, 0), - (void *) pm->configcr, 0, 0, + (void *) pm->configcr, NULL, 0, powermate_config_complete, pm); pm->config->setup_dma = pm->configcr_dma; pm->config->transfer_flags |= URB_NO_SETUP_DMA_MAP; diff -Nru a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c --- a/drivers/usb/media/ov511.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/media/ov511.c 2004-07-13 12:24:00 -07:00 @@ -1900,7 +1900,7 @@ case SEN_KS0127: case SEN_KS0127B: case SEN_SAA7111A: - val = 0; + val = NULL; PDEBUG(3, "Unsupported with this sensor"); return -EPERM; default: diff -Nru a/drivers/usb/media/pwc-ctrl.c b/drivers/usb/media/pwc-ctrl.c --- a/drivers/usb/media/pwc-ctrl.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/media/pwc-ctrl.c 2004-07-13 12:24:01 -07:00 @@ -359,7 +359,7 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, int compression, int snapshot) { - struct Kiara_table_entry *pChoose = 0; + struct Kiara_table_entry *pChoose = NULL; int fps, ret; unsigned char buf[12]; struct Kiara_table_entry RawEntry = {6, 773, 1272, {0xAD, 0xF4, 0x10, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}}; 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-13 12:24:01 -07:00 +++ b/drivers/usb/media/pwc-if.c 2004-07-13 12:24:01 -07:00 @@ -593,7 +593,7 @@ int i, fst, flen; int awake; struct pwc_frame_buf *fbuf; - unsigned char *fillptr = 0, *iso_buf = 0; + unsigned char *fillptr = NULL, *iso_buf = NULL; awake = 0; pdev = (struct pwc_device *)urb->context; diff -Nru a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c --- a/drivers/usb/misc/auerswald.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/misc/auerswald.c 2004-07-13 12:24:00 -07:00 @@ -699,7 +699,7 @@ dr->wLength = cpu_to_le16 (size); usb_fill_control_urb (urb, dev, pipe, (unsigned char*)dr, data, size, /* build urb */ - auerchain_blocking_completion,0); + auerchain_blocking_completion,NULL); ret = auerchain_start_wait_urb (acp, urb, timeout, &length); usb_free_urb (urb); diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c --- a/drivers/usb/misc/speedtch.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/misc/speedtch.c 2004-07-13 12:24:01 -07:00 @@ -1149,7 +1149,7 @@ } /* ATM init */ - if (!(instance->atm_dev = atm_dev_register (udsl_driver_name, &udsl_atm_devops, -1, 0))) { + if (!(instance->atm_dev = atm_dev_register (udsl_driver_name, &udsl_atm_devops, -1, NULL))) { dbg ("udsl_usb_probe: failed to register ATM device!"); goto fail; } diff -Nru a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c --- a/drivers/usb/misc/usbtest.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/misc/usbtest.c 2004-07-13 12:24:01 -07:00 @@ -121,8 +121,8 @@ for (tmp = 0; tmp < intf->num_altsetting; tmp++) { unsigned ep; - in = out = 0; - iso_in = iso_out = 0; + in = out = NULL; + iso_in = iso_out = NULL; alt = intf->altsetting + tmp; /* take the first altsetting with in-bulk + out-bulk; @@ -216,11 +216,11 @@ struct urb *urb; if (bytes < 0) - return 0; + return NULL; urb = usb_alloc_urb (0, SLAB_KERNEL); if (!urb) return urb; - usb_fill_bulk_urb (urb, udev, pipe, 0, bytes, simple_callback, 0); + usb_fill_bulk_urb (urb, udev, pipe, NULL, bytes, simple_callback, NULL); urb->interval = (udev->speed == USB_SPEED_HIGH) ? (INTERRUPT_RATE << 3) : INTERRUPT_RATE; @@ -231,7 +231,7 @@ &urb->transfer_dma); if (!urb->transfer_buffer) { usb_free_urb (urb); - urb = 0; + urb = NULL; } else memset (urb->transfer_buffer, 0, bytes); return urb; @@ -380,7 +380,7 @@ sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL); if (!sg) - return 0; + return NULL; memset (sg, 0, nents * sizeof *sg); for (i = 0; i < nents; i++) { @@ -389,7 +389,7 @@ buf = kmalloc (size, SLAB_KERNEL); if (!buf) { free_sglist (sg, i); - return 0; + return NULL; } memset (buf, 0, size); @@ -637,7 +637,7 @@ /* and sometimes [9.2.6.6] speed dependent descriptors */ if (udev->descriptor.bcdUSB == 0x0200) { /* pre-swapped */ - struct usb_qualifier_descriptor *d = 0; + struct usb_qualifier_descriptor *d = NULL; /* device qualifier [9.6.2] */ retval = usb_get_descriptor (udev, @@ -817,11 +817,11 @@ if ((status = usb_submit_urb (urb, SLAB_ATOMIC)) != 0) { dbg ("can't resubmit ctrl %02x.%02x, err %d", reqp->bRequestType, reqp->bRequest, status); - urb->dev = 0; + urb->dev = NULL; } else ctx->pending++; } else - urb->dev = 0; + urb->dev = NULL; /* signal completion when nothing's queued */ if (ctx->pending == 0) @@ -1368,7 +1368,7 @@ unsigned i, maxp, packets; if (bytes < 0 || !desc) - return 0; + return NULL; maxp = 0x7ff & desc->wMaxPacketSize; maxp *= 1 + (0x3 & (desc->wMaxPacketSize >> 11)); packets = (bytes + maxp - 1) / maxp; @@ -1385,7 +1385,7 @@ &urb->transfer_dma); if (!urb->transfer_buffer) { usb_free_urb (urb); - return 0; + return NULL; } memset (urb->transfer_buffer, 0, bytes); for (i = 0; i < packets; i++) { diff -Nru a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c --- a/drivers/usb/net/kaweth.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/net/kaweth.c 2004-07-13 12:24:01 -07:00 @@ -1293,7 +1293,7 @@ return -ENOMEM; usb_fill_control_urb(urb, usb_dev, pipe, (unsigned char*)cmd, data, - len, usb_api_blocking_completion,0); + len, usb_api_blocking_completion,NULL); retv = usb_start_wait_urb(urb, timeout, &length); if (retv < 0) { diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c --- a/drivers/usb/net/usbnet.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/net/usbnet.c 2004-07-13 12:24:01 -07:00 @@ -316,7 +316,7 @@ for (tmp = 0; tmp < intf->num_altsetting; tmp++) { unsigned ep; - in = out = 0; + in = out = NULL; alt = intf->altsetting + tmp; /* take the first altsetting with in-bulk + out-bulk; @@ -1086,7 +1086,7 @@ /* ensure immediate exit from usbnet_disconnect */ usb_set_intfdata(info->data, NULL); usb_driver_release_interface (&usbnet_driver, info->data); - info->data = 0; + info->data = NULL; } /* and vice versa (just in case) */ @@ -1094,7 +1094,7 @@ /* ensure immediate exit from usbnet_disconnect */ usb_set_intfdata(info->control, NULL); usb_driver_release_interface (&usbnet_driver, info->control); - info->control = 0; + info->control = NULL; } } @@ -1641,7 +1641,7 @@ req, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, value, regnum, - 0, 0, // data is in setup packet + NULL, 0, // data is in setup packet CONTROL_TIMEOUT_JIFFIES); } @@ -2084,7 +2084,7 @@ req, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, val, index, - 0, 0, + NULL, 0, CONTROL_TIMEOUT_JIFFIES); } @@ -2418,7 +2418,7 @@ skb_put (skb, urb->actual_length); entry->state = rx_done; - entry->urb = 0; + entry->urb = NULL; switch (urb_status) { // success @@ -2462,7 +2462,7 @@ block: entry->state = rx_cleanup; entry->urb = urb; - urb = 0; + urb = NULL; break; // data overrun ... flush fifo? @@ -2557,7 +2557,7 @@ schedule_timeout (UNLINK_TIMEOUT_JIFFIES); devdbg (dev, "waited for %d urb completions", temp); } - dev->wait = 0; + dev->wait = NULL; remove_wait_queue (&unlink_wakeup, &wait); /* deferred work (task, timer, softirq) must also stop. @@ -2716,7 +2716,7 @@ /* tasklet could resubmit itself forever if memory is tight */ if (test_bit (EVENT_RX_MEMORY, &dev->flags)) { - struct urb *urb = 0; + struct urb *urb = NULL; if (netif_running (dev->net)) urb = usb_alloc_urb (0, GFP_KERNEL); @@ -2771,7 +2771,7 @@ } } - urb->dev = 0; + urb->dev = NULL; entry->state = tx_done; defer_bh (dev, skb); } @@ -2795,13 +2795,13 @@ struct usbnet *dev = (struct usbnet *) net->priv; int length; int retval = NET_XMIT_SUCCESS; - struct urb *urb = 0; + struct urb *urb = NULL; struct skb_data *entry; struct driver_info *info = dev->driver_info; unsigned long flags; #ifdef CONFIG_USB_NET1080 - struct nc_header *header = 0; - struct nc_trailer *trailer = 0; + struct nc_header *header = NULL; + struct nc_trailer *trailer = NULL; #endif /* CONFIG_USB_NET1080 */ // some devices want funky USB-level framing, for diff -Nru a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c --- a/drivers/usb/serial/keyspan.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/usb/serial/keyspan.c 2004-07-13 12:24:00 -07:00 @@ -1175,7 +1175,7 @@ stop_urb(p_priv->out_urbs[i]); } } - port->tty = 0; + port->tty = NULL; } diff -Nru a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c --- a/drivers/usb/serial/kobil_sct.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/serial/kobil_sct.c 2004-07-13 12:24:01 -07:00 @@ -361,7 +361,7 @@ if (port->write_urb){ usb_unlink_urb( port->write_urb ); usb_free_urb( port->write_urb ); - port->write_urb = 0; + port->write_urb = NULL; } if (port->interrupt_in_urb){ usb_unlink_urb (port->interrupt_in_urb); diff -Nru a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c --- a/drivers/usb/storage/sddr09.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/usb/storage/sddr09.c 2004-07-13 12:24:01 -07:00 @@ -1089,7 +1089,7 @@ if (result != USB_STOR_TRANSPORT_GOOD) { US_DEBUGP("Result of read_deviceID is %d\n", result); printk("sddr09: could not read card info\n"); - return 0; + return NULL; } sprintf(blurbtxt, "sddr09: Found Flash card, ID = %02X %02X %02X %02X", diff -Nru a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c --- a/drivers/video/aty/mach64_cursor.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/video/aty/mach64_cursor.c 2004-07-13 12:24:01 -07:00 @@ -182,7 +182,7 @@ cursor = kmalloc(sizeof(struct aty_cursor), GFP_ATOMIC); if (!cursor) - return 0; + return NULL; memset(cursor, 0, sizeof(*cursor)); info->fix.smem_len -= PAGE_SIZE; diff -Nru a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c --- a/drivers/video/cirrusfb.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/video/cirrusfb.c 2004-07-13 12:24:01 -07:00 @@ -2199,7 +2199,7 @@ } else { DPRINTK ("Attempt to get PCI info for Cirrus Graphics Card\n"); get_pci_addrs (pdev, &board_addr, &cinfo->fbregs_phys); - cinfo->regbase = 0; /* FIXME: this forces VGA. alternatives? */ + cinfo->regbase = NULL; /* FIXME: this forces VGA. alternatives? */ } DPRINTK ("Board address: 0x%lx, register address: 0x%lx\n", board_addr, cinfo->fbregs_phys); diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c --- a/drivers/video/fbmem.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/video/fbmem.c 2004-07-13 12:24:00 -07:00 @@ -1459,7 +1459,7 @@ { int i; - create_proc_read_entry("fb", 0, 0, fbmem_read_proc, NULL); + create_proc_read_entry("fb", 0, NULL, fbmem_read_proc, NULL); devfs_mk_dir("fb"); if (register_chrdev(FB_MAJOR,"fb",&fb_fops)) diff -Nru a/drivers/video/i810/i810_gtf.c b/drivers/video/i810/i810_gtf.c --- a/drivers/video/i810/i810_gtf.c 2004-07-13 12:24:01 -07:00 +++ b/drivers/video/i810/i810_gtf.c 2004-07-13 12:24:01 -07:00 @@ -222,7 +222,7 @@ u32 i810_get_watermark(const struct fb_var_screeninfo *var, struct i810fb_par *par) { - struct wm_info *wmark = 0; + struct wm_info *wmark = NULL; u32 i, size = 0, pixclock, wm_best = 0, min, diff; if (par->mem_freq == 100) { diff -Nru a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c --- a/drivers/video/kyro/fbdev.c 2004-07-13 12:24:00 -07:00 +++ b/drivers/video/kyro/fbdev.c 2004-07-13 12:24:00 -07:00 @@ -84,7 +84,7 @@ } device_info_t; /* global graphics card info structure (one per card) */ -static device_info_t deviceInfo = { 0 }; +static device_info_t deviceInfo; static char *mode_option __initdata = NULL; static int nopan __initdata = 0; diff -Nru a/drivers/video/riva/riva_hw.c b/drivers/video/riva/riva_hw.c --- a/drivers/video/riva/riva_hw.c 2004-07-13 12:24:02 -07:00 +++ b/drivers/video/riva/riva_hw.c 2004-07-13 12:24:02 -07:00 @@ -1344,7 +1344,7 @@ { case NV_ARCH_04: LOAD_FIXED_STATE(nv4,FIFO); - chip->Tri03 = 0L; + chip->Tri03 = NULL; chip->Tri05 = (RivaTexturedTriangle05 *)&(chip->FIFO[0x0000E000/4]); break; case NV_ARCH_10: @@ -1354,7 +1354,7 @@ */ LOAD_FIXED_STATE(nv10tri05,PGRAPH); LOAD_FIXED_STATE(nv10,FIFO); - chip->Tri03 = 0L; + chip->Tri03 = NULL; chip->Tri05 = (RivaTexturedTriangle05 *)&(chip->FIFO[0x0000E000/4]); break; } @@ -1394,13 +1394,13 @@ case 32: LOAD_FIXED_STATE_32BPP(nv3,PRAMIN); LOAD_FIXED_STATE_32BPP(nv3,PGRAPH); - chip->Tri03 = 0L; + chip->Tri03 = NULL; break; case 8: default: LOAD_FIXED_STATE_8BPP(nv3,PRAMIN); LOAD_FIXED_STATE_8BPP(nv3,PGRAPH); - chip->Tri03 = 0L; + chip->Tri03 = NULL; break; } for (i = 0x00000; i < 0x00800; i++) @@ -1438,13 +1438,13 @@ case 32: LOAD_FIXED_STATE_32BPP(nv4,PRAMIN); LOAD_FIXED_STATE_32BPP(nv4,PGRAPH); - chip->Tri03 = 0L; + chip->Tri03 = NULL; break; case 8: default: LOAD_FIXED_STATE_8BPP(nv4,PRAMIN); LOAD_FIXED_STATE_8BPP(nv4,PGRAPH); - chip->Tri03 = 0L; + chip->Tri03 = NULL; break; } chip->PGRAPH[0x00000640/4] = state->offset0; @@ -1483,13 +1483,13 @@ case 32: LOAD_FIXED_STATE_32BPP(nv10,PRAMIN); LOAD_FIXED_STATE_32BPP(nv10,PGRAPH); - chip->Tri03 = 0L; + chip->Tri03 = NULL; break; case 8: default: LOAD_FIXED_STATE_8BPP(nv10,PRAMIN); LOAD_FIXED_STATE_8BPP(nv10,PGRAPH); - chip->Tri03 = 0L; + chip->Tri03 = NULL; break; } diff -Nru a/fs/afs/fsclient.c b/fs/afs/fsclient.c --- a/fs/afs/fsclient.c 2004-07-13 12:24:01 -07:00 +++ b/fs/afs/fsclient.c 2004-07-13 12:24:01 -07:00 @@ -59,7 +59,7 @@ { struct rxrpc_connection *conn; struct rxrpc_call *call; - struct iovec piov[2]; + struct kvec piov[2]; size_t sent; int ret; u32 param[1]; @@ -189,7 +189,7 @@ { struct rxrpc_connection *conn; struct rxrpc_call *call; - struct iovec piov[3]; + struct kvec piov[3]; size_t sent; int ret; u32 param[2], *bp, zero; @@ -304,7 +304,7 @@ { struct afs_server_callslot callslot; struct rxrpc_call *call; - struct iovec piov[1]; + struct kvec piov[1]; size_t sent; int ret; u32 *bp; @@ -429,7 +429,7 @@ { struct afs_server_callslot callslot; struct rxrpc_call *call; - struct iovec piov[1]; + struct kvec piov[1]; size_t sent; int ret; u32 *bp; @@ -580,7 +580,7 @@ { struct afs_server_callslot callslot; struct rxrpc_call *call; - struct iovec piov[1]; + struct kvec piov[1]; size_t sent; int ret; u32 *bp; @@ -686,7 +686,7 @@ { struct rxrpc_connection *conn; struct rxrpc_call *call; - struct iovec piov[3]; + struct kvec piov[3]; size_t sent; int ret; u32 *bp, zero; diff -Nru a/fs/afs/mntpt.c b/fs/afs/mntpt.c --- a/fs/afs/mntpt.c 2004-07-13 12:24:00 -07:00 +++ b/fs/afs/mntpt.c 2004-07-13 12:24:00 -07:00 @@ -182,7 +182,7 @@ goto error; /* read the contents of the AFS special symlink */ - filler = mntpt->d_inode->i_mapping->a_ops->readpage; + filler = (filler_t *)mntpt->d_inode->i_mapping->a_ops->readpage; page = read_cache_page(mntpt->d_inode->i_mapping, 0, filler, NULL); if (IS_ERR(page)) { diff -Nru a/fs/afs/vlclient.c b/fs/afs/vlclient.c --- a/fs/afs/vlclient.c 2004-07-13 12:24:00 -07:00 +++ b/fs/afs/vlclient.c 2004-07-13 12:24:00 -07:00 @@ -97,7 +97,7 @@ { struct rxrpc_connection *conn; struct rxrpc_call *call; - struct iovec piov[1]; + struct kvec piov[1]; size_t sent; int ret; u32 param[1]; @@ -187,7 +187,7 @@ struct rxrpc_connection *conn; struct rxrpc_call *call; - struct iovec piov[3]; + struct kvec piov[3]; unsigned tmp; size_t sent; int ret, loop; @@ -322,7 +322,7 @@ struct rxrpc_connection *conn; struct rxrpc_call *call; - struct iovec piov[1]; + struct kvec piov[1]; unsigned tmp; size_t sent; int ret, loop; @@ -459,7 +459,7 @@ { struct rxrpc_connection *conn; struct rxrpc_call *call; - struct iovec piov[1]; + struct kvec piov[1]; size_t sent; int ret; u32 param[3]; diff -Nru a/fs/cifs/CHANGES b/fs/cifs/CHANGES --- a/fs/cifs/CHANGES 2004-07-13 12:24:01 -07:00 +++ b/fs/cifs/CHANGES 2004-07-13 12:24:01 -07:00 @@ -1,7 +1,11 @@ Version 1.20 ------------ Make transaction counts more consistent. Merge /proc/fs/cifs/SimultaneousOps -info into /proc/fs/cifs/DebugData +info into /proc/fs/cifs/DebugData. Fix oops in rare oops in readdir +(in build_wildcard_path_from_dentry). Fix mknod to pass type field +(block/char/fifo) properly. Remove spurious mount warning log entry when +credentials passed as mount argument. Set major/minor device number in +inode for block and char devices when unix extensions enabled. Version 1.19 ------------ diff -Nru a/fs/cifs/README b/fs/cifs/README --- a/fs/cifs/README 2004-07-13 12:24:01 -07:00 +++ b/fs/cifs/README 2004-07-13 12:24:01 -07:00 @@ -101,10 +101,11 @@ Note that ea support is required for supporting Linux xattrs. Some administrators also change the "map archive" and the "create mask" -parameters from their default values. Creating special devices (mknod) remotely -may require specifying a mkdev function to Samba. For more information on these -see the manual pages ("man smb.conf") on the Samba server system. Note that the -cifs vfs, unlike the smbfs vfs, does not read the smb.conf on the client system +parameters from their default values. Creating special devices (mknod) +remotely may require specifying a mkdev function to Samba if you are not using +Samba 3.0.5 or later. For more information on these see the manual pages +("man smb.conf") on the Samba server system. Note that the cifs vfs, +unlike the smbfs vfs, does not read the smb.conf on the client system (the few optional settings are passed in on mount via -o parameters instead). Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete open files (required for strict POSIX compliance). Windows Servers already diff -Nru a/fs/cifs/TODO b/fs/cifs/TODO --- a/fs/cifs/TODO 2004-07-13 12:24:01 -07:00 +++ b/fs/cifs/TODO 2004-07-13 12:24:01 -07:00 @@ -82,7 +82,7 @@ succeed but still return access denied (appears to be Windows server not cifs client problem) and has not been reproduced recently. NTFS partitions do not have this problem. -4) debug connectation lock test case 10 which fails against +4) debug connectathon lock test case 10 which fails against Samba (may be unmappable due to POSIX to Windows lock model differences but worth investigating). Also debug Samba to see why lock test case 7 takes longer to complete to Samba @@ -91,7 +91,7 @@ Misc testing to do ================== 1) check out max path names and max path name components against various server -types. Return max path name in stat -f information +types. Try nested symlinks. Return max path name in stat -f information 2) Modify file portion of ltp so it can run against a mounted network share and run it against cifs vfs. diff -Nru a/fs/cifs/asn1.c b/fs/cifs/asn1.c --- a/fs/cifs/asn1.c 2004-07-13 12:24:00 -07:00 +++ b/fs/cifs/asn1.c 2004-07-13 12:24:00 -07:00 @@ -201,7 +201,7 @@ if (def) *eoc = ctx->pointer + len; else - *eoc = 0; + *eoc = NULL; return 1; } diff -Nru a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c --- a/fs/cifs/cifs_debug.c 2004-07-13 12:24:01 -07:00 +++ b/fs/cifs/cifs_debug.c 2004-07-13 12:24:01 -07:00 @@ -313,65 +313,65 @@ proc_fs_cifs->owner = THIS_MODULE; create_proc_read_entry("DebugData", 0, proc_fs_cifs, - cifs_debug_data_read, 0); + cifs_debug_data_read, NULL); #ifdef CONFIG_CIFS_STATS create_proc_read_entry("Stats", 0, proc_fs_cifs, - cifs_stats_read, 0); + cifs_stats_read, NULL); #endif pde = create_proc_read_entry("cifsFYI", 0, proc_fs_cifs, - cifsFYI_read, 0); + cifsFYI_read, NULL); if (pde) pde->write_proc = cifsFYI_write; pde = create_proc_read_entry("traceSMB", 0, proc_fs_cifs, - traceSMB_read, 0); + traceSMB_read, NULL); if (pde) pde->write_proc = traceSMB_write; pde = create_proc_read_entry("OplockEnabled", 0, proc_fs_cifs, - oplockEnabled_read, 0); + oplockEnabled_read, NULL); if (pde) pde->write_proc = oplockEnabled_write; pde = create_proc_read_entry("QuotaEnabled", 0, proc_fs_cifs, - quotaEnabled_read, 0); + quotaEnabled_read, NULL); if (pde) pde->write_proc = quotaEnabled_write; pde = create_proc_read_entry("LinuxExtensionsEnabled", 0, proc_fs_cifs, - linuxExtensionsEnabled_read, 0); + linuxExtensionsEnabled_read, NULL); if (pde) pde->write_proc = linuxExtensionsEnabled_write; pde = create_proc_read_entry("MultiuserMount", 0, proc_fs_cifs, - multiuser_mount_read, 0); + multiuser_mount_read, NULL); if (pde) pde->write_proc = multiuser_mount_write; pde = create_proc_read_entry("ExtendedSecurity", 0, proc_fs_cifs, - extended_security_read, 0); + extended_security_read, NULL); if (pde) pde->write_proc = extended_security_write; pde = create_proc_read_entry("LookupCacheEnabled", 0, proc_fs_cifs, - lookupFlag_read, 0); + lookupFlag_read, NULL); if (pde) pde->write_proc = lookupFlag_write; pde = create_proc_read_entry("NTLMV2Enabled", 0, proc_fs_cifs, - ntlmv2_enabled_read, 0); + ntlmv2_enabled_read, NULL); if (pde) pde->write_proc = ntlmv2_enabled_write; pde = create_proc_read_entry("PacketSigningEnabled", 0, proc_fs_cifs, - packet_signing_enabled_read, 0); + packet_signing_enabled_read, NULL); if (pde) pde->write_proc = packet_signing_enabled_write; } diff -Nru a/fs/cifs/cifs_uniupr.h b/fs/cifs/cifs_uniupr.h --- a/fs/cifs/cifs_uniupr.h 2004-07-13 12:24:00 -07:00 +++ b/fs/cifs/cifs_uniupr.h 2004-07-13 12:24:00 -07:00 @@ -132,7 +132,7 @@ {0x0490, 0x04cc, UniCaseRangeU0490}, {0x1e00, 0x1ffc, UniCaseRangeU1e00}, {0xff40, 0xff5a, UniCaseRangeUff40}, - {0, 0, 0} + {0} }; #endif diff -Nru a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c --- a/fs/cifs/cifssmb.c 2004-07-13 12:24:00 -07:00 +++ b/fs/cifs/cifssmb.c 2004-07-13 12:24:00 -07:00 @@ -190,7 +190,7 @@ rc = -EIO; return rc; } - rc = smb_init(SMB_COM_NEGOTIATE, 0, 0 /* no tcon yet */ , + rc = smb_init(SMB_COM_NEGOTIATE, 0, NULL /* no tcon yet */ , (void **) &pSMB, (void **) &pSMBr); if (rc) return rc; @@ -363,7 +363,7 @@ return -EBUSY; } - rc = smb_init(SMB_COM_LOGOFF_ANDX, 2, 0 /* no tcon anymore */, + rc = smb_init(SMB_COM_LOGOFF_ANDX, 2, NULL /* no tcon anymore */, (void **) &pSMB, (void **) &smb_buffer_response); if(ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) @@ -2067,7 +2067,7 @@ if (ses == NULL) return -ENODEV; getDFSRetry: - rc = smb_init(SMB_COM_TRANSACTION2, 15, 0, (void **) &pSMB, + rc = smb_init(SMB_COM_TRANSACTION2, 15, NULL, (void **) &pSMB, (void **) &pSMBr); if (rc) return rc; @@ -2836,6 +2836,23 @@ data_offset->DevMajor = cpu_to_le64(MAJOR(device)); data_offset->DevMinor = cpu_to_le64(MINOR(device)); data_offset->Permissions = cpu_to_le64(mode); + + if(S_ISREG(mode)) + data_offset->Type = cpu_to_le32(UNIX_FILE); + else if(S_ISDIR(mode)) + data_offset->Type = cpu_to_le32(UNIX_DIR); + else if(S_ISLNK(mode)) + data_offset->Type = cpu_to_le32(UNIX_SYMLINK); + else if(S_ISCHR(mode)) + data_offset->Type = cpu_to_le32(UNIX_CHARDEV); + else if(S_ISBLK(mode)) + data_offset->Type = cpu_to_le32(UNIX_BLOCKDEV); + else if(S_ISFIFO(mode)) + data_offset->Type = cpu_to_le32(UNIX_FIFO); + else if(S_ISSOCK(mode)) + data_offset->Type = cpu_to_le32(UNIX_SOCKET); + + pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount); rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, (struct smb_hdr *) pSMBr, &bytes_returned, 0); diff -Nru a/fs/cifs/connect.c b/fs/cifs/connect.c --- a/fs/cifs/connect.c 2004-07-13 12:24:01 -07:00 +++ b/fs/cifs/connect.c 2004-07-13 12:24:01 -07:00 @@ -715,6 +715,8 @@ if((i==15) && (value[i] != 0)) printk(KERN_WARNING "CIFS: netbiosname longer than 15 and was truncated.\n"); } + } else if (strnicmp(data, "credentials", 4) == 0) { + /* ignore */ } else if (strnicmp(data, "version", 3) == 0) { /* ignore */ } else if (strnicmp(data, "rw", 2) == 0) { @@ -1443,7 +1445,7 @@ /* send SMBsessionSetup here */ header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, - 0 /* no tCon exists yet */ , 13 /* wct */ ); + NULL /* no tCon exists yet */ , 13 /* wct */ ); pSMB->req_no_secext.AndXCommand = 0xFF; pSMB->req_no_secext.MaxBufferSize = cpu_to_le16(ses->server->maxBuf); @@ -1699,7 +1701,7 @@ /* send SMBsessionSetup here */ header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, - 0 /* no tCon exists yet */ , 12 /* wct */ ); + NULL /* no tCon exists yet */ , 12 /* wct */ ); pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; pSMB->req.AndXCommand = 0xFF; pSMB->req.MaxBufferSize = cpu_to_le16(ses->server->maxBuf); @@ -1961,7 +1963,7 @@ /* send SMBsessionSetup here */ header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, - 0 /* no tCon exists yet */ , 12 /* wct */ ); + NULL /* no tCon exists yet */ , 12 /* wct */ ); pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT); @@ -2301,7 +2303,7 @@ /* send SMBsessionSetup here */ header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX, - 0 /* no tCon exists yet */ , 12 /* wct */ ); + NULL /* no tCon exists yet */ , 12 /* wct */ ); pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT); pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC; pSMB->req.AndXCommand = 0xFF; @@ -2674,7 +2676,7 @@ smb_buffer_response = smb_buffer; header_assemble(smb_buffer, SMB_COM_TREE_CONNECT_ANDX, - 0 /*no tid */ , 4 /*wct */ ); + NULL /*no tid */ , 4 /*wct */ ); smb_buffer->Uid = ses->Suid; pSMB = (TCONX_REQ *) smb_buffer; pSMBr = (TCONX_RSP *) smb_buffer_response; diff -Nru a/fs/cifs/dir.c b/fs/cifs/dir.c --- a/fs/cifs/dir.c 2004-07-13 12:24:01 -07:00 +++ b/fs/cifs/dir.c 2004-07-13 12:24:01 -07:00 @@ -101,6 +101,7 @@ return full_path; } +/* Note: caller must free return buffer */ char * build_wildcard_path_from_dentry(struct dentry *direntry) { @@ -108,18 +109,28 @@ int namelen = 0; char *full_path; + if(direntry == NULL) + return NULL; /* not much we can do if dentry is freed and + we need to reopen the file after it was closed implicitly + when the server crashed */ + +cifs_bwp_rename_retry: for (temp = direntry; !IS_ROOT(temp);) { namelen += (1 + temp->d_name.len); temp = temp->d_parent; + if(temp == NULL) { + cERROR(1,("corrupt dentry")); + return NULL; + } } - namelen += 3; /* allow for trailing null and wildcard (slash and *) */ - full_path = kmalloc(namelen, GFP_KERNEL); - namelen--; - full_path[namelen] = 0; /* trailing null */ - namelen--; - full_path[namelen] = '*'; - namelen--; + + full_path = kmalloc(namelen+3, GFP_KERNEL); + if(full_path == NULL) + return full_path; + full_path[namelen] = '\\'; + full_path[namelen+1] = '*'; + full_path[namelen+2] = 0; /* trailing null */ for (temp = direntry; !IS_ROOT(temp);) { namelen -= 1 + temp->d_name.len; @@ -129,13 +140,26 @@ full_path[namelen] = '\\'; strncpy(full_path + namelen + 1, temp->d_name.name, temp->d_name.len); + cFYI(0, (" name: %s ", full_path + namelen)); } temp = temp->d_parent; + if(temp == NULL) { + cERROR(1,("corrupt dentry")); + kfree(full_path); + return NULL; + } } - if (namelen != 0) + if (namelen != 0) { cERROR(1, ("We did not end path lookup where we expected namelen is %d", namelen)); + /* presumably this is only possible if we were racing with a rename + of one of the parent directories (we can not lock the dentries + above us to prevent this, but retrying should be harmless) */ + kfree(full_path); + namelen = 0; + goto cifs_bwp_rename_retry; + } return full_path; } @@ -431,9 +455,16 @@ cifs_sb = CIFS_SB(inode->i_sb); pTcon = cifs_sb->tcon; - full_path = build_wildcard_path_from_dentry(file->f_dentry); + if(file->f_dentry) { + down(&file->f_dentry->d_sb->s_vfs_rename_sem); + full_path = build_wildcard_path_from_dentry(file->f_dentry); + up(&file->f_dentry->d_sb->s_vfs_rename_sem); + } else { + FreeXid(xid); + return -EIO; + } - cFYI(1, (" inode = 0x%p and full path is %s", inode, full_path)); + cFYI(1, ("inode = 0x%p and full path is %s", inode, full_path)); if (full_path) kfree(full_path); diff -Nru a/fs/cifs/file.c b/fs/cifs/file.c --- a/fs/cifs/file.c 2004-07-13 12:24:00 -07:00 +++ b/fs/cifs/file.c 2004-07-13 12:24:00 -07:00 @@ -1105,7 +1105,7 @@ struct cifsTconInfo *pTcon; int bytes_read = 0; unsigned int read_size,i; - char * smb_read_data = 0; + char * smb_read_data = NULL; struct smb_com_read_rsp * pSMBr; struct pagevec lru_pvec; struct cifsFileInfo * open_file; @@ -1170,7 +1170,7 @@ if(rc== -EAGAIN) { if(smb_read_data) { cifs_buf_release(smb_read_data); - smb_read_data = 0; + smb_read_data = NULL; } } } @@ -1224,7 +1224,7 @@ } if(smb_read_data) { cifs_buf_release(smb_read_data); - smb_read_data = 0; + smb_read_data = NULL; } bytes_read = 0; } @@ -1234,7 +1234,7 @@ /* need to free smb_read_data buf before exit */ if(smb_read_data) { cifs_buf_release(smb_read_data); - smb_read_data = 0; + smb_read_data = NULL; } FreeXid(xid); @@ -1463,9 +1463,13 @@ } else if (pfindData->Type == UNIX_CHARDEV) { *pobject_type = DT_CHR; tmp_inode->i_mode |= S_IFCHR; + tmp_inode->i_rdev = MKDEV(le64_to_cpu(pfindData->DevMajor), + le64_to_cpu(pfindData->DevMinor) & MINORMASK); } else if (pfindData->Type == UNIX_BLOCKDEV) { *pobject_type = DT_BLK; tmp_inode->i_mode |= S_IFBLK; + tmp_inode->i_rdev = MKDEV(le64_to_cpu(pfindData->DevMajor), + le64_to_cpu(pfindData->DevMinor) & MINORMASK); } else if (pfindData->Type == UNIX_FIFO) { *pobject_type = DT_FIFO; tmp_inode->i_mode |= S_IFIFO; @@ -1682,7 +1686,14 @@ data = kmalloc(bufsize, GFP_KERNEL); pfindData = (FILE_DIRECTORY_INFO *) data; + if(file->f_dentry == NULL) { + FreeXid(xid); + return -EIO; + } + down(&file->f_dentry->d_sb->s_vfs_rename_sem); full_path = build_wildcard_path_from_dentry(file->f_dentry); + up(&file->f_dentry->d_sb->s_vfs_rename_sem); + cFYI(1, ("Full path: %s start at: %lld ", full_path, file->f_pos)); diff -Nru a/fs/cifs/inode.c b/fs/cifs/inode.c --- a/fs/cifs/inode.c 2004-07-13 12:24:00 -07:00 +++ b/fs/cifs/inode.c 2004-07-13 12:24:00 -07:00 @@ -110,8 +110,12 @@ inode->i_mode |= S_IFDIR; } else if (findData.Type == UNIX_CHARDEV) { inode->i_mode |= S_IFCHR; + inode->i_rdev = MKDEV(le64_to_cpu(findData.DevMajor), + le64_to_cpu(findData.DevMinor) & MINORMASK); } else if (findData.Type == UNIX_BLOCKDEV) { inode->i_mode |= S_IFBLK; + inode->i_rdev = MKDEV(le64_to_cpu(findData.DevMajor), + le64_to_cpu(findData.DevMinor) & MINORMASK); } else if (findData.Type == UNIX_FIFO) { inode->i_mode |= S_IFIFO; } else if (findData.Type == UNIX_SOCKET) { diff -Nru a/fs/cifs/misc.c b/fs/cifs/misc.c --- a/fs/cifs/misc.c 2004-07-13 12:24:01 -07:00 +++ b/fs/cifs/misc.c 2004-07-13 12:24:01 -07:00 @@ -150,7 +150,7 @@ struct smb_hdr * cifs_buf_get(void) { - struct smb_hdr *ret_buf = 0; + struct smb_hdr *ret_buf = NULL; /* We could use negotiated size instead of max_msgsize - but it may be more efficient to always alloc same size diff -Nru a/fs/coda/inode.c b/fs/coda/inode.c --- a/fs/coda/inode.c 2004-07-13 12:24:01 -07:00 +++ b/fs/coda/inode.c 2004-07-13 12:24:01 -07:00 @@ -142,7 +142,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) { - struct inode *root = 0; + struct inode *root = NULL; struct coda_sb_info *sbi = NULL; struct venus_comm *vc = NULL; struct CodaFid fid; diff -Nru a/fs/coda/psdev.c b/fs/coda/psdev.c --- a/fs/coda/psdev.c 2004-07-13 12:24:01 -07:00 +++ b/fs/coda/psdev.c 2004-07-13 12:24:01 -07:00 @@ -296,7 +296,7 @@ INIT_LIST_HEAD(&vcp->vc_pending); INIT_LIST_HEAD(&vcp->vc_processing); init_waitqueue_head(&vcp->vc_waitq); - vcp->vc_sb = 0; + vcp->vc_sb = NULL; vcp->vc_seq = 0; } diff -Nru a/fs/coda/sysctl.c b/fs/coda/sysctl.c --- a/fs/coda/sysctl.c 2004-07-13 12:24:00 -07:00 +++ b/fs/coda/sysctl.c 2004-07-13 12:24:00 -07:00 @@ -240,7 +240,7 @@ #ifdef CONFIG_SYSCTL if ( fs_table_header ) { unregister_sysctl_table(fs_table_header); - fs_table_header = 0; + fs_table_header = NULL; } #endif diff -Nru a/fs/compat.c b/fs/compat.c --- a/fs/compat.c 2004-07-13 12:24:01 -07:00 +++ b/fs/compat.c 2004-07-13 12:24:01 -07:00 @@ -824,7 +824,7 @@ return -EINVAL; buf->result++; dirent = buf->dirent; - if (!access_ok(VERIFY_WRITE, (unsigned long)dirent, + if (!access_ok(VERIFY_WRITE, dirent, (unsigned long)(dirent->d_name + namlen + 1) - (unsigned long)dirent)) goto efault; diff -Nru a/fs/compat_ioctl.c b/fs/compat_ioctl.c --- a/fs/compat_ioctl.c 2004-07-13 12:24:01 -07:00 +++ b/fs/compat_ioctl.c 2004-07-13 12:24:01 -07:00 @@ -257,66 +257,6 @@ compat_int_t clipcount; }; -static void free_kvideo_clips(struct video_window *kp) -{ - struct video_clip *cp; - - cp = kp->clips; - if(cp != NULL) - kfree(cp); -} - -static int get_video_window32(struct video_window *kp, struct video_window32 __user *up) -{ - struct video_clip32 __user *ucp; - struct video_clip *kcp; - int nclips, err, i; - u32 tmp; - - if(get_user(kp->x, &up->x)) - return -EFAULT; - __get_user(kp->y, &up->y); - __get_user(kp->width, &up->width); - __get_user(kp->height, &up->height); - __get_user(kp->chromakey, &up->chromakey); - __get_user(kp->flags, &up->flags); - __get_user(kp->clipcount, &up->clipcount); - __get_user(tmp, &up->clips); - ucp = compat_ptr(tmp); - kp->clips = NULL; - - nclips = kp->clipcount; - if(nclips == 0) - return 0; - - if(ucp == 0) - return -EINVAL; - - /* Peculiar interface... */ - if(nclips < 0) - nclips = VIDEO_CLIPMAP_SIZE; - - kcp = kmalloc(nclips * sizeof(struct video_clip), GFP_KERNEL); - err = -ENOMEM; - if(kcp == NULL) - goto cleanup_and_err; - - kp->clips = kcp; - for(i = 0; i < nclips; i++) { - __get_user(kcp[i].x, &ucp[i].x); - __get_user(kcp[i].y, &ucp[i].y); - __get_user(kcp[i].width, &ucp[i].width); - __get_user(kcp[i].height, &ucp[i].height); - kcp[nclips].next = NULL; - } - - return 0; - -cleanup_and_err: - free_kvideo_clips(kp); - return err; -} - /* You get back everything except the clips... */ static int put_video_window32(struct video_window *kp, struct video_window32 __user *up) { @@ -340,6 +280,66 @@ #define VIDIOCGFREQ32 _IOR('v',14, u32) #define VIDIOCSFREQ32 _IOW('v',15, u32) +enum { + MaxClips = (~0U-sizeof(struct video_window))/sizeof(struct video_clip) +}; + +static int do_set_window(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + struct video_window32 __user *up = compat_ptr(arg); + struct video_window __user *vw; + struct video_clip __user *p; + int nclips; + u32 n; + + if (get_user(nclips, &up->clipcount)) + return -EFAULT; + + /* Peculiar interface... */ + if (nclips < 0) + nclips = VIDEO_CLIPMAP_SIZE; + + if (nclips > MaxClips) + return -ENOMEM; + + vw = compat_alloc_user_space(sizeof(struct video_window) + + nclips * sizeof(struct video_clip)); + + p = nclips ? (struct video_clip __user *)(vw + 1) : NULL; + + if (get_user(n, &up->x) || put_user(n, &vw->x) || + get_user(n, &up->y) || put_user(n, &vw->y) || + get_user(n, &up->width) || put_user(n, &vw->width) || + get_user(n, &up->height) || put_user(n, &vw->height) || + get_user(n, &up->chromakey) || put_user(n, &vw->chromakey) || + get_user(n, &up->flags) || put_user(n, &vw->flags) || + get_user(n, &up->clipcount) || put_user(n, &vw->clipcount) || + get_user(n, &up->clips) || put_user(p, &vw->clips)) + return -EFAULT; + + if (nclips) { + struct video_clip32 __user *u = compat_ptr(n); + int i; + if (!u) + return -EINVAL; + for (i = 0; i < nclips; i++, u++, p++) { + s32 v; + if (get_user(v, &u->x) || + put_user(v, &p->x) || + get_user(v, &u->y) || + put_user(v, &p->y) || + get_user(v, &u->width) || + put_user(v, &p->width) || + get_user(v, &u->height) || + put_user(v, &p->height) || + put_user(NULL, &p->next)) + return -EFAULT; + } + } + + return sys_ioctl(fd, VIDIOCSWIN, (unsigned long)p); +} + static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) { union { @@ -357,7 +357,6 @@ case VIDIOCGTUNER32: cmd = VIDIOCGTUNER; break; case VIDIOCSTUNER32: cmd = VIDIOCSTUNER; break; case VIDIOCGWIN32: cmd = VIDIOCGWIN; break; - case VIDIOCSWIN32: cmd = VIDIOCSWIN; break; case VIDIOCGFBUF32: cmd = VIDIOCGFBUF; break; case VIDIOCSFBUF32: cmd = VIDIOCSFBUF; break; case VIDIOCGFREQ32: cmd = VIDIOCGFREQ; break; @@ -370,10 +369,6 @@ err = get_video_tuner32(&karg.vt, up); break; - case VIDIOCSWIN: - err = get_video_window32(&karg.vw, up); - break; - case VIDIOCSFBUF: err = get_video_buffer32(&karg.vb, up); break; @@ -389,9 +384,6 @@ err = sys_ioctl(fd, cmd, (unsigned long)&karg); set_fs(old_fs); - if(cmd == VIDIOCSWIN) - free_kvideo_clips(&karg.vw); - if(err == 0) { switch(cmd) { case VIDIOCGTUNER: @@ -2525,54 +2517,15 @@ static int do_usbdevfs_control(unsigned int fd, unsigned int cmd, unsigned long arg) { - struct usbdevfs_ctrltransfer kctrl; - struct usbdevfs_ctrltransfer32 __user *uctrl; - mm_segment_t old_fs; + struct usbdevfs_ctrltransfer32 __user *p32 = compat_ptr(arg); + struct usbdevfs_ctrltransfer __user *p; __u32 udata; - void __user *uptr; - void *kptr; - int err; - - uctrl = compat_ptr(arg); - - if (copy_from_user(&kctrl, uctrl, - (sizeof(struct usbdevfs_ctrltransfer32) - - sizeof(compat_caddr_t)))) - return -EFAULT; - - if (get_user(udata, &uctrl->data)) - return -EFAULT; - uptr = compat_ptr(udata); - /* In usbdevice_fs, it limits the control buffer to a page, - * for simplicity so do we. - */ - if (!uptr || kctrl.wLength > PAGE_SIZE) - return -EINVAL; - - kptr = (void *)__get_free_page(GFP_KERNEL); - - if ((kctrl.bRequestType & USB_DIR_IN) == 0) { - err = -EFAULT; - if (copy_from_user(kptr, uptr, kctrl.wLength)) - goto out; - } - - kctrl.data = kptr; - - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_ioctl(fd, USBDEVFS_CONTROL, (unsigned long)&kctrl); - set_fs(old_fs); - - if (err >= 0 && - ((kctrl.bRequestType & USB_DIR_IN) != 0)) { - if (copy_to_user(uptr, kptr, kctrl.wLength)) - err = -EFAULT; - } - -out: - free_page((unsigned long) kptr); - return err; + p = compat_alloc_user_space(sizeof(*p)); + if (copy_in_user(p, p32, (sizeof(*p32) - sizeof(compat_caddr_t))) || + get_user(udata, &p32->data) || + put_user(compat_ptr(udata), &p->data)) + return -EFAULT; + return sys_ioctl(fd, USBDEVFS_CONTROL, (unsigned long)p); } @@ -2587,54 +2540,20 @@ static int do_usbdevfs_bulk(unsigned int fd, unsigned int cmd, unsigned long arg) { - struct usbdevfs_bulktransfer kbulk; - struct usbdevfs_bulktransfer32 __user *ubulk; - mm_segment_t old_fs; - __u32 udata; - void __user *uptr; - void *kptr; - int err; - - ubulk = compat_ptr(arg); - - if (get_user(kbulk.ep, &ubulk->ep) || - get_user(kbulk.len, &ubulk->len) || - get_user(kbulk.timeout, &ubulk->timeout) || - get_user(udata, &ubulk->data)) + struct usbdevfs_bulktransfer32 __user *p32 = compat_ptr(arg); + struct usbdevfs_bulktransfer __user *p; + compat_uint_t n; + compat_caddr_t addr; + + p = compat_alloc_user_space(sizeof(*p)); + + if (get_user(n, &p32->ep) || put_user(n, &p->ep) || + get_user(n, &p32->len) || put_user(n, &p->len) || + get_user(n, &p32->timeout) || put_user(n, &p->timeout) || + get_user(addr, &p32->data) || put_user(compat_ptr(addr), &p->data)) return -EFAULT; - uptr = compat_ptr(udata); - - /* In usbdevice_fs, it limits the control buffer to a page, - * for simplicity so do we. - */ - if (!uptr || kbulk.len > PAGE_SIZE) - return -EINVAL; - - kptr = (void *) __get_free_page(GFP_KERNEL); - - if ((kbulk.ep & 0x80) == 0) { - err = -EFAULT; - if (copy_from_user(kptr, uptr, kbulk.len)) - goto out; - } - - kbulk.data = kptr; - - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_ioctl(fd, USBDEVFS_BULK, (unsigned long) &kbulk); - set_fs(old_fs); - - if (err >= 0 && - ((kbulk.ep & 0x80) != 0)) { - if (copy_to_user(uptr, kptr, kbulk.len)) - err = -EFAULT; - } - -out: - free_page((unsigned long) kptr); - return err; + return sys_ioctl(fd, USBDEVFS_BULK, (unsigned long)p); } /* This needs more work before we can enable it. Unfortunately @@ -3342,7 +3261,7 @@ HANDLE_IOCTL(VIDIOCGTUNER32, do_video_ioctl) HANDLE_IOCTL(VIDIOCSTUNER32, do_video_ioctl) HANDLE_IOCTL(VIDIOCGWIN32, do_video_ioctl) -HANDLE_IOCTL(VIDIOCSWIN32, do_video_ioctl) +HANDLE_IOCTL(VIDIOCSWIN32, do_set_window) HANDLE_IOCTL(VIDIOCGFBUF32, do_video_ioctl) HANDLE_IOCTL(VIDIOCSFBUF32, do_video_ioctl) HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl) diff -Nru a/fs/ext2/acl.c b/fs/ext2/acl.c --- a/fs/ext2/acl.c 2004-07-13 12:24:01 -07:00 +++ b/fs/ext2/acl.c 2004-07-13 12:24:01 -07:00 @@ -161,7 +161,7 @@ int retval; if (!test_opt(inode->i_sb, POSIX_ACL)) - return 0; + return NULL; switch(type) { case ACL_TYPE_ACCESS: diff -Nru a/fs/ext2/xattr.c b/fs/ext2/xattr.c --- a/fs/ext2/xattr.c 2004-07-13 12:24:01 -07:00 +++ b/fs/ext2/xattr.c 2004-07-13 12:24:01 -07:00 @@ -772,7 +772,8 @@ s_first_data_block) + EXT2_I(inode)->i_block_group * EXT2_BLOCKS_PER_GROUP(sb); - int block = ext2_new_block(inode, goal, 0, 0, &error); + int block = ext2_new_block(inode, goal, + NULL, NULL, &error); if (error) goto cleanup; ea_idebug(inode, "creating block %d", block); diff -Nru a/fs/ext3/acl.c b/fs/ext3/acl.c --- a/fs/ext3/acl.c 2004-07-13 12:24:00 -07:00 +++ b/fs/ext3/acl.c 2004-07-13 12:24:00 -07:00 @@ -164,7 +164,7 @@ int retval; if (!test_opt(inode->i_sb, POSIX_ACL)) - return 0; + return NULL; switch(type) { case ACL_TYPE_ACCESS: diff -Nru a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c --- a/fs/hfsplus/inode.c 2004-07-13 12:24:00 -07:00 +++ b/fs/hfsplus/inode.c 2004-07-13 12:24:00 -07:00 @@ -342,7 +342,7 @@ HFSPLUS_I(inode).cached_start = 0; HFSPLUS_I(inode).cached_blocks = 0; HFSPLUS_I(inode).phys_size = 0; - HFSPLUS_I(inode).rsrc_inode = 0; + HFSPLUS_I(inode).rsrc_inode = NULL; if (S_ISDIR(inode->i_mode)) { inode->i_size = 2; HFSPLUS_SB(sb).folder_count++; diff -Nru a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c --- a/fs/hpfs/buffer.c 2004-07-13 12:24:01 -07:00 +++ b/fs/hpfs/buffer.c 2004-07-13 12:24:01 -07:00 @@ -73,7 +73,7 @@ if (secno & 3) { printk("HPFS: hpfs_map_4sectors: unaligned read\n"); - return 0; + return NULL; } qbh->data = data = (char *)kmalloc(2048, GFP_NOFS); @@ -126,7 +126,7 @@ if (secno & 3) { printk("HPFS: hpfs_get_4sectors: unaligned read\n"); - return 0; + return NULL; } /*return hpfs_map_4sectors(s, secno, qbh, 0);*/ diff -Nru a/fs/isofs/compress.c b/fs/isofs/compress.c --- a/fs/isofs/compress.c 2004-07-13 12:24:00 -07:00 +++ b/fs/isofs/compress.c 2004-07-13 12:24:00 -07:00 @@ -114,7 +114,7 @@ blockendptr = blockptr + 4; indexblocks = ((blockptr^blockendptr) >> bufshift) ? 2 : 1; - ptrbh[0] = ptrbh[1] = 0; + ptrbh[0] = ptrbh[1] = NULL; if ( isofs_get_blocks(inode, blockptr >> bufshift, ptrbh, indexblocks) != indexblocks ) { if ( ptrbh[0] ) brelse(ptrbh[0]); diff -Nru a/fs/jffs/jffs_fm.c b/fs/jffs/jffs_fm.c --- a/fs/jffs/jffs_fm.c 2004-07-13 12:24:01 -07:00 +++ b/fs/jffs/jffs_fm.c 2004-07-13 12:24:01 -07:00 @@ -114,10 +114,9 @@ jffs_cleanup_fmcontrol(struct jffs_fmcontrol *fmc) { if (fmc) { - struct jffs_fm *cur; struct jffs_fm *next = fmc->head; - - while ((cur = next)) { + while (next) { + struct jffs_fm *cur = next; next = next->next; jffs_free_fm(cur); } diff -Nru a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c --- a/fs/lockd/xdr4.c 2004-07-13 12:24:00 -07:00 +++ b/fs/lockd/xdr4.c 2004-07-13 12:24:00 -07:00 @@ -191,7 +191,7 @@ dprintk("xdr: before encode_testres (p %p resp %p)\n", p, resp); if (!(p = nlm4_encode_cookie(p, &resp->cookie))) - return 0; + return NULL; *p++ = resp->status; if (resp->status == nlm_lck_denied) { @@ -202,7 +202,7 @@ /* Encode owner handle. */ if (!(p = xdr_encode_netobj(p, &resp->lock.oh))) - return 0; + return NULL; start = loff_t_to_s64(fl->fl_start); if (fl->fl_end == OFFSET_MAX) diff -Nru a/fs/minix/inode.c b/fs/minix/inode.c --- a/fs/minix/inode.c 2004-07-13 12:24:01 -07:00 +++ b/fs/minix/inode.c 2004-07-13 12:24:01 -07:00 @@ -453,7 +453,7 @@ raw_inode = minix_V1_raw_inode(inode->i_sb, inode->i_ino, &bh); if (!raw_inode) - return 0; + return NULL; raw_inode->i_mode = inode->i_mode; raw_inode->i_uid = fs_high2lowuid(inode->i_uid); raw_inode->i_gid = fs_high2lowgid(inode->i_gid); @@ -480,7 +480,7 @@ raw_inode = minix_V2_raw_inode(inode->i_sb, inode->i_ino, &bh); if (!raw_inode) - return 0; + return NULL; raw_inode->i_mode = inode->i_mode; raw_inode->i_uid = fs_high2lowuid(inode->i_uid); raw_inode->i_gid = fs_high2lowgid(inode->i_gid); diff -Nru a/fs/namei.c b/fs/namei.c --- a/fs/namei.c 2004-07-13 12:24:00 -07:00 +++ b/fs/namei.c 2004-07-13 12:24:00 -07:00 @@ -408,7 +408,61 @@ return result; } -static int __vfs_follow_link(struct nameidata *, const char *); +static int __emul_lookup_dentry(const char *, struct nameidata *); + +/* SMP-safe */ +static inline int +walk_init_root(const char *name, struct nameidata *nd) +{ + read_lock(¤t->fs->lock); + if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) { + nd->mnt = mntget(current->fs->altrootmnt); + nd->dentry = dget(current->fs->altroot); + read_unlock(¤t->fs->lock); + if (__emul_lookup_dentry(name,nd)) + return 0; + read_lock(¤t->fs->lock); + } + nd->mnt = mntget(current->fs->rootmnt); + nd->dentry = dget(current->fs->root); + read_unlock(¤t->fs->lock); + return 1; +} + +static inline int __vfs_follow_link(struct nameidata *nd, const char *link) +{ + int res = 0; + char *name; + if (IS_ERR(link)) + goto fail; + + if (*link == '/') { + path_release(nd); + if (!walk_init_root(link, nd)) + /* weird __emul_prefix() stuff did it */ + goto out; + } + res = link_path_walk(link, nd); +out: + if (nd->depth || res || nd->last_type!=LAST_NORM) + return res; + /* + * If it is an iterative symlinks resolution in open_namei() we + * have to copy the last component. And all that crap because of + * bloody create() on broken symlinks. Furrfu... + */ + name = __getname(); + if (unlikely(!name)) { + path_release(nd); + return -ENOMEM; + } + strcpy(name, nd->last.name); + nd->last.name = name; + return 0; +fail: + path_release(nd); + return PTR_ERR(link); +} /* * This limits recursive symlink follows to 8, while @@ -869,25 +923,6 @@ } } -/* SMP-safe */ -static inline int -walk_init_root(const char *name, struct nameidata *nd) -{ - read_lock(¤t->fs->lock); - if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) { - nd->mnt = mntget(current->fs->altrootmnt); - nd->dentry = dget(current->fs->altroot); - read_unlock(¤t->fs->lock); - if (__emul_lookup_dentry(name,nd)) - return 0; - read_lock(¤t->fs->lock); - } - nd->mnt = mntget(current->fs->rootmnt); - nd->dentry = dget(current->fs->root); - read_unlock(¤t->fs->lock); - return 1; -} - int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd) { int retval; @@ -2219,41 +2254,6 @@ dentry->d_inode->i_op->put_link(dentry, &nd); } return res; -} - -static int __vfs_follow_link(struct nameidata *nd, const char *link) -{ - int res = 0; - char *name; - if (IS_ERR(link)) - goto fail; - - if (*link == '/') { - path_release(nd); - if (!walk_init_root(link, nd)) - /* weird __emul_prefix() stuff did it */ - goto out; - } - res = link_path_walk(link, nd); -out: - if (nd->depth || res || nd->last_type!=LAST_NORM) - return res; - /* - * If it is an iterative symlinks resolution in open_namei() we - * have to copy the last component. And all that crap because of - * bloody create() on broken symlinks. Furrfu... - */ - name = __getname(); - if (unlikely(!name)) { - path_release(nd); - return -ENOMEM; - } - strcpy(name, nd->last.name); - nd->last.name = name; - return 0; -fail: - path_release(nd); - return PTR_ERR(link); } int vfs_follow_link(struct nameidata *nd, const char *link) diff -Nru a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c --- a/fs/nfs/nfs4proc.c 2004-07-13 12:24:01 -07:00 +++ b/fs/nfs/nfs4proc.c 2004-07-13 12:24:01 -07:00 @@ -387,7 +387,7 @@ fattr->valid = 0; if (sattr->ia_valid & ATTR_SIZE) - nfs4_copy_stateid(&arg.stateid, state, 0); + nfs4_copy_stateid(&arg.stateid, state, NULL); else memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid)); diff -Nru a/fs/qnx4/inode.c b/fs/qnx4/inode.c --- a/fs/qnx4/inode.c 2004-07-13 12:24:01 -07:00 +++ b/fs/qnx4/inode.c 2004-07-13 12:24:01 -07:00 @@ -232,8 +232,8 @@ int ix; long offset, i_xblk; unsigned long block = 0; - struct buffer_head *bh = 0; - struct qnx4_xblk *xblk = 0; + struct buffer_head *bh = NULL; + struct qnx4_xblk *xblk = NULL; struct qnx4_inode_entry *qnx4_inode = qnx4_raw_inode(inode); qnx4_nxtnt_t nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts); @@ -269,7 +269,7 @@ i_xblk = le32_to_cpu(xblk->xblk_next_xblk); ix = 0; brelse( bh ); - bh = 0; + bh = NULL; } } if ( bh ) diff -Nru a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c --- a/fs/reiserfs/do_balan.c 2004-07-13 12:24:00 -07:00 +++ b/fs/reiserfs/do_balan.c 2004-07-13 12:24:00 -07:00 @@ -169,8 +169,8 @@ if ( PATH_H_POSITION (tb->tb_path, 1) == 0 && 1 < B_NR_ITEMS(tb->FR[0]) ) replace_key(tb, tb->CFL[0],tb->lkey[0],tb->FR[0],1); - leaf_move_items (LEAF_FROM_S_TO_L, tb, n, -1, 0); - leaf_move_items (LEAF_FROM_R_TO_L, tb, B_NR_ITEMS(tb->R[0]), -1, 0); + leaf_move_items (LEAF_FROM_S_TO_L, tb, n, -1, NULL); + leaf_move_items (LEAF_FROM_R_TO_L, tb, B_NR_ITEMS(tb->R[0]), -1, NULL); reiserfs_invalidate_buffer (tb, tbS0); reiserfs_invalidate_buffer (tb, tb->R[0]); @@ -178,8 +178,8 @@ return 0; } /* all contents of all the 3 buffers will be in R[0] */ - leaf_move_items (LEAF_FROM_S_TO_R, tb, n, -1, 0); - leaf_move_items (LEAF_FROM_L_TO_R, tb, B_NR_ITEMS(tb->L[0]), -1, 0); + leaf_move_items (LEAF_FROM_S_TO_R, tb, n, -1, NULL); + leaf_move_items (LEAF_FROM_L_TO_R, tb, B_NR_ITEMS(tb->L[0]), -1, NULL); /* right_delimiting_key is correct in R[0] */ replace_key(tb, tb->CFR[0],tb->rkey[0],tb->R[0],0); @@ -854,7 +854,7 @@ /* Insert part of the item into S_new[i] before 0-th item */ bi.tb = tb; bi.bi_bh = S_new[i]; - bi.bi_parent = 0; + bi.bi_parent = NULL; bi.bi_position = 0; if ( (old_len - sbytes[i]) > zeros_num ) { @@ -882,7 +882,7 @@ /* Insert new item into S_new[i] */ bi.tb = tb; bi.bi_bh = S_new[i]; - bi.bi_parent = 0; + bi.bi_parent = NULL; bi.bi_position = 0; leaf_insert_into_buf (&bi, item_pos - n + snum[i] - 1, ih, body, zeros_num); @@ -927,7 +927,7 @@ /* Paste given directory entry to directory item */ bi.tb = tb; bi.bi_bh = S_new[i]; - bi.bi_parent = 0; + bi.bi_parent = NULL; bi.bi_position = 0; leaf_paste_in_buffer (&bi, 0, pos_in_item - entry_count + sbytes[i] - 1, tb->insert_size[0], body,zeros_num); @@ -965,7 +965,7 @@ /* Append part of body into S_new[0] */ bi.tb = tb; bi.bi_bh = S_new[i]; - bi.bi_parent = 0; + bi.bi_parent = NULL; bi.bi_position = 0; if ( n_rem > zeros_num ) { @@ -1021,7 +1021,7 @@ /* paste into item */ bi.tb = tb; bi.bi_bh = S_new[i]; - bi.bi_parent = 0; + bi.bi_parent = NULL; bi.bi_position = 0; leaf_paste_in_buffer(&bi, item_pos - n + snum[i], pos_in_item, tb->insert_size[0], body, zeros_num); @@ -1196,11 +1196,11 @@ bi.tb = tb; bi.bi_bh = first_b = tb->FEB[i]; - bi.bi_parent = 0; + bi.bi_parent = NULL; bi.bi_position = 0; make_empty_node (&bi); set_buffer_uptodate(first_b); - tb->FEB[i] = 0; + tb->FEB[i] = NULL; tb->used[i] = first_b; return(first_b); diff -Nru a/fs/reiserfs/file.c b/fs/reiserfs/file.c --- a/fs/reiserfs/file.c 2004-07-13 12:24:00 -07:00 +++ b/fs/reiserfs/file.c 2004-07-13 12:24:00 -07:00 @@ -832,7 +832,7 @@ struct item_head *ih = NULL; // pointer to item head that we are going to deal with struct buffer_head *itembuf=NULL; // Buffer head that contains items that we are going to deal with INITIALIZE_PATH(path); // path to item, that we are going to deal with. - __u32 * item=0; // pointer to item we are going to deal with + __u32 * item=NULL; // pointer to item we are going to deal with int item_pos=-1; /* Position in indirect item */ diff -Nru a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c --- a/fs/reiserfs/fix_node.c 2004-07-13 12:24:00 -07:00 +++ b/fs/reiserfs/fix_node.c 2004-07-13 12:24:00 -07:00 @@ -2445,12 +2445,12 @@ reiserfs_restore_prepared_buffer(p_s_tb->tb_sb, p_s_tb->CFR[i]); } - brelse (p_s_tb->L[i]);p_s_tb->L[i] = 0; - brelse (p_s_tb->R[i]);p_s_tb->R[i] = 0; - brelse (p_s_tb->FL[i]);p_s_tb->FL[i] = 0; - brelse (p_s_tb->FR[i]);p_s_tb->FR[i] = 0; - brelse (p_s_tb->CFL[i]);p_s_tb->CFL[i] = 0; - brelse (p_s_tb->CFR[i]);p_s_tb->CFR[i] = 0; + brelse (p_s_tb->L[i]);p_s_tb->L[i] = NULL; + brelse (p_s_tb->R[i]);p_s_tb->R[i] = NULL; + brelse (p_s_tb->FL[i]);p_s_tb->FL[i] = NULL; + brelse (p_s_tb->FR[i]);p_s_tb->FR[i] = NULL; + brelse (p_s_tb->CFL[i]);p_s_tb->CFL[i] = NULL; + brelse (p_s_tb->CFR[i]);p_s_tb->CFR[i] = NULL; } if (wait_tb_buffers_run) { diff -Nru a/fs/reiserfs/ibalance.c b/fs/reiserfs/ibalance.c --- a/fs/reiserfs/ibalance.c 2004-07-13 12:24:01 -07:00 +++ b/fs/reiserfs/ibalance.c 2004-07-13 12:24:01 -07:00 @@ -922,7 +922,7 @@ if ( tb->blknum[h] != 1 ) - reiserfs_panic(0, "balance_internal: One new node required for creating the new root"); + reiserfs_panic(NULL, "balance_internal: One new node required for creating the new root"); /* S[h] = empty buffer from the list FEB. */ tbSh = get_FEB (tb); blkh = B_BLK_HEAD(tbSh); @@ -964,7 +964,7 @@ dest_bi.tb = tb; dest_bi.bi_bh = S_new; - dest_bi.bi_parent = 0; + dest_bi.bi_parent = NULL; dest_bi.bi_position = 0; src_bi.tb = tb; src_bi.bi_bh = tbSh; diff -Nru a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c --- a/fs/reiserfs/inode.c 2004-07-13 12:24:00 -07:00 +++ b/fs/reiserfs/inode.c 2004-07-13 12:24:00 -07:00 @@ -556,7 +556,7 @@ INITIALIZE_PATH(path); int pos_in_item; struct cpu_key key; - struct buffer_head * bh, * unbh = 0; + struct buffer_head * bh, * unbh = NULL; struct item_head * ih, tmp_ih; __u32 * item; int done; @@ -1394,7 +1394,7 @@ if (comp_short_keys (INODE_PKEY (inode), key) || is_bad_inode (inode)) { /* either due to i/o error or a stale NFS handle */ iput (inode); - inode = 0; + inode = NULL; } return inode; } @@ -1558,13 +1558,13 @@ old type (ITEM_VERSION_1). Do not set key (second arg is 0), it is done by reiserfs_new_inode */ if (old_format_only (sb)) { - make_le_item_head (ih, 0, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE_V1, 2); + make_le_item_head (ih, NULL, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE_V1, 2); make_empty_dir_item_v1 (body, ih->ih_key.k_dir_id, ih->ih_key.k_objectid, INODE_PKEY (dir)->k_dir_id, INODE_PKEY (dir)->k_objectid ); } else { - make_le_item_head (ih, 0, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE, 2); + make_le_item_head (ih, NULL, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE, 2); make_empty_dir_item (body, ih->ih_key.k_dir_id, ih->ih_key.k_objectid, INODE_PKEY (dir)->k_dir_id, @@ -1606,7 +1606,7 @@ le32_to_cpu (ih->ih_key.k_objectid), 1, TYPE_DIRECT, 3/*key length*/); - make_le_item_head (ih, 0, KEY_FORMAT_3_5, 1, TYPE_DIRECT, item_len, 0/*free_space*/); + make_le_item_head (ih, NULL, KEY_FORMAT_3_5, 1, TYPE_DIRECT, item_len, 0/*free_space*/); /* look for place in the tree for new item */ retval = search_item (sb, &key, path); @@ -1701,7 +1701,7 @@ REISERFS_I(inode)->i_prealloc_block = 0; REISERFS_I(inode)->i_prealloc_count = 0; REISERFS_I(inode)->i_trans_id = 0; - REISERFS_I(inode)->i_jl = 0; + REISERFS_I(inode)->i_jl = NULL; REISERFS_I(inode)->i_attrs = REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK; sd_attrs_to_i_attrs( REISERFS_I(inode) -> i_attrs, inode ); @@ -1710,9 +1710,9 @@ init_rwsem (&REISERFS_I(inode)->xattr_sem); if (old_format_only (sb)) - make_le_item_head (&ih, 0, KEY_FORMAT_3_5, SD_OFFSET, TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT); + make_le_item_head (&ih, NULL, KEY_FORMAT_3_5, SD_OFFSET, TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT); else - make_le_item_head (&ih, 0, KEY_FORMAT_3_6, SD_OFFSET, TYPE_STAT_DATA, SD_SIZE, MAX_US_INT); + make_le_item_head (&ih, NULL, KEY_FORMAT_3_6, SD_OFFSET, TYPE_STAT_DATA, SD_SIZE, MAX_US_INT); /* key to search for correct place for new stat data */ _make_cpu_key (&key, KEY_FORMAT_3_6, le32_to_cpu (ih.ih_key.k_dir_id), diff -Nru a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c --- a/fs/reiserfs/item_ops.c 2004-07-13 12:24:01 -07:00 +++ b/fs/reiserfs/item_ops.c 2004-07-13 12:24:01 -07:00 @@ -549,7 +549,7 @@ if (l + IH_SIZE != vi->vi_item_len + ((is_affected && (vn->vn_mode == M_PASTE || vn->vn_mode == M_CUT)) ? insert_size : 0) ) { - reiserfs_panic (0, "vs-8025: set_entry_sizes: (mode==%c, insert_size==%d), invalid length of directory item", + reiserfs_panic (NULL, "vs-8025: set_entry_sizes: (mode==%c, insert_size==%d), invalid length of directory item", vn->vn_mode, insert_size); } } diff -Nru a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c --- a/fs/reiserfs/lbalance.c 2004-07-13 12:24:01 -07:00 +++ b/fs/reiserfs/lbalance.c 2004-07-13 12:24:01 -07:00 @@ -49,7 +49,7 @@ deh_location( &(deh[from + copy_count - 1])); } else { copy_records_len = 0; - records = 0; + records = NULL; } /* when copy last to first, dest buffer can contain 0 items */ @@ -145,7 +145,7 @@ else { if (bytes_or_entries == ih_item_len(ih) && is_indirect_le_ih(ih)) if (get_ih_free_space (ih)) - reiserfs_panic (0, "vs-10020: leaf_copy_boundary_item: " + reiserfs_panic (NULL, "vs-10020: leaf_copy_boundary_item: " "last unformatted node must be filled entirely (%h)", ih); } @@ -552,13 +552,13 @@ src_bi->bi_position = PATH_H_B_ITEM_ORDER (tb->tb_path, 0); dest_bi->tb = tb; dest_bi->bi_bh = Snew; - dest_bi->bi_parent = 0; + dest_bi->bi_parent = NULL; dest_bi->bi_position = 0; *first_last = LAST_TO_FIRST; break; default: - reiserfs_panic (0, "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", shift_mode); + reiserfs_panic (NULL, "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", shift_mode); } RFALSE( src_bi->bi_bh == 0 || dest_bi->bi_bh == 0, "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly", @@ -595,7 +595,7 @@ int i; /* move shift_num (and shift_bytes bytes) items from S[0] to left neighbor L[0] */ - i = leaf_move_items (LEAF_FROM_S_TO_L, tb, shift_num, shift_bytes, 0); + i = leaf_move_items (LEAF_FROM_S_TO_L, tb, shift_num, shift_bytes, NULL); if ( shift_num ) { if (B_NR_ITEMS (S0) == 0) { /* number of items in S[0] == 0 */ @@ -648,7 +648,7 @@ int ret_value; /* move shift_num (and shift_bytes) items from S[0] to right neighbor R[0] */ - ret_value = leaf_move_items (LEAF_FROM_S_TO_R, tb, shift_num, shift_bytes, 0); + ret_value = leaf_move_items (LEAF_FROM_S_TO_R, tb, shift_num, shift_bytes, NULL); /* replace rkey in CFR[0] by the 0-th key from R[0] */ if (shift_num) { @@ -829,7 +829,7 @@ #ifdef CONFIG_REISERFS_CHECK if (zeros_number > paste_size) { print_cur_tb ("10177"); - reiserfs_panic ( 0, "vs-10177: leaf_paste_in_buffer: ero number == %d, paste_size == %d", + reiserfs_panic ( NULL, "vs-10177: leaf_paste_in_buffer: ero number == %d, paste_size == %d", zeros_number, paste_size); } #endif /* CONFIG_REISERFS_CHECK */ diff -Nru a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c --- a/fs/reiserfs/namei.c 2004-07-13 12:24:01 -07:00 +++ b/fs/reiserfs/namei.c 2004-07-13 12:24:01 -07:00 @@ -331,7 +331,7 @@ return ERR_PTR(-ENAMETOOLONG); reiserfs_write_lock(dir->i_sb); - de.de_gen_number_bit_string = 0; + de.de_gen_number_bit_string = NULL; retval = reiserfs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &path_to_entry, &de); pathrelse (&path_to_entry); if (retval == NAME_FOUND) { @@ -384,7 +384,7 @@ if (dir->i_nlink == 0) { return ERR_PTR(-ENOENT); } - de.de_gen_number_bit_string = 0; + de.de_gen_number_bit_string = NULL; reiserfs_write_lock(dir->i_sb); retval = reiserfs_find_entry (dir, "..", 2, &path_to_entry, &de); @@ -607,7 +607,7 @@ reiserfs_write_lock_xattrs (dir->i_sb); journal_begin(&th, dir->i_sb, jbegin_count) ; - retval = reiserfs_new_inode (&th, dir, mode, 0, 0/*i_size*/, dentry, inode); + retval = reiserfs_new_inode (&th, dir, mode, NULL, 0/*i_size*/, dentry, inode); if (locked) reiserfs_write_unlock_xattrs (dir->i_sb); @@ -668,7 +668,7 @@ journal_begin(&th, dir->i_sb, jbegin_count) ; - retval = reiserfs_new_inode (&th, dir, mode, 0, 0/*i_size*/, dentry, inode); + retval = reiserfs_new_inode (&th, dir, mode, NULL, 0/*i_size*/, dentry, inode); if (locked) reiserfs_write_unlock_xattrs (dir->i_sb); @@ -737,7 +737,7 @@ */ INC_DIR_INODE_NLINK(dir) - retval = reiserfs_new_inode (&th, dir, mode, 0/*symlink*/, + retval = reiserfs_new_inode (&th, dir, mode, NULL/*symlink*/, old_format_only (dir->i_sb) ? EMPTY_DIR_SIZE_V1 : EMPTY_DIR_SIZE, dentry, inode); @@ -805,7 +805,7 @@ reiserfs_write_lock(dir->i_sb); journal_begin(&th, dir->i_sb, jbegin_count) ; - de.de_gen_number_bit_string = 0; + de.de_gen_number_bit_string = NULL; if ( (retval = reiserfs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &path, &de)) == NAME_NOT_FOUND) { retval = -ENOENT; goto end_rmdir; @@ -886,7 +886,7 @@ reiserfs_write_lock(dir->i_sb); journal_begin(&th, dir->i_sb, jbegin_count) ; - de.de_gen_number_bit_string = 0; + de.de_gen_number_bit_string = NULL; if ( (retval = reiserfs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &path, &de)) == NAME_NOT_FOUND) { retval = -ENOENT; goto end_unlink; @@ -1093,13 +1093,13 @@ if (inode) { if (!de_visible (de->de_deh + de->de_entry_num)) - reiserfs_panic (0, "vs-7042: entry_points_to_object: entry must be visible"); + reiserfs_panic (NULL, "vs-7042: entry_points_to_object: entry must be visible"); return (de->de_objectid == inode->i_ino) ? 1 : 0; } /* this must be added hidden entry */ if (de_visible (de->de_deh + de->de_entry_num)) - reiserfs_panic (0, "vs-7043: entry_points_to_object: entry must be visible"); + reiserfs_panic (NULL, "vs-7043: entry_points_to_object: entry must be visible"); return 1; } @@ -1149,7 +1149,7 @@ // make sure, that oldname still exists and points to an object we // are going to rename - old_de.de_gen_number_bit_string = 0; + old_de.de_gen_number_bit_string = NULL; reiserfs_write_lock(old_dir->i_sb); retval = reiserfs_find_entry (old_dir, old_dentry->d_name.name, old_dentry->d_name.len, &old_entry_path, &old_de); @@ -1180,7 +1180,7 @@ /* directory is renamed, its parent directory will be changed, ** so find ".." entry */ - dot_dot_de.de_gen_number_bit_string = 0; + dot_dot_de.de_gen_number_bit_string = NULL; retval = reiserfs_find_entry (old_inode, "..", 2, &dot_dot_entry_path, &dot_dot_de); pathrelse (&dot_dot_entry_path); if (retval != NAME_FOUND) { @@ -1232,7 +1232,7 @@ reiserfs_prepare_for_journal(old_inode->i_sb, old_de.de_bh, 1) ; // look for new name by reiserfs_find_entry - new_de.de_gen_number_bit_string = 0; + new_de.de_gen_number_bit_string = NULL; retval = reiserfs_find_entry (new_dir, new_dentry->d_name.name, new_dentry->d_name.len, &new_entry_path, &new_de); // reiserfs_add_entry should not return IO_ERROR, because it is called with essentially same parameters from diff -Nru a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c --- a/fs/reiserfs/prints.c 2004-07-13 12:24:01 -07:00 +++ b/fs/reiserfs/prints.c 2004-07-13 12:24:01 -07:00 @@ -631,8 +631,8 @@ tbSh = PATH_H_PBUFFER (tb->tb_path, h); tbFh = PATH_H_PPARENT (tb->tb_path, h); } else { - tbSh = 0; - tbFh = 0; + tbSh = NULL; + tbFh = NULL; } sprintf (print_tb_buf + strlen (print_tb_buf), "* %d * %3lld(%2d) * %3lld(%2d) * %3lld(%2d) * %5lld * %5lld * %5lld * %5lld * %5lld *\n", @@ -695,10 +695,10 @@ blkh = B_BLK_HEAD (bh); nr = blkh_nr_item(blkh); if ( nr > (bh->b_size - BLKH_SIZE) / IH_SIZE) - reiserfs_panic (0, "vs-6010: check_leaf_block_head: invalid item number %z", bh); + reiserfs_panic (NULL, "vs-6010: check_leaf_block_head: invalid item number %z", bh); if ( blkh_free_space(blkh) > bh->b_size - BLKH_SIZE - IH_SIZE * nr ) - reiserfs_panic (0, "vs-6020: check_leaf_block_head: invalid free space %z", bh); + reiserfs_panic (NULL, "vs-6020: check_leaf_block_head: invalid free space %z", bh); } @@ -708,14 +708,14 @@ blkh = B_BLK_HEAD (bh); if (!(B_LEVEL (bh) > DISK_LEAF_NODE_LEVEL && B_LEVEL (bh) <= MAX_HEIGHT)) - reiserfs_panic (0, "vs-6025: check_internal_block_head: invalid level %z", bh); + reiserfs_panic (NULL, "vs-6025: check_internal_block_head: invalid level %z", bh); if (B_NR_ITEMS (bh) > (bh->b_size - BLKH_SIZE) / IH_SIZE) - reiserfs_panic (0, "vs-6030: check_internal_block_head: invalid item number %z", bh); + reiserfs_panic (NULL, "vs-6030: check_internal_block_head: invalid item number %z", bh); if (B_FREE_SPACE (bh) != bh->b_size - BLKH_SIZE - KEY_SIZE * B_NR_ITEMS (bh) - DC_SIZE * (B_NR_ITEMS (bh) + 1)) - reiserfs_panic (0, "vs-6040: check_internal_block_head: invalid free space %z", bh); + reiserfs_panic (NULL, "vs-6040: check_internal_block_head: invalid free space %z", bh); } diff -Nru a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c --- a/fs/reiserfs/procfs.c 2004-07-13 12:24:00 -07:00 +++ b/fs/reiserfs/procfs.c 2004-07-13 12:24:00 -07:00 @@ -591,7 +591,7 @@ int reiserfs_proc_info_global_init( void ) { if( proc_info_root == NULL ) { - proc_info_root = proc_mkdir( proc_info_root_name, 0 ); + proc_info_root = proc_mkdir(proc_info_root_name, NULL); if( proc_info_root ) { proc_info_root -> owner = THIS_MODULE; } else { @@ -608,7 +608,7 @@ { if ( proc_info_root != NULL ) { proc_info_root = NULL; - remove_proc_entry( proc_info_root_name, 0 ); + remove_proc_entry(proc_info_root_name, NULL); } return 0; } diff -Nru a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c --- a/fs/reiserfs/stree.c 2004-07-13 12:24:01 -07:00 +++ b/fs/reiserfs/stree.c 2004-07-13 12:24:01 -07:00 @@ -1306,7 +1306,7 @@ copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path)); s_del_balance.insert_size[0] = n_del_size; - n_ret_value = fix_nodes(M_DELETE, &s_del_balance, NULL, 0); + n_ret_value = fix_nodes(M_DELETE, &s_del_balance, NULL, NULL); if ( n_ret_value != REPEAT_SEARCH ) break; @@ -1446,14 +1446,14 @@ } quota_cut_bytes = ih_item_len(PATH_PITEM_HEAD(&path)) ; - retval = fix_nodes (M_DELETE, &tb, NULL, 0); + retval = fix_nodes (M_DELETE, &tb, NULL, NULL); if (retval == REPEAT_SEARCH) { PROC_INFO_INC( th -> t_super, delete_solid_item_restarted ); continue; } if (retval == CARRY_ON) { - do_balance (&tb, 0, 0, M_DELETE); + do_balance (&tb, NULL, NULL, M_DELETE); if (inode) { /* Should we count quota for item? (we don't count quotas for save-links) */ #ifdef REISERQUOTA_DEBUG reiserfs_debug (th->t_super, "reiserquota delete_solid_item(): freeing %u id=%u type=%c", quota_cut_bytes, inode->i_uid, key2type(key)); @@ -1587,7 +1587,7 @@ "vs-5616: appended bytes found"); PATH_LAST_POSITION (path) --; - removed = reiserfs_delete_item (th, path, &tail_key, inode, 0/*unbh not needed*/); + removed = reiserfs_delete_item (th, path, &tail_key, inode, NULL/*unbh not needed*/); RFALSE( removed <= 0 || removed > tail_len, "vs-5617: there was tail %d bytes, removed item length %d bytes", tail_len, removed); @@ -1677,7 +1677,7 @@ s_cut_balance.insert_size[0] = n_cut_size; - n_ret_value = fix_nodes(c_mode, &s_cut_balance, NULL, 0); + n_ret_value = fix_nodes(c_mode, &s_cut_balance, NULL, NULL); if ( n_ret_value != REPEAT_SEARCH ) break; @@ -1935,7 +1935,7 @@ if (le_ih_k_offset (found_ih) + op_bytes_number (found_ih, get_last_bh (path)->b_size) != cpu_key_k_offset (p_s_key) || op_bytes_number (found_ih, get_last_bh (path)->b_size) != pos_in_item (path)) - reiserfs_panic (0, "PAP-5720: check_research_for_paste: " + reiserfs_panic (NULL, "PAP-5720: check_research_for_paste: " "found direct item %h or position (%d) does not match to key %K", found_ih, pos_in_item (path), p_s_key); } @@ -1943,7 +1943,7 @@ if (le_ih_k_offset (found_ih) + op_bytes_number (found_ih, get_last_bh (path)->b_size) != cpu_key_k_offset (p_s_key) || I_UNFM_NUM (found_ih) != pos_in_item (path) || get_ih_free_space (found_ih) != 0) - reiserfs_panic (0, "PAP-5730: check_research_for_paste: " + reiserfs_panic (NULL, "PAP-5730: check_research_for_paste: " "found indirect item (%h) or position (%d) does not match to key (%K)", found_ih, pos_in_item (path), p_s_key); } diff -Nru a/fs/reiserfs/super.c b/fs/reiserfs/super.c --- a/fs/reiserfs/super.c 2004-07-13 12:24:01 -07:00 +++ b/fs/reiserfs/super.c 2004-07-13 12:24:01 -07:00 @@ -695,28 +695,29 @@ char * arg = NULL; char * pos; opt_desc_t opts[] = { - {"tails", 't', tails, 0, 0}, /* Compatibility stuff, so that -o notail for old setups still work */ - {"notail", 0, 0, 0, (1<= (unsigned int)-1) { @@ -755,7 +756,7 @@ } if ( c == 'w' ) { - char *p=0; + char *p=NULL; int val = simple_strtoul (arg, &p, 0); if ( *p != '\0') { diff -Nru a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c --- a/fs/reiserfs/tail_conversion.c 2004-07-13 12:24:01 -07:00 +++ b/fs/reiserfs/tail_conversion.c 2004-07-13 12:24:01 -07:00 @@ -223,7 +223,7 @@ /* Set direct item header to insert. */ - make_le_item_head (&s_ih, 0, get_inode_item_key_version (p_s_inode), pos1 + 1, + make_le_item_head (&s_ih, NULL, get_inode_item_key_version (p_s_inode), pos1 + 1, TYPE_DIRECT, round_tail_len, 0xffff/*ih_free_space*/); /* we want a pointer to the first byte of the tail in the page. diff -Nru a/fs/sysv/inode.c b/fs/sysv/inode.c --- a/fs/sysv/inode.c 2004-07-13 12:24:00 -07:00 +++ b/fs/sysv/inode.c 2004-07-13 12:24:00 -07:00 @@ -233,12 +233,12 @@ if (!ino || ino > sbi->s_ninodes) { printk("Bad inode number on dev %s: %d is out of range\n", inode->i_sb->s_id, ino); - return 0; + return NULL; } raw_inode = sysv_raw_inode(sb, ino, &bh); if (!raw_inode) { printk("unable to read i-node block\n"); - return 0; + return NULL; } raw_inode->i_mode = cpu_to_fs16(sbi, inode->i_mode); diff -Nru a/include/asm-alpha/core_lca.h b/include/asm-alpha/core_lca.h --- a/include/asm-alpha/core_lca.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-alpha/core_lca.h 2004-07-13 12:24:01 -07:00 @@ -136,7 +136,7 @@ #define LCA_PMR_DMAO 0x80 /* DMA override */ #define LCA_PMR_OCCEB 0xffff0000L /* Override cycle counter - even bits */ #define LCA_PMR_OCCOB 0xffff000000000000L /* Override cycle counter - even bits */ -#define LCA_PMR_PRIMARY_MASK 0xfffffffffffffff8 +#define LCA_PMR_PRIMARY_MASK 0xfffffffffffffff8L /* LCA PMR Macros */ diff -Nru a/include/asm-alpha/fpu.h b/include/asm-alpha/fpu.h --- a/include/asm-alpha/fpu.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-alpha/fpu.h 2004-07-13 12:24:00 -07:00 @@ -27,7 +27,7 @@ #define FPCR_DYN_PLUS (0x3UL << FPCR_DYN_SHIFT) /* towards +INF */ #define FPCR_DYN_MASK (0x3UL << FPCR_DYN_SHIFT) -#define FPCR_MASK 0xffff800000000000 +#define FPCR_MASK 0xffff800000000000L /* * IEEE trap enables are implemented in software. These per-thread diff -Nru a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h --- a/include/asm-alpha/pgalloc.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-alpha/pgalloc.h 2004-07-13 12:24:00 -07:00 @@ -66,7 +66,7 @@ pte_t *pte = pte_alloc_one_kernel(mm, addr); if (pte) return virt_to_page(pte); - return 0; + return NULL; } static inline void diff -Nru a/include/asm-alpha/signal.h b/include/asm-alpha/signal.h --- a/include/asm-alpha/signal.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-alpha/signal.h 2004-07-13 12:24:01 -07:00 @@ -128,7 +128,11 @@ #define SIG_SETMASK 3 /* 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 */ @@ -149,7 +153,7 @@ struct k_sigaction { struct sigaction sa; - void (*ka_restorer)(void); + __sigrestore_t ka_restorer; }; #else /* Here we must cater to libcs that poke about in kernel headers. */ @@ -169,7 +173,7 @@ #endif /* __KERNEL__ */ typedef struct sigaltstack { - void *ss_sp; + void __user *ss_sp; int ss_flags; size_t ss_size; } stack_t; @@ -179,7 +183,7 @@ implemented here for OSF/1 compatibility. */ struct sigstack { - void *ss_sp; + void __user *ss_sp; int ss_onstack; }; diff -Nru a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h --- a/include/asm-alpha/spinlock.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-alpha/spinlock.h 2004-07-13 12:24:01 -07:00 @@ -26,9 +26,9 @@ } spinlock_t; #ifdef CONFIG_DEBUG_SPINLOCK -#define SPIN_LOCK_UNLOCKED (spinlock_t) {0, -1, 0, 0, 0, 0} +#define SPIN_LOCK_UNLOCKED (spinlock_t) {0, -1, 0, NULL, NULL, NULL} #define spin_lock_init(x) \ - ((x)->lock = 0, (x)->on_cpu = -1, (x)->previous = 0, (x)->task = 0) + ((x)->lock = 0, (x)->on_cpu = -1, (x)->previous = NULL, (x)->task = NULL) #else #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } #define spin_lock_init(x) ((x)->lock = 0) diff -Nru a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h --- a/include/asm-alpha/topology.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-alpha/topology.h 2004-07-13 12:24:00 -07:00 @@ -22,17 +22,17 @@ return node; } -static inline int node_to_cpumask(int node) +static inline cpumask_t node_to_cpumask(int node) { - unsigned long node_cpu_mask = 0; + cpumask_t node_cpu_mask = CPU_MASK_NONE; int cpu; for(cpu = 0; cpu < NR_CPUS; cpu++) { if (cpu_online(cpu) && (cpu_to_node(cpu) == node)) - node_cpu_mask |= 1UL << cpu; + cpu_set(cpu, node_cpu_mask); } -#if DEBUG_NUMA +#ifdef DEBUG_NUMA printk("node %d: cpu_mask: %016lx\n", node, node_cpu_mask); #endif @@ -41,6 +41,8 @@ /* Cross-node load balancing interval. */ # define NODE_BALANCE_RATE 10 + +#define pcibus_to_cpumask(bus) (cpu_online_map) #else /* CONFIG_NUMA */ # include diff -Nru a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h --- a/include/asm-alpha/uaccess.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-alpha/uaccess.h 2004-07-13 12:24:01 -07:00 @@ -29,15 +29,6 @@ #define segment_eq(a,b) ((a).seg == (b).seg) -#ifdef __CHECKER__ -#define CHECK_UPTR(ptr) do { \ - __typeof__(*(ptr)) *__dummy_check_uptr = \ - (void __user *)&__dummy_check_uptr; \ -} while(0) -#else -#define CHECK_UPTR(ptr) -#endif - /* * Is a address valid? This does a straightforward calculation rather * than tests. @@ -53,7 +44,7 @@ #define access_ok(type,addr,size) \ ({ \ - CHECK_UPTR(addr); \ + __chk_user_ptr(addr); \ __access_ok(((unsigned long)(addr)),(size),get_fs()); \ }) @@ -101,7 +92,7 @@ #define __get_user_nocheck(x,ptr,size) \ ({ \ long __gu_err = 0, __gu_val; \ - CHECK_UPTR(ptr); \ + __chk_user_ptr(ptr); \ switch (size) { \ case 1: __get_user_8(ptr); break; \ case 2: __get_user_16(ptr); break; \ @@ -113,23 +104,23 @@ __gu_err; \ }) -#define __get_user_check(x,ptr,size,segment) \ -({ \ - long __gu_err = -EFAULT, __gu_val = 0; \ - const __typeof__(*(ptr)) *__gu_addr = (ptr); \ - CHECK_UPTR(ptr); \ - if (__access_ok((long)__gu_addr,size,segment)) { \ - __gu_err = 0; \ - switch (size) { \ - case 1: __get_user_8(__gu_addr); break; \ - case 2: __get_user_16(__gu_addr); break; \ - case 4: __get_user_32(__gu_addr); break; \ - case 8: __get_user_64(__gu_addr); break; \ - default: __get_user_unknown(); break; \ - } \ - } \ - (x) = (__typeof__(*(ptr))) __gu_val; \ - __gu_err; \ +#define __get_user_check(x,ptr,size,segment) \ +({ \ + long __gu_err = -EFAULT, __gu_val = 0; \ + const __typeof__(*(ptr)) *__gu_addr = (ptr); \ + __chk_user_ptr(ptr); \ + if (__access_ok((unsigned long)__gu_addr,size,segment)) { \ + __gu_err = 0; \ + switch (size) { \ + case 1: __get_user_8(__gu_addr); break; \ + case 2: __get_user_16(__gu_addr); break; \ + case 4: __get_user_32(__gu_addr); break; \ + case 8: __get_user_64(__gu_addr); break; \ + default: __get_user_unknown(); break; \ + } \ + } \ + (x) = (__typeof__(*(ptr))) __gu_val; \ + __gu_err; \ }) struct __large_struct { unsigned long buf[100]; }; @@ -217,7 +208,7 @@ #define __put_user_nocheck(x,ptr,size) \ ({ \ long __pu_err = 0; \ - CHECK_UPTR(ptr); \ + __chk_user_ptr(ptr); \ switch (size) { \ case 1: __put_user_8(x,ptr); break; \ case 2: __put_user_16(x,ptr); break; \ @@ -228,22 +219,22 @@ __pu_err; \ }) -#define __put_user_check(x,ptr,size,segment) \ -({ \ - long __pu_err = -EFAULT; \ - __typeof__(*(ptr)) *__pu_addr = (ptr); \ - CHECK_UPTR(ptr); \ - if (__access_ok((long)__pu_addr,size,segment)) { \ - __pu_err = 0; \ - switch (size) { \ - case 1: __put_user_8(x,__pu_addr); break; \ - case 2: __put_user_16(x,__pu_addr); break; \ - case 4: __put_user_32(x,__pu_addr); break; \ - case 8: __put_user_64(x,__pu_addr); break; \ - default: __put_user_unknown(); break; \ - } \ - } \ - __pu_err; \ +#define __put_user_check(x,ptr,size,segment) \ +({ \ + long __pu_err = -EFAULT; \ + __typeof__(*(ptr)) *__pu_addr = (ptr); \ + __chk_user_ptr(ptr); \ + if (__access_ok((unsigned long)__pu_addr,size,segment)) { \ + __pu_err = 0; \ + switch (size) { \ + case 1: __put_user_8(x,__pu_addr); break; \ + case 2: __put_user_16(x,__pu_addr); break; \ + case 4: __put_user_32(x,__pu_addr); break; \ + case 8: __put_user_64(x,__pu_addr); break; \ + default: __put_user_unknown(); break; \ + } \ + } \ + __pu_err; \ }) /* @@ -388,32 +379,32 @@ extern inline long __copy_tofrom_user(void *to, const void *from, long len, const void __user *validate) { - if (__access_ok((long)validate, len, get_fs())) + if (__access_ok((unsigned long)validate, len, get_fs())) len = __copy_tofrom_user_nocheck(to, from, len); return len; } -#define __copy_to_user(to,from,n) \ -({ \ - CHECK_UPTR(to); \ - __copy_tofrom_user_nocheck((void *)(to),(from),(n)); \ +#define __copy_to_user(to,from,n) \ +({ \ + __chk_user_ptr(to); \ + __copy_tofrom_user_nocheck((__force void *)(to),(from),(n)); \ }) -#define __copy_from_user(to,from,n) \ -({ \ - CHECK_UPTR(from); \ - __copy_tofrom_user_nocheck((to),(void *)(from),(n)); \ +#define __copy_from_user(to,from,n) \ +({ \ + __chk_user_ptr(from); \ + __copy_tofrom_user_nocheck((to),(__force void *)(from),(n)); \ }) extern inline long copy_to_user(void __user *to, const void *from, long n) { - return __copy_tofrom_user((void *)to, from, n, to); + return __copy_tofrom_user((__force void *)to, from, n, to); } extern inline long copy_from_user(void *to, const void __user *from, long n) { - return __copy_tofrom_user(to, (void *)from, n, from); + return __copy_tofrom_user(to, (__force void *)from, n, from); } extern void __do_clear_user(void); @@ -435,7 +426,7 @@ extern inline long clear_user(void __user *to, long len) { - if (__access_ok((long)to, len, get_fs())) + if (__access_ok((unsigned long)to, len, get_fs())) len = __clear_user(to, len); return len; } @@ -452,7 +443,7 @@ strncpy_from_user(char *to, const char __user *from, long n) { long ret = -EFAULT; - if (__access_ok((long)from, 0, get_fs())) + if (__access_ok((unsigned long)from, 0, get_fs())) ret = __strncpy_from_user(to, from, n); return ret; } diff -Nru a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h --- a/include/asm-arm/arch-s3c2410/regs-serial.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-arm/arch-s3c2410/regs-serial.h 2004-07-13 12:24:01 -07:00 @@ -106,8 +106,23 @@ /* fifo size information */ -#define S3C2410_UFCON_RXC(fcon) (((fcon) & S3C2410_UFSTAT_RXMASK) >> S3C2410_UFSTAT_RXSHIFT) -#define S3C2410_UFCON_TXC(fcon) (((fcon) & S3C2410_UFSTAT_TXMASK) >> S3C2410_UFSTAT_TXSHIFT) +#ifndef __ASSEMBLY__ +static inline int S3C2410_UFCON_RXC(int fcon) +{ + if (fcon & S3C2410_UFSTAT_RXFULL) + return 16; + + return ((fcon) & S3C2410_UFSTAT_RXMASK) >> S3C2410_UFSTAT_RXSHIFT; +} + +static inline int S3C2410_UFCON_TXC(int fcon) +{ + if (fcon & S3C2410_UFSTAT_TXFULL) + return 16; + + return ((fcon) & S3C2410_UFSTAT_TXMASK) >> S3C2410_UFSTAT_TXSHIFT; +} +#endif /* __ASSEMBLY__ */ #define S3C2410_UMSTAT_CTS (1<<0) #define S3C2410_UMSTAT_DeltaCTS (1<<2) diff -Nru a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h --- a/include/asm-generic/siginfo.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-generic/siginfo.h 2004-07-13 12:24:00 -07:00 @@ -6,7 +6,7 @@ typedef union sigval { int sival_int; - void *sival_ptr; + void __user *sival_ptr; } sigval_t; /* @@ -78,7 +78,7 @@ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ struct { - void *_addr; /* faulting insn/memory ref. */ + void __user *_addr; /* faulting insn/memory ref. */ #ifdef __ARCH_SI_TRAPNO int _trapno; /* TRAP # which caused the signal */ #endif diff -Nru a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h --- a/include/asm-generic/tlb.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-generic/tlb.h 2004-07-13 12:24:00 -07:00 @@ -147,4 +147,6 @@ __pmd_free_tlb(tlb, pmdp); \ } while (0) +#define tlb_migrate_finish(mm) do {} while (0) + #endif /* _ASM_GENERIC__TLB_H */ diff -Nru a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h --- a/include/asm-ia64/atomic.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-ia64/atomic.h 2004-07-13 12:24:00 -07:00 @@ -56,7 +56,7 @@ CMPXCHG_BUGCHECK(v); old = atomic_read(v); new = old + i; - } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old); + } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old); return new; } @@ -84,7 +84,7 @@ CMPXCHG_BUGCHECK(v); old = atomic_read(v); new = old - i; - } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old); + } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old); return new; } diff -Nru a/include/asm-ia64/dma-mapping.h b/include/asm-ia64/dma-mapping.h --- a/include/asm-ia64/dma-mapping.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-ia64/dma-mapping.h 2004-07-13 12:24:01 -07:00 @@ -6,6 +6,8 @@ * David Mosberger-Tang */ +#include + #define dma_alloc_coherent platform_dma_alloc_coherent #define dma_alloc_noncoherent platform_dma_alloc_coherent /* coherent mem. is cheap */ #define dma_free_coherent platform_dma_free_coherent diff -Nru a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h --- a/include/asm-ia64/machvec.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-ia64/machvec.h 2004-07-13 12:24:01 -07:00 @@ -19,6 +19,7 @@ struct scatterlist; struct irq_desc; struct page; +struct mm_struct; typedef void ia64_mv_setup_t (char **); typedef void ia64_mv_cpu_init_t (void); @@ -26,6 +27,7 @@ typedef void ia64_mv_send_ipi_t (int, int, int, int); typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *); typedef void ia64_mv_global_tlb_purge_t (unsigned long, unsigned long, unsigned long); +typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *); typedef struct irq_desc *ia64_mv_irq_desc (unsigned int); typedef u8 ia64_mv_irq_to_vector (u8); typedef unsigned int ia64_mv_local_vector_to_irq (u8 vector); @@ -69,11 +71,21 @@ typedef unsigned int ia64_mv_readl_relaxed_t (void *); typedef unsigned long ia64_mv_readq_relaxed_t (void *); -extern void machvec_noop (void); +static inline void +machvec_noop (void) +{ +} + +static inline void +machvec_noop_mm (struct mm_struct *mm) +{ +} + extern void machvec_setup (char **); extern void machvec_timer_interrupt (int, void *, struct pt_regs *); extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int); extern void machvec_dma_sync_sg (struct device *, struct scatterlist *, int, int); +extern void machvec_tlb_migrate_finish (struct mm_struct *); # if defined (CONFIG_IA64_HP_SIM) # include @@ -95,6 +107,7 @@ # define platform_send_ipi ia64_mv.send_ipi # define platform_timer_interrupt ia64_mv.timer_interrupt # define platform_global_tlb_purge ia64_mv.global_tlb_purge +# define platform_tlb_migrate_finish ia64_mv.tlb_migrate_finish # define platform_dma_init ia64_mv.dma_init # define platform_dma_alloc_coherent ia64_mv.dma_alloc_coherent # define platform_dma_free_coherent ia64_mv.dma_free_coherent @@ -140,6 +153,7 @@ ia64_mv_send_ipi_t *send_ipi; ia64_mv_timer_interrupt_t *timer_interrupt; ia64_mv_global_tlb_purge_t *global_tlb_purge; + ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish; ia64_mv_dma_init *dma_init; ia64_mv_dma_alloc_coherent *dma_alloc_coherent; ia64_mv_dma_free_coherent *dma_free_coherent; @@ -181,6 +195,7 @@ platform_send_ipi, \ platform_timer_interrupt, \ platform_global_tlb_purge, \ + platform_tlb_migrate_finish, \ platform_dma_init, \ platform_dma_alloc_coherent, \ platform_dma_free_coherent, \ @@ -259,6 +274,9 @@ #endif #ifndef platform_global_tlb_purge # define platform_global_tlb_purge ia64_global_tlb_purge /* default to architected version */ +#endif +#ifndef platform_tlb_migrate_finish +# define platform_tlb_migrate_finish machvec_noop_mm #endif #ifndef platform_dma_init # define platform_dma_init swiotlb_init diff -Nru a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h --- a/include/asm-ia64/machvec_sn2.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-ia64/machvec_sn2.h 2004-07-13 12:24:00 -07:00 @@ -39,6 +39,7 @@ extern ia64_mv_send_ipi_t sn2_send_IPI; extern ia64_mv_timer_interrupt_t sn_timer_interrupt; extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge; +extern ia64_mv_tlb_migrate_finish_t sn_tlb_migrate_finish; extern ia64_mv_irq_desc sn_irq_desc; extern ia64_mv_irq_to_vector sn_irq_to_vector; extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq; @@ -83,6 +84,7 @@ #define platform_send_ipi sn2_send_IPI #define platform_timer_interrupt sn_timer_interrupt #define platform_global_tlb_purge sn2_global_tlb_purge +#define platform_tlb_migrate_finish sn_tlb_migrate_finish #define platform_pci_fixup sn_pci_fixup #define platform_inb __sn_inb #define platform_inw __sn_inw diff -Nru a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h --- a/include/asm-ia64/thread_info.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-ia64/thread_info.h 2004-07-13 12:24:01 -07:00 @@ -73,12 +73,15 @@ #define TIF_SIGPENDING 1 /* signal pending */ #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ #define TIF_SYSCALL_TRACE 3 /* syscall trace active */ +#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_WORK_MASK 0x7 /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE */ -#define TIF_ALLWORK_MASK 0xf /* bits 0..3 are "work to do on user-return" bits */ +#define TIF_ALLWORK_MASK 0x1f /* bits 0..4 are "work to do on user-return" bits */ #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) +#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) +#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) diff -Nru a/include/asm-ia64/tlb.h b/include/asm-ia64/tlb.h --- a/include/asm-ia64/tlb.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-ia64/tlb.h 2004-07-13 12:24:00 -07:00 @@ -44,6 +44,7 @@ #include #include #include +#include #ifdef CONFIG_SMP # define FREE_PTE_NR 2048 @@ -210,6 +211,8 @@ tlb->start_addr = address; tlb->end_addr = address + PAGE_SIZE; } + +#define tlb_migrate_finish(mm) platform_tlb_migrate_finish(mm) #define tlb_start_vma(tlb, vma) do { } while (0) #define tlb_end_vma(tlb, vma) do { } while (0) diff -Nru a/include/asm-sparc/bpp.h b/include/asm-sparc/bpp.h --- a/include/asm-sparc/bpp.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc/bpp.h 2004-07-13 12:24:01 -07:00 @@ -40,9 +40,9 @@ */ # define BPP_PUT_PINS _IOW('B', 1, int) -# define BPP_GET_PINS _IOR('B', 2, void) +# define BPP_GET_PINS _IOR('B', 2, char) /* that's bogus - should've been _IO */ # define BPP_PUT_DATA _IOW('B', 3, int) -# define BPP_GET_DATA _IOR('B', 4, void) +# define BPP_GET_DATA _IOR('B', 4, char) /* ditto */ /* * Set the data bus to input mode. Disengage the data bin driver and diff -Nru a/include/asm-sparc/bug.h b/include/asm-sparc/bug.h --- a/include/asm-sparc/bug.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc/bug.h 2004-07-13 12:24:01 -07:00 @@ -8,7 +8,7 @@ */ #if (__GNUC__ > 3) || \ (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \ - (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 1) + (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4) #define __bug_trap() __builtin_trap() #else #define __bug_trap() \ diff -Nru a/include/asm-sparc/dma.h b/include/asm-sparc/dma.h --- a/include/asm-sparc/dma.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc/dma.h 2004-07-13 12:24:01 -07:00 @@ -19,6 +19,7 @@ #include #include +struct page; extern spinlock_t dma_spin_lock; static __inline__ unsigned long claim_dma_lock(void) @@ -243,5 +244,47 @@ #else #define isa_dma_bridge_buggy (0) #endif + +/* Routines for data transfer buffers. */ +BTFIXUPDEF_CALL(char *, mmu_lockarea, char *, unsigned long) +BTFIXUPDEF_CALL(void, mmu_unlockarea, char *, unsigned long) + +#define mmu_lockarea(vaddr,len) BTFIXUP_CALL(mmu_lockarea)(vaddr,len) +#define mmu_unlockarea(vaddr,len) BTFIXUP_CALL(mmu_unlockarea)(vaddr,len) + +/* These are implementations for sbus_map_sg/sbus_unmap_sg... collapse later */ +BTFIXUPDEF_CALL(__u32, mmu_get_scsi_one, char *, unsigned long, struct sbus_bus *sbus) +BTFIXUPDEF_CALL(void, mmu_get_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus) +BTFIXUPDEF_CALL(void, mmu_release_scsi_one, __u32, unsigned long, struct sbus_bus *sbus) +BTFIXUPDEF_CALL(void, mmu_release_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus) + +#define mmu_get_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_get_scsi_one)(vaddr,len,sbus) +#define mmu_get_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_get_scsi_sgl)(sg,sz,sbus) +#define mmu_release_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_release_scsi_one)(vaddr,len,sbus) +#define mmu_release_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_release_scsi_sgl)(sg,sz,sbus) + +/* + * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep. + * + * The mmu_map_dma_area establishes two mappings in one go. + * These mappings point to pages normally mapped at 'va' (linear address). + * First mapping is for CPU visible address at 'a', uncached. + * This is an alias, but it works because it is an uncached mapping. + * Second mapping is for device visible address, or "bus" address. + * The bus address is returned at '*pba'. + * + * These functions seem distinct, but are hard to split. On sun4c, + * at least for now, 'a' is equal to bus address, and retured in *pba. + * On sun4m, page attributes depend on the CPU type, so we have to + * know if we are mapping RAM or I/O, so it has to be an additional argument + * to a separate mapping function for CPU visible mappings. + */ +BTFIXUPDEF_CALL(int, mmu_map_dma_area, dma_addr_t *, unsigned long, unsigned long, int len) +BTFIXUPDEF_CALL(struct page *, mmu_translate_dvma, unsigned long busa) +BTFIXUPDEF_CALL(void, mmu_unmap_dma_area, unsigned long busa, int len) + +#define mmu_map_dma_area(pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(pba,va,a,len) +#define mmu_unmap_dma_area(ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(ba,len) +#define mmu_translate_dvma(ba) BTFIXUP_CALL(mmu_translate_dvma)(ba) #endif /* !(_ASM_SPARC_DMA_H) */ diff -Nru a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h --- a/include/asm-sparc/pci.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc/pci.h 2004-07-13 12:24:01 -07:00 @@ -87,6 +87,12 @@ extern void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, size_t size, int direction); +/* map_page and map_single cannot fail */ +static inline int pci_dma_mapping_error(dma_addr_t dma_addr) +{ + return 0; +} + /* Map a set of buffers described by scatterlist in streaming * mode for DMA. This is the scather-gather version of the * above pci_map_single interface. Here the scatter gather list diff -Nru a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h --- a/include/asm-sparc/pgtable.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc/pgtable.h 2004-07-13 12:24:01 -07:00 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -32,48 +31,6 @@ extern void load_mmu(void); extern unsigned long calc_highpages(void); - -/* Routines for data transfer buffers. */ -BTFIXUPDEF_CALL(char *, mmu_lockarea, char *, unsigned long) -BTFIXUPDEF_CALL(void, mmu_unlockarea, char *, unsigned long) - -#define mmu_lockarea(vaddr,len) BTFIXUP_CALL(mmu_lockarea)(vaddr,len) -#define mmu_unlockarea(vaddr,len) BTFIXUP_CALL(mmu_unlockarea)(vaddr,len) - -/* These are implementations for sbus_map_sg/sbus_unmap_sg... collapse later */ -BTFIXUPDEF_CALL(__u32, mmu_get_scsi_one, char *, unsigned long, struct sbus_bus *sbus) -BTFIXUPDEF_CALL(void, mmu_get_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus) -BTFIXUPDEF_CALL(void, mmu_release_scsi_one, __u32, unsigned long, struct sbus_bus *sbus) -BTFIXUPDEF_CALL(void, mmu_release_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus) - -#define mmu_get_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_get_scsi_one)(vaddr,len,sbus) -#define mmu_get_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_get_scsi_sgl)(sg,sz,sbus) -#define mmu_release_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_release_scsi_one)(vaddr,len,sbus) -#define mmu_release_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_release_scsi_sgl)(sg,sz,sbus) - -/* - * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep. - * - * The mmu_map_dma_area establishes two mappings in one go. - * These mappings point to pages normally mapped at 'va' (linear address). - * First mapping is for CPU visible address at 'a', uncached. - * This is an alias, but it works because it is an uncached mapping. - * Second mapping is for device visible address, or "bus" address. - * The bus address is returned at '*pba'. - * - * These functions seem distinct, but are hard to split. On sun4c, - * at least for now, 'a' is equal to bus address, and retured in *pba. - * On sun4m, page attributes depend on the CPU type, so we have to - * know if we are mapping RAM or I/O, so it has to be an additional argument - * to a separate mapping function for CPU visible mappings. - */ -BTFIXUPDEF_CALL(int, mmu_map_dma_area, dma_addr_t *, unsigned long, unsigned long, int len) -BTFIXUPDEF_CALL(struct page *, mmu_translate_dvma, unsigned long busa) -BTFIXUPDEF_CALL(void, mmu_unmap_dma_area, unsigned long busa, int len) - -#define mmu_map_dma_area(pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(pba,va,a,len) -#define mmu_unmap_dma_area(ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(ba,len) -#define mmu_translate_dvma(ba) BTFIXUP_CALL(mmu_translate_dvma)(ba) BTFIXUPDEF_SIMM13(pgdir_shift) BTFIXUPDEF_SETHI(pgdir_size) diff -Nru a/include/asm-sparc/pgtsrmmu.h b/include/asm-sparc/pgtsrmmu.h --- a/include/asm-sparc/pgtsrmmu.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-sparc/pgtsrmmu.h 2004-07-13 12:24:00 -07:00 @@ -106,7 +106,7 @@ * enforce all the protection levels that vma's can have. * XXX But for now... */ -#define SRMMU_PAGE_NONE __pgprot(SRMMU_VALID | SRMMU_CACHE | \ +#define SRMMU_PAGE_NONE __pgprot(SRMMU_CACHE | \ SRMMU_PRIV | SRMMU_REF) #define SRMMU_PAGE_SHARED __pgprot(SRMMU_VALID | SRMMU_CACHE | \ SRMMU_EXEC | SRMMU_WRITE | SRMMU_REF) diff -Nru a/include/asm-sparc/pgtsun4.h b/include/asm-sparc/pgtsun4.h --- a/include/asm-sparc/pgtsun4.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-sparc/pgtsun4.h 2004-07-13 12:24:00 -07:00 @@ -51,6 +51,7 @@ #define _SUN4C_PAGE_NOCACHE 0x10000000 /* non-cacheable page */ #define _SUN4C_PAGE_PRESENT 0x08000000 /* implemented in software */ #define _SUN4C_PAGE_IO 0x04000000 /* I/O page */ +#define _SUN4C_PAGE_FILE 0x02000000 /* implemented in software */ #define _SUN4C_PAGE_READ 0x00800000 /* implemented in software */ #define _SUN4C_PAGE_WRITE 0x00400000 /* implemented in software */ #define _SUN4C_PAGE_ACCESSED 0x00200000 /* implemented in software */ @@ -70,6 +71,21 @@ #define SUN4C_PAGE_READONLY __pgprot(_SUN4C_PAGE_PRESENT|_SUN4C_READABLE) #define SUN4C_PAGE_KERNEL __pgprot(_SUN4C_READABLE|_SUN4C_WRITEABLE|\ _SUN4C_PAGE_DIRTY|_SUN4C_PAGE_PRIV) + +/* SUN4C swap entry encoding + * + * We use 5 bits for the type and 19 for the offset. This gives us + * 32 swapfiles of 4GB each. Encoding looks like: + * + * RRRRRRRRooooooooooooooooooottttt + * fedcba9876543210fedcba9876543210 + * + * The top 8 bits are reserved for protection and status bits, especially + * FILE and PRESENT. + */ +#define SUN4C_SWP_TYPE_MASK 0x1f +#define SUN4C_SWP_OFF_MASK 0x7ffff +#define SUN4C_SWP_OFF_SHIFT 5 #ifndef __ASSEMBLY__ diff -Nru a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h --- a/include/asm-sparc/processor.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc/processor.h 2004-07-13 12:24:01 -07:00 @@ -76,20 +76,8 @@ #define SPARC_FLAG_UNALIGNED 0x2 /* is allowed to do unaligned accesses */ #define INIT_THREAD { \ -/* kregs, _pad1, */ \ - 0, 0, \ -/* fork_kpsr, fork_kwim */ \ - 0, 0, \ -/* FPU regs */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \ -/* FPU status, FPU qdepth, FPU queue */ \ - 0, 0, { { 0, 0, }, }, \ -/* flags, current_ds, */ \ - SPARC_FLAG_KTHREAD, KERNEL_DS, \ -/* core_exec */ \ -{ 0, }, \ -/* new_signal */ \ - 0, \ + .flags = SPARC_FLAG_KTHREAD, \ + .current_ds = KERNEL_DS, \ } /* Return saved PC of a blocked thread. */ diff -Nru a/include/asm-sparc/sun4prom.h b/include/asm-sparc/sun4prom.h --- a/include/asm-sparc/sun4prom.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-sparc/sun4prom.h 2004-07-13 12:24:00 -07:00 @@ -25,7 +25,7 @@ unsigned char (*getchar)(void); /* Get char from input device */ void (*putchar)(char); /* Put char to output device */ int (*mayget)(void); /* Maybe get char, or -1 */ - int (*mayput)(void); /* Maybe put char, or -1 */ + int (*mayput)(int); /* Maybe put char, or -1 */ unsigned char *echo; /* Should getchar echo? */ unsigned char *insource; /* Input source selector */ unsigned char *outsink; /* Output sink selector */ diff -Nru a/include/asm-sparc/vfc_ioctls.h b/include/asm-sparc/vfc_ioctls.h --- a/include/asm-sparc/vfc_ioctls.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc/vfc_ioctls.h 2004-07-13 12:24:01 -07:00 @@ -52,7 +52,7 @@ unsigned long addr; unsigned long ret; unsigned long len; - unsigned char *buffer; + unsigned char __user *buffer; }; #endif /* _LINUX_VFC_IOCTLS_H_ */ diff -Nru a/include/asm-sparc64/asi.h b/include/asm-sparc64/asi.h --- a/include/asm-sparc64/asi.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-sparc64/asi.h 2004-07-13 12:24:00 -07:00 @@ -8,125 +8,138 @@ */ /* V9 Architecture mandary ASIs. */ -#define ASI_N 0x04 /* Nucleus */ -#define ASI_NL 0x0c /* Nucleus, little endian */ -#define ASI_AIUP 0x10 /* Primary, user */ -#define ASI_AIUS 0x11 /* Secondary, user */ -#define ASI_AIUPL 0x18 /* Primary, user, little endian */ -#define ASI_AIUSL 0x19 /* Secondary, user, little endian */ -#define ASI_P 0x80 /* Primary, implicit */ -#define ASI_S 0x81 /* Secondary, implicit */ -#define ASI_PNF 0x82 /* Primary, no fault */ -#define ASI_SNF 0x83 /* Secondary, no fault */ -#define ASI_PL 0x88 /* Primary, implicit, little endian */ -#define ASI_SL 0x89 /* Secondary, implicit, little endian */ -#define ASI_PNFL 0x8a /* Primary, no fault, little endian */ -#define ASI_SNFL 0x8b /* Secondary, no fault, little endian */ +#define ASI_N 0x04 /* Nucleus */ +#define ASI_NL 0x0c /* Nucleus, little endian */ +#define ASI_AIUP 0x10 /* Primary, user */ +#define ASI_AIUS 0x11 /* Secondary, user */ +#define ASI_AIUPL 0x18 /* Primary, user, little endian */ +#define ASI_AIUSL 0x19 /* Secondary, user, little endian */ +#define ASI_P 0x80 /* Primary, implicit */ +#define ASI_S 0x81 /* Secondary, implicit */ +#define ASI_PNF 0x82 /* Primary, no fault */ +#define ASI_SNF 0x83 /* Secondary, no fault */ +#define ASI_PL 0x88 /* Primary, implicit, l-endian */ +#define ASI_SL 0x89 /* Secondary, implicit, l-endian */ +#define ASI_PNFL 0x8a /* Primary, no fault, l-endian */ +#define ASI_SNFL 0x8b /* Secondary, no fault, l-endian */ /* SpitFire and later extended ASIs. The "(III)" marker designates - * UltraSparc-III specific ASIs. + * UltraSparc-III and later specific ASIs. The "(CMT)" marker designates + * Chip Multi Threading specific ASIs. */ -#define ASI_PHYS_USE_EC 0x14 /* PADDR, E-cachable */ -#define ASI_PHYS_BYPASS_EC_E 0x15 /* PADDR, E-bit */ -#define ASI_PHYS_USE_EC_L 0x1c /* PADDR, E-cachable, little endian */ -#define ASI_PHYS_BYPASS_EC_E_L 0x1d /* PADDR, E-bit, little endian */ -#define ASI_NUCLEUS_QUAD_LDD 0x24 /* Cachable, qword load */ -#define ASI_NUCLEUS_QUAD_LDD_L 0x2c /* Cachable, qword load, little endian */ -#define ASI_PCACHE_DATA_STATUS 0x30 /* (III) PCache data status RAM diag */ -#define ASI_PCACHE_DATA 0x31 /* (III) PCache data RAM diag */ -#define ASI_PCACHE_TAG 0x32 /* (III) PCache tag RAM diag */ -#define ASI_PCACHE_SNOOP_TAG 0x33 /* (III) PCache snoop tag RAM diag */ -#define ASI_QUAD_LDD_PHYS 0x34 /* (III+) PADDR, qword load */ -#define ASI_WCACHE_VALID_BITS 0x38 /* (III) WCache Valid Bits diag */ -#define ASI_WCACHE_DATA 0x39 /* (III) WCache data RAM diag */ -#define ASI_WCACHE_TAG 0x3a /* (III) WCache tag RAM diag */ -#define ASI_WCACHE_SNOOP_TAG 0x3b /* (III) WCache snoop tag RAM diag */ -#define ASI_QUAD_LDD_PHYS_L 0x3c /* (III+) PADDR, qword load, little endian */ -#define ASI_SRAM_FAST_INIT 0x40 /* (III+) Fast SRAM init */ -#define ASI_DCACHE_INVALIDATE 0x42 /* (III) DCache Invalidate diag */ -#define ASI_DCACHE_UTAG 0x43 /* (III) DCache uTag diag */ -#define ASI_DCACHE_SNOOP_TAG 0x44 /* (III) DCache snoop tag RAM diag */ -#define ASI_LSU_CONTROL 0x45 /* Load-store control unit */ -#define ASI_DCU_CONTROL_REG 0x45 /* (III) DCache Unit Control Register */ -#define ASI_DCACHE_DATA 0x46 /* Data cache data-ram diag access */ -#define ASI_DCACHE_TAG 0x47 /* Data cache tag/valid ram diag access */ -#define ASI_INTR_DISPATCH_STAT 0x48 /* IRQ vector dispatch status */ -#define ASI_INTR_RECEIVE 0x49 /* IRQ vector receive status */ -#define ASI_UPA_CONFIG 0x4a /* UPA config space */ -#define ASI_JBUS_CONFIG 0x4a /* (IIIi) JBUS Config Register */ -#define ASI_SAFARI_CONFIG 0x4a /* (III) Safari Config Register */ -#define ASI_SAFARI_ADDRESS 0x4a /* (III) Safari Address Register */ -#define ASI_ESTATE_ERROR_EN 0x4b /* E-cache error enable space */ -#define ASI_AFSR 0x4c /* Async fault status register */ -#define ASI_AFAR 0x4d /* Async fault address register */ -#define ASI_EC_TAG_DATA 0x4e /* E-cache tag/valid ram diag access */ -#define ASI_IMMU 0x50 /* Insn-MMU main register space */ -#define ASI_IMMU_TSB_8KB_PTR 0x51 /* Insn-MMU 8KB TSB pointer register */ -#define ASI_IMMU_TSB_64KB_PTR 0x52 /* Insn-MMU 64KB TSB pointer register */ -#define ASI_ITLB_DATA_IN 0x54 /* Insn-MMU TLB data in register */ -#define ASI_ITLB_DATA_ACCESS 0x55 /* Insn-MMU TLB data access register */ -#define ASI_ITLB_TAG_READ 0x56 /* Insn-MMU TLB tag read register */ -#define ASI_IMMU_DEMAP 0x57 /* Insn-MMU TLB demap */ -#define ASI_DMMU 0x58 /* Data-MMU main register space */ -#define ASI_DMMU_TSB_8KB_PTR 0x59 /* Data-MMU 8KB TSB pointer register */ -#define ASI_DMMU_TSB_64KB_PTR 0x5a /* Data-MMU 16KB TSB pointer register */ -#define ASI_DMMU_TSB_DIRECT_PTR 0x5b /* Data-MMU TSB direct pointer register */ -#define ASI_DTLB_DATA_IN 0x5c /* Data-MMU TLB data in register */ -#define ASI_DTLB_DATA_ACCESS 0x5d /* Data-MMU TLB data access register */ -#define ASI_DTLB_TAG_READ 0x5e /* Data-MMU TLB tag read register */ -#define ASI_DMMU_DEMAP 0x5f /* Data-MMU TLB demap */ -#define ASI_IIU_INST_TRAP 0x60 /* (III) Instruction Breakpoint register */ -#define ASI_IC_INSTR 0x66 /* Insn cache instrucion ram diag access */ -#define ASI_IC_TAG 0x67 /* Insn cache tag/valid ram diag access */ -#define ASI_IC_STAG 0x68 /* (III) Insn cache snoop tag ram diag */ -#define ASI_IC_PRE_DECODE 0x6e /* Insn cache pre-decode ram diag access */ -#define ASI_IC_NEXT_FIELD 0x6f /* Insn cache next-field ram diag access */ -#define ASI_BRPRED_ARRAY 0x6f /* (III) Branch Prediction RAM diag */ -#define ASI_BLK_AIUP 0x70 /* Primary, user, block load/store */ -#define ASI_BLK_AIUS 0x71 /* Secondary, user, block load/store */ -#define ASI_MCU_CTRL_REG 0x72 /* (III) Memory controller registers */ -#define ASI_EC_DATA 0x74 /* (III) E-cache data staging register */ -#define ASI_EC_CTRL 0x75 /* (III) E-cache control register */ -#define ASI_EC_W 0x76 /* E-cache diag write access */ -#define ASI_UDB_ERROR_W 0x77 /* External UDB error registers write */ -#define ASI_UDB_CONTROL_W 0x77 /* External UDB control registers write */ -#define ASI_INTR_W 0x77 /* IRQ vector dispatch write */ -#define ASI_INTR_DATAN_W 0x77 /* (III) Outgoing irq vector data reg N */ -#define ASI_INTR_DISPATCH_W 0x77 /* (III) Interrupt vector dispatch */ -#define ASI_BLK_AIUPL 0x78 /* Primary, user, little, blk ld/st */ -#define ASI_BLK_AIUSL 0x79 /* Secondary, user, little, blk ld/st */ -#define ASI_EC_R 0x7e /* E-cache diag read access */ -#define ASI_UDBH_ERROR_R 0x7f /* External UDB error registers read hi */ -#define ASI_UDBL_ERROR_R 0x7f /* External UDB error registers read low */ -#define ASI_UDBH_CONTROL_R 0x7f /* External UDB control registers read hi */ -#define ASI_UDBL_CONTROL_R 0x7f /* External UDB control registers read low */ -#define ASI_INTR_R 0x7f /* IRQ vector dispatch read */ -#define ASI_INTR_DATAN_R 0x7f /* (III) Incoming irq vector data reg N */ -#define ASI_PST8_P 0xc0 /* Primary, 8 8-bit, partial */ -#define ASI_PST8_S 0xc1 /* Secondary, 8 8-bit, partial */ -#define ASI_PST16_P 0xc2 /* Primary, 4 16-bit, partial */ -#define ASI_PST16_S 0xc3 /* Secondary, 4 16-bit, partial */ -#define ASI_PST32_P 0xc4 /* Primary, 2 32-bit, partial */ -#define ASI_PST32_S 0xc5 /* Secondary, 2 32-bit, partial */ -#define ASI_PST8_PL 0xc8 /* Primary, 8 8-bit, partial, little */ -#define ASI_PST8_SL 0xc9 /* Secondary, 8 8-bit, partial, little */ -#define ASI_PST16_PL 0xca /* Primary, 4 16-bit, partial, little */ -#define ASI_PST16_SL 0xcb /* Secondary, 4 16-bit, partial, little */ -#define ASI_PST32_PL 0xcc /* Primary, 2 32-bit, partial, little */ -#define ASI_PST32_SL 0xcd /* Secondary, 2 32-bit, partial, little */ -#define ASI_FL8_P 0xd0 /* Primary, 1 8-bit, fpu ld/st */ -#define ASI_FL8_S 0xd1 /* Secondary, 1 8-bit, fpu ld/st */ -#define ASI_FL16_P 0xd2 /* Primary, 1 16-bit, fpu ld/st */ -#define ASI_FL16_S 0xd3 /* Secondary, 1 16-bit, fpu ld/st */ -#define ASI_FL8_PL 0xd8 /* Primary, 1 8-bit, fpu ld/st, little */ -#define ASI_FL8_SL 0xd9 /* Secondary, 1 8-bit, fpu ld/st, little */ -#define ASI_FL16_PL 0xda /* Primary, 1 16-bit, fpu ld/st, little */ -#define ASI_FL16_SL 0xdb /* Secondary, 1 16-bit, fpu ld/st, little */ -#define ASI_BLK_COMMIT_P 0xe0 /* Primary, blk store commit */ -#define ASI_BLK_COMMIT_S 0xe1 /* Secondary, blk store commit */ -#define ASI_BLK_P 0xf0 /* Primary, blk ld/st */ -#define ASI_BLK_S 0xf1 /* Secondary, blk ld/st */ -#define ASI_BLK_PL 0xf8 /* Primary, blk ld/st, little */ -#define ASI_BLK_SL 0xf9 /* Secondary, blk ld/st, little */ +#define ASI_PHYS_USE_EC 0x14 /* PADDR, E-cachable */ +#define ASI_PHYS_BYPASS_EC_E 0x15 /* PADDR, E-bit */ +#define ASI_PHYS_USE_EC_L 0x1c /* PADDR, E-cachable, little endian*/ +#define ASI_PHYS_BYPASS_EC_E_L 0x1d /* PADDR, E-bit, little endian */ +#define ASI_NUCLEUS_QUAD_LDD 0x24 /* Cachable, qword load */ +#define ASI_NUCLEUS_QUAD_LDD_L 0x2c /* Cachable, qword load, l-endian */ +#define ASI_PCACHE_DATA_STATUS 0x30 /* (III) PCache data stat RAM diag */ +#define ASI_PCACHE_DATA 0x31 /* (III) PCache data RAM diag */ +#define ASI_PCACHE_TAG 0x32 /* (III) PCache tag RAM diag */ +#define ASI_PCACHE_SNOOP_TAG 0x33 /* (III) PCache snoop tag RAM diag */ +#define ASI_QUAD_LDD_PHYS 0x34 /* (III+) PADDR, qword load */ +#define ASI_WCACHE_VALID_BITS 0x38 /* (III) WCache Valid Bits diag */ +#define ASI_WCACHE_DATA 0x39 /* (III) WCache data RAM diag */ +#define ASI_WCACHE_TAG 0x3a /* (III) WCache tag RAM diag */ +#define ASI_WCACHE_SNOOP_TAG 0x3b /* (III) WCache snoop tag RAM diag */ +#define ASI_QUAD_LDD_PHYS_L 0x3c /* (III+) PADDR, qw-load, l-endian */ +#define ASI_SRAM_FAST_INIT 0x40 /* (III+) Fast SRAM init */ +#define ASI_CORE_AVAILABLE 0x41 /* (CMT) LP Available */ +#define ASI_CORE_ENABLE_STAT 0x41 /* (CMT) LP Enable Status */ +#define ASI_CORE_ENABLE 0x41 /* (CMT) LP Enable RW */ +#define ASI_XIR_STEERING 0x41 /* (CMT) XIR Steering RW */ +#define ASI_CORE_RUNNING_RW 0x41 /* (CMT) LP Running RW */ +#define ASI_CORE_RUNNING_W1S 0x41 /* (CMT) LP Running Write-One Set */ +#define ASI_CORE_RUNNING_W1C 0x41 /* (CMT) LP Running Write-One Clr */ +#define ASI_CORE_RUNNING_STAT 0x41 /* (CMT) LP Running Status */ +#define ASI_CMT_ERROR_STEERING 0x41 /* (CMT) Error Steering RW */ +#define ASI_DCACHE_INVALIDATE 0x42 /* (III) DCache Invalidate diag */ +#define ASI_DCACHE_UTAG 0x43 /* (III) DCache uTag diag */ +#define ASI_DCACHE_SNOOP_TAG 0x44 /* (III) DCache snoop tag RAM diag */ +#define ASI_LSU_CONTROL 0x45 /* Load-store control unit */ +#define ASI_DCU_CONTROL_REG 0x45 /* (III) DCache Unit Control reg */ +#define ASI_DCACHE_DATA 0x46 /* DCache data-ram diag access */ +#define ASI_DCACHE_TAG 0x47 /* Dcache tag/valid ram diag access*/ +#define ASI_INTR_DISPATCH_STAT 0x48 /* IRQ vector dispatch status */ +#define ASI_INTR_RECEIVE 0x49 /* IRQ vector receive status */ +#define ASI_UPA_CONFIG 0x4a /* UPA config space */ +#define ASI_JBUS_CONFIG 0x4a /* (IIIi) JBUS Config Register */ +#define ASI_SAFARI_CONFIG 0x4a /* (III) Safari Config Register */ +#define ASI_SAFARI_ADDRESS 0x4a /* (III) Safari Address Register */ +#define ASI_ESTATE_ERROR_EN 0x4b /* E-cache error enable space */ +#define ASI_AFSR 0x4c /* Async fault status register */ +#define ASI_AFAR 0x4d /* Async fault address register */ +#define ASI_EC_TAG_DATA 0x4e /* E-cache tag/valid ram diag acc */ +#define ASI_IMMU 0x50 /* Insn-MMU main register space */ +#define ASI_IMMU_TSB_8KB_PTR 0x51 /* Insn-MMU 8KB TSB pointer reg */ +#define ASI_IMMU_TSB_64KB_PTR 0x52 /* Insn-MMU 64KB TSB pointer reg */ +#define ASI_ITLB_DATA_IN 0x54 /* Insn-MMU TLB data in reg */ +#define ASI_ITLB_DATA_ACCESS 0x55 /* Insn-MMU TLB data access reg */ +#define ASI_ITLB_TAG_READ 0x56 /* Insn-MMU TLB tag read reg */ +#define ASI_IMMU_DEMAP 0x57 /* Insn-MMU TLB demap */ +#define ASI_DMMU 0x58 /* Data-MMU main register space */ +#define ASI_DMMU_TSB_8KB_PTR 0x59 /* Data-MMU 8KB TSB pointer reg */ +#define ASI_DMMU_TSB_64KB_PTR 0x5a /* Data-MMU 16KB TSB pointer reg */ +#define ASI_DMMU_TSB_DIRECT_PTR 0x5b /* Data-MMU TSB direct pointer reg */ +#define ASI_DTLB_DATA_IN 0x5c /* Data-MMU TLB data in reg */ +#define ASI_DTLB_DATA_ACCESS 0x5d /* Data-MMU TLB data access reg */ +#define ASI_DTLB_TAG_READ 0x5e /* Data-MMU TLB tag read reg */ +#define ASI_DMMU_DEMAP 0x5f /* Data-MMU TLB demap */ +#define ASI_IIU_INST_TRAP 0x60 /* (III) Instruction Breakpoint */ +#define ASI_INTR_ID 0x63 /* (CMT) Interrupt ID register */ +#define ASI_CORE_ID 0x63 /* (CMT) LP ID register */ +#define ASI_CESR_ID 0x63 /* (CMT) CESR ID register */ +#define ASI_IC_INSTR 0x66 /* Insn cache instrucion ram diag */ +#define ASI_IC_TAG 0x67 /* Insn cache tag/valid ram diag */ +#define ASI_IC_STAG 0x68 /* (III) Insn cache snoop tag ram */ +#define ASI_IC_PRE_DECODE 0x6e /* Insn cache pre-decode ram diag */ +#define ASI_IC_NEXT_FIELD 0x6f /* Insn cache next-field ram diag */ +#define ASI_BRPRED_ARRAY 0x6f /* (III) Branch Prediction RAM diag*/ +#define ASI_BLK_AIUP 0x70 /* Primary, user, block load/store */ +#define ASI_BLK_AIUS 0x71 /* Secondary, user, block ld/st */ +#define ASI_MCU_CTRL_REG 0x72 /* (III) Memory controller regs */ +#define ASI_EC_DATA 0x74 /* (III) E-cache data staging reg */ +#define ASI_EC_CTRL 0x75 /* (III) E-cache control reg */ +#define ASI_EC_W 0x76 /* E-cache diag write access */ +#define ASI_UDB_ERROR_W 0x77 /* External UDB error regs W */ +#define ASI_UDB_CONTROL_W 0x77 /* External UDB control regs W */ +#define ASI_INTR_W 0x77 /* IRQ vector dispatch write */ +#define ASI_INTR_DATAN_W 0x77 /* (III) Out irq vector data reg N */ +#define ASI_INTR_DISPATCH_W 0x77 /* (III) Interrupt vector dispatch */ +#define ASI_BLK_AIUPL 0x78 /* Primary, user, little, blk ld/st*/ +#define ASI_BLK_AIUSL 0x79 /* Secondary, user, little, blk ld/st*/ +#define ASI_EC_R 0x7e /* E-cache diag read access */ +#define ASI_UDBH_ERROR_R 0x7f /* External UDB error regs rd hi */ +#define ASI_UDBL_ERROR_R 0x7f /* External UDB error regs rd low */ +#define ASI_UDBH_CONTROL_R 0x7f /* External UDB control regs rd hi */ +#define ASI_UDBL_CONTROL_R 0x7f /* External UDB control regs rd low*/ +#define ASI_INTR_R 0x7f /* IRQ vector dispatch read */ +#define ASI_INTR_DATAN_R 0x7f /* (III) In irq vector data reg N */ +#define ASI_PST8_P 0xc0 /* Primary, 8 8-bit, partial */ +#define ASI_PST8_S 0xc1 /* Secondary, 8 8-bit, partial */ +#define ASI_PST16_P 0xc2 /* Primary, 4 16-bit, partial */ +#define ASI_PST16_S 0xc3 /* Secondary, 4 16-bit, partial */ +#define ASI_PST32_P 0xc4 /* Primary, 2 32-bit, partial */ +#define ASI_PST32_S 0xc5 /* Secondary, 2 32-bit, partial */ +#define ASI_PST8_PL 0xc8 /* Primary, 8 8-bit, partial, L */ +#define ASI_PST8_SL 0xc9 /* Secondary, 8 8-bit, partial, L */ +#define ASI_PST16_PL 0xca /* Primary, 4 16-bit, partial, L */ +#define ASI_PST16_SL 0xcb /* Secondary, 4 16-bit, partial, L */ +#define ASI_PST32_PL 0xcc /* Primary, 2 32-bit, partial, L */ +#define ASI_PST32_SL 0xcd /* Secondary, 2 32-bit, partial, L */ +#define ASI_FL8_P 0xd0 /* Primary, 1 8-bit, fpu ld/st */ +#define ASI_FL8_S 0xd1 /* Secondary, 1 8-bit, fpu ld/st */ +#define ASI_FL16_P 0xd2 /* Primary, 1 16-bit, fpu ld/st */ +#define ASI_FL16_S 0xd3 /* Secondary, 1 16-bit, fpu ld/st */ +#define ASI_FL8_PL 0xd8 /* Primary, 1 8-bit, fpu ld/st, L */ +#define ASI_FL8_SL 0xd9 /* Secondary, 1 8-bit, fpu ld/st, L*/ +#define ASI_FL16_PL 0xda /* Primary, 1 16-bit, fpu ld/st, L */ +#define ASI_FL16_SL 0xdb /* Secondary, 1 16-bit, fpu ld/st,L*/ +#define ASI_BLK_COMMIT_P 0xe0 /* Primary, blk store commit */ +#define ASI_BLK_COMMIT_S 0xe1 /* Secondary, blk store commit */ +#define ASI_BLK_P 0xf0 /* Primary, blk ld/st */ +#define ASI_BLK_S 0xf1 /* Secondary, blk ld/st */ +#define ASI_BLK_PL 0xf8 /* Primary, blk ld/st, little */ +#define ASI_BLK_SL 0xf9 /* Secondary, blk ld/st, little */ #endif /* _SPARC64_ASI_H */ diff -Nru a/include/asm-sparc64/bpp.h b/include/asm-sparc64/bpp.h --- a/include/asm-sparc64/bpp.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc64/bpp.h 2004-07-13 12:24:01 -07:00 @@ -40,9 +40,9 @@ */ # define BPP_PUT_PINS _IOW('B', 1, int) -# define BPP_GET_PINS _IOR('B', 2, void) +# define BPP_GET_PINS _IOR('B', 2, char) /* that's bogus - should've been _IO */ # define BPP_PUT_DATA _IOW('B', 3, int) -# define BPP_GET_DATA _IOR('B', 4, void) +# define BPP_GET_DATA _IOR('B', 4, char) /* ditto */ /* * Set the data bus to input mode. Disengage the data bin driver and diff -Nru a/include/asm-sparc64/cmt.h b/include/asm-sparc64/cmt.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-sparc64/cmt.h 2004-07-13 12:24:02 -07:00 @@ -0,0 +1,59 @@ +#ifndef _SPARC64_CMT_H +#define _SPARC64_CMT_H + +/* cmt.h: Chip Multi-Threading register definitions + * + * Copyright (C) 2004 David S. Miller (davem@redhat.com) + */ + +/* ASI_CORE_ID - private */ +#define LP_ID 0x0000000000000010UL +#define LP_ID_MAX 0x00000000003f0000UL +#define LP_ID_ID 0x000000000000003fUL + +/* ASI_INTR_ID - private */ +#define LP_INTR_ID 0x0000000000000000UL +#define LP_INTR_ID_ID 0x00000000000003ffUL + +/* ASI_CESR_ID - private */ +#define CESR_ID 0x0000000000000040UL +#define CESR_ID_ID 0x00000000000000ffUL + +/* ASI_CORE_AVAILABLE - shared */ +#define LP_AVAIL 0x0000000000000000UL +#define LP_AVAIL_1 0x0000000000000002UL +#define LP_AVAIL_0 0x0000000000000001UL + +/* ASI_CORE_ENABLE_STATUS - shared */ +#define LP_ENAB_STAT 0x0000000000000010UL +#define LP_ENAB_STAT_1 0x0000000000000002UL +#define LP_ENAB_STAT_0 0x0000000000000001UL + +/* ASI_CORE_ENABLE - shared */ +#define LP_ENAB 0x0000000000000020UL +#define LP_ENAB_1 0x0000000000000002UL +#define LP_ENAB_0 0x0000000000000001UL + +/* ASI_CORE_RUNNING - shared */ +#define LP_RUNNING_RW 0x0000000000000050UL +#define LP_RUNNING_W1S 0x0000000000000060UL +#define LP_RUNNING_W1C 0x0000000000000068UL +#define LP_RUNNING_1 0x0000000000000002UL +#define LP_RUNNING_0 0x0000000000000001UL + +/* ASI_CORE_RUNNING_STAT - shared */ +#define LP_RUN_STAT 0x0000000000000058UL +#define LP_RUN_STAT_1 0x0000000000000002UL +#define LP_RUN_STAT_0 0x0000000000000001UL + +/* ASI_XIR_STEERING - shared */ +#define LP_XIR_STEER 0x0000000000000030UL +#define LP_XIR_STEER_1 0x0000000000000002UL +#define LP_XIR_STEER_0 0x0000000000000001UL + +/* ASI_CMT_ERROR_STEERING - shared */ +#define CMT_ER_STEER 0x0000000000000040UL +#define CMT_ER_STEER_1 0x0000000000000002UL +#define CMT_ER_STEER_0 0x0000000000000001UL + +#endif /* _SPARC64_CMT_H */ diff -Nru a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h --- a/include/asm-sparc64/pgalloc.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-sparc64/pgalloc.h 2004-07-13 12:24:01 -07:00 @@ -196,7 +196,7 @@ pte_t *pte = pte_alloc_one_kernel(mm, addr); if (pte) return virt_to_page(pte); - return 0; + return NULL; } static __inline__ pte_t *pte_alloc_one_fast(struct mm_struct *mm, unsigned long address) diff -Nru a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h --- a/include/asm-sparc64/pgtable.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-sparc64/pgtable.h 2004-07-13 12:24:00 -07:00 @@ -378,7 +378,7 @@ if (addr >= PAGE_OFFSET) return addr & _PAGE_PADDR; if ((addr >= LOW_OBP_ADDRESS) && (addr < HI_OBP_ADDRESS)) - return prom_virt_to_phys(addr, 0); + return prom_virt_to_phys(addr, NULL); pgdp = pgd_offset_k(addr); pmdp = pmd_offset(pgdp, addr); ptep = pte_offset_kernel(pmdp, addr); diff -Nru a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h --- a/include/asm-sparc64/signal.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-sparc64/signal.h 2004-07-13 12:24:00 -07:00 @@ -186,9 +186,14 @@ /* Type of a signal handler. */ #ifdef __KERNEL__ -typedef void (*__sighandler_t)(int, struct sigcontext *); +typedef void __signalfn_t(int); +typedef __signalfn_t __user *__sighandler_t; + +typedef void __restorefn_t(void); +typedef __restorefn_t __user *__sigrestore_t; #else typedef void (*__sighandler_t)(int); +typedef void (*__sigrestore_t)(void); #endif #define SIG_DFL ((__sighandler_t)0) /* default signal handling */ @@ -198,7 +203,7 @@ struct __new_sigaction { __sighandler_t sa_handler; unsigned long sa_flags; - void (*sa_restorer)(void); /* not used by Linux/SPARC yet */ + __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */ __new_sigset_t sa_mask; }; @@ -233,7 +238,7 @@ #endif typedef struct sigaltstack { - void *ss_sp; + void __user *ss_sp; int ss_flags; size_t ss_size; } stack_t; diff -Nru a/include/asm-x86_64/signal.h b/include/asm-x86_64/signal.h --- a/include/asm-x86_64/signal.h 2004-07-13 12:24:00 -07:00 +++ b/include/asm-x86_64/signal.h 2004-07-13 12:24:00 -07:00 @@ -136,7 +136,11 @@ #ifndef __ASSEMBLY__ /* 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 */ @@ -145,7 +149,7 @@ 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 */ }; @@ -154,7 +158,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-x86_64/vsyscall32.h b/include/asm-x86_64/vsyscall32.h --- a/include/asm-x86_64/vsyscall32.h 2004-07-13 12:24:01 -07:00 +++ b/include/asm-x86_64/vsyscall32.h 2004-07-13 12:24:01 -07:00 @@ -13,8 +13,8 @@ #define VSYSCALL32_VSYSCALL ((void *)VSYSCALL32_BASE + 0x400) #define VSYSCALL32_SYSEXIT ((void *)VSYSCALL32_BASE + 0x410) -#define VSYSCALL32_SIGRETURN ((void *)VSYSCALL32_BASE + 0x500) -#define VSYSCALL32_RTSIGRETURN ((void *)VSYSCALL32_BASE + 0x600) +#define VSYSCALL32_SIGRETURN ((void __user *)VSYSCALL32_BASE + 0x500) +#define VSYSCALL32_RTSIGRETURN ((void __user *)VSYSCALL32_BASE + 0x600) #endif #endif diff -Nru a/include/linux/capi.h b/include/linux/capi.h --- a/include/linux/capi.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/capi.h 2004-07-13 12:24:01 -07:00 @@ -77,7 +77,7 @@ typedef struct capi_manufacturer_cmd { unsigned long cmd; - void *data; + void __user *data; } capi_manufacturer_cmd; /* diff -Nru a/include/linux/dvb/osd.h b/include/linux/dvb/osd.h --- a/include/linux/dvb/osd.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/dvb/osd.h 2004-07-13 12:24:01 -07:00 @@ -101,7 +101,7 @@ int x1; int y1; int color; - void *data; + void __user *data; } osd_cmd_t; diff -Nru a/include/linux/dvb/video.h b/include/linux/dvb/video.h --- a/include/linux/dvb/video.h 2004-07-13 12:24:00 -07:00 +++ b/include/linux/dvb/video.h 2004-07-13 12:24:00 -07:00 @@ -100,7 +100,7 @@ struct video_still_picture { - char *iFrame; /* pointer to a single iframe in memory */ + char __user *iFrame; /* pointer to a single iframe in memory */ int32_t size; }; diff -Nru a/include/linux/isdnif.h b/include/linux/isdnif.h --- a/include/linux/isdnif.h 2004-07-13 12:24:00 -07:00 +++ b/include/linux/isdnif.h 2004-07-13 12:24:00 -07:00 @@ -502,26 +502,18 @@ * Parameters: * u_char pointer data * int length of data - * int Flag: 0 = Call form Kernel-Space (use memcpy, - * no schedule allowed) - * 1 = Data is in User-Space (use memcpy_fromfs, - * may schedule) * int driverId * int local channel-number (0 ...) */ - int (*writecmd)(const u_char*, int, int, int, int); + int (*writecmd)(const u_char __user *, int, int, int); /* Read raw Status replies * u_char pointer data (volatile) * int length of buffer - * int Flag: 0 = Call form Kernel-Space (use memcpy, - * no schedule allowed) - * 1 = Data is in User-Space (use memcpy_fromfs, - * may schedule) * int driverId * int local channel-number (0 ...) */ - int (*readstat)(u_char*, int, int, int, int); + int (*readstat)(u_char __user *, int, int, int); char id[20]; } isdn_if; diff -Nru a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h --- a/include/linux/kernelcapi.h 2004-07-13 12:24:00 -07:00 +++ b/include/linux/kernelcapi.h 2004-07-13 12:24:00 -07:00 @@ -81,7 +81,7 @@ u16 capi20_get_version(u32 contr, struct capi_version *verp); u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]); u16 capi20_get_profile(u32 contr, struct capi_profile *profp); -int capi20_manufacturer(unsigned int cmd, void *data); +int capi20_manufacturer(unsigned int cmd, void __user *data); /* temporary hack XXX */ void capi20_set_callback(struct capi20_appl *ap, diff -Nru a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h --- a/include/linux/mtd/mtd.h 2004-07-13 12:24:00 -07:00 +++ b/include/linux/mtd/mtd.h 2004-07-13 12:24:00 -07:00 @@ -12,11 +12,6 @@ #include #include -struct kvec { - void *iov_base; /* and that should *never* hold a userland pointer */ - size_t iov_len; -}; - #endif /* __KERNEL__ */ struct erase_info_user { diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/netdevice.h 2004-07-13 12:24:01 -07:00 @@ -565,7 +565,7 @@ extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf); static inline int unregister_gifconf(unsigned int family) { - return register_gifconf(family, 0); + return register_gifconf(family, NULL); } /* diff -Nru a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h --- a/include/linux/pkt_sched.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/pkt_sched.h 2004-07-13 12:24:01 -07:00 @@ -100,34 +100,6 @@ __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ }; -/* CSZ section */ - -struct tc_csz_qopt -{ - int flows; /* Maximal number of guaranteed flows */ - unsigned char R_log; /* Fixed point position for round number */ - unsigned char delta_log; /* Log of maximal managed time interval */ - __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> CSZ band */ -}; - -struct tc_csz_copt -{ - struct tc_ratespec slice; - struct tc_ratespec rate; - struct tc_ratespec peakrate; - __u32 limit; - __u32 buffer; - __u32 mtu; -}; - -enum -{ - TCA_CSZ_UNSPEC, - TCA_CSZ_PARMS, - TCA_CSZ_RTAB, - TCA_CSZ_PTAB, -}; - /* TBF section */ struct tc_tbf_qopt @@ -437,6 +409,6 @@ __u32 loss; /* random packet loss (0=none ~0=100%) */ __u32 gap; /* re-ordering gap (0 for delay all) */ __u32 duplicate; /* random packet dup (0=none ~0=100%) */ - __u32 rate; /* maximum transmit rate (bytes/sec) */ + __u32 jitter; /* random jitter in latency (us) */ }; #endif diff -Nru a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h --- a/include/linux/reiserfs_fs.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/reiserfs_fs.h 2004-07-13 12:24:01 -07:00 @@ -81,7 +81,7 @@ /** always check a condition and panic if it's false. */ #define RASSERT( cond, format, args... ) \ if( !( cond ) ) \ - reiserfs_panic( 0, "reiserfs[%i]: assertion " #cond " failed at " \ + reiserfs_panic( NULL, "reiserfs[%i]: assertion " #cond " failed at " \ __FILE__ ":%i:%s: " format "\n", \ in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) diff -Nru a/include/linux/uio.h b/include/linux/uio.h --- a/include/linux/uio.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/uio.h 2004-07-13 12:24:01 -07:00 @@ -23,6 +23,15 @@ __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ }; +#ifdef __KERNEL__ + +struct kvec { + void *iov_base; /* and that should *never* hold a userland pointer */ + size_t iov_len; +}; + +#endif + /* * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) */ diff -Nru a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h --- a/include/linux/usbdevice_fs.h 2004-07-13 12:24:00 -07:00 +++ b/include/linux/usbdevice_fs.h 2004-07-13 12:24:00 -07:00 @@ -63,7 +63,7 @@ struct usbdevfs_disconnectsignal { unsigned int signr; - void *context; + void __user *context; }; #define USBDEVFS_MAXDRIVERNAME 255 @@ -162,7 +162,7 @@ wait_queue_head_t wait; /* wake up if a request completed */ unsigned int discsignr; struct task_struct *disctask; - void *disccontext; + void __user *disccontext; unsigned long ifclaimed; }; diff -Nru a/include/linux/videodev.h b/include/linux/videodev.h --- a/include/linux/videodev.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/videodev.h 2004-07-13 12:24:01 -07:00 @@ -222,7 +222,7 @@ __u32 width,height; /* Its size */ __u32 chromakey; __u32 flags; - struct video_clip *clips; /* Set only */ + struct video_clip __user *clips; /* Set only */ int clipcount; #define VIDEO_WINDOW_INTERLACE 1 #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ diff -Nru a/include/linux/videodev2.h b/include/linux/videodev2.h --- a/include/linux/videodev2.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/videodev2.h 2004-07-13 12:24:01 -07:00 @@ -433,9 +433,9 @@ struct v4l2_rect w; enum v4l2_field field; __u32 chromakey; - struct v4l2_clip *clips; + struct v4l2_clip __user *clips; __u32 clipcount; - void *bitmap; + void __user *bitmap; }; diff -Nru a/include/linux/videotext.h b/include/linux/videotext.h --- a/include/linux/videotext.h 2004-07-13 12:24:01 -07:00 +++ b/include/linux/videotext.h 2004-07-13 12:24:01 -07:00 @@ -71,7 +71,7 @@ int pgbuf; /* buffer where page will be stored */ int start; /* start of requested part of page */ int end; /* end of requested part of page */ - void *buffer; /* pointer to beginning of destination buffer */ + void __user *buffer; /* pointer to beginning of destination buffer */ } vtx_pagereq_t; diff -Nru a/include/linux/xfrm.h b/include/linux/xfrm.h --- a/include/linux/xfrm.h 2004-07-13 12:24:00 -07:00 +++ b/include/linux/xfrm.h 2004-07-13 12:24:00 -07:00 @@ -135,6 +135,11 @@ XFRM_MSG_POLEXPIRE, #define XFRM_MSG_POLEXPIRE XFRM_MSG_POLEXPIRE + XFRM_MSG_FLUSHSA, +#define XFRM_MSG_FLUSHSA XFRM_MSG_FLUSHSA + XFRM_MSG_FLUSHPOLICY, +#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY + XFRM_MSG_MAX }; @@ -240,6 +245,10 @@ struct xfrm_user_polexpire { struct xfrm_userpolicy_info pol; __u8 hard; +}; + +struct xfrm_usersa_flush { + __u8 proto; }; #define XFRMGRP_ACQUIRE 1 diff -Nru a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h --- a/include/media/saa7146_vv.h 2004-07-13 12:24:00 -07:00 +++ b/include/media/saa7146_vv.h 2004-07-13 12:24:00 -07:00 @@ -184,7 +184,7 @@ int(*open)(struct saa7146_dev *, struct file *); void (*release)(struct saa7146_dev *, struct file *); void (*irq_done)(struct saa7146_dev *, unsigned long status); - ssize_t (*read)(struct file *, char *, size_t, loff_t *); + ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); }; /* from saa7146_fops.c */ diff -Nru a/include/media/video-buf.h b/include/media/video-buf.h --- a/include/media/video-buf.h 2004-07-13 12:24:01 -07:00 +++ b/include/media/video-buf.h 2004-07-13 12:24:01 -07:00 @@ -226,10 +226,10 @@ int videobuf_read_start(struct file *file, struct videobuf_queue *q); void videobuf_read_stop(struct file *file, struct videobuf_queue *q); ssize_t videobuf_read_stream(struct file *file, struct videobuf_queue *q, - char *data, size_t count, loff_t *ppos, + char __user *data, size_t count, loff_t *ppos, int vbihack); ssize_t videobuf_read_one(struct file *file, struct videobuf_queue *q, - char *data, size_t count, loff_t *ppos); + char __user *data, size_t count, loff_t *ppos); unsigned int videobuf_poll_stream(struct file *file, struct videobuf_queue *q, poll_table *wait); diff -Nru a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h --- a/include/net/bluetooth/l2cap.h 2004-07-13 12:24:00 -07:00 +++ b/include/net/bluetooth/l2cap.h 2004-07-13 12:24:00 -07:00 @@ -176,6 +176,14 @@ __u8 data[0]; } __attribute__ ((packed)); +/* info type */ +#define L2CAP_IT_CL_MTU 0x0001 +#define L2CAP_IT_FEAT_MASK 0x0002 + +/* info result */ +#define L2CAP_IR_SUCCESS 0x0000 +#define L2CAP_IR_NOTSUPP 0x0001 + /* ----- L2CAP connections ----- */ struct l2cap_chan_list { struct sock *head; diff -Nru a/include/net/dst.h b/include/net/dst.h --- a/include/net/dst.h 2004-07-13 12:24:01 -07:00 +++ b/include/net/dst.h 2004-07-13 12:24:01 -07:00 @@ -149,7 +149,9 @@ { if (dst) { if (atomic_read(&dst->__refcnt) < 1) - printk(dst_underflow_bug_msg, dst, current_text_addr()); + printk(dst_underflow_bug_msg, + atomic_read(&dst->__refcnt), + dst, current_text_addr()); atomic_dec(&dst->__refcnt); } } diff -Nru a/include/net/pkt_act.h b/include/net/pkt_act.h --- a/include/net/pkt_act.h 2004-07-13 12:24:01 -07:00 +++ b/include/net/pkt_act.h 2004-07-13 12:24:01 -07:00 @@ -252,7 +252,7 @@ } spin_lock_init(&p->lock); - p->stats.lock = &p->lock; + p->stats_lock = &p->lock; p->index = parm->index ? : tcf_hash_new_index(); p->tm.install = jiffies; p->tm.lastuse = jiffies; diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h 2004-07-13 12:24:01 -07:00 +++ b/include/net/sock.h 2004-07-13 12:24:01 -07:00 @@ -917,25 +917,8 @@ write_unlock_bh(&sk->sk_callback_lock); } -static inline int sock_i_uid(struct sock *sk) -{ - int uid; - - read_lock(&sk->sk_callback_lock); - uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0; - read_unlock(&sk->sk_callback_lock); - return uid; -} - -static inline unsigned long sock_i_ino(struct sock *sk) -{ - unsigned long ino; - - read_lock(&sk->sk_callback_lock); - ino = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_ino : 0; - read_unlock(&sk->sk_callback_lock); - return ino; -} +extern int sock_i_uid(struct sock *sk); +extern unsigned long sock_i_ino(struct sock *sk); static inline struct dst_entry * __sk_dst_get(struct sock *sk) @@ -1219,7 +1202,7 @@ /* * Default write policy as shown to user space via poll/select/SIGIO */ -static inline int sock_writeable(struct sock *sk) +static inline int sock_writeable(const struct sock *sk) { return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2); } @@ -1229,17 +1212,17 @@ return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; } -static inline long sock_rcvtimeo(struct sock *sk, int noblock) +static inline long sock_rcvtimeo(const struct sock *sk, int noblock) { return noblock ? 0 : sk->sk_rcvtimeo; } -static inline long sock_sndtimeo(struct sock *sk, int noblock) +static inline long sock_sndtimeo(const struct sock *sk, int noblock) { return noblock ? 0 : sk->sk_sndtimeo; } -static inline int sock_rcvlowat(struct sock *sk, int waitall, int len) +static inline int sock_rcvlowat(const struct sock *sk, int waitall, int len) { return (waitall ? len : min_t(int, sk->sk_rcvlowat, len)) ? : 1; } diff -Nru a/include/net/tcp.h b/include/net/tcp.h --- a/include/net/tcp.h 2004-07-13 12:24:00 -07:00 +++ b/include/net/tcp.h 2004-07-13 12:24:00 -07:00 @@ -272,20 +272,20 @@ #define tcptw_sk(__sk) ((struct tcp_tw_bucket *)(__sk)) -static inline const u32 tcp_v4_rcv_saddr(const struct sock *sk) +static inline u32 tcp_v4_rcv_saddr(const struct sock *sk) { return likely(sk->sk_state != TCP_TIME_WAIT) ? inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr; } #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -static inline const struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk) +static inline struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk) { return likely(sk->sk_state != TCP_TIME_WAIT) ? &inet6_sk(sk)->rcv_saddr : &tcptw_sk(sk)->tw_v6_rcv_saddr; } -static inline const struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk) +static inline struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk) { return sk->sk_family == AF_INET6 ? __tcp_v6_rcv_saddr(sk) : NULL; } diff -Nru a/include/net/xfrm.h b/include/net/xfrm.h --- a/include/net/xfrm.h 2004-07-13 12:24:01 -07:00 +++ b/include/net/xfrm.h 2004-07-13 12:24:01 -07:00 @@ -818,6 +818,7 @@ extern int xfrm_check_selectors(struct xfrm_state **x, int n, struct flowi *fl); extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); extern int xfrm4_rcv(struct sk_buff *skb); +extern int xfrm4_output(struct sk_buff **pskb); extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); extern int xfrm4_tunnel_check_size(struct sk_buff *skb); diff -Nru a/include/rxrpc/call.h b/include/rxrpc/call.h --- a/include/rxrpc/call.h 2004-07-13 12:24:00 -07:00 +++ b/include/rxrpc/call.h 2004-07-13 12:24:00 -07:00 @@ -204,7 +204,7 @@ extern int rxrpc_call_write_data(struct rxrpc_call *call, size_t sioc, - struct iovec siov[], + struct kvec *siov, uint8_t rxhdr_flags, int alloc_flags, int dup_data, diff -Nru a/include/rxrpc/message.h b/include/rxrpc/message.h --- a/include/rxrpc/message.h 2004-07-13 12:24:00 -07:00 +++ b/include/rxrpc/message.h 2004-07-13 12:24:00 -07:00 @@ -44,7 +44,7 @@ int dcount; /* data part count */ size_t dsize; /* data size */ #define RXRPC_MSG_MAX_IOCS 8 - struct iovec data[RXRPC_MSG_MAX_IOCS]; /* message data */ + struct kvec data[RXRPC_MSG_MAX_IOCS]; /* message data */ unsigned long dfree; /* bit mask indicating kfree(data[x]) if T */ }; @@ -62,7 +62,7 @@ struct rxrpc_call *call, uint8_t type, int count, - struct iovec diov[], + struct kvec *diov, int alloc_flags, struct rxrpc_message **_msg); diff -Nru a/init/Kconfig b/init/Kconfig --- a/init/Kconfig 2004-07-13 12:24:01 -07:00 +++ b/init/Kconfig 2004-07-13 12:24:01 -07:00 @@ -162,7 +162,7 @@ config AUDITSYSCALL bool "Enable system-call auditing support" - depends on AUDIT && (X86 || PPC64 || ARCH_S390) + depends on AUDIT && (X86 || PPC64 || ARCH_S390 || IA64) default y if SECURITY_SELINUX default n help diff -Nru a/ipc/compat.c b/ipc/compat.c --- a/ipc/compat.c 2004-07-13 12:24:01 -07:00 +++ b/ipc/compat.c 2004-07-13 12:24:01 -07:00 @@ -235,24 +235,13 @@ return err; } -static inline int do_semctl(int semid, int semnum, int cmd, union semun arg) -{ - mm_segment_t old_fs; - int err; - - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_semctl(semid, semnum, cmd, arg); - set_fs(old_fs); - - return err; -} long compat_sys_semctl(int first, int second, int third, void __user *uptr) { union semun fourth; u32 pad; int err, err2; struct semid64_ds s64; + struct semid64_ds __user *up64; int version = compat_ipc_parse_version(&third); if (!uptr) @@ -279,16 +268,17 @@ case IPC_STAT: case SEM_STAT: - fourth.__pad = &s64; - err = do_semctl(first, second, third, fourth); + up64 = compat_alloc_user_space(sizeof(s64)); + fourth.__pad = up64; + err = sys_semctl(first, second, third, fourth); if (err < 0) break; - - if (version == IPC_64) { + if (copy_from_user(&s64, up64, sizeof(s64))) + err2 = -EFAULT; + else if (version == IPC_64) err2 = put_compat_semid64_ds(&s64, compat_ptr(pad)); - } else { + else err2 = put_compat_semid_ds(&s64, compat_ptr(pad)); - } if (err2) err = -EFAULT; break; @@ -299,11 +289,14 @@ } else { err = get_compat_semid_ds(&s64, compat_ptr(pad)); } + up64 = compat_alloc_user_space(sizeof(s64)); + if (copy_to_user(up64, &s64, sizeof(s64))) + err = -EFAULT; if (err) break; - fourth.__pad = &s64; - err = do_semctl(first, second, third, fourth); + fourth.__pad = up64; + err = sys_semctl(first, second, third, fourth); break; default: @@ -315,39 +308,30 @@ long compat_sys_msgsnd(int first, int second, int third, void __user *uptr) { - struct msgbuf *p; - struct compat_msgbuf __user *up; - mm_segment_t old_fs; - int err; + struct msgbuf __user *p; + struct compat_msgbuf __user *up = uptr; + long type; if (first < 0) return -EINVAL; if (second < 0 || (second >= MAXBUF - sizeof(struct msgbuf))) return -EINVAL; - p = kmalloc(second + sizeof(struct msgbuf), GFP_USER); - if (!p) - return -ENOMEM; - err = -EFAULT; - up = uptr; - if (get_user(p->mtype, &up->mtype) || - copy_from_user(p->mtext, &up->mtext, second)) - goto out; - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_msgsnd(first, p, second, third); - set_fs(old_fs); -out: - kfree(p); - return err; + p = compat_alloc_user_space(second + sizeof(struct msgbuf)); + if (get_user(type, &up->mtype) || + put_user(type, &p->mtype) || + copy_in_user(p->mtext, up->mtext, second)) + return -EFAULT; + + return sys_msgsnd(first, p, second, third); } long compat_sys_msgrcv(int first, int second, int msgtyp, int third, int version, void __user *uptr) { - struct msgbuf *p; + struct msgbuf __user *p; struct compat_msgbuf __user *up; - mm_segment_t old_fs; + long type; int err; if (first < 0) @@ -356,34 +340,25 @@ return -EINVAL; if (!version) { - struct compat_ipc_kludge __user *uipck = uptr; struct compat_ipc_kludge ipck; - err = -EINVAL; if (!uptr) goto out; err = -EFAULT; - if (copy_from_user (&ipck, uipck, sizeof(ipck))) + if (copy_from_user (&ipck, uptr, sizeof(ipck))) goto out; uptr = compat_ptr(ipck.msgp); msgtyp = ipck.msgtyp; } - err = -ENOMEM; - p = kmalloc(second + sizeof(struct msgbuf), GFP_USER); - if (!p) - goto out; - old_fs = get_fs(); - set_fs(KERNEL_DS); + p = compat_alloc_user_space(second + sizeof(struct msgbuf)); err = sys_msgrcv(first, p, second, msgtyp, third); - set_fs(old_fs); if (err < 0) - goto free_then_out; + goto out; up = uptr; - if (put_user(p->mtype, &up->mtype) || - __copy_to_user(&up->mtext, p->mtext, err)) + if (get_user(type, &p->mtype) || + put_user(type, &up->mtype) || + copy_in_user(up->mtext, p->mtext, err)) err = -EFAULT; -free_then_out: - kfree(p); out: return err; } @@ -450,24 +425,12 @@ return err; } -static inline int do_msgctl(int first, int second, void *buf) -{ - mm_segment_t old_fs; - int err; - - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_msgctl(first, second, buf); - set_fs(old_fs); - - return err; -} - long compat_sys_msgctl(int first, int second, void __user *uptr) { int err, err2; struct msqid64_ds m64; int version = compat_ipc_parse_version(&second); + void __user *p; switch (second & (~IPC_64)) { case IPC_INFO: @@ -484,21 +447,25 @@ } if (err) break; - - err = do_msgctl(first, second, &m64); + p = compat_alloc_user_space(sizeof(m64)); + if (copy_to_user(p, &m64, sizeof(m64))) + err = -EFAULT; + else + err = sys_msgctl(first, second, p); break; case IPC_STAT: case MSG_STAT: - err = do_msgctl(first, second, &m64); + p = compat_alloc_user_space(sizeof(m64)); + err = sys_msgctl(first, second, p); if (err < 0) break; - - if (version == IPC_64) { + if (copy_from_user(&m64, p, sizeof(m64))) + err2 = -EFAULT; + else if (version == IPC_64) err2 = put_compat_msqid64_ds(&m64, uptr); - } else { + else err2 = put_compat_msqid_ds(&m64, uptr); - } if (err2) err = -EFAULT; break; @@ -607,40 +574,29 @@ err |= __put_user(smi->shmall, &up->shmall); } -static inline int put_compat_shm_info(struct shm_info *si, +static inline int put_compat_shm_info(struct shm_info __user *ip, struct compat_shm_info __user *uip) { int err; + struct shm_info si; - if (!access_ok(VERIFY_WRITE, uip, sizeof(*uip))) + if (!access_ok(VERIFY_WRITE, uip, sizeof(*uip)) || + copy_from_user(&si, ip, sizeof(si))) return -EFAULT; - err = __put_user(si->used_ids, &uip->used_ids); - err |= __put_user(si->shm_tot, &uip->shm_tot); - err |= __put_user(si->shm_rss, &uip->shm_rss); - err |= __put_user(si->shm_swp, &uip->shm_swp); - err |= __put_user(si->swap_attempts, &uip->swap_attempts); - err |= __put_user(si->swap_successes, &uip->swap_successes); - return err; -} - -static inline int do_shmctl(int shmid, int cmd, void *buf) -{ - mm_segment_t old_fs; - int err; - - old_fs = get_fs(); - set_fs(KERNEL_DS); - err = sys_shmctl(shmid, cmd, buf); - set_fs(old_fs); - + err = __put_user(si.used_ids, &uip->used_ids); + err |= __put_user(si.shm_tot, &uip->shm_tot); + err |= __put_user(si.shm_rss, &uip->shm_rss); + err |= __put_user(si.shm_swp, &uip->shm_swp); + err |= __put_user(si.swap_attempts, &uip->swap_attempts); + err |= __put_user(si.swap_successes, &uip->swap_successes); return err; } long compat_sys_shmctl(int first, int second, void __user *uptr) { + void __user *p; struct shmid64_ds s64; struct shminfo64 smi; - struct shm_info si; int err, err2; int version = compat_ipc_parse_version(&second); @@ -652,15 +608,16 @@ break; case IPC_INFO: - err = do_shmctl(first, second, &smi); + p = compat_alloc_user_space(sizeof(smi)); + err = sys_shmctl(first, second, p); if (err < 0) break; - - if (version == IPC_64) { + if (copy_from_user(&smi, p, sizeof(smi))) + err2 = -EFAULT; + else if (version == IPC_64) err2 = put_compat_shminfo64(&smi, uptr); - } else { + else err2 = put_compat_shminfo(&smi, uptr); - } if (err2) err = -EFAULT; break; @@ -674,30 +631,35 @@ } if (err) break; - - err = do_shmctl(first, second, &s64); + p = compat_alloc_user_space(sizeof(s64)); + if (copy_to_user(p, &s64, sizeof(s64))) + err = -EFAULT; + else + err = sys_shmctl(first, second, p); break; case IPC_STAT: case SHM_STAT: - err = do_shmctl(first, second, &s64); + p = compat_alloc_user_space(sizeof(s64)); + err = sys_shmctl(first, second, p); if (err < 0) break; - - if (version == IPC_64) { + if (copy_from_user(&s64, p, sizeof(s64))) + err2 = -EFAULT; + else if (version == IPC_64) err2 = put_compat_shmid64_ds(&s64, uptr); - } else { + else err2 = put_compat_shmid_ds(&s64, uptr); - } if (err2) err = -EFAULT; break; case SHM_INFO: - err = do_shmctl(first, second, &si); + p = compat_alloc_user_space(sizeof(struct shm_info)); + err = sys_shmctl(first, second, p); if (err < 0) break; - err2 = put_compat_shm_info(&si, uptr); + err2 = put_compat_shm_info(p, uptr); if (err2) err = -EFAULT; break; @@ -712,24 +674,14 @@ long compat_sys_semtimedop(int semid, struct sembuf __user *tsems, unsigned nsops, const struct compat_timespec __user *timeout) { - struct timespec ts; - struct timespec __user *ts64; - - /* parameter checking precedence should mirror sys_semtimedop() */ - if (nsops < 1 || semid < 0) - return -EINVAL; - if (nsops > sc_semopm) - return -E2BIG; - if (!access_ok(VERIFY_READ, tsems, nsops * sizeof(struct sembuf))) - return -EFAULT; - if (!timeout) - return sys_semtimedop(semid, tsems, nsops, 0); - - ts64 = compat_alloc_user_space(sizeof(*ts64)); - if (get_compat_timespec(&ts, timeout)) - return -EFAULT; - if (copy_to_user(ts64, &ts, sizeof(ts))) - return -EFAULT; - + struct timespec __user *ts64 = NULL; + if (timeout) { + struct timespec ts; + ts64 = compat_alloc_user_space(sizeof(*ts64)); + if (get_compat_timespec(&ts, timeout)) + return -EFAULT; + if (copy_to_user(ts64, &ts, sizeof(ts))) + return -EFAULT; + } return sys_semtimedop(semid, tsems, nsops, ts64); } diff -Nru a/ipc/compat_mq.c b/ipc/compat_mq.c --- a/ipc/compat_mq.c 2004-07-13 12:24:00 -07:00 +++ b/ipc/compat_mq.c 2004-07-13 12:24:00 -07:00 @@ -50,45 +50,29 @@ int oflag, compat_mode_t mode, struct compat_mq_attr __user *u_attr) { - struct mq_attr attr; - mm_segment_t oldfs; - char *name; - long ret; - - if ((oflag & O_CREAT) == 0 || !u_attr) - return sys_mq_open(u_name, oflag, mode, 0); - - if (get_compat_mq_attr(&attr, u_attr)) - return -EFAULT; - - name = getname(u_name); - if (IS_ERR(name)) - return PTR_ERR(name); - - oldfs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_mq_open(name, oflag, mode, &attr); - set_fs(oldfs); - - putname(name); - return ret; + void __user *p = NULL; + if (u_attr && oflag & O_CREAT) { + struct mq_attr attr; + p = compat_alloc_user_space(sizeof(attr)); + if (get_compat_mq_attr(&attr, u_attr) || + copy_to_user(p, &attr, sizeof(attr))) + return -EFAULT; + } + return sys_mq_open(u_name, oflag, mode, p); } -static struct timespec __user *compat_prepare_timeout( - const struct compat_timespec __user *u_abs_timeout) +static int compat_prepare_timeout(struct timespec __user * *p, + const struct compat_timespec __user *u) { struct timespec ts; - struct timespec __user *u_ts; - - if (!u_abs_timeout) + if (!u) { + *p = NULL; return 0; - - u_ts = compat_alloc_user_space(sizeof(*u_ts)); - if (get_compat_timespec(&ts, u_abs_timeout) - || copy_to_user(u_ts, &ts, sizeof(*u_ts))) - return ERR_PTR(-EFAULT); - - return u_ts; + } + *p = compat_alloc_user_space(sizeof(ts)); + if (get_compat_timespec(&ts, u) || copy_to_user(*p, &ts, sizeof(ts))) + return -EFAULT; + return 0; } asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes, @@ -98,8 +82,7 @@ { struct timespec __user *u_ts; - u_ts = compat_prepare_timeout(u_abs_timeout); - if (IS_ERR(u_ts)) + if (compat_prepare_timeout(&u_ts, u_abs_timeout)) return -EFAULT; return sys_mq_timedsend(mqdes, u_msg_ptr, msg_len, @@ -112,9 +95,7 @@ const struct compat_timespec __user *u_abs_timeout) { struct timespec __user *u_ts; - - u_ts = compat_prepare_timeout(u_abs_timeout); - if (IS_ERR(u_ts)) + if (compat_prepare_timeout(&u_ts, u_abs_timeout)) return -EFAULT; return sys_mq_timedreceive(mqdes, u_msg_ptr, msg_len, @@ -138,60 +119,42 @@ asmlinkage long compat_sys_mq_notify(mqd_t mqdes, const struct compat_sigevent __user *u_notification) { - mm_segment_t oldfs; - struct sigevent notification; - char cookie[NOTIFY_COOKIE_LEN]; - compat_uptr_t u_cookie; - long ret; - - if (!u_notification) - return sys_mq_notify(mqdes, 0); - - if (get_compat_sigevent(¬ification, u_notification)) - return -EFAULT; - - if (notification.sigev_notify == SIGEV_THREAD) { - u_cookie = (compat_uptr_t)notification.sigev_value.sival_int; - if (copy_from_user(cookie, compat_ptr(u_cookie), - NOTIFY_COOKIE_LEN)) { + struct sigevent __user *p = NULL; + if (u_notification) { + struct sigevent n; + p = compat_alloc_user_space(sizeof(*p)); + if (get_compat_sigevent(&n, u_notification)) + return -EFAULT; + if (n.sigev_notify == SIGEV_THREAD) + n.sigev_value.sival_ptr = compat_ptr(n.sigev_value.sival_int); + if (copy_to_user(p, &n, sizeof(*p))) return -EFAULT; - } - notification.sigev_value.sival_ptr = cookie; } - - oldfs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_mq_notify(mqdes, ¬ification); - set_fs(oldfs); - - return ret; + return sys_mq_notify(mqdes, p); } asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes, const struct compat_mq_attr __user *u_mqstat, struct compat_mq_attr __user *u_omqstat) { - struct mq_attr mqstat, omqstat; - struct mq_attr *p_mqstat = 0, *p_omqstat = 0; - mm_segment_t oldfs; + struct mq_attr mqstat; + struct mq_attr __user *p = compat_alloc_user_space(2 * sizeof(*p)); long ret; if (u_mqstat) { - p_mqstat = &mqstat; - if (get_compat_mq_attr(p_mqstat, u_mqstat)) + if (get_compat_mq_attr(&mqstat, u_mqstat) || + copy_to_user(p, &mqstat, sizeof(mqstat))) return -EFAULT; } - - if (u_omqstat) - p_omqstat = &omqstat; - - oldfs = get_fs(); - set_fs(KERNEL_DS); - ret = sys_mq_getsetattr(mqdes, p_mqstat, p_omqstat); - set_fs(oldfs); - + ret = sys_mq_getsetattr(mqdes, + u_mqstat ? p : NULL, + u_omqstat ? p + 1 : NULL); if (ret) return ret; - - return (u_omqstat) ? put_compat_mq_attr(&omqstat, u_omqstat) : 0; + if (u_omqstat) { + if (copy_from_user(&mqstat, p + 1, sizeof(mqstat)) || + put_compat_mq_attr(&mqstat, u_omqstat)) + return -EFAULT; + } + return 0; } diff -Nru a/kernel/exit.c b/kernel/exit.c --- a/kernel/exit.c 2004-07-13 12:24:01 -07:00 +++ b/kernel/exit.c 2004-07-13 12:24:01 -07:00 @@ -296,7 +296,7 @@ Let the signal code know it'll be handled, so that they don't get converted to SIGKILL or just silently dropped */ - current->sighand->action[(sig)-1].sa.sa_handler = (void *)2; + current->sighand->action[(sig)-1].sa.sa_handler = (void __user *)2; } recalc_sigpending(); spin_unlock_irq(¤t->sighand->siglock); diff -Nru a/kernel/sched.c b/kernel/sched.c --- a/kernel/sched.c 2004-07-13 12:24:01 -07:00 +++ b/kernel/sched.c 2004-07-13 12:24:01 -07:00 @@ -40,6 +40,7 @@ #include #include #include +#include #include @@ -3349,6 +3350,7 @@ task_rq_unlock(rq, &flags); wake_up_process(rq->migration_thread); wait_for_completion(&req.done); + tlb_migrate_finish(p->mm); return 0; } out: diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c 2004-07-13 12:24:01 -07:00 +++ b/net/atm/clip.c 2004-07-13 12:24:01 -07:00 @@ -998,7 +998,7 @@ /* so neigh_ifdown() doesn't complain */ clip_tbl.proxy_timer.data = 0; - clip_tbl.proxy_timer.function = 0; + clip_tbl.proxy_timer.function = NULL; init_timer(&clip_tbl.proxy_timer); skb_queue_head_init(&clip_tbl.proxy_queue); diff -Nru a/net/atm/signaling.c b/net/atm/signaling.c --- a/net/atm/signaling.c 2004-07-13 12:24:01 -07:00 +++ b/net/atm/signaling.c 2004-07-13 12:24:01 -07:00 @@ -135,7 +135,7 @@ lock_sock(vcc->sk); if (vcc->sk->sk_ack_backlog == vcc->sk->sk_max_ack_backlog) { - sigd_enq(0,as_reject,vcc,NULL,NULL); + sigd_enq(NULL,as_reject,vcc,NULL,NULL); goto as_indicate_complete; } vcc->sk->sk_ack_backlog++; diff -Nru a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c --- a/net/bluetooth/af_bluetooth.c 2004-07-13 12:24:00 -07:00 +++ b/net/bluetooth/af_bluetooth.c 2004-07-13 12:24:00 -07:00 @@ -354,7 +354,7 @@ /* Init socket cache */ bt_sock_cache = kmem_cache_create("bt_sock", sizeof(struct bt_sock), 0, - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN, NULL, NULL); if (!bt_sock_cache) { BT_ERR("Socket cache creation failed"); diff -Nru a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c --- a/net/bluetooth/hci_sysfs.c 2004-07-13 12:24:01 -07:00 +++ b/net/bluetooth/hci_sysfs.c 2004-07-13 12:24:01 -07:00 @@ -91,7 +91,7 @@ if ((size <= 0) || (i >= num_envp)) return -ENOMEM; - envp[i] = 0; + envp[i] = NULL; return 0; } #endif diff -Nru a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c --- a/net/bluetooth/l2cap.c 2004-07-13 12:24:01 -07:00 +++ b/net/bluetooth/l2cap.c 2004-07-13 12:24:01 -07:00 @@ -57,7 +57,7 @@ #define BT_DBG(D...) #endif -#define VERSION "2.2" +#define VERSION "2.3" static struct proto_ops l2cap_sock_ops; @@ -718,8 +718,7 @@ return err; } -static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, - struct msghdr *msg, size_t len) +static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; int err = 0; @@ -1444,7 +1443,7 @@ struct l2cap_conn_rsp *rsp = (struct l2cap_conn_rsp *) data; u16 scid, dcid, result, status; struct sock *sk; - char req[128]; + u8 req[128]; scid = __le16_to_cpu(rsp->scid); dcid = __le16_to_cpu(rsp->dcid); @@ -1481,7 +1480,7 @@ { struct l2cap_conf_req *req = (struct l2cap_conf_req *) data; u16 dcid, flags; - u8 rsp[64]; + u8 rsp[64]; struct sock *sk; int result; @@ -1633,6 +1632,35 @@ return 0; } +static inline int l2cap_info_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data) +{ + struct l2cap_info_req *req = (struct l2cap_info_req *) data; + struct l2cap_info_rsp rsp; + u16 type; + + type = __le16_to_cpu(req->type); + + BT_DBG("type 0x%4.4x", type); + + rsp.type = __cpu_to_le16(type); + rsp.result = __cpu_to_le16(L2CAP_IR_NOTSUPP); + l2cap_send_rsp(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(rsp), &rsp); + return 0; +} + +static inline int l2cap_info_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data) +{ + struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) data; + u16 type, result; + + type = __le16_to_cpu(rsp->type); + result = __le16_to_cpu(rsp->result); + + BT_DBG("type 0x%4.4x result 0x%2.2x", type, result); + + return 0; +} + static inline void l2cap_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb) { u8 *data = skb->data; @@ -1657,6 +1685,10 @@ } switch (cmd.code) { + case L2CAP_COMMAND_REJ: + /* FIXME: We should process this */ + break; + case L2CAP_CONN_REQ: err = l2cap_connect_req(conn, &cmd, data); break; @@ -1681,17 +1713,19 @@ err = l2cap_disconnect_rsp(conn, &cmd, data); break; - case L2CAP_COMMAND_REJ: - /* FIXME: We should process this */ - break; - case L2CAP_ECHO_REQ: l2cap_send_rsp(conn, cmd.ident, L2CAP_ECHO_RSP, cmd.len, data); break; case L2CAP_ECHO_RSP: + break; + case L2CAP_INFO_REQ: + err = l2cap_info_req(conn, &cmd, data); + break; + case L2CAP_INFO_RSP: + err = l2cap_info_rsp(conn, &cmd, data); break; default: @@ -1704,7 +1738,7 @@ struct l2cap_cmd_rej rej; BT_DBG("error %d", err); - /* FIXME: Map err to a valid reason. */ + /* FIXME: Map err to a valid reason */ rej.reason = __cpu_to_le16(0); l2cap_send_rsp(conn, cmd.ident, L2CAP_COMMAND_REJ, sizeof(rej), &rej); } @@ -1737,7 +1771,7 @@ /* If socket recv buffers overflows we drop data here * which is *bad* because L2CAP has to be reliable. * But we don't have any other choice. L2CAP doesn't - * provide flow control mechanism */ + * provide flow control mechanism. */ if (!sock_queue_rcv_skb(sk, skb)) goto done; @@ -2210,7 +2244,7 @@ module_init(l2cap_init); module_exit(l2cap_exit); -MODULE_AUTHOR("Maxim Krasnyansky "); +MODULE_AUTHOR("Maxim Krasnyansky , Marcel Holtmann "); MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION); MODULE_VERSION(VERSION); MODULE_LICENSE("GPL"); diff -Nru a/net/bridge/br_device.c b/net/bridge/br_device.c --- a/net/bridge/br_device.c 2004-07-13 12:24:00 -07:00 +++ b/net/bridge/br_device.c 2004-07-13 12:24:00 -07:00 @@ -89,6 +89,15 @@ return 0; } +static int br_change_mtu(struct net_device *dev, int new_mtu) +{ + if ((new_mtu < 68) || new_mtu > br_min_mtu(dev->priv)) + return -EINVAL; + + dev->mtu = new_mtu; + return 0; +} + static int br_dev_accept_fastpath(struct net_device *dev, struct dst_entry *dst) { return -1; @@ -105,6 +114,7 @@ dev->hard_start_xmit = br_dev_xmit; dev->open = br_dev_open; dev->set_multicast_list = br_dev_set_multicast_list; + dev->change_mtu = br_change_mtu; dev->destructor = free_netdev; SET_MODULE_OWNER(dev); dev->stop = br_dev_stop; diff -Nru a/net/bridge/br_forward.c b/net/bridge/br_forward.c --- a/net/bridge/br_forward.c 2004-07-13 12:24:00 -07:00 +++ b/net/bridge/br_forward.c 2004-07-13 12:24:00 -07:00 @@ -23,6 +23,7 @@ const struct sk_buff *skb) { if (skb->dev == p->dev || + skb->len > p->dev->mtu || p->state != BR_STATE_FORWARDING) return 0; diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c --- a/net/bridge/br_if.c 2004-07-13 12:24:01 -07:00 +++ b/net/bridge/br_if.c 2004-07-13 12:24:01 -07:00 @@ -295,6 +295,24 @@ return ret; } +int br_min_mtu(const struct net_bridge *br) +{ + const struct net_bridge_port *p; + int mtu = 0; + + ASSERT_RTNL(); + + if (list_empty(&br->port_list)) + mtu = 1500; + else { + list_for_each_entry(p, &br->port_list, list) { + if (!mtu || p->dev->mtu < mtu) + mtu = p->dev->mtu; + } + } + return mtu; +} + /* called with RTNL */ int br_add_if(struct net_bridge *br, struct net_device *dev) { @@ -328,6 +346,8 @@ if ((br->dev->flags & IFF_UP) && (dev->flags & IFF_UP)) br_stp_enable_port(p); spin_unlock_bh(&br->lock); + + br->dev->mtu = br_min_mtu(br); } return err; diff -Nru a/net/bridge/br_notify.c b/net/bridge/br_notify.c --- a/net/bridge/br_notify.c 2004-07-13 12:24:00 -07:00 +++ b/net/bridge/br_notify.c 2004-07-13 12:24:00 -07:00 @@ -47,6 +47,10 @@ spin_unlock_bh(&br->lock); break; + case NETDEV_CHANGEMTU: + br->dev->mtu = br_min_mtu(br); + break; + case NETDEV_DOWN: if (br->dev->flags & IFF_UP) { spin_lock_bh(&br->lock); diff -Nru a/net/bridge/br_private.h b/net/bridge/br_private.h --- a/net/bridge/br_private.h 2004-07-13 12:24:00 -07:00 +++ b/net/bridge/br_private.h 2004-07-13 12:24:00 -07:00 @@ -168,6 +168,7 @@ struct net_device *dev); extern int br_del_if(struct net_bridge *br, struct net_device *dev); +extern int br_min_mtu(const struct net_bridge *br); /* br_input.c */ extern int br_handle_frame_finish(struct sk_buff *skb); diff -Nru a/net/core/pktgen.c b/net/core/pktgen.c --- a/net/core/pktgen.c 2004-07-13 12:24:01 -07:00 +++ b/net/core/pktgen.c 2004-07-13 12:24:01 -07:00 @@ -1355,7 +1355,7 @@ pginfos[i].udp_dst_max = 9; sprintf(pginfos[i].fname, "net/%s/pg%i", PG_PROC_DIR, i); - pginfos[i].proc_ent = create_proc_entry(pginfos[i].fname, 0600, 0); + pginfos[i].proc_ent = create_proc_entry(pginfos[i].fname, 0600, NULL); if (!pginfos[i].proc_ent) { printk("pktgen: Error: cannot create net/%s/pg procfs entry.\n", PG_PROC_DIR); goto cleanup_mem; @@ -1366,7 +1366,7 @@ pginfos[i].proc_ent->owner = THIS_MODULE; sprintf(pginfos[i].busy_fname, "net/%s/pg_busy%i", PG_PROC_DIR, i); - pginfos[i].busy_proc_ent = create_proc_entry(pginfos[i].busy_fname, 0, 0); + pginfos[i].busy_proc_ent = create_proc_entry(pginfos[i].busy_fname, 0, NULL); if (!pginfos[i].busy_proc_ent) { printk("pktgen: Error: cannot create net/%s/pg_busy procfs entry.\n", PG_PROC_DIR); goto cleanup_mem; diff -Nru a/net/core/sock.c b/net/core/sock.c --- a/net/core/sock.c 2004-07-13 12:24:01 -07:00 +++ b/net/core/sock.c 2004-07-13 12:24:01 -07:00 @@ -711,6 +711,27 @@ atomic_sub(skb->truesize, &sk->sk_rmem_alloc); } + +int sock_i_uid(struct sock *sk) +{ + int uid; + + read_lock(&sk->sk_callback_lock); + uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0; + read_unlock(&sk->sk_callback_lock); + return uid; +} + +unsigned long sock_i_ino(struct sock *sk) +{ + unsigned long ino; + + read_lock(&sk->sk_callback_lock); + ino = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_ino : 0; + read_unlock(&sk->sk_callback_lock); + return ino; +} + /* * Allocate a skb from the socket's send buffer. */ @@ -1379,6 +1400,8 @@ EXPORT_SYMBOL(sock_setsockopt); EXPORT_SYMBOL(sock_wfree); EXPORT_SYMBOL(sock_wmalloc); +EXPORT_SYMBOL(sock_i_uid); +EXPORT_SYMBOL(sock_i_ino); #ifdef CONFIG_SYSCTL EXPORT_SYMBOL(sysctl_optmem_max); EXPORT_SYMBOL(sysctl_rmem_max); diff -Nru a/net/econet/af_econet.c b/net/econet/af_econet.c --- a/net/econet/af_econet.c 2004-07-13 12:24:01 -07:00 +++ b/net/econet/af_econet.c 2004-07-13 12:24:01 -07:00 @@ -1091,7 +1091,7 @@ if (edev) { if (net2dev_map[0] == dev) - net2dev_map[0] = 0; + net2dev_map[0] = NULL; net2dev_map[edev->net] = NULL; kfree(edev); dev->ec_ptr = NULL; diff -Nru a/net/ipv4/Kconfig b/net/ipv4/Kconfig --- a/net/ipv4/Kconfig 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/Kconfig 2004-07-13 12:24:01 -07:00 @@ -196,8 +196,7 @@ can be useful if you want to make your (or some other) machine appear on a different network than it physically is, or to use mobile-IP facilities (allowing laptops to seamlessly move between - networks without changing their IP addresses; check out - ). + networks without changing their IP addresses). Saying Y to this option will produce two modules ( = code which can be inserted in and removed from the running kernel whenever you diff -Nru a/net/ipv4/Makefile b/net/ipv4/Makefile --- a/net/ipv4/Makefile 2004-07-13 12:24:00 -07:00 +++ b/net/ipv4/Makefile 2004-07-13 12:24:00 -07:00 @@ -23,4 +23,5 @@ obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_IP_VS) += ipvs/ -obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o xfrm4_tunnel.o +obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \ + xfrm4_tunnel.o xfrm4_output.o diff -Nru a/net/ipv4/ah4.c b/net/ipv4/ah4.c --- a/net/ipv4/ah4.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/ah4.c 2004-07-13 12:24:01 -07:00 @@ -67,52 +67,24 @@ char buf[60]; } tmp_iph; - if ((*pskb)->ip_summed == CHECKSUM_HW) { - err = skb_checksum_help(pskb, 0); - if (err) - goto error_nolock; - } + top_iph = (*pskb)->nh.iph; + iph = &tmp_iph.iph; - spin_lock_bh(&x->lock); - err = xfrm_state_check(x, *pskb); - if (err) - goto error; - - iph = (*pskb)->nh.iph; - if (x->props.mode) { - err = xfrm4_tunnel_check_size(*pskb); + 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) { + 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) goto error; - top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len); - top_iph->ihl = 5; - top_iph->version = 4; - top_iph->tos = iph->tos; - if (x->props.flags & XFRM_STATE_NOECN) - IP_ECN_clear(top_iph); - top_iph->frag_off = iph->frag_off & ~htons(IP_MF|IP_OFFSET); - if (!(iph->frag_off&htons(IP_DF))) - __ip_select_ident(top_iph, dst, 0); - top_iph->ttl = iph->ttl; - top_iph->saddr = x->props.saddr.a4; - top_iph->daddr = x->id.daddr.a4; - memcpy(&tmp_iph, top_iph, 20); - memset(&(IPCB(*pskb)->opt), 0, sizeof(struct ip_options)); - ah = (struct ip_auth_hdr*)(top_iph+1); - ah->nexthdr = IPPROTO_IPIP; - } else { - memcpy(&tmp_iph, (*pskb)->data, iph->ihl*4); - top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len); - memcpy(top_iph, &tmp_iph, iph->ihl*4); - if (top_iph->ihl != 5) { - err = ip_clear_mutable_options(top_iph, &top_iph->daddr); - if (err) - goto error; - } - ah = (struct ip_auth_hdr*)((char*)top_iph+iph->ihl*4); - ah->nexthdr = iph->protocol; } - iph = &tmp_iph.iph; + ah = (struct ip_auth_hdr *)((char *)top_iph+top_iph->ihl*4); + ah->nexthdr = top_iph->protocol; + top_iph->tos = 0; top_iph->tot_len = htons((*pskb)->len); top_iph->frag_off = 0; @@ -128,31 +100,19 @@ ah->spi = x->id.spi; ah->seq_no = htonl(++x->replay.oseq); ahp->icv(ahp, *pskb, ah->auth_data); + top_iph->tos = iph->tos; top_iph->ttl = iph->ttl; top_iph->frag_off = iph->frag_off; - if (!x->props.mode) { - top_iph->daddr = iph->daddr; - if (iph->ihl != 5) - memcpy(top_iph+1, iph+1, iph->ihl*4 - sizeof(struct iphdr)); - } - ip_send_check(top_iph); + top_iph->daddr = iph->daddr; + if (top_iph->ihl != 5) + memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); - (*pskb)->nh.raw = (*pskb)->data; + ip_send_check(top_iph); - x->curlft.bytes += (*pskb)->len; - x->curlft.packets++; - spin_unlock_bh(&x->lock); - if (((*pskb)->dst = dst_pop(dst)) == NULL) { - err = -EHOSTUNREACH; - goto error_nolock; - } - return NET_XMIT_BYPASS; + err = 0; error: - spin_unlock_bh(&x->lock); -error_nolock: - kfree_skb(*pskb); return err; } diff -Nru a/net/ipv4/esp4.c b/net/ipv4/esp4.c --- a/net/ipv4/esp4.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/esp4.c 2004-07-13 12:24:01 -07:00 @@ -23,7 +23,7 @@ int err; struct dst_entry *dst = (*pskb)->dst; struct xfrm_state *x = dst->xfrm; - struct iphdr *iph, *top_iph; + struct iphdr *top_iph; struct ip_esp_hdr *esph; struct crypto_tfm *tfm; struct esp_data *esp; @@ -32,32 +32,9 @@ int clen; int alen; int nfrags; - union { - struct iphdr iph; - char buf[60]; - } tmp_iph; - - if ((*pskb)->ip_summed == CHECKSUM_HW) { - err = skb_checksum_help(pskb, 0); - if (err) - goto error_nolock; - } - - spin_lock_bh(&x->lock); - err = xfrm_state_check(x, *pskb); - if (err) - goto error; - if (x->props.mode) { - err = xfrm4_tunnel_check_size(*pskb); - if (err) - goto error; - } else { - /* Strip IP header in transport mode. Save it. */ - iph = (*pskb)->nh.iph; - memcpy(&tmp_iph, iph, iph->ihl*4); - __skb_pull(*pskb, iph->ihl*4); - } + /* Strip IP+ESP header. */ + __skb_pull(*pskb, (*pskb)->h.raw - (*pskb)->data); /* Now skb is pure payload to encrypt */ err = -ENOMEM; @@ -85,35 +62,11 @@ *(u8*)(trailer->tail + clen-(*pskb)->len - 2) = (clen - (*pskb)->len)-2; pskb_put(*pskb, trailer, clen - (*pskb)->len); - iph = (*pskb)->nh.iph; - if (x->props.mode) { - top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len); - esph = (struct ip_esp_hdr*)(top_iph+1); - *(u8*)(trailer->tail - 1) = IPPROTO_IPIP; - top_iph->ihl = 5; - top_iph->version = 4; - top_iph->tos = iph->tos; /* DS disclosed */ - if (x->props.flags & XFRM_STATE_NOECN) - IP_ECN_clear(top_iph); - top_iph->tot_len = htons((*pskb)->len + alen); - top_iph->frag_off = iph->frag_off&htons(IP_DF); - if (!(top_iph->frag_off)) - ip_select_ident(top_iph, dst, NULL); - top_iph->ttl = iph->ttl; /* TTL disclosed */ - top_iph->check = 0; - top_iph->saddr = x->props.saddr.a4; - top_iph->daddr = x->id.daddr.a4; - memset(&(IPCB(*pskb)->opt), 0, sizeof(struct ip_options)); - } else { - esph = (struct ip_esp_hdr*)skb_push(*pskb, x->props.header_len); - top_iph = (struct iphdr*)skb_push(*pskb, iph->ihl*4); - memcpy(top_iph, &tmp_iph, iph->ihl*4); - iph = &tmp_iph.iph; - top_iph->tot_len = htons((*pskb)->len + alen); - top_iph->check = 0; - top_iph->frag_off = iph->frag_off; - *(u8*)(trailer->tail - 1) = iph->protocol; - } + __skb_push(*pskb, (*pskb)->data - (*pskb)->nh.raw); + top_iph = (*pskb)->nh.iph; + esph = (struct ip_esp_hdr *)((*pskb)->nh.raw + top_iph->ihl*4); + top_iph->tot_len = htons((*pskb)->len + alen); + *(u8*)(trailer->tail - 1) = top_iph->protocol; /* this is non-NULL only with UDP Encapsulation */ if (x->encap) { @@ -124,7 +77,7 @@ uh = (struct udphdr *)esph; uh->source = encap->encap_sport; uh->dest = encap->encap_dport; - uh->len = htons((*pskb)->len + alen - sizeof(struct iphdr)); + uh->len = htons((*pskb)->len + alen - top_iph->ihl*4); uh->check = 0; switch (encap->encap_type) { @@ -176,21 +129,9 @@ ip_send_check(top_iph); - (*pskb)->nh.raw = (*pskb)->data; - - x->curlft.bytes += (*pskb)->len; - x->curlft.packets++; - spin_unlock_bh(&x->lock); - if (((*pskb)->dst = dst_pop(dst)) == NULL) { - err = -EHOSTUNREACH; - goto error_nolock; - } - return NET_XMIT_BYPASS; + err = 0; error: - spin_unlock_bh(&x->lock); -error_nolock: - kfree_skb(*pskb); return err; } diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/ip_output.c 2004-07-13 12:24:01 -07:00 @@ -498,10 +498,6 @@ skb_headroom(frag) < hlen) goto slow_path; - /* Correct socket ownership. */ - if (frag->sk == NULL && skb->sk) - goto slow_path; - /* Partially cloned skb? */ if (skb_shared(frag)) goto slow_path; @@ -1113,12 +1109,10 @@ tail_skb = &(tmp_skb->next); skb->len += tmp_skb->len; skb->data_len += tmp_skb->len; -#if 0 /* Logically correct, but useless work, ip_fragment() will have to undo */ skb->truesize += tmp_skb->truesize; __sock_put(tmp_skb->sk); tmp_skb->destructor = NULL; tmp_skb->sk = NULL; -#endif } /* Unless user demanded real pmtu discovery (IP_PMTUDISC_DO), we allow diff -Nru a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c --- a/net/ipv4/ipcomp.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/ipcomp.c 2004-07-13 12:24:01 -07:00 @@ -121,28 +121,6 @@ return err; } -static void ipcomp_tunnel_encap(struct xfrm_state *x, struct sk_buff *skb) -{ - struct dst_entry *dst = skb->dst; - struct iphdr *iph, *top_iph; - - iph = skb->nh.iph; - top_iph = (struct iphdr *)skb_push(skb, sizeof(struct iphdr)); - top_iph->ihl = 5; - top_iph->version = 4; - top_iph->tos = iph->tos; - top_iph->tot_len = htons(skb->len); - if (!(iph->frag_off&htons(IP_DF))) - __ip_select_ident(top_iph, dst, 0); - top_iph->ttl = iph->ttl; - top_iph->check = 0; - top_iph->saddr = x->props.saddr.a4; - top_iph->daddr = x->id.daddr.a4; - top_iph->frag_off = iph->frag_off&~htons(IP_MF|IP_OFFSET); - memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); - skb->nh.raw = skb->data; -} - static int ipcomp_output(struct sk_buff **pskb) { int err; @@ -153,39 +131,17 @@ struct ipcomp_data *ipcd = x->data; int hdr_len = 0; - if ((*pskb)->ip_summed == CHECKSUM_HW) { - err = skb_checksum_help(pskb, 0); - if (err) - goto error_nolock; - } - - spin_lock_bh(&x->lock); - err = xfrm_state_check(x, *pskb); - if (err) - goto error; - - if (x->props.mode) { - err = xfrm4_tunnel_check_size(*pskb); - if (err) - goto error; - } else { - /* Don't bother compressing */ - iph = (*pskb)->nh.iph; - hdr_len = iph->ihl * 4; - } + iph = (*pskb)->nh.iph; + iph->tot_len = htons((*pskb)->len); + hdr_len = iph->ihl * 4; if (((*pskb)->len - hdr_len) < ipcd->threshold) { + /* Don't bother compressing */ if (x->props.mode) { - ipcomp_tunnel_encap(x, *pskb); - iph = (*pskb)->nh.iph; - iph->protocol = IPPROTO_IPIP; ip_send_check(iph); } goto out_ok; } - if (x->props.mode) - ipcomp_tunnel_encap(x, *pskb); - if ((skb_is_nonlinear(*pskb) || skb_cloned(*pskb)) && skb_linearize(*pskb, GFP_ATOMIC) != 0) { err = -ENOMEM; @@ -197,7 +153,6 @@ if (err == -EMSGSIZE) { if (x->props.mode) { iph = (*pskb)->nh.iph; - iph->protocol = IPPROTO_IPIP; ip_send_check(iph); } goto out_ok; @@ -207,36 +162,19 @@ /* Install ipcomp header, convert into ipcomp datagram. */ iph = (*pskb)->nh.iph; - if (x->props.mode && (x->props.flags & XFRM_STATE_NOECN)) - IP_ECN_clear(iph); iph->tot_len = htons((*pskb)->len); - iph->check = 0; ipch = (struct ip_comp_hdr *)((char *)iph + iph->ihl * 4); - ipch->nexthdr = x->props.mode ? IPPROTO_IPIP : iph->protocol; + ipch->nexthdr = iph->protocol; ipch->flags = 0; ipch->cpi = htons((u16 )ntohl(x->id.spi)); iph->protocol = IPPROTO_COMP; ip_send_check(iph); - (*pskb)->nh.raw = (*pskb)->data; out_ok: - x->curlft.bytes += (*pskb)->len; - x->curlft.packets++; - spin_unlock_bh(&x->lock); - - if (((*pskb)->dst = dst_pop(dst)) == NULL) { - err = -EHOSTUNREACH; - goto error_nolock; - } - err = NET_XMIT_BYPASS; + err = 0; -out_exit: - return err; error: - spin_unlock_bh(&x->lock); -error_nolock: - kfree_skb(*pskb); - goto out_exit; + return err; } static void ipcomp4_err(struct sk_buff *skb, u32 info) diff -Nru a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c --- a/net/ipv4/ipmr.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/ipmr.c 2004-07-13 12:24:01 -07:00 @@ -109,7 +109,9 @@ static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert); static int ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm); +#ifdef CONFIG_IP_PIMSM_V2 static struct net_protocol pim_protocol; +#endif static struct timer_list ipmr_expire_timer; @@ -1702,7 +1704,7 @@ .open = ipmr_vif_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = seq_release_private, }; struct ipmr_mfc_iter { @@ -1737,6 +1739,9 @@ static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) { + struct ipmr_mfc_iter *it = seq->private; + it->cache = NULL; + it->ct = 0; return *pos ? ipmr_mfc_seq_idx(seq->private, *pos - 1) : SEQ_START_TOKEN; } @@ -1846,7 +1851,6 @@ if (rc) goto out_kfree; - memset(s, 0, sizeof(*s)); seq = file->private_data; seq->private = s; out: @@ -1862,7 +1866,7 @@ .open = ipmr_mfc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = seq_release_private, }; #endif diff -Nru a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c --- a/net/ipv4/ipvs/ip_vs_sync.c 2004-07-13 12:24:00 -07:00 +++ b/net/ipv4/ipvs/ip_vs_sync.c 2004-07-13 12:24:00 -07:00 @@ -593,7 +593,7 @@ /* Receive a packet */ iov.iov_base = buffer; iov.iov_len = (size_t)buflen; - msg.msg_name = 0; + msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; diff -Nru a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c --- a/net/ipv4/ipvs/ip_vs_xmit.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/ipvs/ip_vs_xmit.c 2004-07-13 12:24:01 -07:00 @@ -51,7 +51,7 @@ return NULL; if ((dst->obsolete || rtos != dest->dst_rtos) && dst->ops->check(dst, cookie) == NULL) { - dest->dst_cache = 0; + dest->dst_cache = NULL; return NULL; } dst_hold(dst); diff -Nru a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c --- a/net/ipv4/netfilter/ip_nat_snmp_basic.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c 2004-07-13 12:24:01 -07:00 @@ -252,7 +252,7 @@ if (def) *eoc = ctx->pointer + len; else - *eoc = 0; + *eoc = NULL; return 1; } diff -Nru a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c --- a/net/ipv4/netfilter/ipt_LOG.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/netfilter/ipt_LOG.c 2004-07-13 12:24:01 -07:00 @@ -76,7 +76,7 @@ printk("FRAG:%u ", ntohs(iph.frag_off) & IP_OFFSET); if ((info->logflags & IPT_LOG_IPOPT) - && iph.ihl * 4 != sizeof(struct iphdr)) { + && iph.ihl * 4 > sizeof(struct iphdr)) { unsigned char opt[4 * 15 - sizeof(struct iphdr)]; unsigned int i, optsize; @@ -143,7 +143,7 @@ printk("URGP=%u ", ntohs(tcph.urg_ptr)); if ((info->logflags & IPT_LOG_TCPOPT) - && tcph.doff * 4 != sizeof(struct tcphdr)) { + && tcph.doff * 4 > sizeof(struct tcphdr)) { unsigned char opt[4 * 15 - sizeof(struct tcphdr)]; unsigned int i, optsize; diff -Nru a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c --- a/net/ipv4/netfilter/ipt_ULOG.c 2004-07-13 12:24:00 -07:00 +++ b/net/ipv4/netfilter/ipt_ULOG.c 2004-07-13 12:24:00 -07:00 @@ -217,6 +217,10 @@ pm = NLMSG_DATA(nlh); + /* We might not have a timestamp, get one */ + if (skb->stamp.tv_sec == 0) + do_gettimeofday((struct timeval *)&skb->stamp); + /* copy hook, prefix, timestamp, payload, etc. */ pm->data_len = copy_len; pm->timestamp_sec = skb->stamp.tv_sec; diff -Nru a/net/ipv4/route.c b/net/ipv4/route.c --- a/net/ipv4/route.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/route.c 2004-07-13 12:24:01 -07:00 @@ -432,7 +432,7 @@ .open = rt_cpu_seq_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release_private, + .release = seq_release, }; #endif /* CONFIG_PROC_FS */ diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/tcp_output.c 2004-07-13 12:24:01 -07:00 @@ -682,17 +682,32 @@ if (free_space > tp->rcv_ssthresh) free_space = tp->rcv_ssthresh; - /* Get the largest window that is a nice multiple of mss. - * Window clamp already applied above. - * If our current window offering is within 1 mss of the - * free space we just keep it. This prevents the divide - * and multiply from happening most of the time. - * We also don't do any window rounding when the free space - * is too small. + /* Don't do rounding if we are using window scaling, since the + * scaled window will not line up with the MSS boundary anyway. */ window = tp->rcv_wnd; - if (window <= free_space - mss || window > free_space) - window = (free_space/mss)*mss; + if (tp->rcv_wscale) { + window = free_space; + + /* Advertise enough space so that it won't get scaled away. + * Import case: prevent zero window announcement if + * 1< mss. + */ + if (((window >> tp->rcv_wscale) << tp->rcv_wscale) != window) + window = (((window >> tp->rcv_wscale) + 1) + << tp->rcv_wscale); + } else { + /* Get the largest window that is a nice multiple of mss. + * Window clamp already applied above. + * If our current window offering is within 1 mss of the + * free space we just keep it. This prevents the divide + * and multiply from happening most of the time. + * We also don't do any window rounding when the free space + * is too small. + */ + if (window <= free_space - mss || window > free_space) + window = (free_space/mss)*mss; + } return window; } diff -Nru a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/net/ipv4/xfrm4_output.c 2004-07-13 12:24:02 -07:00 @@ -0,0 +1,120 @@ +/* + * xfrm4_output.c - Common IPsec encapsulation code for IPv4. + * Copyright (c) 2004 Herbert Xu + * + * 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 +#include +#include +#include +#include + +/* Add encapsulation header. + * + * In transport mode, the IP header will be moved forward to make space + * for the encapsulation header. + * + * In tunnel mode, the top IP header will be constructed per RFC 2401. + * The following fields in it shall be filled in by x->type->output: + * tot_len + * check + * + * On exit, skb->h will be set to the start of the payload to be processed + * by x->type->output and skb->nh will be set to the top IP header. + */ +static void xfrm4_encap(struct sk_buff *skb) +{ + struct dst_entry *dst = skb->dst; + struct xfrm_state *x = dst->xfrm; + struct iphdr *iph, *top_iph; + + iph = skb->nh.iph; + skb->h.ipiph = iph; + + skb->nh.raw = skb_push(skb, x->props.header_len); + top_iph = skb->nh.iph; + + if (!x->props.mode) { + skb->h.raw += iph->ihl*4; + memmove(top_iph, iph, iph->ihl*4); + return; + } + + top_iph->ihl = 5; + top_iph->version = 4; + + /* DS disclosed */ + top_iph->tos = INET_ECN_encapsulate(iph->tos, iph->tos); + if (x->props.flags & XFRM_STATE_NOECN) + IP_ECN_clear(top_iph); + + top_iph->frag_off = iph->frag_off & htons(IP_DF); + if (!top_iph->frag_off) + __ip_select_ident(top_iph, dst, 0); + + /* TTL disclosed */ + top_iph->ttl = iph->ttl; + + top_iph->saddr = x->props.saddr.a4; + top_iph->daddr = x->id.daddr.a4; + top_iph->protocol = IPPROTO_IPIP; + + memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); +} + +int xfrm4_output(struct sk_buff **pskb) +{ + struct sk_buff *skb = *pskb; + struct dst_entry *dst = skb->dst; + struct xfrm_state *x = dst->xfrm; + int err; + + if (skb->ip_summed == CHECKSUM_HW) { + err = skb_checksum_help(pskb, 0); + skb = *pskb; + if (err) + goto error_nolock; + } + + spin_lock_bh(&x->lock); + err = xfrm_state_check(x, skb); + if (err) + goto error; + + if (x->props.mode) { + err = xfrm4_tunnel_check_size(skb); + if (err) + goto error; + } + + xfrm4_encap(skb); + + err = x->type->output(pskb); + skb = *pskb; + if (err) + goto error; + + x->curlft.bytes += skb->len; + x->curlft.packets++; + + spin_unlock_bh(&x->lock); + + if (!(skb->dst = dst_pop(dst))) { + err = -EHOSTUNREACH; + goto error_nolock; + } + err = NET_XMIT_BYPASS; + +out_exit: + return err; +error: + spin_unlock_bh(&x->lock); +error_nolock: + kfree_skb(skb); + goto out_exit; +} diff -Nru a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c --- a/net/ipv4/xfrm4_policy.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv4/xfrm4_policy.c 2004-07-13 12:24:01 -07:00 @@ -139,7 +139,7 @@ /* Copy neighbout for reachability confirmation */ dst_prev->neighbour = neigh_clone(rt->u.dst.neighbour); dst_prev->input = rt->u.dst.input; - dst_prev->output = dst_prev->xfrm->type->output; + dst_prev->output = xfrm4_output; if (rt->peer) atomic_inc(&rt->peer->refcnt); x->u.rt.peer = rt->peer; diff -Nru a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c --- a/net/ipv4/xfrm4_tunnel.c 2004-07-13 12:24:00 -07:00 +++ b/net/ipv4/xfrm4_tunnel.c 2004-07-13 12:24:00 -07:00 @@ -36,52 +36,13 @@ static int ipip_output(struct sk_buff **pskb) { struct sk_buff *skb = *pskb; - struct dst_entry *dst = skb->dst; - struct xfrm_state *x = dst->xfrm; - struct iphdr *iph, *top_iph; - int tos, err; - - if ((err = xfrm4_tunnel_check_size(skb)) != 0) - goto error_nolock; - + struct iphdr *iph; + iph = skb->nh.iph; + iph->tot_len = htons(skb->len); + ip_send_check(iph); - spin_lock_bh(&x->lock); - - tos = iph->tos; - - top_iph = (struct iphdr *) skb_push(skb, x->props.header_len); - top_iph->ihl = 5; - top_iph->version = 4; - top_iph->tos = INET_ECN_encapsulate(tos, iph->tos); - top_iph->tot_len = htons(skb->len); - top_iph->frag_off = iph->frag_off & ~htons(IP_MF|IP_OFFSET); - if (!(iph->frag_off & htons(IP_DF))) - __ip_select_ident(top_iph, dst, 0); - top_iph->ttl = iph->ttl; - top_iph->protocol = IPPROTO_IPIP; - top_iph->check = 0; - top_iph->saddr = x->props.saddr.a4; - top_iph->daddr = x->id.daddr.a4; - memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); - ip_send_check(top_iph); - - skb->nh.raw = skb->data; - x->curlft.bytes += skb->len; - x->curlft.packets++; - - spin_unlock_bh(&x->lock); - - if ((skb->dst = dst_pop(dst)) == NULL) { - kfree_skb(skb); - err = -EHOSTUNREACH; - goto error_nolock; - } - return NET_XMIT_BYPASS; - -error_nolock: - kfree_skb(skb); - return err; + return 0; } static int ipip_xfrm_rcv(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb) diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c --- a/net/ipv6/addrconf.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv6/addrconf.c 2004-07-13 12:24:01 -07:00 @@ -696,7 +696,7 @@ ift = !max_addresses || ipv6_count_addresses(idev) < max_addresses ? ipv6_add_addr(idev, &addr, tmp_plen, - ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK, IFA_F_TEMPORARY) : 0; + ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK, IFA_F_TEMPORARY) : NULL; if (!ift || IS_ERR(ift)) { in6_dev_put(idev); in6_ifa_put(ifp); diff -Nru a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c --- a/net/ipv6/af_inet6.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv6/af_inet6.c 2004-07-13 12:24:01 -07:00 @@ -719,13 +719,13 @@ /* allocate our sock slab caches */ tcp6_sk_cachep = kmem_cache_create("tcp6_sock", sizeof(struct tcp6_sock), 0, - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN, NULL, NULL); udp6_sk_cachep = kmem_cache_create("udp6_sock", sizeof(struct udp6_sock), 0, - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN, NULL, NULL); raw6_sk_cachep = kmem_cache_create("raw6_sock", sizeof(struct raw6_sock), 0, - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN, NULL, NULL); if (!tcp6_sk_cachep || !udp6_sk_cachep || !raw6_sk_cachep) printk(KERN_CRIT "%s: Can't create protocol sock SLAB " "caches!\n", __FUNCTION__); diff -Nru a/net/ipv6/anycast.c b/net/ipv6/anycast.c --- a/net/ipv6/anycast.c 2004-07-13 12:24:00 -07:00 +++ b/net/ipv6/anycast.c 2004-07-13 12:24:00 -07:00 @@ -202,7 +202,7 @@ struct ipv6_ac_socklist *pac, *prev_pac; write_lock_bh(&ipv6_sk_ac_lock); - prev_pac = 0; + prev_pac = NULL; for (pac = np->ipv6_ac_list; pac; pac = pac->acl_next) { if ((ifindex == 0 || pac->acl_ifindex == ifindex) && ipv6_addr_cmp(&pac->acl_addr, addr) == 0) @@ -232,13 +232,13 @@ void ipv6_sock_ac_close(struct sock *sk) { struct ipv6_pinfo *np = inet6_sk(sk); - struct net_device *dev = 0; + struct net_device *dev = NULL; struct ipv6_ac_socklist *pac; int prev_index; write_lock_bh(&ipv6_sk_ac_lock); pac = np->ipv6_ac_list; - np->ipv6_ac_list = 0; + np->ipv6_ac_list = NULL; write_unlock_bh(&ipv6_sk_ac_lock); prev_index = 0; @@ -373,7 +373,7 @@ return -ENODEV; write_lock_bh(&idev->lock); - prev_aca = 0; + prev_aca = NULL; for (aca = idev->ac_list; aca; aca = aca->aca_next) { if (ipv6_addr_cmp(&aca->aca_addr, addr) == 0) break; diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c --- a/net/ipv6/ip6_output.c 2004-07-13 12:24:00 -07:00 +++ b/net/ipv6/ip6_output.c 2004-07-13 12:24:00 -07:00 @@ -561,7 +561,7 @@ err = 0; offset = 0; frag = skb_shinfo(skb)->frag_list; - skb_shinfo(skb)->frag_list = 0; + skb_shinfo(skb)->frag_list = NULL; /* BUILD HEADER */ tmp_hdr = kmalloc(hlen, GFP_ATOMIC); diff -Nru a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c --- a/net/ipv6/ipcomp6.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv6/ipcomp6.c 2004-07-13 12:24:01 -07:00 @@ -123,7 +123,7 @@ int err; struct dst_entry *dst = (*pskb)->dst; struct xfrm_state *x = dst->xfrm; - struct ipv6hdr *tmp_iph = NULL, *iph, *top_iph; + struct ipv6hdr *iph, *top_iph; int hdr_len = 0; struct ipv6_comp_hdr *ipch; struct ipcomp_data *ipcd = x->data; @@ -193,19 +193,11 @@ if ((dlen + sizeof(struct ipv6_comp_hdr)) >= plen) { goto out_ok; } - memcpy(start, scratch, dlen); - pskb_trim(*pskb, hdr_len+dlen); + memcpy(start + sizeof(struct ip_comp_hdr), scratch, dlen); + pskb_trim(*pskb, hdr_len + dlen + sizeof(struct ip_comp_hdr)); /* insert ipcomp header and replace datagram */ - tmp_iph = kmalloc(hdr_len, GFP_ATOMIC); - if (!tmp_iph) { - err = -ENOMEM; - goto error; - } - memcpy(tmp_iph, (*pskb)->nh.raw, hdr_len); - top_iph = (struct ipv6hdr*)skb_push(*pskb, sizeof(struct ipv6_comp_hdr)); - memcpy(top_iph, tmp_iph, hdr_len); - kfree(tmp_iph); + top_iph = (*pskb)->nh.ipv6h; if (x->props.mode && (x->props.flags & XFRM_STATE_NOECN)) IP6_ECN_clear(top_iph); @@ -358,7 +350,7 @@ goto error; memset(ipcd, 0, sizeof(*ipcd)); - x->props.header_len = sizeof(struct ipv6_comp_hdr); + x->props.header_len = 0; if (x->props.mode) x->props.header_len += sizeof(struct ipv6hdr); diff -Nru a/net/ipv6/mcast.c b/net/ipv6/mcast.c --- a/net/ipv6/mcast.c 2004-07-13 12:24:01 -07:00 +++ b/net/ipv6/mcast.c 2004-07-13 12:24:01 -07:00 @@ -210,7 +210,7 @@ mc_lst->ifindex = dev->ifindex; mc_lst->sfmode = MCAST_EXCLUDE; - mc_lst->sflist = 0; + mc_lst->sflist = NULL; /* * now add/increase the group membership on the device @@ -272,8 +272,8 @@ struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex) { - struct net_device *dev = 0; - struct inet6_dev *idev = 0; + struct net_device *dev = NULL; + struct inet6_dev *idev = NULL; if (ifindex == 0) { struct rt6_info *rt; @@ -288,18 +288,18 @@ dev = dev_get_by_index(ifindex); if (!dev) - return 0; + return NULL; idev = in6_dev_get(dev); if (!idev) { dev_put(dev); - return 0; + return NULL; } read_lock_bh(&idev->lock); if (idev->dead) { read_unlock_bh(&idev->lock); in6_dev_put(idev); dev_put(dev); - return 0; + return NULL; } return idev; } @@ -378,8 +378,8 @@ goto done; } else if (pmc->sfmode != omode) { /* allow mode switches for empty-set filters */ - ip6_mc_add_src(idev, group, omode, 0, 0, 0); - ip6_mc_del_src(idev, group, pmc->sfmode, 0, 0, 0); + ip6_mc_add_src(idev, group, omode, 0, NULL, 0); + ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0); pmc->sfmode = omode; } @@ -509,14 +509,14 @@ goto done; } } else - newpsl = 0; + newpsl = NULL; psl = pmc->sflist; if (psl) { (void) ip6_mc_del_src(idev, group, pmc->sfmode, psl->sl_count, psl->sl_addr, 0); sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max)); } else - (void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, 0, 0); + (void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0); pmc->sflist = newpsl; pmc->sfmode = gsf->gf_fmode; done: @@ -718,7 +718,7 @@ pmc->mca_tomb = im->mca_tomb; pmc->mca_sources = im->mca_sources; - im->mca_tomb = im->mca_sources = 0; + im->mca_tomb = im->mca_sources = NULL; for (psf=pmc->mca_sources; psf; psf=psf->sf_next) psf->sf_crcount = pmc->mca_crcount; } @@ -736,7 +736,7 @@ struct ip6_sf_list *psf, *psf_next; write_lock_bh(&idev->mc_lock); - pmc_prev = 0; + pmc_prev = NULL; for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) { if (ipv6_addr_cmp(&pmc->mca_addr, pmca) == 0) break; @@ -765,7 +765,7 @@ write_lock_bh(&idev->mc_lock); pmc = idev->mc_tomb; - idev->mc_tomb = 0; + idev->mc_tomb = NULL; write_unlock_bh(&idev->mc_lock); for (; pmc; pmc = nextpmc) { @@ -782,7 +782,7 @@ spin_lock_bh(&pmc->mca_lock); psf = pmc->mca_tomb; - pmc->mca_tomb = 0; + pmc->mca_tomb = NULL; spin_unlock_bh(&pmc->mca_lock); for (; psf; psf=psf_next) { psf_next = psf->sf_next; @@ -818,7 +818,7 @@ mc->mca_users++; write_unlock_bh(&idev->lock); ip6_mc_add_src(idev, &mc->mca_addr, MCAST_EXCLUDE, 0, - 0, 0); + NULL, 0); in6_dev_put(idev); return 0; } @@ -1274,7 +1274,7 @@ skb = sock_alloc_send_skb(sk, size + LL_RESERVED_SPACE(dev), 1, &err); if (skb == 0) - return 0; + return NULL; skb_reserve(skb, LL_RESERVED_SPACE(dev)); if (dev->hard_header) { @@ -1283,7 +1283,7 @@ ndisc_mc_map(&mld2_all_mcr, ha, dev, 1); if (dev->hard_header(skb, dev, ETH_P_IPV6,ha,NULL,size) < 0) { kfree_skb(skb); - return 0; + return NULL; } } @@ -1352,7 +1352,7 @@ if (!skb) skb = mld_newpack(dev, dev->mtu); if (!skb) - return 0; + return NULL; pgr = (struct mld2_grec *)skb_put(skb, sizeof(struct mld2_grec)); pgr->grec_type = type; pgr->grec_auxwords = 0; @@ -1372,7 +1372,7 @@ { struct net_device *dev = pmc->idev->dev; struct mld2_report *pmr; - struct mld2_grec *pgr = 0; + struct mld2_grec *pgr = NULL; struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list; int scount, first, isquery, truncate; @@ -1397,13 +1397,13 @@ if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)+ sizeof(struct in6_addr)) { mld_sendpack(skb); - skb = 0; /* add_grhead will get a new one */ + skb = NULL; /* add_grhead will get a new one */ } skb = add_grhead(skb, pmc, type, &pgr); } return skb; } - pmr = skb ? (struct mld2_report *)skb->h.raw : 0; + pmr = skb ? (struct mld2_report *)skb->h.raw : NULL; /* EX and TO_EX get a fresh packet, if needed */ if (truncate) { @@ -1416,7 +1416,7 @@ } first = 1; scount = 0; - psf_prev = 0; + psf_prev = NULL; for (psf=*psf_list; psf; psf=psf_next) { struct in6_addr *psrc; @@ -1474,7 +1474,7 @@ static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc) { - struct sk_buff *skb = 0; + struct sk_buff *skb = NULL; int type; if (!pmc) { @@ -1511,7 +1511,7 @@ { struct ip6_sf_list *psf_prev, *psf_next, *psf; - psf_prev = 0; + psf_prev = NULL; for (psf=*ppsf; psf; psf = psf_next) { psf_next = psf->sf_next; if (psf->sf_crcount == 0) { @@ -1528,14 +1528,14 @@ static void mld_send_cr(struct inet6_dev *idev) { struct ifmcaddr6 *pmc, *pmc_prev, *pmc_next; - struct sk_buff *skb = 0; + struct sk_buff *skb = NULL; int type, dtype; read_lock_bh(&idev->lock); write_lock_bh(&idev->mc_lock); /* deleted MCA's */ - pmc_prev = 0; + pmc_prev = NULL; for (pmc=idev->mc_tomb; pmc; pmc=pmc_next) { pmc_next = pmc->next; if (pmc->mca_sfmode == MCAST_INCLUDE) { @@ -1691,7 +1691,7 @@ struct ip6_sf_list *psf, *psf_prev; int rv = 0; - psf_prev = 0; + psf_prev = NULL; for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { if (ipv6_addr_cmp(&psf->sf_addr, psfsrc) == 0) break; @@ -1786,7 +1786,7 @@ { struct ip6_sf_list *psf, *psf_prev; - psf_prev = 0; + psf_prev = NULL; for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { if (ipv6_addr_cmp(&psf->sf_addr, psfsrc) == 0) break; @@ -1914,12 +1914,12 @@ nextpsf = psf->sf_next; kfree(psf); } - pmc->mca_tomb = 0; + pmc->mca_tomb = NULL; for (psf=pmc->mca_sources; psf; psf=nextpsf) { nextpsf = psf->sf_next; kfree(psf); } - pmc->mca_sources = 0; + pmc->mca_sources = NULL; pmc->mca_sfmode = MCAST_EXCLUDE; pmc->mca_sfcount[MCAST_EXCLUDE] = 0; pmc->mca_sfcount[MCAST_EXCLUDE] = 1; @@ -1956,12 +1956,12 @@ if (iml->sflist == 0) { /* any-source empty exclude case */ - return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, 0, 0); + return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0); } err = ip6_mc_del_src(idev, &iml->addr, iml->sfmode, iml->sflist->sl_count, iml->sflist->sl_addr, 0); sock_kfree_s(sk, iml->sflist, IP6_SFLSIZE(iml->sflist->sl_max)); - iml->sflist = 0; + iml->sflist = NULL; return err; } @@ -1982,7 +1982,7 @@ struct inet6_dev *idev = (struct inet6_dev *)data; idev->mc_gq_running = 0; - mld_send_report(idev, 0); + mld_send_report(idev, NULL); __in6_dev_put(idev); } @@ -2074,7 +2074,7 @@ init_timer(&idev->mc_gq_timer); idev->mc_gq_timer.data = (unsigned long) idev; idev->mc_gq_timer.function = &mld_gq_timer_expire; - idev->mc_tomb = 0; + idev->mc_tomb = NULL; idev->mc_ifc_count = 0; init_timer(&idev->mc_ifc_timer); idev->mc_ifc_timer.data = (unsigned long) idev; diff -Nru a/net/irda/discovery.c b/net/irda/discovery.c --- a/net/irda/discovery.c 2004-07-13 12:24:00 -07:00 +++ b/net/irda/discovery.c 2004-07-13 12:24:00 -07:00 @@ -449,6 +449,6 @@ .open = discovery_seq_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release_private, + .release = seq_release, }; #endif diff -Nru a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c --- a/net/irda/ircomm/ircomm_core.c 2004-07-13 12:24:02 -07:00 +++ b/net/irda/ircomm/ircomm_core.c 2004-07-13 12:24:02 -07:00 @@ -62,7 +62,7 @@ .open = ircomm_seq_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release_private, + .release = seq_release, }; #endif /* CONFIG_PROC_FS */ diff -Nru a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c --- a/net/irda/ircomm/ircomm_tty.c 2004-07-13 12:24:00 -07:00 +++ b/net/irda/ircomm/ircomm_tty.c 2004-07-13 12:24:00 -07:00 @@ -561,7 +561,7 @@ tty->ldisc.flush_buffer(tty); tty->closing = 0; - self->tty = 0; + self->tty = NULL; if (self->blocked_open) { if (self->close_delay) { @@ -1045,7 +1045,7 @@ /* I guess we need to lock here - Jean II */ spin_lock_irqsave(&self->spinlock, flags); self->flags &= ~ASYNC_NORMAL_ACTIVE; - self->tty = 0; + self->tty = NULL; self->open_count = 0; spin_unlock_irqrestore(&self->spinlock, flags); diff -Nru a/net/irda/iriap.c b/net/irda/iriap.c --- a/net/irda/iriap.c 2004-07-13 12:24:00 -07:00 +++ b/net/irda/iriap.c 2004-07-13 12:24:00 -07:00 @@ -1093,7 +1093,7 @@ .open = irias_seq_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release_private, + .release = seq_release, }; #endif /* PROC_FS */ diff -Nru a/net/irda/irlmp.c b/net/irda/irlmp.c --- a/net/irda/irlmp.c 2004-07-13 12:24:01 -07:00 +++ b/net/irda/irlmp.c 2004-07-13 12:24:01 -07:00 @@ -1491,7 +1491,7 @@ service = kmalloc(sizeof(irlmp_service_t), GFP_ATOMIC); if (!service) { IRDA_DEBUG(1, "%s(), Unable to kmalloc!\n", __FUNCTION__); - return 0; + return NULL; } service->hints.word = hints; hashbin_insert(irlmp->services, (irda_queue_t *) service, @@ -1561,13 +1561,13 @@ irlmp_client_t *client; IRDA_DEBUG(1, "%s()\n", __FUNCTION__); - ASSERT(irlmp != NULL, return 0;); + ASSERT(irlmp != NULL, return NULL;); /* Make a new registration */ client = kmalloc(sizeof(irlmp_client_t), GFP_ATOMIC); if (!client) { IRDA_DEBUG( 1, "%s(), Unable to kmalloc!\n", __FUNCTION__); - return 0; + return NULL; } /* Register the details */ diff -Nru a/net/rxrpc/call.c b/net/rxrpc/call.c --- a/net/rxrpc/call.c 2004-07-13 12:24:01 -07:00 +++ b/net/rxrpc/call.c 2004-07-13 12:24:01 -07:00 @@ -471,7 +471,7 @@ rxrpc_seq_t seq) { struct rxrpc_message *msg; - struct iovec diov[3]; + struct kvec diov[3]; unsigned aux[4]; int delta, ret; @@ -717,7 +717,7 @@ /* send a special ACK if one is required */ if (special_ACK) { struct rxrpc_ackpacket ack; - struct iovec diov[2]; + struct kvec diov[2]; uint8_t acks[1] = { RXRPC_ACK_TYPE_ACK }; /* fill out the appropriate form */ @@ -838,7 +838,7 @@ { struct rxrpc_connection *conn = call->conn; struct rxrpc_message *msg; - struct iovec diov[1]; + struct kvec diov[1]; int ret; u32 _error; @@ -1919,14 +1919,14 @@ */ int rxrpc_call_write_data(struct rxrpc_call *call, size_t sioc, - struct iovec siov[], + struct kvec *siov, u8 rxhdr_flags, int alloc_flags, int dup_data, size_t *size_sent) { struct rxrpc_message *msg; - struct iovec *sptr; + struct kvec *sptr; size_t space, size, chunk, tmp; char *buf; int ret; diff -Nru a/net/rxrpc/connection.c b/net/rxrpc/connection.c --- a/net/rxrpc/connection.c 2004-07-13 12:24:01 -07:00 +++ b/net/rxrpc/connection.c 2004-07-13 12:24:01 -07:00 @@ -518,7 +518,7 @@ struct rxrpc_call *call, uint8_t type, int dcount, - struct iovec diov[], + struct kvec diov[], int alloc_flags, struct rxrpc_message **_msg) { @@ -634,7 +634,11 @@ /* set up the message to be transmitted */ msghdr.msg_name = &conn->addr; msghdr.msg_namelen = sizeof(conn->addr); - msghdr.msg_iov = msg->data; + /* + * the following is safe, since for compiler definitions of kvec and + * iovec are identical, yielding the same in-core layout and alignment + */ + msghdr.msg_iov = (struct iovec *)msg->data; msghdr.msg_iovlen = msg->dcount; msghdr.msg_control = NULL; msghdr.msg_controllen = 0; diff -Nru a/net/rxrpc/transport.c b/net/rxrpc/transport.c --- a/net/rxrpc/transport.c 2004-07-13 12:24:01 -07:00 +++ b/net/rxrpc/transport.c 2004-07-13 12:24:01 -07:00 @@ -611,7 +611,7 @@ struct rxrpc_header ahdr; struct sockaddr_in sin; struct msghdr msghdr; - struct iovec iov[2]; + struct kvec iov[2]; mm_segment_t oldfs; uint32_t _error; int len, ret; @@ -649,7 +649,11 @@ msghdr.msg_name = &sin; msghdr.msg_namelen = sizeof(sin); - msghdr.msg_iov = iov; + /* + * the following is safe, since for compiler definitions of kvec and + * iovec are identical, yielding the same in-core layout and alignment + */ + msghdr.msg_iov = (struct iovec *)iov; msghdr.msg_iovlen = 2; msghdr.msg_control = NULL; msghdr.msg_controllen = 0; diff -Nru a/net/sched/Kconfig b/net/sched/Kconfig --- a/net/sched/Kconfig 2004-07-13 12:24:01 -07:00 +++ b/net/sched/Kconfig 2004-07-13 12:24:01 -07:00 @@ -49,21 +49,6 @@ To compile this code as a module, choose M here: the module will be called sch_hfsc. -config NET_SCH_CSZ - tristate "CSZ packet scheduler" - depends on NET_SCHED - ---help--- - Say Y here if you want to use the Clark-Shenker-Zhang (CSZ) packet - scheduling algorithm for some of your network devices. At the - moment, this is the only algorithm that can guarantee service for - real-time applications (see the top of - for details and references about the algorithm). - - Note: this scheduler is currently broken. - - To compile this code as a module, choose M here: the - module will be called sch_csz. - #tristate ' H-PFQ packet scheduler' CONFIG_NET_SCH_HPFQ config NET_SCH_ATM tristate "ATM pseudo-scheduler" diff -Nru a/net/sched/Makefile b/net/sched/Makefile --- a/net/sched/Makefile 2004-07-13 12:24:01 -07:00 +++ b/net/sched/Makefile 2004-07-13 12:24:01 -07:00 @@ -12,7 +12,6 @@ obj-$(CONFIG_NET_CLS_POLICE) += police.o obj-$(CONFIG_NET_SCH_CBQ) += sch_cbq.o obj-$(CONFIG_NET_SCH_HTB) += sch_htb.o -obj-$(CONFIG_NET_SCH_CSZ) += sch_csz.o obj-$(CONFIG_NET_SCH_HPFQ) += sch_hpfq.o obj-$(CONFIG_NET_SCH_HFSC) += sch_hfsc.o obj-$(CONFIG_NET_SCH_RED) += sch_red.o diff -Nru a/net/sched/sch_csz.c b/net/sched/sch_csz.c --- a/net/sched/sch_csz.c 2004-07-13 12:24:01 -07:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,1055 +0,0 @@ -/* - * net/sched/sch_csz.c Clark-Shenker-Zhang scheduler. - * - * 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. - * - * Authors: Alexey Kuznetsov, - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Clark-Shenker-Zhang algorithm. - ======================================= - - SOURCE. - - David D. Clark, Scott Shenker and Lixia Zhang - "Supporting Real-Time Applications in an Integrated Services Packet - Network: Architecture and Mechanism". - - CBQ presents a flexible universal algorithm for packet scheduling, - but it has pretty poor delay characteristics. - Round-robin scheduling and link-sharing goals - apparently contradict minimization of network delay and jitter. - Moreover, correct handling of predictive flows seems to be - impossible in CBQ. - - CSZ presents a more precise but less flexible and less efficient - approach. As I understand it, the main idea is to create - WFQ flows for each guaranteed service and to allocate - the rest of bandwidth to dummy flow-0. Flow-0 comprises - the predictive services and the best effort traffic; - it is handled by a priority scheduler with the highest - priority band allocated for predictive services, and the rest --- - to the best effort packets. - - Note that in CSZ flows are NOT limited to their bandwidth. It - is supposed that the flow passed admission control at the edge - of the QoS network and it doesn't need further shaping. Any - attempt to improve the flow or to shape it to a token bucket - at intermediate hops will introduce undesired delays and raise - jitter. - - At the moment CSZ is the only scheduler that provides - true guaranteed service. Another schemes (including CBQ) - do not provide guaranteed delay and randomize jitter. - There is a proof (Sally Floyd), that delay - can be estimated by a IntServ compliant formula. - This result is true formally, but it is wrong in principle. - It takes into account only round-robin delays, - ignoring delays introduced by link sharing i.e. overlimiting. - Note that temporary overlimits are inevitable because - real links are not ideal, and the real algorithm must take this - into account. - - ALGORITHM. - - --- Notations. - - $B$ is link bandwidth (bits/sec). - - $I$ is set of all flows, including flow $0$. - Every flow $a \in I$ has associated bandwidth slice $r_a < 1$ and - $\sum_{a \in I} r_a = 1$. - - --- Flow model. - - Let $m_a$ is the number of backlogged bits in flow $a$. - The flow is {\em active}, if $m_a > 0$. - This number is a discontinuous function of time; - when a packet $i$ arrives: - \[ - m_a(t_i+0) - m_a(t_i-0) = L^i, - \] - where $L^i$ is the length of the arrived packet. - The flow queue is drained continuously until $m_a == 0$: - \[ - {d m_a \over dt} = - { B r_a \over \sum_{b \in A} r_b}. - \] - I.e. flow rates are their allocated rates proportionally - scaled to take all available link bandwidth. Apparently, - it is not the only possible policy. F.e. CBQ classes - without borrowing would be modelled by: - \[ - {d m_a \over dt} = - B r_a . - \] - More complicated hierarchical bandwidth allocation - policies are possible, but unfortunately, the basic - flow equations have a simple solution only for proportional - scaling. - - --- Departure times. - - We calculate the time until the last bit of packet is sent: - \[ - E_a^i(t) = { m_a(t_i) - \delta_a(t) \over r_a }, - \] - where $\delta_a(t)$ is number of bits drained since $t_i$. - We have to evaluate $E_a^i$ for all queued packets, - then find the packet with minimal $E_a^i$ and send it. - - This sounds good, but direct implementation of the algorithm - is absolutely infeasible. Luckily, if flow rates - are scaled proportionally, the equations have a simple solution. - - The differential equation for $E_a^i$ is - \[ - {d E_a^i (t) \over dt } = - { d \delta_a(t) \over dt} { 1 \over r_a} = - { B \over \sum_{b \in A} r_b} - \] - with initial condition - \[ - E_a^i (t_i) = { m_a(t_i) \over r_a } . - \] - - Let's introduce an auxiliary function $R(t)$: - - --- Round number. - - Consider the following model: we rotate over active flows, - sending $r_a B$ bits from every flow, so that we send - $B \sum_{a \in A} r_a$ bits per round, that takes - $\sum_{a \in A} r_a$ seconds. - - Hence, $R(t)$ (round number) is a monotonically increasing - linear function of time when $A$ is not changed - \[ - { d R(t) \over dt } = { 1 \over \sum_{a \in A} r_a } - \] - and it is continuous when $A$ changes. - - The central observation is that the quantity - $F_a^i = R(t) + E_a^i(t)/B$ does not depend on time at all! - $R(t)$ does not depend on flow, so that $F_a^i$ can be - calculated only once on packet arrival, and we need not - recalculate $E$ numbers and resorting queues. - The number $F_a^i$ is called finish number of the packet. - It is just the value of $R(t)$ when the last bit of packet - is sent out. - - Maximal finish number on flow is called finish number of flow - and minimal one is "start number of flow". - Apparently, flow is active if and only if $F_a \leq R$. - - When a packet of length $L_i$ bit arrives to flow $a$ at time $t_i$, - we calculate $F_a^i$ as: - - If flow was inactive ($F_a < R$): - $F_a^i = R(t) + {L_i \over B r_a}$ - otherwise - $F_a^i = F_a + {L_i \over B r_a}$ - - These equations complete the algorithm specification. - - It looks pretty hairy, but there is a simple - procedure for solving these equations. - See procedure csz_update(), that is a generalization of - the algorithm from S. Keshav's thesis Chapter 3 - "Efficient Implementation of Fair Queuing". - - NOTES. - - * We implement only the simplest variant of CSZ, - when flow-0 is a explicit 4band priority fifo. - This is bad, but we need a "peek" operation in addition - to "dequeue" to implement complete CSZ. - I do not want to do that, unless it is absolutely - necessary. - - * A primitive support for token bucket filtering - presents itself too. It directly contradicts CSZ, but - even though the Internet is on the globe ... :-) - "the edges of the network" really exist. - - BUGS. - - * Fixed point arithmetic is overcomplicated, suboptimal and even - wrong. Check it later. */ - - -/* This number is arbitrary */ - -#define CSZ_GUARANTEED 16 -#define CSZ_FLOWS (CSZ_GUARANTEED+4) - -struct csz_head -{ - struct csz_head *snext; - struct csz_head *sprev; - struct csz_head *fnext; - struct csz_head *fprev; -}; - -struct csz_flow -{ - struct csz_head *snext; - struct csz_head *sprev; - struct csz_head *fnext; - struct csz_head *fprev; - -/* Parameters */ - struct tc_ratespec rate; - struct tc_ratespec slice; - u32 *L_tab; /* Lookup table for L/(B*r_a) values */ - unsigned long limit; /* Maximal length of queue */ -#ifdef CSZ_PLUS_TBF - struct tc_ratespec peakrate; - __u32 buffer; /* Depth of token bucket, normalized - as L/(B*r_a) */ - __u32 mtu; -#endif - -/* Variables */ -#ifdef CSZ_PLUS_TBF - unsigned long tokens; /* Tokens number: usecs */ - psched_time_t t_tbf; - unsigned long R_tbf; - int throttled; -#endif - unsigned peeked; - unsigned long start; /* Finish number of the first skb */ - unsigned long finish; /* Finish number of the flow */ - - struct sk_buff_head q; /* FIFO queue */ -}; - -#define L2R(f,L) ((f)->L_tab[(L)>>(f)->slice.cell_log]) - -struct csz_sched_data -{ -/* Parameters */ - unsigned char rate_log; /* fixed point position for rate; - * really we need not it */ - unsigned char R_log; /* fixed point position for round number */ - unsigned char delta_log; /* 1< 2.1sec is MAXIMAL value */ - -/* Variables */ - struct tcf_proto *filter_list; - u8 prio2band[TC_PRIO_MAX+1]; -#ifdef CSZ_PLUS_TBF - struct timer_list wd_timer; - long wd_expires; -#endif - psched_time_t t_c; /* Time check-point */ - unsigned long R_c; /* R-number check-point */ - unsigned long rate; /* Current sum of rates of active flows */ - struct csz_head s; /* Flows sorted by "start" */ - struct csz_head f; /* Flows sorted by "finish" */ - - struct sk_buff_head other[4];/* Predicted (0) and the best efforts - classes (1,2,3) */ - struct csz_flow flow[CSZ_GUARANTEED]; /* Array of flows */ -}; - -/* These routines (csz_insert_finish and csz_insert_start) are - the most time consuming part of all the algorithm. - - We insert to sorted list, so that time - is linear with respect to number of active flows in the worst case. - Note that we have not very large number of guaranteed flows, - so that logarithmic algorithms (heap etc.) are useless, - they are slower than linear one when length of list <= 32. - - Heap would take sence if we used WFQ for best efforts - flows, but SFQ is better choice in this case. - */ - - -/* Insert flow "this" to the list "b" before - flow with greater finish number. - */ - -#if 0 -/* Scan forward */ -static inline void csz_insert_finish(struct csz_head *b, - struct csz_flow *this) -{ - struct csz_head *f = b->fnext; - unsigned long finish = this->finish; - - while (f != b) { - if (((struct csz_flow*)f)->finish - finish > 0) - break; - f = f->fnext; - } - this->fnext = f; - this->fprev = f->fprev; - this->fnext->fprev = this->fprev->fnext = (struct csz_head*)this; -} -#else -/* Scan backward */ -static inline void csz_insert_finish(struct csz_head *b, - struct csz_flow *this) -{ - struct csz_head *f = b->fprev; - unsigned long finish = this->finish; - - while (f != b) { - if (((struct csz_flow*)f)->finish - finish <= 0) - break; - f = f->fprev; - } - this->fnext = f->fnext; - this->fprev = f; - this->fnext->fprev = this->fprev->fnext = (struct csz_head*)this; -} -#endif - -/* Insert flow "this" to the list "b" before - flow with greater start number. - */ - -static inline void csz_insert_start(struct csz_head *b, - struct csz_flow *this) -{ - struct csz_head *f = b->snext; - unsigned long start = this->start; - - while (f != b) { - if (((struct csz_flow*)f)->start - start > 0) - break; - f = f->snext; - } - this->snext = f; - this->sprev = f->sprev; - this->snext->sprev = this->sprev->snext = (struct csz_head*)this; -} - - -/* Calculate and return current round number. - It is another time consuming part, but - it is impossible to avoid it. - - It costs O(N) that make all the algorithm useful only - to play with closest to ideal fluid model. - - There exist less academic, but more practical modifications, - which might have even better characteristics (WF2Q+, HPFQ, HFSC) - */ - -static unsigned long csz_update(struct Qdisc *sch) -{ - struct csz_sched_data *q = (struct csz_sched_data*)sch->data; - struct csz_flow *a; - unsigned long F; - unsigned long tmp; - psched_time_t now; - unsigned long delay; - unsigned long R_c; - - PSCHED_GET_TIME(now); - delay = PSCHED_TDIFF(now, q->t_c); - if (delay>>q->delta_log) { - /* Delta is too large. - It is possible if MTU/BW > 1<delta_log - (i.e. configuration error) or because of hardware - fault. We have no choice... - */ - qdisc_reset(sch); - return 0; - } - - q->t_c = now; - - for (;;) { - a = (struct csz_flow*)q->f.fnext; - - /* No more active flows. Reset R and exit. */ - if (a == (struct csz_flow*)&q->f) { -#ifdef CSZ_DEBUG - if (q->rate) { - printk("csz_update: rate!=0 on inactive csz\n"); - q->rate = 0; - } -#endif - q->R_c = 0; - return 0; - } - - F = a->finish; - -#ifdef CSZ_DEBUG - if (q->rate == 0) { - printk("csz_update: rate=0 on active csz\n"); - goto do_reset; - } -#endif - - /* - * tmp = (t - q->t_c)/q->rate; - */ - - tmp = ((delay<<(31-q->delta_log))/q->rate)>>(31-q->delta_log+q->R_log); - - tmp += q->R_c; - - /* OK, this flow (and all flows with greater - finish numbers) is still active */ - if (F - tmp > 0) - break; - - /* It is more not active */ - - a->fprev->fnext = a->fnext; - a->fnext->fprev = a->fprev; - - /* - * q->t_c += (F - q->R_c)*q->rate - */ - - tmp = ((F-q->R_c)*q->rate)<R_log; - R_c = F; - q->rate -= a->slice.rate; - - if ((long)(delay - tmp) >= 0) { - delay -= tmp; - continue; - } - delay = 0; - } - - q->R_c = tmp; - return tmp; -} - -unsigned csz_classify(struct sk_buff *skb, struct csz_sched_data *q) -{ - return CSZ_GUARANTEED; -} - -static int -csz_enqueue(struct sk_buff *skb, struct Qdisc* sch) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - unsigned flow_id = csz_classify(skb, q); - unsigned long R; - int prio = 0; - struct csz_flow *this; - - if (flow_id >= CSZ_GUARANTEED) { - prio = flow_id - CSZ_GUARANTEED; - flow_id = 0; - } - - this = &q->flow[flow_id]; - if (this->q.qlen >= this->limit || this->L_tab == NULL) { - sch->stats.drops++; - kfree_skb(skb); - return NET_XMIT_DROP; - } - - R = csz_update(sch); - - if ((long)(this->finish - R) >= 0) { - /* It was active */ - this->finish += L2R(this,skb->len); - } else { - /* It is inactive; activate it */ - this->finish = R + L2R(this,skb->len); - q->rate += this->slice.rate; - csz_insert_finish(&q->f, this); - } - - /* If this flow was empty, remember start number - and insert it into start queue */ - if (this->q.qlen == 0) { - this->start = this->finish; - csz_insert_start(&q->s, this); - } - if (flow_id) - skb_queue_tail(&this->q, skb); - else - skb_queue_tail(&q->other[prio], skb); - sch->q.qlen++; - sch->stats.bytes += skb->len; - sch->stats.packets++; - return 0; -} - -static __inline__ struct sk_buff * -skb_dequeue_best(struct csz_sched_data * q) -{ - int i; - struct sk_buff *skb; - - for (i=0; i<4; i++) { - skb = skb_dequeue(&q->other[i]); - if (skb) { - q->flow[0].q.qlen--; - return skb; - } - } - return NULL; -} - -static __inline__ struct sk_buff * -skb_peek_best(struct csz_sched_data * q) -{ - int i; - struct sk_buff *skb; - - for (i=0; i<4; i++) { - skb = skb_peek(&q->other[i]); - if (skb) - return skb; - } - return NULL; -} - -#ifdef CSZ_PLUS_TBF - -static void csz_watchdog(unsigned long arg) -{ - struct Qdisc *sch = (struct Qdisc*)arg; - - qdisc_wakeup(sch->dev); -} - -static __inline__ void -csz_move_queue(struct csz_flow *this, long delta) -{ - this->fprev->fnext = this->fnext; - this->fnext->fprev = this->fprev; - - this->start += delta; - this->finish += delta; - - csz_insert_finish(this); -} - -static __inline__ int csz_enough_tokens(struct csz_sched_data *q, - struct csz_flow *this, - struct sk_buff *skb) -{ - long toks; - long shift; - psched_time_t now; - - PSCHED_GET_TIME(now); - - toks = PSCHED_TDIFF(now, t_tbf) + this->tokens - L2R(q,this,skb->len); - - shift = 0; - if (this->throttled) { - /* Remember aposteriory delay */ - - unsigned long R = csz_update(q); - shift = R - this->R_tbf; - this->R_tbf = R; - } - - if (toks >= 0) { - /* Now we have enough tokens to proceed */ - - this->tokens = toks <= this->depth ? toks : this->depth; - this->t_tbf = now; - - if (!this->throttled) - return 1; - - /* Flow was throttled. Update its start&finish numbers - with delay calculated aposteriori. - */ - - this->throttled = 0; - if (shift > 0) - csz_move_queue(this, shift); - return 1; - } - - if (!this->throttled) { - /* Flow has just been throttled; remember - current round number to calculate aposteriori delay - */ - this->throttled = 1; - this->R_tbf = csz_update(q); - } - - /* Move all the queue to the time when it will be allowed to send. - We should translate time to round number, but it is impossible, - so that we made the most conservative estimate i.e. we suppose - that only this flow is active and, hence, R = t. - Really toks <= R <= toks/r_a. - - This apriory shift in R will be adjusted later to reflect - real delay. We cannot avoid it because of: - - throttled flow continues to be active from the viewpoint - of CSZ, so that it would acquire the highest priority, - if you not adjusted start numbers. - - Eventually, finish number would become less than round - number and flow were declared inactive. - */ - - toks = -toks; - - /* Remember, that we should start watchdog */ - if (toks < q->wd_expires) - q->wd_expires = toks; - - toks >>= q->R_log; - shift += toks; - if (shift > 0) { - this->R_tbf += toks; - csz_move_queue(this, shift); - } - csz_insert_start(this); - return 0; -} -#endif - - -static struct sk_buff * -csz_dequeue(struct Qdisc* sch) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - struct sk_buff *skb; - struct csz_flow *this; - -#ifdef CSZ_PLUS_TBF - q->wd_expires = 0; -#endif - this = (struct csz_flow*)q->s.snext; - - while (this != (struct csz_flow*)&q->s) { - - /* First of all: unlink from start list */ - this->sprev->snext = this->snext; - this->snext->sprev = this->sprev; - - if (this != &q->flow[0]) { /* Guaranteed flow */ - skb = __skb_dequeue(&this->q); - if (skb) { -#ifdef CSZ_PLUS_TBF - if (this->depth) { - if (!csz_enough_tokens(q, this, skb)) - continue; - } -#endif - if (this->q.qlen) { - struct sk_buff *nskb = skb_peek(&this->q); - this->start += L2R(this,nskb->len); - csz_insert_start(&q->s, this); - } - sch->q.qlen--; - return skb; - } - } else { /* Predicted or best effort flow */ - skb = skb_dequeue_best(q); - if (skb) { - unsigned peeked = this->peeked; - this->peeked = 0; - - if (--this->q.qlen) { - struct sk_buff *nskb; - unsigned dequeued = L2R(this,skb->len); - - /* We got not the same thing that - peeked earlier; adjust start number - */ - if (peeked != dequeued && peeked) - this->start += dequeued - peeked; - - nskb = skb_peek_best(q); - peeked = L2R(this,nskb->len); - this->start += peeked; - this->peeked = peeked; - csz_insert_start(&q->s, this); - } - sch->q.qlen--; - return skb; - } - } - } -#ifdef CSZ_PLUS_TBF - /* We are about to return no skb. - Schedule watchdog timer, if it occurred because of shaping. - */ - if (q->wd_expires) { - unsigned long delay = PSCHED_US2JIFFIE(q->wd_expires); - if (delay == 0) - delay = 1; - mod_timer(&q->wd_timer, jiffies + delay); - sch->stats.overlimits++; - } -#endif - return NULL; -} - -static void -csz_reset(struct Qdisc* sch) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - int i; - - for (i=0; i<4; i++) - skb_queue_purge(&q->other[i]); - - for (i=0; iflow + i; - skb_queue_purge(&this->q); - this->snext = this->sprev = - this->fnext = this->fprev = (struct csz_head*)this; - this->start = this->finish = 0; - } - q->s.snext = q->s.sprev = &q->s; - q->f.fnext = q->f.fprev = &q->f; - q->R_c = 0; -#ifdef CSZ_PLUS_TBF - PSCHED_GET_TIME(&q->t_tbf); - q->tokens = q->depth; - del_timer(&q->wd_timer); -#endif - sch->q.qlen = 0; -} - -static void -csz_destroy(struct Qdisc* sch) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - struct tcf_proto *tp; - - while ((tp = q->filter_list) != NULL) { - q->filter_list = tp->next; - tcf_destroy(tp); - } -} - -static int csz_init(struct Qdisc *sch, struct rtattr *opt) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - struct rtattr *tb[TCA_CSZ_PTAB]; - struct tc_csz_qopt *qopt; - int i; - - rtattr_parse(tb, TCA_CSZ_PTAB, RTA_DATA(opt), RTA_PAYLOAD(opt)); - if (tb[TCA_CSZ_PARMS-1] == NULL || - RTA_PAYLOAD(tb[TCA_CSZ_PARMS-1]) < sizeof(*qopt)) - return -EINVAL; - qopt = RTA_DATA(tb[TCA_CSZ_PARMS-1]); - - q->R_log = qopt->R_log; - q->delta_log = qopt->delta_log; - for (i=0; i<=TC_PRIO_MAX; i++) { - if (qopt->priomap[i] >= CSZ_FLOWS) - return -EINVAL; - q->prio2band[i] = qopt->priomap[i]; - } - - for (i=0; i<4; i++) - skb_queue_head_init(&q->other[i]); - - for (i=0; iflow + i; - skb_queue_head_init(&this->q); - this->snext = this->sprev = - this->fnext = this->fprev = (struct csz_head*)this; - this->start = this->finish = 0; - } - q->s.snext = q->s.sprev = &q->s; - q->f.fnext = q->f.fprev = &q->f; - q->R_c = 0; -#ifdef CSZ_PLUS_TBF - init_timer(&q->wd_timer); - q->wd_timer.data = (unsigned long)sch; - q->wd_timer.function = csz_watchdog; -#endif - return 0; -} - -static int csz_dump(struct Qdisc *sch, struct sk_buff *skb) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - unsigned char *b = skb->tail; - struct rtattr *rta; - struct tc_csz_qopt opt; - - rta = (struct rtattr*)b; - RTA_PUT(skb, TCA_OPTIONS, 0, NULL); - - opt.flows = CSZ_FLOWS; - memcpy(&opt.priomap, q->prio2band, TC_PRIO_MAX+1); - RTA_PUT(skb, TCA_CSZ_PARMS, sizeof(opt), &opt); - rta->rta_len = skb->tail - b; - - return skb->len; - -rtattr_failure: - skb_trim(skb, b - skb->data); - return -1; -} - -static int csz_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new, - struct Qdisc **old) -{ - return -EINVAL; -} - -static struct Qdisc * csz_leaf(struct Qdisc *sch, unsigned long cl) -{ - return NULL; -} - - -static unsigned long csz_get(struct Qdisc *sch, u32 classid) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - unsigned long band = TC_H_MIN(classid) - 1; - - if (band >= CSZ_FLOWS) - return 0; - - if (band < CSZ_GUARANTEED && q->flow[band].L_tab == NULL) - return 0; - - return band+1; -} - -static unsigned long csz_bind(struct Qdisc *sch, unsigned long parent, u32 classid) -{ - return csz_get(sch, classid); -} - - -static void csz_put(struct Qdisc *sch, unsigned long cl) -{ - return; -} - -static int csz_change(struct Qdisc *sch, u32 handle, u32 parent, struct rtattr **tca, unsigned long *arg) -{ - unsigned long cl = *arg; - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - struct rtattr *opt = tca[TCA_OPTIONS-1]; - struct rtattr *tb[TCA_CSZ_PTAB]; - struct tc_csz_copt *copt; - - rtattr_parse(tb, TCA_CSZ_PTAB, RTA_DATA(opt), RTA_PAYLOAD(opt)); - if (tb[TCA_CSZ_PARMS-1] == NULL || - RTA_PAYLOAD(tb[TCA_CSZ_PARMS-1]) < sizeof(*copt)) - return -EINVAL; - copt = RTA_DATA(tb[TCA_CSZ_PARMS-1]); - - if (tb[TCA_CSZ_RTAB-1] && - RTA_PAYLOAD(tb[TCA_CSZ_RTAB-1]) < 1024) - return -EINVAL; - - if (cl) { - struct csz_flow *a; - cl--; - if (cl >= CSZ_FLOWS) - return -ENOENT; - if (cl >= CSZ_GUARANTEED || q->flow[cl].L_tab == NULL) - return -EINVAL; - - a = &q->flow[cl]; - - spin_lock_bh(&sch->dev->queue_lock); -#if 0 - a->rate_log = copt->rate_log; -#endif -#ifdef CSZ_PLUS_TBF - a->limit = copt->limit; - a->rate = copt->rate; - a->buffer = copt->buffer; - a->mtu = copt->mtu; -#endif - - if (tb[TCA_CSZ_RTAB-1]) - memcpy(a->L_tab, RTA_DATA(tb[TCA_CSZ_RTAB-1]), 1024); - - spin_unlock_bh(&sch->dev->queue_lock); - return 0; - } - /* NI */ - return 0; -} - -static int csz_delete(struct Qdisc *sch, unsigned long cl) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - struct csz_flow *a; - - cl--; - - if (cl >= CSZ_FLOWS) - return -ENOENT; - if (cl >= CSZ_GUARANTEED || q->flow[cl].L_tab == NULL) - return -EINVAL; - - a = &q->flow[cl]; - - spin_lock_bh(&sch->dev->queue_lock); - a->fprev->fnext = a->fnext; - a->fnext->fprev = a->fprev; - a->sprev->snext = a->snext; - a->snext->sprev = a->sprev; - a->start = a->finish = 0; - kfree(xchg(&q->flow[cl].L_tab, NULL)); - spin_unlock_bh(&sch->dev->queue_lock); - - return 0; -} - -static int csz_dump_class(struct Qdisc *sch, unsigned long cl, struct sk_buff *skb, struct tcmsg *tcm) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - unsigned char *b = skb->tail; - struct rtattr *rta; - struct tc_csz_copt opt; - - tcm->tcm_handle = sch->handle|cl; - - cl--; - - if (cl > CSZ_FLOWS) - goto rtattr_failure; - - if (cl < CSZ_GUARANTEED) { - struct csz_flow *f = &q->flow[cl]; - - if (f->L_tab == NULL) - goto rtattr_failure; - - rta = (struct rtattr*)b; - RTA_PUT(skb, TCA_OPTIONS, 0, NULL); - - opt.limit = f->limit; - opt.rate = f->rate; - opt.slice = f->slice; - memset(&opt.peakrate, 0, sizeof(opt.peakrate)); -#ifdef CSZ_PLUS_TBF - opt.buffer = f->buffer; - opt.mtu = f->mtu; -#else - opt.buffer = 0; - opt.mtu = 0; -#endif - - RTA_PUT(skb, TCA_CSZ_PARMS, sizeof(opt), &opt); - rta->rta_len = skb->tail - b; - } - - return skb->len; - -rtattr_failure: - skb_trim(skb, b - skb->data); - return -1; -} - -static void csz_walk(struct Qdisc *sch, struct qdisc_walker *arg) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - int prio = 0; - - if (arg->stop) - return; - - for (prio = 0; prio < CSZ_FLOWS; prio++) { - if (arg->count < arg->skip) { - arg->count++; - continue; - } - if (prio < CSZ_GUARANTEED && q->flow[prio].L_tab == NULL) { - arg->count++; - continue; - } - if (arg->fn(sch, prio+1, arg) < 0) { - arg->stop = 1; - break; - } - arg->count++; - } -} - -static struct tcf_proto ** csz_find_tcf(struct Qdisc *sch, unsigned long cl) -{ - struct csz_sched_data *q = (struct csz_sched_data *)sch->data; - - if (cl) - return NULL; - - return &q->filter_list; -} - -struct Qdisc_class_ops csz_class_ops = { - .graft = csz_graft, - .leaf = csz_leaf, - .get = csz_get, - .put = csz_put, - .change = csz_change, - .delete = csz_delete, - .walk = csz_walk, - .tcf_chain = csz_find_tcf, - .bind_tcf = csz_bind, - .unbind_tcf = csz_put, - .dump = csz_dump_class, -}; - -static struct Qdisc_ops csz_qdisc_ops = { - .next = NULL, - .cl_ops = &csz_class_ops, - .id = "csz", - .priv_size = sizeof(struct csz_sched_data), - .enqueue = csz_enqueue, - .dequeue = csz_dequeue, - .requeue = NULL, - .drop = NULL, - .init = csz_init, - .reset = csz_reset, - .destroy = csz_destroy, - .change = NULL, - .dump = csz_dump, - .owner = THIS_MODULE, -}; - -static int __init csz_module_init(void) -{ - return register_qdisc(&csz_qdisc_ops); -} -static void __exit csz_module_exit(void) -{ - unregister_qdisc(&csz_qdisc_ops); -} -module_init(csz_module_init) -module_exit(csz_module_exit) -MODULE_LICENSE("GPL"); diff -Nru a/net/sched/sch_netem.c b/net/sched/sch_netem.c --- a/net/sched/sch_netem.c 2004-07-13 12:24:01 -07:00 +++ b/net/sched/sch_netem.c 2004-07-13 12:24:01 -07:00 @@ -29,14 +29,16 @@ */ struct netem_sched_data { - struct sk_buff_head qnormal; - struct sk_buff_head qdelay; + struct Qdisc *qdisc; + struct sk_buff_head delayed; struct timer_list timer; u32 latency; u32 loss; + u32 limit; u32 counter; u32 gap; + u32 jitter; }; /* Time stamp put into socket buffer control block */ @@ -44,6 +46,558 @@ psched_time_t time_to_send; }; +/* This is the distribution table for the normal distribution produced + * with NISTnet tools. + * The entries represent a scaled inverse of the cumulative distribution + * function. + */ +#define TABLESIZE 2048 +#define TABLEFACTOR 8192 + +static const short disttable[TABLESIZE] = { + -31473, -26739, -25226, -24269, + -23560, -22993, -22518, -22109, + -21749, -21426, -21133, -20865, + -20618, -20389, -20174, -19972, + -19782, -19601, -19430, -19267, + -19112, -18962, -18819, -18681, + -18549, -18421, -18298, -18178, + -18062, -17950, -17841, -17735, + -17632, -17532, -17434, -17339, + -17245, -17155, -17066, -16979, + -16894, -16811, -16729, -16649, + -16571, -16494, -16419, -16345, + -16272, -16201, -16130, -16061, + -15993, -15926, -15861, -15796, + -15732, -15669, -15607, -15546, + -15486, -15426, -15368, -15310, + -15253, -15196, -15140, -15086, + -15031, -14977, -14925, -14872, + -14821, -14769, -14719, -14669, + -14619, -14570, -14522, -14473, + -14426, -14379, -14332, -14286, + -14241, -14196, -14150, -14106, + -14062, -14019, -13976, -13933, + -13890, -13848, -13807, -13765, + -13724, -13684, -13643, -13604, + -13564, -13525, -13486, -13447, + -13408, -13370, -13332, -13295, + -13258, -13221, -13184, -13147, + -13111, -13075, -13040, -13004, + -12969, -12934, -12899, -12865, + -12830, -12796, -12762, -12729, + -12695, -12662, -12629, -12596, + -12564, -12531, -12499, -12467, + -12435, -12404, -12372, -12341, + -12310, -12279, -12248, -12218, + -12187, -12157, -12127, -12097, + -12067, -12038, -12008, -11979, + -11950, -11921, -11892, -11863, + -11835, -11806, -11778, -11750, + -11722, -11694, -11666, -11639, + -11611, -11584, -11557, -11530, + -11503, -11476, -11450, -11423, + -11396, -11370, -11344, -11318, + -11292, -11266, -11240, -11214, + -11189, -11164, -11138, -11113, + -11088, -11063, -11038, -11013, + -10988, -10964, -10939, -10915, + -10891, -10866, -10843, -10818, + -10794, -10770, -10747, -10723, + -10700, -10676, -10652, -10630, + -10606, -10583, -10560, -10537, + -10514, -10491, -10469, -10446, + -10424, -10401, -10378, -10356, + -10334, -10312, -10290, -10267, + -10246, -10224, -10202, -10180, + -10158, -10137, -10115, -10094, + -10072, -10051, -10030, -10009, + -9988, -9967, -9945, -9925, + -9904, -9883, -9862, -9842, + -9821, -9800, -9780, -9760, + -9739, -9719, -9699, -9678, + -9658, -9638, -9618, -9599, + -9578, -9559, -9539, -9519, + -9499, -9480, -9461, -9441, + -9422, -9402, -9383, -9363, + -9344, -9325, -9306, -9287, + -9268, -9249, -9230, -9211, + -9192, -9173, -9155, -9136, + -9117, -9098, -9080, -9062, + -9043, -9025, -9006, -8988, + -8970, -8951, -8933, -8915, + -8897, -8879, -8861, -8843, + -8825, -8807, -8789, -8772, + -8754, -8736, -8718, -8701, + -8683, -8665, -8648, -8630, + -8613, -8595, -8578, -8561, + -8543, -8526, -8509, -8492, + -8475, -8458, -8441, -8423, + -8407, -8390, -8373, -8356, + -8339, -8322, -8305, -8289, + -8272, -8255, -8239, -8222, + -8206, -8189, -8172, -8156, + -8140, -8123, -8107, -8090, + -8074, -8058, -8042, -8025, + -8009, -7993, -7977, -7961, + -7945, -7929, -7913, -7897, + -7881, -7865, -7849, -7833, + -7817, -7802, -7786, -7770, + -7754, -7739, -7723, -7707, + -7692, -7676, -7661, -7645, + -7630, -7614, -7599, -7583, + -7568, -7553, -7537, -7522, + -7507, -7492, -7476, -7461, + -7446, -7431, -7416, -7401, + -7385, -7370, -7356, -7340, + -7325, -7311, -7296, -7281, + -7266, -7251, -7236, -7221, + -7207, -7192, -7177, -7162, + -7148, -7133, -7118, -7104, + -7089, -7075, -7060, -7046, + -7031, -7016, -7002, -6988, + -6973, -6959, -6944, -6930, + -6916, -6901, -6887, -6873, + -6859, -6844, -6830, -6816, + -6802, -6788, -6774, -6760, + -6746, -6731, -6717, -6704, + -6690, -6675, -6661, -6647, + -6633, -6620, -6606, -6592, + -6578, -6564, -6550, -6537, + -6523, -6509, -6495, -6482, + -6468, -6454, -6441, -6427, + -6413, -6400, -6386, -6373, + -6359, -6346, -6332, -6318, + -6305, -6291, -6278, -6264, + -6251, -6238, -6224, -6211, + -6198, -6184, -6171, -6158, + -6144, -6131, -6118, -6105, + -6091, -6078, -6065, -6052, + -6039, -6025, -6012, -5999, + -5986, -5973, -5960, -5947, + -5934, -5921, -5908, -5895, + -5882, -5869, -5856, -5843, + -5830, -5817, -5804, -5791, + -5779, -5766, -5753, -5740, + -5727, -5714, -5702, -5689, + -5676, -5663, -5650, -5638, + -5625, -5612, -5600, -5587, + -5575, -5562, -5549, -5537, + -5524, -5512, -5499, -5486, + -5474, -5461, -5449, -5436, + -5424, -5411, -5399, -5386, + -5374, -5362, -5349, -5337, + -5324, -5312, -5299, -5287, + -5275, -5263, -5250, -5238, + -5226, -5213, -5201, -5189, + -5177, -5164, -5152, -5140, + -5128, -5115, -5103, -5091, + -5079, -5067, -5055, -5043, + -5030, -5018, -5006, -4994, + -4982, -4970, -4958, -4946, + -4934, -4922, -4910, -4898, + -4886, -4874, -4862, -4850, + -4838, -4826, -4814, -4803, + -4791, -4778, -4767, -4755, + -4743, -4731, -4719, -4708, + -4696, -4684, -4672, -4660, + -4649, -4637, -4625, -4613, + -4601, -4590, -4578, -4566, + -4554, -4543, -4531, -4520, + -4508, -4496, -4484, -4473, + -4461, -4449, -4438, -4427, + -4415, -4403, -4392, -4380, + -4368, -4357, -4345, -4334, + -4322, -4311, -4299, -4288, + -4276, -4265, -4253, -4242, + -4230, -4219, -4207, -4196, + -4184, -4173, -4162, -4150, + -4139, -4128, -4116, -4105, + -4094, -4082, -4071, -4060, + -4048, -4037, -4026, -4014, + -4003, -3992, -3980, -3969, + -3958, -3946, -3935, -3924, + -3913, -3901, -3890, -3879, + -3868, -3857, -3845, -3834, + -3823, -3812, -3801, -3790, + -3779, -3767, -3756, -3745, + -3734, -3723, -3712, -3700, + -3689, -3678, -3667, -3656, + -3645, -3634, -3623, -3612, + -3601, -3590, -3579, -3568, + -3557, -3545, -3535, -3524, + -3513, -3502, -3491, -3480, + -3469, -3458, -3447, -3436, + -3425, -3414, -3403, -3392, + -3381, -3370, -3360, -3348, + -3337, -3327, -3316, -3305, + -3294, -3283, -3272, -3262, + -3251, -3240, -3229, -3218, + -3207, -3197, -3185, -3175, + -3164, -3153, -3142, -3132, + -3121, -3110, -3099, -3088, + -3078, -3067, -3056, -3045, + -3035, -3024, -3013, -3003, + -2992, -2981, -2970, -2960, + -2949, -2938, -2928, -2917, + -2906, -2895, -2885, -2874, + -2864, -2853, -2842, -2832, + -2821, -2810, -2800, -2789, + -2778, -2768, -2757, -2747, + -2736, -2725, -2715, -2704, + -2694, -2683, -2673, -2662, + -2651, -2641, -2630, -2620, + -2609, -2599, -2588, -2578, + -2567, -2556, -2546, -2535, + -2525, -2515, -2504, -2493, + -2483, -2472, -2462, -2451, + -2441, -2431, -2420, -2410, + -2399, -2389, -2378, -2367, + -2357, -2347, -2336, -2326, + -2315, -2305, -2295, -2284, + -2274, -2263, -2253, -2243, + -2232, -2222, -2211, -2201, + -2191, -2180, -2170, -2159, + -2149, -2139, -2128, -2118, + -2107, -2097, -2087, -2076, + -2066, -2056, -2046, -2035, + -2025, -2014, -2004, -1994, + -1983, -1973, -1963, -1953, + -1942, -1932, -1921, -1911, + -1901, -1891, -1880, -1870, + -1860, -1849, -1839, -1829, + -1819, -1808, -1798, -1788, + -1778, -1767, -1757, -1747, + -1736, -1726, -1716, -1706, + -1695, -1685, -1675, -1665, + -1654, -1644, -1634, -1624, + -1613, -1603, -1593, -1583, + -1573, -1563, -1552, -1542, + -1532, -1522, -1511, -1501, + -1491, -1481, -1471, -1461, + -1450, -1440, -1430, -1420, + -1409, -1400, -1389, -1379, + -1369, -1359, -1348, -1339, + -1328, -1318, -1308, -1298, + -1288, -1278, -1267, -1257, + -1247, -1237, -1227, -1217, + -1207, -1196, -1186, -1176, + -1166, -1156, -1146, -1135, + -1126, -1115, -1105, -1095, + -1085, -1075, -1065, -1055, + -1044, -1034, -1024, -1014, + -1004, -994, -984, -974, + -964, -954, -944, -933, + -923, -913, -903, -893, + -883, -873, -863, -853, + -843, -833, -822, -812, + -802, -792, -782, -772, + -762, -752, -742, -732, + -722, -712, -702, -691, + -682, -671, -662, -651, + -641, -631, -621, -611, + -601, -591, -581, -571, + -561, -551, -541, -531, + -521, -511, -501, -491, + -480, -471, -460, -451, + -440, -430, -420, -410, + -400, -390, -380, -370, + -360, -350, -340, -330, + -320, -310, -300, -290, + -280, -270, -260, -250, + -240, -230, -220, -210, + -199, -190, -179, -170, + -159, -150, -139, -129, + -119, -109, -99, -89, + -79, -69, -59, -49, + -39, -29, -19, -9, + 1, 11, 21, 31, + 41, 51, 61, 71, + 81, 91, 101, 111, + 121, 131, 141, 152, + 161, 172, 181, 192, + 202, 212, 222, 232, + 242, 252, 262, 272, + 282, 292, 302, 312, + 322, 332, 342, 352, + 362, 372, 382, 392, + 402, 412, 422, 433, + 442, 453, 462, 473, + 483, 493, 503, 513, + 523, 533, 543, 553, + 563, 573, 583, 593, + 603, 613, 623, 633, + 643, 653, 664, 673, + 684, 694, 704, 714, + 724, 734, 744, 754, + 764, 774, 784, 794, + 804, 815, 825, 835, + 845, 855, 865, 875, + 885, 895, 905, 915, + 925, 936, 946, 956, + 966, 976, 986, 996, + 1006, 1016, 1026, 1037, + 1047, 1057, 1067, 1077, + 1087, 1097, 1107, 1117, + 1128, 1138, 1148, 1158, + 1168, 1178, 1188, 1198, + 1209, 1219, 1229, 1239, + 1249, 1259, 1269, 1280, + 1290, 1300, 1310, 1320, + 1330, 1341, 1351, 1361, + 1371, 1381, 1391, 1402, + 1412, 1422, 1432, 1442, + 1452, 1463, 1473, 1483, + 1493, 1503, 1513, 1524, + 1534, 1544, 1554, 1565, + 1575, 1585, 1595, 1606, + 1616, 1626, 1636, 1647, + 1656, 1667, 1677, 1687, + 1697, 1708, 1718, 1729, + 1739, 1749, 1759, 1769, + 1780, 1790, 1800, 1810, + 1821, 1831, 1841, 1851, + 1862, 1872, 1883, 1893, + 1903, 1913, 1923, 1934, + 1944, 1955, 1965, 1975, + 1985, 1996, 2006, 2016, + 2027, 2037, 2048, 2058, + 2068, 2079, 2089, 2099, + 2110, 2120, 2130, 2141, + 2151, 2161, 2172, 2182, + 2193, 2203, 2213, 2224, + 2234, 2245, 2255, 2265, + 2276, 2286, 2297, 2307, + 2318, 2328, 2338, 2349, + 2359, 2370, 2380, 2391, + 2401, 2412, 2422, 2433, + 2443, 2454, 2464, 2475, + 2485, 2496, 2506, 2517, + 2527, 2537, 2548, 2559, + 2569, 2580, 2590, 2601, + 2612, 2622, 2632, 2643, + 2654, 2664, 2675, 2685, + 2696, 2707, 2717, 2728, + 2738, 2749, 2759, 2770, + 2781, 2791, 2802, 2813, + 2823, 2834, 2845, 2855, + 2866, 2877, 2887, 2898, + 2909, 2919, 2930, 2941, + 2951, 2962, 2973, 2984, + 2994, 3005, 3015, 3027, + 3037, 3048, 3058, 3069, + 3080, 3091, 3101, 3113, + 3123, 3134, 3145, 3156, + 3166, 3177, 3188, 3199, + 3210, 3220, 3231, 3242, + 3253, 3264, 3275, 3285, + 3296, 3307, 3318, 3329, + 3340, 3351, 3362, 3373, + 3384, 3394, 3405, 3416, + 3427, 3438, 3449, 3460, + 3471, 3482, 3493, 3504, + 3515, 3526, 3537, 3548, + 3559, 3570, 3581, 3592, + 3603, 3614, 3625, 3636, + 3647, 3659, 3670, 3681, + 3692, 3703, 3714, 3725, + 3736, 3747, 3758, 3770, + 3781, 3792, 3803, 3814, + 3825, 3837, 3848, 3859, + 3870, 3881, 3893, 3904, + 3915, 3926, 3937, 3949, + 3960, 3971, 3983, 3994, + 4005, 4017, 4028, 4039, + 4051, 4062, 4073, 4085, + 4096, 4107, 4119, 4130, + 4141, 4153, 4164, 4175, + 4187, 4198, 4210, 4221, + 4233, 4244, 4256, 4267, + 4279, 4290, 4302, 4313, + 4325, 4336, 4348, 4359, + 4371, 4382, 4394, 4406, + 4417, 4429, 4440, 4452, + 4464, 4475, 4487, 4499, + 4510, 4522, 4533, 4545, + 4557, 4569, 4581, 4592, + 4604, 4616, 4627, 4639, + 4651, 4663, 4674, 4686, + 4698, 4710, 4722, 4734, + 4746, 4758, 4769, 4781, + 4793, 4805, 4817, 4829, + 4841, 4853, 4865, 4877, + 4889, 4900, 4913, 4925, + 4936, 4949, 4961, 4973, + 4985, 4997, 5009, 5021, + 5033, 5045, 5057, 5070, + 5081, 5094, 5106, 5118, + 5130, 5143, 5155, 5167, + 5179, 5191, 5204, 5216, + 5228, 5240, 5253, 5265, + 5278, 5290, 5302, 5315, + 5327, 5340, 5352, 5364, + 5377, 5389, 5401, 5414, + 5426, 5439, 5451, 5464, + 5476, 5489, 5502, 5514, + 5527, 5539, 5552, 5564, + 5577, 5590, 5603, 5615, + 5628, 5641, 5653, 5666, + 5679, 5691, 5704, 5717, + 5730, 5743, 5756, 5768, + 5781, 5794, 5807, 5820, + 5833, 5846, 5859, 5872, + 5885, 5897, 5911, 5924, + 5937, 5950, 5963, 5976, + 5989, 6002, 6015, 6028, + 6042, 6055, 6068, 6081, + 6094, 6108, 6121, 6134, + 6147, 6160, 6174, 6187, + 6201, 6214, 6227, 6241, + 6254, 6267, 6281, 6294, + 6308, 6321, 6335, 6348, + 6362, 6375, 6389, 6403, + 6416, 6430, 6443, 6457, + 6471, 6485, 6498, 6512, + 6526, 6540, 6554, 6567, + 6581, 6595, 6609, 6623, + 6637, 6651, 6665, 6679, + 6692, 6706, 6721, 6735, + 6749, 6763, 6777, 6791, + 6805, 6819, 6833, 6848, + 6862, 6876, 6890, 6905, + 6919, 6933, 6948, 6962, + 6976, 6991, 7005, 7020, + 7034, 7049, 7064, 7078, + 7093, 7107, 7122, 7136, + 7151, 7166, 7180, 7195, + 7210, 7225, 7240, 7254, + 7269, 7284, 7299, 7314, + 7329, 7344, 7359, 7374, + 7389, 7404, 7419, 7434, + 7449, 7465, 7480, 7495, + 7510, 7526, 7541, 7556, + 7571, 7587, 7602, 7618, + 7633, 7648, 7664, 7680, + 7695, 7711, 7726, 7742, + 7758, 7773, 7789, 7805, + 7821, 7836, 7852, 7868, + 7884, 7900, 7916, 7932, + 7948, 7964, 7981, 7997, + 8013, 8029, 8045, 8061, + 8078, 8094, 8110, 8127, + 8143, 8160, 8176, 8193, + 8209, 8226, 8242, 8259, + 8276, 8292, 8309, 8326, + 8343, 8360, 8377, 8394, + 8410, 8428, 8444, 8462, + 8479, 8496, 8513, 8530, + 8548, 8565, 8582, 8600, + 8617, 8634, 8652, 8670, + 8687, 8704, 8722, 8740, + 8758, 8775, 8793, 8811, + 8829, 8847, 8865, 8883, + 8901, 8919, 8937, 8955, + 8974, 8992, 9010, 9029, + 9047, 9066, 9084, 9103, + 9121, 9140, 9159, 9177, + 9196, 9215, 9234, 9253, + 9272, 9291, 9310, 9329, + 9349, 9368, 9387, 9406, + 9426, 9445, 9465, 9484, + 9504, 9524, 9544, 9563, + 9583, 9603, 9623, 9643, + 9663, 9683, 9703, 9723, + 9744, 9764, 9785, 9805, + 9826, 9846, 9867, 9888, + 9909, 9930, 9950, 9971, + 9993, 10013, 10035, 10056, + 10077, 10099, 10120, 10142, + 10163, 10185, 10207, 10229, + 10251, 10273, 10294, 10317, + 10339, 10361, 10384, 10406, + 10428, 10451, 10474, 10496, + 10519, 10542, 10565, 10588, + 10612, 10635, 10658, 10682, + 10705, 10729, 10752, 10776, + 10800, 10824, 10848, 10872, + 10896, 10921, 10945, 10969, + 10994, 11019, 11044, 11069, + 11094, 11119, 11144, 11169, + 11195, 11221, 11246, 11272, + 11298, 11324, 11350, 11376, + 11402, 11429, 11456, 11482, + 11509, 11536, 11563, 11590, + 11618, 11645, 11673, 11701, + 11728, 11756, 11785, 11813, + 11842, 11870, 11899, 11928, + 11957, 11986, 12015, 12045, + 12074, 12104, 12134, 12164, + 12194, 12225, 12255, 12286, + 12317, 12348, 12380, 12411, + 12443, 12475, 12507, 12539, + 12571, 12604, 12637, 12670, + 12703, 12737, 12771, 12804, + 12839, 12873, 12907, 12942, + 12977, 13013, 13048, 13084, + 13120, 13156, 13192, 13229, + 13267, 13304, 13341, 13379, + 13418, 13456, 13495, 13534, + 13573, 13613, 13653, 13693, + 13734, 13775, 13817, 13858, + 13901, 13943, 13986, 14029, + 14073, 14117, 14162, 14206, + 14252, 14297, 14343, 14390, + 14437, 14485, 14533, 14582, + 14631, 14680, 14731, 14782, + 14833, 14885, 14937, 14991, + 15044, 15099, 15154, 15210, + 15266, 15324, 15382, 15441, + 15500, 15561, 15622, 15684, + 15747, 15811, 15877, 15943, + 16010, 16078, 16148, 16218, + 16290, 16363, 16437, 16513, + 16590, 16669, 16749, 16831, + 16915, 17000, 17088, 17177, + 17268, 17362, 17458, 17556, + 17657, 17761, 17868, 17977, + 18090, 18207, 18328, 18452, + 18581, 18715, 18854, 18998, + 19149, 19307, 19472, 19645, + 19828, 20021, 20226, 20444, + 20678, 20930, 21204, 21503, + 21835, 22206, 22630, 23124, + 23721, 24478, 25529, 27316, +}; + +/* tabledist - return a pseudo-randomly distributed value with mean mu and + * std deviation sigma. Uses table lookup to approximate the desired + * distribution, and a uniformly-distributed pseudo-random source. + */ +static inline int tabledist(int mu, int sigma) +{ + int x; + int index; + int sigmamod, sigmadiv; + + if (sigma == 0) + return mu; + + index = (net_random() & (TABLESIZE-1)); + sigmamod = sigma%TABLEFACTOR; + sigmadiv = sigma/TABLEFACTOR; + x = sigmamod*disttable[index]; + + if (x >= 0) + x += TABLEFACTOR/2; + else + x -= TABLEFACTOR/2; + + x /= TABLEFACTOR; + x += sigmadiv*disttable[index]; + x += mu; + return x; +} + /* Enqueue packets with underlying discipline (fifo) * but mark them with current time first. */ @@ -51,6 +605,8 @@ { struct netem_sched_data *q = (struct netem_sched_data *)sch->data; struct netem_skb_cb *cb = (struct netem_skb_cb *)skb->cb; + psched_time_t now; + long delay; pr_debug("netem_enqueue skb=%p @%lu\n", skb, jiffies); @@ -60,101 +616,105 @@ return 0; /* lie about loss so TCP doesn't know */ } - if (q->qnormal.qlen < sch->dev->tx_queue_len) { - PSCHED_GET_TIME(cb->time_to_send); - PSCHED_TADD(cb->time_to_send, q->latency); - __skb_queue_tail(&q->qnormal, skb); - sch->q.qlen++; - sch->stats.bytes += skb->len; - sch->stats.packets++; - return 0; + /* If doing simple delay then gap == 0 so all packets + * go into the delayed holding queue + * otherwise if doing out of order only "1 out of gap" + * packets will be delayed. + */ + if (q->counter < q->gap) { + int ret; + + ++q->counter; + ret = q->qdisc->enqueue(skb, q->qdisc); + if (ret) + sch->stats.drops++; + return ret; } - - sch->stats.drops++; - kfree_skb(skb); - return NET_XMIT_DROP; + + q->counter = 0; + + PSCHED_GET_TIME(now); + if (q->jitter) + delay = tabledist(q->latency, q->jitter); + else + delay = q->latency; + + 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; } /* Requeue packets but don't change time stamp */ static int netem_requeue(struct sk_buff *skb, struct Qdisc *sch) { struct netem_sched_data *q = (struct netem_sched_data *)sch->data; + int ret; - __skb_queue_head(&q->qnormal, skb); - sch->q.qlen++; - return 0; + if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0) + sch->q.qlen++; + + return ret; } -/* - * Check the look aside buffer list, and see if any freshly baked buffers. - * If head of queue is not baked, set timer. - */ -static struct sk_buff *netem_get_delayed(struct netem_sched_data *q) +static unsigned int netem_drop(struct Qdisc* sch) { - struct sk_buff *skb; - psched_time_t now; - long delay; - - skb = skb_peek(&q->qdelay); - if (skb) { - const struct netem_skb_cb *cb - = (const struct netem_skb_cb *)skb->cb; - - PSCHED_GET_TIME(now); - delay = PSCHED_US2JIFFIE(PSCHED_TDIFF(cb->time_to_send, now)); - pr_debug("netem_dequeue: delay queue %p@%lu %ld\n", - skb, jiffies, delay); - - /* it's baked enough */ - if (delay <= 0) { - __skb_unlink(skb, &q->qdelay); - del_timer(&q->timer); - return skb; - } + struct netem_sched_data *q = (struct netem_sched_data *)sch->data; + unsigned int len; - if (!timer_pending(&q->timer)) { - q->timer.expires = jiffies + delay; - add_timer(&q->timer); - } + if ((len = q->qdisc->ops->drop(q->qdisc)) != 0) { + sch->q.qlen--; + sch->stats.drops++; } - return NULL; + return len; } /* Dequeue packet. - * If packet needs to be held up, then put in the delay - * queue and set timer to wakeup later. + * Move all packets that are ready to send from the delay holding + * list to the underlying qdisc, then just call dequeue */ static struct sk_buff *netem_dequeue(struct Qdisc *sch) { struct netem_sched_data *q = (struct netem_sched_data *)sch->data; struct sk_buff *skb; + psched_time_t now; + + PSCHED_GET_TIME(now); + while ((skb = skb_peek(&q->delayed)) != NULL) { + const struct netem_skb_cb *cb + = (const struct netem_skb_cb *)skb->cb; + long delay + = PSCHED_US2JIFFIE(PSCHED_TDIFF(cb->time_to_send, now)); + pr_debug("netem_dequeue: delay queue %p@%lu %ld\n", + skb, jiffies, delay); - skb = netem_get_delayed(q); - if (!skb && (skb = __skb_dequeue(&q->qnormal))) { - /* are we doing out of order packet skip? */ - if (q->counter < q->gap) { - pr_debug("netem_dequeue: send %p normally\n", skb); - q->counter++; - } else { - /* don't send now hold for later */ - pr_debug("netem_dequeue: hold [%p]@%lu\n", skb, jiffies); - __skb_queue_tail(&q->qdelay, skb); - q->counter = 0; - skb = netem_get_delayed(q); + /* if more time remaining? */ + if (delay > 0) { + mod_timer(&q->timer, jiffies + delay); + break; } + __skb_unlink(skb, &q->delayed); + + if (q->qdisc->enqueue(skb, q->qdisc)) + sch->stats.drops++; } - if (skb) + skb = q->qdisc->dequeue(q->qdisc); + if (skb) sch->q.qlen--; return skb; } -static void netem_timer(unsigned long arg) +static void netem_watchdog(unsigned long arg) { struct Qdisc *sch = (struct Qdisc *)arg; - pr_debug("netem_timer: fired @%lu\n", jiffies); + pr_debug("netem_watchdog: fired @%lu\n", jiffies); netif_schedule(sch->dev); } @@ -162,24 +722,63 @@ { struct netem_sched_data *q = (struct netem_sched_data *)sch->data; - skb_queue_purge(&q->qnormal); - skb_queue_purge(&q->qdelay); + qdisc_reset(q->qdisc); + skb_queue_purge(&q->delayed); sch->q.qlen = 0; del_timer_sync(&q->timer); } +static int set_fifo_limit(struct Qdisc *q, int limit) +{ + struct rtattr *rta; + int ret = -ENOMEM; + + rta = kmalloc(RTA_LENGTH(sizeof(struct tc_fifo_qopt)), GFP_KERNEL); + if (rta) { + rta->rta_type = RTM_NEWQDISC; + rta->rta_len = RTA_LENGTH(sizeof(struct tc_fifo_qopt)); + ((struct tc_fifo_qopt *)RTA_DATA(rta))->limit = limit; + + ret = q->ops->change(q, rta); + kfree(rta); + } + return ret; +} + static int netem_change(struct Qdisc *sch, struct rtattr *opt) { struct netem_sched_data *q = (struct netem_sched_data *)sch->data; struct tc_netem_qopt *qopt = RTA_DATA(opt); + struct Qdisc *child; + int ret; - if (qopt->limit) - sch->dev->tx_queue_len = qopt->limit; + if (opt->rta_len < RTA_LENGTH(sizeof(*qopt))) + return -EINVAL; - q->gap = qopt->gap; - q->loss = qopt->loss; - q->latency = qopt->latency; + child = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops); + if (!child) + return -EINVAL; + + ret = set_fifo_limit(child, qopt->limit); + if (ret) { + qdisc_destroy(child); + return ret; + } + + sch_tree_lock(sch); + if (child) { + child = xchg(&q->qdisc, child); + if (child != &noop_qdisc) + qdisc_destroy(child); + + q->latency = qopt->latency; + q->jitter = qopt->jitter; + q->limit = qopt->limit; + q->gap = qopt->gap; + q->loss = qopt->loss; + } + sch_tree_unlock(sch); return 0; } @@ -191,10 +790,11 @@ if (!opt) return -EINVAL; - skb_queue_head_init(&q->qnormal); - skb_queue_head_init(&q->qdelay); + skb_queue_head_init(&q->delayed); + q->qdisc = &noop_qdisc; + init_timer(&q->timer); - q->timer.function = netem_timer; + q->timer.function = netem_watchdog; q->timer.data = (unsigned long) sch; q->counter = 0; @@ -215,6 +815,7 @@ struct tc_netem_qopt qopt; qopt.latency = q->latency; + qopt.jitter = q->jitter; qopt.limit = sch->dev->tx_queue_len; qopt.loss = q->loss; qopt.gap = q->gap; @@ -234,6 +835,7 @@ .enqueue = netem_enqueue, .dequeue = netem_dequeue, .requeue = netem_requeue, + .drop = netem_drop, .init = netem_init, .reset = netem_reset, .destroy = netem_destroy, diff -Nru a/net/sctp/inqueue.c b/net/sctp/inqueue.c --- a/net/sctp/inqueue.c 2004-07-13 12:24:01 -07:00 +++ b/net/sctp/inqueue.c 2004-07-13 12:24:01 -07:00 @@ -78,7 +78,7 @@ struct sctp_chunk *chunk; /* Empty the queue. */ - while ((chunk = (struct sctp_chunk *) skb_dequeue(&queue->in))) + while ((chunk = (struct sctp_chunk *) skb_dequeue(&queue->in)) != NULL) sctp_chunk_free(chunk); /* If there is a packet which is currently being worked on, diff -Nru a/net/sctp/output.c b/net/sctp/output.c --- a/net/sctp/output.c 2004-07-13 12:24:00 -07:00 +++ b/net/sctp/output.c 2004-07-13 12:24:00 -07:00 @@ -133,7 +133,7 @@ SCTP_DEBUG_PRINTK("%s: packet:%p\n", __FUNCTION__, packet); - while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks))) + while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks)) != NULL) sctp_chunk_free(chunk); if (packet->malloced) @@ -370,7 +370,7 @@ * [This whole comment explains WORD_ROUND() below.] */ SCTP_DEBUG_PRINTK("***sctp_transmit_packet***\n"); - while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks))) { + while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks)) != NULL) { if (sctp_chunk_is_data(chunk)) { if (!chunk->has_tsn) { @@ -511,7 +511,7 @@ * will get resent or dropped later. */ - while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks))) { + while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks)) != NULL) { if (!sctp_chunk_is_data(chunk)) sctp_chunk_free(chunk); } diff -Nru a/net/sctp/outqueue.c b/net/sctp/outqueue.c --- a/net/sctp/outqueue.c 2004-07-13 12:24:00 -07:00 +++ b/net/sctp/outqueue.c 2004-07-13 12:24:00 -07:00 @@ -245,7 +245,7 @@ /* Throw away unacknowledged chunks. */ list_for_each(pos, &q->asoc->peer.transport_addr_list) { transport = list_entry(pos, struct sctp_transport, transports); - while ((lchunk = sctp_list_dequeue(&transport->transmitted))) { + while ((lchunk = sctp_list_dequeue(&transport->transmitted)) != NULL) { chunk = list_entry(lchunk, struct sctp_chunk, transmitted_list); /* Mark as part of a failed message. */ @@ -282,7 +282,7 @@ } /* Throw away any leftover data chunks. */ - while ((chunk = sctp_outq_dequeue_data(q))) { + while ((chunk = sctp_outq_dequeue_data(q)) != NULL) { /* Mark as send failure. */ sctp_chunk_fail(chunk, q->error); @@ -292,7 +292,7 @@ q->error = 0; /* Throw away any leftover control chunks. */ - while ((chunk = (struct sctp_chunk *) skb_dequeue(&q->control))) + while ((chunk = (struct sctp_chunk *) skb_dequeue(&q->control)) != NULL) sctp_chunk_free(chunk); } @@ -681,7 +681,7 @@ */ queue = &q->control; - while ((chunk = (struct sctp_chunk *)skb_dequeue(queue))) { + while ((chunk = (struct sctp_chunk *)skb_dequeue(queue)) != NULL) { /* Pick the right transport to use. */ new_transport = chunk->transport; @@ -812,7 +812,7 @@ start_timer = 0; queue = &q->out; - while ((chunk = sctp_outq_dequeue_data(q))) { + while ((chunk = sctp_outq_dequeue_data(q)) != NULL) { /* RFC 2960 6.5 Every DATA chunk MUST carry a valid * stream identifier. */ @@ -866,7 +866,7 @@ SCTP_DEBUG_PRINTK("TX TSN 0x%x skb->head " "%p skb->users %d.\n", ntohl(chunk->subh.data_hdr->tsn), - chunk->skb ?chunk->skb->head : 0, + chunk->skb ?chunk->skb->head : NULL, chunk->skb ? atomic_read(&chunk->skb->users) : -1); diff -Nru a/net/sctp/protocol.c b/net/sctp/protocol.c --- a/net/sctp/protocol.c 2004-07-13 12:24:01 -07:00 +++ b/net/sctp/protocol.c 2004-07-13 12:24:01 -07:00 @@ -101,7 +101,7 @@ { if (!proc_net_sctp) { struct proc_dir_entry *ent; - ent = proc_mkdir("net/sctp", 0); + ent = proc_mkdir("net/sctp", NULL); if (ent) { ent->owner = THIS_MODULE; proc_net_sctp = ent; @@ -134,7 +134,7 @@ if (proc_net_sctp) { proc_net_sctp = NULL; - remove_proc_entry("net/sctp", 0); + remove_proc_entry("net/sctp", NULL); } } diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c --- a/net/sctp/sm_statefuns.c 2004-07-13 12:24:00 -07:00 +++ b/net/sctp/sm_statefuns.c 2004-07-13 12:24:00 -07:00 @@ -995,7 +995,7 @@ /* Search through all current addresses and make sure * we aren't adding any new ones. */ - new_addr = 0; + new_addr = NULL; found = 0; list_for_each(pos, &new_asoc->peer.transport_addr_list) { diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c --- a/net/sctp/socket.c 2004-07-13 12:24:01 -07:00 +++ b/net/sctp/socket.c 2004-07-13 12:24:01 -07:00 @@ -86,8 +86,6 @@ /* Forward declarations for internal helper functions. */ static int sctp_writeable(struct sock *sk); -static inline int sctp_wspace(struct sctp_association *asoc); -static inline void sctp_set_owner_w(struct sctp_chunk *chunk); static void sctp_wfree(struct sk_buff *skb); static int sctp_wait_for_sndbuf(struct sctp_association *, long *timeo_p, size_t msg_len); @@ -95,7 +93,8 @@ static int sctp_wait_for_connect(struct sctp_association *, long *timeo_p); static int sctp_wait_for_accept(struct sock *sk, long timeo); static void sctp_wait_for_close(struct sock *sk, long timeo); -static inline int sctp_verify_addr(struct sock *, union sctp_addr *, int); +static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt, + union sctp_addr *addr, int len); static int sctp_bindx_add(struct sock *, struct sockaddr *, int); static int sctp_bindx_rem(struct sock *, struct sockaddr *, int); static int sctp_send_asconf_add_ip(struct sock *, struct sockaddr *, int); @@ -111,6 +110,64 @@ extern kmem_cache_t *sctp_bucket_cachep; extern int sctp_assoc_valid(struct sock *sk, struct sctp_association *asoc); +/* Get the sndbuf space available at the time on the association. */ +static inline int sctp_wspace(struct sctp_association *asoc) +{ + struct sock *sk = asoc->base.sk; + int amt = 0; + + amt = sk->sk_sndbuf - asoc->sndbuf_used; + if (amt < 0) + amt = 0; + return amt; +} + +/* Increment the used sndbuf space count of the corresponding association by + * the size of the outgoing data chunk. + * Also, set the skb destructor for sndbuf accounting later. + * + * Since it is always 1-1 between chunk and skb, and also a new skb is always + * allocated for chunk bundling in sctp_packet_transmit(), we can use the + * destructor in the data chunk skb for the purpose of the sndbuf space + * tracking. + */ +static inline void sctp_set_owner_w(struct sctp_chunk *chunk) +{ + struct sctp_association *asoc = chunk->asoc; + struct sock *sk = asoc->base.sk; + + /* The sndbuf space is tracked per association. */ + sctp_association_hold(asoc); + + chunk->skb->destructor = sctp_wfree; + /* Save the chunk pointer in skb for sctp_wfree to use later. */ + *((struct sctp_chunk **)(chunk->skb->cb)) = chunk; + + asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk); + sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk); +} + +/* Verify that this is a valid address. */ +static inline int sctp_verify_addr(struct sock *sk, union sctp_addr *addr, + int len) +{ + struct sctp_af *af; + + /* Verify basic sockaddr. */ + af = sctp_sockaddr_af(sctp_sk(sk), addr, len); + if (!af) + return -EINVAL; + + /* Is this a valid SCTP address? */ + if (!af->addr_valid(addr, sctp_sk(sk))) + return -EINVAL; + + if (!sctp_sk(sk)->pf->send_verify(sctp_sk(sk), (addr))) + return -EINVAL; + + return 0; +} + /* Look up the association by its id. If this is not a UDP-style * socket, the ID field is always ignored. */ @@ -1008,7 +1065,7 @@ struct sctp_sndrcvinfo *sinfo; struct sctp_initmsg *sinit; sctp_assoc_t associd = NULL; - sctp_cmsgs_t cmsgs = { 0 }; + sctp_cmsgs_t cmsgs = { NULL }; int err; sctp_scope_t scope; long timeo; @@ -4142,64 +4199,6 @@ no_packet: *err = error; return NULL; -} - -/* Verify that this is a valid address. */ -static inline int sctp_verify_addr(struct sock *sk, union sctp_addr *addr, - int len) -{ - struct sctp_af *af; - - /* Verify basic sockaddr. */ - af = sctp_sockaddr_af(sctp_sk(sk), addr, len); - if (!af) - return -EINVAL; - - /* Is this a valid SCTP address? */ - if (!af->addr_valid(addr, sctp_sk(sk))) - return -EINVAL; - - if (!sctp_sk(sk)->pf->send_verify(sctp_sk(sk), (addr))) - return -EINVAL; - - return 0; -} - -/* Get the sndbuf space available at the time on the association. */ -static inline int sctp_wspace(struct sctp_association *asoc) -{ - struct sock *sk = asoc->base.sk; - int amt = 0; - - amt = sk->sk_sndbuf - asoc->sndbuf_used; - if (amt < 0) - amt = 0; - return amt; -} - -/* Increment the used sndbuf space count of the corresponding association by - * the size of the outgoing data chunk. - * Also, set the skb destructor for sndbuf accounting later. - * - * Since it is always 1-1 between chunk and skb, and also a new skb is always - * allocated for chunk bundling in sctp_packet_transmit(), we can use the - * destructor in the data chunk skb for the purpose of the sndbuf space - * tracking. - */ -static inline void sctp_set_owner_w(struct sctp_chunk *chunk) -{ - struct sctp_association *asoc = chunk->asoc; - struct sock *sk = asoc->base.sk; - - /* The sndbuf space is tracked per association. */ - sctp_association_hold(asoc); - - chunk->skb->destructor = sctp_wfree; - /* Save the chunk pointer in skb for sctp_wfree to use later. */ - *((struct sctp_chunk **)(chunk->skb->cb)) = chunk; - - asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk); - sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk); } /* If sndbuf has changed, wake up per association sndbuf waiters. */ diff -Nru a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c --- a/net/sctp/ulpevent.c 2004-07-13 12:24:00 -07:00 +++ b/net/sctp/ulpevent.c 2004-07-13 12:24:00 -07:00 @@ -48,13 +48,23 @@ #include #include -static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event, - const struct sctp_association *asoc); -static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event); static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event, struct sctp_association *asoc); static void sctp_ulpevent_release_data(struct sctp_ulpevent *event); +/* Stub skb destructor. */ +static void sctp_stub_rfree(struct sk_buff *skb) +{ +/* WARNING: This function is just a warning not to use the + * skb destructor. If the skb is shared, we may get the destructor + * callback on some processor that does not own the sock_lock. This + * was occuring with PACKET socket applications that were monitoring + * our skbs. We can't take the sock_lock, because we can't risk + * recursing if we do really own the sock lock. Instead, do all + * of our rwnd manipulation while we own the sock_lock outright. + */ +} + /* Create a new sctp_ulpevent. */ struct sctp_ulpevent *sctp_ulpevent_new(int size, int msg_flags, int gfp) { @@ -87,6 +97,30 @@ return MSG_NOTIFICATION == (event->msg_flags & MSG_NOTIFICATION); } +/* Hold the association in case the msg_name needs read out of + * the association. + */ +static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event, + const struct sctp_association *asoc) +{ + struct sk_buff *skb; + + /* Cast away the const, as we are just wanting to + * bump the reference count. + */ + sctp_association_hold((struct sctp_association *)asoc); + skb = sctp_event2skb(event); + skb->sk = asoc->base.sk; + event->asoc = (struct sctp_association *)asoc; + skb->destructor = sctp_stub_rfree; +} + +/* A simple destructor to give up the reference to the association. */ +static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event) +{ + sctp_association_put(event->asoc); +} + /* Create and initialize an SCTP_ASSOC_CHANGE event. * * 5.3.1.1 SCTP_ASSOC_CHANGE @@ -787,43 +821,6 @@ put_cmsg(msghdr, IPPROTO_SCTP, SCTP_SNDRCV, sizeof(struct sctp_sndrcvinfo), (void *)&sinfo); -} - -/* Stub skb destructor. */ -static void sctp_stub_rfree(struct sk_buff *skb) -{ -/* WARNING: This function is just a warning not to use the - * skb destructor. If the skb is shared, we may get the destructor - * callback on some processor that does not own the sock_lock. This - * was occuring with PACKET socket applications that were monitoring - * our skbs. We can't take the sock_lock, because we can't risk - * recursing if we do really own the sock lock. Instead, do all - * of our rwnd manipulation while we own the sock_lock outright. - */ -} - -/* Hold the association in case the msg_name needs read out of - * the association. - */ -static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event, - const struct sctp_association *asoc) -{ - struct sk_buff *skb; - - /* Cast away the const, as we are just wanting to - * bump the reference count. - */ - sctp_association_hold((struct sctp_association *)asoc); - skb = sctp_event2skb(event); - skb->sk = asoc->base.sk; - event->asoc = (struct sctp_association *)asoc; - skb->destructor = sctp_stub_rfree; -} - -/* A simple destructor to give up the reference to the association. */ -static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event) -{ - sctp_association_put(event->asoc); } /* Do accounting for bytes received and hold a reference to the association diff -Nru a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c --- a/net/sctp/ulpqueue.c 2004-07-13 12:24:01 -07:00 +++ b/net/sctp/ulpqueue.c 2004-07-13 12:24:01 -07:00 @@ -49,10 +49,10 @@ #include /* Forward declarations for internal helpers. */ -static inline struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq, - struct sctp_ulpevent *); -static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *, - struct sctp_ulpevent *); +static struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq, + struct sctp_ulpevent *); +static struct sctp_ulpevent * sctp_ulpq_order(struct sctp_ulpq *, + struct sctp_ulpevent *); /* 1st Level Abstractions */ @@ -97,12 +97,12 @@ struct sk_buff *skb; struct sctp_ulpevent *event; - while ((skb = __skb_dequeue(&ulpq->lobby))) { + while ((skb = __skb_dequeue(&ulpq->lobby)) != NULL) { event = sctp_skb2event(skb); sctp_ulpevent_free(event); } - while ((skb = __skb_dequeue(&ulpq->reasm))) { + while ((skb = __skb_dequeue(&ulpq->reasm)) != NULL) { event = sctp_skb2event(skb); sctp_ulpevent_free(event); } @@ -466,8 +466,8 @@ /* Helper function to reassemble chunks. Hold chunks on the reasm queue that * need reassembling. */ -static inline struct sctp_ulpevent *sctp_ulpq_reasm(struct sctp_ulpq *ulpq, - struct sctp_ulpevent *event) +static struct sctp_ulpevent *sctp_ulpq_reasm(struct sctp_ulpq *ulpq, + struct sctp_ulpevent *event) { struct sctp_ulpevent *retval = NULL; @@ -645,8 +645,8 @@ } -static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *ulpq, - struct sctp_ulpevent *event) +static struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *ulpq, + struct sctp_ulpevent *event) { __u16 sid, ssn; struct sctp_stream *in; @@ -756,7 +756,7 @@ tsnmap = &ulpq->asoc->peer.tsn_map; - while ((skb = __skb_dequeue_tail(&ulpq->lobby))) { + while ((skb = __skb_dequeue_tail(&ulpq->lobby)) != NULL) { freed += skb_headlen(skb); event = sctp_skb2event(skb); tsn = event->tsn; @@ -782,7 +782,7 @@ tsnmap = &ulpq->asoc->peer.tsn_map; /* Walk backwards through the list, reneges the newest tsns. */ - while ((skb = __skb_dequeue_tail(&ulpq->reasm))) { + while ((skb = __skb_dequeue_tail(&ulpq->reasm)) != NULL) { freed += skb_headlen(skb); event = sctp_skb2event(skb); tsn = event->tsn; diff -Nru a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c --- a/net/xfrm/xfrm_user.c 2004-07-13 12:24:01 -07:00 +++ b/net/xfrm/xfrm_user.c 2004-07-13 12:24:01 -07:00 @@ -814,6 +814,20 @@ return err; } +static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) +{ + struct xfrm_usersa_flush *p = NLMSG_DATA(nlh); + + xfrm_state_flush(p->proto); + return 0; +} + +static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) +{ + xfrm_policy_flush(); + return 0; +} + static const int xfrm_msg_min[(XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)] = { NLMSG_LENGTH(sizeof(struct xfrm_usersa_info)), /* NEW SA */ NLMSG_LENGTH(sizeof(struct xfrm_usersa_id)), /* DEL SA */ @@ -826,6 +840,9 @@ NLMSG_LENGTH(sizeof(struct xfrm_user_expire)), /* EXPIRE */ NLMSG_LENGTH(sizeof(struct xfrm_userpolicy_info)),/* UPD POLICY */ NLMSG_LENGTH(sizeof(struct xfrm_usersa_info)), /* UPD SA */ + NLMSG_LENGTH(sizeof(struct xfrm_user_polexpire)), /* POLEXPIRE */ + NLMSG_LENGTH(sizeof(struct xfrm_usersa_flush)), /* FLUSH SA */ + NLMSG_LENGTH(0), /* FLUSH POLICY */ }; static struct xfrm_link { @@ -849,6 +866,9 @@ {}, { .doit = xfrm_add_policy }, { .doit = xfrm_add_sa, }, + {}, + { .doit = xfrm_flush_sa }, + { .doit = xfrm_flush_policy }, }; static int xfrm_done(struct netlink_callback *cb)