]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'cfq-merge' of git://brick.kernel.dk/data/git/linux-2.6-block
authorLinus Torvalds <torvalds@g5.osdl.org>
Tue, 28 Mar 2006 17:25:44 +0000 (09:25 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 28 Mar 2006 17:25:44 +0000 (09:25 -0800)
* 'cfq-merge' of git://brick.kernel.dk/data/git/linux-2.6-block:
  [BLOCK] cfq-iosched: seek and async performance fixes
  [PATCH] ll_rw_blk: fix 80-col offender in put_io_context()
  [PATCH] cfq-iosched: small cfq_choose_req() optimization
  [PATCH] [BLOCK] cfq-iosched: change cfq io context linking from list to tree

330 files changed:
CREDITS
Documentation/DMA-mapping.txt
Documentation/RCU/whatisRCU.txt
Documentation/cpu-hotplug.txt
Documentation/cputopology.txt
Documentation/filesystems/00-INDEX
Documentation/ioctl-number.txt
Documentation/m68k/README.buddha
Documentation/networking/ifenslave.c
arch/alpha/kernel/time.c
arch/arm/lib/copy_template.S
arch/arm/mach-footbridge/time.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/microcode.c
arch/i386/kernel/nmi.c
arch/i386/mach-voyager/voyager_smp.c
arch/i386/oprofile/nmi_int.c
arch/ia64/sn/kernel/sn2/sn_proc_fs.c
arch/m68k/mvme16x/rtc.c
arch/mips/dec/time.c
arch/mips/momentum/ocelot_3/setup.c
arch/mips/tx4938/common/rtc_rx5c348.c
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/chrp/time.c
arch/powerpc/platforms/maple/time.c
arch/ppc/kernel/ppc_htab.c
arch/ppc/platforms/chrp_time.c
arch/sh/boards/mpc1211/rtc.c
arch/sh/boards/sh03/rtc.c
arch/sh/kernel/cpu/rtc.c
arch/sh64/kernel/time.c
arch/sparc64/kernel/time.c
arch/x86_64/kernel/time.c
block/ll_rw_blk.c
drivers/atm/lanai.c
drivers/block/DAC960.c
drivers/block/Kconfig
drivers/block/acsi_slm.c
drivers/block/floppy.c
drivers/block/paride/pd.c
drivers/block/paride/pg.c
drivers/block/paride/pt.c
drivers/block/umem.c
drivers/char/agp/nvidia-agp.c
drivers/char/drm/drm_fops.c
drivers/char/drm/i810_dma.c
drivers/char/drm/i830_dma.c
drivers/char/mem.c
drivers/char/misc.c
drivers/char/mxser.h
drivers/char/synclink.c
drivers/char/synclink_gt.c
drivers/edac/edac_mc.c
drivers/ide/ide-tape.c
drivers/ide/pci/amd74xx.c
drivers/ide/pci/generic.c
drivers/ide/pci/sis5513.c
drivers/input/input.c
drivers/isdn/capi/capi.c
drivers/isdn/capi/kcapi_proc.c
drivers/media/dvb/dvb-core/dvbdev.c
drivers/media/video/videodev.c
drivers/message/i2o/i2o_proc.c
drivers/misc/ibmasm/ibmasmfs.c
drivers/net/forcedeth.c
drivers/net/ioc3-eth.c
drivers/net/irda/nsc-ircc.c
drivers/net/loopback.c
drivers/net/ns83820.c
drivers/net/sis900.c
drivers/net/tulip/de4x5.c
drivers/net/tulip/pnic2.c
drivers/net/typhoon.c
drivers/net/wan/wanxl.c
drivers/net/wireless/orinoco.c
drivers/net/wireless/prism54/isl_ioctl.c
drivers/net/wireless/prism54/islpci_hotplug.c
drivers/oprofile/cpu_buffer.c
drivers/oprofile/oprofile_stats.c
drivers/oprofile/oprofilefs.c
drivers/scsi/3w-9xxx.c
drivers/scsi/BusLogic.c
drivers/scsi/a100u2w.c
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/linit.c
drivers/scsi/atp870u.c
drivers/scsi/dpt_i2o.c
drivers/scsi/eata.c
drivers/scsi/gdth.c
drivers/scsi/initio.c
drivers/scsi/ips.c
drivers/scsi/megaraid.c
drivers/scsi/nsp32.c
drivers/scsi/osst.c
drivers/scsi/ppa.c
drivers/scsi/qla1280.c
drivers/scsi/qlogicfc.c
drivers/scsi/qlogicpti.c
drivers/serial/8250.c
drivers/serial/serial_txx9.c
drivers/serial/sunsu.c
drivers/telephony/phonedev.c
drivers/usb/core/file.c
drivers/usb/gadget/inode.c
drivers/usb/host/ohci-s3c2410.c
drivers/usb/net/zaurus.c
fs/9p/v9fs_vfs.h
fs/9p/vfs_dir.c
fs/9p/vfs_file.c
fs/adfs/adfs.h
fs/adfs/dir.c
fs/adfs/file.c
fs/affs/affs.h
fs/affs/dir.c
fs/affs/file.c
fs/afs/dir.c
fs/afs/internal.h
fs/afs/mntpt.c
fs/afs/proc.c
fs/autofs/autofs_i.h
fs/autofs/root.c
fs/autofs4/autofs_i.h
fs/autofs4/inode.c
fs/autofs4/root.c
fs/bad_inode.c
fs/befs/linuxvfs.c
fs/bfs/bfs.h
fs/bfs/dir.c
fs/bfs/file.c
fs/binfmt_misc.c
fs/block_dev.c
fs/char_dev.c
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/coda/dir.c
fs/coda/file.c
fs/coda/pioctl.c
fs/coda/psdev.c
fs/compat.c
fs/configfs/configfs_internal.h
fs/configfs/dir.c
fs/configfs/file.c
fs/cramfs/inode.c
fs/debugfs/file.c
fs/debugfs/inode.c
fs/devfs/base.c
fs/efs/dir.c
fs/eventpoll.c
fs/ext2/dir.c
fs/ext2/ext2.h
fs/ext2/file.c
fs/ext3/dir.c
fs/ext3/file.c
fs/fat/dir.c
fs/fat/file.c
fs/fat/inode.c
fs/fifo.c
fs/file.c
fs/freevxfs/vxfs_extern.h
fs/freevxfs/vxfs_lookup.c
fs/fuse/dev.c
fs/fuse/dir.c
fs/fuse/file.c
fs/fuse/fuse_i.h
fs/hfs/dir.c
fs/hfs/hfs_fs.h
fs/hfs/inode.c
fs/hfsplus/dir.c
fs/hfsplus/inode.c
fs/hostfs/hostfs_kern.c
fs/hpfs/dir.c
fs/hpfs/file.c
fs/hpfs/hpfs_fn.h
fs/hppfs/hppfs_kern.c
fs/hugetlbfs/inode.c
fs/inode.c
fs/inotify.c
fs/isofs/dir.c
fs/isofs/isofs.h
fs/jffs/inode-v23.c
fs/jffs2/dir.c
fs/jffs2/file.c
fs/jffs2/os-linux.h
fs/jfs/file.c
fs/jfs/jfs_inode.h
fs/jfs/namei.c
fs/libfs.c
fs/mbcache.c
fs/minix/dir.c
fs/minix/file.c
fs/minix/minix.h
fs/ncpfs/dir.c
fs/ncpfs/file.c
fs/nfs/dir.c
fs/nfs/file.c
fs/nfsd/nfsctl.c
fs/nfsd/stats.c
fs/nfsd/vfs.c
fs/ntfs/dir.c
fs/ntfs/file.c
fs/ntfs/ntfs.h
fs/ocfs2/dlmglue.c
fs/ocfs2/file.c
fs/ocfs2/file.h
fs/openpromfs/inode.c
fs/pipe.c
fs/proc/generic.c
fs/proc/internal.h
fs/proc/kcore.c
fs/proc/kmsg.c
fs/proc/proc_misc.c
fs/proc/vmcore.c
fs/qnx4/dir.c
fs/qnx4/file.c
fs/ramfs/file-mmu.c
fs/ramfs/file-nommu.c
fs/ramfs/internal.h
fs/read_write.c
fs/reiserfs/dir.c
fs/reiserfs/file.c
fs/reiserfs/procfs.c
fs/romfs/inode.c
fs/select.c
fs/smbfs/dir.c
fs/smbfs/file.c
fs/smbfs/proto.h
fs/sysfs/bin.c
fs/sysfs/dir.c
fs/sysfs/file.c
fs/sysfs/sysfs.h
fs/sysv/dir.c
fs/sysv/file.c
fs/sysv/sysv.h
fs/udf/dir.c
fs/udf/file.c
fs/udf/udfdecl.h
fs/ufs/dir.c
fs/ufs/file.c
fs/xfs/linux-2.6/xfs_file.c
fs/xfs/linux-2.6/xfs_iops.h
include/asm-alpha/poll.h
include/asm-generic/local.h
include/asm-generic/percpu.h
include/asm-i386/mach-default/mach_time.h
include/asm-i386/processor.h
include/asm-mips/mc146818-time.h
include/asm-parisc/pdc.h
include/asm-sh/addrspace.h
include/asm-sparc64/floppy.h
include/asm-sparc64/futex.h
include/asm-x86_64/processor.h
include/linux/cdev.h
include/linux/coda_linux.h
include/linux/cpumask.h
include/linux/crash_dump.h
include/linux/debugfs.h
include/linux/dma-mapping.h
include/linux/efs_fs.h
include/linux/ext3_fs.h
include/linux/fb.h
include/linux/fs.h
include/linux/genhd.h
include/linux/hugetlb.h
include/linux/input.h
include/linux/kernel_stat.h
include/linux/miscdevice.h
include/linux/msdos_fs.h
include/linux/ncp_fs.h
include/linux/nfs_fs.h
include/linux/oprofile.h
include/linux/pci_ids.h
include/linux/poll.h
include/linux/proc_fs.h
include/linux/qnx4_fs.h
include/linux/ramfs.h
include/linux/reiserfs_fs.h
include/linux/relayfs_fs.h [deleted file]
include/linux/sound.h
include/linux/sunrpc/stats.h
include/linux/synclink.h
include/linux/ufs_fs.h
include/linux/usb.h
include/linux/videodev2.h
include/sound/core.h
init/main.c
ipc/mqueue.c
kernel/futex_compat.c
kernel/module.c
kernel/params.c
kernel/rcutorture.c
kernel/sched.c
mm/mempolicy.c
mm/slab.c
mm/swap.c
net/irda/af_irda.c
net/nonet.c
net/socket.c
net/sunrpc/rpc_pipe.c
net/sunrpc/stats.c
sound/core/init.c
sound/core/rawmidi.c
sound/core/sound.c
sound/core/sound_oss.c
sound/oss/dmasound/dmasound_awacs.c
sound/oss/emu10k1/midi.c
sound/oss/esssolo1.c
sound/oss/maestro3.c
sound/oss/msnd.c
sound/oss/sb_card.c
sound/oss/sequencer.c
sound/oss/sh_dac_audio.c
sound/oss/sonicvibes.c
sound/pci/ad1889.c
sound/pci/ali5451/ali5451.c
sound/pci/als4000.c
sound/pci/azt3328.c
sound/pci/emu10k1/emu10k1x.c
sound/pci/es1938.c
sound/pci/es1968.c
sound/pci/ice1712/ice1712.c
sound/pci/maestro3.c
sound/pci/mixart/mixart.c
sound/pci/pcxhr/pcxhr.c
sound/pci/rme32.c
sound/pci/rme96.c
sound/pci/rme9652/hdspm.c
sound/pci/sonicvibes.c
sound/pci/trident/trident_main.c
sound/sound_core.c
sound/usb/usx2y/usx2yhwdeppcm.c

diff --git a/CREDITS b/CREDITS
index 35850d882c3439895927e2ce498755ca03dbed17..0bf31eac6dc221add4980576b5e55f6fce384d70 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -1127,8 +1127,10 @@ S: Carnegie, Pennsylvania 15106-4304
 S: USA
 
 N: Philip Gladstone
-E: philip@raptor.com
+E: philip@gladstonefamily.net
 D: Kernel / timekeeping stuff
+S: Carlisle, MA 01741
+S: USA
   
 N: Jan-Benedict Glaw
 E: jbglaw@lug-owl.de
index 684557474c156210114243f89b2f79667bdb179e..ee4bb73683cd40e3550484b2b2248ef75088910f 100644 (file)
@@ -199,6 +199,8 @@ address during PCI bus mastering you might do something like:
                       "mydev: 24-bit DMA addressing not available.\n");
                goto ignore_this_device;
        }
+[Better use DMA_24BIT_MASK instead of 0x00ffffff.
+See linux/include/dma-mapping.h for reference.]
 
 When pci_set_dma_mask() is successful, and returns zero, the PCI layer
 saves away this mask you have provided.  The PCI layer will use this
index b4ea51ad3610f7c2a99f18c3ee2dc776ebfe0731..07cb93b82ba9e4e6539e1b0ecb43e4b8a0af416a 100644 (file)
@@ -605,7 +605,7 @@ are the same as those shown in the preceding section, so they are omitted.
        {
                int cpu;
 
-               for_each_cpu(cpu)
+               for_each_possible_cpu(cpu)
                        run_on(cpu);
        }
 
index 57a09f99ecb08977d51d883ee5d6caecbc0967ba..1bcf69996c9df74fba87c25949c05285ff604d3b 100644 (file)
@@ -97,13 +97,13 @@ at which time hotplug is disabled.
 
 You really dont need to manipulate any of the system cpu maps. They should
 be read-only for most use. When setting up per-cpu resources almost always use
-cpu_possible_map/for_each_cpu() to iterate.
+cpu_possible_map/for_each_possible_cpu() to iterate.
 
 Never use anything other than cpumask_t to represent bitmap of CPUs.
 
 #include <linux/cpumask.h>
 
-for_each_cpu              - Iterate over cpu_possible_map
+for_each_possible_cpu     - Iterate over cpu_possible_map
 for_each_online_cpu       - Iterate over cpu_online_map
 for_each_present_cpu      - Iterate over cpu_present_map
 for_each_cpu_mask(x,mask) - Iterate over some random collection of cpu mask.
index ff280e2e1613e808e4d7844376134dfa2bb1fc21..2b28e9ec4e3a2437d8108dc5aee3976a281b9903 100644 (file)
@@ -1,5 +1,5 @@
 
-Export cpu topology info by sysfs. Items (attributes) are similar
+Export cpu topology info via sysfs. Items (attributes) are similar
 to /proc/cpuinfo.
 
 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
@@ -12,7 +12,7 @@ represent the thread siblings to cpu X in the same core;
 represent the thread siblings to cpu X in the same physical package;
 
 To implement it in an architecture-neutral way, a new source file,
-driver/base/topology.c, is to export the 5 attributes.
+drivers/base/topology.c, is to export the 4 attributes.
 
 If one architecture wants to support this feature, it just needs to
 implement 4 defines, typically in file include/asm-XXX/topology.h.
index 74052d22d868f5461966291473f91e8ecdcd1d40..66fdc0744fe0f370bb8115c2bdb5071da0a404d5 100644 (file)
@@ -1,27 +1,47 @@
 00-INDEX
        - this file (info on some of the filesystems supported by linux).
+Exporting
+       - explanation of how to make filesystems exportable.
 Locking
        - info on locking rules as they pertain to Linux VFS.
 adfs.txt
        - info and mount options for the Acorn Advanced Disc Filing System.
+afs.txt
+       - info and examples for the distributed AFS (Andrew File System) fs.
 affs.txt
        - info and mount options for the Amiga Fast File System.
+automount-support.txt
+       - information about filesystem automount support.
+befs.txt
+       - information about the BeOS filesystem for Linux.
 bfs.txt
        - info for the SCO UnixWare Boot Filesystem (BFS).
 cifs.txt
-       - description of the CIFS filesystem
+       - description of the CIFS filesystem.
 coda.txt
        - description of the CODA filesystem.
 configfs/
        - directory containing configfs documentation and example code.
 cramfs.txt
-       - info on the cram filesystem for small storage (ROMs etc)
+       - info on the cram filesystem for small storage (ROMs etc).
+dentry-locking.txt
+       - info on the RCU-based dcache locking model.
 devfs/
        - directory containing devfs documentation.
+directory-locking
+       - info about the locking scheme used for directory operations.
 dlmfs.txt
        - info on the userspace interface to the OCFS2 DLM.
 ext2.txt
        - info, mount options and specifications for the Ext2 filesystem.
+ext3.txt
+       - info, mount options and specifications for the Ext3 filesystem.
+files.txt
+       - info on file management in the Linux kernel.
+fuse.txt
+       - info on the Filesystem in User SpacE including mount options.
+hfs.txt
+       - info on the Macintosh HFS Filesystem for Linux.
 hpfs.txt
        - info and mount options for the OS/2 HPFS.
 isofs.txt
@@ -32,23 +52,43 @@ ncpfs.txt
        - info on Novell Netware(tm) filesystem using NCP protocol.
 ntfs.txt
        - info and mount options for the NTFS filesystem (Windows NT).
-proc.txt
-       - info on Linux's /proc filesystem.
 ocfs2.txt
        - info and mount options for the OCFS2 clustered filesystem.
+porting
+       - various information on filesystem porting.
+proc.txt
+       - info on Linux's /proc filesystem.
+ramfs-rootfs-initramfs.txt
+       - info on the 'in memory' filesystems ramfs, rootfs and initramfs.
+reiser4.txt
+       - info on the Reiser4 filesystem based on dancing tree algorithms.
+relayfs.txt
+       - info on relayfs, for efficient streaming from kernel to user space.
 romfs.txt
-       - Description of the ROMFS filesystem.
+       - description of the ROMFS filesystem.
 smbfs.txt
-       - info on using filesystems with the SMB protocol (Windows 3.11 and NT)
+       - info on using filesystems with the SMB protocol (Win 3.11 and NT).
+spufs.txt
+       - info and mount options for the SPU filesystem used on Cell.
+sysfs-pci.txt
+       - info on accessing PCI device resources through sysfs.
+sysfs.txt
+       - info on sysfs, a ram-based filesystem for exporting kernel objects.
 sysv-fs.txt
        - info on the SystemV/V7/Xenix/Coherent filesystem.
+tmpfs.txt
+       - info on tmpfs, a filesystem that holds all files in virtual memory.
 udf.txt
        - info and mount options for the UDF filesystem.
 ufs.txt
        - info on the ufs filesystem.
+v9fs.txt
+       - v9fs is a Unix implementation of the Plan 9 9p remote fs protocol.
 vfat.txt
        - info on using the VFAT filesystem used in Windows NT and Windows 95
 vfs.txt
-       - Overview of the Virtual File System
+       - overview of the Virtual File System
 xfs.txt
        - info and mount options for the XFS filesystem.
+xip.txt
+       - info on execute-in-place for file mappings.
index aa7ba00ec082adb2818b18bfd0026374d7412df3..171a44ebd939175e4bf1f8ff0821773babd0eb9e 100644 (file)
@@ -78,8 +78,6 @@ Code  Seq#    Include File            Comments
 '#'    00-3F   IEEE 1394 Subsystem     Block for the entire subsystem
 '1'    00-1F   <linux/timepps.h>       PPS kit from Ulrich Windl
                                        <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
-'6'    00-10   <asm-i386/processor.h>  Intel IA32 microcode update driver
-                                       <mailto:tigran@veritas.com>
 '8'    all                             SNP8023 advanced NIC card
                                        <mailto:mcr@solidum.com>
 'A'    00-1F   linux/apm_bios.h
index bf802ffc98ad1c134ea32a69a01fcb48259554aa..ef484a719bb9d528cdce84cbecbfbb06f3c6bf69 100644 (file)
@@ -29,7 +29,7 @@ address is written to $4a, then the whole Byte is written to
 $48, while it doesn't matter how often you're writing to $4a
 as  long as $48 is not touched.  After $48 has been written,
 the  whole card disappears from $e8 and is mapped to the new
-address just written.  Make shure $4a is written before $48,
+address just written.  Make sure $4a is written before $48,
 otherwise your chance is only 1:16 to find the board :-).
 
 The local memory-map is even active when mapped to $e8:
index 545447ac503a8ac0dee22df30d27654737675faa..a12059886755c7d2b5ff346eaaf495f9376a589a 100644 (file)
@@ -87,7 +87,7 @@
  *        would fail and generate an error message in the system log.
  *      - For opt_c: slave should not be set to the master's setting
  *        while it is running. It was already set during enslave. To
- *        simplify things, it is now handeled separately.
+ *        simplify things, it is now handled separately.
  *
  *    - 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
  *      - Code cleanup and style changes
index 6b2921be19090c9a5a0a6a85a87f4e6d525ff258..3859749810b41fd27cd74608d6678f57723f0f3d 100644 (file)
@@ -314,10 +314,11 @@ time_init(void)
        if (!est_cycle_freq)
                est_cycle_freq = validate_cc_value(calibrate_cc_with_pit());
 
-       cc1 = rpcc_after_update_in_progress();
+       cc1 = rpcc();
 
        /* Calibrate CPU clock -- attempt #2.  */
        if (!est_cycle_freq) {
+               cc1 = rpcc_after_update_in_progress();
                cc2 = rpcc_after_update_in_progress();
                est_cycle_freq = validate_cc_value(cc2 - cc1);
                cc1 = cc2;
index 838e435e49223558aad338940ddd2809070c7249..cab355c0c1f782d28fc7c074f5a08b1661fadc50 100644 (file)
 
 
 /*
- * Abort preanble and completion macros.
+ * Abort preamble and completion macros.
  * If a fixup handler is required then those macros must surround it.
  * It is assumed that the fixup code will handle the private part of
  * the exit macro.
index 2c64a0b0502e6beaac9f19596854c55add0cae8a..5d02e95dede310ac52c00cb3e8832b5a83760d09 100644 (file)
@@ -34,27 +34,12 @@ static int rtc_base;
 static unsigned long __init get_isa_cmos_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
-       int i;
 
        // check to see if the RTC makes sense.....
        if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0)
                return mktime(1970, 1, 1, 0, 0, 0);
 
-       /* The Linux interpretation of the CMOS clock register contents:
-        * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
-        * RTC registers show the second which has precisely just started.
-        * Let's hope other operating systems interpret the RTC the same way.
-        */
-       /* read RTC exactly on falling edge of update flag */
-       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
-               if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
-                       break;
-
-       for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
-               if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
-                       break;
-
-       do { /* Isn't this overkill ? UIP above should guarantee consistency */
+       do {
                sec  = CMOS_READ(RTC_SECONDS);
                min  = CMOS_READ(RTC_MINUTES);
                hour = CMOS_READ(RTC_HOURS);
index 311b4e7266f16f891c86c9687af267953bd28c68..3b329af4afc53dc5303a93dc3d573c1c41517891 100644 (file)
@@ -381,7 +381,7 @@ static void do_irq_balance(void)
        unsigned long imbalance = 0;
        cpumask_t allowed_mask, target_cpu_mask, tmp;
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                int package_index;
                CPU_IRQ(i) = 0;
                if (!cpu_online(i))
@@ -632,7 +632,7 @@ static int __init balanced_irq_init(void)
        else 
                printk(KERN_ERR "balanced_irq_init: failed to spawn balanced_irq");
 failed:
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                kfree(irq_cpu_data[i].irq_delta);
                irq_cpu_data[i].irq_delta = NULL;
                kfree(irq_cpu_data[i].last_irq);
index dd780a00553f3eeeeb038c25824d8a8346a00114..e7c138f66c5ac91dd9eaedba94d8deb731c062f7 100644 (file)
@@ -459,26 +459,9 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_
        return ret;
 }
 
-static int microcode_ioctl (struct inode *inode, struct file *file, 
-               unsigned int cmd, unsigned long arg)
-{
-       switch (cmd) {
-               /* 
-                *  XXX: will be removed after microcode_ctl 
-                *  is updated to ignore failure of this ioctl()
-                */
-               case MICROCODE_IOCFREE:
-                       return 0;
-               default:
-                       return -EINVAL;
-       }
-       return -EINVAL;
-}
-
 static struct file_operations microcode_fops = {
        .owner          = THIS_MODULE,
        .write          = microcode_write,
-       .ioctl          = microcode_ioctl,
        .open           = microcode_open,
 };
 
index 9074818b9473face4d96ead8b36987d61c81a53e..d43b498ec745e2ea335d1282df274311eac62234 100644 (file)
@@ -138,12 +138,12 @@ static int __init check_nmi_watchdog(void)
        if (nmi_watchdog == NMI_LOCAL_APIC)
                smp_call_function(nmi_cpu_busy, (void *)&endflag, 0, 0);
 
-       for_each_cpu(cpu)
+       for_each_possible_cpu(cpu)
                prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count;
        local_irq_enable();
        mdelay((10*1000)/nmi_hz); // wait 10 ticks
 
-       for_each_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
 #ifdef CONFIG_SMP
                /* Check cpu_callin_map here because that is set
                   after the timer is started. */
@@ -510,7 +510,7 @@ void touch_nmi_watchdog (void)
         * Just reset the alert counters, (other CPUs might be
         * spinning on locks we hold):
         */
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                alert_counter[i] = 0;
 
        /*
@@ -529,7 +529,8 @@ void nmi_watchdog_tick (struct pt_regs * regs)
         * always switch the stack NMI-atomically, it's safe to use
         * smp_processor_id().
         */
-       int sum, cpu = smp_processor_id();
+       unsigned int sum;
+       int cpu = smp_processor_id();
 
        sum = per_cpu(irq_stat, cpu).apic_timer_irqs;
 
index 8165626a5c30ba0e2967d9419ea8648033ba91c0..70e560a1b79ad1c457d0ac9777d3931d2c8ba87a 100644 (file)
@@ -1700,7 +1700,7 @@ after_handle_vic_irq(unsigned int irq)
 
                        printk("VOYAGER SMP: CPU%d lost interrupt %d\n",
                               cpu, irq);
-                       for_each_cpu(real_cpu, mask) {
+                       for_each_possible_cpu(real_cpu, mask) {
 
                                outb(VIC_CPU_MASQUERADE_ENABLE | real_cpu,
                                     VIC_PROCESSOR_ID);
index 1accce50c2c7ddaf1f3b534a5aeab0d92c88b393..1a2076ce6f6a7107346a46ce29cfb8a956d2aed9 100644 (file)
@@ -122,7 +122,7 @@ static void nmi_save_registers(void * dummy)
 static void free_msrs(void)
 {
        int i;
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                kfree(cpu_msrs[i].counters);
                cpu_msrs[i].counters = NULL;
                kfree(cpu_msrs[i].controls);
index c686d9c12f7b1dc3c66b49f72acbd128466339bb..5100261310f76465a10925aa397e4c4228e25253 100644 (file)
@@ -93,19 +93,22 @@ static int coherence_id_open(struct inode *inode, struct file *file)
 static struct proc_dir_entry
 *sn_procfs_create_entry(const char *name, struct proc_dir_entry *parent,
                        int (*openfunc)(struct inode *, struct file *),
-                       int (*releasefunc)(struct inode *, struct file *))
+       int (*releasefunc)(struct inode *, struct file *),
+       ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *))
 {
        struct proc_dir_entry *e = create_proc_entry(name, 0444, parent);
 
        if (e) {
-               e->proc_fops = (struct file_operations *)kmalloc(
-                       sizeof(struct file_operations), GFP_KERNEL);
-               if (e->proc_fops) {
-                       memset(e->proc_fops, 0, sizeof(struct file_operations));
-                       e->proc_fops->open = openfunc;
-                       e->proc_fops->read = seq_read;
-                       e->proc_fops->llseek = seq_lseek;
-                       e->proc_fops->release = releasefunc;
+               struct file_operations *f;
+
+               f = kzalloc(sizeof(*f), GFP_KERNEL);
+               if (f) {
+                       f->open = openfunc;
+                       f->read = seq_read;
+                       f->llseek = seq_lseek;
+                       f->release = releasefunc;
+                       f->write = write;
+                       e->proc_fops = f;
                }
        }
 
@@ -119,31 +122,29 @@ extern int sn_topology_release(struct inode *, struct file *);
 void register_sn_procfs(void)
 {
        static struct proc_dir_entry *sgi_proc_dir = NULL;
-       struct proc_dir_entry *e;
 
        BUG_ON(sgi_proc_dir != NULL);
        if (!(sgi_proc_dir = proc_mkdir("sgi_sn", NULL)))
                return;
 
        sn_procfs_create_entry("partition_id", sgi_proc_dir,
-                              partition_id_open, single_release);
+               partition_id_open, single_release, NULL);
 
        sn_procfs_create_entry("system_serial_number", sgi_proc_dir,
-                              system_serial_number_open, single_release);
+               system_serial_number_open, single_release, NULL);
 
        sn_procfs_create_entry("licenseID", sgi_proc_dir, 
-                              licenseID_open, single_release);
+               licenseID_open, single_release, NULL);
 
-       e = sn_procfs_create_entry("sn_force_interrupt", sgi_proc_dir, 
-                                  sn_force_interrupt_open, single_release);
-       if (e) 
-               e->proc_fops->write = sn_force_interrupt_write_proc;
+       sn_procfs_create_entry("sn_force_interrupt", sgi_proc_dir,
+               sn_force_interrupt_open, single_release,
+               sn_force_interrupt_write_proc);
 
        sn_procfs_create_entry("coherence_id", sgi_proc_dir, 
-                              coherence_id_open, single_release);
+               coherence_id_open, single_release, NULL);
        
        sn_procfs_create_entry("sn_topology", sgi_proc_dir,
-                              sn_topology_open, sn_topology_release);
+               sn_topology_open, sn_topology_release, NULL);
 }
 
 #endif /* CONFIG_PROC_FS */
index a69fe3048edce030e8d65d6403e75e291bd1176e..b0e4c084df8a062aaf25293908d081dbf9daa5a5 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/poll.h>
 #include <linux/mc146818rtc.h> /* For struct rtc_time and ioctls, etc */
 #include <linux/smp_lock.h>
+#include <linux/bcd.h>
 #include <asm/mvme16xhw.h>
 
 #include <asm/io.h>
@@ -31,9 +32,6 @@
  *     ioctls.
  */
 
-#define BCD2BIN(val) (((val)&15) + ((val)>>4)*10)
-#define BIN2BCD(val) ((((val)/10)<<4) + (val)%10)
-
 static const unsigned char days_in_mo[] =
 {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
index f17d3378e9a6796aaf76df4415c13bc58a9ce0d7..74cb055d4bf64d859923a6aeb33fa23bded02f84 100644 (file)
 #include <asm/dec/ioasic_addrs.h>
 #include <asm/dec/machtype.h>
 
-
-/*
- * Returns true if a clock update is in progress
- */
-static inline unsigned char dec_rtc_is_updating(void)
-{
-       unsigned char uip;
-       unsigned long flags;
-
-       spin_lock_irqsave(&rtc_lock, flags);
-       uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
-       spin_unlock_irqrestore(&rtc_lock, flags);
-       return uip;
-}
-
 static unsigned long dec_rtc_get_time(void)
 {
        unsigned int year, mon, day, hour, min, sec, real_year;
-       int i;
        unsigned long flags;
 
-       /* The Linux interpretation of the DS1287 clock register contents:
-        * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
-        * RTC registers show the second which has precisely just started.
-        * Let's hope other operating systems interpret the RTC the same way.
-        */
-       /* read RTC exactly on falling edge of update flag */
-       for (i = 0; i < 1000000; i++)   /* may take up to 1 second... */
-               if (dec_rtc_is_updating())
-                       break;
-       for (i = 0; i < 1000000; i++)   /* must try at least 2.228 ms */
-               if (!dec_rtc_is_updating())
-                       break;
        spin_lock_irqsave(&rtc_lock, flags);
-       /* Isn't this overkill?  UIP above should guarantee consistency */
+
        do {
                sec = CMOS_READ(RTC_SECONDS);
                min = CMOS_READ(RTC_MINUTES);
@@ -78,7 +50,16 @@ static unsigned long dec_rtc_get_time(void)
                day = CMOS_READ(RTC_DAY_OF_MONTH);
                mon = CMOS_READ(RTC_MONTH);
                year = CMOS_READ(RTC_YEAR);
+               /*
+                * The PROM will reset the year to either '72 or '73.
+                * Therefore we store the real year separately, in one
+                * of unused BBU RAM locations.
+                */
+               real_year = CMOS_READ(RTC_DEC_YEAR);
        } while (sec != CMOS_READ(RTC_SECONDS));
+
+       spin_unlock_irqrestore(&rtc_lock, flags);
+
        if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
                sec = BCD2BIN(sec);
                min = BCD2BIN(min);
@@ -87,13 +68,7 @@ static unsigned long dec_rtc_get_time(void)
                mon = BCD2BIN(mon);
                year = BCD2BIN(year);
        }
-       /*
-        * The PROM will reset the year to either '72 or '73.
-        * Therefore we store the real year separately, in one
-        * of unused BBU RAM locations.
-        */
-       real_year = CMOS_READ(RTC_DEC_YEAR);
-       spin_unlock_irqrestore(&rtc_lock, flags);
+
        year += real_year - 72 + 2000;
 
        return mktime(year, mon, day, hour, min, sec);
index 969612eab8a621b7a7fe46441f6607cdbdb10fd0..370e75d0e75cdf2d4897806a0c47d59a6ff3df0e 100644 (file)
@@ -58,6 +58,7 @@
 #include <linux/bootmem.h>
 #include <linux/mv643xx.h>
 #include <linux/pm.h>
+#include <linux/bcd.h>
 
 #include <asm/time.h>
 #include <asm/page.h>
@@ -131,9 +132,6 @@ void setup_wired_tlb_entries(void)
        add_wired_entry(ENTRYLO(0xfc000000), ENTRYLO(0xfd000000), (signed)0xfc000000, PM_16M);
 }
 
-#define CONV_BCD_TO_BIN(val)   (((val) & 0xf) + (((val) >> 4) * 10))
-#define CONV_BIN_TO_BCD(val)   (((val) % 10) + (((val) / 10) << 4))
-
 unsigned long m48t37y_get_time(void)
 {
        unsigned int year, month, day, hour, min, sec;
@@ -143,16 +141,16 @@ unsigned long m48t37y_get_time(void)
        /* stop the update */
        rtc_base[0x7ff8] = 0x40;
 
-       year = CONV_BCD_TO_BIN(rtc_base[0x7fff]);
-       year += CONV_BCD_TO_BIN(rtc_base[0x7ff1]) * 100;
+       year = BCD2BIN(rtc_base[0x7fff]);
+       year += BCD2BIN(rtc_base[0x7ff1]) * 100;
 
-       month = CONV_BCD_TO_BIN(rtc_base[0x7ffe]);
+       month = BCD2BIN(rtc_base[0x7ffe]);
 
-       day = CONV_BCD_TO_BIN(rtc_base[0x7ffd]);
+       day = BCD2BIN(rtc_base[0x7ffd]);
 
-       hour = CONV_BCD_TO_BIN(rtc_base[0x7ffb]);
-       min = CONV_BCD_TO_BIN(rtc_base[0x7ffa]);
-       sec = CONV_BCD_TO_BIN(rtc_base[0x7ff9]);
+       hour = BCD2BIN(rtc_base[0x7ffb]);
+       min = BCD2BIN(rtc_base[0x7ffa]);
+       sec = BCD2BIN(rtc_base[0x7ff9]);
 
        /* start the update */
        rtc_base[0x7ff8] = 0x00;
@@ -175,22 +173,22 @@ int m48t37y_set_time(unsigned long sec)
        rtc_base[0x7ff8] = 0x80;
 
        /* year */
-       rtc_base[0x7fff] = CONV_BIN_TO_BCD(tm.tm_year % 100);
-       rtc_base[0x7ff1] = CONV_BIN_TO_BCD(tm.tm_year / 100);
+       rtc_base[0x7fff] = BIN2BCD(tm.tm_year % 100);
+       rtc_base[0x7ff1] = BIN2BCD(tm.tm_year / 100);
 
        /* month */
-       rtc_base[0x7ffe] = CONV_BIN_TO_BCD(tm.tm_mon);
+       rtc_base[0x7ffe] = BIN2BCD(tm.tm_mon);
 
        /* day */
-       rtc_base[0x7ffd] = CONV_BIN_TO_BCD(tm.tm_mday);
+       rtc_base[0x7ffd] = BIN2BCD(tm.tm_mday);
 
        /* hour/min/sec */
-       rtc_base[0x7ffb] = CONV_BIN_TO_BCD(tm.tm_hour);
-       rtc_base[0x7ffa] = CONV_BIN_TO_BCD(tm.tm_min);
-       rtc_base[0x7ff9] = CONV_BIN_TO_BCD(tm.tm_sec);
+       rtc_base[0x7ffb] = BIN2BCD(tm.tm_hour);
+       rtc_base[0x7ffa] = BIN2BCD(tm.tm_min);
+       rtc_base[0x7ff9] = BIN2BCD(tm.tm_sec);
 
        /* day of week -- not really used, but let's keep it up-to-date */
-       rtc_base[0x7ffc] = CONV_BIN_TO_BCD(tm.tm_wday + 1);
+       rtc_base[0x7ffc] = BIN2BCD(tm.tm_wday + 1);
 
        /* disable writing */
        rtc_base[0x7ff8] = 0x00;
index f74295f2852732d457eb1442280a2d249204af04..07f782fc072506397f696882ff9126ae6de5d4c1 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/string.h>
 #include <linux/rtc.h>
 #include <linux/time.h>
+#include <linux/bcd.h>
 #include <asm/time.h>
 #include <asm/tx4938/spi.h>
 
@@ -77,17 +78,6 @@ spi_rtc_io(unsigned char *inbuf, unsigned char *outbuf, unsigned int count)
                           inbufs, incounts, outbufs, outcounts, 0);
 }
 
-/*
- * Conversion between binary and BCD.
- */
-#ifndef BCD_TO_BIN
-#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
-#endif
-
-#ifndef BIN_TO_BCD
-#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
-#endif
-
 /* RTC-dependent code for time.c */
 
 static int
index b3962c3a03480ca16a36dcdb98c44cf4dc6839ad..5be40aa483fdb8644a3667e5480449cdc40e30a6 100644 (file)
@@ -103,7 +103,7 @@ spufs_setattr(struct dentry *dentry, struct iattr *attr)
 
 static int
 spufs_new_file(struct super_block *sb, struct dentry *dentry,
-               struct file_operations *fops, int mode,
+               const struct file_operations *fops, int mode,
                struct spu_context *ctx)
 {
        static struct inode_operations spufs_file_iops = {
index 12c6f689b1aa443af167344a4bc976b27caba44f..7d7889026936a2eee1366b4ba7e6cc6b9e35923c 100644 (file)
@@ -120,33 +120,15 @@ int chrp_set_rtc_time(struct rtc_time *tmarg)
 void chrp_get_rtc_time(struct rtc_time *tm)
 {
        unsigned int year, mon, day, hour, min, sec;
-       int uip, i;
 
-       /* The Linux interpretation of the CMOS clock register contents:
-        * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
-        * RTC registers show the second which has precisely just started.
-        * Let's hope other operating systems interpret the RTC the same way.
-        */
-
-       /* Since the UIP flag is set for about 2.2 ms and the clock
-        * is typically written with a precision of 1 jiffy, trying
-        * to obtain a precision better than a few milliseconds is
-        * an illusion. Only consistency is interesting, this also
-        * allows to use the routine for /dev/rtc without a potential
-        * 1 second kernel busy loop triggered by any reader of /dev/rtc.
-        */
-
-       for ( i = 0; i<1000000; i++) {
-               uip = chrp_cmos_clock_read(RTC_FREQ_SELECT);
+       do {
                sec = chrp_cmos_clock_read(RTC_SECONDS);
                min = chrp_cmos_clock_read(RTC_MINUTES);
                hour = chrp_cmos_clock_read(RTC_HOURS);
                day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH);
                mon = chrp_cmos_clock_read(RTC_MONTH);
                year = chrp_cmos_clock_read(RTC_YEAR);
-               uip |= chrp_cmos_clock_read(RTC_FREQ_SELECT);
-               if ((uip & RTC_UIP)==0) break;
-       }
+       } while (sec != chrp_cmos_clock_read(RTC_SECONDS));
 
        if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
                BCD_TO_BIN(sec);
index 5e6981d17379351ccf5bdf60f3b84bc7d843a8e1..b9a2b3d4bf3323d6a04bf7f91f6f158d01b10030 100644 (file)
@@ -60,34 +60,14 @@ static void maple_clock_write(unsigned long val, int addr)
 
 void maple_get_rtc_time(struct rtc_time *tm)
 {
-       int uip, i;
-
-       /* The Linux interpretation of the CMOS clock register contents:
-        * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
-        * RTC registers show the second which has precisely just started.
-        * Let's hope other operating systems interpret the RTC the same way.
-        */
-
-       /* Since the UIP flag is set for about 2.2 ms and the clock
-        * is typically written with a precision of 1 jiffy, trying
-        * to obtain a precision better than a few milliseconds is
-        * an illusion. Only consistency is interesting, this also
-        * allows to use the routine for /dev/rtc without a potential
-        * 1 second kernel busy loop triggered by any reader of /dev/rtc.
-        */
-
-       for (i = 0; i<1000000; i++) {
-               uip = maple_clock_read(RTC_FREQ_SELECT);
+       do {
                tm->tm_sec = maple_clock_read(RTC_SECONDS);
                tm->tm_min = maple_clock_read(RTC_MINUTES);
                tm->tm_hour = maple_clock_read(RTC_HOURS);
                tm->tm_mday = maple_clock_read(RTC_DAY_OF_MONTH);
                tm->tm_mon = maple_clock_read(RTC_MONTH);
                tm->tm_year = maple_clock_read(RTC_YEAR);
-               uip |= maple_clock_read(RTC_FREQ_SELECT);
-               if ((uip & RTC_UIP)==0)
-                       break;
-       }
+       } while (tm->tm_sec != maple_clock_read(RTC_SECONDS));
 
        if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY)
            || RTC_ALWAYS_BCD) {
index 2f5c7650274f26a76e7b4f75cba8ed554dccc33e..9b84bffdefced595f8876b2f5855feab0b063611 100644 (file)
@@ -52,7 +52,7 @@ static int ppc_htab_open(struct inode *inode, struct file *file)
        return single_open(file, ppc_htab_show, NULL);
 }
 
-struct file_operations ppc_htab_operations = {
+const struct file_operations ppc_htab_operations = {
        .open           = ppc_htab_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index c8627770af139a9a0beddd844c2e9802fe93c465..51e06ad661687e292d6c10953e86096b3318865e 100644 (file)
@@ -119,44 +119,28 @@ int chrp_set_rtc_time(unsigned long nowtime)
 unsigned long chrp_get_rtc_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
-       int uip, i;
 
-       /* The Linux interpretation of the CMOS clock register contents:
-        * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
-        * RTC registers show the second which has precisely just started.
-        * Let's hope other operating systems interpret the RTC the same way.
-        */
-
-       /* Since the UIP flag is set for about 2.2 ms and the clock
-        * is typically written with a precision of 1 jiffy, trying
-        * to obtain a precision better than a few milliseconds is
-        * an illusion. Only consistency is interesting, this also
-        * allows to use the routine for /dev/rtc without a potential
-        * 1 second kernel busy loop triggered by any reader of /dev/rtc.
-        */
-
-       for ( i = 0; i<1000000; i++) {
-               uip = chrp_cmos_clock_read(RTC_FREQ_SELECT);
+       do {
                sec = chrp_cmos_clock_read(RTC_SECONDS);
                min = chrp_cmos_clock_read(RTC_MINUTES);
                hour = chrp_cmos_clock_read(RTC_HOURS);
                day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH);
                mon = chrp_cmos_clock_read(RTC_MONTH);
                year = chrp_cmos_clock_read(RTC_YEAR);
-               uip |= chrp_cmos_clock_read(RTC_FREQ_SELECT);
-               if ((uip & RTC_UIP)==0) break;
+       } while (sec != chrp_cmos_clock_read(RTC_SECONDS));
+
+       if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY)
+           || RTC_ALWAYS_BCD) {
+               BCD_TO_BIN(sec);
+               BCD_TO_BIN(min);
+               BCD_TO_BIN(hour);
+               BCD_TO_BIN(day);
+               BCD_TO_BIN(mon);
+               BCD_TO_BIN(year);
        }
 
-       if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
-         {
-           BCD_TO_BIN(sec);
-           BCD_TO_BIN(min);
-           BCD_TO_BIN(hour);
-           BCD_TO_BIN(day);
-           BCD_TO_BIN(mon);
-           BCD_TO_BIN(year);
-         }
-       if ((year += 1900) < 1970)
+       year += 1900;
+       if (year < 1970)
                year += 100;
        return mktime(year, mon, day, hour, min, sec);
 }
index 4d100f0480723ed8d7382901bdb358519376f475..a76c655dceeeba4790a2654b03e525f824bf24ee 100644 (file)
@@ -9,36 +9,16 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/time.h>
+#include <linux/bcd.h>
 #include <linux/mc146818rtc.h>
 
-#ifndef BCD_TO_BIN
-#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
-#endif
-
-#ifndef BIN_TO_BCD
-#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
-#endif
-
-/* arc/i386/kernel/time.c */
 unsigned long get_cmos_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
-       int i;
 
        spin_lock(&rtc_lock);
-       /* The Linux interpretation of the CMOS clock register contents:
-        * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
-        * RTC registers show the second which has precisely just started.
-        * Let's hope other operating systems interpret the RTC the same way.
-        */
-       /* read RTC exactly on falling edge of update flag */
-       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
-               if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
-                       break;
-       for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
-               if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
-                       break;
-       do { /* Isn't this overkill ? UIP above should guarantee consistency */
+
+       do {
                sec = CMOS_READ(RTC_SECONDS);
                min = CMOS_READ(RTC_MINUTES);
                hour = CMOS_READ(RTC_HOURS);
@@ -46,18 +26,22 @@ unsigned long get_cmos_time(void)
                mon = CMOS_READ(RTC_MONTH);
                year = CMOS_READ(RTC_YEAR);
        } while (sec != CMOS_READ(RTC_SECONDS));
-       if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
-         {
-           BCD_TO_BIN(sec);
-           BCD_TO_BIN(min);
-           BCD_TO_BIN(hour);
-           BCD_TO_BIN(day);
-           BCD_TO_BIN(mon);
-           BCD_TO_BIN(year);
-         }
+
+       if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
+               BCD_TO_BIN(sec);
+               BCD_TO_BIN(min);
+               BCD_TO_BIN(hour);
+               BCD_TO_BIN(day);
+               BCD_TO_BIN(mon);
+               BCD_TO_BIN(year);
+       }
+
        spin_unlock(&rtc_lock);
-       if ((year += 1900) < 1970)
+
+       year += 1900;
+       if (year < 1970)
                year += 100;
+
        return mktime(year, mon, day, hour, min, sec);
 }
 
index cbeca7037ba562321c3607e3b83d493d71ea2356..d609863cfe53fba5ba3068da2d1d78a95d2bade5 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/time.h>
+#include <linux/bcd.h>
 #include <asm/io.h>
 #include <linux/rtc.h>
 #include <linux/spinlock.h>
 #define RTC_BUSY       1
 #define RTC_STOP       2
 
-#ifndef BCD_TO_BIN
-#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
-#endif
-
-#ifndef BIN_TO_BCD
-#define BIN_TO_BCD(val)        ((val)=(((val)/10)<<4) + (val)%10)
-#endif
-
 extern void (*rtc_get_time)(struct timespec *);
 extern int (*rtc_set_time)(const time_t);
 extern spinlock_t rtc_lock;
@@ -48,13 +41,9 @@ extern spinlock_t rtc_lock;
 unsigned long get_cmos_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
-       int i;
 
        spin_lock(&rtc_lock);
  again:
-       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
-               if (!(ctrl_inb(RTC_CTL) & RTC_BUSY))
-                       break;
        do {
                sec  = (ctrl_inb(RTC_SEC1) & 0xf) + (ctrl_inb(RTC_SEC10) & 0x7) * 10;
                min  = (ctrl_inb(RTC_MIN1) & 0xf) + (ctrl_inb(RTC_MIN10) & 0xf) * 10;
index f8361f5e788bc81896f3635d268ebf7a40056974..4304cf75cfa2e7ef6076a7864b4a375408a20eb4 100644 (file)
@@ -9,18 +9,10 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/time.h>
-
+#include <linux/bcd.h>
 #include <asm/io.h>
 #include <asm/rtc.h>
 
-#ifndef BCD_TO_BIN
-#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
-#endif
-
-#ifndef BIN_TO_BCD
-#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
-#endif
-
 void sh_rtc_gettimeofday(struct timespec *ts)
 {
        unsigned int sec128, sec, sec2, min, hr, wk, day, mon, yr, yr100, cf_bit;
index 0773c9f389f3b14798b8f912e009b0503c103d2d..6b8f4d22abc69a2b2d49118281cb7f04cdb63e85 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/profile.h>
 #include <linux/smp.h>
 #include <linux/module.h>
+#include <linux/bcd.h>
 
 #include <asm/registers.h>      /* required by inline __asm__ stmt. */
 
 #define RCR1           rtc_base+0x38
 #define RCR2           rtc_base+0x3c
 
-#ifndef BCD_TO_BIN
-#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
-#endif
-
-#ifndef BIN_TO_BCD
-#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
-#endif
-
 #define TICK_SIZE (tick_nsec / 1000)
 
 extern unsigned long wall_jiffies;
index 7d61f1bfd3d33806b2babc5e7065a35542f14c63..e55b5c6ece027e91dfbf9bd9a434b527207fbb58 100644 (file)
@@ -641,23 +641,8 @@ static void __init set_system_time(void)
                mon = MSTK_REG_MONTH(mregs);
                year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );
        } else {
-               int i;
-
                /* Dallas 12887 RTC chip. */
 
-               /* Stolen from arch/i386/kernel/time.c, see there for
-                * credits and descriptive comments.
-                */
-               for (i = 0; i < 1000000; i++) {
-                       if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
-                               break;
-                       udelay(10);
-               }
-               for (i = 0; i < 1000000; i++) {
-                       if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
-                               break;
-                       udelay(10);
-               }
                do {
                        sec  = CMOS_READ(RTC_SECONDS);
                        min  = CMOS_READ(RTC_MINUTES);
@@ -666,6 +651,7 @@ static void __init set_system_time(void)
                        mon  = CMOS_READ(RTC_MONTH);
                        year = CMOS_READ(RTC_YEAR);
                } while (sec != CMOS_READ(RTC_SECONDS));
+
                if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
                        BCD_TO_BIN(sec);
                        BCD_TO_BIN(min);
index 7f58fa6824917beef6104bb6f3e1414179a8381b..473b514b66e437bc835d4958c57592e06b21ff53 100644 (file)
@@ -504,42 +504,25 @@ unsigned long long sched_clock(void)
 
 static unsigned long get_cmos_time(void)
 {
-       unsigned int timeout = 1000000, year, mon, day, hour, min, sec;
-       unsigned char uip = 0, this = 0;
+       unsigned int year, mon, day, hour, min, sec;
        unsigned long flags;
        unsigned extyear = 0;
 
-/*
- * The Linux interpretation of the CMOS clock register contents: When the
- * Update-In-Progress (UIP) flag goes from 1 to 0, the RTC registers show the
- * second which has precisely just started. Waiting for this can take up to 1
- * second, we timeout approximately after 2.4 seconds on a machine with
- * standard 8.3 MHz ISA bus.
- */
-
        spin_lock_irqsave(&rtc_lock, flags);
 
-       while (timeout && (!uip || this)) {
-               uip |= this;
-               this = CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP;
-               timeout--;
-       }
-
-       /*
-        * Here we are safe to assume the registers won't change for a whole
-        * second, so we just go ahead and read them.
-        */
-       sec = CMOS_READ(RTC_SECONDS);
-       min = CMOS_READ(RTC_MINUTES);
-       hour = CMOS_READ(RTC_HOURS);
-       day = CMOS_READ(RTC_DAY_OF_MONTH);
-       mon = CMOS_READ(RTC_MONTH);
-       year = CMOS_READ(RTC_YEAR);
-
+       do {
+               sec = CMOS_READ(RTC_SECONDS);
+               min = CMOS_READ(RTC_MINUTES);
+               hour = CMOS_READ(RTC_HOURS);
+               day = CMOS_READ(RTC_DAY_OF_MONTH);
+               mon = CMOS_READ(RTC_MONTH);
+               year = CMOS_READ(RTC_YEAR);
 #ifdef CONFIG_ACPI
-       if (acpi_fadt.revision >= FADT2_REVISION_ID && acpi_fadt.century)
-               extyear = CMOS_READ(acpi_fadt.century);
+               if (acpi_fadt.revision >= FADT2_REVISION_ID &&
+                                       acpi_fadt.century)
+                       extyear = CMOS_READ(acpi_fadt.century);
 #endif
+       } while (sec != CMOS_READ(RTC_SECONDS));
 
        spin_unlock_irqrestore(&rtc_lock, flags);
 
index 7b23743eb9c528999bbc0a7fae90cccb122e2170..5b26af8597f3fae3bcb4651186ebb748eaa8583c 100644 (file)
@@ -3514,7 +3514,7 @@ int __init blk_dev_init(void)
        iocontext_cachep = kmem_cache_create("blkdev_ioc",
                        sizeof(struct io_context), 0, SLAB_PANIC, NULL, NULL);
 
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                INIT_LIST_HEAD(&per_cpu(blk_cpu_done, i));
 
        open_softirq(BLOCK_SOFTIRQ, blk_done_softirq, NULL);
index 69f4c7ce9a633b04dea5611402a06159c118daba..cac09e353be8d0d87135c7f17e1fb8eaba7a95e8 100644 (file)
@@ -1972,7 +1972,7 @@ static int __devinit lanai_pci_start(struct lanai_dev *lanai)
                    "(itf %d): No suitable DMA available.\n", lanai->number);
                return -EBUSY;
        }
-       if (pci_set_consistent_dma_mask(pci, 0xFFFFFFFF) != 0) {
+       if (pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) != 0) {
                printk(KERN_WARNING DEV_LABEL
                    "(itf %d): No suitable DMA available.\n", lanai->number);
                return -EBUSY;
index 49c7cd558ddfcb7133bfb366c9df6755c956fc68..45bcda544880a598de44437c38db947d1b42840d 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/timer.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/jiffies.h>
 #include <linux/random.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -3654,8 +3655,8 @@ static void DAC960_V1_ProcessCompletedCommand(DAC960_Command_T *Command)
              (NewEnquiry->EventLogSequenceNumber !=
               OldEnquiry->EventLogSequenceNumber) ||
              Controller->MonitoringTimerCount == 0 ||
-             (jiffies - Controller->SecondaryMonitoringTime
-              >= DAC960_SecondaryMonitoringInterval))
+             time_after_eq(jiffies, Controller->SecondaryMonitoringTime
+              + DAC960_SecondaryMonitoringInterval))
            {
              Controller->V1.NeedLogicalDriveInformation = true;
              Controller->V1.NewEventLogSequenceNumber =
@@ -5640,8 +5641,8 @@ static void DAC960_MonitoringTimerFunction(unsigned long TimerData)
       unsigned int StatusChangeCounter =
        Controller->V2.HealthStatusBuffer->StatusChangeCounter;
       boolean ForceMonitoringCommand = false;
-      if (jiffies - Controller->SecondaryMonitoringTime
-         > DAC960_SecondaryMonitoringInterval)
+      if (time_after(jiffies, Controller->SecondaryMonitoringTime
+         + DAC960_SecondaryMonitoringInterval))
        {
          int LogicalDriveNumber;
          for (LogicalDriveNumber = 0;
@@ -5669,8 +5670,8 @@ static void DAC960_MonitoringTimerFunction(unsigned long TimerData)
           ControllerInfo->ConsistencyChecksActive +
           ControllerInfo->RebuildsActive +
           ControllerInfo->OnlineExpansionsActive == 0 ||
-          jiffies - Controller->PrimaryMonitoringTime
-          < DAC960_MonitoringTimerInterval) &&
+          time_before(jiffies, Controller->PrimaryMonitoringTime
+          + DAC960_MonitoringTimerInterval)) &&
          !ForceMonitoringCommand)
        {
          Controller->MonitoringTimer.expires =
@@ -5807,8 +5808,8 @@ static void DAC960_Message(DAC960_MessageLevel_T MessageLevel,
       Controller->ProgressBufferLength = Length;
       if (Controller->EphemeralProgressMessage)
        {
-         if (jiffies - Controller->LastProgressReportTime
-             >= DAC960_ProgressReportingInterval)
+         if (time_after_eq(jiffies, Controller->LastProgressReportTime
+             + DAC960_ProgressReportingInterval))
            {
              printk("%sDAC960#%d: %s", DAC960_MessageLevelMap[MessageLevel],
                     Controller->ControllerNumber, Buffer);
index 875ae7699025add355935826cccb2d7dc2266900..ae0949b3394f1574777e12e9adfde58b45dbc0a9 100644 (file)
@@ -383,8 +383,9 @@ config BLK_DEV_RAM
          thus say N here.
 
 config BLK_DEV_RAM_COUNT
-       int "Default number of RAM disks" if BLK_DEV_RAM
+       int "Default number of RAM disks"
        default "16"
+       depends on BLK_DEV_RAM
        help
          The default value is 16 RAM disks. Change this if you know what
          are doing. If you boot from a filesystem that needs to be extracted
index a5c1c8e871ec38aacc9abcbbe15a211ab3269b85..4cb9c13362874cedbed44c24a2982046d1e74e4c 100644 (file)
@@ -369,8 +369,6 @@ static ssize_t slm_read( struct file *file, char *buf, size_t count,
        int length;
        int end;
 
-       if (count < 0)
-               return( -EINVAL );
        if (!(page = __get_free_page( GFP_KERNEL )))
                return( -ENOMEM );
        
index d3ad9081697ea35852a417256c70d56e97d77c46..bedb689b051fe5cb9e58667b082673208b41cc81 100644 (file)
@@ -170,6 +170,7 @@ static int print_unex = 1;
 #include <linux/mm.h>
 #include <linux/bio.h>
 #include <linux/string.h>
+#include <linux/jiffies.h>
 #include <linux/fcntl.h>
 #include <linux/delay.h>
 #include <linux/mc146818rtc.h> /* CMOS defines */
@@ -747,7 +748,7 @@ static int disk_change(int drive)
 {
        int fdc = FDC(drive);
 #ifdef FLOPPY_SANITY_CHECK
-       if (jiffies - UDRS->select_date < UDP->select_delay)
+       if (time_before(jiffies, UDRS->select_date + UDP->select_delay))
                DPRINT("WARNING disk change called early\n");
        if (!(FDCS->dor & (0x10 << UNIT(drive))) ||
            (FDCS->dor & 3) != UNIT(drive) || fdc != FDC(drive)) {
@@ -1075,7 +1076,7 @@ static int fd_wait_for_completion(unsigned long delay, timeout_fn function)
                return 1;
        }
 
-       if ((signed)(jiffies - delay) < 0) {
+       if (time_before(jiffies, delay)) {
                del_timer(&fd_timer);
                fd_timer.function = function;
                fd_timer.expires = delay;
@@ -1535,7 +1536,7 @@ static void setup_rw_floppy(void)
                 * again just before spinup completion. Beware that
                 * after scandrives, we must again wait for selection.
                 */
-               if ((signed)(ready_date - jiffies) > DP->select_delay) {
+               if (time_after(ready_date, jiffies + DP->select_delay)) {
                        ready_date -= DP->select_delay;
                        function = (timeout_fn) floppy_start;
                } else
@@ -3823,7 +3824,7 @@ static int check_floppy_change(struct gendisk *disk)
        if (UTESTF(FD_DISK_CHANGED) || UTESTF(FD_VERIFY))
                return 1;
 
-       if (UDP->checkfreq < (int)(jiffies - UDRS->last_checked)) {
+       if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) {
                if (floppy_grab_irq_and_dma()) {
                        return 1;
                }
index 62d2464c12f2001017077dadb883e0a18264be84..2403721f9db107509cc4ff8b628795a70290597e 100644 (file)
@@ -151,6 +151,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_GEO, D_SBY, D_DLY, D_SLV};
 #include <linux/cdrom.h>       /* for the eject ioctl */
 #include <linux/blkdev.h>
 #include <linux/blkpg.h>
+#include <linux/kernel.h>
 #include <asm/uaccess.h>
 #include <linux/sched.h>
 #include <linux/workqueue.h>
@@ -275,7 +276,7 @@ static void pd_print_error(struct pd_unit *disk, char *msg, int status)
        int i;
 
        printk("%s: %s: status = 0x%x =", disk->name, msg, status);
-       for (i = 0; i < 18; i++)
+       for (i = 0; i < ARRAY_SIZE(pd_errs); i++)
                if (status & (1 << i))
                        printk(" %s", pd_errs[i]);
        printk("\n");
index 6f5df0fad70384b1eab9537740f3a8a2bb73cdfe..79b868254032a68505abb3140b8918f8395ee4e2 100644 (file)
@@ -643,7 +643,8 @@ static ssize_t pg_read(struct file *filp, char __user *buf, size_t count, loff_t
 
 static int __init pg_init(void)
 {
-       int unit, err = 0;
+       int unit;
+       int err;
 
        if (disable){
                err = -1;
@@ -657,16 +658,17 @@ static int __init pg_init(void)
                goto out;
        }
 
-       if (register_chrdev(major, name, &pg_fops)) {
+       err = register_chrdev(major, name, &pg_fops);
+       if (err < 0) {
                printk("pg_init: unable to get major number %d\n", major);
                for (unit = 0; unit < PG_UNITS; unit++) {
                        struct pg *dev = &devices[unit];
                        if (dev->present)
                                pi_release(dev->pi);
                }
-               err = -1;
                goto out;
        }
+       major = err;    /* In case the user specified `major=0' (dynamic) */
        pg_class = class_create(THIS_MODULE, "pg");
        if (IS_ERR(pg_class)) {
                err = PTR_ERR(pg_class);
index 715ae5dc88fba4f8a2e1dd191d2bd8d591997d4c..d2013d362403819c49c2e21ffe54f64f311796cd 100644 (file)
@@ -943,7 +943,8 @@ static ssize_t pt_write(struct file *filp, const char __user *buf, size_t count,
 
 static int __init pt_init(void)
 {
-       int unit, err = 0;
+       int unit;
+       int err;
 
        if (disable) {
                err = -1;
@@ -955,14 +956,15 @@ static int __init pt_init(void)
                goto out;
        }
 
-       if (register_chrdev(major, name, &pt_fops)) {
+       err = register_chrdev(major, name, &pt_fops);
+       if (err < 0) {
                printk("pt_init: unable to get major number %d\n", major);
                for (unit = 0; unit < PT_UNITS; unit++)
                        if (pt[unit].present)
                                pi_release(pt[unit].pi);
-               err = -1;
                goto out;
        }
+       major = err;
        pt_class = class_create(THIS_MODULE, "pt");
        if (IS_ERR(pt_class)) {
                err = PTR_ERR(pt_class);
index c16e66b9c7a74f56d1fef2b55ba8f7bdf2de66e8..f7d4c65a7b8c369a76c3b7b82d8cb98ce03dcfa0 100644 (file)
@@ -50,6 +50,7 @@
 #include <linux/timer.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/dma-mapping.h>
 
 #include <linux/fcntl.h>        /* O_ACCMODE */
 #include <linux/hdreg.h>  /* HDIO_GETGEO */
@@ -881,8 +882,8 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i
        printk(KERN_INFO "Micro Memory(tm) controller #%d found at %02x:%02x (PCI Mem Module (Battery Backup))\n",
               card->card_number, dev->bus->number, dev->devfn);
 
-       if (pci_set_dma_mask(dev, 0xffffffffffffffffLL) &&
-           pci_set_dma_mask(dev, 0xffffffffLL)) {
+       if (pci_set_dma_mask(dev, DMA_64BIT_MASK) &&
+           pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
                printk(KERN_WARNING "MM%d: NO suitable DMA found\n",num_cards);
                return  -ENOMEM;
        }
index 70b8ed9cd1722c5cc2526b6976dcefcbf563a87d..4c67135c12d853052b389657d1fba450e1c3dfe4 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/gfp.h>
 #include <linux/page-flags.h>
 #include <linux/mm.h>
+#include <linux/jiffies.h>
 #include "agp.h"
 
 /* NVIDIA registers */
@@ -256,7 +257,7 @@ static void nvidia_tlbflush(struct agp_memory *mem)
                do {
                        pci_read_config_dword(nvidia_private.dev_1,
                                        NVIDIA_1_WBC, &wbc_reg);
-                       if ((signed)(end - jiffies) <= 0) {
+                       if (time_before_eq(end, jiffies)) {
                                printk(KERN_ERR PFX
                                    "TLB flush took more than 3 seconds.\n");
                        }
index 641f7633878c798d660657a5d56a1e1395e9ad38..b7f7951c458721d8b3517c49dd5b4531bfa6f3be 100644 (file)
@@ -175,7 +175,7 @@ int drm_stub_open(struct inode *inode, struct file *filp)
        drm_device_t *dev = NULL;
        int minor = iminor(inode);
        int err = -ENODEV;
-       struct file_operations *old_fops;
+       const struct file_operations *old_fops;
 
        DRM_DEBUG("\n");
 
index ae0aa6d7e0bb74140ca576c89bb4c8bf2fcd5705..c658dde3633b4307b4e38d79eafdf079ab56af0d 100644 (file)
@@ -126,7 +126,7 @@ static int i810_map_buffer(drm_buf_t * buf, struct file *filp)
        drm_device_t *dev = priv->head->dev;
        drm_i810_buf_priv_t *buf_priv = buf->dev_private;
        drm_i810_private_t *dev_priv = dev->dev_private;
-       struct file_operations *old_fops;
+       const struct file_operations *old_fops;
        int retcode = 0;
 
        if (buf_priv->currently_mapped == I810_BUF_MAPPED)
index 163f2cbfe60d2dd4b1c90761f4aaf0a95145db76..b0f815d8cea8592028cee0540f6b23ffe3dac9c8 100644 (file)
@@ -128,7 +128,7 @@ static int i830_map_buffer(drm_buf_t * buf, struct file *filp)
        drm_device_t *dev = priv->head->dev;
        drm_i830_buf_priv_t *buf_priv = buf->dev_private;
        drm_i830_private_t *dev_priv = dev->dev_private;
-       struct file_operations *old_fops;
+       const struct file_operations *old_fops;
        unsigned long virtual;
        int retcode = 0;
 
index 5245ba1649ed9b12ba81385ad76bf9c5d3faf5aa..66719f9d294c32457584ae00a08dea2a97e1cdf7 100644 (file)
@@ -899,7 +899,7 @@ static const struct {
        unsigned int            minor;
        char                    *name;
        umode_t                 mode;
-       struct file_operations  *fops;
+       const struct file_operations    *fops;
 } devlist[] = { /* list of minor devices */
        {1, "mem",     S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops},
        {2, "kmem",    S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops},
index 3e4c0414a01a2177d3a1d40638a5dc6b34aa5437..96eb2a709e21d66ca7772d75c83ca79d595c81bf 100644 (file)
@@ -129,7 +129,7 @@ static int misc_open(struct inode * inode, struct file * file)
        int minor = iminor(inode);
        struct miscdevice *c;
        int err = -ENODEV;
-       struct file_operations *old_fops, *new_fops = NULL;
+       const struct file_operations *old_fops, *new_fops = NULL;
        
        down(&misc_sem);
        
index e7fd0b08e0b7fe6a0ef4c1e26665a3aba70ef8de..7e188a4d602a7060915a89eda89d95533bfc2636 100644 (file)
 
 // enable CTS interrupt
 #define MOXA_MUST_IER_ECTSI            0x80
-// eanble RTS interrupt
+// enable RTS interrupt
 #define MOXA_MUST_IER_ERTSI            0x40
 // enable Xon/Xoff interrupt
 #define MOXA_MUST_IER_XINT             0x20
index d68be61f0a49a6372f7aa438752d4f7c4eccbf28..fee2aca3f6a5c7eb77c8c07135489644e5ec8ab2 100644 (file)
@@ -941,17 +941,6 @@ static void* mgsl_get_text_ptr(void)
        return mgsl_get_text_ptr;
 }
 
-/*
- * tmp_buf is used as a temporary buffer by mgsl_write.  We need to
- * lock it in case the COPY_FROM_USER blocks while swapping in a page,
- * and some other program tries to do a serial write at the same time.
- * Since the lock will only come under contention when the system is
- * swapping and available memory is low, it makes sense to share one
- * buffer across all the serial ioports, since it significantly saves
- * memory if large numbers of serial ports are open.
- */
-static unsigned char *tmp_buf;
-
 static inline int mgsl_paranoia_check(struct mgsl_struct *info,
                                        char *name, const char *routine)
 {
@@ -2150,7 +2139,7 @@ static int mgsl_write(struct tty_struct * tty,
        if (mgsl_paranoia_check(info, tty->name, "mgsl_write"))
                goto cleanup;
 
-       if (!tty || !info->xmit_buf || !tmp_buf)
+       if (!tty || !info->xmit_buf)
                goto cleanup;
 
        if ( info->params.mode == MGSL_MODE_HDLC ||
@@ -3438,7 +3427,6 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
 {
        struct mgsl_struct      *info;
        int                     retval, line;
-       unsigned long           page;
        unsigned long flags;
 
        /* verify range of specified line number */     
@@ -3472,18 +3460,6 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
                goto cleanup;
        }
        
-       if (!tmp_buf) {
-               page = get_zeroed_page(GFP_KERNEL);
-               if (!page) {
-                       retval = -ENOMEM;
-                       goto cleanup;
-               }
-               if (tmp_buf)
-                       free_page(page);
-               else
-                       tmp_buf = (unsigned char *) page;
-       }
-       
        info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
 
        spin_lock_irqsave(&info->netlock, flags);
@@ -4502,11 +4478,6 @@ static void synclink_cleanup(void)
                kfree(tmp);
        }
        
-       if (tmp_buf) {
-               free_page((unsigned long) tmp_buf);
-               tmp_buf = NULL;
-       }
-       
        if (pci_registered)
                pci_unregister_driver(&synclink_pci_driver);
 }
@@ -6025,7 +5996,7 @@ static void usc_set_async_mode( struct mgsl_struct *info )
         * <15..8>      ?               RxFIFO IRQ Request Level
         *
         * Note: For async mode the receive FIFO level must be set
-        * to 0 to aviod the situation where the FIFO contains fewer bytes
+        * to 0 to avoid the situation where the FIFO contains fewer bytes
         * than the trigger level and no more data is expected.
         *
         * <7>          0               Exited Hunt IA (Interrupt Arm)
index 738ec2f4e563d4a1c0bafc77356487113d7b9a5a..b4d1f4eea435afe1eccf7cc11788dd9184f2a7c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: synclink_gt.c,v 4.22 2006/01/09 20:16:06 paulkf Exp $
+ * $Id: synclink_gt.c,v 4.25 2006/02/06 21:20:33 paulkf Exp $
  *
  * Device driver for Microgate SyncLink GT serial adapters.
  *
@@ -92,7 +92,7 @@
  * module identification
  */
 static char *driver_name     = "SyncLink GT";
-static char *driver_version  = "$Revision: 4.22 $";
+static char *driver_version  = "$Revision: 4.25 $";
 static char *tty_driver_name = "synclink_gt";
 static char *tty_dev_prefix  = "ttySLG";
 MODULE_LICENSE("GPL");
@@ -187,6 +187,20 @@ static void hdlcdev_exit(struct slgt_info *info);
 #define SLGT_MAX_PORTS 4
 #define SLGT_REG_SIZE  256
 
+/*
+ * conditional wait facility
+ */
+struct cond_wait {
+       struct cond_wait *next;
+       wait_queue_head_t q;
+       wait_queue_t wait;
+       unsigned int data;
+};
+static void init_cond_wait(struct cond_wait *w, unsigned int data);
+static void add_cond_wait(struct cond_wait **head, struct cond_wait *w);
+static void remove_cond_wait(struct cond_wait **head, struct cond_wait *w);
+static void flush_cond_wait(struct cond_wait **head);
+
 /*
  * DMA buffer descriptor and access macros
  */
@@ -269,6 +283,9 @@ struct slgt_info {
        struct timer_list       tx_timer;
        struct timer_list       rx_timer;
 
+       unsigned int            gpio_present;
+       struct cond_wait        *gpio_wait_q;
+
        spinlock_t lock;        /* spinlock for synchronizing with ISR */
 
        struct work_struct task;
@@ -379,6 +396,11 @@ static MGSL_PARAMS default_params = {
 #define MASK_OVERRUN BIT4
 
 #define GSR   0x00 /* global status */
+#define JCR   0x04 /* JTAG control */
+#define IODR  0x08 /* GPIO direction */
+#define IOER  0x0c /* GPIO interrupt enable */
+#define IOVR  0x10 /* GPIO value */
+#define IOSR  0x14 /* GPIO interrupt status */
 #define TDR   0x80 /* tx data */
 #define RDR   0x80 /* rx data */
 #define TCR   0x82 /* tx control */
@@ -503,6 +525,9 @@ static int  tiocmset(struct tty_struct *tty, struct file *file,
 static void set_break(struct tty_struct *tty, int break_state);
 static int  get_interface(struct slgt_info *info, int __user *if_mode);
 static int  set_interface(struct slgt_info *info, int if_mode);
+static int  set_gpio(struct slgt_info *info, struct gpio_desc __user *gpio);
+static int  get_gpio(struct slgt_info *info, struct gpio_desc __user *gpio);
+static int  wait_gpio(struct slgt_info *info, struct gpio_desc __user *gpio);
 
 /*
  * driver functions
@@ -1112,6 +1137,12 @@ static int ioctl(struct tty_struct *tty, struct file *file,
                return get_interface(info, argp);
        case MGSL_IOCSIF:
                return set_interface(info,(int)arg);
+       case MGSL_IOCSGPIO:
+               return set_gpio(info, argp);
+       case MGSL_IOCGGPIO:
+               return get_gpio(info, argp);
+       case MGSL_IOCWAITGPIO:
+               return wait_gpio(info, argp);
        case TIOCGICOUNT:
                spin_lock_irqsave(&info->lock,flags);
                cnow = info->icount;
@@ -1762,10 +1793,6 @@ static void rx_async(struct slgt_info *info)
                DBGDATA(info, p, count, "rx");
 
                for(i=0 ; i < count; i+=2, p+=2) {
-                       if (tty && chars) {
-                               tty_flip_buffer_push(tty);
-                               chars = 0;
-                       }
                        ch = *p;
                        icount->rx++;
 
@@ -2158,6 +2185,24 @@ static void isr_txeom(struct slgt_info *info, unsigned short status)
        }
 }
 
+static void isr_gpio(struct slgt_info *info, unsigned int changed, unsigned int state)
+{
+       struct cond_wait *w, *prev;
+
+       /* wake processes waiting for specific transitions */
+       for (w = info->gpio_wait_q, prev = NULL ; w != NULL ; w = w->next) {
+               if (w->data & changed) {
+                       w->data = state;
+                       wake_up_interruptible(&w->q);
+                       if (prev != NULL)
+                               prev->next = w->next;
+                       else
+                               info->gpio_wait_q = w->next;
+               } else
+                       prev = w;
+       }
+}
+
 /* interrupt service routine
  *
  *     irq     interrupt number
@@ -2193,6 +2238,22 @@ static irqreturn_t slgt_interrupt(int irq, void *dev_id, struct pt_regs * regs)
                }
        }
 
+       if (info->gpio_present) {
+               unsigned int state;
+               unsigned int changed;
+               while ((changed = rd_reg32(info, IOSR)) != 0) {
+                       DBGISR(("%s iosr=%08x\n", info->device_name, changed));
+                       /* read latched state of GPIO signals */
+                       state = rd_reg32(info, IOVR);
+                       /* clear pending GPIO interrupt bits */
+                       wr_reg32(info, IOSR, changed);
+                       for (i=0 ; i < info->port_count ; i++) {
+                               if (info->port_array[i] != NULL)
+                                       isr_gpio(info->port_array[i], changed, state);
+                       }
+               }
+       }
+
        for(i=0; i < info->port_count ; i++) {
                struct slgt_info *port = info->port_array[i];
 
@@ -2276,6 +2337,8 @@ static void shutdown(struct slgt_info *info)
                set_signals(info);
        }
 
+       flush_cond_wait(&info->gpio_wait_q);
+
        spin_unlock_irqrestore(&info->lock,flags);
 
        if (info->tty)
@@ -2650,6 +2713,175 @@ static int set_interface(struct slgt_info *info, int if_mode)
        return 0;
 }
 
+/*
+ * set general purpose IO pin state and direction
+ *
+ * user_gpio fields:
+ * state   each bit indicates a pin state
+ * smask   set bit indicates pin state to set
+ * dir     each bit indicates a pin direction (0=input, 1=output)
+ * dmask   set bit indicates pin direction to set
+ */
+static int set_gpio(struct slgt_info *info, struct gpio_desc __user *user_gpio)
+{
+       unsigned long flags;
+       struct gpio_desc gpio;
+       __u32 data;
+
+       if (!info->gpio_present)
+               return -EINVAL;
+       if (copy_from_user(&gpio, user_gpio, sizeof(gpio)))
+               return -EFAULT;
+       DBGINFO(("%s set_gpio state=%08x smask=%08x dir=%08x dmask=%08x\n",
+                info->device_name, gpio.state, gpio.smask,
+                gpio.dir, gpio.dmask));
+
+       spin_lock_irqsave(&info->lock,flags);
+       if (gpio.dmask) {
+               data = rd_reg32(info, IODR);
+               data |= gpio.dmask & gpio.dir;
+               data &= ~(gpio.dmask & ~gpio.dir);
+               wr_reg32(info, IODR, data);
+       }
+       if (gpio.smask) {
+               data = rd_reg32(info, IOVR);
+               data |= gpio.smask & gpio.state;
+               data &= ~(gpio.smask & ~gpio.state);
+               wr_reg32(info, IOVR, data);
+       }
+       spin_unlock_irqrestore(&info->lock,flags);
+
+       return 0;
+}
+
+/*
+ * get general purpose IO pin state and direction
+ */
+static int get_gpio(struct slgt_info *info, struct gpio_desc __user *user_gpio)
+{
+       struct gpio_desc gpio;
+       if (!info->gpio_present)
+               return -EINVAL;
+       gpio.state = rd_reg32(info, IOVR);
+       gpio.smask = 0xffffffff;
+       gpio.dir   = rd_reg32(info, IODR);
+       gpio.dmask = 0xffffffff;
+       if (copy_to_user(user_gpio, &gpio, sizeof(gpio)))
+               return -EFAULT;
+       DBGINFO(("%s get_gpio state=%08x dir=%08x\n",
+                info->device_name, gpio.state, gpio.dir));
+       return 0;
+}
+
+/*
+ * conditional wait facility
+ */
+static void init_cond_wait(struct cond_wait *w, unsigned int data)
+{
+       init_waitqueue_head(&w->q);
+       init_waitqueue_entry(&w->wait, current);
+       w->data = data;
+}
+
+static void add_cond_wait(struct cond_wait **head, struct cond_wait *w)
+{
+       set_current_state(TASK_INTERRUPTIBLE);
+       add_wait_queue(&w->q, &w->wait);
+       w->next = *head;
+       *head = w;
+}
+
+static void remove_cond_wait(struct cond_wait **head, struct cond_wait *cw)
+{
+       struct cond_wait *w, *prev;
+       remove_wait_queue(&cw->q, &cw->wait);
+       set_current_state(TASK_RUNNING);
+       for (w = *head, prev = NULL ; w != NULL ; prev = w, w = w->next) {
+               if (w == cw) {
+                       if (prev != NULL)
+                               prev->next = w->next;
+                       else
+                               *head = w->next;
+                       break;
+               }
+       }
+}
+
+static void flush_cond_wait(struct cond_wait **head)
+{
+       while (*head != NULL) {
+               wake_up_interruptible(&(*head)->q);
+               *head = (*head)->next;
+       }
+}
+
+/*
+ * wait for general purpose I/O pin(s) to enter specified state
+ *
+ * user_gpio fields:
+ * state - bit indicates target pin state
+ * smask - set bit indicates watched pin
+ *
+ * The wait ends when at least one watched pin enters the specified
+ * state. When 0 (no error) is returned, user_gpio->state is set to the
+ * state of all GPIO pins when the wait ends.
+ *
+ * Note: Each pin may be a dedicated input, dedicated output, or
+ * configurable input/output. The number and configuration of pins
+ * varies with the specific adapter model. Only input pins (dedicated
+ * or configured) can be monitored with this function.
+ */
+static int wait_gpio(struct slgt_info *info, struct gpio_desc __user *user_gpio)
+{
+       unsigned long flags;
+       int rc = 0;
+       struct gpio_desc gpio;
+       struct cond_wait wait;
+       u32 state;
+
+       if (!info->gpio_present)
+               return -EINVAL;
+       if (copy_from_user(&gpio, user_gpio, sizeof(gpio)))
+               return -EFAULT;
+       DBGINFO(("%s wait_gpio() state=%08x smask=%08x\n",
+                info->device_name, gpio.state, gpio.smask));
+       /* ignore output pins identified by set IODR bit */
+       if ((gpio.smask &= ~rd_reg32(info, IODR)) == 0)
+               return -EINVAL;
+       init_cond_wait(&wait, gpio.smask);
+
+       spin_lock_irqsave(&info->lock, flags);
+       /* enable interrupts for watched pins */
+       wr_reg32(info, IOER, rd_reg32(info, IOER) | gpio.smask);
+       /* get current pin states */
+       state = rd_reg32(info, IOVR);
+
+       if (gpio.smask & ~(state ^ gpio.state)) {
+               /* already in target state */
+               gpio.state = state;
+       } else {
+               /* wait for target state */
+               add_cond_wait(&info->gpio_wait_q, &wait);
+               spin_unlock_irqrestore(&info->lock, flags);
+               schedule();
+               if (signal_pending(current))
+                       rc = -ERESTARTSYS;
+               else
+                       gpio.state = wait.data;
+               spin_lock_irqsave(&info->lock, flags);
+               remove_cond_wait(&info->gpio_wait_q, &wait);
+       }
+
+       /* disable all GPIO interrupts if no waiting processes */
+       if (info->gpio_wait_q == NULL)
+               wr_reg32(info, IOER, 0);
+       spin_unlock_irqrestore(&info->lock,flags);
+
+       if ((rc == 0) && copy_to_user(user_gpio, &gpio, sizeof(gpio)))
+               rc = -EFAULT;
+       return rc;
+}
+
 static int modem_input_wait(struct slgt_info *info,int arg)
 {
        unsigned long flags;
@@ -3166,8 +3398,10 @@ static void device_init(int adapter_num, struct pci_dev *pdev)
                } else {
                        port_array[0]->irq_requested = 1;
                        adapter_test(port_array[0]);
-                       for (i=1 ; i < port_count ; i++)
+                       for (i=1 ; i < port_count ; i++) {
                                port_array[i]->init_error = port_array[0]->init_error;
+                               port_array[i]->gpio_present = port_array[0]->gpio_present;
+                       }
                }
        }
 }
@@ -4301,7 +4535,7 @@ static int register_test(struct slgt_info *info)
                        break;
                }
        }
-
+       info->gpio_present = (rd_reg32(info, JCR) & BIT5) ? 1 : 0;
        info->init_error = rc ? 0 : DiagStatus_AddressFailure;
        return rc;
 }
index 905f58ba8e1622685e74acc1d7f16d3420e14e7a..ea06e3a4dc358837c21ebf5081396851610a1f3b 100644 (file)
@@ -2044,7 +2044,7 @@ static int __init edac_mc_init(void)
         */
        clear_pci_parity_errors();
 
-       /* Create the MC sysfs entires */
+       /* Create the MC sysfs entries */
        if (edac_sysfs_memctrl_setup()) {
                edac_printk(KERN_ERR, EDAC_MC,
                        "Error initializing sysfs code\n");
index ebc59064b4752a6fd12f511cece004c8e8dae889..f04791a58df0b0784e3e754cad9a0275034f0712 100644 (file)
 #include <linux/timer.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/jiffies.h>
 #include <linux/major.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/errno.h>
@@ -2336,7 +2337,7 @@ static ide_startstop_t idetape_rw_callback (ide_drive_t *drive)
        }
        if (time_after(jiffies, tape->insert_time))
                tape->insert_speed = tape->insert_size / 1024 * HZ / (jiffies - tape->insert_time);
-       if (jiffies - tape->avg_time >= HZ) {
+       if (time_after_eq(jiffies, tape->avg_time + HZ)) {
                tape->avg_speed = tape->avg_size * HZ / (jiffies - tape->avg_time) / 1024;
                tape->avg_size = 0;
                tape->avg_time = jiffies;
@@ -2497,7 +2498,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
                        } else {
                                return ide_do_reset(drive);
                        }
-               } else if (jiffies - tape->dsc_polling_start > IDETAPE_DSC_MA_THRESHOLD)
+               } else if (time_after(jiffies, tape->dsc_polling_start + IDETAPE_DSC_MA_THRESHOLD))
                        tape->dsc_polling_frequency = IDETAPE_DSC_MA_SLOW;
                idetape_postpone_request(drive);
                return ide_stopped;
index 21965e5ef25e8c1c86bd59da0f40350d4f821702..b22ee546231837f4ed98651831ef9c2f8d51d791 100644 (file)
@@ -347,10 +347,8 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
                        break;
 
                case AMD_UDMA_66:
-                       pci_read_config_dword(dev, AMD_UDMA_TIMING, &u);
-                       for (i = 24; i >= 0; i -= 8)
-                               if ((u >> i) & 4)
-                                       amd_80w |= (1 << (1 - (i >> 4)));
+                       /* no host side cable detection */
+                       amd_80w = 0x03;
                        break;
        }
 
@@ -386,8 +384,6 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
        if (amd_clock < 20000 || amd_clock > 50000) {
                printk(KERN_WARNING "%s: User given PCI clock speed impossible (%d), using 33 MHz instead.\n",
                        amd_chipset->name, amd_clock);
-               printk(KERN_WARNING "%s: Use ide0=ata66 if you want to assume 80-wire cable\n",
-                       amd_chipset->name);
                amd_clock = 33333;
        }
 
index 6e3ab0c38c4d672e0c332be3ec88895957187124..f82e82109728fa0e79a5fa31987266406120d19c 100644 (file)
 
 static int ide_generic_all;            /* Set to claim all devices */
 
+#ifndef MODULE
 static int __init ide_generic_all_on(char *unused)
 {
        ide_generic_all = 1;
        printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage controllers.\n");
        return 1;
 }
-
 __setup("all-generic-ide", ide_generic_all_on);
+#endif
 
 static void __devinit init_hwif_generic (ide_hwif_t *hwif)
 {
index 75a2253a3e6872813a94179db4767c3751502f4e..8e9d87701ce245f4eb15ed4a370c4e2f4ba22111 100644 (file)
@@ -112,6 +112,7 @@ static const struct {
 
        { "SiS5596",    PCI_DEVICE_ID_SI_5596,  ATA_16   },
        { "SiS5571",    PCI_DEVICE_ID_SI_5571,  ATA_16   },
+       { "SiS5517",    PCI_DEVICE_ID_SI_5517,  ATA_16   },
        { "SiS551x",    PCI_DEVICE_ID_SI_5511,  ATA_16   },
 };
 
@@ -524,6 +525,7 @@ static void config_art_rwp_pio (ide_drive_t *drive, u8 pio)
                        case 3:         test1 = 0x30|0x03; break;
                        case 2:         test1 = 0x40|0x04; break;
                        case 1:         test1 = 0x60|0x07; break;
+                       case 0:         test1 = 0x00; break;
                        default:        break;
                }
                pci_write_config_byte(dev, drive_pci, test1);
index 4fe3da3c667a0ecfa06eefad1759d831aa7f014f..f8af0945964ecf85147a54712e08b73f237101e1 100644 (file)
@@ -923,7 +923,7 @@ void input_unregister_handler(struct input_handler *handler)
 static int input_open_file(struct inode *inode, struct file *file)
 {
        struct input_handler *handler = input_table[iminor(inode) >> 5];
-       struct file_operations *old_fops, *new_fops = NULL;
+       const struct file_operations *old_fops, *new_fops = NULL;
        int err;
 
        /* No load-on-demand here? */
index 623adbb0d13abe8098912f0203c9218211967019..9b493f0becc4d370541742a7fec7f4ef6aed43df 100644 (file)
@@ -1485,6 +1485,7 @@ static int __init capi_init(void)
 {
        char *p;
        char *compileinfo;
+       int major_ret;
 
        if ((p = strchr(revision, ':')) != 0 && p[1]) {
                strlcpy(rev, p + 2, sizeof(rev));
@@ -1493,11 +1494,12 @@ static int __init capi_init(void)
        } else
                strcpy(rev, "1.0");
 
-       if (register_chrdev(capi_major, "capi20", &capi_fops)) {
+       major_ret = register_chrdev(capi_major, "capi20", &capi_fops);
+       if (major_ret < 0) {
                printk(KERN_ERR "capi20: unable to get major %d\n", capi_major);
-               return -EIO;
+               return major_ret;
        }
-
+       capi_major = major_ret;
        capi_class = class_create(THIS_MODULE, "capi");
        if (IS_ERR(capi_class)) {
                unregister_chrdev(capi_major, "capi20");
index 2cc8b27e4c3be918aeb05ab855ca13bd0afee574..ca9dc00a45c4aedc9147c4c47877194000c1d36e 100644 (file)
@@ -233,7 +233,7 @@ static struct file_operations proc_applstats_ops = {
 };
 
 static void
-create_seq_entry(char *name, mode_t mode, struct file_operations *f)
+create_seq_entry(char *name, mode_t mode, const struct file_operations *f)
 {
        struct proc_dir_entry *entry;
        entry = create_proc_entry(name, mode, NULL);
index 54f8b95717b0fd7740dcb7a4bcacd4fff80d869c..96fe0ecae25089da66ee5bd4ca77dd4261dcdd34 100644 (file)
@@ -86,7 +86,7 @@ static int dvb_device_open(struct inode *inode, struct file *file)
 
        if (dvbdev && dvbdev->fops) {
                int err = 0;
-               struct file_operations *old_fops;
+               const struct file_operations *old_fops;
 
                file->private_data = dvbdev;
                old_fops = file->f_op;
index 75e3d41382f2b1875e332d887e1d28350d627657..5f87dd5f1d0b7fe28af648e26d10f142aa2cfab9 100644 (file)
@@ -97,7 +97,7 @@ static int video_open(struct inode *inode, struct file *file)
        unsigned int minor = iminor(inode);
        int err = 0;
        struct video_device *vfl;
-       struct file_operations *old_fops;
+       const struct file_operations *old_fops;
 
        if(minor>=VIDEO_NUM_DEVICES)
                return -ENODEV;
index 2a0c42b8cda5016257504f713a9308583af15a19..3d2e76eea93e9d8fb0779bd66462bc497d1237a2 100644 (file)
@@ -56,7 +56,7 @@
 typedef struct _i2o_proc_entry_t {
        char *name;             /* entry name */
        mode_t mode;            /* mode */
-       struct file_operations *fops;   /* open function */
+       const struct file_operations *fops;     /* open function */
 } i2o_proc_entry;
 
 /* global I2O /proc/i2o entry */
index 5c550fcac2c487f176ba6a2881d41d1449423a15..26a230b6ff80dbee2d207a10d4625c44e64f02d4 100644 (file)
@@ -101,7 +101,7 @@ static struct super_operations ibmasmfs_s_ops = {
        .drop_inode     = generic_delete_inode,
 };
 
-static struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations;
+static const struct file_operations *ibmasmfs_dir_ops = &simple_dir_operations;
 
 static struct file_system_type ibmasmfs_type = {
        .owner          = THIS_MODULE,
index e7fc28b07e5a5ed7056955bed669eea278fba417..7627a75f4f7cf8ca3ebc047d800d78e05aad124f 100644 (file)
 #include <linux/random.h>
 #include <linux/init.h>
 #include <linux/if_vlan.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/irq.h>
 #include <asm/io.h>
@@ -2932,7 +2933,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
        if (id->driver_data & DEV_HAS_HIGH_DMA) {
                /* packet format 3: supports 40-bit addressing */
                np->desc_ver = DESC_VER_3;
-               if (pci_set_dma_mask(pci_dev, 0x0000007fffffffffULL)) {
+               if (pci_set_dma_mask(pci_dev, DMA_39BIT_MASK)) {
                        printk(KERN_INFO "forcedeth: 64-bit DMA failed, using 32-bit addressing for device %s.\n",
                                        pci_name(pci_dev));
                } else {
index 9b8295ee06ef1fb069f283a950f12a67b0ae113b..ae71ed57c12db04f624f01d4c7c9324576376f06 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/ip.h>
 #include <linux/tcp.h>
 #include <linux/udp.h>
+#include <linux/dma-mapping.h>
 
 #ifdef CONFIG_SERIAL_8250
 #include <linux/serial_core.h>
@@ -1195,17 +1196,17 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        int err, pci_using_dac;
 
        /* Configure DMA attributes. */
-       err = pci_set_dma_mask(pdev, 0xffffffffffffffffULL);
+       err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
        if (!err) {
                pci_using_dac = 1;
-               err = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL);
+               err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
                if (err < 0) {
                        printk(KERN_ERR "%s: Unable to obtain 64 bit DMA "
                               "for consistent allocations\n", pci_name(pdev));
                        goto out;
                }
        } else {
-               err = pci_set_dma_mask(pdev, 0xffffffffULL);
+               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
                if (err) {
                        printk(KERN_ERR "%s: No usable DMA configuration, "
                               "aborting.\n", pci_name(pdev));
index 9aa074b44dd3df9f419e86e70ec137b5549c2fa9..cc7ff8f00e4233f1acf38b1c32174d253ba3da9d 100644 (file)
@@ -812,7 +812,7 @@ static int nsc_ircc_init_39x(nsc_chip_t *chip, chipio_t *info)
        int cfg_base = info->cfg_base;
        int enabled;
 
-       /* User is shure about his config... accept it. */
+       /* User is sure about his config... accept it. */
        IRDA_DEBUG(2, "%s(): nsc_ircc_init_39x (user settings): "
                   "io=0x%04x, irq=%d, dma=%d\n", 
                   __FUNCTION__, info->fir_base, info->irq, info->dma);
index 0c13795dca38d0cdc8638b0f362a73a7b6c3e76b..b79d6e8d30457ddcf8f2c9cd58b927595f5f3315 100644 (file)
@@ -172,7 +172,7 @@ static struct net_device_stats *get_stats(struct net_device *dev)
 
        memset(stats, 0, sizeof(struct net_device_stats));
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                struct net_device_stats *lb_stats;
 
                lb_stats = &per_cpu(loopback_stats, i);
index 0fede50abd3e276e743d066ccfcd3f1f56bbaecc..8e9b1a537deeaca0dedf55337c5626cc0d55c556 100644 (file)
@@ -1828,10 +1828,10 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
        int using_dac = 0;
 
        /* See if we can set the dma mask early on; failure is fatal. */
-       if (sizeof(dma_addr_t) == 8 && 
-               !pci_set_dma_mask(pci_dev, 0xffffffffffffffffULL)) {
+       if (sizeof(dma_addr_t) == 8 &&
+               !pci_set_dma_mask(pci_dev, DMA_64BIT_MASK)) {
                using_dac = 1;
-       } else if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
+       } else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
                using_dac = 0;
        } else {
                printk(KERN_WARNING "ns83820.c: pci_set_dma_mask failed!\n");
index 8429ceb0138942bb3c4fdcacb9ad8ebfd69e2aee..b82191d2bee127415d14b3e65075af0d7f702421 100644 (file)
@@ -2283,7 +2283,7 @@ static void set_rx_mode(struct net_device *net_dev)
        int i, table_entries;
        u32 rx_mode;
 
-       /* 635 Hash Table entires = 256(2^16) */
+       /* 635 Hash Table entries = 256(2^16) */
        if((sis_priv->chipset_rev >= SIS635A_900_REV) ||
                        (sis_priv->chipset_rev == SIS900B_900_REV))
                table_entries = 16;
index ee48bfd6734938a0e241170e320b1335ee6dac7c..d1a86a080a65f5438fb103f38bbe597de59cbfc5 100644 (file)
@@ -513,7 +513,7 @@ struct mii_phy {
     u_char  *rst;           /* Start of reset sequence in SROM           */
     u_int mc;               /* Media Capabilities                        */
     u_int ana;              /* NWay Advertisement                        */
-    u_int fdx;              /* Full DupleX capabilites for each media    */
+    u_int fdx;              /* Full DupleX capabilities for each media   */
     u_int ttm;              /* Transmit Threshold Mode for each media    */
     u_int mci;              /* 21142 MII Connector Interrupt info        */
 };
index 55f4a9a631bc62226b670cdfcbd7bdaced3c931c..ab985023fcca0ab9f4c0b173983dee4691634cec 100644 (file)
@@ -199,7 +199,7 @@ void pnic2_lnk_change(struct net_device *dev, int csr5)
                       /* negotiation ended successfully */
 
                       /* get the link partners reply and mask out all but
-                        * bits 24-21 which show the partners capabilites
+                        * bits 24-21 which show the partners capabilities
                         * and match those to what we advertised
                         *
                         * then begin to interpret the results of the negotiation.
index cde35dd879063054ebe9d26061adb825792e3867..c1ce87a5f8d3aacc01373cf122f0cec850a67570 100644 (file)
@@ -208,7 +208,7 @@ static const struct typhoon_card_info typhoon_card_info[] __devinitdata = {
 };
 
 /* Notes on the new subsystem numbering scheme:
- * bits 0-1 indicate crypto capabilites: (0) variable, (1) DES, or (2) 3DES
+ * bits 0-1 indicate crypto capabilities: (0) variable, (1) DES, or (2) 3DES
  * bit 4 indicates if this card has secured firmware (we don't support it)
  * bit 8 indicates if this is a (0) copper or (1) fiber card
  * bits 12-16 indicate card type: (0) client and (1) server
@@ -788,7 +788,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
        /* we have two rings to choose from, but we only use txLo for now
         * If we start using the Hi ring as well, we'll need to update
         * typhoon_stop_runtime(), typhoon_interrupt(), typhoon_num_free_tx(),
-        * and TXHI_ENTIRES to match, as well as update the TSO code below
+        * and TXHI_ENTRIES to match, as well as update the TSO code below
         * to get the right DMA address
         */
        txRing = &tp->txLoRing;
index 9d3b51c3ef548f334e30f6fe9ef450deecc788ee..29a756dd979b4e72e1126f9f65d96c6af856e4a4 100644 (file)
@@ -577,8 +577,8 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
           We set both dma_mask and consistent_dma_mask to 28 bits
           and pray pci_alloc_consistent() will use this info. It should
           work on most platforms */
-       if (pci_set_consistent_dma_mask(pdev, 0x0FFFFFFF) ||
-           pci_set_dma_mask(pdev, 0x0FFFFFFF)) {
+       if (pci_set_consistent_dma_mask(pdev, DMA_28BIT_MASK) ||
+           pci_set_dma_mask(pdev, DMA_28BIT_MASK)) {
                printk(KERN_ERR "wanXL: No usable DMA configuration\n");
                return -EIO;
        }
index 6fd0bf736830f4c7a0694005d32b50613f05818b..8dfdfbd5966c5b1b95e54617009eab26fa55dd6b 100644 (file)
@@ -3858,7 +3858,7 @@ static int orinoco_ioctl_setscan(struct net_device *dev,
        unsigned long flags;
 
        /* Note : you may have realised that, as this is a SET operation,
-        * this is priviledged and therefore a normal user can't
+        * this is privileged and therefore a normal user can't
         * perform scanning.
         * This is not an error, while the device perform scanning,
         * traffic doesn't flow, so it's a perfect DoS...
index e5bb9f5ae4291bf6b5e126219123e8454924bef9..989599ad33ef076e875ad944e41df82345ae19df 100644 (file)
@@ -747,7 +747,7 @@ prism54_get_essid(struct net_device *ndev, struct iw_request_info *info,
 
        if (essid->length) {
                dwrq->flags = 1;        /* set ESSID to ON for Wireless Extensions */
-               /* if it is to big, trunk it */
+               /* if it is too big, trunk it */
                dwrq->length = min((u8)IW_ESSID_MAX_SIZE, essid->length);
        } else {
                dwrq->flags = 0;
index b41d666fea3c18ab588d4c28b3e1d945956c6a81..bfa0cc319a098717ed6f7712e2ed35ccabed07eb 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/init.h> /* For __init, __exit */
+#include <linux/dma-mapping.h>
 
 #include "prismcompat.h"
 #include "islpci_dev.h"
@@ -124,7 +125,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        }
 
        /* enable PCI DMA */
-       if (pci_set_dma_mask(pdev, 0xffffffff)) {
+       if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                printk(KERN_ERR "%s: 32-bit PCI DMA not supported", DRV_NAME);
                goto do_pci_disable_device;
         }
index 330d3869b41ed342d0052af758cb16b28322931a..fc4bc9b94c748d2e1736913f8d4978bc07cfcb49 100644 (file)
@@ -217,11 +217,10 @@ static void oprofile_end_trace(struct oprofile_cpu_buffer * cpu_buf)
        cpu_buf->tracing = 0;
 }
 
-void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
+void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
+                               unsigned long event, int is_kernel)
 {
        struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
-       unsigned long pc = profile_pc(regs);
-       int is_kernel = !user_mode(regs);
 
        if (!backtrace_depth) {
                log_sample(cpu_buf, pc, is_kernel, event);
@@ -238,6 +237,14 @@ void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
        oprofile_end_trace(cpu_buf);
 }
 
+void oprofile_add_sample(struct pt_regs * const regs, unsigned long event)
+{
+       int is_kernel = !user_mode(regs);
+       unsigned long pc = profile_pc(regs);
+
+       oprofile_add_ext_sample(pc, regs, event, is_kernel);
+}
+
 void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event)
 {
        struct oprofile_cpu_buffer * cpu_buf = &cpu_buffer[smp_processor_id()];
index e94b1e4a2a8430de85aae0c4c9c46b71a51fea8f..f0acb661c25391dc81902543210067a3e40c9248 100644 (file)
@@ -22,7 +22,7 @@ void oprofile_reset_stats(void)
        struct oprofile_cpu_buffer * cpu_buf; 
        int i;
  
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                cpu_buf = &cpu_buffer[i]; 
                cpu_buf->sample_received = 0;
                cpu_buf->sample_lost_overflow = 0;
@@ -46,7 +46,7 @@ void oprofile_create_stats_files(struct super_block * sb, struct dentry * root)
        if (!dir)
                return;
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                cpu_buf = &cpu_buffer[i]; 
                snprintf(buf, 10, "cpu%d", i);
                cpudir = oprofilefs_mkdir(sb, dir, buf);
index d6bae699749af49785577284c130e5128c28e9d3..b62da9b0cbf025f7a93684cdbe6be6160dbe7159 100644 (file)
@@ -130,7 +130,7 @@ static struct file_operations ulong_ro_fops = {
 
 
 static struct dentry * __oprofilefs_create_file(struct super_block * sb,
-       struct dentry * root, char const * name, struct file_operations * fops,
+       struct dentry * root, char const * name, const struct file_operations * fops,
        int perm)
 {
        struct dentry * dentry;
@@ -203,7 +203,7 @@ int oprofilefs_create_ro_atomic(struct super_block * sb, struct dentry * root,
 
  
 int oprofilefs_create_file(struct super_block * sb, struct dentry * root,
-       char const * name, struct file_operations * fops)
+       char const * name, const struct file_operations * fops)
 {
        if (!__oprofilefs_create_file(sb, root, name, fops, 0644))
                return -EFAULT;
@@ -212,7 +212,7 @@ int oprofilefs_create_file(struct super_block * sb, struct dentry * root,
 
 
 int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root,
-       char const * name, struct file_operations * fops, int perm)
+       char const * name, const struct file_operations * fops, int perm)
 {
        if (!__oprofilefs_create_file(sb, root, name, fops, perm))
                return -EFAULT;
index 0ab26d01877b1c985e9119006679bd7f21194054..0d2b447c50ed6e9cea185bf4810a18858dd1ddc5 100644 (file)
@@ -1026,7 +1026,7 @@ static void twa_free_request_id(TW_Device_Extension *tw_dev, int request_id)
        tw_dev->free_tail = (tw_dev->free_tail + 1) % TW_Q_LENGTH;
 } /* End twa_free_request_id() */
 
-/* This function will get parameter table entires from the firmware */
+/* This function will get parameter table entries from the firmware */
 static void *twa_get_param(TW_Device_Extension *tw_dev, int request_id, int table_id, int parameter_id, int parameter_size_bytes)
 {
        TW_Command_Full *full_command_packet;
index 1c459343292bb6b910cf28322293df912bfb9323..bde3d5834ade134c8ba1a44915af2cd5b027a64f 100644 (file)
@@ -41,6 +41,8 @@
 #include <linux/stat.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
+#include <linux/jiffies.h>
+#include <linux/dma-mapping.h>
 #include <scsi/scsicam.h>
 
 #include <asm/dma.h>
@@ -676,7 +678,7 @@ static int __init BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAd
                if (pci_enable_device(PCI_Device))
                        continue;
 
-               if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff))
+               if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK ))
                        continue;
 
                Bus = PCI_Device->bus->number;
@@ -831,7 +833,7 @@ static int __init BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAd
                if (pci_enable_device(PCI_Device))
                        continue;
 
-               if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff))
+               if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK))
                        continue;
 
                Bus = PCI_Device->bus->number;
@@ -885,7 +887,7 @@ static int __init BusLogic_InitializeFlashPointProbeInfo(struct BusLogic_HostAda
                if (pci_enable_device(PCI_Device))
                        continue;
 
-               if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff))
+               if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK))
                        continue;
 
                Bus = PCI_Device->bus->number;
@@ -2896,7 +2898,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou
                 */
                if (HostAdapter->ActiveCommands[TargetID] == 0)
                        HostAdapter->LastSequencePoint[TargetID] = jiffies;
-               else if (jiffies - HostAdapter->LastSequencePoint[TargetID] > 4 * HZ) {
+               else if (time_after(jiffies, HostAdapter->LastSequencePoint[TargetID] + 4 * HZ)) {
                        HostAdapter->LastSequencePoint[TargetID] = jiffies;
                        QueueTag = BusLogic_OrderedQueueTag;
                }
index 9f45ae1745da7eb0a8190a9a9b84d4f35d099b6c..3dce21c7873730cf70719689576d224763ad99e4 100644 (file)
@@ -89,6 +89,7 @@
 #include <linux/string.h>
 #include <linux/ioport.h>
 #include <linux/slab.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -1052,7 +1053,7 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
 
        if (pci_enable_device(pdev))
                goto out;
-       if (pci_set_dma_mask(pdev, 0xffffffffULL)) {
+       if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                printk(KERN_WARNING "Unable to set 32bit DMA "
                                    "on inia100 adapter, ignoring.\n");
                goto out_disable_device;
index a16f8ded8f1dd683f266683757dd21ed0cf7fd43..8df4a0ea3761598d4f9f40ca7a658a277a49e7ea 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/slab.h>
 #include <linux/completion.h>
 #include <linux/blkdev.h>
+#include <linux/dma-mapping.h>
 #include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
index c2596335549da13ff2f121698d61251a7044ca5b..720330778648a99309e0a8381260561ad003025a 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/dma-mapping.h>
 #include <linux/syscalls.h>
 #include <linux/delay.h>
 #include <linux/smp_lock.h>
@@ -806,8 +807,8 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
         * to driver communication memory to be allocated below 2gig
         */
        if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) 
-               if (pci_set_dma_mask(pdev, 0x7FFFFFFFULL) ||
-                               pci_set_consistent_dma_mask(pdev, 0x7FFFFFFFULL))
+               if (pci_set_dma_mask(pdev, DMA_31BIT_MASK) ||
+                               pci_set_consistent_dma_mask(pdev, DMA_31BIT_MASK))
                        goto out;
        
        pci_set_master(pdev);
index 5227a779c05c2661804eb0ad07724efddfe61d55..a198d86667e9070ef34e81cdaaaeecc0d191ab04 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/spinlock.h>
 #include <linux/pci.h>
 #include <linux/blkdev.h>
+#include <linux/dma-mapping.h>
 #include <asm/system.h>
 #include <asm/io.h>
 
@@ -2631,7 +2632,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (pci_enable_device(pdev))
                return -EIO;
 
-        if (!pci_set_dma_mask(pdev, 0xFFFFFFFFUL)) {
+        if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                 printk(KERN_INFO "atp870u: use 32bit DMA mask.\n");
         } else {
                 printk(KERN_ERR "atp870u: DMA mask required but not available.\n");
index 6e6b293dcb28b67dc5922089ff586dc2e0eeaeaa..b1b704a42efdb8f24bd6ffb3c81f47d5587dd9da 100644 (file)
@@ -57,6 +57,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver");
 #include <linux/reboot.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
+#include <linux/dma-mapping.h>
 
 #include <linux/timer.h>
 #include <linux/string.h>
@@ -906,8 +907,8 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
        }
 
        pci_set_master(pDev);
-       if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) &&
-           pci_set_dma_mask(pDev, 0xffffffffULL))
+       if (pci_set_dma_mask(pDev, DMA_64BIT_MASK) &&
+           pci_set_dma_mask(pDev, DMA_32BIT_MASK))
                return -EINVAL;
 
        base_addr0_phys = pci_resource_start(pDev,0);
index b3f9de8f75955f69d7bfa9f0a69c0d22cd8432da..059eeee4b55412cbb4c0d534308fae807a13ba02 100644 (file)
 #include <linux/init.h>
 #include <linux/ctype.h>
 #include <linux/spinlock.h>
+#include <linux/dma-mapping.h>
 #include <asm/byteorder.h>
 #include <asm/dma.h>
 #include <asm/io.h>
@@ -1426,7 +1427,7 @@ static int port_detect(unsigned long port_base, unsigned int j,
 
        if (ha->pdev) {
                pci_set_master(ha->pdev);
-               if (pci_set_dma_mask(ha->pdev, 0xffffffff))
+               if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK))
                        printk("%s: warning, pci_set_dma_mask failed.\n",
                               ha->board_name);
        }
index 7f7013e80a88269da3e98482ed8a1688bb8bb0ef..d5740bbdef3e8e98a032ff951b1985ade6c46be6 100644 (file)
 #include <linux/proc_fs.h>
 #include <linux/time.h>
 #include <linux/timer.h>
+#include <linux/dma-mapping.h>
 #ifdef GDTH_RTC
 #include <linux/mc146818rtc.h>
 #endif
@@ -4527,15 +4528,15 @@ static int __init gdth_detect(struct scsi_host_template *shtp)
             if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)||
                 /* 64-bit DMA only supported from FW >= x.43 */
                 (!ha->dma64_support)) {
-                if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) {
+                if (pci_set_dma_mask(pcistr[ctr].pdev, DMA_32BIT_MASK)) {
                     printk(KERN_WARNING "GDT-PCI %d: Unable to set 32-bit DMA\n", hanum);
                     err = TRUE;
                 }
             } else {
                 shp->max_cmd_len = 16;
-                if (!pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffffffffffffULL)) {
+                if (!pci_set_dma_mask(pcistr[ctr].pdev, DMA_64BIT_MASK)) {
                     printk("GDT-PCI %d: 64-bit DMA enabled\n", hanum);
-                } else if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) {
+                } else if (pci_set_dma_mask(pcistr[ctr].pdev, DMA_32BIT_MASK)) {
                     printk(KERN_WARNING "GDT-PCI %d: Unable to set 64/32-bit DMA\n", hanum);
                     err = TRUE;
                 }
index ea6f3c0e05d9632a148e2b6a03c14bbc66a20722..0cc7f65b584ff4b84575da41ab307532b823f370 100644 (file)
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/jiffies.h>
+#include <linux/dma-mapping.h>
 #include <asm/io.h>
 
 #include <scsi/scsi.h>
@@ -2780,7 +2781,7 @@ static int tul_NewReturnNumberOfAdapters(void)
                        if (((dRegValue & 0xFF00) >> 8) == 0xFF)
                                dRegValue = 0;
                        wBIOS = (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8));
-                       if (pci_set_dma_mask(pDev, 0xffffffff)) {
+                       if (pci_set_dma_mask(pDev, DMA_32BIT_MASK)) {
                                printk(KERN_WARNING 
                                       "i91u: Could not set 32 bit DMA mask\n");
                                continue;
index 481708d527aee7e75eca5ea794eaee7952a7fe64..a4c0b04cfdbdb14af7b17cdec0180a59b44c2725 100644 (file)
 
 #include <linux/blkdev.h>
 #include <linux/types.h>
+#include <linux/dma-mapping.h>
 
 #include <scsi/sg.h>
 
@@ -7284,10 +7285,10 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr)
         * are guaranteed to be < 4G.
         */
        if (IPS_ENABLE_DMA64 && IPS_HAS_ENH_SGLIST(ha) &&
-           !pci_set_dma_mask(ha->pcidev, 0xffffffffffffffffULL)) {
+           !pci_set_dma_mask(ha->pcidev, DMA_64BIT_MASK)) {
                (ha)->flags |= IPS_HA_ENH_SG;
        } else {
-               if (pci_set_dma_mask(ha->pcidev, 0xffffffffULL) != 0) {
+               if (pci_set_dma_mask(ha->pcidev, DMA_32BIT_MASK) != 0) {
                        printk(KERN_WARNING "Unable to set DMA Mask\n");
                        return ips_abort_init(ha, index);
                }
index 7144674bc8e677adae796bef8ed8a5cea0e0f323..80b68a2481b39210229a4ca7520c015707a06478 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 #include <scsi/scsicam.h>
 
 #include "scsi.h"
@@ -2094,7 +2095,7 @@ make_local_pdev(adapter_t *adapter, struct pci_dev **pdev)
 
        memcpy(*pdev, adapter->dev, sizeof(struct pci_dev));
 
-       if( pci_set_dma_mask(*pdev, 0xffffffff) != 0 ) {
+       if( pci_set_dma_mask(*pdev, DMA_32BIT_MASK) != 0 ) {
                kfree(*pdev);
                return -1;
        }
@@ -4859,10 +4860,10 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
        /* Set the Mode of addressing to 64 bit if we can */
        if ((adapter->flag & BOARD_64BIT) && (sizeof(dma_addr_t) == 8)) {
-               pci_set_dma_mask(pdev, 0xffffffffffffffffULL);
+               pci_set_dma_mask(pdev, DMA_64BIT_MASK);
                adapter->has_64bit_addr = 1;
        } else  {
-               pci_set_dma_mask(pdev, 0xffffffff);
+               pci_set_dma_mask(pdev, DMA_32BIT_MASK);
                adapter->has_64bit_addr = 0;
        }
                
index a279ebb61447cab8cc6b096240f686836857c71c..30ee0ef4b459ad14af1b2717a5506d02d0a064cb 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/ctype.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/dma.h>
 #include <asm/system.h>
@@ -2776,7 +2777,7 @@ static int nsp32_detect(struct scsi_host_template *sht)
        /*
         * setup DMA 
         */
-       if (pci_set_dma_mask(PCIDEV, 0xffffffffUL) != 0) {
+       if (pci_set_dma_mask(PCIDEV, DMA_32BIT_MASK) != 0) {
                nsp32_msg (KERN_ERR, "failed to set PCI DMA mask");
                goto scsi_unregister;
        }
index 66ea47a9c53c74774e95f584f484761e0e2ff3f7..e3bd4bc339f438e177f20d52bed6e6224086085e 100644 (file)
@@ -49,6 +49,7 @@ static const char * osst_version = "0.99.4";
 #include <linux/blkdev.h>
 #include <linux/moduleparam.h>
 #include <linux/delay.h>
+#include <linux/jiffies.h>
 #include <asm/uaccess.h>
 #include <asm/dma.h>
 #include <asm/system.h>
@@ -856,7 +857,7 @@ static int osst_wait_frame(struct osst_tape * STp, struct osst_request ** aSRpnt
                    ) && result >= 0)
                {
 #if DEBUG                      
-                       if (debugging || jiffies - startwait >= 2*HZ/OSST_POLL_PER_SEC)
+                       if (debugging || time_after_eq(jiffies, startwait + 2*HZ/OSST_POLL_PER_SEC))
                                printk (OSST_DEB_MSG
                                        "%s:D: Succ wait f fr %i (>%i): %i-%i %i (%i): %3li.%li s\n",
                                        name, curr, curr+minlast, STp->first_frame_position,
@@ -867,7 +868,7 @@ static int osst_wait_frame(struct osst_tape * STp, struct osst_request ** aSRpnt
                        return 0;
                }
 #if DEBUG
-               if (jiffies - startwait >= 2*HZ/OSST_POLL_PER_SEC && notyetprinted)
+               if (time_after_eq(jiffies, startwait + 2*HZ/OSST_POLL_PER_SEC) && notyetprinted)
                {
                        printk (OSST_DEB_MSG "%s:D: Wait for frame %i (>%i): %i-%i %i (%i)\n",
                                name, curr, curr+minlast, STp->first_frame_position,
index 05347eed9dd5d1edfe2ea9fb3b251da770c299f1..fee843fab1c7d5a0760285f9b4472da260efb8b7 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/parport.h>
 #include <linux/workqueue.h>
 #include <linux/delay.h>
+#include <linux/jiffies.h>
 #include <asm/io.h>
 
 #include <scsi/scsi.h>
@@ -726,7 +727,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
                                retv--;
 
                        if (retv) {
-                               if ((jiffies - dev->jstart) > (1 * HZ)) {
+                               if (time_after(jiffies, dev->jstart + (1 * HZ))) {
                                        printk
                                            ("ppa: Parallel port cable is unplugged!!\n");
                                        ppa_fail(dev, DID_BUS_BUSY);
index e0230249fa0fb55cb9cda06f399b2c8ee0318e9f..5a48e55f9418b1e48764dcde73e3b9edd9e69010 100644 (file)
 #include <linux/pci_ids.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -4321,7 +4322,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
 #ifdef QLA_64BIT_PTR
        if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) {
-               if (pci_set_dma_mask(ha->pdev, 0xffffffff)) {
+               if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) {
                        printk(KERN_WARNING "scsi(%li): Unable to set a "
                               "suitable DMA mask - aborting\n", ha->host_no);
                        error = -ENODEV;
@@ -4331,7 +4332,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
                dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n",
                        ha->host_no);
 #else
-       if (pci_set_dma_mask(ha->pdev, 0xffffffff)) {
+       if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) {
                printk(KERN_WARNING "scsi(%li): Unable to set a "
                       "suitable DMA mask - aborting\n", ha->host_no);
                error = -ENODEV;
index 94ef3f08d378b895d7329373404b08fd04e73ad5..52b224a5d6fd678e8ec1c988d57fea0ff4c890b8 100644 (file)
@@ -61,6 +61,8 @@
 #include <linux/unistd.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/dma-mapping.h>
+#include <linux/jiffies.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include "scsi.h"
@@ -737,8 +739,8 @@ static int isp2x00_detect(struct scsi_host_template * tmpt)
                                continue;
 
                        /* Try to configure DMA attributes. */
-                       if (pci_set_dma_mask(pdev, 0xffffffffffffffffULL) &&
-                           pci_set_dma_mask(pdev, 0xffffffffULL))
+                       if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) &&
+                           pci_set_dma_mask(pdev, DMA_32BIT_MASK))
                                        continue;
 
                        host = scsi_register(tmpt, sizeof(struct isp2x00_hostdata));
@@ -1325,7 +1327,7 @@ static int isp2x00_queuecommand(Scsi_Cmnd * Cmnd, void (*done) (Scsi_Cmnd *))
                cmd->control_flags = cpu_to_le16(CFLAG_READ);
 
        if (Cmnd->device->tagged_supported) {
-               if ((jiffies - hostdata->tag_ages[Cmnd->device->id]) > (2 * ISP_TIMEOUT)) {
+               if (time_after(jiffies, hostdata->tag_ages[Cmnd->device->id] + (2 * ISP_TIMEOUT))) {
                        cmd->control_flags |= cpu_to_le16(CFLAG_ORDERED_TAG);
                        hostdata->tag_ages[Cmnd->device->id] = jiffies;
                } else
index 1fd5fc6d0fe3fb7fe1e8fb6c297fd3e9ef709a20..c7e78dcf09df237734d944587aa6f0e664fe223c 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
+#include <linux/jiffies.h>
 
 #include <asm/byteorder.h>
 
@@ -1017,7 +1018,7 @@ static inline void cmd_frob(struct Command_Entry *cmd, struct scsi_cmnd *Cmnd,
        if (Cmnd->device->tagged_supported) {
                if (qpti->cmd_count[Cmnd->device->id] == 0)
                        qpti->tag_ages[Cmnd->device->id] = jiffies;
-               if ((jiffies - qpti->tag_ages[Cmnd->device->id]) > (5*HZ)) {
+               if (time_after(jiffies, qpti->tag_ages[Cmnd->device->id] + (5*HZ))) {
                        cmd->control_flags = CFLAG_ORDERED_TAG;
                        qpti->tag_ages[Cmnd->device->id] = jiffies;
                } else
index 5996d3cd0ed854d2c13f2ecb30b2918cea025cab..674b15c78f680ab190b308dbbffaa01fd7482f6c 100644 (file)
@@ -1528,7 +1528,7 @@ static int serial8250_startup(struct uart_port *port)
 
        /*
         * Clear the FIFO buffers and disable them.
-        * (they will be reeanbled in set_termios())
+        * (they will be reenabled in set_termios())
         */
        serial8250_clear_fifos(up);
 
index b848b7d944129b17448fcc4873a428e56a619ee1..3bdee64d1a997101f12f49f9f7c509c25694cbd8 100644 (file)
@@ -483,7 +483,7 @@ static int serial_txx9_startup(struct uart_port *port)
 
        /*
         * Clear the FIFO buffers and disable them.
-        * (they will be reeanbled in set_termios())
+        * (they will be reenabled in set_termios())
         */
        sio_set(up, TXX9_SIFCR,
                TXX9_SIFCR_TFRST | TXX9_SIFCR_RFRST | TXX9_SIFCR_FRSTE);
index 9fe2283d91e5eb31531a93eb3b425402ebdf2b45..1c4396c2962d0de28ce661921655bd76d2c49820 100644 (file)
@@ -641,7 +641,7 @@ static int sunsu_startup(struct uart_port *port)
 
        /*
         * Clear the FIFO buffers and disable them.
-        * (they will be reeanbled in set_termios())
+        * (they will be reenabled in set_termios())
         */
        if (uart_config[up->port.type].flags & UART_CLEAR_FIFO) {
                serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
index 7a6db1c5c8c5bf491f8f9b237d18b2b812e0dcf3..e166fffea86ba5b971df5d6fd7e4f2c95240e689 100644 (file)
@@ -49,7 +49,7 @@ static int phone_open(struct inode *inode, struct file *file)
        unsigned int minor = iminor(inode);
        int err = 0;
        struct phone_device *p;
-       struct file_operations *old_fops, *new_fops = NULL;
+       const struct file_operations *old_fops, *new_fops = NULL;
 
        if (minor >= PHONE_NUM_DEVICES)
                return -ENODEV;
index 37b13368c8145c9ca8522aab5d074d30dc3eb42f..b263a54a13c0b79099bf0989fa818b862284521a 100644 (file)
 #include "usb.h"
 
 #define MAX_USB_MINORS 256
-static struct file_operations *usb_minors[MAX_USB_MINORS];
+static const struct file_operations *usb_minors[MAX_USB_MINORS];
 static DEFINE_SPINLOCK(minor_lock);
 
 static int usb_open(struct inode * inode, struct file * file)
 {
        int minor = iminor(inode);
-       struct file_operations *c;
+       const struct file_operations *c;
        int err = -ENODEV;
-       struct file_operations *old_fops, *new_fops = NULL;
+       const struct file_operations *old_fops, *new_fops = NULL;
 
        spin_lock (&minor_lock);
        c = usb_minors[minor];
index b44cfda76b61a572ddb2c6f7411297d4d7433dd1..3f618ce6998dbb1b92a604784d96de0b9df29ba1 100644 (file)
@@ -1581,7 +1581,7 @@ restart:
 
 static struct inode *
 gadgetfs_create_file (struct super_block *sb, char const *name,
-               void *data, struct file_operations *fops,
+               void *data, const struct file_operations *fops,
                struct dentry **dentry_p);
 
 static int activate_ep_files (struct dev_data *dev)
@@ -1955,7 +1955,7 @@ module_param (default_perm, uint, 0644);
 
 static struct inode *
 gadgetfs_make_inode (struct super_block *sb,
-               void *data, struct file_operations *fops,
+               void *data, const struct file_operations *fops,
                int mode)
 {
        struct inode *inode = new_inode (sb);
@@ -1979,7 +1979,7 @@ gadgetfs_make_inode (struct super_block *sb,
  */
 static struct inode *
 gadgetfs_create_file (struct super_block *sb, char const *name,
-               void *data, struct file_operations *fops,
+               void *data, const struct file_operations *fops,
                struct dentry **dentry_p)
 {
        struct dentry   *dentry;
index 372527a835930fcb51b236c0ba359c0e5aff629c..682bf2215660fccb6325dca29f35749bb23e8dbe 100644 (file)
@@ -158,7 +158,7 @@ static int ohci_s3c2410_hub_control (
                "s3c2410_hub_control(%p,0x%04x,0x%04x,0x%04x,%p,%04x)\n",
                hcd, typeReq, wValue, wIndex, buf, wLength);
 
-       /* if we are only an humble host without any special capabilites
+       /* if we are only an humble host without any special capabilities
         * process the request straight away and exit */
 
        if (info == NULL) {
index 9c5ab251370c5b78e578b24e0d1aaafbe0d61744..f7ac9d6b985687a197994e2211c9ca30cb1649e3 100644 (file)
@@ -217,7 +217,7 @@ static int blan_mdlm_bind(struct usbnet *dev, struct usb_interface *intf)
                         * with devices that use it and those that don't.
                         */
                        if ((detail->bDetailData[1] & ~0x02) != 0x01) {
-                               /* bmDataCapabilites == 0 would be fine too,
+                               /* bmDataCapabilities == 0 would be fine too,
                                 * but framing is minidriver-coupled for now.
                                 */
 bad_detail:
index 43c9f7de0314e8360b943746424a5d596e10236e..f867b8d3e973a069d1d0bf21495114963e36a0a0 100644 (file)
@@ -39,8 +39,8 @@
 
 extern struct file_system_type v9fs_fs_type;
 extern struct address_space_operations v9fs_addr_operations;
-extern struct file_operations v9fs_file_operations;
-extern struct file_operations v9fs_dir_operations;
+extern const struct file_operations v9fs_file_operations;
+extern const struct file_operations v9fs_dir_operations;
 extern struct dentry_operations v9fs_dentry_operations;
 
 struct inode *v9fs_get_inode(struct super_block *sb, int mode);
index 766f11f1215c9545bf347dada64a725b942951fa..e32d5971039b6712db19eb62fc19210be226656e 100644 (file)
@@ -204,7 +204,7 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
        return 0;
 }
 
-struct file_operations v9fs_dir_operations = {
+const struct file_operations v9fs_dir_operations = {
        .read = generic_read_dir,
        .readdir = v9fs_dir_readdir,
        .open = v9fs_file_open,
index 59e74416340775af80a41ee99ce36366c4223466..083dcfcd158e1cd3df4e445fdecabdd3c286f8eb 100644 (file)
@@ -266,7 +266,7 @@ v9fs_file_write(struct file *filp, const char __user * data,
        return total;
 }
 
-struct file_operations v9fs_file_operations = {
+const struct file_operations v9fs_file_operations = {
        .llseek = generic_file_llseek,
        .read = v9fs_file_read,
        .write = v9fs_file_write,
index f6cd01352cc87753f4ee717c70197bc146e68ed3..29217ff36d446a673dbabde26823b948aa6ce89b 100644 (file)
@@ -85,7 +85,7 @@ void __adfs_error(struct super_block *sb, const char *function,
 
 /* dir_*.c */
 extern struct inode_operations adfs_dir_inode_operations;
-extern struct file_operations adfs_dir_operations;
+extern const struct file_operations adfs_dir_operations;
 extern struct dentry_operations adfs_dentry_operations;
 extern struct adfs_dir_ops adfs_f_dir_ops;
 extern struct adfs_dir_ops adfs_fplus_dir_ops;
@@ -94,7 +94,7 @@ extern int adfs_dir_update(struct super_block *sb, struct object_info *obj);
 
 /* file.c */
 extern struct inode_operations adfs_file_inode_operations;
-extern struct file_operations adfs_file_operations;
+extern const struct file_operations adfs_file_operations;
 
 static inline __u32 signed_asl(__u32 val, signed int shift)
 {
index 0b4c3a028076699cef70483056d31e7f1c17faea..7b075fc397da7bcffece6dcde249afdf2d097f1e 100644 (file)
@@ -196,7 +196,7 @@ out:
        return ret;
 }
 
-struct file_operations adfs_dir_operations = {
+const struct file_operations adfs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = adfs_readdir,
        .fsync          = file_fsync,
index 6af10885f9d6d0449a8e6836eedbbede5794ff6b..1014b9f2117b2bd2e6bc00086f8bcc9d84475d0e 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "adfs.h"
 
-struct file_operations adfs_file_operations = {
+const struct file_operations adfs_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .mmap           = generic_file_mmap,
index 0c6799f2137a742bf339d4b210651aa67394d37a..a43a876742b8e3b9759c7429e475bb62f5fb7e61 100644 (file)
@@ -192,9 +192,9 @@ extern void   affs_dir_truncate(struct inode *);
 extern struct inode_operations  affs_file_inode_operations;
 extern struct inode_operations  affs_dir_inode_operations;
 extern struct inode_operations   affs_symlink_inode_operations;
-extern struct file_operations   affs_file_operations;
-extern struct file_operations   affs_file_operations_ofs;
-extern struct file_operations   affs_dir_operations;
+extern const struct file_operations     affs_file_operations;
+extern const struct file_operations     affs_file_operations_ofs;
+extern const struct file_operations     affs_dir_operations;
 extern struct address_space_operations  affs_symlink_aops;
 extern struct address_space_operations  affs_aops;
 extern struct address_space_operations  affs_aops_ofs;
index 548efd0ee98cd9e8e5449abde56d0c2821afaed4..5d9649fa1814c1ab8d2d4f91f4dd24aa6a81ce55 100644 (file)
@@ -17,7 +17,7 @@
 
 static int affs_readdir(struct file *, void *, filldir_t);
 
-struct file_operations affs_dir_operations = {
+const struct file_operations affs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = affs_readdir,
        .fsync          = file_fsync,
index f72fb776ecdf86621f95e7e444c2d0ac54191f67..7076262af39b39404c4ae2669392597934554602 100644 (file)
@@ -25,7 +25,7 @@ static struct buffer_head *affs_get_extblock_slow(struct inode *inode, u32 ext);
 static int affs_file_open(struct inode *inode, struct file *filp);
 static int affs_file_release(struct inode *inode, struct file *filp);
 
-struct file_operations affs_file_operations = {
+const struct file_operations affs_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
index 5c61c24dab2a12dac4b55ae70ef87191cc53defd..a6dff6a4f204c9cfa3fdcfd8b703f9cdc1d74afd 100644 (file)
@@ -32,7 +32,7 @@ static int afs_d_delete(struct dentry *dentry);
 static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen,
                                  loff_t fpos, ino_t ino, unsigned dtype);
 
-struct file_operations afs_dir_file_operations = {
+const struct file_operations afs_dir_file_operations = {
        .open           = afs_dir_open,
        .readdir        = afs_dir_readdir,
 };
index ab8f87c66319bc4233444e8bcd7c3f17163e5d88..72febdf9a35af9379996eb51a9167e1c085aeb8b 100644 (file)
@@ -64,7 +64,7 @@ extern struct cachefs_index_def afs_cache_cell_index_def;
  * dir.c
  */
 extern struct inode_operations afs_dir_inode_operations;
-extern struct file_operations afs_dir_file_operations;
+extern const struct file_operations afs_dir_file_operations;
 
 /*
  * file.c
@@ -105,7 +105,7 @@ extern struct cachefs_netfs afs_cache_netfs;
  * mntpt.c
  */
 extern struct inode_operations afs_mntpt_inode_operations;
-extern struct file_operations afs_mntpt_file_operations;
+extern const struct file_operations afs_mntpt_file_operations;
 extern struct afs_timer afs_mntpt_expiry_timer;
 extern struct afs_timer_ops afs_mntpt_expiry_timer_ops;
 extern unsigned long afs_mntpt_expiry_timeout;
index 31ee06590de549d833be410c742da32240187d22..4e6eeb59b83cc02a2ccb1b24ad3ba515770f8d57 100644 (file)
@@ -32,7 +32,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir,
 static int afs_mntpt_open(struct inode *inode, struct file *file);
 static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd);
 
-struct file_operations afs_mntpt_file_operations = {
+const struct file_operations afs_mntpt_file_operations = {
        .open           = afs_mntpt_open,
 };
 
index 9c81b8f7eef07dfd5e976768f55edf18ea383329..101d21b6c03715b45ead510a2abccb706f23d209 100644 (file)
@@ -37,7 +37,7 @@ static struct seq_operations afs_proc_cells_ops = {
        .show   = afs_proc_cells_show,
 };
 
-static struct file_operations afs_proc_cells_fops = {
+static const struct file_operations afs_proc_cells_fops = {
        .open           = afs_proc_cells_open,
        .read           = seq_read,
        .write          = afs_proc_cells_write,
@@ -53,7 +53,7 @@ static ssize_t afs_proc_rootcell_write(struct file *file,
                                       const char __user *buf,
                                       size_t size, loff_t *_pos);
 
-static struct file_operations afs_proc_rootcell_fops = {
+static const struct file_operations afs_proc_rootcell_fops = {
        .open           = afs_proc_rootcell_open,
        .read           = afs_proc_rootcell_read,
        .write          = afs_proc_rootcell_write,
@@ -77,7 +77,7 @@ static struct seq_operations afs_proc_cell_volumes_ops = {
        .show   = afs_proc_cell_volumes_show,
 };
 
-static struct file_operations afs_proc_cell_volumes_fops = {
+static const struct file_operations afs_proc_cell_volumes_fops = {
        .open           = afs_proc_cell_volumes_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -101,7 +101,7 @@ static struct seq_operations afs_proc_cell_vlservers_ops = {
        .show   = afs_proc_cell_vlservers_show,
 };
 
-static struct file_operations afs_proc_cell_vlservers_fops = {
+static const struct file_operations afs_proc_cell_vlservers_fops = {
        .open           = afs_proc_cell_vlservers_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -124,7 +124,7 @@ static struct seq_operations afs_proc_cell_servers_ops = {
        .show   = afs_proc_cell_servers_show,
 };
 
-static struct file_operations afs_proc_cell_servers_fops = {
+static const struct file_operations afs_proc_cell_servers_fops = {
        .open           = afs_proc_cell_servers_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 990c28da5aecec59a81e7fab256a3bf0cbfc7f6c..a62327f1bdffeb4085fb7839e6b9d409d69c4d3c 100644 (file)
@@ -146,7 +146,7 @@ struct autofs_dir_ent *autofs_expire(struct super_block *,struct autofs_sb_info
 
 extern struct inode_operations autofs_root_inode_operations;
 extern struct inode_operations autofs_symlink_inode_operations;
-extern struct file_operations autofs_root_operations;
+extern const struct file_operations autofs_root_operations;
 
 /* Initializing function */
 
index 870e2cf3301653030bb9cf29512c163f8e172398..9cac08d6a873111086c8ab75529976589e12dfce 100644 (file)
@@ -26,7 +26,7 @@ static int autofs_root_rmdir(struct inode *,struct dentry *);
 static int autofs_root_mkdir(struct inode *,struct dentry *,int);
 static int autofs_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long);
 
-struct file_operations autofs_root_operations = {
+const struct file_operations autofs_root_operations = {
        .read           = generic_read_dir,
        .readdir        = autofs_root_readdir,
        .ioctl          = autofs_root_ioctl,
index 617fd7b37447a326623525b85d64de024b455141..57c4903614e58c29a2eae1462f1f46c1ca8083ec 100644 (file)
@@ -176,8 +176,8 @@ extern struct inode_operations autofs4_dir_inode_operations;
 extern struct inode_operations autofs4_root_inode_operations;
 extern struct inode_operations autofs4_indirect_root_inode_operations;
 extern struct inode_operations autofs4_direct_root_inode_operations;
-extern struct file_operations autofs4_dir_operations;
-extern struct file_operations autofs4_root_operations;
+extern const struct file_operations autofs4_dir_operations;
+extern const struct file_operations autofs4_root_operations;
 
 /* Initializing function */
 
@@ -230,3 +230,6 @@ static inline int __simple_empty(struct dentry *dentry)
 out:
        return ret;
 }
+
+void autofs4_dentry_release(struct dentry *);
+
index 4eddee4e76fc5bee26d0e3270bae7958ef41536e..fde78b110dddf1675860b319433e218a41ba71dc 100644 (file)
@@ -292,7 +292,6 @@ static struct autofs_info *autofs4_mkroot(struct autofs_sb_info *sbi)
        return ino;
 }
 
-void autofs4_dentry_release(struct dentry *);
 static struct dentry_operations autofs4_sb_dentry_operations = {
        .d_release      = autofs4_dentry_release,
 };
index c8fe43a475e2a7be6c8d7cdfadb01092a508a868..84e030c8ddd0f99047473308afc4d26f555e2c14 100644 (file)
@@ -32,7 +32,7 @@ static int autofs4_root_readdir(struct file * filp, void * dirent, filldir_t fil
 static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
 static void *autofs4_follow_link(struct dentry *, struct nameidata *);
 
-struct file_operations autofs4_root_operations = {
+const struct file_operations autofs4_root_operations = {
        .open           = dcache_dir_open,
        .release        = dcache_dir_close,
        .read           = generic_read_dir,
@@ -40,7 +40,7 @@ struct file_operations autofs4_root_operations = {
        .ioctl          = autofs4_root_ioctl,
 };
 
-struct file_operations autofs4_dir_operations = {
+const struct file_operations autofs4_dir_operations = {
        .open           = autofs4_dir_open,
        .release        = autofs4_dir_close,
        .read           = generic_read_dir,
index e172180a1d8c3f0173adae9101175c1454111ce3..80599ae339669d3a3a962d64d974f62fb30a58d6 100644 (file)
@@ -22,7 +22,7 @@ static int return_EIO(void)
 
 #define EIO_ERROR ((void *) (return_EIO))
 
-static struct file_operations bad_file_ops =
+static const struct file_operations bad_file_ops =
 {
        .llseek         = EIO_ERROR,
        .aio_read       = EIO_ERROR,
index 044a59587829ba5b5573ec9edf7270359cbc7a3a..68ebd10f345db87fc2d7cee847d16431168e257c 100644 (file)
@@ -64,7 +64,7 @@ static const struct super_operations befs_sops = {
 /* slab cache for befs_inode_info objects */
 static kmem_cache_t *befs_inode_cachep;
 
-static struct file_operations befs_dir_operations = {
+static const struct file_operations befs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = befs_readdir,
 };
index 1fbc53f14aba998648c6bd3dba91590c924c4a50..9d791004b21ccbf02ccc7a6d01d01a64cddf0b70 100644 (file)
@@ -49,11 +49,11 @@ static inline struct bfs_inode_info *BFS_I(struct inode *inode)
 
 /* file.c */
 extern struct inode_operations bfs_file_inops;
-extern struct file_operations bfs_file_operations;
+extern const struct file_operations bfs_file_operations;
 extern struct address_space_operations bfs_aops;
 
 /* dir.c */
 extern struct inode_operations bfs_dir_inops;
-extern struct file_operations bfs_dir_operations;
+extern const struct file_operations bfs_dir_operations;
 
 #endif /* _FS_BFS_BFS_H */
index 5af928fa044909a63d0f82297ee4a70ffec6b71c..26fad96217380786af130867e2e8f943d670fe4b 100644 (file)
@@ -70,7 +70,7 @@ static int bfs_readdir(struct file * f, void * dirent, filldir_t filldir)
        return 0;       
 }
 
-struct file_operations bfs_dir_operations = {
+const struct file_operations bfs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = bfs_readdir,
        .fsync          = file_fsync,
index 807723b65daf3b1c93830325e441bf4b03bc81ef..d83cd74a2e4e681a061552e8c26e22070e41efa0 100644 (file)
@@ -17,7 +17,7 @@
 #define dprintf(x...)
 #endif
 
-struct file_operations bfs_file_operations = {
+const struct file_operations bfs_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
index 6a7b730c206bbc8c8e0f757187873dff2af3d3b6..d73d75591a3966125003fdc8e6edebca1d7cc5e3 100644 (file)
@@ -600,7 +600,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
        return count;
 }
 
-static struct file_operations bm_entry_operations = {
+static const struct file_operations bm_entry_operations = {
        .read           = bm_entry_read,
        .write          = bm_entry_write,
 };
@@ -668,7 +668,7 @@ out:
        return count;
 }
 
-static struct file_operations bm_register_operations = {
+static const struct file_operations bm_register_operations = {
        .write          = bm_register_write,
 };
 
@@ -715,7 +715,7 @@ static ssize_t bm_status_write(struct file * file, const char __user * buffer,
        return count;
 }
 
-static struct file_operations bm_status_operations = {
+static const struct file_operations bm_status_operations = {
        .read           = bm_status_read,
        .write          = bm_status_write,
 };
index 17c76182f389849c657cd60a791e1435411214f4..af88c43043d589a45c20e744d44dd15b557243e4 100644 (file)
@@ -1087,7 +1087,7 @@ struct address_space_operations def_blk_aops = {
        .direct_IO      = blkdev_direct_IO,
 };
 
-struct file_operations def_blk_fops = {
+const struct file_operations def_blk_fops = {
        .open           = blkdev_open,
        .release        = blkdev_close,
        .llseek         = block_llseek,
index 8c6eb04d31e2ab9033a067fc42393d5fa8c38a60..4e1b849f912f740d6d120fe02abab1a347f53035 100644 (file)
@@ -250,7 +250,7 @@ int alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count,
 }
 
 int register_chrdev(unsigned int major, const char *name,
-                   struct file_operations *fops)
+                   const struct file_operations *fops)
 {
        struct char_device_struct *cd;
        struct cdev *cdev;
@@ -406,7 +406,7 @@ static void cdev_purge(struct cdev *cdev)
  * is contain the open that then fills in the correct operations
  * depending on the special file...
  */
-struct file_operations def_chr_fops = {
+const struct file_operations def_chr_fops = {
        .open = chrdev_open,
 };
 
@@ -473,7 +473,7 @@ struct cdev *cdev_alloc(void)
        return p;
 }
 
-void cdev_init(struct cdev *cdev, struct file_operations *fops)
+void cdev_init(struct cdev *cdev, const struct file_operations *fops)
 {
        memset(cdev, 0, sizeof *cdev);
        INIT_LIST_HEAD(&cdev->list);
index 6b99b51d66946b16b3553d3cf9bb36172eb292a0..4bbc544857bccf160405121a8719d89736ed1699 100644 (file)
@@ -583,7 +583,7 @@ struct inode_operations cifs_symlink_inode_ops = {
 #endif 
 };
 
-struct file_operations cifs_file_ops = {
+const struct file_operations cifs_file_ops = {
        .read = do_sync_read,
        .write = do_sync_write,
        .readv = generic_file_readv,
@@ -607,7 +607,7 @@ struct file_operations cifs_file_ops = {
 #endif /* CONFIG_CIFS_EXPERIMENTAL */
 };
 
-struct file_operations cifs_file_direct_ops = {
+const struct file_operations cifs_file_direct_ops = {
        /* no mmap, no aio, no readv - 
           BB reevaluate whether they can be done with directio, no cache */
        .read = cifs_user_read,
@@ -626,7 +626,7 @@ struct file_operations cifs_file_direct_ops = {
        .dir_notify = cifs_dir_notify,
 #endif /* CONFIG_CIFS_EXPERIMENTAL */
 };
-struct file_operations cifs_file_nobrl_ops = {
+const struct file_operations cifs_file_nobrl_ops = {
        .read = do_sync_read,
        .write = do_sync_write,
        .readv = generic_file_readv,
@@ -649,7 +649,7 @@ struct file_operations cifs_file_nobrl_ops = {
 #endif /* CONFIG_CIFS_EXPERIMENTAL */
 };
 
-struct file_operations cifs_file_direct_nobrl_ops = {
+const struct file_operations cifs_file_direct_nobrl_ops = {
        /* no mmap, no aio, no readv - 
           BB reevaluate whether they can be done with directio, no cache */
        .read = cifs_user_read,
@@ -668,7 +668,7 @@ struct file_operations cifs_file_direct_nobrl_ops = {
 #endif /* CONFIG_CIFS_EXPERIMENTAL */
 };
 
-struct file_operations cifs_dir_ops = {
+const struct file_operations cifs_dir_ops = {
        .readdir = cifs_readdir,
        .release = cifs_closedir,
        .read    = generic_read_dir,
index 821a8eb2255965a77e031c37a6b2f4c674f97e48..74f405ae4da349e4a0224aece033cfb5dbb8ecaa 100644 (file)
@@ -61,10 +61,10 @@ extern struct inode_operations cifs_file_inode_ops;
 extern struct inode_operations cifs_symlink_inode_ops;
 
 /* Functions related to files and directories */
-extern struct file_operations cifs_file_ops;
-extern struct file_operations cifs_file_direct_ops; /* if directio mount */
-extern struct file_operations cifs_file_nobrl_ops;
-extern struct file_operations cifs_file_direct_nobrl_ops; /* if directio mount */
+extern const struct file_operations cifs_file_ops;
+extern const struct file_operations cifs_file_direct_ops; /* if directio mount */
+extern const struct file_operations cifs_file_nobrl_ops;
+extern const struct file_operations cifs_file_direct_nobrl_ops; /* if directio mount */
 extern int cifs_open(struct inode *inode, struct file *file);
 extern int cifs_close(struct inode *inode, struct file *file);
 extern int cifs_closedir(struct inode *inode, struct file *file);
@@ -76,7 +76,7 @@ extern int cifs_lock(struct file *, int, struct file_lock *);
 extern int cifs_fsync(struct file *, struct dentry *, int);
 extern int cifs_flush(struct file *);
 extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
-extern struct file_operations cifs_dir_ops;
+extern const struct file_operations cifs_dir_ops;
 extern int cifs_dir_open(struct inode *inode, struct file *file);
 extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir);
 extern int cifs_dir_notify(struct file *, unsigned long arg);
index 54f76de8a686f30c9ab03917ce18524341031a66..71f2ea632e5376168d5b8aa4f194604941021104 100644 (file)
@@ -82,7 +82,7 @@ struct inode_operations coda_dir_inode_operations =
        .setattr        = coda_setattr,
 };
 
-struct file_operations coda_dir_operations = {
+const struct file_operations coda_dir_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
        .readdir        = coda_readdir,
index 146a991d6eb5890349165a59dc6c203daea5a556..7c2642431fa5baa7bef2aa4cb0514b01615d5d0b 100644 (file)
@@ -288,7 +288,7 @@ int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync)
        return err;
 }
 
-struct file_operations coda_file_operations = {
+const struct file_operations coda_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = coda_file_read,
        .write          = coda_file_write,
index 127714936c666f5fc97e4d68927a68e3d0ae6726..214822be87bdd424c07a9cc116d74a4ca6e5eada 100644 (file)
@@ -36,7 +36,7 @@ struct inode_operations coda_ioctl_inode_operations =
        .setattr        = coda_setattr,
 };
 
-struct file_operations coda_ioctl_operations = {
+const struct file_operations coda_ioctl_operations = {
        .owner          = THIS_MODULE,
        .ioctl          = coda_pioctl,
 };
index 98c74fe2e139d0f349cb1201577abdbad8b6b3f2..6c6771db36da4f482f123a42f92c852e90cf05fd 100644 (file)
@@ -342,7 +342,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
 }
 
 
-static struct file_operations coda_psdev_fops = {
+static const struct file_operations coda_psdev_fops = {
        .owner          = THIS_MODULE,
        .read           = coda_psdev_read,
        .write          = coda_psdev_write,
index ef5a0771592d1a5d30d2cb9eb53799ed2c862520..7f8e26ea427c4bed0d125c4fa051e28a7db6123f 100644 (file)
@@ -1639,15 +1639,6 @@ void compat_set_fd_set(unsigned long nr, compat_ulong_t __user *ufdset,
  * This is a virtual copy of sys_select from fs/select.c and probably
  * should be compared to it from time to time
  */
-static void *select_bits_alloc(int size)
-{
-       return kmalloc(6 * size, GFP_KERNEL);
-}
-
-static void select_bits_free(void *bits, int size)
-{
-       kfree(bits);
-}
 
 /*
  * We can actually return ERESTARTSYS instead of EINTR, but I'd
@@ -1686,7 +1677,7 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp,
         */
        ret = -ENOMEM;
        size = FDS_BYTES(n);
-       bits = select_bits_alloc(size);
+       bits = kmalloc(6 * size, GFP_KERNEL);
        if (!bits)
                goto out_nofds;
        fds.in      = (unsigned long *)  bits;
@@ -1720,7 +1711,7 @@ int compat_core_sys_select(int n, compat_ulong_t __user *inp,
        compat_set_fd_set(n, exp, fds.res_ex);
 
 out:
-       select_bits_free(bits, size);
+       kfree(bits);
 out_nofds:
        return ret;
 }
index f70e46951b3781ec1baa4677e715919ac78724c2..3f4ff7a242b9ebf746bf93f1ea67beb0622d1cf4 100644 (file)
@@ -72,9 +72,9 @@ extern void configfs_release_fs(void);
 
 extern struct rw_semaphore configfs_rename_sem;
 extern struct super_block * configfs_sb;
-extern struct file_operations configfs_dir_operations;
-extern struct file_operations configfs_file_operations;
-extern struct file_operations bin_fops;
+extern const struct file_operations configfs_dir_operations;
+extern const struct file_operations configfs_file_operations;
+extern const struct file_operations bin_fops;
 extern struct inode_operations configfs_dir_inode_operations;
 extern struct inode_operations configfs_symlink_inode_operations;
 
index ca60e3abef451d64ce9df9374b2b49dfe8a5d97c..8ed9b06a982834d91b70c9919d16f58f9149d1af 100644 (file)
@@ -1027,7 +1027,7 @@ static loff_t configfs_dir_lseek(struct file * file, loff_t offset, int origin)
        return offset;
 }
 
-struct file_operations configfs_dir_operations = {
+const struct file_operations configfs_dir_operations = {
        .open           = configfs_dir_open,
        .release        = configfs_dir_close,
        .llseek         = configfs_dir_lseek,
index 3921920d8716a32f3495e8200abad6c0b2d08f2c..f499803743e04add3d576dc919e0a54752d00ba1 100644 (file)
@@ -322,7 +322,7 @@ static int configfs_release(struct inode * inode, struct file * filp)
        return 0;
 }
 
-struct file_operations configfs_file_operations = {
+const struct file_operations configfs_file_operations = {
        .read           = configfs_read_file,
        .write          = configfs_write_file,
        .llseek         = generic_file_llseek,
index acc1b2c10a86a2283b7f3eaa84bf621f2704268a..9efcc3a164e8ccb1278e4cbebd8dcd0ad0cefffd 100644 (file)
@@ -29,7 +29,7 @@
 
 static struct super_operations cramfs_ops;
 static struct inode_operations cramfs_dir_inode_operations;
-static struct file_operations cramfs_directory_operations;
+static const struct file_operations cramfs_directory_operations;
 static struct address_space_operations cramfs_aops;
 
 static DEFINE_MUTEX(read_mutex);
@@ -512,7 +512,7 @@ static struct address_space_operations cramfs_aops = {
 /*
  * A directory can only readdir
  */
-static struct file_operations cramfs_directory_operations = {
+static const struct file_operations cramfs_directory_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
        .readdir        = cramfs_readdir,
index 40c4fc973fad3125e3732b92c755f985a198a3dd..66a505422e5cbb8f75756022366a27a16688628b 100644 (file)
@@ -39,7 +39,7 @@ static int default_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-struct file_operations debugfs_file_operations = {
+const struct file_operations debugfs_file_operations = {
        .read =         default_read_file,
        .write =        default_write_file,
        .open =         default_open,
@@ -213,7 +213,7 @@ static ssize_t write_file_bool(struct file *file, const char __user *user_buf,
        return count;
 }
 
-static struct file_operations fops_bool = {
+static const struct file_operations fops_bool = {
        .read =         read_file_bool,
        .write =        write_file_bool,
        .open =         default_open,
index d4f1a2cddd47779a9b765316f7c653273d86eace..85d166cdcae4908e8916b4e66a1dd30722b00f1c 100644 (file)
@@ -191,7 +191,7 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
  */
 struct dentry *debugfs_create_file(const char *name, mode_t mode,
                                   struct dentry *parent, void *data,
-                                  struct file_operations *fops)
+                                  const struct file_operations *fops)
 {
        struct dentry *dentry = NULL;
        int error;
index b621521e09d4af83152845d889882947e29a0e5d..52f5059c4f311532d7898f5053ae520ed9f217df 100644 (file)
@@ -856,14 +856,14 @@ static int devfsd_close(struct inode *inode, struct file *file);
 #ifdef CONFIG_DEVFS_DEBUG
 static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
                         loff_t * ppos);
-static struct file_operations stat_fops = {
+static const struct file_operations stat_fops = {
        .open = nonseekable_open,
        .read = stat_read,
 };
 #endif
 
 /*  Devfs daemon file operations  */
-static struct file_operations devfsd_fops = {
+static const struct file_operations devfsd_fops = {
        .open = nonseekable_open,
        .read = devfsd_read,
        .ioctl = devfsd_ioctl,
@@ -1842,8 +1842,8 @@ static int try_modload(struct devfs_entry *parent, struct fs_info *fs_info,
 
 static struct inode_operations devfs_iops;
 static struct inode_operations devfs_dir_iops;
-static struct file_operations devfs_fops;
-static struct file_operations devfs_dir_fops;
+static const struct file_operations devfs_fops;
+static const struct file_operations devfs_dir_fops;
 static struct inode_operations devfs_symlink_iops;
 
 static int devfs_notify_change(struct dentry *dentry, struct iattr *iattr)
@@ -2061,11 +2061,11 @@ static int devfs_open(struct inode *inode, struct file *file)
        return err;
 }                              /*  End Function devfs_open  */
 
-static struct file_operations devfs_fops = {
+static const struct file_operations devfs_fops = {
        .open = devfs_open,
 };
 
-static struct file_operations devfs_dir_fops = {
+static const struct file_operations devfs_dir_fops = {
        .read = generic_read_dir,
        .readdir = devfs_readdir,
 };
index 777c614ff360e7f578bc1e89423b982804680454..17f5b2d3c16a7071a18010926d574a26046569b1 100644 (file)
@@ -10,7 +10,7 @@
 
 static int efs_readdir(struct file *, void *, filldir_t);
 
-struct file_operations efs_dir_operations = {
+const struct file_operations efs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = efs_readdir,
 };
index e067a06c64645663da32c3905e5fb0724d7ac04d..242fe1a66ce5731690fc9e7dfe340307bc685448 100644 (file)
@@ -290,7 +290,7 @@ static kmem_cache_t *pwq_cache __read_mostly;
 static struct vfsmount *eventpoll_mnt __read_mostly;
 
 /* File callbacks that implement the eventpoll file behaviour */
-static struct file_operations eventpoll_fops = {
+static const struct file_operations eventpoll_fops = {
        .release        = ep_eventpoll_close,
        .poll           = ep_eventpoll_poll
 };
index 0165388c425cce5625d4265ee40136ae9a988d25..d672aa9f40612b94ba9810ff5c681d7106a4c5b1 100644 (file)
@@ -658,7 +658,7 @@ not_empty:
        return 0;
 }
 
-struct file_operations ext2_dir_operations = {
+const struct file_operations ext2_dir_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
        .readdir        = ext2_readdir,
index 11035ac7986f19a13d1f8485e573b2268f2c25ae..9f74a62be555f1cc84da03e9455d8efb27652a5e 100644 (file)
@@ -154,12 +154,12 @@ extern void ext2_write_super (struct super_block *);
  */
 
 /* dir.c */
-extern struct file_operations ext2_dir_operations;
+extern const struct file_operations ext2_dir_operations;
 
 /* file.c */
 extern struct inode_operations ext2_file_inode_operations;
-extern struct file_operations ext2_file_operations;
-extern struct file_operations ext2_xip_file_operations;
+extern const struct file_operations ext2_file_operations;
+extern const struct file_operations ext2_xip_file_operations;
 
 /* inode.c */
 extern struct address_space_operations ext2_aops;
index a484412fc7821bc37dfff95c5141c37ac7cbe3e2..509cceca04dbf5f24fc9a0d14fcaca6d685a6d36 100644 (file)
@@ -39,7 +39,7 @@ static int ext2_release_file (struct inode * inode, struct file * filp)
  * We have mostly NULL's here: the current defaults are ok for
  * the ext2 filesystem.
  */
-struct file_operations ext2_file_operations = {
+const struct file_operations ext2_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
@@ -56,7 +56,7 @@ struct file_operations ext2_file_operations = {
 };
 
 #ifdef CONFIG_EXT2_FS_XIP
-struct file_operations ext2_xip_file_operations = {
+const struct file_operations ext2_xip_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = xip_file_read,
        .write          = xip_file_write,
index 38bd3f6ec147775474ef3c27a9707fd5d33be5a5..f37528ed222e82ed419762b9839ca6546eab85f5 100644 (file)
@@ -39,7 +39,7 @@ static int ext3_dx_readdir(struct file * filp,
 static int ext3_release_dir (struct inode * inode,
                                struct file * filp);
 
-struct file_operations ext3_dir_operations = {
+const struct file_operations ext3_dir_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
        .readdir        = ext3_readdir,         /* we take BKL. needed?*/
index 59098ea56711cb5f07b17506ff1b66f405bb2cbb..783a796220bbe44f2fc124af0e9eaef6101e02dc 100644 (file)
@@ -105,7 +105,7 @@ force_commit:
        return ret;
 }
 
-struct file_operations ext3_file_operations = {
+const struct file_operations ext3_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = do_sync_read,
        .write          = do_sync_write,
index 4095bc149eb12ee182cf11a8b409a37e537d29d0..698b85bb1dd45855a709635eb6239a4c9bbef0d6 100644 (file)
@@ -741,7 +741,7 @@ static int fat_dir_ioctl(struct inode * inode, struct file * filp,
        return ret;
 }
 
-struct file_operations fat_dir_operations = {
+const struct file_operations fat_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = fat_readdir,
        .ioctl          = fat_dir_ioctl,
index 88aa1ae13f9f3022c7978d9bbd7e5cb20c2d71aa..1ee25232e6af3dd4cee629fdeba312f769cd8d02 100644 (file)
@@ -112,7 +112,7 @@ int fat_generic_ioctl(struct inode *inode, struct file *filp,
        }
 }
 
-struct file_operations fat_file_operations = {
+const struct file_operations fat_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = do_sync_read,
        .write          = do_sync_write,
index 404bfc9f7385ff1051c4abff11743346d857889f..c1ce284f8a944bf033cdc268aaa13670cff82976 100644 (file)
@@ -1435,9 +1435,6 @@ out_fail:
 
 EXPORT_SYMBOL_GPL(fat_fill_super);
 
-int __init fat_cache_init(void);
-void fat_cache_destroy(void);
-
 static int __init init_fat_fs(void)
 {
        int err;
index d13fcd3ec803bd52e335ef340d09c817421b05fb..889f722ee36d638c5379634ebe2eb54c1055e58e 100644 (file)
--- a/fs/fifo.c
+++ b/fs/fifo.c
@@ -145,6 +145,6 @@ err_nocleanup:
  * is contain the open that then fills in the correct operations
  * depending on the access mode of the file...
  */
-struct file_operations def_fifo_fops = {
+const struct file_operations def_fifo_fops = {
        .open           = fifo_open,    /* will set read or write pipe_fops */
 };
index bbc743314730b6eeadcc7d9a183f485f58875c81..55f4e70225631b275f85215ee543b104507caacc 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -373,6 +373,6 @@ static void __devinit fdtable_defer_list_init(int cpu)
 void __init files_defer_init(void)
 {
        int i;
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                fdtable_defer_list_init(i);
 }
index 927acf70c591c4b9793fc134912a9dc4363d61ea..1cf1fe8466a2c9f0efbb28e06e3cfe0c4f21c99e 100644 (file)
@@ -63,7 +63,7 @@ extern void                   vxfs_clear_inode(struct inode *);
 
 /* vxfs_lookup.c */
 extern struct inode_operations vxfs_dir_inode_ops;
-extern struct file_operations  vxfs_dir_operations;
+extern const struct file_operations    vxfs_dir_operations;
 
 /* vxfs_olt.c */
 extern int                     vxfs_read_olt(struct super_block *, u_long);
index 554eb455722cbb3812837d3bc1b7b64290ebcc30..29cce456c7ced1fdbfd6bfc7a9ed1b9a2ff07779 100644 (file)
@@ -56,7 +56,7 @@ struct inode_operations vxfs_dir_inode_ops = {
        .lookup =               vxfs_lookup,
 };
 
-struct file_operations vxfs_dir_operations = {
+const struct file_operations vxfs_dir_operations = {
        .readdir =              vxfs_readdir,
 };
 
index 0c9a2ee54c91dfde34d502737e821e93d5a765ad..23d1f52eb1b8de693f86c96a8eccc2bb5909d750 100644 (file)
@@ -922,7 +922,7 @@ static int fuse_dev_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-struct file_operations fuse_dev_operations = {
+const struct file_operations fuse_dev_operations = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = fuse_dev_read,
index c72a8a97935c9733af8522eeb2533bd83c930ba1..256355b80256f4525272f84788c8561207942389 100644 (file)
@@ -1170,7 +1170,7 @@ static struct inode_operations fuse_dir_inode_operations = {
        .removexattr    = fuse_removexattr,
 };
 
-static struct file_operations fuse_dir_operations = {
+static const struct file_operations fuse_dir_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
        .readdir        = fuse_readdir,
index 6f05379b0a0d31e41cc9373d6594097a82c55905..975f2697e866388d5c9e5ad9f80fc75f6e0953a1 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/slab.h>
 #include <linux/kernel.h>
 
-static struct file_operations fuse_direct_io_file_operations;
+static const struct file_operations fuse_direct_io_file_operations;
 
 static int fuse_send_open(struct inode *inode, struct file *file, int isdir,
                          struct fuse_open_out *outargp)
@@ -611,7 +611,7 @@ static int fuse_set_page_dirty(struct page *page)
        return 0;
 }
 
-static struct file_operations fuse_file_operations = {
+static const struct file_operations fuse_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
@@ -623,7 +623,7 @@ static struct file_operations fuse_file_operations = {
        .sendfile       = generic_file_sendfile,
 };
 
-static struct file_operations fuse_direct_io_file_operations = {
+static const struct file_operations fuse_direct_io_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = fuse_direct_read,
        .write          = fuse_direct_write,
index 4a83adfec968ebae108b9ae71802e14db6ef6dbb..a16a04fcf41eca2e37ac265a368a19eecf426dc3 100644 (file)
@@ -346,7 +346,7 @@ static inline u64 get_node_id(struct inode *inode)
 }
 
 /** Device operations */
-extern struct file_operations fuse_dev_operations;
+extern const struct file_operations fuse_dev_operations;
 
 /**
  * This is the single global spinlock which protects FUSE's structures
index 534e5a7480efc8626c00347fa4e22e9d9dc412ee..7cd8cc03aea7790159aa7ce5263e73655dabfd8d 100644 (file)
@@ -313,7 +313,7 @@ static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        return res;
 }
 
-struct file_operations hfs_dir_operations = {
+const struct file_operations hfs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = hfs_readdir,
        .llseek         = generic_file_llseek,
index 18ce47ab1b71f0d27044e3831c69444ccb33740f..3ed8663a8db1ea792d14d0ab9ab6d0821d2521ce 100644 (file)
@@ -169,7 +169,7 @@ extern int hfs_cat_move(u32, struct inode *, struct qstr *,
 extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *);
 
 /* dir.c */
-extern struct file_operations hfs_dir_operations;
+extern const struct file_operations hfs_dir_operations;
 extern struct inode_operations hfs_dir_inode_operations;
 
 /* extent.c */
index 2c564701724f9fdd0266bcfe08f1cfa364c18f32..2d4ced22201ba18d3b8e81eb5b1860d63011897b 100644 (file)
@@ -17,7 +17,7 @@
 #include "hfs_fs.h"
 #include "btree.h"
 
-static struct file_operations hfs_file_operations;
+static const struct file_operations hfs_file_operations;
 static struct inode_operations hfs_file_inode_operations;
 
 /*================ Variable-like macros ================*/
@@ -601,7 +601,7 @@ int hfs_inode_setattr(struct dentry *dentry, struct iattr * attr)
 }
 
 
-static struct file_operations hfs_file_operations = {
+static const struct file_operations hfs_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
index 01a6fe3a395c765eeb79f5a22b1f31a91931f99e..1f9ece0de326227af5a15c238aca2f7b78a61aa0 100644 (file)
@@ -483,7 +483,7 @@ struct inode_operations hfsplus_dir_inode_operations = {
        .rename         = hfsplus_rename,
 };
 
-struct file_operations hfsplus_dir_operations = {
+const struct file_operations hfsplus_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = hfsplus_readdir,
        .ioctl          = hfsplus_ioctl,
index 9fbe4d2aeece7816d02fab76ea371c99b23976cc..acf66dba3e01ddc5256469ef5183853128107ee6 100644 (file)
@@ -280,7 +280,7 @@ static struct inode_operations hfsplus_file_inode_operations = {
        .listxattr      = hfsplus_listxattr,
 };
 
-static struct file_operations hfsplus_file_operations = {
+static const struct file_operations hfsplus_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
index b3ad0bd0312f2ecc7e9ab8ea2dc37639a3a7b0d0..bf0f8e16e4336db36e64f7b46bc253b283c18b7d 100644 (file)
@@ -384,7 +384,7 @@ int hostfs_fsync(struct file *file, struct dentry *dentry, int datasync)
        return fsync_file(HOSTFS_I(dentry->d_inode)->fd, datasync);
 }
 
-static struct file_operations hostfs_file_fops = {
+static const struct file_operations hostfs_file_fops = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .sendfile       = generic_file_sendfile,
@@ -399,7 +399,7 @@ static struct file_operations hostfs_file_fops = {
        .fsync          = hostfs_fsync,
 };
 
-static struct file_operations hostfs_dir_fops = {
+static const struct file_operations hostfs_dir_fops = {
        .llseek         = generic_file_llseek,
        .readdir        = hostfs_readdir,
        .read           = generic_read_dir,
index 5591f9623aa2299840c5cd1d894702a59d982bde..ecc9180645ae1a12b70beab00bc5561f602c4a65 100644 (file)
@@ -310,7 +310,7 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct name
        return ERR_PTR(-ENOENT);
 }
 
-struct file_operations hpfs_dir_ops =
+const struct file_operations hpfs_dir_ops =
 {
        .llseek         = hpfs_dir_lseek,
        .read           = generic_read_dir,
index 7c995ac4081bcbbbf1c1b0cf0eec5c0a3691413a..d3b9fffe45a140bedc792f9022f4af7c8f7908ce 100644 (file)
@@ -119,7 +119,7 @@ static ssize_t hpfs_file_write(struct file *file, const char __user *buf,
        return retval;
 }
 
-struct file_operations hpfs_file_ops =
+const struct file_operations hpfs_file_ops =
 {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
index 4c6473ab3b346e1f7091047878c4694fdee41d86..29b7a3e55173e8825ed63d8f899076e045641c75 100644 (file)
@@ -240,7 +240,7 @@ void hpfs_set_dentry_operations(struct dentry *);
 /* dir.c */
 
 struct dentry *hpfs_lookup(struct inode *, struct dentry *, struct nameidata *);
-extern struct file_operations hpfs_dir_ops;
+extern const struct file_operations hpfs_dir_ops;
 
 /* dnode.c */
 
@@ -266,7 +266,7 @@ void hpfs_set_ea(struct inode *, struct fnode *, char *, char *, int);
 /* file.c */
 
 int hpfs_file_fsync(struct file *, struct dentry *, int);
-extern struct file_operations hpfs_file_ops;
+extern const struct file_operations hpfs_file_ops;
 extern struct inode_operations hpfs_file_iops;
 extern struct address_space_operations hpfs_aops;
 
index a44dc58973991b6ff33274ee2f6eaf2a6ca28ca3..2ba20cdb5baa7316e8f14738b895f3332c1b9a1e 100644 (file)
@@ -558,7 +558,7 @@ static loff_t hppfs_llseek(struct file *file, loff_t off, int where)
        return(default_llseek(file, off, where));
 }
 
-static struct file_operations hppfs_file_fops = {
+static const struct file_operations hppfs_file_fops = {
        .owner          = NULL,
        .llseek         = hppfs_llseek,
        .read           = hppfs_read,
@@ -609,7 +609,7 @@ static int hppfs_fsync(struct file *file, struct dentry *dentry, int datasync)
        return(0);
 }
 
-static struct file_operations hppfs_dir_fops = {
+static const struct file_operations hppfs_dir_fops = {
        .owner          = NULL,
        .readdir        = hppfs_readdir,
        .open           = hppfs_dir_open,
index 25fa8bba8cb5ecf552698b017688a97022eff2d2..3a5b4e9234550200b252f3ca2333d3343aafcb4e 100644 (file)
@@ -35,7 +35,7 @@
 
 static struct super_operations hugetlbfs_ops;
 static struct address_space_operations hugetlbfs_aops;
-struct file_operations hugetlbfs_file_operations;
+const struct file_operations hugetlbfs_file_operations;
 static struct inode_operations hugetlbfs_dir_inode_operations;
 static struct inode_operations hugetlbfs_inode_operations;
 
@@ -566,7 +566,7 @@ static void init_once(void *foo, kmem_cache_t *cachep, unsigned long flags)
                inode_init_once(&ei->vfs_inode);
 }
 
-struct file_operations hugetlbfs_file_operations = {
+const struct file_operations hugetlbfs_file_operations = {
        .mmap                   = hugetlbfs_file_mmap,
        .fsync                  = simple_sync_file,
        .get_unmapped_area      = hugetlb_get_unmapped_area,
index 1fddf2803af8593cc0e7a079221864d871966735..32b7c3375021fdacaade973b59ccb350899b2dd6 100644 (file)
@@ -104,7 +104,7 @@ static struct inode *alloc_inode(struct super_block *sb)
 {
        static struct address_space_operations empty_aops;
        static struct inode_operations empty_iops;
-       static struct file_operations empty_fops;
+       static const struct file_operations empty_fops;
        struct inode *inode;
 
        if (sb->s_op->alloc_inode)
index f48a3dae07120f14e8f20c0514e2f8b00986c278..367c487c014b6f62db3c04811ad56e3bec4cc0df 100644 (file)
@@ -920,7 +920,7 @@ static long inotify_ioctl(struct file *file, unsigned int cmd,
        return ret;
 }
 
-static struct file_operations inotify_fops = {
+static const struct file_operations inotify_fops = {
        .poll           = inotify_poll,
        .read           = inotify_read,
        .release        = inotify_release,
index 7901ac9f97ab4728150c0ba68e11e48645f51a26..5440ea292c6964678ce6038db108633d69363962 100644 (file)
@@ -16,7 +16,7 @@
 
 static int isofs_readdir(struct file *, void *, filldir_t);
 
-struct file_operations isofs_dir_operations =
+const struct file_operations isofs_dir_operations =
 {
        .read           = generic_read_dir,
        .readdir        = isofs_readdir,
index 439a19b1bf3e8b4fddd0dadcfe10573c602ccc28..b87ba066f5e76f42debee19fcfb5336c896f33f9 100644 (file)
@@ -175,6 +175,6 @@ isofs_normalize_block_and_offset(struct iso_directory_record* de,
 }
 
 extern struct inode_operations isofs_dir_inode_operations;
-extern struct file_operations isofs_dir_operations;
+extern const struct file_operations isofs_dir_operations;
 extern struct address_space_operations isofs_symlink_aops;
 extern struct export_operations isofs_export_ops;
index 5a4519e834da31131f4140f246aaa5aaf27f04e2..020cc097c539955b6771412b3d32d9ac291a0494 100644 (file)
@@ -55,9 +55,9 @@
 static int jffs_remove(struct inode *dir, struct dentry *dentry, int type);
 
 static struct super_operations jffs_ops;
-static struct file_operations jffs_file_operations;
+static const struct file_operations jffs_file_operations;
 static struct inode_operations jffs_file_inode_operations;
-static struct file_operations jffs_dir_operations;
+static const struct file_operations jffs_dir_operations;
 static struct inode_operations jffs_dir_inode_operations;
 static struct address_space_operations jffs_address_operations;
 
@@ -1629,7 +1629,7 @@ static int jffs_fsync(struct file *f, struct dentry *d, int datasync)
 }
 
 
-static struct file_operations jffs_file_operations =
+static const struct file_operations jffs_file_operations =
 {
        .open           = generic_file_open,
        .llseek         = generic_file_llseek,
@@ -1649,7 +1649,7 @@ static struct inode_operations jffs_file_inode_operations =
 };
 
 
-static struct file_operations jffs_dir_operations =
+static const struct file_operations jffs_dir_operations =
 {
        .readdir        = jffs_readdir,
 };
index a7bf9cb2567fc20b763354d5abd4a8e197c63373..8bc7a5018e4044be500c3e14bf73b974673c6646 100644 (file)
@@ -37,7 +37,7 @@ static int jffs2_mknod (struct inode *,struct dentry *,int,dev_t);
 static int jffs2_rename (struct inode *, struct dentry *,
                         struct inode *, struct dentry *);
 
-struct file_operations jffs2_dir_operations =
+const struct file_operations jffs2_dir_operations =
 {
        .read =         generic_read_dir,
        .readdir =      jffs2_readdir,
index 935f273dc57b834bcb7491d8a099522653f19ce7..9f4171213e58b2d4105152e78a8627c688e37633 100644 (file)
@@ -38,7 +38,7 @@ int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync)
        return 0;
 }
 
-struct file_operations jffs2_file_operations =
+const struct file_operations jffs2_file_operations =
 {
        .llseek =       generic_file_llseek,
        .open =         generic_file_open,
index 59e7a393200c6877c99a7a2dc87303045b1e2644..d307cf548625b5a9b654af3c711b6c619edbfce9 100644 (file)
@@ -159,11 +159,11 @@ void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c);
 void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c);
 
 /* dir.c */
-extern struct file_operations jffs2_dir_operations;
+extern const struct file_operations jffs2_dir_operations;
 extern struct inode_operations jffs2_dir_inode_operations;
 
 /* file.c */
-extern struct file_operations jffs2_file_operations;
+extern const struct file_operations jffs2_file_operations;
 extern struct inode_operations jffs2_file_inode_operations;
 extern struct address_space_operations jffs2_file_address_operations;
 int jffs2_fsync(struct file *, struct dentry *, int);
index e1ac6e497e2be67829bbc583ea545ae645ebf97d..1c9745be5adab3db43fd2218b69b4e92884100f6 100644 (file)
@@ -100,7 +100,7 @@ struct inode_operations jfs_file_inode_operations = {
 #endif
 };
 
-struct file_operations jfs_file_operations = {
+const struct file_operations jfs_file_operations = {
        .open           = jfs_open,
        .llseek         = generic_file_llseek,
        .write          = generic_file_write,
index 095d471b9f9a186c36b5736d5484626133718dea..c300726744641869b6e4f87794b2ece81d9b8280 100644 (file)
@@ -35,9 +35,9 @@ extern void jfs_set_inode_flags(struct inode *);
 
 extern struct address_space_operations jfs_aops;
 extern struct inode_operations jfs_dir_inode_operations;
-extern struct file_operations jfs_dir_operations;
+extern const struct file_operations jfs_dir_operations;
 extern struct inode_operations jfs_file_inode_operations;
-extern struct file_operations jfs_file_operations;
+extern const struct file_operations jfs_file_operations;
 extern struct inode_operations jfs_symlink_inode_operations;
 extern struct dentry_operations jfs_ci_dentry_operations;
 #endif                         /* _H_JFS_INODE */
index 309cee575f7db88165c6edf78aeb0ba86b7bcc3f..09ea03f622778a0d5c568db9192eec9e2ea5ceb9 100644 (file)
@@ -1519,7 +1519,7 @@ struct inode_operations jfs_dir_inode_operations = {
 #endif
 };
 
-struct file_operations jfs_dir_operations = {
+const struct file_operations jfs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = jfs_readdir,
        .fsync          = jfs_fsync,
index 4fdeaceb892cb83d0206f2024f1bbc229dba1192..7145ba7a48d06329de45384b3d3bda2c607cc1a1 100644 (file)
@@ -179,7 +179,7 @@ ssize_t generic_read_dir(struct file *filp, char __user *buf, size_t siz, loff_t
        return -EISDIR;
 }
 
-struct file_operations simple_dir_operations = {
+const struct file_operations simple_dir_operations = {
        .open           = dcache_dir_open,
        .release        = dcache_dir_close,
        .llseek         = dcache_dir_lseek,
index 73e754fea2d8639ebc99331fe68f5e24cde00f19..e4fde1ab22cdb0a5af105cdea66cccf9473ac08e 100644 (file)
@@ -311,7 +311,7 @@ fail:
 /*
  * mb_cache_shrink()
  *
- * Removes all cache entires of a device from the cache. All cache entries
+ * Removes all cache entries of a device from the cache. All cache entries
  * currently in use cannot be freed, and thus remain in the cache. All others
  * are freed.
  *
index 732502aabc056320a714f34e2e23b0a4c555d2f6..69224d1fe043d635089f60dcb0452b1366bd9839 100644 (file)
@@ -14,7 +14,7 @@ typedef struct minix_dir_entry minix_dirent;
 
 static int minix_readdir(struct file *, void *, filldir_t);
 
-struct file_operations minix_dir_operations = {
+const struct file_operations minix_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = minix_readdir,
        .fsync          = minix_sync_file,
index f1d77acb3f01425aa215eca838e4666c66af1016..420b32882a10ce6f55c8cd6d396d5045f334d5d6 100644 (file)
@@ -15,7 +15,7 @@
  */
 int minix_sync_file(struct file *, struct dentry *, int);
 
-struct file_operations minix_file_operations = {
+const struct file_operations minix_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
index e42a8bb890013bf27b717c3b6458133cb34ab124..c55b77cdcc8e2af21e447a168e5cbb4ad26c6d42 100644 (file)
@@ -81,8 +81,8 @@ extern int minix_sync_file(struct file *, struct dentry *, int);
 
 extern struct inode_operations minix_file_inode_operations;
 extern struct inode_operations minix_dir_inode_operations;
-extern struct file_operations minix_file_operations;
-extern struct file_operations minix_dir_operations;
+extern const struct file_operations minix_file_operations;
+extern const struct file_operations minix_dir_operations;
 extern struct dentry_operations minix_dentry_operations;
 
 static inline struct minix_sb_info *minix_sb(struct super_block *sb)
index cfd76f431dc0ecba78d8e8bb96c668c402979cc5..f0860c602d8bbcc14b51b1d7c96732653bed890c 100644 (file)
@@ -49,7 +49,7 @@ extern int ncp_symlink(struct inode *, struct dentry *, const char *);
 #define ncp_symlink NULL
 #endif
                      
-struct file_operations ncp_dir_operations =
+const struct file_operations ncp_dir_operations =
 {
        .read           = generic_read_dir,
        .readdir        = ncp_readdir,
index ebdad8f6398f14fdcb84ee93b8e4878e59c24bf4..e6b7c67cf057765f86921cf2220fee385eaaee38 100644 (file)
@@ -283,7 +283,7 @@ static int ncp_release(struct inode *inode, struct file *file) {
        return 0;
 }
 
-struct file_operations ncp_file_operations =
+const struct file_operations ncp_file_operations =
 {
        .llseek         = remote_llseek,
        .read           = ncp_file_read,
index 06c48b385c94de72c081266e2b8f5ecc51c59e80..a23f3489416709288655f80603337f91ea94e398 100644 (file)
@@ -54,7 +54,7 @@ static int nfs_rename(struct inode *, struct dentry *,
 static int nfs_fsync_dir(struct file *, struct dentry *, int);
 static loff_t nfs_llseek_dir(struct file *, loff_t, int);
 
-struct file_operations nfs_dir_operations = {
+const struct file_operations nfs_dir_operations = {
        .llseek         = nfs_llseek_dir,
        .read           = generic_read_dir,
        .readdir        = nfs_readdir,
index dee49a0cb9951bad14365d6a16c792e632485af7..f1df2c8d92591e4fa1474d66ecda7f887868fd86 100644 (file)
@@ -49,7 +49,7 @@ static int nfs_check_flags(int flags);
 static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
 
-struct file_operations nfs_file_operations = {
+const struct file_operations nfs_file_operations = {
        .llseek         = nfs_file_llseek,
        .read           = do_sync_read,
        .write          = do_sync_write,
index c8960aff09685957e5b20dccf6b0a2fcdef27684..3ef017b3b5bde5b0526832175208c2be8bde4490 100644 (file)
@@ -134,7 +134,7 @@ static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size
        return simple_transaction_read(file, buf, size, pos);
 }
 
-static struct file_operations transaction_ops = {
+static const struct file_operations transaction_ops = {
        .write          = nfsctl_transaction_write,
        .read           = nfsctl_transaction_read,
        .release        = simple_transaction_release,
@@ -146,7 +146,7 @@ static int exports_open(struct inode *inode, struct file *file)
        return seq_open(file, &nfs_exports_op);
 }
 
-static struct file_operations exports_operations = {
+static const struct file_operations exports_operations = {
        .open           = exports_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 1cf955bcc526ecd7db7a0be50a58021e0663ac6e..57265d56380453750310a39c5305a39178a1c35c 100644 (file)
@@ -80,7 +80,7 @@ static int nfsd_proc_open(struct inode *inode, struct file *file)
        return single_open(file, nfsd_proc_show, NULL);
 }
 
-static struct file_operations nfsd_proc_fops = {
+static const struct file_operations nfsd_proc_fops = {
        .owner = THIS_MODULE,
        .open = nfsd_proc_open,
        .read  = seq_read,
index 5320e5afaddbe0498c8cbde8e54cba835ab374a3..31018333dc383f58905f6348ac7a949de04849ca 100644 (file)
@@ -706,7 +706,7 @@ nfsd_close(struct file *filp)
  * after it.
  */
 static inline int nfsd_dosync(struct file *filp, struct dentry *dp,
-                             struct file_operations *fop)
+                             const struct file_operations *fop)
 {
        struct inode *inode = dp->d_inode;
        int (*fsync) (struct file *, struct dentry *, int);
index 9d9ed3fe371db95e42428a654a0f73f60996d03c..d1e2c6f9f05eed155e257b0524da8cc2ff5e4566 100644 (file)
@@ -1553,7 +1553,7 @@ static int ntfs_dir_fsync(struct file *filp, struct dentry *dentry,
 
 #endif /* NTFS_RW */
 
-struct file_operations ntfs_dir_ops = {
+const struct file_operations ntfs_dir_ops = {
        .llseek         = generic_file_llseek,  /* Seek inside directory. */
        .read           = generic_read_dir,     /* Return -EISDIR. */
        .readdir        = ntfs_readdir,         /* Read directory contents. */
index f5d057e4acc2a141e07f3b0a5e2755d3ce93f073..c63a83e8da98b7d6737de1969a86f9c5ed066e35 100644 (file)
@@ -2294,7 +2294,7 @@ static int ntfs_file_fsync(struct file *filp, struct dentry *dentry,
 
 #endif /* NTFS_RW */
 
-struct file_operations ntfs_file_ops = {
+const struct file_operations ntfs_file_ops = {
        .llseek         = generic_file_llseek,   /* Seek inside file. */
        .read           = generic_file_read,     /* Read from file. */
        .aio_read       = generic_file_aio_read, /* Async read from file. */
@@ -2337,6 +2337,6 @@ struct inode_operations ntfs_file_inode_ops = {
 #endif /* NTFS_RW */
 };
 
-struct file_operations ntfs_empty_file_ops = {};
+const struct file_operations ntfs_empty_file_ops = {};
 
 struct inode_operations ntfs_empty_inode_ops = {};
index 166142960b53be467e9392f0d13ce87057185445..bf7b3d7c09303a17de113173b80b2b8890d97ecb 100644 (file)
@@ -60,13 +60,13 @@ extern struct kmem_cache *ntfs_index_ctx_cache;
 extern struct address_space_operations ntfs_aops;
 extern struct address_space_operations ntfs_mst_aops;
 
-extern struct  file_operations ntfs_file_ops;
+extern const struct  file_operations ntfs_file_ops;
 extern struct inode_operations ntfs_file_inode_ops;
 
-extern struct  file_operations ntfs_dir_ops;
+extern const struct  file_operations ntfs_dir_ops;
 extern struct inode_operations ntfs_dir_inode_ops;
 
-extern struct  file_operations ntfs_empty_file_ops;
+extern const struct  file_operations ntfs_empty_file_ops;
 extern struct inode_operations ntfs_empty_inode_ops;
 
 extern struct export_operations ntfs_export_ops;
index 84f153aca692069c6fd2f36d3a322c61bea8d6ea..64cd52860c876943d3a51a373f8a74df9f7067f5 100644 (file)
@@ -2017,7 +2017,7 @@ out:
        return ret;
 }
 
-static struct file_operations ocfs2_dlm_debug_fops = {
+static const struct file_operations ocfs2_dlm_debug_fops = {
        .open =         ocfs2_dlm_debug_open,
        .release =      ocfs2_dlm_debug_release,
        .read =         seq_read,
index 4b4cbadd583834adddc8f033c64cc2a449fc3a7c..34e903a6a46b22e42be625f060e28973b6d77801 100644 (file)
@@ -1176,7 +1176,7 @@ struct inode_operations ocfs2_special_file_iops = {
        .getattr        = ocfs2_getattr,
 };
 
-struct file_operations ocfs2_fops = {
+const struct file_operations ocfs2_fops = {
        .read           = do_sync_read,
        .write          = do_sync_write,
        .sendfile       = generic_file_sendfile,
@@ -1188,7 +1188,7 @@ struct file_operations ocfs2_fops = {
        .aio_write      = ocfs2_file_aio_write,
 };
 
-struct file_operations ocfs2_dops = {
+const struct file_operations ocfs2_dops = {
        .read           = generic_read_dir,
        .readdir        = ocfs2_readdir,
        .fsync          = ocfs2_sync_file,
index a5ea33b2406072d43cc61d637ba6121652497d42..740c9e7ca5993b5fd86ab9fefa1a55cdacbb9a21 100644 (file)
@@ -26,8 +26,8 @@
 #ifndef OCFS2_FILE_H
 #define OCFS2_FILE_H
 
-extern struct file_operations ocfs2_fops;
-extern struct file_operations ocfs2_dops;
+extern const struct file_operations ocfs2_fops;
+extern const struct file_operations ocfs2_dops;
 extern struct inode_operations ocfs2_file_iops;
 extern struct inode_operations ocfs2_special_file_iops;
 struct ocfs2_alloc_context;
index aeb0106890e4f1db6dc903f3d5e94f3724278ab0..0f14276a2e510de843ad4c6877c9aa5bd469ce0a 100644 (file)
@@ -581,17 +581,17 @@ int property_release (struct inode *inode, struct file *filp)
        return 0;
 }
 
-static struct file_operations openpromfs_prop_ops = {
+static const struct file_operations openpromfs_prop_ops = {
        .read           = property_read,
        .write          = property_write,
        .release        = property_release,
 };
 
-static struct file_operations openpromfs_nodenum_ops = {
+static const struct file_operations openpromfs_nodenum_ops = {
        .read           = nodenum_read,
 };
 
-static struct file_operations openprom_operations = {
+static const struct file_operations openprom_operations = {
        .read           = generic_read_dir,
        .readdir        = openpromfs_readdir,
 };
index 4384c929094354d84f27936b1b15c6001b9d9dd5..e2f4f1d9ffc2578ff4d2da0404c459b819a260a0 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -568,7 +568,7 @@ pipe_rdwr_open(struct inode *inode, struct file *filp)
  * The file_operations structs are not static because they
  * are also used in linux/fs/fifo.c to do operations on FIFOs.
  */
-struct file_operations read_fifo_fops = {
+const struct file_operations read_fifo_fops = {
        .llseek         = no_llseek,
        .read           = pipe_read,
        .readv          = pipe_readv,
@@ -580,7 +580,7 @@ struct file_operations read_fifo_fops = {
        .fasync         = pipe_read_fasync,
 };
 
-struct file_operations write_fifo_fops = {
+const struct file_operations write_fifo_fops = {
        .llseek         = no_llseek,
        .read           = bad_pipe_r,
        .write          = pipe_write,
@@ -592,7 +592,7 @@ struct file_operations write_fifo_fops = {
        .fasync         = pipe_write_fasync,
 };
 
-struct file_operations rdwr_fifo_fops = {
+const struct file_operations rdwr_fifo_fops = {
        .llseek         = no_llseek,
        .read           = pipe_read,
        .readv          = pipe_readv,
index 47b7a20d45eb56e1d0c4f09bc47cad509e36f46e..4ba03009cf72328770df1a9e1b33787dc7ef7429 100644 (file)
@@ -560,7 +560,7 @@ static void proc_kill_inodes(struct proc_dir_entry *de)
                struct file * filp = list_entry(p, struct file, f_u.fu_list);
                struct dentry * dentry = filp->f_dentry;
                struct inode * inode;
-               struct file_operations *fops;
+               const struct file_operations *fops;
 
                if (dentry->d_op != &proc_dentry_operations)
                        continue;
index 95a1cf32b838e162bb3e41fe3afd2356bd7b4b22..0502f17b860def3b7e221783979aa4a4eba59a7d 100644 (file)
@@ -30,7 +30,7 @@ do {                                          \
 
 #endif
 
-extern void create_seq_entry(char *name, mode_t mode, struct file_operations *f);
+extern void create_seq_entry(char *name, mode_t mode, const struct file_operations *f);
 extern int proc_exe_link(struct inode *, struct dentry **, struct vfsmount **);
 extern int proc_tid_stat(struct task_struct *,  char *);
 extern int proc_tgid_stat(struct task_struct *, char *);
index adc2cd95169a0793b69cde85db8949a11ef8c898..17f6e8fa13978801e939a2a9cf749fcae8d7bf4f 100644 (file)
@@ -31,7 +31,7 @@ static int open_kcore(struct inode * inode, struct file * filp)
 
 static ssize_t read_kcore(struct file *, char __user *, size_t, loff_t *);
 
-struct file_operations proc_kcore_operations = {
+const struct file_operations proc_kcore_operations = {
        .read           = read_kcore,
        .open           = open_kcore,
 };
index 10d37bf252060fab81b641d56e4573aaa56fe110..ff3b90b56e9d635546fe71868ffdc473632c5352 100644 (file)
@@ -47,7 +47,7 @@ static unsigned int kmsg_poll(struct file *file, poll_table *wait)
 }
 
 
-struct file_operations proc_kmsg_operations = {
+const struct file_operations proc_kmsg_operations = {
        .read           = kmsg_read,
        .poll           = kmsg_poll,
        .open           = kmsg_open,
index 1e9ea37d457e246fdc10c1dbfe63e14d443b759d..ef5a3323f4b551c7968bfb56d6a8daf74858f39c 100644 (file)
@@ -534,7 +534,7 @@ static int show_stat(struct seq_file *p, void *v)
        if (wall_to_monotonic.tv_nsec)
                --jif;
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                int j;
 
                user = cputime64_add(user, kstat_cpu(i).cpustat.user);
@@ -731,7 +731,7 @@ static struct file_operations proc_sysrq_trigger_operations = {
 
 struct proc_dir_entry *proc_root_kcore;
 
-void create_seq_entry(char *name, mode_t mode, struct file_operations *f)
+void create_seq_entry(char *name, mode_t mode, const struct file_operations *f)
 {
        struct proc_dir_entry *entry;
        entry = create_proc_entry(name, mode, NULL);
index 4063fb32f78c210dd6c41690ff107966e68ed821..7efa73d44c9a5b6f61a7ee3bb4aa02ff885eebb1 100644 (file)
@@ -172,7 +172,7 @@ static int open_vmcore(struct inode *inode, struct file *filp)
        return 0;
 }
 
-struct file_operations proc_vmcore_operations = {
+const struct file_operations proc_vmcore_operations = {
        .read           = read_vmcore,
        .open           = open_vmcore,
 };
index 7a8f5595c26fea5898f1dfe246c8b86025b3e72a..9031948fefd056104a4822ab4f193529f70a1475 100644 (file)
@@ -81,7 +81,7 @@ out:
        return 0;
 }
 
-struct file_operations qnx4_dir_operations =
+const struct file_operations qnx4_dir_operations =
 {
        .read           = generic_read_dir,
        .readdir        = qnx4_readdir,
index c33963fded9eb94d0b209c48e60d7c7499a27a20..62af4b1348bda336cfcc90420a6f1b208f7f807f 100644 (file)
@@ -19,7 +19,7 @@
  * We have mostly NULL's here: the current defaults are ok for
  * the qnx4 filesystem.
  */
-struct file_operations qnx4_file_operations =
+const struct file_operations qnx4_file_operations =
 {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
index 6ada2095b9ac3609340138286cad2d1e35d0d0c1..00a933eb820c27127cc330adbca12e6518deb4d8 100644 (file)
@@ -32,7 +32,7 @@ struct address_space_operations ramfs_aops = {
        .commit_write   = simple_commit_write
 };
 
-struct file_operations ramfs_file_operations = {
+const struct file_operations ramfs_file_operations = {
        .read           = generic_file_read,
        .write          = generic_file_write,
        .mmap           = generic_file_mmap,
index b1ca234068f67173816c51c49bceecfe2c66bed9..f443a84b98a5a300b21fbf298f7aa2587e6e83eb 100644 (file)
@@ -33,7 +33,7 @@ struct address_space_operations ramfs_aops = {
        .commit_write           = simple_commit_write
 };
 
-struct file_operations ramfs_file_operations = {
+const struct file_operations ramfs_file_operations = {
        .mmap                   = ramfs_nommu_mmap,
        .get_unmapped_area      = ramfs_nommu_get_unmapped_area,
        .read                   = generic_file_read,
index 272c8a7120b031004386c00cbfbaa18eab62072c..313237631b49dda2c66145fcc0bab146cc5472aa 100644 (file)
@@ -11,5 +11,5 @@
 
 
 extern struct address_space_operations ramfs_aops;
-extern struct file_operations ramfs_file_operations;
+extern const struct file_operations ramfs_file_operations;
 extern struct inode_operations ramfs_file_inode_operations;
index 34b1bf259efd239d5380282b689258285711fc5e..6256ca81a718673694249aa2bcc3f9dff6895bcf 100644 (file)
@@ -19,7 +19,7 @@
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
 
-struct file_operations generic_ro_fops = {
+const struct file_operations generic_ro_fops = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .mmap           = generic_file_readonly_mmap,
index d71ac657928931e114ea0798342e501f27558a79..973c819f803387a9f5adce136825c62bdeea4010 100644 (file)
@@ -18,7 +18,7 @@ static int reiserfs_readdir(struct file *, void *, filldir_t);
 static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry,
                              int datasync);
 
-struct file_operations reiserfs_dir_operations = {
+const struct file_operations reiserfs_dir_operations = {
        .read = generic_read_dir,
        .readdir = reiserfs_readdir,
        .fsync = reiserfs_dir_fsync,
index d0c1e865963eac20acc606cc8f26089f20ad2ac1..010094d14da678fce192938a77e3e903a245bd09 100644 (file)
@@ -1566,7 +1566,7 @@ static ssize_t reiserfs_aio_write(struct kiocb *iocb, const char __user * buf,
        return generic_file_aio_write(iocb, buf, count, pos);
 }
 
-struct file_operations reiserfs_file_operations = {
+const struct file_operations reiserfs_file_operations = {
        .read = generic_file_read,
        .write = reiserfs_file_write,
        .ioctl = reiserfs_ioctl,
index ef6caed9336b3c36f5c51a1616d866b735e247f7..731688e1cfe334608001da8648f9d8c051d2b1c1 100644 (file)
@@ -470,7 +470,7 @@ static int r_open(struct inode *inode, struct file *file)
        return ret;
 }
 
-static struct file_operations r_file_operations = {
+static const struct file_operations r_file_operations = {
        .open = r_open,
        .read = seq_read,
        .llseek = seq_lseek,
index c2fc424d7d5c7ceef553b7c8f76000276943850d..9b9eda7b335c431803092dde7aa6fabea1fe8bdc 100644 (file)
@@ -463,7 +463,7 @@ static struct address_space_operations romfs_aops = {
        .readpage = romfs_readpage
 };
 
-static struct file_operations romfs_dir_operations = {
+static const struct file_operations romfs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = romfs_readdir,
 };
index 1815a57d225585122c22dd0a357dbdced59e1c40..b3a3a1326af66e63505860cef77c8ae343ebc55a 100644 (file)
 #define ROUND_UP(x,y) (((x)+(y)-1)/(y))
 #define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
 
-struct poll_table_entry {
-       struct file * filp;
-       wait_queue_t wait;
-       wait_queue_head_t * wait_address;
-};
-
 struct poll_table_page {
        struct poll_table_page * next;
        struct poll_table_entry * entry;
@@ -64,13 +58,23 @@ void poll_initwait(struct poll_wqueues *pwq)
        init_poll_funcptr(&pwq->pt, __pollwait);
        pwq->error = 0;
        pwq->table = NULL;
+       pwq->inline_index = 0;
 }
 
 EXPORT_SYMBOL(poll_initwait);
 
+static void free_poll_entry(struct poll_table_entry *entry)
+{
+       remove_wait_queue(entry->wait_address,&entry->wait);
+       fput(entry->filp);
+}
+
 void poll_freewait(struct poll_wqueues *pwq)
 {
        struct poll_table_page * p = pwq->table;
+       int i;
+       for (i = 0; i < pwq->inline_index; i++)
+               free_poll_entry(pwq->inline_entries + i);
        while (p) {
                struct poll_table_entry * entry;
                struct poll_table_page *old;
@@ -78,8 +82,7 @@ void poll_freewait(struct poll_wqueues *pwq)
                entry = p->entry;
                do {
                        entry--;
-                       remove_wait_queue(entry->wait_address,&entry->wait);
-                       fput(entry->filp);
+                       free_poll_entry(entry);
                } while (entry > p->entries);
                old = p;
                p = p->next;
@@ -89,12 +92,14 @@ void poll_freewait(struct poll_wqueues *pwq)
 
 EXPORT_SYMBOL(poll_freewait);
 
-static void __pollwait(struct file *filp, wait_queue_head_t *wait_address,
-                      poll_table *_p)
+static struct poll_table_entry *poll_get_entry(poll_table *_p)
 {
        struct poll_wqueues *p = container_of(_p, struct poll_wqueues, pt);
        struct poll_table_page *table = p->table;
 
+       if (p->inline_index < N_INLINE_POLL_ENTRIES)
+               return p->inline_entries + p->inline_index++;
+
        if (!table || POLL_TABLE_FULL(table)) {
                struct poll_table_page *new_table;
 
@@ -102,7 +107,7 @@ static void __pollwait(struct file *filp, wait_queue_head_t *wait_address,
                if (!new_table) {
                        p->error = -ENOMEM;
                        __set_current_state(TASK_RUNNING);
-                       return;
+                       return NULL;
                }
                new_table->entry = new_table->entries;
                new_table->next = table;
@@ -110,16 +115,21 @@ static void __pollwait(struct file *filp, wait_queue_head_t *wait_address,
                table = new_table;
        }
 
-       /* Add a new entry */
-       {
-               struct poll_table_entry * entry = table->entry;
-               table->entry = entry+1;
-               get_file(filp);
-               entry->filp = filp;
-               entry->wait_address = wait_address;
-               init_waitqueue_entry(&entry->wait, current);
-               add_wait_queue(wait_address,&entry->wait);
-       }
+       return table->entry++;
+}
+
+/* Add a new entry */
+static void __pollwait(struct file *filp, wait_queue_head_t *wait_address,
+                               poll_table *p)
+{
+       struct poll_table_entry *entry = poll_get_entry(p);
+       if (!entry)
+               return;
+       get_file(filp);
+       entry->filp = filp;
+       entry->wait_address = wait_address;
+       init_waitqueue_entry(&entry->wait, current);
+       add_wait_queue(wait_address,&entry->wait);
 }
 
 #define FDS_IN(fds, n)         (fds->in + n)
@@ -210,7 +220,7 @@ int do_select(int n, fd_set_bits *fds, s64 *timeout)
                for (i = 0; i < n; ++rinp, ++routp, ++rexp) {
                        unsigned long in, out, ex, all_bits, bit = 1, mask, j;
                        unsigned long res_in = 0, res_out = 0, res_ex = 0;
-                       struct file_operations *f_op = NULL;
+                       const struct file_operations *f_op = NULL;
                        struct file *file = NULL;
 
                        in = *inp++; out = *outp++; ex = *exp++;
@@ -221,17 +231,18 @@ int do_select(int n, fd_set_bits *fds, s64 *timeout)
                        }
 
                        for (j = 0; j < __NFDBITS; ++j, ++i, bit <<= 1) {
+                               int fput_needed;
                                if (i >= n)
                                        break;
                                if (!(bit & all_bits))
                                        continue;
-                               file = fget(i);
+                               file = fget_light(i, &fput_needed);
                                if (file) {
                                        f_op = file->f_op;
                                        mask = DEFAULT_POLLMASK;
                                        if (f_op && f_op->poll)
                                                mask = (*f_op->poll)(file, retval ? NULL : wait);
-                                       fput(file);
+                                       fput_light(file, fput_needed);
                                        if ((mask & POLLIN_SET) && (in & bit)) {
                                                res_in |= bit;
                                                retval++;
@@ -284,16 +295,6 @@ int do_select(int n, fd_set_bits *fds, s64 *timeout)
        return retval;
 }
 
-static void *select_bits_alloc(int size)
-{
-       return kmalloc(6 * size, GFP_KERNEL);
-}
-
-static void select_bits_free(void *bits, int size)
-{
-       kfree(bits);
-}
-
 /*
  * We can actually return ERESTARTSYS instead of EINTR, but I'd
  * like to be certain this leads to no problems. So I return
@@ -312,6 +313,8 @@ static int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
        char *bits;
        int ret, size, max_fdset;
        struct fdtable *fdt;
+       /* Allocate small arguments on the stack to save memory and be faster */
+       char stack_fds[SELECT_STACK_ALLOC];
 
        ret = -EINVAL;
        if (n < 0)
@@ -332,7 +335,10 @@ static int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
         */
        ret = -ENOMEM;
        size = FDS_BYTES(n);
-       bits = select_bits_alloc(size);
+       if (6*size < SELECT_STACK_ALLOC)
+               bits = stack_fds;
+       else
+               bits = kmalloc(6 * size, GFP_KERNEL);
        if (!bits)
                goto out_nofds;
        fds.in      = (unsigned long *)  bits;
@@ -367,7 +373,8 @@ static int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
                ret = -EFAULT;
 
 out:
-       select_bits_free(bits, size);
+       if (bits != stack_fds)
+               kfree(bits);
 out_nofds:
        return ret;
 }
@@ -551,14 +558,15 @@ static void do_pollfd(unsigned int num, struct pollfd * fdpage,
                fdp = fdpage+i;
                fd = fdp->fd;
                if (fd >= 0) {
-                       struct file * file = fget(fd);
+                       int fput_needed;
+                       struct file * file = fget_light(fd, &fput_needed);
                        mask = POLLNVAL;
                        if (file != NULL) {
                                mask = DEFAULT_POLLMASK;
                                if (file->f_op && file->f_op->poll)
                                        mask = file->f_op->poll(file, *pwait);
                                mask &= fdp->events | POLLERR | POLLHUP;
-                               fput(file);
+                               fput_light(file, fput_needed);
                        }
                        if (mask) {
                                *pwait = NULL;
@@ -619,6 +627,9 @@ static int do_poll(unsigned int nfds,  struct poll_list *list,
        return count;
 }
 
+#define N_STACK_PPS ((sizeof(stack_pps) - sizeof(struct poll_list))  / \
+                       sizeof(struct pollfd))
+
 int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, s64 *timeout)
 {
        struct poll_wqueues table;
@@ -628,6 +639,9 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, s64 *timeout)
        struct poll_list *walk;
        struct fdtable *fdt;
        int max_fdset;
+       /* Allocate small arguments on the stack to save memory and be faster */
+       char stack_pps[POLL_STACK_ALLOC];
+       struct poll_list *stack_pp = NULL;
 
        /* Do a sanity check on nfds ... */
        rcu_read_lock();
@@ -645,14 +659,23 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, s64 *timeout)
        err = -ENOMEM;
        while(i!=0) {
                struct poll_list *pp;
-               pp = kmalloc(sizeof(struct poll_list)+
-                               sizeof(struct pollfd)*
-                               (i>POLLFD_PER_PAGE?POLLFD_PER_PAGE:i),
-                                       GFP_KERNEL);
-               if(pp==NULL)
-                       goto out_fds;
+               int num, size;
+               if (stack_pp == NULL)
+                       num = N_STACK_PPS;
+               else
+                       num = POLLFD_PER_PAGE;
+               if (num > i)
+                       num = i;
+               size = sizeof(struct poll_list) + sizeof(struct pollfd)*num;
+               if (!stack_pp)
+                       stack_pp = pp = (struct poll_list *)stack_pps;
+               else {
+                       pp = kmalloc(size, GFP_KERNEL);
+                       if (!pp)
+                               goto out_fds;
+               }
                pp->next=NULL;
-               pp->len = (i>POLLFD_PER_PAGE?POLLFD_PER_PAGE:i);
+               pp->len = num;
                if (head == NULL)
                        head = pp;
                else
@@ -660,7 +683,7 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, s64 *timeout)
 
                walk = pp;
                if (copy_from_user(pp->entries, ufds + nfds-i, 
-                               sizeof(struct pollfd)*pp->len)) {
+                               sizeof(struct pollfd)*num)) {
                        err = -EFAULT;
                        goto out_fds;
                }
@@ -689,7 +712,8 @@ out_fds:
        walk = head;
        while(walk!=NULL) {
                struct poll_list *pp = walk->next;
-               kfree(walk);
+               if (walk != stack_pp)
+                       kfree(walk);
                walk = pp;
        }
        poll_freewait(&table);
index 0424d06b147e3832273b068f2389b99057c28e0a..34c7a11d91f0ebbb29854a0116d8c558825fbbbc 100644 (file)
@@ -34,7 +34,7 @@ static int smb_rename(struct inode *, struct dentry *,
 static int smb_make_node(struct inode *,struct dentry *,int,dev_t);
 static int smb_link(struct dentry *, struct inode *, struct dentry *);
 
-struct file_operations smb_dir_operations =
+const struct file_operations smb_dir_operations =
 {
        .read           = generic_read_dir,
        .readdir        = smb_readdir,
index 7042e62726a419eef23cd42750a86677d20d9d71..c56bd99a97018ca42b669a9ab5709ff5093ddbde 100644 (file)
@@ -401,7 +401,7 @@ smb_file_permission(struct inode *inode, int mask, struct nameidata *nd)
        return error;
 }
 
-struct file_operations smb_file_operations =
+const struct file_operations smb_file_operations =
 {
        .llseek         = remote_llseek,
        .read           = smb_file_read,
index e866ec8660d0c7d8bbff41de02a4651e3717fe02..47664597e6b17ced95636f7a60575d85f469eaf8 100644 (file)
@@ -35,7 +35,7 @@ extern int smb_proc_symlink(struct smb_sb_info *server, struct dentry *d, const
 extern int smb_proc_link(struct smb_sb_info *server, struct dentry *dentry, struct dentry *new_dentry);
 extern void smb_install_null_ops(struct smb_ops *ops);
 /* dir.c */
-extern struct file_operations smb_dir_operations;
+extern const struct file_operations smb_dir_operations;
 extern struct inode_operations smb_dir_inode_operations;
 extern struct inode_operations smb_dir_inode_operations_unix;
 extern void smb_new_dentry(struct dentry *dentry);
@@ -64,7 +64,7 @@ extern int smb_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat
 extern int smb_notify_change(struct dentry *dentry, struct iattr *attr);
 /* file.c */
 extern struct address_space_operations smb_file_aops;
-extern struct file_operations smb_file_operations;
+extern const struct file_operations smb_file_operations;
 extern struct inode_operations smb_file_inode_operations;
 /* ioctl.c */
 extern int smb_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);
index 78899eeab9742c8e35b8c8a68a43054c0fd9c5a9..c16a93c353c0cba3c7503b8041341be39ff69c21 100644 (file)
@@ -163,7 +163,7 @@ static int release(struct inode * inode, struct file * file)
        return 0;
 }
 
-struct file_operations bin_fops = {
+const struct file_operations bin_fops = {
        .read           = read,
        .write          = write,
        .mmap           = mmap,
index 9ee956864445e54025343eab41b9ed5da4dc8665..f26880a4785eec127e80ce736144624c3016098c 100644 (file)
@@ -503,7 +503,7 @@ static loff_t sysfs_dir_lseek(struct file * file, loff_t offset, int origin)
        return offset;
 }
 
-struct file_operations sysfs_dir_operations = {
+const struct file_operations sysfs_dir_operations = {
        .open           = sysfs_dir_open,
        .release        = sysfs_dir_close,
        .llseek         = sysfs_dir_lseek,
index 5e83e72467885a90fb88efeaf78601e70da2027f..830f76fa098c531f9db023f74253d9a19a1dff06 100644 (file)
@@ -348,7 +348,7 @@ static int sysfs_release(struct inode * inode, struct file * filp)
        return 0;
 }
 
-struct file_operations sysfs_file_operations = {
+const struct file_operations sysfs_file_operations = {
        .read           = sysfs_read_file,
        .write          = sysfs_write_file,
        .llseek         = generic_file_llseek,
index cf11d5b789d9ac2485bcb6693e3d1cbbd2d1aec6..32958a7c50e95ce5ffe448a83507c654901fb349 100644 (file)
@@ -21,9 +21,9 @@ extern int sysfs_setattr(struct dentry *dentry, struct iattr *iattr);
 
 extern struct rw_semaphore sysfs_rename_sem;
 extern struct super_block * sysfs_sb;
-extern struct file_operations sysfs_dir_operations;
-extern struct file_operations sysfs_file_operations;
-extern struct file_operations bin_fops;
+extern const struct file_operations sysfs_dir_operations;
+extern const struct file_operations sysfs_file_operations;
+extern const struct file_operations bin_fops;
 extern struct inode_operations sysfs_dir_inode_operations;
 extern struct inode_operations sysfs_symlink_inode_operations;
 
index cce8b05cba5a03da1068a462aec9b4228e6a2986..8c66e9270dd64995f95ac6504a61998bec5c31dd 100644 (file)
@@ -20,7 +20,7 @@
 
 static int sysv_readdir(struct file *, void *, filldir_t);
 
-struct file_operations sysv_dir_operations = {
+const struct file_operations sysv_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = sysv_readdir,
        .fsync          = sysv_sync_file,
index da69abc06240cc213eafb5cfe1bd63f297e50327..a59e303135fa02feca937e45706c87b14f8d0c5b 100644 (file)
@@ -19,7 +19,7 @@
  * We have mostly NULLs here: the current defaults are OK for
  * the coh filesystem.
  */
-struct file_operations sysv_file_operations = {
+const struct file_operations sysv_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
index b7f9b4a42aab561697e6a205d4d844b828efc3ad..393a480e4deb0860190a1bda62d37178d2846d85 100644 (file)
@@ -159,8 +159,8 @@ extern ino_t sysv_inode_by_name(struct dentry *);
 extern struct inode_operations sysv_file_inode_operations;
 extern struct inode_operations sysv_dir_inode_operations;
 extern struct inode_operations sysv_fast_symlink_inode_operations;
-extern struct file_operations sysv_file_operations;
-extern struct file_operations sysv_dir_operations;
+extern const struct file_operations sysv_file_operations;
+extern const struct file_operations sysv_dir_operations;
 extern struct address_space_operations sysv_aops;
 extern struct super_operations sysv_sops;
 extern struct dentry_operations sysv_dentry_operations;
index f5222527fe39fca5cb0d8997c4140ad9959a253b..8c28efa3b8ff2e4a40e981dd9bc7a4cbe193d44a 100644 (file)
@@ -42,7 +42,7 @@ static int do_udf_readdir(struct inode *, struct file *, filldir_t, void *);
 
 /* readdir and lookup functions */
 
-struct file_operations udf_dir_operations = {
+const struct file_operations udf_dir_operations = {
        .read                   = generic_read_dir,
        .readdir                = udf_readdir,
        .ioctl                  = udf_ioctl,
index a6f2acc1f15c01929dd0ecc48a93b6c00e981d11..e34b00e303f13ae9cdd75d35a3649b6346b5c027 100644 (file)
@@ -248,7 +248,7 @@ static int udf_release_file(struct inode * inode, struct file * filp)
        return 0;
 }
 
-struct file_operations udf_file_operations = {
+const struct file_operations udf_file_operations = {
        .read                   = generic_file_read,
        .ioctl                  = udf_ioctl,
        .open                   = generic_file_open,
index 1d5800e0cbe7a78d1b6e85c13fd4c253f221a194..023e19ba5a2ee8be3d2f4df434564aa70a5f1dc8 100644 (file)
@@ -44,9 +44,9 @@ struct buffer_head;
 struct super_block;
 
 extern struct inode_operations udf_dir_inode_operations;
-extern struct file_operations udf_dir_operations;
+extern const struct file_operations udf_dir_operations;
 extern struct inode_operations udf_file_inode_operations;
-extern struct file_operations udf_file_operations;
+extern const struct file_operations udf_file_operations;
 extern struct address_space_operations udf_aops;
 extern struct address_space_operations udf_adinicb_aops;
 extern struct address_space_operations udf_symlink_aops;
index 7c10c68902ae2f22ba2e620c197e57d7233b4b5d..1a561202d3f44d33712ebd9e95609a0a436f5e44 100644 (file)
@@ -620,7 +620,7 @@ int ufs_empty_dir (struct inode * inode)
        return 1;
 }
 
-struct file_operations ufs_dir_operations = {
+const struct file_operations ufs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = ufs_readdir,
        .fsync          = file_fsync,
index 62ad481810ef9ba8d8eee4f6564ce9998cbb2977..312fd3f86313b61a7d6f7230699cc2f763d69008 100644 (file)
@@ -31,7 +31,7 @@
  * the ufs filesystem.
  */
  
-struct file_operations ufs_file_operations = {
+const struct file_operations ufs_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_file_read,
        .write          = generic_file_write,
index 185567a6a56118cb47dcf6da77b7df8de98f5af5..85997b1205f5f1c85dc9be7aa62d99b7dd536047 100644 (file)
@@ -528,7 +528,7 @@ open_exec_out:
 }
 #endif /* HAVE_FOP_OPEN_EXEC */
 
-struct file_operations xfs_file_operations = {
+const struct file_operations xfs_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = do_sync_read,
        .write          = do_sync_write,
@@ -550,7 +550,7 @@ struct file_operations xfs_file_operations = {
 #endif
 };
 
-struct file_operations xfs_invis_file_operations = {
+const struct file_operations xfs_invis_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = do_sync_read,
        .write          = do_sync_write,
@@ -570,7 +570,7 @@ struct file_operations xfs_invis_file_operations = {
 };
 
 
-struct file_operations xfs_dir_file_operations = {
+const struct file_operations xfs_dir_file_operations = {
        .read           = generic_read_dir,
        .readdir        = xfs_file_readdir,
        .unlocked_ioctl = xfs_file_ioctl,
index a8417d7af5f9dcffc7b4ab6350a219c7f76935e8..ad6173da567813c428ce5c159f180faedf61a097 100644 (file)
@@ -22,9 +22,9 @@ extern struct inode_operations xfs_inode_operations;
 extern struct inode_operations xfs_dir_inode_operations;
 extern struct inode_operations xfs_symlink_inode_operations;
 
-extern struct file_operations xfs_file_operations;
-extern struct file_operations xfs_dir_file_operations;
-extern struct file_operations xfs_invis_file_operations;
+extern const struct file_operations xfs_file_operations;
+extern const struct file_operations xfs_dir_file_operations;
+extern const struct file_operations xfs_invis_file_operations;
 
 extern int xfs_ioctl(struct bhv_desc *, struct inode *, struct file *,
                         int, unsigned int, void __user *);
index 95707182b3ed3c7a7c7609d4307bc137c0572a48..76f89356b6a759d82e69ee6d15148c0b03098b39 100644 (file)
@@ -12,8 +12,8 @@
 #define POLLWRNORM     (1 << 8)
 #define POLLWRBAND     (1 << 9)
 #define POLLMSG                (1 << 10)
-#define POLLREMOVE     (1 << 11)
-#define POLLRDHUP       (1 << 12)
+#define POLLREMOVE     (1 << 12)
+#define POLLRDHUP       (1 << 13)
 
 
 struct pollfd {
index 16fc00360f7582eef14a9934c9d6fe7f3abf7f7c..de4614840c2cdf4cd8bd7b85502be301c247cedb 100644 (file)
@@ -4,28 +4,28 @@
 #include <linux/config.h>
 #include <linux/percpu.h>
 #include <linux/hardirq.h>
+#include <asm/atomic.h>
 #include <asm/types.h>
 
 /* An unsigned long type for operations which are atomic for a single
  * CPU.  Usually used in combination with per-cpu variables. */
 
-#if BITS_PER_LONG == 32
 /* Implement in terms of atomics. */
 
 /* Don't use typedef: don't want them to be mixed with atomic_t's. */
 typedef struct
 {
-       atomic_t a;
+       atomic_long_t a;
 } local_t;
 
-#define LOCAL_INIT(i)  { ATOMIC_INIT(i) }
+#define LOCAL_INIT(i)  { ATOMIC_LONG_INIT(i) }
 
-#define local_read(l)  ((unsigned long)atomic_read(&(l)->a))
-#define local_set(l,i) atomic_set((&(l)->a),(i))
-#define local_inc(l)   atomic_inc(&(l)->a)
-#define local_dec(l)   atomic_dec(&(l)->a)
-#define local_add(i,l) atomic_add((i),(&(l)->a))
-#define local_sub(i,l) atomic_sub((i),(&(l)->a))
+#define local_read(l)  ((unsigned long)atomic_long_read(&(l)->a))
+#define local_set(l,i) atomic_long_set((&(l)->a),(i))
+#define local_inc(l)   atomic_long_inc(&(l)->a)
+#define local_dec(l)   atomic_long_dec(&(l)->a)
+#define local_add(i,l) atomic_long_add((i),(&(l)->a))
+#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
 
 /* Non-atomic variants, ie. preemption disabled and won't be touched
  * in interrupt, etc.  Some archs can optimize this case well. */
@@ -34,68 +34,6 @@ typedef struct
 #define __local_add(i,l)       local_set((l), local_read(l) + (i))
 #define __local_sub(i,l)       local_set((l), local_read(l) - (i))
 
-#else /* ... can't use atomics. */
-/* Implement in terms of three variables.
-   Another option would be to use local_irq_save/restore. */
-
-typedef struct
-{
-       /* 0 = in hardirq, 1 = in softirq, 2 = usermode. */
-       unsigned long v[3];
-} local_t;
-
-#define _LOCAL_VAR(l)  ((l)->v[!in_interrupt() + !in_irq()])
-
-#define LOCAL_INIT(i)  { { (i), 0, 0 } }
-
-static inline unsigned long local_read(local_t *l)
-{
-       return l->v[0] + l->v[1] + l->v[2];
-}
-
-static inline void local_set(local_t *l, unsigned long v)
-{
-       l->v[0] = v;
-       l->v[1] = l->v[2] = 0;
-}
-
-static inline void local_inc(local_t *l)
-{
-       preempt_disable();
-       _LOCAL_VAR(l)++;
-       preempt_enable();
-}
-
-static inline void local_dec(local_t *l)
-{
-       preempt_disable();
-       _LOCAL_VAR(l)--;
-       preempt_enable();
-}
-
-static inline void local_add(unsigned long v, local_t *l)
-{
-       preempt_disable();
-       _LOCAL_VAR(l) += v;
-       preempt_enable();
-}
-
-static inline void local_sub(unsigned long v, local_t *l)
-{
-       preempt_disable();
-       _LOCAL_VAR(l) -= v;
-       preempt_enable();
-}
-
-/* Non-atomic variants, ie. preemption disabled and won't be touched
- * in interrupt, etc.  Some archs can optimize this case well. */
-#define __local_inc(l)         ((l)->v[0]++)
-#define __local_dec(l)         ((l)->v[0]--)
-#define __local_add(i,l)       ((l)->v[0] += (i))
-#define __local_sub(i,l)       ((l)->v[0] -= (i))
-
-#endif /* Non-atomic implementation */
-
 /* Use these for per-cpu local_t variables: on some archs they are
  * much more efficient than these naive implementations.  Note they take
  * a variable (eg. mystruct.foo), not an address.
index 78cf45547e31f0a5742be733f31c0a394297c040..c0caf433a7d76dc99b8473f4145c250f3446e877 100644 (file)
@@ -19,7 +19,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
 #define percpu_modcopy(pcpudst, src, size)                     \
 do {                                                           \
        unsigned int __i;                                       \
-       for_each_cpu(__i)                                       \
+       for_each_possible_cpu(__i)                              \
                memcpy((pcpudst)+__per_cpu_offset[__i],         \
                       (src), (size));                          \
 } while (0)
index b749aa44a86f5462e5e88038edf673ecc7cedee6..31eb5de6f3dc7d285baed0f69d6daadcfada178c 100644 (file)
@@ -82,21 +82,8 @@ static inline int mach_set_rtc_mmss(unsigned long nowtime)
 static inline unsigned long mach_get_cmos_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
-       int i;
 
-       /* The Linux interpretation of the CMOS clock register contents:
-        * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
-        * RTC registers show the second which has precisely just started.
-        * Let's hope other operating systems interpret the RTC the same way.
-        */
-       /* read RTC exactly on falling edge of update flag */
-       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
-               if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
-                       break;
-       for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
-               if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
-                       break;
-       do { /* Isn't this overkill ? UIP above should guarantee consistency */
+       do {
                sec = CMOS_READ(RTC_SECONDS);
                min = CMOS_READ(RTC_MINUTES);
                hour = CMOS_READ(RTC_HOURS);
@@ -104,16 +91,18 @@ static inline unsigned long mach_get_cmos_time(void)
                mon = CMOS_READ(RTC_MONTH);
                year = CMOS_READ(RTC_YEAR);
        } while (sec != CMOS_READ(RTC_SECONDS));
-       if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
-         {
-           BCD_TO_BIN(sec);
-           BCD_TO_BIN(min);
-           BCD_TO_BIN(hour);
-           BCD_TO_BIN(day);
-           BCD_TO_BIN(mon);
-           BCD_TO_BIN(year);
-         }
-       if ((year += 1900) < 1970)
+
+       if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
+               BCD_TO_BIN(sec);
+               BCD_TO_BIN(min);
+               BCD_TO_BIN(hour);
+               BCD_TO_BIN(day);
+               BCD_TO_BIN(mon);
+               BCD_TO_BIN(year);
+       }
+
+       year += 1900;
+       if (year < 1970)
                year += 100;
 
        return mktime(year, mon, day, hour, min, sec);
index af4bfd012475ced0edb62d553a1691872b5dbc9c..805f0dcda468d3d720b2e836d506870b0657d0ee 100644 (file)
@@ -621,8 +621,6 @@ struct extended_sigtable {
        unsigned int reserved[3];
        struct extended_signature sigs[0];
 };
-/* '6' because it used to be for P6 only (but now covers Pentium 4 as well) */
-#define MICROCODE_IOCFREE      _IO('6',0)
 
 /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
 static inline void rep_nop(void)
index 47214861093be33cca0822da379e4aff54a274d8..41ac8d363c67997d8f2edee2b60f24d71b75f527 100644 (file)
@@ -86,43 +86,14 @@ static inline int mc146818_set_rtc_mmss(unsigned long nowtime)
        return retval;
 }
 
-/*
- * Returns true if a clock update is in progress
- */
-static inline unsigned char rtc_is_updating(void)
-{
-       unsigned char uip;
-       unsigned long flags;
-
-       spin_lock_irqsave(&rtc_lock, flags);
-       uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
-       spin_unlock_irqrestore(&rtc_lock, flags);
-       return uip;
-}
-
 static inline unsigned long mc146818_get_cmos_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
-       int i;
        unsigned long flags;
 
-       /*
-        * The Linux interpretation of the CMOS clock register contents:
-        * When the Update-In-Progress (UIP) flag goes from 1 to 0, the
-        * RTC registers show the second which has precisely just started.
-        * Let's hope other operating systems interpret the RTC the same way.
-        */
-
-       /* read RTC exactly on falling edge of update flag */
-       for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
-               if (rtc_is_updating())
-                       break;
-       for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
-               if (!rtc_is_updating())
-                       break;
-
        spin_lock_irqsave(&rtc_lock, flags);
-       do { /* Isn't this overkill ? UIP above should guarantee consistency */
+
+       do {
                sec = CMOS_READ(RTC_SECONDS);
                min = CMOS_READ(RTC_MINUTES);
                hour = CMOS_READ(RTC_HOURS);
index 8e23e4c674f65daff3786b71cfd9c7d7f4468637..0a3face6c480b87ce97660fa8bde6c87bd6469d1 100644 (file)
@@ -333,7 +333,7 @@ struct pdc_model {          /* for PDC_MODEL */
        unsigned long curr_key;
 };
 
-/* Values for PDC_MODEL_CAPABILITES non-equivalent virtual aliasing support */
+/* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */
 
 #define PDC_MODEL_IOPDIR_FDC            (1 << 2)        /* see sba_iommu.c */
 #define PDC_MODEL_NVA_MASK             (3 << 4)
index dbb05d1a26d18f4e330ce773c5245304a589b9ce..720afc11c2caf7c4e95d7943894337ef25ec154d 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <asm/cpu/addrspace.h>
 
-/* Memory segments (32bit Priviledged mode addresses)  */
+/* Memory segments (32bit Privileged mode addresses)  */
 #define P0SEG          0x00000000
 #define P1SEG          0x80000000
 #define P2SEG          0xa0000000
index 49d49a285943d2654e3a59c50376d3bca384d353..6a95d5d0c57613c5760773123ace45b08d765456 100644 (file)
@@ -738,7 +738,7 @@ static unsigned long __init sun_floppy_init(void)
                if (!sun_floppy_types[0] && sun_floppy_types[1]) {
                        /*
                         * Set the drive exchange bit in FCR on NS87303,
-                        * make shure other bits are sane before doing so.
+                        * make sure other bits are sane before doing so.
                         */
                        ns87303_modify(config, FER, FER_EDM, 0);
                        ns87303_modify(config, ASC, ASC_DRV2_SEL, 0);
index cd340a233156f04a40c1da972d807bd45b978dfd..dee40206b221f8d30d1e011faf79eedbea81402c 100644 (file)
@@ -84,9 +84,27 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
 }
 
 static inline int
-futex_atomic_cmpxchg_inuser(int __user *uaddr, int oldval, int newval)
+futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
 {
-       return -ENOSYS;
+       __asm__ __volatile__(
+       "\n1:   lduwa   [%2] %%asi, %0\n"
+       "2:     casa    [%2] %%asi, %0, %1\n"
+       "3:\n"
+       "       .section .fixup,#alloc,#execinstr\n"
+       "       .align  4\n"
+       "4:     ba      3b\n"
+       "        mov    %3, %0\n"
+       "       .previous\n"
+       "       .section __ex_table,\"a\"\n"
+       "       .align  4\n"
+       "       .word   1b, 4b\n"
+       "       .word   2b, 4b\n"
+       "       .previous\n"
+       : "=&r" (oldval)
+       : "r" (newval), "r" (uaddr), "i" (-EFAULT)
+       : "memory");
+
+       return oldval;
 }
 
 #endif /* !(_SPARC64_FUTEX_H) */
index 1aa2cee433443caabeee201580020f0c852b5a5d..37a3ec433ee5816e7ada16d4f8da264b1623343e 100644 (file)
@@ -358,9 +358,6 @@ struct extended_sigtable {
        struct extended_signature sigs[0];
 };
 
-/* '6' because it used to be for P6 only (but now covers Pentium 4 as well) */
-#define MICROCODE_IOCFREE      _IO('6',0)
-
 
 #define ASM_NOP1 K8_NOP1
 #define ASM_NOP2 K8_NOP2
index 8da37e29cb877177208e0e51821a72a2e9c72927..2216638962d2790fa8d5e4776d17559c3717a69a 100644 (file)
@@ -5,13 +5,13 @@
 struct cdev {
        struct kobject kobj;
        struct module *owner;
-       struct file_operations *ops;
+       const struct file_operations *ops;
        struct list_head list;
        dev_t dev;
        unsigned int count;
 };
 
-void cdev_init(struct cdev *, struct file_operations *);
+void cdev_init(struct cdev *, const struct file_operations *);
 
 struct cdev *cdev_alloc(void);
 
index cc621ec409d8f8d97e96bda2b92f835021667bff..b3ecf8f71d97066666ed60cdef837e4bdd436b0f 100644 (file)
@@ -30,9 +30,9 @@ extern struct inode_operations coda_ioctl_inode_operations;
 extern struct address_space_operations coda_file_aops;
 extern struct address_space_operations coda_symlink_aops;
 
-extern struct file_operations coda_dir_operations;
-extern struct file_operations coda_file_operations;
-extern struct file_operations coda_ioctl_operations;
+extern const struct file_operations coda_dir_operations;
+extern const struct file_operations coda_file_operations;
+extern const struct file_operations coda_ioctl_operations;
 
 /* operations shared over more than one file */
 int coda_open(struct inode *i, struct file *f);
index 99e6115d8e526cfc53deeaf1e0c27879428b56ab..9cbb781d6f808b361a9f7f1a4df50f8ee9bde9a9 100644 (file)
@@ -67,7 +67,7 @@
  *
  * int any_online_cpu(mask)            First online cpu in mask
  *
- * for_each_cpu(cpu)                   for-loop cpu over cpu_possible_map
+ * for_each_possible_cpu(cpu)          for-loop cpu over cpu_possible_map
  * for_each_online_cpu(cpu)            for-loop cpu over cpu_online_map
  * for_each_present_cpu(cpu)           for-loop cpu over cpu_present_map
  *
@@ -405,7 +405,8 @@ int __any_online_cpu(const cpumask_t *mask);
 #define any_online_cpu(mask)           0
 #endif
 
-#define for_each_cpu(cpu)        for_each_cpu_mask((cpu), cpu_possible_map)
+#define for_each_cpu(cpu)  for_each_cpu_mask((cpu), cpu_possible_map)
+#define for_each_possible_cpu(cpu)  for_each_cpu_mask((cpu), cpu_possible_map)
 #define for_each_online_cpu(cpu)  for_each_cpu_mask((cpu), cpu_online_map)
 #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)
 
index 534d750d922dee89c645f10d93166c3065db85c0..32503657f14f11e9078d16c44ae503e38248d7ad 100644 (file)
@@ -11,7 +11,7 @@
 extern unsigned long long elfcorehdr_addr;
 extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
                                                unsigned long, int);
-extern struct file_operations proc_vmcore_operations;
+extern const struct file_operations proc_vmcore_operations;
 extern struct proc_dir_entry *proc_vmcore;
 
 #endif /* CONFIG_CRASH_DUMP */
index 4b0428e335beb5b652bddf8ad77fde35f982e57a..176e2d37157783153458fc1d8e57b53057482171 100644 (file)
@@ -29,7 +29,7 @@ struct debugfs_blob_wrapper {
 #if defined(CONFIG_DEBUG_FS)
 struct dentry *debugfs_create_file(const char *name, mode_t mode,
                                   struct dentry *parent, void *data,
-                                  struct file_operations *fops);
+                                  const struct file_operations *fops);
 
 struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
 
index a8731062a74cc1fbc06a3b6bb8b77c78f01fc284..9b4751aecc238d7cbc5ab045ccd7d70cfbe26245 100644 (file)
@@ -21,6 +21,7 @@ enum dma_data_direction {
 #define DMA_30BIT_MASK 0x000000003fffffffULL
 #define DMA_29BIT_MASK 0x000000001fffffffULL
 #define DMA_28BIT_MASK 0x000000000fffffffULL
+#define DMA_24BIT_MASK 0x0000000000ffffffULL
 
 #include <asm/dma-mapping.h>
 
index 28f368c526fba4360be6c0fa83e705bbcd51801c..fbfa6b52e2fb0007a3ec29b7a003fc3981981d19 100644 (file)
@@ -37,7 +37,7 @@ static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb)
 struct statfs;
 
 extern struct inode_operations efs_dir_inode_operations;
-extern struct file_operations efs_dir_operations;
+extern const struct file_operations efs_dir_operations;
 extern struct address_space_operations efs_symlink_aops;
 
 extern void efs_read_inode(struct inode *);
index 8bb4f842cded772983f04d5c9e39f92afed89c5d..3ade6a4e3bdd7233cfddfe02f0f1494dcc6616d3 100644 (file)
@@ -833,11 +833,11 @@ do {                                                              \
  */
 
 /* dir.c */
-extern struct file_operations ext3_dir_operations;
+extern const struct file_operations ext3_dir_operations;
 
 /* file.c */
 extern struct inode_operations ext3_file_inode_operations;
-extern struct file_operations ext3_file_operations;
+extern const struct file_operations ext3_file_operations;
 
 /* namei.c */
 extern struct inode_operations ext3_dir_inode_operations;
index 2cb19e6503aa954003e7ae30703188697bda472b..d03fadfcafe37461c18d22fdb6b7ac6840be42ab 100644 (file)
@@ -734,7 +734,7 @@ struct fb_tile_ops {
 
 /* A driver may set this flag to indicate that it does want a set_par to be
  * called every time when fbcon_switch is executed. The advantage is that with
- * this flag set you can really be shure that set_par is always called before
+ * this flag set you can really be sure that set_par is always called before
  * any of the functions dependant on the correct hardware state or altering
  * that state, even if you are using some broken X releases. The disadvantage
  * is that it introduces unwanted delays to every console switch if set_par
index 680d913350e7edd074b09e7c0c2ca1cf3797de03..408fe89498f421285b563e12889439b3e620b310 100644 (file)
@@ -496,7 +496,7 @@ struct inode {
        struct mutex            i_mutex;
        struct rw_semaphore     i_alloc_sem;
        struct inode_operations *i_op;
-       struct file_operations  *i_fop; /* former ->i_op->default_file_ops */
+       const struct file_operations    *i_fop; /* former ->i_op->default_file_ops */
        struct super_block      *i_sb;
        struct file_lock        *i_flock;
        struct address_space    *i_mapping;
@@ -636,7 +636,7 @@ struct file {
        } f_u;
        struct dentry           *f_dentry;
        struct vfsmount         *f_vfsmnt;
-       struct file_operations  *f_op;
+       const struct file_operations    *f_op;
        atomic_t                f_count;
        unsigned int            f_flags;
        mode_t                  f_mode;
@@ -1390,11 +1390,11 @@ extern void bd_set_size(struct block_device *, loff_t size);
 extern void bd_forget(struct inode *inode);
 extern void bdput(struct block_device *);
 extern struct block_device *open_by_devnum(dev_t, unsigned);
-extern struct file_operations def_blk_fops;
+extern const struct file_operations def_blk_fops;
 extern struct address_space_operations def_blk_aops;
-extern struct file_operations def_chr_fops;
-extern struct file_operations bad_sock_fops;
-extern struct file_operations def_fifo_fops;
+extern const struct file_operations def_chr_fops;
+extern const struct file_operations bad_sock_fops;
+extern const struct file_operations def_fifo_fops;
 extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
 extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
 extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
@@ -1414,7 +1414,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *);
 extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
 extern int register_chrdev_region(dev_t, unsigned, const char *);
 extern int register_chrdev(unsigned int, const char *,
-                          struct file_operations *);
+                          const struct file_operations *);
 extern int unregister_chrdev(unsigned int, const char *);
 extern void unregister_chrdev_region(dev_t, unsigned);
 extern int chrdev_open(struct inode *, struct file *);
@@ -1444,9 +1444,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t);
 extern void make_bad_inode(struct inode *);
 extern int is_bad_inode(struct inode *);
 
-extern struct file_operations read_fifo_fops;
-extern struct file_operations write_fifo_fops;
-extern struct file_operations rdwr_fifo_fops;
+extern const struct file_operations read_fifo_fops;
+extern const struct file_operations write_fifo_fops;
+extern const struct file_operations rdwr_fifo_fops;
 
 extern int fs_may_remount_ro(struct super_block *);
 
@@ -1688,7 +1688,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb,
                                nr_segs, get_block, end_io, DIO_OWN_LOCKING);
 }
 
-extern struct file_operations generic_ro_fops;
+extern const struct file_operations generic_ro_fops;
 
 #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
 
@@ -1744,9 +1744,9 @@ extern int simple_commit_write(struct file *file, struct page *page,
 
 extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
 extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
-extern struct file_operations simple_dir_operations;
+extern const struct file_operations simple_dir_operations;
 extern struct inode_operations simple_dir_inode_operations;
-struct tree_descr { char *name; struct file_operations *ops; int mode; };
+struct tree_descr { char *name; const struct file_operations *ops; int mode; };
 struct dentry *d_alloc_name(struct dentry *, const char *);
 extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
 extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);
index 3c1b0294a74286ab79063fac7999255711d36992..10a27f29d6925514265aa39834642bb58dd4c493 100644 (file)
@@ -152,14 +152,14 @@ struct disk_attribute {
 ({                                                                     \
        typeof(gendiskp->dkstats->field) res = 0;                       \
        int i;                                                          \
-       for_each_cpu(i)                                                 \
+       for_each_possible_cpu(i)                                        \
                res += per_cpu_ptr(gendiskp->dkstats, i)->field;        \
        res;                                                            \
 })
 
 static inline void disk_stat_set_all(struct gendisk *gendiskp, int value)      {
        int i;
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                memset(per_cpu_ptr(gendiskp->dkstats, i), value,
                                sizeof (struct disk_stats));
 }              
index d6f1019625af72294e578e2731199199e02dea15..4c5e610fe442eb7a4c116d84dda43bfcd9923ced 100644 (file)
@@ -154,7 +154,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
        return sb->s_fs_info;
 }
 
-extern struct file_operations hugetlbfs_file_operations;
+extern const struct file_operations hugetlbfs_file_operations;
 extern struct vm_operations_struct hugetlb_vm_ops;
 struct file *hugetlb_zero_setup(size_t);
 int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info,
index 6d4cc3c110d6b375ab90fa3e979bbe0cbd33cbde..1d4e341b72e62c23bcd0847bdaa44b5f2971ff9a 100644 (file)
@@ -957,7 +957,7 @@ struct input_handler {
        struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id);
        void (*disconnect)(struct input_handle *handle);
 
-       struct file_operations *fops;
+       const struct file_operations *fops;
        int minor;
        char *name;
 
index a484572c302e10fd43a81aa3cdffd9c2be6eb07b..b46249082ccacf661902110804ec2192ea733f25 100644 (file)
@@ -46,7 +46,7 @@ static inline int kstat_irqs(int irq)
 {
        int cpu, sum = 0;
 
-       for_each_cpu(cpu)
+       for_each_possible_cpu(cpu)
                sum += kstat_cpu(cpu).irqs[irq];
 
        return sum;
index 14ceebfc1efaf5d35153b7f9e2e22b41d4320adb..5b584dafb5a6d4384f9b3169b2500d8cf0c3b518 100644 (file)
@@ -36,7 +36,7 @@ struct class_device;
 struct miscdevice  {
        int minor;
        const char *name;
-       struct file_operations *fops;
+       const struct file_operations *fops;
        struct list_head list;
        struct device *dev;
        struct class_device *class;
index 779e6a5744c77e5dbe8b1112af78026ba89a3cba..d9035c73e5d1206e8ca798bdbec05fe4845bb287 100644 (file)
@@ -334,7 +334,7 @@ extern int fat_bmap(struct inode *inode, sector_t sector, sector_t *phys,
                    unsigned long *mapped_blocks);
 
 /* fat/dir.c */
-extern struct file_operations fat_dir_operations;
+extern const struct file_operations fat_dir_operations;
 extern int fat_search_long(struct inode *inode, const unsigned char *name,
                           int name_len, struct fat_slot_info *sinfo);
 extern int fat_dir_empty(struct inode *dir);
@@ -397,7 +397,7 @@ extern int fat_count_free_clusters(struct super_block *sb);
 /* fat/file.c */
 extern int fat_generic_ioctl(struct inode *inode, struct file *filp,
                             unsigned int cmd, unsigned long arg);
-extern struct file_operations fat_file_operations;
+extern const struct file_operations fat_file_operations;
 extern struct inode_operations fat_file_inode_operations;
 extern int fat_notify_change(struct dentry * dentry, struct iattr * attr);
 extern void fat_truncate(struct inode *inode);
@@ -420,6 +420,9 @@ extern int date_dos2unix(unsigned short time, unsigned short date);
 extern void fat_date_unix2dos(int unix_date, __le16 *time, __le16 *date);
 extern int fat_sync_bhs(struct buffer_head **bhs, int nr_bhs);
 
+int fat_cache_init(void);
+void fat_cache_destroy(void);
+
 #endif /* __KERNEL__ */
 
 #endif
index e013425685302654e31021c870e4777184ee07a7..96dc237b8f0347571c80601d985785eaaea07cb8 100644 (file)
@@ -209,7 +209,7 @@ void ncp_update_inode2(struct inode *, struct ncp_entry_info *);
 
 /* linux/fs/ncpfs/dir.c */
 extern struct inode_operations ncp_dir_inode_operations;
-extern struct file_operations ncp_dir_operations;
+extern const struct file_operations ncp_dir_operations;
 int ncp_conn_logged_in(struct super_block *);
 int ncp_date_dos2unix(__le16 time, __le16 date);
 void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
@@ -230,7 +230,7 @@ void ncp_unlock_server(struct ncp_server *server);
 
 /* linux/fs/ncpfs/file.c */
 extern struct inode_operations ncp_file_inode_operations;
-extern struct file_operations ncp_file_operations;
+extern const struct file_operations ncp_file_operations;
 int ncp_make_open(struct inode *, int);
 
 /* linux/fs/ncpfs/mmap.c */
index cbebd7d1b9e8610f6206ab3c650893fb39773d8a..c71227dd43896ff5a64ad6de0258e9e785aa96ad 100644 (file)
@@ -324,7 +324,7 @@ extern struct inode_operations nfs_file_inode_operations;
 #ifdef CONFIG_NFS_V3
 extern struct inode_operations nfs3_file_inode_operations;
 #endif /* CONFIG_NFS_V3 */
-extern struct file_operations nfs_file_operations;
+extern const struct file_operations nfs_file_operations;
 extern struct address_space_operations nfs_file_aops;
 
 static inline struct rpc_cred *nfs_file_cred(struct file *file)
@@ -371,7 +371,7 @@ extern struct inode_operations nfs_dir_inode_operations;
 #ifdef CONFIG_NFS_V3
 extern struct inode_operations nfs3_dir_inode_operations;
 #endif /* CONFIG_NFS_V3 */
-extern struct file_operations nfs_dir_operations;
+extern const struct file_operations nfs_dir_operations;
 extern struct dentry_operations nfs_dentry_operations;
 
 extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr);
index 559c4c38a9c716e4a0a87e46805125198cfa8f2e..0d514b252454478a71e4706bc3b693e6b3d7941a 100644 (file)
@@ -61,6 +61,16 @@ void oprofile_arch_exit(void);
  */
 void oprofile_add_sample(struct pt_regs * const regs, unsigned long event);
 
+/**
+ * Add an extended sample.  Use this when the PC is not from the regs, and
+ * we cannot determine if we're in kernel mode from the regs.
+ *
+ * This function does perform a backtrace.
+ *
+ */
+void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
+                               unsigned long event, int is_kernel);
+
 /* Use this instead when the PC value is not from the regs. Doesn't
  * backtrace. */
 void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event);
@@ -74,10 +84,10 @@ void oprofile_add_trace(unsigned long eip);
  * the specified file operations.
  */
 int oprofilefs_create_file(struct super_block * sb, struct dentry * root,
-       char const * name, struct file_operations * fops);
+       char const * name, const struct file_operations * fops);
 
 int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root,
-       char const * name, struct file_operations * fops, int perm);
+       char const * name, const struct file_operations * fops, int perm);
  
 /** Create a file for read/write access to an unsigned long. */
 int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root,
index 02f6cf20b141e99fe40d66ea0fefabff5fa7fa92..e2ab2ac18d6b70f0a3c71c2886389e53db58c9cd 100644 (file)
 #define PCI_DEVICE_ID_SI_965           0x0965
 #define PCI_DEVICE_ID_SI_5511          0x5511
 #define PCI_DEVICE_ID_SI_5513          0x5513
+#define PCI_DEVICE_ID_SI_5517          0x5517
 #define PCI_DEVICE_ID_SI_5518          0x5518
 #define PCI_DEVICE_ID_SI_5571          0x5571
 #define PCI_DEVICE_ID_SI_5581          0x5581
index 8e8f6098508aca2992e6402f12e83087d3846757..51e1b56741fb153013e50f6b1167b9a36345232f 100644 (file)
 #include <linux/mm.h>
 #include <asm/uaccess.h>
 
+/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
+   additional memory. */
+#define MAX_STACK_ALLOC 832
+#define FRONTEND_STACK_ALLOC   256
+#define SELECT_STACK_ALLOC     FRONTEND_STACK_ALLOC
+#define POLL_STACK_ALLOC       FRONTEND_STACK_ALLOC
+#define WQUEUES_STACK_ALLOC    (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC)
+#define N_INLINE_POLL_ENTRIES  (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry))
+
 struct poll_table_struct;
 
 /* 
@@ -33,6 +42,12 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc)
        pt->qproc = qproc;
 }
 
+struct poll_table_entry {
+       struct file * filp;
+       wait_queue_t wait;
+       wait_queue_head_t * wait_address;
+};
+
 /*
  * Structures and helpers for sys_poll/sys_poll
  */
@@ -40,6 +55,8 @@ struct poll_wqueues {
        poll_table pt;
        struct poll_table_page * table;
        int error;
+       int inline_index;
+       struct poll_table_entry inline_entries[N_INLINE_POLL_ENTRIES];
 };
 
 extern void poll_initwait(struct poll_wqueues *pwq);
index cb224cf653b1bcd60b2945fa7e5d4707a789a8bc..135871df991103b661eb5e78e0c0c30084fc278d 100644 (file)
@@ -58,7 +58,7 @@ struct proc_dir_entry {
        gid_t gid;
        loff_t size;
        struct inode_operations * proc_iops;
-       struct file_operations * proc_fops;
+       const struct file_operations * proc_fops;
        get_info_t *get_info;
        struct module *owner;
        struct proc_dir_entry *next, *parent, *subdir;
@@ -128,9 +128,9 @@ extern int proc_match(int, const char *,struct proc_dir_entry *);
 extern int proc_readdir(struct file *, void *, filldir_t);
 extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *);
 
-extern struct file_operations proc_kcore_operations;
-extern struct file_operations proc_kmsg_operations;
-extern struct file_operations ppc_htab_operations;
+extern const struct file_operations proc_kcore_operations;
+extern const struct file_operations proc_kmsg_operations;
+extern const struct file_operations ppc_htab_operations;
 
 /*
  * proc_tty.c
@@ -189,7 +189,7 @@ static inline struct proc_dir_entry *proc_net_create(const char *name,
 }
 
 static inline struct proc_dir_entry *proc_net_fops_create(const char *name,
-       mode_t mode, struct file_operations *fops)
+       mode_t mode, const struct file_operations *fops)
 {
        struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net);
        if (res)
index fc610bb0f73397421ba88804236d950a2a4d9c7d..27f49c85d5d6da385fcb087601fc83d3d376cb3a 100644 (file)
@@ -118,8 +118,8 @@ extern struct buffer_head *qnx4_bread(struct inode *, int, int);
 
 extern struct inode_operations qnx4_file_inode_operations;
 extern struct inode_operations qnx4_dir_inode_operations;
-extern struct file_operations qnx4_file_operations;
-extern struct file_operations qnx4_dir_operations;
+extern const struct file_operations qnx4_file_operations;
+extern const struct file_operations qnx4_dir_operations;
 extern int qnx4_is_free(struct super_block *sb, long block);
 extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy);
 extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd);
index 953b6df5d03713916a4f00365ed18a3ab840465d..78ecfa28b1c286a3d5b5b8f22892ba18f6c26a46 100644 (file)
@@ -15,7 +15,7 @@ extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
 extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
 #endif
 
-extern struct file_operations ramfs_file_operations;
+extern const struct file_operations ramfs_file_operations;
 extern struct vm_operations_struct generic_file_vm_ops;
 
 #endif
index 912f1b7cb18f375123b99efa0046fc793491a7ff..5676c4210e2c186d23548072abaf39d5885d4874 100644 (file)
@@ -1960,7 +1960,7 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset,
 extern struct inode_operations reiserfs_dir_inode_operations;
 extern struct inode_operations reiserfs_symlink_inode_operations;
 extern struct inode_operations reiserfs_special_inode_operations;
-extern struct file_operations reiserfs_dir_operations;
+extern const struct file_operations reiserfs_dir_operations;
 
 /* tail_conversion.c */
 int direct2indirect(struct reiserfs_transaction_handle *, struct inode *,
@@ -1972,7 +1972,7 @@ void reiserfs_unmap_buffer(struct buffer_head *);
 
 /* file.c */
 extern struct inode_operations reiserfs_file_inode_operations;
-extern struct file_operations reiserfs_file_operations;
+extern const struct file_operations reiserfs_file_operations;
 extern struct address_space_operations reiserfs_address_space_operations;
 
 /* fix_nodes.c */
diff --git a/include/linux/relayfs_fs.h b/include/linux/relayfs_fs.h
deleted file mode 100644 (file)
index 7342e66..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * linux/include/linux/relayfs_fs.h
- *
- * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp
- * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com)
- *
- * RelayFS definitions and declarations
- */
-
-#ifndef _LINUX_RELAYFS_FS_H
-#define _LINUX_RELAYFS_FS_H
-
-#include <linux/config.h>
-#include <linux/types.h>
-#include <linux/sched.h>
-#include <linux/wait.h>
-#include <linux/list.h>
-#include <linux/fs.h>
-#include <linux/poll.h>
-#include <linux/kref.h>
-
-/*
- * Tracks changes to rchan/rchan_buf structs
- */
-#define RELAYFS_CHANNEL_VERSION                6
-
-/*
- * Per-cpu relay channel buffer
- */
-struct rchan_buf
-{
-       void *start;                    /* start of channel buffer */
-       void *data;                     /* start of current sub-buffer */
-       size_t offset;                  /* current offset into sub-buffer */
-       size_t subbufs_produced;        /* count of sub-buffers produced */
-       size_t subbufs_consumed;        /* count of sub-buffers consumed */
-       struct rchan *chan;             /* associated channel */
-       wait_queue_head_t read_wait;    /* reader wait queue */
-       struct work_struct wake_readers; /* reader wake-up work struct */
-       struct dentry *dentry;          /* channel file dentry */
-       struct kref kref;               /* channel buffer refcount */
-       struct page **page_array;       /* array of current buffer pages */
-       unsigned int page_count;        /* number of current buffer pages */
-       unsigned int finalized;         /* buffer has been finalized */
-       size_t *padding;                /* padding counts per sub-buffer */
-       size_t prev_padding;            /* temporary variable */
-       size_t bytes_consumed;          /* bytes consumed in cur read subbuf */
-       unsigned int cpu;               /* this buf's cpu */
-} ____cacheline_aligned;
-
-/*
- * Relay channel data structure
- */
-struct rchan
-{
-       u32 version;                    /* the version of this struct */
-       size_t subbuf_size;             /* sub-buffer size */
-       size_t n_subbufs;               /* number of sub-buffers per buffer */
-       size_t alloc_size;              /* total buffer size allocated */
-       struct rchan_callbacks *cb;     /* client callbacks */
-       struct kref kref;               /* channel refcount */
-       void *private_data;             /* for user-defined data */
-       size_t last_toobig;             /* tried to log event > subbuf size */
-       struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */
-};
-
-/*
- * Relay channel client callbacks
- */
-struct rchan_callbacks
-{
-       /*
-        * subbuf_start - called on buffer-switch to a new sub-buffer
-        * @buf: the channel buffer containing the new sub-buffer
-        * @subbuf: the start of the new sub-buffer
-        * @prev_subbuf: the start of the previous sub-buffer
-        * @prev_padding: unused space at the end of previous sub-buffer
-        *
-        * The client should return 1 to continue logging, 0 to stop
-        * logging.
-        *
-        * NOTE: subbuf_start will also be invoked when the buffer is
-        *       created, so that the first sub-buffer can be initialized
-        *       if necessary.  In this case, prev_subbuf will be NULL.
-        *
-        * NOTE: the client can reserve bytes at the beginning of the new
-        *       sub-buffer by calling subbuf_start_reserve() in this callback.
-        */
-       int (*subbuf_start) (struct rchan_buf *buf,
-                            void *subbuf,
-                            void *prev_subbuf,
-                            size_t prev_padding);
-
-       /*
-        * buf_mapped - relayfs buffer mmap notification
-        * @buf: the channel buffer
-        * @filp: relayfs file pointer
-        *
-        * Called when a relayfs file is successfully mmapped
-        */
-        void (*buf_mapped)(struct rchan_buf *buf,
-                          struct file *filp);
-
-       /*
-        * buf_unmapped - relayfs buffer unmap notification
-        * @buf: the channel buffer
-        * @filp: relayfs file pointer
-        *
-        * Called when a relayfs file is successfully unmapped
-        */
-        void (*buf_unmapped)(struct rchan_buf *buf,
-                            struct file *filp);
-       /*
-        * create_buf_file - create file to represent a relayfs channel buffer
-        * @filename: the name of the file to create
-        * @parent: the parent of the file to create
-        * @mode: the mode of the file to create
-        * @buf: the channel buffer
-        * @is_global: outparam - set non-zero if the buffer should be global
-        *
-        * Called during relay_open(), once for each per-cpu buffer,
-        * to allow the client to create a file to be used to
-        * represent the corresponding channel buffer.  If the file is
-        * created outside of relayfs, the parent must also exist in
-        * that filesystem.
-        *
-        * The callback should return the dentry of the file created
-        * to represent the relay buffer.
-        *
-        * Setting the is_global outparam to a non-zero value will
-        * cause relay_open() to create a single global buffer rather
-        * than the default set of per-cpu buffers.
-        *
-        * See Documentation/filesystems/relayfs.txt for more info.
-        */
-       struct dentry *(*create_buf_file)(const char *filename,
-                                         struct dentry *parent,
-                                         int mode,
-                                         struct rchan_buf *buf,
-                                         int *is_global);
-
-       /*
-        * remove_buf_file - remove file representing a relayfs channel buffer
-        * @dentry: the dentry of the file to remove
-        *
-        * Called during relay_close(), once for each per-cpu buffer,
-        * to allow the client to remove a file used to represent a
-        * channel buffer.
-        *
-        * The callback should return 0 if successful, negative if not.
-        */
-       int (*remove_buf_file)(struct dentry *dentry);
-};
-
-/*
- * relayfs kernel API, fs/relayfs/relay.c
- */
-
-struct rchan *relay_open(const char *base_filename,
-                        struct dentry *parent,
-                        size_t subbuf_size,
-                        size_t n_subbufs,
-                        struct rchan_callbacks *cb);
-extern void relay_close(struct rchan *chan);
-extern void relay_flush(struct rchan *chan);
-extern void relay_subbufs_consumed(struct rchan *chan,
-                                  unsigned int cpu,
-                                  size_t consumed);
-extern void relay_reset(struct rchan *chan);
-extern int relay_buf_full(struct rchan_buf *buf);
-
-extern size_t relay_switch_subbuf(struct rchan_buf *buf,
-                                 size_t length);
-extern struct dentry *relayfs_create_dir(const char *name,
-                                        struct dentry *parent);
-extern int relayfs_remove_dir(struct dentry *dentry);
-extern struct dentry *relayfs_create_file(const char *name,
-                                         struct dentry *parent,
-                                         int mode,
-                                         struct file_operations *fops,
-                                         void *data);
-extern int relayfs_remove_file(struct dentry *dentry);
-
-/**
- *     relay_write - write data into the channel
- *     @chan: relay channel
- *     @data: data to be written
- *     @length: number of bytes to write
- *
- *     Writes data into the current cpu's channel buffer.
- *
- *     Protects the buffer by disabling interrupts.  Use this
- *     if you might be logging from interrupt context.  Try
- *     __relay_write() if you know you won't be logging from
- *     interrupt context.
- */
-static inline void relay_write(struct rchan *chan,
-                              const void *data,
-                              size_t length)
-{
-       unsigned long flags;
-       struct rchan_buf *buf;
-
-       local_irq_save(flags);
-       buf = chan->buf[smp_processor_id()];
-       if (unlikely(buf->offset + length > chan->subbuf_size))
-               length = relay_switch_subbuf(buf, length);
-       memcpy(buf->data + buf->offset, data, length);
-       buf->offset += length;
-       local_irq_restore(flags);
-}
-
-/**
- *     __relay_write - write data into the channel
- *     @chan: relay channel
- *     @data: data to be written
- *     @length: number of bytes to write
- *
- *     Writes data into the current cpu's channel buffer.
- *
- *     Protects the buffer by disabling preemption.  Use
- *     relay_write() if you might be logging from interrupt
- *     context.
- */
-static inline void __relay_write(struct rchan *chan,
-                                const void *data,
-                                size_t length)
-{
-       struct rchan_buf *buf;
-
-       buf = chan->buf[get_cpu()];
-       if (unlikely(buf->offset + length > buf->chan->subbuf_size))
-               length = relay_switch_subbuf(buf, length);
-       memcpy(buf->data + buf->offset, data, length);
-       buf->offset += length;
-       put_cpu();
-}
-
-/**
- *     relay_reserve - reserve slot in channel buffer
- *     @chan: relay channel
- *     @length: number of bytes to reserve
- *
- *     Returns pointer to reserved slot, NULL if full.
- *
- *     Reserves a slot in the current cpu's channel buffer.
- *     Does not protect the buffer at all - caller must provide
- *     appropriate synchronization.
- */
-static inline void *relay_reserve(struct rchan *chan, size_t length)
-{
-       void *reserved;
-       struct rchan_buf *buf = chan->buf[smp_processor_id()];
-
-       if (unlikely(buf->offset + length > buf->chan->subbuf_size)) {
-               length = relay_switch_subbuf(buf, length);
-               if (!length)
-                       return NULL;
-       }
-       reserved = buf->data + buf->offset;
-       buf->offset += length;
-
-       return reserved;
-}
-
-/**
- *     subbuf_start_reserve - reserve bytes at the start of a sub-buffer
- *     @buf: relay channel buffer
- *     @length: number of bytes to reserve
- *
- *     Helper function used to reserve bytes at the beginning of
- *     a sub-buffer in the subbuf_start() callback.
- */
-static inline void subbuf_start_reserve(struct rchan_buf *buf,
-                                       size_t length)
-{
-       BUG_ON(length >= buf->chan->subbuf_size - 1);
-       buf->offset = length;
-}
-
-/*
- * exported relay file operations, fs/relayfs/inode.c
- */
-extern struct file_operations relay_file_operations;
-
-#endif /* _LINUX_RELAYFS_FS_H */
-
index 72b9af4c3fd48e822fb28a8d3d025115fc82ff62..f63d8342ffa342a813c5b2bc10f89a54f00f801a 100644 (file)
  */
  
 struct device;
-extern int register_sound_special(struct file_operations *fops, int unit);
-extern int register_sound_special_device(struct file_operations *fops, int unit, struct device *dev);
-extern int register_sound_mixer(struct file_operations *fops, int dev);
-extern int register_sound_midi(struct file_operations *fops, int dev);
-extern int register_sound_dsp(struct file_operations *fops, int dev);
-extern int register_sound_synth(struct file_operations *fops, int dev);
+extern int register_sound_special(const struct file_operations *fops, int unit);
+extern int register_sound_special_device(const struct file_operations *fops, int unit, struct device *dev);
+extern int register_sound_mixer(const struct file_operations *fops, int dev);
+extern int register_sound_midi(const struct file_operations *fops, int dev);
+extern int register_sound_dsp(const struct file_operations *fops, int dev);
+extern int register_sound_synth(const struct file_operations *fops, int dev);
 
 extern void unregister_sound_special(int unit);
 extern void unregister_sound_mixer(int unit);
index 0d6ed3c8bdc4c75811a3442e2495f70088afdab0..d93c24b47f3f4ceb82b3fd21d20c52c795e4c174 100644 (file)
@@ -50,7 +50,7 @@ struct proc_dir_entry *       rpc_proc_register(struct rpc_stat *);
 void                   rpc_proc_unregister(const char *);
 void                   rpc_proc_zero(struct rpc_program *);
 struct proc_dir_entry *        svc_proc_register(struct svc_stat *,
-                                         struct file_operations *);
+                                         const struct file_operations *);
 void                   svc_proc_unregister(const char *);
 
 void                   svc_seq_show(struct seq_file *,
@@ -65,7 +65,7 @@ static inline void rpc_proc_unregister(const char *p) {}
 static inline void rpc_proc_zero(struct rpc_program *p) {}
 
 static inline struct proc_dir_entry *svc_proc_register(struct svc_stat *s,
-                                                      struct file_operations *f) { return NULL; }
+                                                      const struct file_operations *f) { return NULL; }
 static inline void svc_proc_unregister(const char *p) {}
 
 static inline void svc_seq_show(struct seq_file *seq,
index 1b7cd8d1a71b0e107651a1dce30ec303d3b0ae7b..2993302f792391afe961826389c55f7fe3824af5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * SyncLink Multiprotocol Serial Adapter Driver
  *
- * $Id: synclink.h,v 3.10 2005/11/08 19:50:54 paulkf Exp $
+ * $Id: synclink.h,v 3.11 2006/02/06 21:20:29 paulkf Exp $
  *
  * Copyright (C) 1998-2000 by Microgate Corporation
  *
@@ -221,6 +221,12 @@ struct mgsl_icount {
        __u32   rxidle;
 };
 
+struct gpio_desc {
+       __u32 state;
+       __u32 smask;
+       __u32 dir;
+       __u32 dmask;
+};
 
 #define DEBUG_LEVEL_DATA       1
 #define DEBUG_LEVEL_ERROR      2
@@ -276,5 +282,8 @@ struct mgsl_icount {
 #define MGSL_IOCLOOPTXDONE     _IO(MGSL_MAGIC_IOC,9)
 #define MGSL_IOCSIF            _IO(MGSL_MAGIC_IOC,10)
 #define MGSL_IOCGIF            _IO(MGSL_MAGIC_IOC,11)
+#define MGSL_IOCSGPIO          _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
+#define MGSL_IOCGGPIO          _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
+#define MGSL_IOCWAITGPIO       _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
 
 #endif /* _SYNCLINK_H_ */
index b0ffe4356e5a60c8a7e74101ae45053fcc44b8d6..843aeaaa79d4a4cb8d68b21ff1518bfe1b8283aa 100644 (file)
@@ -895,7 +895,7 @@ extern void ufs_set_link(struct inode *, struct ufs_dir_entry *, struct buffer_h
 
 /* file.c */
 extern struct inode_operations ufs_file_inode_operations;
-extern struct file_operations ufs_file_operations;
+extern const struct file_operations ufs_file_operations;
 
 extern struct address_space_operations ufs_aops;
 
@@ -915,7 +915,7 @@ extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
 extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create);
 
 /* namei.c */
-extern struct file_operations ufs_dir_operations;
+extern const struct file_operations ufs_dir_operations;
         
 /* super.c */
 extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
index 130d125fda12282509268be224ac76c73afd3d40..e34e5e3dce529bff49f09e1565471d7d9c657c85 100644 (file)
@@ -615,7 +615,7 @@ extern struct bus_type usb_bus_type;
  */
 struct usb_class_driver {
        char *name;
-       struct file_operations *fops;
+       const struct file_operations *fops;
        int minor_base;
 };
 
index 2275bfec5b687e3c7545fc848346cc14a16d2ccc..af2d6155d3fe21208c8f03e33b3742f35425a71e 100644 (file)
@@ -75,7 +75,7 @@ struct video_device
        int minor;
 
        /* device ops + callbacks */
-       struct file_operations *fops;
+       const struct file_operations *fops;
        void (*release)(struct video_device *vfd);
 
 
index 144bdc2f217fab4aa814c2cdc5ee75d65c13af4a..7f32c12b4a0a6313d0751863c5b92e394dd41534 100644 (file)
@@ -186,7 +186,7 @@ struct snd_minor {
        int type;                       /* SNDRV_DEVICE_TYPE_XXX */
        int card;                       /* card number */
        int device;                     /* device number */
-       struct file_operations *f_ops;  /* file operations */
+       const struct file_operations *f_ops;    /* file operations */
        void *private_data;             /* private data for f_ops->open */
        char name[0];                   /* device name (keep at the end of
                                                                structure) */
@@ -200,14 +200,14 @@ extern int snd_ecards_limit;
 void snd_request_card(int card);
 
 int snd_register_device(int type, struct snd_card *card, int dev,
-                       struct file_operations *f_ops, void *private_data,
+                       const struct file_operations *f_ops, void *private_data,
                        const char *name);
 int snd_unregister_device(int type, struct snd_card *card, int dev);
 void *snd_lookup_minor_data(unsigned int minor, int type);
 
 #ifdef CONFIG_SND_OSSEMUL
 int snd_register_oss_device(int type, struct snd_card *card, int dev,
-                           struct file_operations *f_ops, void *private_data,
+                           const struct file_operations *f_ops, void *private_data,
                            const char *name);
 int snd_unregister_oss_device(int type, struct snd_card *card, int dev);
 void *snd_lookup_oss_minor_data(unsigned int minor, int type);
index 64466ea1984c9d1b69f5e7d0a0183e72a07dbfa4..4a2f0898dda1d00bd0dcdeeb2d545007382f3dd3 100644 (file)
@@ -341,7 +341,7 @@ static void __init setup_per_cpu_areas(void)
 #endif
        ptr = alloc_bootmem(size * nr_possible_cpus);
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                __per_cpu_offset[i] = ptr - __per_cpu_start;
                memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
                ptr += size;
index 532ec3bf18d6f6920792c09a4ceebd0e624c852d..41ecbd440feda782dd3ac9949632458c16fd4de8 100644 (file)
@@ -762,7 +762,7 @@ out_unlock:
  * The receiver accepts the message and returns without grabbing the queue
  * spinlock. Therefore an intermediate STATE_PENDING state and memory barriers
  * are necessary. The same algorithm is used for sysv semaphores, see
- * ipc/sem.c fore more details.
+ * ipc/sem.c for more details.
  *
  * The same algorithm is used for senders.
  */
index 9c077cf9aa84b81c0da8d87450b6fb491b3a231f..54274fc853216d7448762c78e37ac0cd30d5e8f6 100644 (file)
@@ -137,5 +137,6 @@ asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
        if (op >= FUTEX_REQUEUE)
                val2 = (int) (unsigned long) utime;
 
-       return do_futex(uaddr, op, val, timeout, uaddr2, val2, val3);
+       return do_futex((unsigned long)uaddr, op, val, timeout,
+                       (unsigned long)uaddr2, val2, val3);
 }
index 4fafd58038a03ad6a36ab9265bcbbd1093bdea83..bd088a7c1499e8872a0fea69c7f65f17e987518d 100644 (file)
@@ -127,7 +127,7 @@ extern const unsigned long __start___kcrctab_gpl_future[];
 #ifndef CONFIG_MODVERSIONS
 #define symversion(base, idx) NULL
 #else
-#define symversion(base, idx) ((base) ? ((base) + (idx)) : NULL)
+#define symversion(base, idx) ((base != NULL) ? ((base) + (idx)) : NULL)
 #endif
 
 /* lookup symbol in given range of kernel_symbols */
index 9de637a5c8bc920df2875910d29aba8dc0b4e3bb..af43ecdc8d9b21b21599bd1f3c8a063bc5c43100 100644 (file)
@@ -31,7 +31,7 @@
 #define DEBUGP(fmt, a...)
 #endif
 
-static inline int dash2underscore(char c)
+static inline char dash2underscore(char c)
 {
        if (c == '-')
                return '_';
index b4b362b5baf5a6ccd101f13ab39f3c5043352b33..8154e7589d1284a7f96b1aa3b587ab2ffc01c299 100644 (file)
@@ -301,7 +301,7 @@ rcu_torture_printk(char *page)
        long pipesummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
        long batchsummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
 
-       for_each_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
                        pipesummary[i] += per_cpu(rcu_torture_count, cpu)[i];
                        batchsummary[i] += per_cpu(rcu_torture_batch, cpu)[i];
@@ -535,7 +535,7 @@ rcu_torture_init(void)
        atomic_set(&n_rcu_torture_error, 0);
        for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++)
                atomic_set(&rcu_torture_wcount[i], 0);
-       for_each_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
                        per_cpu(rcu_torture_count, cpu)[i] = 0;
                        per_cpu(rcu_torture_batch, cpu)[i] = 0;
index 7854ee516b922b59a057a91eb88851c822ad9191..a9ecac398bb9b979a4457ea0ade69259c9e7dc53 100644 (file)
@@ -1625,7 +1625,7 @@ unsigned long nr_uninterruptible(void)
 {
        unsigned long i, sum = 0;
 
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                sum += cpu_rq(i)->nr_uninterruptible;
 
        /*
@@ -1642,7 +1642,7 @@ unsigned long long nr_context_switches(void)
 {
        unsigned long long i, sum = 0;
 
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                sum += cpu_rq(i)->nr_switches;
 
        return sum;
@@ -1652,7 +1652,7 @@ unsigned long nr_iowait(void)
 {
        unsigned long i, sum = 0;
 
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                sum += atomic_read(&cpu_rq(i)->nr_iowait);
 
        return sum;
@@ -6080,7 +6080,7 @@ void __init sched_init(void)
        runqueue_t *rq;
        int i, j, k;
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                prio_array_t *array;
 
                rq = cpu_rq(i);
index 4f71cfd29c6fa4859c151442176434f48aec748d..dec8249e972de3cdae046203b16ef32d25d1cda9 100644 (file)
@@ -912,7 +912,7 @@ asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
        /*
         * Check if this process has the right to modify the specified
         * process. The right exists if the process has administrative
-        * capabilities, superuser priviledges or the same
+        * capabilities, superuser privileges or the same
         * userid as the target process.
         */
        if ((current->euid != task->suid) && (current->euid != task->uid) &&
index 681837499d7d59fa967cd2297a250ceff6e278af..4cbf8bb135571f620ee76b9e76cdf1186ba24889 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3311,7 +3311,7 @@ void *__alloc_percpu(size_t size)
         * and we have no way of figuring out how to fix the array
         * that we have allocated then....
         */
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                int node = cpu_to_node(i);
 
                if (node_online(node))
@@ -3398,7 +3398,7 @@ void free_percpu(const void *objp)
        /*
         * We allocate for all cpus so we cannot use for online cpu here.
         */
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
            kfree(p->ptrs[i]);
        kfree(p);
 }
index 91b7e2026f696718d3a51b49d40dd660ea308047..88895c249bc901f576760a633f993c75bfcd5cf7 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -512,7 +512,7 @@ long percpu_counter_sum(struct percpu_counter *fbc)
 
        spin_lock(&fbc->lock);
        ret = fbc->count;
-       for_each_cpu(cpu) {
+       for_each_possible_cpu(cpu) {
                long *pcount = per_cpu_ptr(fbc->counters, cpu);
                ret += *pcount;
        }
index 759445648667a8e178a6b6481e8021ab73e73ca7..627b11342233d2abba2a606fcf982d93ccc57677 100644 (file)
@@ -1302,7 +1302,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
        if (sk->sk_state != TCP_ESTABLISHED)
                return -ENOTCONN;
 
-       /* Check that we don't send out to big frames */
+       /* Check that we don't send out too big frames */
        if (len > self->max_data_size) {
                IRDA_DEBUG(2, "%s(), Chopping frame from %zd to %d bytes!\n",
                           __FUNCTION__, len, self->max_data_size);
@@ -1546,7 +1546,7 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock,
        IRDA_ASSERT(self != NULL, return -1;);
 
        /*
-        * Check that we don't send out to big frames. This is an unreliable
+        * Check that we don't send out too big frames. This is an unreliable
         * service, so we have no fragmentation and no coalescence
         */
        if (len > self->max_data_size) {
@@ -1642,7 +1642,7 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock,
        }
 
        /*
-        * Check that we don't send out to big frames. This is an unreliable
+        * Check that we don't send out too big frames. This is an unreliable
         * service, so we have no fragmentation and no coalescence
         */
        if (len > self->max_data_size) {
index 1230f0ae832e9d52bdd50e4411a56e0ebd795510..92e76640c7cd65146dd6aed382698174f7a0f2a2 100644 (file)
@@ -19,7 +19,7 @@ static int sock_no_open(struct inode *irrelevant, struct file *dontcare)
        return -ENXIO;
 }
 
-struct file_operations bad_sock_fops = {
+const struct file_operations bad_sock_fops = {
        .owner = THIS_MODULE,
        .open = sock_no_open,
 };
index 5211ba2703751fe2a19b2fc5a2f1acd17f864d30..fcd77eac0ccff184294eab4888e3ff61ad35d168 100644 (file)
@@ -539,7 +539,7 @@ static int sock_no_open(struct inode *irrelevant, struct file *dontcare)
        return -ENXIO;
 }
 
-struct file_operations bad_sock_fops = {
+const struct file_operations bad_sock_fops = {
        .owner = THIS_MODULE,
        .open = sock_no_open,
 };
index aa4158be9900479ca1a152557e9686d2efc57af2..cc673dd8433fd3653d66100e460acf7cdfac60ac 100644 (file)
@@ -395,7 +395,7 @@ enum {
  */
 struct rpc_filelist {
        char *name;
-       struct file_operations *i_fop;
+       const struct file_operations *i_fop;
        int mode;
 };
 
index 790941e8af4daf6b77d6c549d6cba2c11c7d44ac..dea529666d6991077aa69deaecad2818033def0c 100644 (file)
@@ -225,7 +225,7 @@ EXPORT_SYMBOL(rpc_print_iostats);
  * Register/unregister RPC proc files
  */
 static inline struct proc_dir_entry *
-do_register(const char *name, void *data, struct file_operations *fops)
+do_register(const char *name, void *data, const struct file_operations *fops)
 {
        struct proc_dir_entry *ent;
 
@@ -253,7 +253,7 @@ rpc_proc_unregister(const char *name)
 }
 
 struct proc_dir_entry *
-svc_proc_register(struct svc_stat *statp, struct file_operations *fops)
+svc_proc_register(struct svc_stat *statp, const struct file_operations *fops)
 {
        return do_register(statp->program->pg_name, statp, fops);
 }
index ad68761abba1a86eb9dd9fa16d0c495ecb428d84..5bb8a8b23d5191fe53516a754ba8a775271ce77c 100644 (file)
@@ -223,7 +223,8 @@ int snd_card_disconnect(struct snd_card *card)
        struct snd_monitor_file *mfile;
        struct file *file;
        struct snd_shutdown_f_ops *s_f_ops;
-       struct file_operations *f_ops, *old_f_ops;
+       struct file_operations *f_ops;
+       const struct file_operations *old_f_ops;
        int err;
 
        spin_lock(&card->files_lock);
index 6b7a3677429891c041fd77a6108dbce0b614c87f..87b47c9564f78029ad6ceaaaf0e8b700fdcbb5d5 100644 (file)
@@ -631,7 +631,8 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
                return -EINVAL;
        }
        if (params->buffer_size != runtime->buffer_size) {
-               if ((newbuf = (char *) kmalloc(params->buffer_size, GFP_KERNEL)) == NULL)
+               newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
+               if (!newbuf)
                        return -ENOMEM;
                kfree(runtime->buffer);
                runtime->buffer = newbuf;
@@ -657,7 +658,8 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
                return -EINVAL;
        }
        if (params->buffer_size != runtime->buffer_size) {
-               if ((newbuf = (char *) kmalloc(params->buffer_size, GFP_KERNEL)) == NULL)
+               newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
+               if (!newbuf)
                        return -ENOMEM;
                kfree(runtime->buffer);
                runtime->buffer = newbuf;
index 4d28e52126118bbc57659825ac6b93579de18a88..108e430b50362dc10f65f97e73ecdc0992d93b62 100644 (file)
@@ -137,7 +137,7 @@ static int snd_open(struct inode *inode, struct file *file)
 {
        unsigned int minor = iminor(inode);
        struct snd_minor *mptr = NULL;
-       struct file_operations *old_fops;
+       const struct file_operations *old_fops;
        int err = 0;
 
        if (minor >= ARRAY_SIZE(snd_minors))
@@ -240,7 +240,7 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev)
  * Retrurns zero if successful, or a negative error code on failure.
  */
 int snd_register_device(int type, struct snd_card *card, int dev,
-                       struct file_operations *f_ops, void *private_data,
+                       const struct file_operations *f_ops, void *private_data,
                        const char *name)
 {
        int minor;
index 4023d3b406de2c22613bcfc6811e4c83193584cd..9055c6de95875d4b199dce59b0db0b1fe5737ed6 100644 (file)
@@ -95,7 +95,7 @@ static int snd_oss_kernel_minor(int type, struct snd_card *card, int dev)
 }
 
 int snd_register_oss_device(int type, struct snd_card *card, int dev,
-                           struct file_operations *f_ops, void *private_data,
+                           const struct file_operations *f_ops, void *private_data,
                            const char *name)
 {
        int minor = snd_oss_kernel_minor(type, card, dev);
index 6ba8d6f45fe848ecbcf288a46f3410fc51cd88ba..3bbc8105e9f10dfedcf362fc86c3361609590d90 100644 (file)
@@ -2798,7 +2798,7 @@ __init setup_beep(void)
                        DBDMA_ALIGN(beep_dbdma_cmd_space);
        /* set up emergency dbdma cmd */
        emergency_dbdma_cmd = beep_dbdma_cmd+1 ;
-       beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
+       beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
        if (beep_buf == NULL) {
                printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n");
                kfree(beep_dbdma_cmd_space) ;
index 959a96794dbad0c88bcdcdca8fb79795afda8f46..25ae8e4a488db955db707f25c4dc876ef94f3d5b 100644 (file)
@@ -65,7 +65,8 @@ static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hd
 
        init_midi_hdr(midihdr);
 
-       if ((midihdr->data = (u8 *) kmalloc(MIDIIN_BUFLEN, GFP_KERNEL)) == NULL) {
+       midihdr->data = kmalloc(MIDIIN_BUFLEN, GFP_KERNEL);
+       if (!midihdr->data) {
                ERROR();
                kfree(midihdr);
                return -1;
@@ -334,7 +335,8 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer,
        midihdr->bytesrecorded = 0;
        midihdr->flags = 0;
 
-       if ((midihdr->data = (u8 *) kmalloc(count, GFP_KERNEL)) == NULL) {
+       midihdr->data = kmalloc(count, GFP_KERNEL);
+       if (!midihdr->data) {
                ERROR();
                kfree(midihdr);
                return -EINVAL;
@@ -545,7 +547,8 @@ int emu10k1_seq_midi_out(int dev, unsigned char midi_byte)
        midihdr->bytesrecorded = 0;
        midihdr->flags = 0;
 
-       if ((midihdr->data = (u8 *) kmalloc(1, GFP_KERNEL)) == NULL) {
+       midihdr->data = kmalloc(1, GFP_KERNEL);
+       if (!midihdr->data) {
                ERROR();
                kfree(midihdr);
                return -EINVAL;
index 78d3e29ce968135d15a7d0bea3fd6fb64a52c4e3..6861563d7525edbc85e5b4e83f112ef62312553a 100644 (file)
@@ -2348,7 +2348,7 @@ static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device
        /* Recording requires 24-bit DMA, so attempt to set dma mask
         * to 24 bits first, then 32 bits (playback only) if that fails.
         */
-       if (pci_set_dma_mask(pcidev, 0x00ffffff) &&
+       if (pci_set_dma_mask(pcidev, DMA_24BIT_MASK) &&
            pci_set_dma_mask(pcidev, DMA_32BIT_MASK)) {
                printk(KERN_WARNING "solo1: architecture does not support 24bit or 32bit PCI busmaster DMA\n");
                return -ENODEV;
index 66044aff25867c885085d8334fba657c5ae1d066..4a5e4237a1106af30e0c7e08a93002bf6981e848 100644 (file)
@@ -2582,15 +2582,9 @@ static int alloc_dsp_suspendmem(struct m3_card *card)
 
     return 0;
 }
-static void free_dsp_suspendmem(struct m3_card *card)
-{
-   if(card->suspend_mem)
-       vfree(card->suspend_mem);
-}
 
 #else
 #define alloc_dsp_suspendmem(args...) 0
-#define free_dsp_suspendmem(args...) 
 #endif
 
 /*
@@ -2717,7 +2711,7 @@ out:
     if(ret) {
         if(card->iobase)
             release_region(pci_resource_start(pci_dev, 0), pci_resource_len(pci_dev, 0));
-        free_dsp_suspendmem(card);
+        vfree(card->suspend_mem);
         if(card->ac97) {
             unregister_sound_mixer(card->ac97->dev_mixer);
             kfree(card->ac97);
@@ -2760,7 +2754,7 @@ static void m3_remove(struct pci_dev *pci_dev)
         }
 
         release_region(card->iobase, 256);
-        free_dsp_suspendmem(card);
+        vfree(card->suspend_mem);
         kfree(card);
     }
     devs = NULL;
index a7ad2b0a2ac095b768bb6f9ddd7fdf65615b6654..5dbfc0f9c3c7bf32abb87475283ea4c4f21c65b9 100644 (file)
@@ -95,10 +95,8 @@ void msnd_fifo_init(msnd_fifo *f)
 
 void msnd_fifo_free(msnd_fifo *f)
 {
-       if (f->data) {
-               vfree(f->data);
-               f->data = NULL;
-       }
+       vfree(f->data);
+       f->data = NULL;
 }
 
 int msnd_fifo_alloc(msnd_fifo *f, size_t n)
index d38e88abc8fac32510159d8d885e6cb78ad2d3fa..4708cbdc31497edded137e77ed4fc1b181856861 100644 (file)
@@ -348,10 +348,8 @@ static void __exit sb_exit(void)
 
        sb_unregister_all();
 
-       if (smw_free) {
-               vfree(smw_free);
-               smw_free = NULL;
-       }
+       vfree(smw_free);
+       smw_free = NULL;
 }
 
 module_init(sb_init);
index 347cd79c2502aa23b5af9ad62b4f81ce32cfb705..6815c30e0bc1be68fd9589040b167499b5b2cde5 100644 (file)
@@ -1671,14 +1671,7 @@ void sequencer_init(void)
 
 void sequencer_unload(void)
 {
-       if(queue)
-       {
-               vfree(queue);
-               queue=NULL;
-       }
-       if(iqueue)
-       {
-               vfree(iqueue);
-               iqueue=NULL;
-       }
+       vfree(queue);
+       vfree(iqueue);
+       queue = iqueue = NULL;
 }
index 8a9917c919c2e60cc00b06908f61d855bb184f3c..3f7427cd195a03358ca5fc136d24690177c38ae1 100644 (file)
@@ -289,7 +289,7 @@ static int __init dac_audio_init(void)
 
        in_use = 0;
 
-       data_buffer = (char *)kmalloc(BUFFER_SIZE, GFP_KERNEL);
+       data_buffer = kmalloc(BUFFER_SIZE, GFP_KERNEL);
        if (data_buffer == NULL)
                return -ENOMEM;
 
index 4471757b798588be35e2767bb244fe21fcb51e9f..42bd276cfc39081482eeeb6468d5052e9e5f8adb 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/gameport.h>
+#include <linux/dma-mapping.h>
 #include <linux/mutex.h>
 
 
@@ -2535,7 +2536,7 @@ static int __devinit sv_probe(struct pci_dev *pcidev, const struct pci_device_id
                return -ENODEV;
        if (pcidev->irq == 0)
                return -ENODEV;
-       if (pci_set_dma_mask(pcidev, 0x00ffffff)) {
+       if (pci_set_dma_mask(pcidev, DMA_24BIT_MASK)) {
                printk(KERN_WARNING "sonicvibes: architecture does not support 24bit PCI busmaster DMA\n");
                return -ENODEV;
        }
index 2aa5a7fdb6e067e7b95da311aedaab7015093a94..c6c8333acc6216176440a7f9e9a9aecf33c1dc48 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/interrupt.h>
 #include <linux/compiler.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 
 #include <sound/driver.h>
 #include <sound/core.h>
index e264136e8fb44ad9508851158c9079c0ff80805b..fc92b6896c247c78e947d5b229d1c5202ed3da46 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/moduleparam.h>
+#include <linux/dma-mapping.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/info.h>
@@ -2220,8 +2221,8 @@ static int __devinit snd_ali_create(struct snd_card *card,
        if ((err = pci_enable_device(pci)) < 0)
                return err;
        /* check, if we can restrict PCI DMA transfers to 31 bits */
-       if (pci_set_dma_mask(pci, 0x7fffffff) < 0 ||
-           pci_set_consistent_dma_mask(pci, 0x7fffffff) < 0) {
+       if (pci_set_dma_mask(pci, DMA_31BIT_MASK) < 0 ||
+           pci_set_consistent_dma_mask(pci, DMA_31BIT_MASK) < 0) {
                snd_printk(KERN_ERR "architecture does not support 31bit PCI busmaster DMA\n");
                pci_disable_device(pci);
                return -ENXIO;
index 7b2ff5f4672e27c721430badb24394a888e8548f..100d8127a41118805a936b5561d53fc01d245188 100644 (file)
@@ -70,6 +70,7 @@
 #include <linux/slab.h>
 #include <linux/gameport.h>
 #include <linux/moduleparam.h>
+#include <linux/dma-mapping.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/rawmidi.h>
@@ -688,8 +689,8 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
                return err;
        }
        /* check, if we can restrict PCI DMA transfers to 24 bits */
-       if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
-           pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
+       if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 ||
+           pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) {
                snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n");
                pci_disable_device(pci);
                return -ENXIO;
index e077eb3fbe2f42e305f6b260ac7c59f29772e916..680077e1e0576eb9a660191fa66ca65451e05aa7 100644 (file)
 #include <linux/slab.h>
 #include <linux/gameport.h>
 #include <linux/moduleparam.h>
+#include <linux/dma-mapping.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
@@ -1669,8 +1670,8 @@ snd_azf3328_create(struct snd_card *card,
        chip->irq = -1;
 
        /* check if we can restrict PCI DMA transfers to 24 bits */
-       if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
-           pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
+       if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 ||
+           pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) {
                snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n");
                err = -ENXIO;
                goto out_err;
index 2208dbd48be97bbd99c6d1141cf831827b421c72..3e332f3981627372cc7e4ca78f1490a4e4c5d4d3 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
 #include <linux/moduleparam.h>
+#include <linux/dma-mapping.h>
 #include <sound/core.h>
 #include <sound/initval.h>
 #include <sound/pcm.h>
index 0d556b09ad046773818ecdb82b60c4dc0adb93bb..4d62fe439177a0149b65ecc28b4e7a4cf239882d 100644 (file)
@@ -55,6 +55,7 @@
 #include <linux/gameport.h>
 #include <linux/moduleparam.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
@@ -1517,8 +1518,8 @@ static int __devinit snd_es1938_create(struct snd_card *card,
        if ((err = pci_enable_device(pci)) < 0)
                return err;
         /* check, if we can restrict PCI DMA transfers to 24 bits */
-       if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
-           pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
+       if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 ||
+           pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) {
                snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n");
                pci_disable_device(pci);
                 return -ENXIO;
index dd465a186e119eb6233aa8268fb3fd2123c1560e..e3ad17f53c2997e9e1147c37025f4c0b7dabd2d2 100644 (file)
 #include <linux/slab.h>
 #include <linux/gameport.h>
 #include <linux/moduleparam.h>
+#include <linux/dma-mapping.h>
 #include <linux/mutex.h>
 
 #include <sound/core.h>
index 672e198317e1c4fc75a898331e7b65188dd30c25..b88eeba2f5d1d2f7cf0389642325417a9174b195 100644 (file)
@@ -56,7 +56,9 @@
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
 #include <linux/moduleparam.h>
+#include <linux/dma-mapping.h>
 #include <linux/mutex.h>
+
 #include <sound/core.h>
 #include <sound/cs8427.h>
 #include <sound/info.h>
index 8bc084956c2849026491b4fecc57e78835fde09a..44393e19092951ca1c775172f50dada8dea08978 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/moduleparam.h>
+#include <linux/dma-mapping.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/control.h>
index 43ee3b2b948f95e69df97709707c240359268050..b5a095052d4c99bd532eb5b93637220280fc8d44 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/dma-mapping.h>
 #include <linux/moduleparam.h>
 #include <linux/mutex.h>
+#include <linux/dma-mapping.h>
+
 #include <sound/core.h>
 #include <sound/initval.h>
 #include <sound/info.h>
index f679779d96e3b6c4135862feba645999e60e5919..35875c8aa2990fde3fbed9f7f6fcbed2dacc877f 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/delay.h>
 #include <linux/moduleparam.h>
 #include <linux/mutex.h>
+#include <linux/dma-mapping.h>
 
 #include <sound/core.h>
 #include <sound/initval.h>
index 0cbef5fe6c63c4519899799efb4ddd79c1897a2e..ab78544bf04238a01e90a5f7ba45d5863fa5dc20 100644 (file)
@@ -313,7 +313,7 @@ static int snd_rme32_capture_copy(struct snd_pcm_substream *substream, int chann
 }
 
 /*
- * SPDIF I/O capabilites (half-duplex mode)
+ * SPDIF I/O capabilities (half-duplex mode)
  */
 static struct snd_pcm_hardware snd_rme32_spdif_info = {
        .info =         (SNDRV_PCM_INFO_MMAP_IOMEM |
@@ -339,7 +339,7 @@ static struct snd_pcm_hardware snd_rme32_spdif_info = {
 };
 
 /*
- * ADAT I/O capabilites (half-duplex mode)
+ * ADAT I/O capabilities (half-duplex mode)
  */
 static struct snd_pcm_hardware snd_rme32_adat_info =
 {
@@ -364,7 +364,7 @@ static struct snd_pcm_hardware snd_rme32_adat_info =
 };
 
 /*
- * SPDIF I/O capabilites (full-duplex mode)
+ * SPDIF I/O capabilities (full-duplex mode)
  */
 static struct snd_pcm_hardware snd_rme32_spdif_fd_info = {
        .info =         (SNDRV_PCM_INFO_MMAP |
@@ -390,7 +390,7 @@ static struct snd_pcm_hardware snd_rme32_spdif_fd_info = {
 };
 
 /*
- * ADAT I/O capabilites (full-duplex mode)
+ * ADAT I/O capabilities (full-duplex mode)
  */
 static struct snd_pcm_hardware snd_rme32_adat_fd_info =
 {
index 0e694b011dcc66b424097805cdea5fc37a241d08..6c2a9f4a765924066a06deb47d886315da5f7255 100644 (file)
@@ -359,7 +359,7 @@ snd_rme96_capture_copy(struct snd_pcm_substream *substream,
 }
 
 /*
- * Digital output capabilites (S/PDIF)
+ * Digital output capabilities (S/PDIF)
  */
 static struct snd_pcm_hardware snd_rme96_playback_spdif_info =
 {
@@ -388,7 +388,7 @@ static struct snd_pcm_hardware snd_rme96_playback_spdif_info =
 };
 
 /*
- * Digital input capabilites (S/PDIF)
+ * Digital input capabilities (S/PDIF)
  */
 static struct snd_pcm_hardware snd_rme96_capture_spdif_info =
 {
@@ -417,7 +417,7 @@ static struct snd_pcm_hardware snd_rme96_capture_spdif_info =
 };
 
 /*
- * Digital output capabilites (ADAT)
+ * Digital output capabilities (ADAT)
  */
 static struct snd_pcm_hardware snd_rme96_playback_adat_info =
 {
@@ -442,7 +442,7 @@ static struct snd_pcm_hardware snd_rme96_playback_adat_info =
 };
 
 /*
- * Digital input capabilites (ADAT)
+ * Digital input capabilities (ADAT)
  */
 static struct snd_pcm_hardware snd_rme96_capture_adat_info =
 {
index 980b9cd689dd1569b58014bc346af6c871ef4734..b5538efd146b1eb6fff9ef5df626774e4ea8fe0a 100644 (file)
@@ -2256,7 +2256,7 @@ static int snd_hdspm_create_controls(struct snd_card *card, struct hdspm * hdspm
        }
 
        /* Channel playback mixer as default control 
-          Note: the whole matrix would be 128*HDSPM_MIXER_CHANNELS Faders, thats to big for any alsamixer 
+          Note: the whole matrix would be 128*HDSPM_MIXER_CHANNELS Faders, thats too big for any alsamixer
           they are accesible via special IOCTL on hwdep
           and the mixer 2dimensional mixer control */
 
index 7bbea3738b8aee1f1418152ebd19abddb9076c6e..2d66a09fe5ee3deca6a9de1bebe576fbb1ea9be9 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/slab.h>
 #include <linux/gameport.h>
 #include <linux/moduleparam.h>
+#include <linux/dma-mapping.h>
 
 #include <sound/core.h>
 #include <sound/pcm.h>
@@ -1227,8 +1228,8 @@ static int __devinit snd_sonicvibes_create(struct snd_card *card,
        if ((err = pci_enable_device(pci)) < 0)
                return err;
        /* check, if we can restrict PCI DMA transfers to 24 bits */
-        if (pci_set_dma_mask(pci, 0x00ffffff) < 0 ||
-           pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) {
+        if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 ||
+           pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) {
                snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n");
                pci_disable_device(pci);
                 return -ENXIO;
index 83b7d8aba9e61f52329628243369f89039d096fe..52178b8ad49d93af8d172925106721b0b658c36b 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/gameport.h>
+#include <linux/dma-mapping.h>
 
 #include <sound/core.h>
 #include <sound/info.h>
@@ -3554,8 +3555,8 @@ int __devinit snd_trident_create(struct snd_card *card,
        if ((err = pci_enable_device(pci)) < 0)
                return err;
        /* check, if we can restrict PCI DMA transfers to 30 bits */
-       if (pci_set_dma_mask(pci, 0x3fffffff) < 0 ||
-           pci_set_consistent_dma_mask(pci, 0x3fffffff) < 0) {
+       if (pci_set_dma_mask(pci, DMA_30BIT_MASK) < 0 ||
+           pci_set_consistent_dma_mask(pci, DMA_30BIT_MASK) < 0) {
                snd_printk(KERN_ERR "architecture does not support 30bit PCI busmaster DMA\n");
                pci_disable_device(pci);
                return -ENXIO;
index 394b53e20cb8bd36532f23ba14078a67120759f4..6f849720aef35fa08552dc1bc8e16fc84383e0aa 100644 (file)
@@ -53,7 +53,7 @@
 struct sound_unit
 {
        int unit_minor;
-       struct file_operations *unit_fops;
+       const struct file_operations *unit_fops;
        struct sound_unit *next;
        char name[32];
 };
@@ -73,7 +73,7 @@ EXPORT_SYMBOL(sound_class);
  *     join into it. Called with the lock asserted
  */
 
-static int __sound_insert_unit(struct sound_unit * s, struct sound_unit **list, struct file_operations *fops, int index, int low, int top)
+static int __sound_insert_unit(struct sound_unit * s, struct sound_unit **list, const struct file_operations *fops, int index, int low, int top)
 {
        int n=low;
 
@@ -153,7 +153,7 @@ static DEFINE_SPINLOCK(sound_loader_lock);
  *     list. Acquires locks as needed
  */
 
-static int sound_insert_unit(struct sound_unit **list, struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode, struct device *dev)
+static int sound_insert_unit(struct sound_unit **list, const struct file_operations *fops, int index, int low, int top, const char *name, umode_t mode, struct device *dev)
 {
        struct sound_unit *s = kmalloc(sizeof(*s), GFP_KERNEL);
        int r;
@@ -237,7 +237,7 @@ static struct sound_unit *chains[SOUND_STEP];
  *     a negative error code is returned.
  */
  
-int register_sound_special_device(struct file_operations *fops, int unit,
+int register_sound_special_device(const struct file_operations *fops, int unit,
                                  struct device *dev)
 {
        const int chain = unit % SOUND_STEP;
@@ -301,7 +301,7 @@ int register_sound_special_device(struct file_operations *fops, int unit,
  
 EXPORT_SYMBOL(register_sound_special_device);
 
-int register_sound_special(struct file_operations *fops, int unit)
+int register_sound_special(const struct file_operations *fops, int unit)
 {
        return register_sound_special_device(fops, unit, NULL);
 }
@@ -318,7 +318,7 @@ EXPORT_SYMBOL(register_sound_special);
  *     number is returned, on failure a negative error code is returned.
  */
 
-int register_sound_mixer(struct file_operations *fops, int dev)
+int register_sound_mixer(const struct file_operations *fops, int dev)
 {
        return sound_insert_unit(&chains[0], fops, dev, 0, 128,
                                 "mixer", S_IRUSR | S_IWUSR, NULL);
@@ -336,7 +336,7 @@ EXPORT_SYMBOL(register_sound_mixer);
  *     number is returned, on failure a negative error code is returned.
  */
 
-int register_sound_midi(struct file_operations *fops, int dev)
+int register_sound_midi(const struct file_operations *fops, int dev)
 {
        return sound_insert_unit(&chains[2], fops, dev, 2, 130,
                                 "midi", S_IRUSR | S_IWUSR, NULL);
@@ -362,7 +362,7 @@ EXPORT_SYMBOL(register_sound_midi);
  *     and will always allocate them as a matching pair - eg dsp3/audio3
  */
 
-int register_sound_dsp(struct file_operations *fops, int dev)
+int register_sound_dsp(const struct file_operations *fops, int dev)
 {
        return sound_insert_unit(&chains[3], fops, dev, 3, 131,
                                 "dsp", S_IWUSR | S_IRUSR, NULL);
@@ -381,7 +381,7 @@ EXPORT_SYMBOL(register_sound_dsp);
  */
 
 
-int register_sound_synth(struct file_operations *fops, int dev)
+int register_sound_synth(const struct file_operations *fops, int dev)
 {
        return sound_insert_unit(&chains[9], fops, dev, 9, 137,
                                 "synth", S_IRUSR | S_IWUSR, NULL);
@@ -501,7 +501,7 @@ int soundcore_open(struct inode *inode, struct file *file)
        int chain;
        int unit = iminor(inode);
        struct sound_unit *s;
-       struct file_operations *new_fops = NULL;
+       const struct file_operations *new_fops = NULL;
 
        chain=unit&0x0F;
        if(chain==4 || chain==5)        /* dsp/audio/dsp16 */
@@ -540,7 +540,7 @@ int soundcore_open(struct inode *inode, struct file *file)
                 * switching ->f_op in the first place.
                 */
                int err = 0;
-               struct file_operations *old_fops = file->f_op;
+               const struct file_operations *old_fops = file->f_op;
                file->f_op = new_fops;
                spin_unlock(&sound_loader_lock);
                if(file->f_op->open)
index 315855082fe181b8d9a905adde3bba9b175bd234..fe67a92e2a1a355ccbd36acb1ce2c6dcab7b2777 100644 (file)
@@ -404,7 +404,7 @@ static void usX2Y_usbpcm_subs_startup(struct snd_usX2Y_substream *subs)
        struct usX2Ydev * usX2Y = subs->usX2Y;
        usX2Y->prepare_subs = subs;
        subs->urb[0]->start_frame = -1;
-       smp_wmb();      // Make shure above modifications are seen by i_usX2Y_subs_startup()
+       smp_wmb();      // Make sure above modifications are seen by i_usX2Y_subs_startup()
        usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_subs_startup);
 }