diff options
878 files changed, 5816 insertions, 5824 deletions
diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl index ed5aa7343935..9ec317a175da 100644 --- a/Documentation/DocBook/deviceiobook.tmpl +++ b/Documentation/DocBook/deviceiobook.tmpl @@ -152,7 +152,7 @@ <para> While the basic functions are defined to be synchronous with respect to each other and ordered with respect to each other the busses the - devices sit on may themselves have asynchronocity. In paticular many + devices sit on may themselves have asynchronicity. In particular many authors are burned by the fact that PCI bus writes are posted asynchronously. A driver author must issue a read from the same device to ensure that writes have occurred in the specific cases the diff --git a/Documentation/DocBook/parportbook.tmpl b/Documentation/DocBook/parportbook.tmpl index a4b652107644..86fa32fdf959 100644 --- a/Documentation/DocBook/parportbook.tmpl +++ b/Documentation/DocBook/parportbook.tmpl @@ -1149,7 +1149,7 @@ static struct parport_driver lp_driver = { peripheral what transfer mode it would like to use, and the peripheral either accepts that mode or rejects it; if the mode is rejected, the host can try again with a different mode. This is - the negotation phase. Once the peripheral has accepted a + the negotiation phase. Once the peripheral has accepted a particular transfer mode, data transfer can begin that mode. </para> diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt index dfc23bf7f01b..f433f259b72a 100644 --- a/Documentation/block/biodoc.txt +++ b/Documentation/block/biodoc.txt @@ -1038,7 +1038,7 @@ the queue gets explicitly unplugged as part of waiting for completion, in fact all queues get unplugged as a side-effect. Aside: - This is kind of controversial territory, as its not clear if plugging is + This is kind of controversial territory, as it's not clear if plugging is always the right thing to do. Devices typically have their own queues, and allowing a big queue to build up in software, while letting the device be idle for a while may not always make sense. The trick is to handle the fine diff --git a/Documentation/fb/sstfb.txt b/Documentation/fb/sstfb.txt index b6d9d923fbb7..628d7ffa8769 100644 --- a/Documentation/fb/sstfb.txt +++ b/Documentation/fb/sstfb.txt @@ -138,7 +138,7 @@ Bugs - The driver is not your_favorite_toy-safe. this includes SMP... [Actually from inspection it seems to be safe - Alan] - when using XFree86 FBdev (X over fbdev) you may see strange color - patterns at the border of your windows (the pixels loose the lowest + patterns at the border of your windows (the pixels lose the lowest byte -> basicaly the blue component nd some of the green) . I'm unable to reproduce this with XFree86-3.3, but one of the testers has this problem with XFree86-4. apparently recent Xfree86-4.x solve this diff --git a/Documentation/filesystems/hpfs.txt b/Documentation/filesystems/hpfs.txt index 7a9f89e39312..be65317bca51 100644 --- a/Documentation/filesystems/hpfs.txt +++ b/Documentation/filesystems/hpfs.txt @@ -109,7 +109,7 @@ support is quite buggy. I have Czech OS/2 working in codepage 852 on my disk. Once I booted English OS/2 working in cp 850 and I created a file on my 852 partition. It marked file name codepage as 850 - good. But when I again booted Czech OS/2, the file was completely inaccessible under any name. It seems that -OS/2 uppercases the search pattern with it's system code page (852) and file +OS/2 uppercases the search pattern with its system code page (852) and file name it's comparing to with its code page (850). These could never match. Is it really what IBM developers wanted? But problems continued. When I created in Czech OS/2 another file in that directory, that file was inaccessible too. OS/2 diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index ab67bdd0f6dc..9557ea1846d2 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt @@ -439,7 +439,7 @@ struct dentry_operations { d_release: called when a dentry is really deallocated - d_iput: called when a dentry looses its inode (just prior to its + d_iput: called when a dentry loses its inode (just prior to its being deallocated). The default when this is NULL is that the VFS calls iput(). If you define this method, you must call iput() yourself diff --git a/Documentation/input/joystick-api.txt b/Documentation/input/joystick-api.txt index 5f86d74e7cfa..acbd32b88454 100644 --- a/Documentation/input/joystick-api.txt +++ b/Documentation/input/joystick-api.txt @@ -168,7 +168,7 @@ mentioned, or because too much time elapses from one read to another and too many events to store in the queue get generated. Note that high system load may contribute to space those reads even more. -If time between reads is enough to fill the queue and loose an event, +If time between reads is enough to fill the queue and lose an event, the driver will switch to startup mode and next time you read it, synthetic events (JS_EVENT_INIT) will be generated to inform you of the actual state of the joystick. diff --git a/Documentation/networking/decnet.txt b/Documentation/networking/decnet.txt index 9af616d3d45e..c6bd25f5d61d 100644 --- a/Documentation/networking/decnet.txt +++ b/Documentation/networking/decnet.txt @@ -42,7 +42,7 @@ worked with 2.4 will work under 2.5 with no change. 3) Command line options You can set a DECnet address on the kernel command line for compatibility -with the 2.4 configuration procedure, but in general its not needed any more. +with the 2.4 configuration procedure, but in general it's not needed any more. If you do st a DECnet address on the command line, it has only one purpose which is that its added to the addresses on the loopback device. diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c index 18e1ec074c1e..8ab614ec0f44 100644 --- a/Documentation/networking/ifenslave.c +++ b/Documentation/networking/ifenslave.c @@ -299,7 +299,7 @@ main(int argc, char **argv) else { /* attach a slave interface to the master */ /* two possibilities : - if hwaddr_notset, do nothing. The bond will assign the - hwaddr from it's first slave. + hwaddr from its first slave. - if !hwaddr_notset, assign the master's hwaddr to each slave */ diff --git a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt index 3b85618ab360..0723093cf896 100644 --- a/Documentation/networking/netdevices.txt +++ b/Documentation/networking/netdevices.txt @@ -18,7 +18,8 @@ dev->open: dev->stop: Synchronization: rtnl_lock() semaphore. Context: process - Notes: netif_running() is guaranteed false when this is called + Note1: netif_running() is guaranteed false + Note2: dev->poll() is guaranteed to be stopped dev->do_ioctl: Synchronization: rtnl_lock() semaphore. @@ -31,10 +32,12 @@ dev->get_stats: dev->hard_start_xmit: Synchronization: dev->xmit_lock spinlock. Context: BHs disabled + Notes: netif_queue_stopped() is guaranteed false dev->tx_timeout: Synchronization: dev->xmit_lock spinlock. Context: BHs disabled + Notes: netif_queue_stopped() is guaranteed true dev->set_multicast_list: Synchronization: dev->xmit_lock spinlock. diff --git a/Documentation/networking/sk98lin.txt b/Documentation/networking/sk98lin.txt index 170e3fc40d43..b0220f4dc19d 100644 --- a/Documentation/networking/sk98lin.txt +++ b/Documentation/networking/sk98lin.txt @@ -187,7 +187,7 @@ which you set the parameter (A or B). this port is not "Sense". If autonegotiation is "On", all three values are possible. If it is "Off", only "Full" and "Half" are allowed. - It is usefull if your link partner does not support all + It is useful if your link partner does not support all possible combinations. - Flow Control diff --git a/Documentation/s390/TAPE b/Documentation/s390/TAPE index 6329276b41bf..c639aa5603ff 100644 --- a/Documentation/s390/TAPE +++ b/Documentation/s390/TAPE @@ -91,7 +91,7 @@ create an ISO9660 filesystem: TODO List - - Driver has to be stabelized still + - Driver has to be stabilized still BUGS diff --git a/Documentation/s390/s390dbf.txt b/Documentation/s390/s390dbf.txt index f8b7a5b89036..e7048364a9f9 100644 --- a/Documentation/s390/s390dbf.txt +++ b/Documentation/s390/s390dbf.txt @@ -14,7 +14,7 @@ in order to analyze the reason for the crash. If the system still runs but only a subcomponent which uses dbf failes, it is possible to look at the debug logs on a live system via the Linux proc filesystem. -The debug feature may also very usefull for kernel and driver development. +The debug feature may also very useful for kernel and driver development. Design: ------- diff --git a/Documentation/scsi/ibmmca.txt b/Documentation/scsi/ibmmca.txt index 3957eb3034a4..9322203ed655 100644 --- a/Documentation/scsi/ibmmca.txt +++ b/Documentation/scsi/ibmmca.txt @@ -254,7 +254,7 @@ device to be existant, but it has no ldn assigned, it gets a ldn out of 7 to 14. The numbers are assigned in cyclic order. Therefore it takes 8 dynamical reassignments on the SCSI-devices, until a certain device - looses its ldn again. This assures, that dynamical remapping is avoided + loses its ldn again. This assures, that dynamical remapping is avoided during intense I/O between up to 15 SCSI-devices (means pun,lun combinations). A further advantage of this method is, that people who build their kernel without probing on all luns will get what they expect, diff --git a/Documentation/sound/oss/Wavefront b/Documentation/sound/oss/Wavefront index 5453af77f425..3b936a2bcc65 100644 --- a/Documentation/sound/oss/Wavefront +++ b/Documentation/sound/oss/Wavefront @@ -81,7 +81,7 @@ out. Reports welcome. 2) Why does line XXX of the code look like this .... ? ********************************************************************** -Either because its not finished yet, or because you're a better coder +Either because it's not finished yet, or because you're a better coder than I am, or because you don't understand some aspect of how the card or the code works. diff --git a/Documentation/sx.txt b/Documentation/sx.txt index 9d9dafc427a6..cb4efa0fb5cc 100644 --- a/Documentation/sx.txt +++ b/Documentation/sx.txt @@ -265,7 +265,7 @@ switch to RIO). -- Done (Ugly: not the way I want it. Copied from serial.c). - write buffer isn't flushed at close. - -- Done. I still seem to loose a few chars at close. + -- Done. I still seem to lose a few chars at close. Sorry. I think that this is a firmware issue. (-> Specialix) - drain hardware before changing termios diff --git a/Documentation/video4linux/bttv/Sound-FAQ b/Documentation/video4linux/bttv/Sound-FAQ index e5ff77068019..b00218162d58 100644 --- a/Documentation/video4linux/bttv/Sound-FAQ +++ b/Documentation/video4linux/bttv/Sound-FAQ @@ -120,7 +120,7 @@ know what the other elements in the tvcards array are good for: video_inputs - # of video inputs the card has audio_inputs - historical cruft, not used any more. tuner - which input is the tuner -svhs - which input is svhs (all others are labled composite) +svhs - which input is svhs (all others are labeled composite) muxsel - video mux, input->registervalue mapping pll - same as pll= insmod option tuner_type - same as tuner= insmod option diff --git a/Documentation/vm/locking b/Documentation/vm/locking index 879b971e10d6..fa4f9f3d77ab 100644 --- a/Documentation/vm/locking +++ b/Documentation/vm/locking @@ -80,7 +80,7 @@ Note: PTL can also be used to guarantee that no new clones using the mm start up ... this is a loose form of stability on mm_users. For example, it is used in copy_mm to protect against a racing tlb_gather_mmu single address space optimization, so that the zap_page_range (from -vmtruncate) does not loose sending ipi's to cloned threads that might +vmtruncate) does not lose sending ipi's to cloned threads that might be spawned underneath it and go to user mode to drag in pte's into tlbs. swap_list_lock/swap_device_lock diff --git a/Documentation/vm/overcommit-accounting b/Documentation/vm/overcommit-accounting index c264a9fcac6a..b39221feaceb 100644 --- a/Documentation/vm/overcommit-accounting +++ b/Documentation/vm/overcommit-accounting @@ -26,7 +26,7 @@ Gotchas The C language stack growth does an implicit mremap. If you want absolute guarantees and run close to the edge you MUST mmap your stack for the largest size you think you will need. For typical stack usage is does -not matter much but its a corner case if you really really care +not matter much but it's a corner case if you really really care In mode 2 the MAP_NORESERVE flag is ignored. diff --git a/MAINTAINERS b/MAINTAINERS index 6eb4fbbbb4bd..630d18339262 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1791,10 +1791,10 @@ W: http://www.buzzard.org.uk/toshiba/ S: Maintained TRIDENT 4DWAVE/SIS 7018 PCI AUDIO CORE -P: Ollie Lho -M: ollie@sis.com.tw +P: Muli Ben-Yehuda +M: mulix@mulix.org L: linux-kernel@vger.kernel.org -S: Supported +S: Maintained TMS380 TOKEN-RING NETWORK DRIVER P: Adam Fritzler diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objstrip.c index bbda40330708..b454091d7b6f 100644 --- a/arch/alpha/boot/tools/objstrip.c +++ b/arch/alpha/boot/tools/objstrip.c @@ -7,7 +7,7 @@ */ /* * Converts an ECOFF or ELF object file into a bootable file. The - * object file must be a OMAGIC file (i.e., data and bss follow immediatly + * object file must be a OMAGIC file (i.e., data and bss follow immediately * behind the text). See DEC "Assembly Language Programmer's Guide" * documentation for details. The SRM boot process is documented in * the Alpha AXP Architecture Reference Manual, Second Edition by diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index 436502888e12..614aa87cb94f 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c @@ -318,7 +318,7 @@ pci_map_page(struct pci_dev *pdev, struct page *page, unsigned long offset, /* Unmap a single streaming mode DMA translation. The DMA_ADDR and SIZE must match what was provided for in a previous pci_map_single call. All other usages are undefined. After this call, reads by - the cpu to the buffer are guarenteed to see whatever the device + the cpu to the buffer are guaranteed to see whatever the device wrote there. */ void diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index 224ddf8b9ca2..16631bf1034a 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c @@ -440,7 +440,7 @@ marvel_smp_callin(void) return; /* - * There is a local IO7 - redirect all of it's interrupts here. + * There is a local IO7 - redirect all of its interrupts here. */ printk("Redirecting IO7 interrupts to local CPU at PE %u\n", cpuid); diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c index 0d56b55e52e6..9f0bd3cdaac6 100644 --- a/arch/alpha/kernel/time.c +++ b/arch/alpha/kernel/time.c @@ -50,7 +50,7 @@ #include "proto.h" #include "irq_impl.h" -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; extern unsigned long wall_jiffies; /* kernel/timer.c */ diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 9803b8ca0670..4cfbd4e27786 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c @@ -411,7 +411,7 @@ do_entIF(unsigned long type, struct pt_regs *regs) } /* There is an ifdef in the PALcode in MILO that enables a - "kernel debugging entry point" as an unpriviledged call_pal. + "kernel debugging entry point" as an unprivileged call_pal. We don't want to have anything to do with it, but unfortunately several versions of MILO included in distributions have it enabled, diff --git a/arch/alpha/lib/checksum.c b/arch/alpha/lib/checksum.c index 7f29ac81c7f3..9f2daa0301fe 100644 --- a/arch/alpha/lib/checksum.c +++ b/arch/alpha/lib/checksum.c @@ -63,7 +63,7 @@ unsigned int csum_tcpudp_nofold(unsigned long saddr, ((unsigned long) ntohs(len) << 16) + ((unsigned long) proto << 8)); - /* Fold down to 32-bits so we don't loose in the typedef-less + /* Fold down to 32-bits so we don't lose in the typedef-less network stack. */ /* 64 to 33 */ result = (result & 0xffffffff) + (result >> 32); diff --git a/arch/arm/kernel/entry-armo.S b/arch/arm/kernel/entry-armo.S index c204f080a304..f081ad9af786 100644 --- a/arch/arm/kernel/entry-armo.S +++ b/arch/arm/kernel/entry-armo.S @@ -426,7 +426,7 @@ Ldata_do: mov r3, sp mov r2, #0 tst r4, #1 << 20 @ Check to see if it is a write instruction orreq r2, r2, #FAULT_CODE_WRITE @ Indicate write instruction - mov r1, r4, lsr #22 @ Now branch to the relevent processing routine + mov r1, r4, lsr #22 @ Now branch to the relevant processing routine and r1, r1, #15 << 2 add pc, pc, r1 movs pc, lr diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 72245e91600c..c300acd5a385 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -1026,7 +1026,7 @@ vector_IRQ: @ mrs lr, spsr str lr, [r13, #4] @ save spsr_IRQ @ - @ now branch to the relevent MODE handling routine + @ now branch to the relevant MODE handling routine @ mov r13, #PSR_I_BIT | MODE_SVC msr spsr_c, r13 @ switch to SVC_32 mode @@ -1067,7 +1067,7 @@ vector_data: @ mrs lr, spsr str lr, [r13, #4] @ - @ now branch to the relevent MODE handling routine + @ now branch to the relevant MODE handling routine @ mov r13, #PSR_I_BIT | MODE_SVC msr spsr_c, r13 @ switch to SVC_32 mode @@ -1109,7 +1109,7 @@ vector_prefetch: mrs lr, spsr str lr, [r13, #4] @ save spsr_ABT @ - @ now branch to the relevent MODE handling routine + @ now branch to the relevant MODE handling routine @ mov r13, #PSR_I_BIT | MODE_SVC msr spsr_c, r13 @ switch to SVC_32 mode @@ -1150,7 +1150,7 @@ vector_undefinstr: mrs lr, spsr str lr, [r13, #4] @ save spsr_UND @ - @ now branch to the relevent MODE handling routine + @ now branch to the relevant MODE handling routine @ mov r13, #PSR_I_BIT | MODE_SVC msr spsr_c, r13 @ switch to SVC_32 mode diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index eee41a18b7e4..473a27aa39d0 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -435,7 +435,7 @@ void ptrace_set_bpt(struct task_struct *child) * be receiving a prefetch abort shortly. * * If we don't set this breakpoint here, then we can - * loose control of the thread during single stepping. + * lose control of the thread during single stepping. */ if (!alt || predicate(insn) != PREDICATE_ALWAYS) add_breakpoint(child, dbg, pc + 4); diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 1cb54c5d5204..f7dbb73f8064 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -32,7 +32,7 @@ #include <asm/irq.h> #include <asm/leds.h> -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; extern unsigned long wall_jiffies; diff --git a/arch/arm/mach-iop310/iop310-pci.c b/arch/arm/mach-iop310/iop310-pci.c index 3cf19682f279..30a48f98a8df 100644 --- a/arch/arm/mach-iop310/iop310-pci.c +++ b/arch/arm/mach-iop310/iop310-pci.c @@ -296,7 +296,7 @@ static struct pci_ops iop310_secondary_ops = { * within 3 instructions." * * This does not appear to be the case. With 8 NOPs after the load, we - * see the imprecise abort occuring on the STM of iop310_sec_pci_status() + * see the imprecise abort occurring on the STM of iop310_sec_pci_status() * which is about 10 instructions away. * * Always trust reality! diff --git a/arch/arm/mach-iop310/mm.c b/arch/arm/mach-iop310/mm.c index 2b09969e53b1..59200937c0f8 100644 --- a/arch/arm/mach-iop310/mm.c +++ b/arch/arm/mach-iop310/mm.c @@ -1,7 +1,7 @@ /* * linux/arch/arm/mach-iop310/mm.c * - * Low level memory intialization for IOP310 based systems + * Low level memory initialization for IOP310 based systems * * Author: Nicolas Pitre <npitre@mvista.com> * diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S index 2c5bf39ab0a4..76b6eed5366c 100644 --- a/arch/arm/mm/proc-arm6_7.S +++ b/arch/arm/mm/proc-arm6_7.S @@ -97,7 +97,7 @@ ENTRY(cpu_arm7_data_abort) tst r4, r4, lsr #21 @ C = bit 20 sbc r1, r1, r1 @ r1 = C - 1 and r2, r4, #15 << 24 - add pc, pc, r2, lsr #22 @ Now branch to the relevent processing routine + add pc, pc, r2, lsr #22 @ Now branch to the relevant processing routine movs pc, lr b Ldata_unknown diff --git a/arch/cris/boot/rescue/head.S b/arch/cris/boot/rescue/head.S index 40f9af6b6ef4..52881742da43 100644 --- a/arch/cris/boot/rescue/head.S +++ b/arch/cris/boot/rescue/head.S @@ -130,7 +130,7 @@ in_cache: ;; first put a jump test to give a possibility of upgrading the rescue code ;; without erasing/reflashing the sector. we put a longword of -1 here and if - ;; its not -1, we jump using the value as jump target. since we can always + ;; it is not -1, we jump using the value as jump target. since we can always ;; change 1's to 0's without erasing the sector, it is possible to add new ;; code after this and altering the jumptarget in an upgrade. diff --git a/arch/cris/drivers/eeprom.c b/arch/cris/drivers/eeprom.c index eb5aa7db784b..7a94c4cbac4c 100644 --- a/arch/cris/drivers/eeprom.c +++ b/arch/cris/drivers/eeprom.c @@ -815,7 +815,7 @@ static int read_from_eeprom(char * buf, int count) i2c_outbyte( eeprom.select_cmd | 1 ); } - if(i2c_getack()); + if(i2c_getack()) { break; } diff --git a/arch/cris/drivers/ethernet.c b/arch/cris/drivers/ethernet.c index e22f35d1fcdf..31c918563f76 100644 --- a/arch/cris/drivers/ethernet.c +++ b/arch/cris/drivers/ethernet.c @@ -236,7 +236,7 @@ static unsigned int network_rec_config_shadow = 0; /* Network speed indication. */ static struct timer_list speed_timer = TIMER_INITIALIZER(NULL, 0, 0); static struct timer_list clear_led_timer = TIMER_INITIALIZER(NULL, 0, 0); -static int current_speed; /* Speed read from tranceiver */ +static int current_speed; /* Speed read from transceiver */ static int current_speed_selection; /* Speed selected by user */ static int led_next_time; static int led_active; @@ -276,7 +276,7 @@ static unsigned short e100_get_mdio_reg(unsigned char reg_num); static void e100_send_mdio_cmd(unsigned short cmd, int write_cmd); static void e100_send_mdio_bit(unsigned char bit); static unsigned char e100_receive_mdio_bit(void); -static void e100_reset_tranceiver(void); +static void e100_reset_transceiver(void); static void e100_clear_network_leds(unsigned long dummy); static void e100_set_network_leds(int active); @@ -786,7 +786,7 @@ e100_receive_mdio_bit() } static void -e100_reset_tranceiver(void) +e100_reset_transceiver(void) { unsigned short cmd; unsigned short data; @@ -826,9 +826,9 @@ e100_tx_timeout(struct net_device *dev) RESET_DMA(NETWORK_TX_DMA_NBR); WAIT_DMA(NETWORK_TX_DMA_NBR); - /* Reset the tranceiver. */ + /* Reset the transceiver. */ - e100_reset_tranceiver(); + e100_reset_transceiver(); /* and get rid of the packet that never got an interrupt */ diff --git a/arch/cris/drivers/lpslave/e100lpslavenet.c b/arch/cris/drivers/lpslave/e100lpslavenet.c index c802187c1194..5555809bdc40 100644 --- a/arch/cris/drivers/lpslave/e100lpslavenet.c +++ b/arch/cris/drivers/lpslave/e100lpslavenet.c @@ -129,7 +129,7 @@ static void set_multicast_list(struct net_device *dev); static void e100_hardware_send_packet(unsigned long hostcmd, char *buf, int length); static void update_rx_stats(struct net_device_stats *); static void update_tx_stats(struct net_device_stats *); -static void e100_reset_tranceiver(void); +static void e100_reset_transceiver(void); static void boot_slave(unsigned char *code); @@ -528,7 +528,7 @@ e100_open(struct net_device *dev) } static void -e100_reset_tranceiver(void) +e100_reset_transceiver(void) { /* To do: Reboot and setup slave Etrax */ } @@ -554,9 +554,9 @@ e100_tx_timeout(struct net_device *dev) RESET_DMA(4); WAIT_DMA(4); - /* Reset the tranceiver. */ + /* Reset the transceiver. */ - e100_reset_tranceiver(); + e100_reset_transceiver(); /* and get rid of the packet that never got an interrupt */ diff --git a/arch/cris/drivers/serial.c b/arch/cris/drivers/serial.c index edeed9fe241b..5fb7b45d0e94 100644 --- a/arch/cris/drivers/serial.c +++ b/arch/cris/drivers/serial.c @@ -132,7 +132,7 @@ * Items worth noticing: * * No Etrax100 port 1 workarounds (does only compile on 2.4 anyway now) - * RS485 is not ported (why cant it be done in userspace as on x86 ?) + * RS485 is not ported (why can't it be done in userspace as on x86 ?) * Statistics done through async_icount - if any more stats are needed, * that's the place to put them or in an arch-dep version of it. * timeout_interrupt and the other fast timeout stuff not ported yet @@ -1766,7 +1766,7 @@ will look differently: B= Break character (0x00) with framing error. E= Error byte with parity error received after B characters. -F= "Faked" valid byte received immediatly after B characters. +F= "Faked" valid byte received immediately after B characters. V= Valid byte 1. @@ -2802,7 +2802,7 @@ send_break(struct e100_serial * info, int duration) info->tx_ctrl |= (0x80 | 0x40); /* Set bit 7 (txd) and 6 (tr_enable) */ info->port[REG_TR_CTRL] = info->tx_ctrl; - /* the DMA gets awfully confused if we toggle the tranceiver like this + /* the DMA gets awfully confused if we toggle the transceiver like this * so we need to reset it */ *info->ocmdadr = 4; diff --git a/arch/cris/kernel/kgdb.c b/arch/cris/kernel/kgdb.c index 5d5c9d4bbfdc..c88eb88013b1 100644 --- a/arch/cris/kernel/kgdb.c +++ b/arch/cris/kernel/kgdb.c @@ -1486,7 +1486,7 @@ kgdb_handle_serial: move.d $r0,[reg+0x62] ; Save the return address in BRP move $usp,[reg+0x66] ; USP -;; get the serial character (from debugport.c) and check if its a ctrl-c +;; get the serial character (from debugport.c) and check if it is a ctrl-c jsr getDebugChar cmp.b 3, $r10 diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c index 9eb5b73519c5..60441877ef2f 100644 --- a/arch/cris/kernel/process.c +++ b/arch/cris/kernel/process.c @@ -154,7 +154,7 @@ void hard_reset_now (void) #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) cause_of_death = 0xbedead; #else - /* Since we dont plan to keep on reseting the watchdog, + /* Since we don't plan to keep on reseting the watchdog, the key can be arbitrary hence three */ *R_WATCHDOG = IO_FIELD(R_WATCHDOG, key, 3) | IO_STATE(R_WATCHDOG, enable, start); @@ -226,7 +226,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, swstack = ((struct switch_stack *)childregs) - 1; - swstack->r9 = 0; /* parameter to ret_from_sys_call, 0 == dont restart the syscall */ + swstack->r9 = 0; /* parameter to ret_from_sys_call, 0 == don't restart the syscall */ /* we want to return into ret_from_sys_call after the _resume */ diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c index 6ab8d7bc0feb..a97ce40542fd 100644 --- a/arch/cris/kernel/setup.c +++ b/arch/cris/kernel/setup.c @@ -164,7 +164,7 @@ setup_arch(char **cmdline_p) paging_init(); - /* We dont use a command line yet, so just re-initialize it without + /* We don't use a command line yet, so just re-initialize it without saving anything that might be there. */ *cmdline_p = command_line; diff --git a/arch/cris/kernel/signal.c b/arch/cris/kernel/signal.c index a04726efc889..678281dae205 100644 --- a/arch/cris/kernel/signal.c +++ b/arch/cris/kernel/signal.c @@ -494,7 +494,7 @@ handle_signal(int canrestart, unsigned long sig, case -ERESTARTNOHAND: /* ERESTARTNOHAND means that the syscall should only be restarted if there was no handler for the signal, and since - we only get here if there is a handler, we dont restart */ + we only get here if there is a handler, we don't restart */ regs->r10 = -EINTR; break; diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c index 0541e25a48aa..f42806219c68 100644 --- a/arch/cris/kernel/time.c +++ b/arch/cris/kernel/time.c @@ -45,7 +45,7 @@ #include <asm/svinto.h> -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; static int have_rtc; /* used to remember if we have an RTC or not */ diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c index fa0a6934eed1..2e4d91e40cf9 100644 --- a/arch/cris/mm/fault.c +++ b/arch/cris/mm/fault.c @@ -170,7 +170,7 @@ handle_mmu_bus_fault(struct pt_regs *regs) if (miss) { /* see if the pte exists at all - * refer through current_pgd, dont use mm->pgd + * refer through current_pgd, don't use mm->pgd */ pmd = (pmd_t *)(current_pgd + pgd_index(address)); diff --git a/arch/cris/mm/tlb.c b/arch/cris/mm/tlb.c index 9d5e588d8028..f5a97c9799fd 100644 --- a/arch/cris/mm/tlb.c +++ b/arch/cris/mm/tlb.c @@ -58,7 +58,7 @@ flush_tlb_all(void) int i; unsigned long flags; - /* the vpn of i & 0xf is so we dont write similar TLB entries + /* the vpn of i & 0xf is so we don't write similar TLB entries * in the same 4-way entry group. details.. */ diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index e9098fd1e3f0..d0977e4e74d9 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -75,6 +75,11 @@ config X86_SUMMIT If you don't have one of these computers, you should say N here. +config ACPI_SRAT + bool + default y + depends on NUMA && X86_SUMMIT + config X86_BIGSMP bool "Support for other sub-arch SMP systems with more than 8 CPUs" help @@ -483,7 +488,7 @@ config NR_CPUS # Common NUMA Features config NUMA bool "Numa Memory Allocation Support" - depends on X86_NUMAQ + depends on (HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT && ACPI && !ACPI_HT_ONLY))) config DISCONTIGMEM bool @@ -752,6 +757,13 @@ config HAVE_DEC_LOCK depends on (SMP || PREEMPT) && X86_CMPXCHG default y +# turning this on wastes a bunch of space. +# Summit needs it only when NUMA is on +config BOOT_IOREMAP + bool + depends on (X86_SUMMIT && NUMA) + default y + endmenu diff --git a/arch/i386/boot/bootsect.S b/arch/i386/boot/bootsect.S index a99ffbbbe905..ebaa2556fd13 100644 --- a/arch/i386/boot/bootsect.S +++ b/arch/i386/boot/bootsect.S @@ -405,7 +405,7 @@ kill_motor: ret sectors: .word 0 -disksizes: .byte 36, 18, 15, 9 +disksizes: .byte 36, 21, 18, 15, 9 msg1: .byte 13, 10 .ascii "Loading" diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 400829ad9e89..c423f788cf7f 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile @@ -28,6 +28,7 @@ obj-$(CONFIG_X86_NUMAQ) += numaq.o obj-$(CONFIG_EDD) += edd.o obj-$(CONFIG_MODULES) += module.o obj-y += sysenter.o +obj-$(CONFIG_ACPI_SRAT) += srat.o EXTRA_AFLAGS := -traditional diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 6e94298acae8..2f945403d38d 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c @@ -24,6 +24,7 @@ */ #include <linux/init.h> +#include <linux/config.h> #include <linux/acpi.h> #include <asm/pgalloc.h> #include <asm/apic.h> diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 921e49ee3a3d..af9ec6bbf5ba 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c @@ -665,7 +665,6 @@ static int __init detect_init_APIC (void) } set_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability); mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; - boot_cpu_physical_apicid = 0; if (nmi_watchdog != NMI_NONE) nmi_watchdog = NMI_LOCAL_APIC; @@ -1154,8 +1153,7 @@ int __init APIC_init_uniprocessor (void) connect_bsp_APIC(); - phys_cpu_present_map = 1; - apic_write_around(APIC_ID, boot_cpu_physical_apicid); + phys_cpu_present_map = 1 << boot_cpu_physical_apicid; apic_pm_init2(); diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index d21b59a85ede..67e9015e6400 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -1096,7 +1096,7 @@ static int apm_engage_power_management(u_short device, int enable) * @blank: on/off * * Attempt to blank the console, firstly by blanking just video device - * zero, and if that fails (some BIOSes dont support it) then it blanks + * zero, and if that fails (some BIOSes don't support it) then it blanks * all video devices. Typically the BIOS will do laptop backlight and * monitor powerdown for us. */ diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c index 762a1a8d8c01..fc57a582354e 100644 --- a/arch/i386/kernel/cpu/amd.c +++ b/arch/i386/kernel/cpu/amd.c @@ -151,11 +151,10 @@ static void __init init_amd(struct cpuinfo_x86 *c) case 6: /* An Athlon/Duron */ /* Bit 15 of Athlon specific MSR 15, needs to be 0 - * to enable SSE on Palomino/Morgan CPU's. - * If the BIOS didn't enable it already, enable it - * here. + * to enable SSE on Palomino/Morgan/Barton CPU's. + * If the BIOS didn't enable it already, enable it here. */ - if (c->x86_model == 6 || c->x86_model == 7) { + if (c->x86_model >= 6 && c->x86_model <= 10) { if (!cpu_has(c, X86_FEATURE_XMM)) { printk(KERN_INFO "Enabling disabled K7/SSE Support.\n"); rdmsr(MSR_K7_HWCR, l, h); diff --git a/arch/i386/kernel/cpu/centaur.c b/arch/i386/kernel/cpu/centaur.c index 5d6e84590b22..20d4cda0e427 100644 --- a/arch/i386/kernel/cpu/centaur.c +++ b/arch/i386/kernel/cpu/centaur.c @@ -412,8 +412,9 @@ static unsigned int centaur_size_cache(struct cpuinfo_x86 * c, unsigned int size size >>= 8; /* VIA also screwed up Nehemiah stepping 1, and made - it return '65KB' instead of '64KB' */ - if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1)) + it return '65KB' instead of '64KB' + - Note, it seems this may only be in engineering samples. */ + if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1) && (size==65)) size -=1; return size; diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c index e7755e874eb9..c86b0c466744 100644 --- a/arch/i386/kernel/cpu/cpufreq/longrun.c +++ b/arch/i386/kernel/cpu/cpufreq/longrun.c @@ -133,7 +133,7 @@ static int longrun_verify_policy(struct cpufreq_policy *policy) * longrun_determine_freqs - determines the lowest and highest possible core frequency * * Determines the lowest and highest possible core frequencies on this CPU. - * This is neccessary to calculate the performance percentage according to + * This is necessary to calculate the performance percentage according to * TMTA rules: * performance_pctg = (target_freq - low_freq)/(high_freq - low_freq) */ diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/i386/kernel/cpu/cyrix.c index a91dbda9c0db..a09e70fa105a 100644 --- a/arch/i386/kernel/cpu/cyrix.c +++ b/arch/i386/kernel/cpu/cyrix.c @@ -49,7 +49,7 @@ void __init do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in * order to identify the Cyrix CPU model after we're out of setup.c * - * Actually since bugs.h doesnt even reference this perhaps someone should + * Actually since bugs.h doesn't even reference this perhaps someone should * fix the documentation ??? */ static unsigned char Cx86_dir0_msb __initdata = 0; @@ -77,7 +77,7 @@ static char cyrix_model_mult2[] __initdata = "12233445"; * BIOSes for compatibility with DOS games. This makes the udelay loop * work correctly, and improves performance. * - * FIXME: our newer udelay uses the tsc. We dont need to frob with SLOP + * FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP */ extern void calibrate_delay(void) __init; diff --git a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c index 99e34048350a..3bd0a2fa986c 100644 --- a/arch/i386/kernel/cpu/intel.c +++ b/arch/i386/kernel/cpu/intel.c @@ -151,7 +151,7 @@ static void __init init_intel(struct cpuinfo_x86 *c) #ifdef CONFIG_X86_F00F_BUG /* * All current models of Pentium and Pentium with MMX technology CPUs - * have the F0 0F bug, which lets nonpriviledged users lock up the system. + * have the F0 0F bug, which lets nonprivileged users lock up the system. * Note that the workaround only should be initialized once... */ c->f00f_bug = 0; diff --git a/arch/i386/kernel/cpu/mcheck/non-fatal.c b/arch/i386/kernel/cpu/mcheck/non-fatal.c index 57035340e783..9bbb02ba6abc 100644 --- a/arch/i386/kernel/cpu/mcheck/non-fatal.c +++ b/arch/i386/kernel/cpu/mcheck/non-fatal.c @@ -33,7 +33,7 @@ static void mce_checkregs (void *info) rdmsr (MSR_IA32_MC0_STATUS+i*4, low, high); if (high & (1<<31)) { - printk (KERN_EMERG "MCE: The hardware reports a non fatal, correctable incident occured on CPU %d.\n", + printk (KERN_EMERG "MCE: The hardware reports a non fatal, correctable incident occurred on CPU %d.\n", smp_processor_id()); printk (KERN_EMERG "Bank %d: %08x%08x\n", i, high, low); diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c index 57495ec0d263..179579a1df20 100644 --- a/arch/i386/kernel/dmi_scan.c +++ b/arch/i386/kernel/dmi_scan.c @@ -440,7 +440,7 @@ static __init int broken_pirq(struct dmi_blacklist *d) { printk(KERN_INFO " *** Possibly defective BIOS detected (irqtable)\n"); printk(KERN_INFO " *** Many BIOSes matching this signature have incorrect IRQ routing tables.\n"); - printk(KERN_INFO " *** If you see IRQ problems, in paticular SCSI resets and hangs at boot\n"); + printk(KERN_INFO " *** If you see IRQ problems, in particular SCSI resets and hangs at boot\n"); printk(KERN_INFO " *** contact your hardware vendor and ask about updates.\n"); printk(KERN_INFO " *** Building an SMP kernel may evade the bug some of the time.\n"); #ifdef CONFIG_X86_IO_APIC diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index edfb712a2ba0..cd0dd133a572 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S @@ -228,7 +228,6 @@ need_resched: #define SYSENTER_RETURN 0xffffe010 # sysenter call handler stub - ALIGN ENTRY(sysenter_entry) sti pushl $(__USER_DS) @@ -271,7 +270,6 @@ ENTRY(sysenter_entry) # system call handler stub - ALIGN ENTRY(system_call) pushl %eax # save orig_eax SAVE_ALL diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 556f2237ee13..7f2892e1e35e 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -46,7 +46,7 @@ static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED; /* * Is the SiS APIC rmw bug present ? - * -1 = dont know, 0 = no, 1 = yes + * -1 = don't know, 0 = no, 1 = yes */ int sis_apic_bug = -1; @@ -223,7 +223,7 @@ static void set_ioapic_affinity (unsigned int irq, unsigned long mask) extern unsigned long irq_affinity [NR_IRQS]; int __cacheline_aligned pending_irq_balance_apicid [NR_IRQS]; -static int irqbalance_disabled __initdata = 0; +static int irqbalance_disabled = NO_BALANCE_IRQ; static int physical_balance = 0; struct irq_cpu_info { @@ -492,7 +492,7 @@ static inline void balance_irq (int cpu, int irq) unsigned long allowed_mask; unsigned int new_cpu; - if (no_balance_irq) + if (irqbalance_disabled) return; allowed_mask = cpu_online_map & irq_affinity[irq]; diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index 50025095c075..6760e8f41aa3 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c @@ -87,7 +87,7 @@ static void ack_none(unsigned int irq) { /* * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesnt deserve + * each architecture has to answer this themselves, it doesn't deserve * a generic callback i think. */ #if CONFIG_X86 diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index 682446a5c050..ed31b7804c06 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c @@ -325,7 +325,7 @@ static spinlock_t nmi_print_lock = SPIN_LOCK_UNLOCKED; * as these watchdog NMI IRQs are generated on every CPU, we only * have to check the current processor. * - * since NMIs dont listen to _any_ locks, we have to be extremely + * since NMIs don't listen to _any_ locks, we have to be extremely * careful not to rely on unsafe variables. The printk might lock * up though, so we have to break up any console locks first ... * [when there will be more tty-related locks, break them up diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 37444600d272..ccbb374944b2 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -14,6 +14,9 @@ * Moved CPU detection code to cpu/${cpu}.c * Patrick Mochel <mochel@osdl.org>, March 2002 * + * Provisions for empty E820 memory regions (reported by certain BIOSes). + * Alex Achenbach <xela@slit.de>, December 2002. + * */ /* @@ -279,7 +282,7 @@ static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map) int chgidx, still_changing; int overlap_entries; int new_bios_entry; - int old_nr, new_nr; + int old_nr, new_nr, chg_nr; int i; /* @@ -333,20 +336,24 @@ static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map) for (i=0; i < 2*old_nr; i++) change_point[i] = &change_point_list[i]; - /* record all known change-points (starting and ending addresses) */ + /* record all known change-points (starting and ending addresses), + omitting those that are for empty memory regions */ chgidx = 0; for (i=0; i < old_nr; i++) { - change_point[chgidx]->addr = biosmap[i].addr; - change_point[chgidx++]->pbios = &biosmap[i]; - change_point[chgidx]->addr = biosmap[i].addr + biosmap[i].size; - change_point[chgidx++]->pbios = &biosmap[i]; + if (biosmap[i].size != 0) { + change_point[chgidx]->addr = biosmap[i].addr; + change_point[chgidx++]->pbios = &biosmap[i]; + change_point[chgidx]->addr = biosmap[i].addr + biosmap[i].size; + change_point[chgidx++]->pbios = &biosmap[i]; + } } + chg_nr = chgidx; /* true number of change-points */ /* sort change-point list by memory addresses (low -> high) */ still_changing = 1; while (still_changing) { still_changing = 0; - for (i=1; i < 2*old_nr; i++) { + for (i=1; i < chg_nr; i++) { /* if <current_addr> > <last_addr>, swap */ /* or, if current=<start_addr> & last=<end_addr>, swap */ if ((change_point[i]->addr < change_point[i-1]->addr) || @@ -369,7 +376,7 @@ static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map) last_type = 0; /* start with undefined memory type */ last_addr = 0; /* start with 0 as last starting address */ /* loop through change-points, determining affect on the new bios map */ - for (chgidx=0; chgidx < 2*old_nr; chgidx++) + for (chgidx=0; chgidx < chg_nr; chgidx++) { /* keep track of all overlapping bios entries */ if (change_point[chgidx]->addr == change_point[chgidx]->pbios->addr) @@ -818,7 +825,7 @@ static void __init register_memory(unsigned long max_low_pfn) request_resource(&iomem_resource, res); if (e820.map[i].type == E820_RAM) { /* - * We dont't know which RAM region contains kernel data, + * We don't know which RAM region contains kernel data, * so we try it repeatedly and let the resource manager * test it. */ diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 01259d1f21ad..9068867ab6d3 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c @@ -170,7 +170,7 @@ valid_k7: /* * TSC synchronization. * - * We first check wether all CPUs have their TSC's synchronized, + * We first check whether all CPUs have their TSC's synchronized, * then we print a warning if not, and always resync. */ @@ -956,7 +956,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) smp_tune_scheduling(); /* - * If we couldnt find an SMP configuration at boot time, + * If we couldn't find an SMP configuration at boot time, * get out of here now! */ if (!smp_found_config) { diff --git a/arch/i386/kernel/srat.c b/arch/i386/kernel/srat.c new file mode 100644 index 000000000000..899dee610170 --- /dev/null +++ b/arch/i386/kernel/srat.c @@ -0,0 +1,448 @@ +/* + * Some of the code in this file has been gleaned from the 64 bit + * discontigmem support code base. + * + * Copyright (C) 2002, IBM Corp. + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or + * NON INFRINGEMENT. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Send feedback to Pat Gaughen <gone@us.ibm.com> + */ +#include <linux/config.h> +#include <linux/mm.h> +#include <linux/bootmem.h> +#include <linux/mmzone.h> +#include <linux/acpi.h> +#include <asm/srat.h> + +/* + * proximity macros and definitions + */ +#define NODE_ARRAY_INDEX(x) ((x) / 8) /* 8 bits/char */ +#define NODE_ARRAY_OFFSET(x) ((x) % 8) /* 8 bits/char */ +#define BMAP_SET(bmap, bit) ((bmap)[NODE_ARRAY_INDEX(bit)] |= 1 << NODE_ARRAY_OFFSET(bit)) +#define BMAP_TEST(bmap, bit) ((bmap)[NODE_ARRAY_INDEX(bit)] & (1 << NODE_ARRAY_OFFSET(bit))) +#define MAX_PXM_DOMAINS 256 /* 1 byte and no promises about values */ +/* bitmap length; _PXM is at most 255 */ +#define PXM_BITMAP_LEN (MAX_PXM_DOMAINS / 8) +static u8 pxm_bitmap[PXM_BITMAP_LEN]; /* bitmap of proximity domains */ + +#define MAX_CHUNKS_PER_NODE 4 +#define MAXCHUNKS (MAX_CHUNKS_PER_NODE * MAX_NUMNODES) +struct node_memory_chunk_s { + unsigned long start_pfn; + unsigned long end_pfn; + u8 pxm; // proximity domain of node + u8 nid; // which cnode contains this chunk? + u8 bank; // which mem bank on this node +}; +static struct node_memory_chunk_s node_memory_chunk[MAXCHUNKS]; + +static int num_memory_chunks; /* total number of memory chunks */ +static int zholes_size_init; +static unsigned long zholes_size[MAX_NUMNODES * MAX_NR_ZONES]; + +unsigned long node_start_pfn[MAX_NUMNODES]; +unsigned long node_end_pfn[MAX_NUMNODES]; + +extern void * boot_ioremap(unsigned long, unsigned long); + +/* Identify CPU proximity domains */ +static void __init parse_cpu_affinity_structure(char *p) +{ + struct acpi_table_processor_affinity *cpu_affinity = + (struct acpi_table_processor_affinity *) p; + + if (!cpu_affinity->flags.enabled) + return; /* empty entry */ + + /* mark this node as "seen" in node bitmap */ + BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain); + + printk("CPU 0x%02X in proximity domain 0x%02X\n", + cpu_affinity->apic_id, cpu_affinity->proximity_domain); +} + +/* + * Identify memory proximity domains and hot-remove capabilities. + * Fill node memory chunk list structure. + */ +static void __init parse_memory_affinity_structure (char *sratp) +{ + unsigned long long paddr, size; + unsigned long start_pfn, end_pfn; + u8 pxm; + struct node_memory_chunk_s *p, *q, *pend; + struct acpi_table_memory_affinity *memory_affinity = + (struct acpi_table_memory_affinity *) sratp; + + if (!memory_affinity->flags.enabled) + return; /* empty entry */ + + /* mark this node as "seen" in node bitmap */ + BMAP_SET(pxm_bitmap, memory_affinity->proximity_domain); + + /* calculate info for memory chunk structure */ + paddr = memory_affinity->base_addr_hi; + paddr = (paddr << 32) | memory_affinity->base_addr_lo; + size = memory_affinity->length_hi; + size = (size << 32) | memory_affinity->length_lo; + + start_pfn = paddr >> PAGE_SHIFT; + end_pfn = (paddr + size) >> PAGE_SHIFT; + + pxm = memory_affinity->proximity_domain; + + if (num_memory_chunks >= MAXCHUNKS) { + printk("Too many mem chunks in SRAT. Ignoring %lld MBytes at %llx\n", + size/(1024*1024), paddr); + return; + } + + /* Insertion sort based on base address */ + pend = &node_memory_chunk[num_memory_chunks]; + for (p = &node_memory_chunk[0]; p < pend; p++) { + if (start_pfn < p->start_pfn) + break; + } + if (p < pend) { + for (q = pend; q >= p; q--) + *(q + 1) = *q; + } + p->start_pfn = start_pfn; + p->end_pfn = end_pfn; + p->pxm = pxm; + + num_memory_chunks++; + + printk("Memory range 0x%lX to 0x%lX (type 0x%X) in proximity domain 0x%02X %s\n", + start_pfn, end_pfn, + memory_affinity->memory_type, + memory_affinity->proximity_domain, + (memory_affinity->flags.hot_pluggable ? + "enabled and removable" : "enabled" ) ); +} + +#if MAX_NR_ZONES != 3 +#error "MAX_NR_ZONES != 3, chunk_to_zone requires review" +#endif +/* Take a chunk of pages from page frame cstart to cend and count the number + * of pages in each zone, returned via zones[]. + */ +static __init void chunk_to_zones(unsigned long cstart, unsigned long cend, + unsigned long *zones) +{ + unsigned long max_dma; + extern unsigned long max_low_pfn; + + int z; + unsigned long rend; + + /* FIXME: MAX_DMA_ADDRESS and max_low_pfn are trying to provide + * similarly scoped information and should be handled in a consistant + * manner. + */ + max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; + + /* Split the hole into the zones in which it falls. Repeatedly + * take the segment in which the remaining hole starts, round it + * to the end of that zone. + */ + memset(zones, 0, MAX_NR_ZONES * sizeof(long)); + while (cstart < cend) { + if (cstart < max_dma) { + z = ZONE_DMA; + rend = (cend < max_dma)? cend : max_dma; + + } else if (cstart < max_low_pfn) { + z = ZONE_NORMAL; + rend = (cend < max_low_pfn)? cend : max_low_pfn; + + } else { + z = ZONE_HIGHMEM; + rend = cend; + } + zones[z] += rend - cstart; + cstart = rend; + } +} + +/* + * physnode_map keeps track of the physical memory layout of the + * numaq nodes on a 256Mb break (each element of the array will + * represent 256Mb of memory and will be marked by the node id. so, + * if the first gig is on node 0, and the second gig is on node 1 + * physnode_map will contain: + * physnode_map[0-3] = 0; + * physnode_map[4-7] = 1; + * physnode_map[8- ] = -1; + */ +int pfnnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1}; +EXPORT_SYMBOL(pfnnode_map); + +static void __init initialize_pfnnode_map(void) +{ + unsigned long topofchunk, cur = 0; + int i; + + for (i = 0; i < num_memory_chunks; i++) { + cur = node_memory_chunk[i].start_pfn; + topofchunk = node_memory_chunk[i].end_pfn; + while (cur < topofchunk) { + pfnnode_map[PFN_TO_ELEMENT(cur)] = node_memory_chunk[i].nid; + cur ++; + } + } +} + +/* Parse the ACPI Static Resource Affinity Table */ +static int __init acpi20_parse_srat(struct acpi_table_srat *sratp) +{ + u8 *start, *end, *p; + int i, j, nid; + u8 pxm_to_nid_map[MAX_PXM_DOMAINS];/* _PXM to logical node ID map */ + u8 nid_to_pxm_map[MAX_NUMNODES];/* logical node ID to _PXM map */ + + start = (u8 *)(&(sratp->reserved) + 1); /* skip header */ + p = start; + end = (u8 *)sratp + sratp->header.length; + + memset(pxm_bitmap, 0, sizeof(pxm_bitmap)); /* init proximity domain bitmap */ + memset(node_memory_chunk, 0, sizeof(node_memory_chunk)); + memset(zholes_size, 0, sizeof(zholes_size)); + + /* -1 in these maps means not available */ + memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map)); + memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map)); + + num_memory_chunks = 0; + while (p < end) { + switch (*p) { + case ACPI_SRAT_PROCESSOR_AFFINITY: + parse_cpu_affinity_structure(p); + break; + case ACPI_SRAT_MEMORY_AFFINITY: + parse_memory_affinity_structure(p); + break; + default: + printk("ACPI 2.0 SRAT: unknown entry skipped: type=0x%02X, len=%d\n", p[0], p[1]); + break; + } + p += p[1]; + if (p[1] == 0) { + printk("acpi20_parse_srat: Entry length value is zero;" + " can't parse any further!\n"); + break; + } + } + + /* Calculate total number of nodes in system from PXM bitmap and create + * a set of sequential node IDs starting at zero. (ACPI doesn't seem + * to specify the range of _PXM values.) + */ + numnodes = 0; /* init total nodes in system */ + for (i = 0; i < MAX_PXM_DOMAINS; i++) { + if (BMAP_TEST(pxm_bitmap, i)) { + pxm_to_nid_map[i] = numnodes; + nid_to_pxm_map[numnodes] = i; + node_set_online(numnodes); + ++numnodes; + } + } + + if (numnodes == 0) + BUG(); + + /* set cnode id in memory chunk structure */ + for (i = 0; i < num_memory_chunks; i++) + node_memory_chunk[i].nid = pxm_to_nid_map[node_memory_chunk[i].pxm]; + + initialize_pfnnode_map(); + + printk("pxm bitmap: "); + for (i = 0; i < sizeof(pxm_bitmap); i++) { + printk("%02X ", pxm_bitmap[i]); + } + printk("\n"); + printk("Number of logical nodes in system = %d\n", numnodes); + printk("Number of memory chunks in system = %d\n", num_memory_chunks); + + for (j = 0; j < num_memory_chunks; j++){ + printk("chunk %d nid %d start_pfn %08lx end_pfn %08lx\n", + j, node_memory_chunk[j].nid, + node_memory_chunk[j].start_pfn, + node_memory_chunk[j].end_pfn); + } + + /*calculate node_start_pfn/node_end_pfn arrays*/ + for (nid = 0; nid < numnodes; nid++) { + int been_here_before = 0; + + for (j = 0; j < num_memory_chunks; j++){ + if (node_memory_chunk[j].nid == nid) { + if (been_here_before == 0) { + node_start_pfn[nid] = node_memory_chunk[j].start_pfn; + node_end_pfn[nid] = node_memory_chunk[j].end_pfn; + been_here_before = 1; + } else { /* We've found another chunk of memory for the node */ + if (node_start_pfn[nid] < node_memory_chunk[j].start_pfn) { + node_end_pfn[nid] = node_memory_chunk[j].end_pfn; + } + } + } + } + } + return 0; +} + +void __init get_memcfg_from_srat(void) +{ + struct acpi_table_header *header = NULL; + struct acpi_table_rsdp *rsdp = NULL; + struct acpi_table_rsdt *rsdt = NULL; + struct acpi_pointer *rsdp_address = NULL; + struct acpi_table_rsdt saved_rsdt; + int tables = 0; + int i = 0; + + acpi_find_root_pointer(ACPI_PHYSICAL_ADDRESSING, rsdp_address); + + if (rsdp_address->pointer_type == ACPI_PHYSICAL_POINTER) { + printk("%s: assigning address to rsdp\n", __FUNCTION__); + rsdp = (struct acpi_table_rsdp *)rsdp_address->pointer.physical; + } else { + printk("%s: rsdp_address is not a physical pointer\n", __FUNCTION__); + return; + } + if (!rsdp) { + printk("%s: Didn't find ACPI root!\n", __FUNCTION__); + return; + } + + printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision, + rsdp->oem_id); + + if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) { + printk(KERN_WARNING "%s: RSDP table signature incorrect\n", __FUNCTION__); + return; + } + + rsdt = (struct acpi_table_rsdt *) + boot_ioremap(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt)); + + if (!rsdt) { + printk(KERN_WARNING + "%s: ACPI: Invalid root system description tables (RSDT)\n", + __FUNCTION__); + return; + } + + header = & rsdt->header; + + if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) { + printk(KERN_WARNING "ACPI: RSDT signature incorrect\n"); + return; + } + + /* + * The number of tables is computed by taking the + * size of all entries (header size minus total + * size of RSDT) divided by the size of each entry + * (4-byte table pointers). + */ + tables = (header->length - sizeof(struct acpi_table_header)) / 4; + + memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt)); + + if (saved_rsdt.header.length > sizeof(saved_rsdt)) { + printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", + saved_rsdt.header.length); + return; + } + +printk("Begin table scan....\n"); + + for (i = 0; i < tables; i++) { + /* Map in header, then map in full table length. */ + header = (struct acpi_table_header *) + boot_ioremap(saved_rsdt.entry[i], sizeof(struct acpi_table_header)); + if (!header) + break; + header = (struct acpi_table_header *) + boot_ioremap(saved_rsdt.entry[i], header->length); + if (!header) + break; + + if (strncmp((char *) &header->signature, "SRAT", 4)) + continue; + acpi20_parse_srat((struct acpi_table_srat *)header); + /* we've found the srat table. don't need to look at any more tables */ + break; + } +} + +/* For each node run the memory list to determine whether there are + * any memory holes. For each hole determine which ZONE they fall + * into. + * + * NOTE#1: this requires knowledge of the zone boundries and so + * _cannot_ be performed before those are calculated in setup_memory. + * + * NOTE#2: we rely on the fact that the memory chunks are ordered by + * start pfn number during setup. + */ +static void __init get_zholes_init(void) +{ + int nid; + int c; + int first; + unsigned long end = 0; + + for (nid = 0; nid < numnodes; nid++) { + first = 1; + for (c = 0; c < num_memory_chunks; c++){ + if (node_memory_chunk[c].nid == nid) { + if (first) { + end = node_memory_chunk[c].end_pfn; + first = 0; + + } else { + /* Record any gap between this chunk + * and the previous chunk on this node + * against the zones it spans. + */ + chunk_to_zones(end, + node_memory_chunk[c].start_pfn, + &zholes_size[nid * MAX_NR_ZONES]); + } + } + } + } +} + +unsigned long * __init get_zholes_size(int nid) +{ + if (!zholes_size_init) { + zholes_size_init++; + get_zholes_init(); + } + if((nid >= numnodes) | (nid >= MAX_NUMNODES)) + printk("%s: nid = %d is invalid. numnodes = %d", + __FUNCTION__, nid, numnodes); + return &zholes_size[nid * MAX_NR_ZONES]; +} diff --git a/arch/i386/kernel/suspend.c b/arch/i386/kernel/suspend.c index cca0d136f36c..427b387efcf7 100644 --- a/arch/i386/kernel/suspend.c +++ b/arch/i386/kernel/suspend.c @@ -113,7 +113,7 @@ void fix_processor_context(void) int cpu = smp_processor_id(); struct tss_struct * t = init_tss + cpu; - set_tss_desc(cpu,t); /* This just modifies memory; should not be neccessary. But... This is neccessary, because 386 hardware has concept of busy TSS or some similar stupidity. */ + set_tss_desc(cpu,t); /* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */ cpu_gdt_table[cpu][GDT_ENTRY_TSS].b &= 0xfffffdff; load_TR_desc(); /* This does ltr */ diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index b14b181779f7..79389a99e06f 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -66,7 +66,7 @@ int pit_latch_buggy; /* extern */ #include "do_timer.h" -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; unsigned long cpu_khz; /* Detected as we calibrate the TSC */ diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index b21a7fbfdc06..aedbefce21e1 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c @@ -264,7 +264,7 @@ static int init_tsc(void) * the ident/bugs checks so we must run this hook as it * may turn off the TSC flag. * - * NOTE: this doesnt yet handle SMP 486 machines where only + * NOTE: this doesn't yet handle SMP 486 machines where only * some CPU's have a TSC. Thats never worked and nobody has * moaned if you have the only one in the world - you fix it! */ diff --git a/arch/i386/lib/mmx.c b/arch/i386/lib/mmx.c index 8a49853d00de..d6fc84f375e3 100644 --- a/arch/i386/lib/mmx.c +++ b/arch/i386/lib/mmx.c @@ -15,7 +15,7 @@ * (reported so on K6-III) * We should use a better code neutral filler for the short jump * leal ebx. [ebx] is apparently best for K6-2, but Cyrix ?? - * We also want to clobber the filler register so we dont get any + * We also want to clobber the filler register so we don't get any * register forwarding stalls on the filler. * * Add *user handling. Checksums are not a win with MMX on any CPU diff --git a/arch/i386/mach-visws/visws_apic.c b/arch/i386/mach-visws/visws_apic.c index 2c4b5efaf4d4..3d20387637f2 100644 --- a/arch/i386/mach-visws/visws_apic.c +++ b/arch/i386/mach-visws/visws_apic.c @@ -190,7 +190,7 @@ static struct hw_interrupt_type piix4_virtual_irq_type = { * the 'master' interrupt source: CO_IRQ_8259. * * When the 8259 interrupts its handler figures out which of these - * devices is interrupting and dispatches to it's handler. + * devices is interrupting and dispatches to its handler. * * CAREFUL: devices see the 'virtual' interrupt only. Thus disable/ * enable_irq gets the right irq. This 'master' irq is never directly diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c index 83f8655f862b..6463639d5b26 100644 --- a/arch/i386/mach-voyager/voyager_smp.c +++ b/arch/i386/mach-voyager/voyager_smp.c @@ -1230,9 +1230,10 @@ flush_tlb_all_function(void* info) void flush_tlb_all(void) { + preempt_disable(); smp_call_function (flush_tlb_all_function, 0, 1, 1); - do_flush_tlb_all_local(); + preempt_enable(); } /* used to set up the trampoline for other CPUs when the memory manager @@ -1453,7 +1454,7 @@ smp_intr_init(void) } /* send a CPI at level cpi to a set of cpus in cpuset (set 1 bit per - * processor to recieve CPI */ + * processor to receive CPI */ static void send_CPI(__u32 cpuset, __u8 cpi) { diff --git a/arch/i386/mm/Makefile b/arch/i386/mm/Makefile index 183d802bf494..87dd63c9802a 100644 --- a/arch/i386/mm/Makefile +++ b/arch/i386/mm/Makefile @@ -2,8 +2,9 @@ # Makefile for the linux i386-specific parts of the memory manager. # -obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o +obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o obj-$(CONFIG_DISCONTIGMEM) += discontig.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_HIGHMEM) += highmem.o +obj-$(CONFIG_BOOT_IOREMAP) += boot_ioremap.o diff --git a/arch/i386/mm/boot_ioremap.c b/arch/i386/mm/boot_ioremap.c new file mode 100644 index 000000000000..43f66c3ac340 --- /dev/null +++ b/arch/i386/mm/boot_ioremap.c @@ -0,0 +1,94 @@ +/* + * arch/i386/mm/boot_ioremap.c + * + * Re-map functions for early boot-time before paging_init() when the + * boot-time pagetables are still in use + * + * Written by Dave Hansen <haveblue@us.ibm.com> + */ + + +/* + * We need to use the 2-level pagetable functions, but CONFIG_X86_PAE + * keeps that from happenning. If anyone has a better way, I'm listening. + * + * boot_pte_t is defined only if this all works correctly + */ + +#include <linux/config.h> +#undef CONFIG_X86_PAE +#include <asm/page.h> +#include <asm/pgtable.h> +#include <linux/init.h> +#include <linux/stddef.h> + +/* + * I'm cheating here. It is known that the two boot PTE pages are + * allocated next to each other. I'm pretending that they're just + * one big array. + */ + +#define BOOT_PTE_PTRS (PTRS_PER_PTE*2) +#define boot_pte_index(address) \ + (((address) >> PAGE_SHIFT) & (BOOT_PTE_PTRS - 1)) + +static inline boot_pte_t* boot_vaddr_to_pte(void *address) +{ + boot_pte_t* boot_pg = (boot_pte_t*)pg0; + return &boot_pg[boot_pte_index((unsigned long)address)]; +} + +/* + * This is only for a caller who is clever enough to page-align + * phys_addr and virtual_source, and who also has a preference + * about which virtual address from which to steal ptes + */ +static void __boot_ioremap(unsigned long phys_addr, unsigned long nrpages, + void* virtual_source) +{ + boot_pte_t* pte; + int i; + + pte = boot_vaddr_to_pte(virtual_source); + for (i=0; i < nrpages; i++, phys_addr += PAGE_SIZE, pte++) { + set_pte(pte, pfn_pte(phys_addr>>PAGE_SHIFT, PAGE_KERNEL)); + } +} + +/* the virtual space we're going to remap comes from this array */ +#define BOOT_IOREMAP_PAGES 4 +#define BOOT_IOREMAP_SIZE (BOOT_IOREMAP_PAGES*PAGE_SIZE) +__initdata char boot_ioremap_space[BOOT_IOREMAP_SIZE] + __attribute__ ((aligned (PAGE_SIZE))); + +/* + * This only applies to things which need to ioremap before paging_init() + * bt_ioremap() and plain ioremap() are both useless at this point. + * + * When used, we're still using the boot-time pagetables, which only + * have 2 PTE pages mapping the first 8MB + * + * There is no unmap. The boot-time PTE pages aren't used after boot. + * If you really want the space back, just remap it yourself. + * boot_ioremap(&ioremap_space-PAGE_OFFSET, BOOT_IOREMAP_SIZE) + */ +__init void* boot_ioremap(unsigned long phys_addr, unsigned long size) +{ + unsigned long last_addr, offset; + unsigned int nrpages; + + last_addr = phys_addr + size - 1; + + /* page align the requested address */ + offset = phys_addr & ~PAGE_MASK; + phys_addr &= PAGE_MASK; + size = PAGE_ALIGN(last_addr) - phys_addr; + + nrpages = size >> PAGE_SHIFT; + if (nrpages > BOOT_IOREMAP_PAGES) + return NULL; + + __boot_ioremap(phys_addr, nrpages, boot_ioremap_space); + + return &boot_ioremap_space[offset]; +} diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index ce54c1886dbc..0f136b70678d 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c @@ -284,6 +284,7 @@ void __init zone_sizes_init(void) for (nid = 0; nid < numnodes; nid++) { unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; + unsigned long *zholes_size; unsigned int max_dma; unsigned long low = max_low_pfn; @@ -307,6 +308,7 @@ void __init zone_sizes_init(void) #endif } } + zholes_size = get_zholes_size(nid); /* * We let the lmem_map for node 0 be allocated from the * normal bootmem allocator, but other nodes come from the @@ -315,10 +317,10 @@ void __init zone_sizes_init(void) if (nid) free_area_init_node(nid, NODE_DATA(nid), node_remap_start_vaddr[nid], zones_size, - start, 0); + start, zholes_size); else free_area_init_node(nid, NODE_DATA(nid), 0, - zones_size, start, 0); + zones_size, start, zholes_size); } return; } diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c index 071097273504..6b37833292aa 100644 --- a/arch/i386/mm/hugetlbpage.c +++ b/arch/i386/mm/hugetlbpage.c @@ -29,6 +29,8 @@ static long htlbzone_pages; static LIST_HEAD(htlbpage_freelist); static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED; +void free_huge_page(struct page *page); + static struct page *alloc_hugetlb_page(void) { int i; @@ -45,7 +47,7 @@ static struct page *alloc_hugetlb_page(void) htlbpagemem--; spin_unlock(&htlbpage_lock); set_page_count(page, 1); - page->lru.prev = (void *)huge_page_release; + page->lru.prev = (void *)free_huge_page; for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i) clear_highpage(&page[i]); return page; diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c index 8a6809bd624e..f5ed94a11bce 100644 --- a/arch/i386/mm/ioremap.c +++ b/arch/i386/mm/ioremap.c @@ -205,6 +205,7 @@ void *ioremap_nocache (unsigned long phys_addr, unsigned long size) iounmap(p); p = NULL; } + global_flush_tlb(); } return p; @@ -226,6 +227,7 @@ void iounmap(void *addr) change_page_attr(virt_to_page(__va(p->phys_addr)), p->size >> PAGE_SHIFT, PAGE_KERNEL); + global_flush_tlb(); } kfree(p); } diff --git a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c index 50b8df7dd138..c6b4c17f10fa 100644 --- a/arch/i386/pci/visws.c +++ b/arch/i386/pci/visws.c @@ -52,7 +52,7 @@ static int __init visws_map_irq(struct pci_dev *dev, u8 slot, u8 pin) pin--; - /* Nothing usefull at PIIX4 pin 1 */ + /* Nothing useful at PIIX4 pin 1 */ if (bus == pci_bus0 && slot == 4 && pin == 0) return -1; diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c index de4213cf1a5a..6715c8ad2456 100644 --- a/arch/ia64/ia32/ia32_signal.c +++ b/arch/ia64/ia32/ia32_signal.c @@ -338,7 +338,7 @@ restore_ia32_fpstate_live (struct _fpstate_ia32 *save) /* * Updating fsr, fcr, fir, fdr. * Just a bit more complicated than save. - * - Need to make sure that we dont write any value other than the + * - Need to make sure that we don't write any value other than the * specific fpstate info * - Need to make sure that the untouched part of frs, fdr, fir, fcr * should remain same while writing. diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c index 91ac80986823..a35b32f48655 100644 --- a/arch/ia64/kernel/irq.c +++ b/arch/ia64/kernel/irq.c @@ -104,7 +104,7 @@ static void ack_none(unsigned int irq) { /* * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesnt deserve + * each architecture has to answer this themselves, it doesn't deserve * a generic callback i think. */ #if CONFIG_X86 diff --git a/arch/ia64/kernel/minstate.h b/arch/ia64/kernel/minstate.h index ed1d91daafac..800c929e93d4 100644 --- a/arch/ia64/kernel/minstate.h +++ b/arch/ia64/kernel/minstate.h @@ -26,7 +26,7 @@ */ /* - * For ivt.s we want to access the stack virtually so we dont have to disable translation + * For ivt.s we want to access the stack virtually so we don't have to disable translation * on interrupts. */ #define MINSTATE_START_SAVE_MIN_VIRT \ @@ -52,7 +52,7 @@ /* * For mca_asm.S we want to access the stack physically since the state is saved before we - * go virtual and dont want to destroy the iip or ipsr. + * go virtual and don't want to destroy the iip or ipsr. */ #define MINSTATE_START_SAVE_MIN_PHYS \ (pKStk) movl sp=ia64_init_stack+IA64_STK_OFFSET-IA64_PT_REGS_SIZE; \ diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 4a63c27ac26d..9dfd3968dd64 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -718,7 +718,7 @@ pfm_remap_buffer(struct vm_area_struct *vma, unsigned long buf, unsigned long ad /* * counts the number of PMDS to save per entry. - * This code is generic enough to accomodate more than 64 PMDS when they become available + * This code is generic enough to accommodate more than 64 PMDS when they become available */ static unsigned long pfm_smpl_entry_size(unsigned long *which, unsigned long size) diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index b85fe8b701b2..bf603c142328 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -27,7 +27,7 @@ extern unsigned long wall_jiffies; extern unsigned long last_time_offset; -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; #ifdef CONFIG_IA64_DEBUG_IRQ diff --git a/arch/ia64/lib/checksum.c b/arch/ia64/lib/checksum.c index c642c346adb3..f4b64765ecbf 100644 --- a/arch/ia64/lib/checksum.c +++ b/arch/ia64/lib/checksum.c @@ -50,7 +50,7 @@ csum_tcpudp_nofold (unsigned long saddr, unsigned long daddr, unsigned short len ((unsigned long) ntohs(len) << 16) + ((unsigned long) proto << 8)); - /* Fold down to 32-bits so we don't loose in the typedef-less network stack. */ + /* Fold down to 32-bits so we don't lose in the typedef-less network stack. */ /* 64 to 33 */ result = (result & 0xffffffff) + (result >> 32); /* 33 to 32 */ diff --git a/arch/ia64/lib/do_csum.S b/arch/ia64/lib/do_csum.S index 5eed93665a40..c3bc67df7f7b 100644 --- a/arch/ia64/lib/do_csum.S +++ b/arch/ia64/lib/do_csum.S @@ -41,7 +41,7 @@ // into one 8 byte word. In this case we have only one entry in the pipeline. // // We use a (LOAD_LATENCY+2)-stage pipeline in the loop to account for -// possible load latency and also to accomodate for head and tail. +// possible load latency and also to accommodate for head and tail. // // The end of the function deals with folding the checksum from 64bits // down to 16bits taking care of the carry. diff --git a/arch/ia64/lib/swiotlb.c b/arch/ia64/lib/swiotlb.c index f390da81d018..52a9df383b22 100644 --- a/arch/ia64/lib/swiotlb.c +++ b/arch/ia64/lib/swiotlb.c @@ -359,7 +359,7 @@ mark_clean (void *addr, size_t size) * was provided for in a previous swiotlb_map_single call. All other usages are * undefined. * - * After this call, reads by the cpu to the buffer are guarenteed to see whatever the + * After this call, reads by the cpu to the buffer are guaranteed to see whatever the * device wrote there. */ void diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index f855cb69db21..e39bd20123a7 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c @@ -241,7 +241,7 @@ discontig_mem_init(void) * - build the nodedir for the node. This contains pointers to * the per-bank mem_map entries. * - fix the page struct "virtual" pointers. These are bank specific - * values that the paging system doesnt understand. + * values that the paging system doesn't understand. * - replicate the nodedir structure to other nodes */ diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c index c71ed65b5a2d..44b2f0cfd148 100644 --- a/arch/ia64/mm/hugetlbpage.c +++ b/arch/ia64/mm/hugetlbpage.c @@ -26,6 +26,8 @@ static long htlbzone_pages; static LIST_HEAD(htlbpage_freelist); static spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED; +void free_huge_page(struct page *page); + static struct page *alloc_hugetlb_page(void) { int i; @@ -42,6 +44,7 @@ static struct page *alloc_hugetlb_page(void) htlbpagemem--; spin_unlock(&htlbpage_lock); set_page_count(page, 1); + page->lru.prev = (void *)free_huge_page; for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i) clear_highpage(&page[i]); return page; diff --git a/arch/ia64/sn/fakeprom/fpmem.c b/arch/ia64/sn/fakeprom/fpmem.c index 041bf851ef0f..2c58cd9a1884 100644 --- a/arch/ia64/sn/fakeprom/fpmem.c +++ b/arch/ia64/sn/fakeprom/fpmem.c @@ -218,7 +218,7 @@ build_efi_memmap(void *md, int mdsize) } /* - * Check for the node 0 hole. Since banks cant + * Check for the node 0 hole. Since banks can't * span the hole, we only need to check if the end of * the range is the end of the hole. */ @@ -226,7 +226,7 @@ build_efi_memmap(void *md, int mdsize) numbytes -= NODE0_HOLE_SIZE; /* * UGLY hack - we must skip overr the kernel and - * PROM runtime services but we dont exactly where it is. + * PROM runtime services but we don't exactly where it is. * So lets just reserve: * node 0 * 0-1MB for PAL diff --git a/arch/ia64/sn/fakeprom/fw-emu.c b/arch/ia64/sn/fakeprom/fw-emu.c index 8ba4632dbb33..792abb0a59b9 100644 --- a/arch/ia64/sn/fakeprom/fw-emu.c +++ b/arch/ia64/sn/fakeprom/fw-emu.c @@ -757,7 +757,7 @@ sys_fw_init (const char *args, int arglen, int bsp) sal_systab->checksum = -checksum; /* If the checksum is correct, the kernel tries to use the - * table. We dont build enough table & the kernel aborts. + * table. We don't build enough table & the kernel aborts. * Note that the PROM hasd thhhe same problem!! */ diff --git a/arch/ia64/sn/io/hcl.c b/arch/ia64/sn/io/hcl.c index 22d8dda7309b..a8b8b98a6f81 100644 --- a/arch/ia64/sn/io/hcl.c +++ b/arch/ia64/sn/io/hcl.c @@ -467,7 +467,7 @@ hwgraph_register(devfs_handle_t de, const char *name, /* * We need to clean up! */ - printk(KERN_WARNING "HCL: Unable to set the connect point to it's parent 0x%p\n", + printk(KERN_WARNING "HCL: Unable to set the connect point to its parent 0x%p\n", (void *)new_devfs_handle); } diff --git a/arch/ia64/sn/io/sn1/pcibr.c b/arch/ia64/sn/io/sn1/pcibr.c index 6029f26613fe..92594ce11da6 100644 --- a/arch/ia64/sn/io/sn1/pcibr.c +++ b/arch/ia64/sn/io/sn1/pcibr.c @@ -2647,7 +2647,7 @@ pcibr_slot_addr_space_init(devfs_handle_t pcibr_vhdl, /* * The Adaptec 1160 FC Controller WAR #767995: * The part incorrectly ignores the upper 32 bits of a 64 bit - * address when decoding references to it's registers so to + * address when decoding references to its registers so to * keep it from responding to a bus cycle that it shouldn't * we only use I/O space to get at it's registers. Don't * enable memory space accesses on that PCI device. @@ -5113,7 +5113,7 @@ ate_freeze(pcibr_dmamap_t pcibr_dmamap, /* Bridge Hardware Bug WAR #484930: * Bridge can't handle updating External ATEs - * while DMA is occuring that uses External ATEs, + * while DMA is occurring that uses External ATEs, * even if the particular ATEs involved are disjoint. */ @@ -6844,7 +6844,7 @@ pcibr_xintr_preset(void *which_widget, * * This is the pcibr interrupt "wrapper" function that is called, * in interrupt context, to initiate the interrupt handler(s) registered - * (via pcibr_intr_alloc/connect) for the occuring interrupt. Non-threaded + * (via pcibr_intr_alloc/connect) for the occurring interrupt. Non-threaded * handlers will be called directly, and threaded handlers will have their * thread woken up. */ diff --git a/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c index a2d2ff2cab0b..5b8460ee01d1 100644 --- a/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c +++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_ate.c @@ -362,7 +362,7 @@ ate_freeze(pcibr_dmamap_t pcibr_dmamap, /* Bridge Hardware Bug WAR #484930: * Bridge can't handle updating External ATEs - * while DMA is occuring that uses External ATEs, + * while DMA is occurring that uses External ATEs, * even if the particular ATEs involved are disjoint. */ diff --git a/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c index b4ebde013027..9b2ce991d5f1 100644 --- a/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c +++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c @@ -849,7 +849,7 @@ pcibr_device_info_new( * will set the c_slot (which is suppose to represent the external * slot (i.e the slot number silk screened on the back of the I/O * brick)). So for PIC we need to adjust this "internal slot" num - * passed into us, into it's external representation. See comment + * passed into us, into its external representation. See comment * for the PCIBR_DEVICE_TO_SLOT macro for more information. */ NEW(pcibr_info); @@ -1527,7 +1527,7 @@ pcibr_attach2(devfs_handle_t xconn_vhdl, bridge_t *bridge, /* enable parity checking on PICs internal RAM */ pic_ctrl_reg |= PIC_CTRL_PAR_EN_RESP; pic_ctrl_reg |= PIC_CTRL_PAR_EN_ATE; - /* PIC BRINGUP WAR (PV# 862253): dont enable write request + /* PIC BRINGUP WAR (PV# 862253): don't enable write request * parity checking. */ if (!PCIBR_WAR_ENABLED(PV862253, pcibr_soft)) { diff --git a/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c index 857c98abe97a..4295a33e916d 100644 --- a/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c +++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_error.c @@ -1806,7 +1806,7 @@ pcibr_pioerror( * * CAUTION: Resetting bit BRIDGE_IRR_PCI_GRP_CLR, acknowledges * a group of interrupts. If while handling this error, - * some other error has occured, that would be + * some other error has occurred, that would be * implicitly cleared by this write. * Need a way to ensure we don't inadvertently clear some * other errors. diff --git a/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c index 01324f3511db..22b679e9d8ab 100644 --- a/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c +++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c @@ -842,7 +842,7 @@ printk("pcibr_xintr_preset: b_wid_int_upper 0x%lx b_wid_int_lower 0x%lx b_int_ho * * This is the pcibr interrupt "wrapper" function that is called, * in interrupt context, to initiate the interrupt handler(s) registered - * (via pcibr_intr_alloc/connect) for the occuring interrupt. Non-threaded + * (via pcibr_intr_alloc/connect) for the occurring interrupt. Non-threaded * handlers will be called directly, and threaded handlers will have their * thread woken up. */ diff --git a/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c b/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c index 3f9735725182..3d3fda15c7b3 100644 --- a/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c +++ b/arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c @@ -803,7 +803,7 @@ pcibr_slot_info_init(devfs_handle_t pcibr_vhdl, * 'min_gnt' and attempt to calculate a latency time. * * NOTE: For now if the device is on the 'real time' arbitration - * ring we dont set the latency timer. + * ring we don't set the latency timer. * * WAR: SGI's IOC3 and RAD devices target abort if you write a * single byte into their config space. So don't set the Latency @@ -852,7 +852,7 @@ pcibr_slot_info_init(devfs_handle_t pcibr_vhdl, } /* Get the PCI-X capability if running in PCI-X mode. If the func - * doesnt have a pcix capability, allocate a PCIIO_VENDOR_ID_NONE + * doesn't have a pcix capability, allocate a PCIIO_VENDOR_ID_NONE * pcibr_info struct so the device driver for that function is not * called. */ @@ -1449,7 +1449,7 @@ pcibr_slot_addr_space_init(devfs_handle_t pcibr_vhdl, /* * The Adaptec 1160 FC Controller WAR #767995: * The part incorrectly ignores the upper 32 bits of a 64 bit - * address when decoding references to it's registers so to + * address when decoding references to its registers so to * keep it from responding to a bus cycle that it shouldn't * we only use I/O space to get at it's registers. Don't * enable memory space accesses on that PCI device. diff --git a/arch/ia64/sn/kernel/llsc4.c b/arch/ia64/sn/kernel/llsc4.c index bc4ba40372f2..38373739789d 100644 --- a/arch/ia64/sn/kernel/llsc4.c +++ b/arch/ia64/sn/kernel/llsc4.c @@ -301,7 +301,7 @@ ran_conf_llsc(int thread) */ linei = randn(linecount, &seed); sharei = randn(2, &seed); - slinei = (linei + (linecount/2))%linecount; /* I dont like this - fix later */ + slinei = (linei + (linecount/2))%linecount; /* I don't like this - fix later */ linep = (dataline_t *)blocks[linei]; slinep = (dataline_t *)blocks[slinei]; diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index fab2d66140ca..f35daeb1b7ab 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c @@ -153,7 +153,7 @@ sn_map_nr (unsigned long addr) /** * early_sn_setup - early setup routine for SN platforms * - * Sets up an intial console to aid debugging. Intended primarily + * Sets up an initial console to aid debugging. Intended primarily * for bringup, it's only called if %BRINGUP and %CONFIG_IA64_EARLY_PRINTK * are turned on. See start_kernel() in init/main.c. */ @@ -172,7 +172,7 @@ early_sn_setup(void) /* * Parse enough of the SAL tables to locate the SAL entry point. Since, console - * IO on SN2 is done via SAL calls, early_printk wont work without this. + * IO on SN2 is done via SAL calls, early_printk won't work without this. * * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c. * Any changes to those file may have to be made hereas well. diff --git a/arch/ia64/sn/kernel/sn1/sn1_smp.c b/arch/ia64/sn/kernel/sn1/sn1_smp.c index affeb952350f..e24f97eba657 100644 --- a/arch/ia64/sn/kernel/sn1/sn1_smp.c +++ b/arch/ia64/sn/kernel/sn1/sn1_smp.c @@ -100,7 +100,7 @@ extern void smp_send_flush_tlb (void) __attribute((weak)); /* * The following table/struct is for remembering PTC coherency domains. It - * is also used to translate sapicid into cpuids. We dont want to start + * is also used to translate sapicid into cpuids. We don't want to start * cpus unless we know their cache domain. */ #ifdef PTC_NOTYET diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c index e0182d31d13d..1850229970c1 100644 --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c @@ -395,7 +395,7 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit mycnode = local_nodeid; /* - * For now, we dont want to spin uninterruptibly waiting + * For now, we don't want to spin uninterruptibly waiting * for the lock. Makes hangs hard to debug. */ local_irq_save(flags); @@ -506,7 +506,7 @@ sn_send_IPI_phys(long physid, int vector, int delivery_mode) pio_phys_write_mmr(p, val); #ifndef CONFIG_SHUB_1_0_SPECIFIC - /* doesnt work on shub 1.0 */ + /* doesn't work on shub 1.0 */ wait_piowc(); #endif } diff --git a/arch/m68k/ifpsp060/src/fpsp.S b/arch/m68k/ifpsp060/src/fpsp.S index 3dab89211bb1..73805f8304bf 100644 --- a/arch/m68k/ifpsp060/src/fpsp.S +++ b/arch/m68k/ifpsp060/src/fpsp.S @@ -2201,7 +2201,7 @@ fu_snan_s_p: mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp) mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp) -# now, we copy the default result to it's proper location +# now, we copy the default result to its proper location mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp) mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp) mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp) @@ -2241,7 +2241,7 @@ fu_operr_p_s: mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp) mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp) -# now, we copy the default result to it's proper location +# now, we copy the default result to its proper location mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp) mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp) mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp) @@ -2281,7 +2281,7 @@ fu_inex_s_p2: mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp) mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp) -# now, we copy the default result to it's proper location +# now, we copy the default result to its proper location mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp) mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp) mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp) diff --git a/arch/m68k/ifpsp060/src/isp.S b/arch/m68k/ifpsp060/src/isp.S index 4f29187c29aa..5a1e6fdc5c90 100644 --- a/arch/m68k/ifpsp060/src/isp.S +++ b/arch/m68k/ifpsp060/src/isp.S @@ -843,7 +843,7 @@ isp_acc_exit2: bra.l _real_access # if the addressing mode was (an)+ or -(an), the address register must -# be restored to it's pre-exception value before entering _real_access. +# be restored to its pre-exception value before entering _real_access. isp_restore: cmpi.b SPCOND_FLG(%a6),&restore_flg # do we need a restore? bne.b isp_restore_done # no diff --git a/arch/m68k/ifpsp060/src/pfpsp.S b/arch/m68k/ifpsp060/src/pfpsp.S index acc45c58c084..fbf9d6448315 100644 --- a/arch/m68k/ifpsp060/src/pfpsp.S +++ b/arch/m68k/ifpsp060/src/pfpsp.S @@ -2200,7 +2200,7 @@ fu_snan_s_p: mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp) mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp) -# now, we copy the default result to it's proper location +# now, we copy the default result to its proper location mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp) mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp) mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp) @@ -2240,7 +2240,7 @@ fu_operr_p_s: mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp) mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp) -# now, we copy the default result to it's proper location +# now, we copy the default result to its proper location mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp) mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp) mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp) @@ -2280,7 +2280,7 @@ fu_inex_s_p2: mov.l LOCAL_SIZE+2+EXC_PC(%sp),LOCAL_SIZE+2+EXC_PC-0xc(%sp) mov.l LOCAL_SIZE+EXC_EA(%sp),LOCAL_SIZE+EXC_EA-0xc(%sp) -# now, we copy the default result to it's proper location +# now, we copy the default result to its proper location mov.l LOCAL_SIZE+FP_DST_EX(%sp),LOCAL_SIZE+0x4(%sp) mov.l LOCAL_SIZE+FP_DST_HI(%sp),LOCAL_SIZE+0x8(%sp) mov.l LOCAL_SIZE+FP_DST_LO(%sp),LOCAL_SIZE+0xc(%sp) diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index a2ee7f8b4b3c..bbeeb3c4e744 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -3127,7 +3127,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1 moveb %d0,M162_SCC_CTRL_A jra 3f 5: - /* 166/167/177; its a CD2401 */ + /* 166/167/177; it's a CD2401 */ moveb #0,M167_CYCAR moveb M167_CYIER,%d2 moveb #0x02,M167_CYIER diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c index 03a38781e59e..ecae7f16d614 100644 --- a/arch/m68k/kernel/time.c +++ b/arch/m68k/kernel/time.c @@ -26,7 +26,7 @@ #include <linux/timex.h> #include <linux/profile.h> -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; static inline int set_rtc_mmss(unsigned long nowtime) { diff --git a/arch/m68k/math-emu/fp_util.S b/arch/m68k/math-emu/fp_util.S index 12e1e7863e1e..efe7981939a7 100644 --- a/arch/m68k/math-emu/fp_util.S +++ b/arch/m68k/math-emu/fp_util.S @@ -49,7 +49,7 @@ * is currently at that time unused, be careful if you want change * something here. %d0 and %d1 is always usable, sometimes %d2 (or * only the lower half) most function have to return the %a0 - * unmodified, so that the caller can immediatly reuse it. + * unmodified, so that the caller can immediately reuse it. */ .globl fp_ill, fp_end diff --git a/arch/m68k/q40/README b/arch/m68k/q40/README index 8bab59512ddf..79a46b054d00 100644 --- a/arch/m68k/q40/README +++ b/arch/m68k/q40/README @@ -16,7 +16,7 @@ For a list of kernel command-line options read the documentation for the particular device drivers. The floppy imposes a very high interrupt load on the CPU, approx 30K/s. -When something blocks interrupts (HD) it will loose some of them, so far +When something blocks interrupts (HD) it will lose some of them, so far this is not known to have caused any data loss. On highly loaded systems it can make the floppy very slow or practically stop. Other Q40 OS' simply poll the floppy for this reason - something that can't be done in Linux. diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 2c21cfb5337f..caf8a22d2498 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -119,7 +119,7 @@ void __init sun3_bootmem_alloc(unsigned long memory_start, unsigned long memory_ { unsigned long start_page; - /* align start/end to page boundries */ + /* align start/end to page boundaries */ memory_start = ((memory_start + (PAGE_SIZE-1)) & PAGE_MASK); memory_end = memory_end & PAGE_MASK; diff --git a/arch/m68knommu/kernel/ints.c b/arch/m68knommu/kernel/ints.c index f7a8eda2522d..290ad865b556 100644 --- a/arch/m68knommu/kernel/ints.c +++ b/arch/m68knommu/kernel/ints.c @@ -214,7 +214,7 @@ void sys_free_irq(unsigned int irq, void *dev_id) /* * Do we need these probe functions on the m68k? * - * ... may be usefull with ISA devices + * ... may be useful with ISA devices */ unsigned long probe_irq_on (void) { diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S index 7e50085c2840..43f1413494fa 100644 --- a/arch/m68knommu/kernel/syscalltable.S +++ b/arch/m68knommu/kernel/syscalltable.S @@ -14,6 +14,7 @@ #include <linux/config.h> #include <linux/sys.h> #include <linux/linkage.h> +#include <asm/unistd.h> .text ALIGN diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c index c12fb4af61fc..4f7e59167293 100644 --- a/arch/m68knommu/kernel/time.c +++ b/arch/m68knommu/kernel/time.c @@ -26,7 +26,7 @@ #define TICK_SIZE (tick_nsec / 1000) -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; static inline int set_rtc_mmss(unsigned long nowtime) { diff --git a/arch/m68knommu/platform/5307/entry.S b/arch/m68knommu/platform/5307/entry.S index 026871952fa1..2ea3f741e2b4 100644 --- a/arch/m68knommu/platform/5307/entry.S +++ b/arch/m68knommu/platform/5307/entry.S @@ -27,6 +27,7 @@ #include <linux/config.h> #include <linux/sys.h> #include <linux/linkage.h> +#include <asm/unistd.h> #include <asm/thread_info.h> #include <asm/errno.h> #include <asm/setup.h> diff --git a/arch/m68knommu/platform/5307/vectors.c b/arch/m68knommu/platform/5307/vectors.c index 01fd2ecd2f58..6c0813d203d7 100644 --- a/arch/m68knommu/platform/5307/vectors.c +++ b/arch/m68knommu/platform/5307/vectors.c @@ -13,6 +13,7 @@ #include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> +#include <linux/unistd.h> #include <asm/irq.h> #include <asm/dma.h> #include <asm/traps.h> diff --git a/arch/m68knommu/platform/68360/ints.c b/arch/m68knommu/platform/68360/ints.c index c209d406cb99..7885623f2d5c 100644 --- a/arch/m68knommu/platform/68360/ints.c +++ b/arch/m68knommu/platform/68360/ints.c @@ -291,7 +291,7 @@ void M68360_do_irq(int vec, struct pt_regs *fp) /* unsigned long pend = *(volatile unsigned long *)pquicc->intr_cipr; */ - /* Bugger all that wierdness. For the moment, I seem to know where I came from; + /* Bugger all that weirdness. For the moment, I seem to know where I came from; * vec is passed from a specific ISR, so I'll use it. */ if (int_irq_list[irq] && int_irq_list[irq]->handler) { diff --git a/arch/mips/au1000/common/serial.c b/arch/mips/au1000/common/serial.c index 64d0ae0299ed..84a926570f13 100644 --- a/arch/mips/au1000/common/serial.c +++ b/arch/mips/au1000/common/serial.c @@ -2703,7 +2703,7 @@ static int __init rs_init(void) * port exists and is in use an error is returned. If the port * is not currently in the table it is added. * - * The port is then probed and if neccessary the IRQ is autodetected + * The port is then probed and if necessary the IRQ is autodetected * If this fails an error is returned. * * On success the port is ready to use and the line number is returned. diff --git a/arch/mips/baget/wbflush.c b/arch/mips/baget/wbflush.c index 64c60bc7100f..db3308a3b3de 100644 --- a/arch/mips/baget/wbflush.c +++ b/arch/mips/baget/wbflush.c @@ -17,7 +17,7 @@ void __init wbflush_setup(void) } /* - * Baget/MIPS doesnt need to write back the WB. + * Baget/MIPS doesn't need to write back the WB. */ static void wbflush_baget(void) { diff --git a/arch/mips/ddb5xxx/common/pci.c b/arch/mips/ddb5xxx/common/pci.c index 17aeea278804..5c1e07f6edbb 100644 --- a/arch/mips/ddb5xxx/common/pci.c +++ b/arch/mips/ddb5xxx/common/pci.c @@ -20,7 +20,7 @@ * Strategies: * * . We rely on pci_auto.c file to assign PCI resources (MEM and IO) - * TODO: this shold be optional for some machines where they do have + * TODO: this should be optional for some machines where they do have * a real "pcibios" that does resource assignment. * * . We then use pci_scan_bus() to "discover" all the resources for diff --git a/arch/mips/dec/boot/decstation.c b/arch/mips/dec/boot/decstation.c index b8f8c2e05728..f7e3dc36656d 100644 --- a/arch/mips/dec/boot/decstation.c +++ b/arch/mips/dec/boot/decstation.c @@ -70,7 +70,7 @@ void dec_entry(int argc, char **argv, #ifdef RELOC /* - * Now copy kernel image to it's destination. + * Now copy kernel image to its destination. */ len = ((unsigned long) (&_end) - k_start); memcpy((void *)k_start, &_ftext, len); diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index 446f28d33c7f..cf6fb793e8e0 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c @@ -44,7 +44,7 @@ static void ack_none(unsigned int irq) { /* * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesnt deserve + * each architecture has to answer this themselves, it doesn't deserve * a generic callback i think. */ printk("unexpected interrupt %d\n", irq); diff --git a/arch/mips/kernel/pci.c b/arch/mips/kernel/pci.c index e13151386427..81aea7026fa2 100644 --- a/arch/mips/kernel/pci.c +++ b/arch/mips/kernel/pci.c @@ -19,7 +19,7 @@ * Strategies: * * . We rely on pci_auto.c file to assign PCI resources (MEM and IO) - * TODO: this shold be optional for some machines where they do have + * TODO: this should be optional for some machines where they do have * a real "pcibios" that does resource assignment. * * . We then use pci_scan_bus() to "discover" all the resources for diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index a775854fd64c..2511f9d4f630 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -112,7 +112,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, p->thread.reg31 = (unsigned long) ret_from_fork; /* - * New tasks loose permission to use the fpu. This accelerates context + * New tasks lose permission to use the fpu. This accelerates context * switching for most programs since they don't use the fpu. */ p->thread.cp0_status = read_32bit_cp0_register(CP0_STATUS) & diff --git a/arch/mips/kernel/r2300_misc.S b/arch/mips/kernel/r2300_misc.S index 30031e295b8d..8ef3683f983d 100644 --- a/arch/mips/kernel/r2300_misc.S +++ b/arch/mips/kernel/r2300_misc.S @@ -76,7 +76,7 @@ /* Check is PTE is present, if not then jump to LABEL. * PTR points to the page table where this PTE is located, * when the macro is done executing PTE will be restored - * with it's original value. + * with its original value. */ #define PTE_PRESENT(pte, ptr, label) \ andi pte, pte, (_PAGE_PRESENT | _PAGE_READ); \ diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S index 973dbb271da7..aefdff8645e7 100644 --- a/arch/mips/kernel/r2300_switch.S +++ b/arch/mips/kernel/r2300_switch.S @@ -80,7 +80,7 @@ LEAF(lazy_fpu_switch) beqz a0, 2f # Save floating point state nor t3, zero, t3 .set reorder - lw t1, ST_OFF(a0) # last thread looses fpu + lw t1, ST_OFF(a0) # last thread loses fpu and t1, t3 sw t1, ST_OFF(a0) FPU_SAVE_SINGLE(a0, t1) # clobbers t1 @@ -108,7 +108,7 @@ LEAF(restore_fp) /* * Load the FPU with signalling NANS. This bit pattern we're using has - * the property that no matter wether considered as single or as double + * the property that no matter whether considered as single or as double * precission represents signaling NANS. * * We initialize fcr31 to rounding to nearest, no exceptions. diff --git a/arch/mips/kernel/r4k_misc.S b/arch/mips/kernel/r4k_misc.S index e16820f889c0..510b08ca9d16 100644 --- a/arch/mips/kernel/r4k_misc.S +++ b/arch/mips/kernel/r4k_misc.S @@ -93,7 +93,7 @@ /* Check is PTE is present, if not then jump to LABEL. * PTR points to the page table where this PTE is located, * when the macro is done executing PTE will be restored - * with it's original value. + * with its original value. */ #define PTE_PRESENT(pte, ptr, label) \ andi pte, pte, (_PAGE_PRESENT | _PAGE_READ); \ diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index c455538a9ebe..18d5ae71abe3 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S @@ -85,7 +85,7 @@ LEAF(lazy_fpu_switch) beqz a0, 2f # Save floating point state nor t3, zero, t3 - lw t1, ST_OFF(a0) # last thread looses fpu + lw t1, ST_OFF(a0) # last thread loses fpu and t1, t3 sw t1, ST_OFF(a0) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 30634e314992..26a70f6d1a13 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -775,7 +775,7 @@ void __init setup_arch(char **cmdline_p) request_resource(&iomem_resource, res); /* - * We dont't know which RAM region contains kernel data, + * We don't know which RAM region contains kernel data, * so we try it repeatedly and let the resource manager * test it. */ diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 6adf09fdf6ad..f7551d197dfb 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -32,7 +32,7 @@ #define USECS_PER_JIFFY (1000000/HZ) #define USECS_PER_JIFFY_FRAC ((1000000ULL << 32) / HZ & 0xffffffff) -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; /* * forward reference diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 5a25242b368d..ea3d490934f0 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -793,7 +793,7 @@ void __init trap_init(void) /* Some firmware leaves the BEV flag set, clear it. */ clear_cp0_status(ST0_BEV); - /* Copy the generic exception handler code to it's final destination. */ + /* Copy the generic exception handler code to its final destination. */ memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80); memcpy((void *)(KSEG0 + 0x100), &except_vec2_generic, 0x80); memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80); @@ -805,7 +805,7 @@ void __init trap_init(void) set_except_vector(i, handle_reserved); /* - * Copy the EJTAG debug exception vector handler code to it's final + * Copy the EJTAG debug exception vector handler code to its final * destination. */ memcpy((void *)(KSEG0 + 0x300), &except_vec_ejtag_debug, 0x80); diff --git a/arch/mips/math-emu/dp_add.c b/arch/mips/math-emu/dp_add.c index 5a3158bbbc26..0c96f9b39de9 100644 --- a/arch/mips/math-emu/dp_add.c +++ b/arch/mips/math-emu/dp_add.c @@ -73,7 +73,7 @@ ieee754dp ieee754dp_add(ieee754dp x, ieee754dp y) return x; - /* Inifity handeling + /* Inifity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -92,7 +92,7 @@ ieee754dp ieee754dp_add(ieee754dp x, ieee754dp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return x; - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips/math-emu/dp_div.c b/arch/mips/math-emu/dp_div.c index fea2a0c13db9..2d3df92de6f5 100644 --- a/arch/mips/math-emu/dp_div.c +++ b/arch/mips/math-emu/dp_div.c @@ -72,7 +72,7 @@ ieee754dp ieee754dp_div(ieee754dp x, ieee754dp y) return x; - /* Infinity handeling + /* Infinity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -89,7 +89,7 @@ ieee754dp ieee754dp_div(ieee754dp x, ieee754dp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return ieee754dp_inf(xs ^ ys); - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips/math-emu/dp_mul.c b/arch/mips/math-emu/dp_mul.c index 9ec5d40605c7..51fc87ff52b6 100644 --- a/arch/mips/math-emu/dp_mul.c +++ b/arch/mips/math-emu/dp_mul.c @@ -72,7 +72,7 @@ ieee754dp ieee754dp_mul(ieee754dp x, ieee754dp y) return x; - /* Infinity handeling */ + /* Infinity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_ZERO): case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): diff --git a/arch/mips/math-emu/dp_sub.c b/arch/mips/math-emu/dp_sub.c index a56d352fc156..6af7edaa18ed 100644 --- a/arch/mips/math-emu/dp_sub.c +++ b/arch/mips/math-emu/dp_sub.c @@ -72,7 +72,7 @@ ieee754dp ieee754dp_sub(ieee754dp x, ieee754dp y) return x; - /* Inifity handeling + /* Inifity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -91,7 +91,7 @@ ieee754dp ieee754dp_sub(ieee754dp x, ieee754dp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return x; - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips/math-emu/ieee754.c b/arch/mips/math-emu/ieee754.c index 5e86e40c678f..3571107088b1 100644 --- a/arch/mips/math-emu/ieee754.c +++ b/arch/mips/math-emu/ieee754.c @@ -3,7 +3,7 @@ * * BUGS * not much dp done - * doesnt generate IEEE754_INEXACT + * doesn't generate IEEE754_INEXACT * */ /* diff --git a/arch/mips/math-emu/ieee754dp.c b/arch/mips/math-emu/ieee754dp.c index 0943d56ecfe1..f1647fb0318c 100644 --- a/arch/mips/math-emu/ieee754dp.c +++ b/arch/mips/math-emu/ieee754dp.c @@ -99,14 +99,14 @@ ieee754dp ieee754dp_bestnan(ieee754dp x, ieee754dp y) } -/* generate a normal/denormal number with over,under handeling +/* generate a normal/denormal number with over,under handling * sn is sign * xe is an unbiased exponent * xm is 3bit extended precision value. */ ieee754dp ieee754dp_format(int sn, int xe, unsigned long long xm) { - assert(xm); /* we dont gen exact zeros (probably should) */ + assert(xm); /* we don't gen exact zeros (probably should) */ assert((xm >> (DP_MBITS + 1 + 3)) == 0); /* no execess */ assert(xm & (DP_HIDDEN_BIT << 3)); diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c index 511ec8de5b27..29546fcf0d05 100644 --- a/arch/mips/math-emu/ieee754sp.c +++ b/arch/mips/math-emu/ieee754sp.c @@ -100,14 +100,14 @@ ieee754sp ieee754sp_bestnan(ieee754sp x, ieee754sp y) } -/* generate a normal/denormal number with over,under handeling +/* generate a normal/denormal number with over,under handling * sn is sign * xe is an unbiased exponent * xm is 3bit extended precision value. */ ieee754sp ieee754sp_format(int sn, int xe, unsigned xm) { - assert(xm); /* we dont gen exact zeros (probably should) */ + assert(xm); /* we don't gen exact zeros (probably should) */ assert((xm >> (SP_MBITS + 1 + 3)) == 0); /* no execess */ assert(xm & (SP_HIDDEN_BIT << 3)); diff --git a/arch/mips/math-emu/sp_add.c b/arch/mips/math-emu/sp_add.c index 61a050bf052d..af192ebb73fb 100644 --- a/arch/mips/math-emu/sp_add.c +++ b/arch/mips/math-emu/sp_add.c @@ -72,7 +72,7 @@ ieee754sp ieee754sp_add(ieee754sp x, ieee754sp y) return x; - /* Inifity handeling + /* Inifity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -91,7 +91,7 @@ ieee754sp ieee754sp_add(ieee754sp x, ieee754sp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return x; - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips/math-emu/sp_div.c b/arch/mips/math-emu/sp_div.c index 14a87a5503a3..6023377037f5 100644 --- a/arch/mips/math-emu/sp_div.c +++ b/arch/mips/math-emu/sp_div.c @@ -72,7 +72,7 @@ ieee754sp ieee754sp_div(ieee754sp x, ieee754sp y) return x; - /* Infinity handeling + /* Infinity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -89,7 +89,7 @@ ieee754sp ieee754sp_div(ieee754sp x, ieee754sp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return ieee754sp_inf(xs ^ ys); - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips/math-emu/sp_fdp.c b/arch/mips/math-emu/sp_fdp.c index a7ce2f0e05e5..ea467be52b58 100644 --- a/arch/mips/math-emu/sp_fdp.c +++ b/arch/mips/math-emu/sp_fdp.c @@ -49,7 +49,7 @@ ieee754sp ieee754sp_fdp(ieee754dp x) case IEEE754_CLASS_ZERO: return ieee754sp_zero(xs); case IEEE754_CLASS_DNORM: - /* cant possibly be sp representable */ + /* can't possibly be sp representable */ SETCX(IEEE754_UNDERFLOW); return ieee754sp_xcpt(ieee754sp_zero(xs), "fdp", x); case IEEE754_CLASS_NORM: diff --git a/arch/mips/math-emu/sp_mul.c b/arch/mips/math-emu/sp_mul.c index cecf18fd65ee..9bcd5449be0d 100644 --- a/arch/mips/math-emu/sp_mul.c +++ b/arch/mips/math-emu/sp_mul.c @@ -72,7 +72,7 @@ ieee754sp ieee754sp_mul(ieee754sp x, ieee754sp y) return x; - /* Infinity handeling */ + /* Infinity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_ZERO): case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): diff --git a/arch/mips/math-emu/sp_sub.c b/arch/mips/math-emu/sp_sub.c index c28fc89351a3..e87e804f572d 100644 --- a/arch/mips/math-emu/sp_sub.c +++ b/arch/mips/math-emu/sp_sub.c @@ -72,7 +72,7 @@ ieee754sp ieee754sp_sub(ieee754sp x, ieee754sp y) return x; - /* Inifity handeling + /* Inifity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -91,7 +91,7 @@ ieee754sp ieee754sp_sub(ieee754sp x, ieee754sp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return x; - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c index 0a8ba48f3c4a..c9e84b11d87e 100644 --- a/arch/mips/mips-boards/generic/pci.c +++ b/arch/mips/mips-boards/generic/pci.c @@ -81,7 +81,7 @@ mips_pcibios_config_access(unsigned char access_type, struct pci_bus *bus_dev, u if (intr & (GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT)) { - /* Error occured */ + /* Error occurred */ /* Clear bits */ GT_WRITE( GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | diff --git a/arch/mips64/kernel/process.c b/arch/mips64/kernel/process.c index ee38f3512ae8..345aa74894ad 100644 --- a/arch/mips64/kernel/process.c +++ b/arch/mips64/kernel/process.c @@ -105,7 +105,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, p->thread.reg31 = (unsigned long) ret_from_fork; /* - * New tasks loose permission to use the fpu. This accelerates context + * New tasks lose permission to use the fpu. This accelerates context * switching for most programs since they don't use the fpu. */ p->thread.cp0_status = read_32bit_cp0_register(CP0_STATUS) & diff --git a/arch/mips64/kernel/r4k_switch.S b/arch/mips64/kernel/r4k_switch.S index 24db4edcc98d..a7b7edce73c0 100644 --- a/arch/mips64/kernel/r4k_switch.S +++ b/arch/mips64/kernel/r4k_switch.S @@ -79,7 +79,7 @@ LEAF(lazy_fpu_switch) beqz a0, 2f # Save floating point state nor t3, zero, t3 - ld t1, ST_OFF(a0) # last thread looses fpu + ld t1, ST_OFF(a0) # last thread loses fpu and t1, t3 sd t1, ST_OFF(a0) sll t2, t1, 5 diff --git a/arch/mips64/kernel/traps.c b/arch/mips64/kernel/traps.c index 7161c7f967af..023435ac92aa 100644 --- a/arch/mips64/kernel/traps.c +++ b/arch/mips64/kernel/traps.c @@ -497,7 +497,7 @@ void __init trap_init(void) /* Some firmware leaves the BEV flag set, clear it. */ set_cp0_status(ST0_BEV, 0); - /* Copy the generic exception handler code to it's final destination. */ + /* Copy the generic exception handler code to its final destination. */ memcpy((void *)(KSEG0 + 0x100), &except_vec2_generic, 0x80); memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80); diff --git a/arch/mips64/math-emu/dp_add.c b/arch/mips64/math-emu/dp_add.c index 5a3158bbbc26..0c96f9b39de9 100644 --- a/arch/mips64/math-emu/dp_add.c +++ b/arch/mips64/math-emu/dp_add.c @@ -73,7 +73,7 @@ ieee754dp ieee754dp_add(ieee754dp x, ieee754dp y) return x; - /* Inifity handeling + /* Inifity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -92,7 +92,7 @@ ieee754dp ieee754dp_add(ieee754dp x, ieee754dp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return x; - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips64/math-emu/dp_div.c b/arch/mips64/math-emu/dp_div.c index fea2a0c13db9..2d3df92de6f5 100644 --- a/arch/mips64/math-emu/dp_div.c +++ b/arch/mips64/math-emu/dp_div.c @@ -72,7 +72,7 @@ ieee754dp ieee754dp_div(ieee754dp x, ieee754dp y) return x; - /* Infinity handeling + /* Infinity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -89,7 +89,7 @@ ieee754dp ieee754dp_div(ieee754dp x, ieee754dp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return ieee754dp_inf(xs ^ ys); - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips64/math-emu/dp_mul.c b/arch/mips64/math-emu/dp_mul.c index 9ec5d40605c7..51fc87ff52b6 100644 --- a/arch/mips64/math-emu/dp_mul.c +++ b/arch/mips64/math-emu/dp_mul.c @@ -72,7 +72,7 @@ ieee754dp ieee754dp_mul(ieee754dp x, ieee754dp y) return x; - /* Infinity handeling */ + /* Infinity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_ZERO): case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): diff --git a/arch/mips64/math-emu/dp_sub.c b/arch/mips64/math-emu/dp_sub.c index a56d352fc156..6af7edaa18ed 100644 --- a/arch/mips64/math-emu/dp_sub.c +++ b/arch/mips64/math-emu/dp_sub.c @@ -72,7 +72,7 @@ ieee754dp ieee754dp_sub(ieee754dp x, ieee754dp y) return x; - /* Inifity handeling + /* Inifity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -91,7 +91,7 @@ ieee754dp ieee754dp_sub(ieee754dp x, ieee754dp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return x; - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips64/math-emu/ieee754dp.c b/arch/mips64/math-emu/ieee754dp.c index 0943d56ecfe1..f1647fb0318c 100644 --- a/arch/mips64/math-emu/ieee754dp.c +++ b/arch/mips64/math-emu/ieee754dp.c @@ -99,14 +99,14 @@ ieee754dp ieee754dp_bestnan(ieee754dp x, ieee754dp y) } -/* generate a normal/denormal number with over,under handeling +/* generate a normal/denormal number with over,under handling * sn is sign * xe is an unbiased exponent * xm is 3bit extended precision value. */ ieee754dp ieee754dp_format(int sn, int xe, unsigned long long xm) { - assert(xm); /* we dont gen exact zeros (probably should) */ + assert(xm); /* we don't gen exact zeros (probably should) */ assert((xm >> (DP_MBITS + 1 + 3)) == 0); /* no execess */ assert(xm & (DP_HIDDEN_BIT << 3)); diff --git a/arch/mips64/math-emu/ieee754sp.c b/arch/mips64/math-emu/ieee754sp.c index 511ec8de5b27..29546fcf0d05 100644 --- a/arch/mips64/math-emu/ieee754sp.c +++ b/arch/mips64/math-emu/ieee754sp.c @@ -100,14 +100,14 @@ ieee754sp ieee754sp_bestnan(ieee754sp x, ieee754sp y) } -/* generate a normal/denormal number with over,under handeling +/* generate a normal/denormal number with over,under handling * sn is sign * xe is an unbiased exponent * xm is 3bit extended precision value. */ ieee754sp ieee754sp_format(int sn, int xe, unsigned xm) { - assert(xm); /* we dont gen exact zeros (probably should) */ + assert(xm); /* we don't gen exact zeros (probably should) */ assert((xm >> (SP_MBITS + 1 + 3)) == 0); /* no execess */ assert(xm & (SP_HIDDEN_BIT << 3)); diff --git a/arch/mips64/math-emu/sp_add.c b/arch/mips64/math-emu/sp_add.c index 61a050bf052d..af192ebb73fb 100644 --- a/arch/mips64/math-emu/sp_add.c +++ b/arch/mips64/math-emu/sp_add.c @@ -72,7 +72,7 @@ ieee754sp ieee754sp_add(ieee754sp x, ieee754sp y) return x; - /* Inifity handeling + /* Inifity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -91,7 +91,7 @@ ieee754sp ieee754sp_add(ieee754sp x, ieee754sp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return x; - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips64/math-emu/sp_div.c b/arch/mips64/math-emu/sp_div.c index 14a87a5503a3..6023377037f5 100644 --- a/arch/mips64/math-emu/sp_div.c +++ b/arch/mips64/math-emu/sp_div.c @@ -72,7 +72,7 @@ ieee754sp ieee754sp_div(ieee754sp x, ieee754sp y) return x; - /* Infinity handeling + /* Infinity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -89,7 +89,7 @@ ieee754sp ieee754sp_div(ieee754sp x, ieee754sp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return ieee754sp_inf(xs ^ ys); - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips64/math-emu/sp_fdp.c b/arch/mips64/math-emu/sp_fdp.c index a7ce2f0e05e5..ea467be52b58 100644 --- a/arch/mips64/math-emu/sp_fdp.c +++ b/arch/mips64/math-emu/sp_fdp.c @@ -49,7 +49,7 @@ ieee754sp ieee754sp_fdp(ieee754dp x) case IEEE754_CLASS_ZERO: return ieee754sp_zero(xs); case IEEE754_CLASS_DNORM: - /* cant possibly be sp representable */ + /* can't possibly be sp representable */ SETCX(IEEE754_UNDERFLOW); return ieee754sp_xcpt(ieee754sp_zero(xs), "fdp", x); case IEEE754_CLASS_NORM: diff --git a/arch/mips64/math-emu/sp_mul.c b/arch/mips64/math-emu/sp_mul.c index cecf18fd65ee..9bcd5449be0d 100644 --- a/arch/mips64/math-emu/sp_mul.c +++ b/arch/mips64/math-emu/sp_mul.c @@ -72,7 +72,7 @@ ieee754sp ieee754sp_mul(ieee754sp x, ieee754sp y) return x; - /* Infinity handeling */ + /* Infinity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_ZERO): case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_INF): diff --git a/arch/mips64/math-emu/sp_sub.c b/arch/mips64/math-emu/sp_sub.c index c28fc89351a3..e87e804f572d 100644 --- a/arch/mips64/math-emu/sp_sub.c +++ b/arch/mips64/math-emu/sp_sub.c @@ -72,7 +72,7 @@ ieee754sp ieee754sp_sub(ieee754sp x, ieee754sp y) return x; - /* Inifity handeling + /* Inifity handling */ case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_INF): @@ -91,7 +91,7 @@ ieee754sp ieee754sp_sub(ieee754sp x, ieee754sp y) case CLPAIR(IEEE754_CLASS_INF, IEEE754_CLASS_DNORM): return x; - /* Zero handeling + /* Zero handling */ case CLPAIR(IEEE754_CLASS_ZERO, IEEE754_CLASS_ZERO): diff --git a/arch/mips64/mips-boards/generic/pci.c b/arch/mips64/mips-boards/generic/pci.c index 513042d8bbf6..4e377c3e9716 100644 --- a/arch/mips64/mips-boards/generic/pci.c +++ b/arch/mips64/mips-boards/generic/pci.c @@ -87,7 +87,7 @@ mips_pcibios_config_access(unsigned char access_type, struct pci_dev *dev, if (intr & (GT_INTRCAUSE_MASABORT0_BIT | GT_INTRCAUSE_TARABORT0_BIT)) { - /* Error occured */ + /* Error occurred */ /* Clear bits */ GT_WRITE( GT_INTRCAUSE_OFS, ~(GT_INTRCAUSE_MASABORT0_BIT | diff --git a/arch/mips64/sgi-ip27/ip27-nmi.c b/arch/mips64/sgi-ip27/ip27-nmi.c index 8b03918f817a..8ba5ff58da0a 100644 --- a/arch/mips64/sgi-ip27/ip27-nmi.c +++ b/arch/mips64/sgi-ip27/ip27-nmi.c @@ -127,7 +127,7 @@ cont_nmi_dump(void) * This is for 2 reasons: * - sometimes a MMSC fail to NMI all cpus. * - on 512p SN0 system, the MMSC will only send NMIs to - * half the cpus. Unfortunately, we dont know which cpus may be + * half the cpus. Unfortunately, we don't know which cpus may be * NMIed - it depends on how the site chooses to configure. * * Note: it has been measure that it takes the MMSC up to 2.3 secs to diff --git a/arch/mips64/sgi-ip27/ip27-pci-dma.c b/arch/mips64/sgi-ip27/ip27-pci-dma.c index 88388cadf95e..fcb71869c6a4 100644 --- a/arch/mips64/sgi-ip27/ip27-pci-dma.c +++ b/arch/mips64/sgi-ip27/ip27-pci-dma.c @@ -74,7 +74,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, * must match what was provided for in a previous pci_map_single call. All * other usages are undefined. * - * After this call, reads by the cpu to the buffer are guarenteed to see + * After this call, reads by the cpu to the buffer are guaranteed to see * whatever the device wrote there. */ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 805debfbd2b7..d618a3bec3cc 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c @@ -349,7 +349,7 @@ txn_alloc_addr(int virt_irq) /* -** The alloc process needs to accept a parameter to accomodate limitations +** The alloc process needs to accept a parameter to accommodate limitations ** of the HW/SW which use these bits: ** Legacy PA I/O (GSC/NIO): 5 bits (architected EIM register) ** V-class (EPIC): 6 bits diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index 4de269b94c13..30f85ffa26ea 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c @@ -255,7 +255,7 @@ printk("Preparing to start counters\n"); } /* - * Open the device and initialize all of it's memory. The device is only + * Open the device and initialize all of its memory. The device is only * opened once, but can be "queried" by multiple processes that know its * file descriptor. */ diff --git a/arch/parisc/kernel/perf_images.h b/arch/parisc/kernel/perf_images.h index 5af3a2072288..d53ee4f06cff 100644 --- a/arch/parisc/kernel/perf_images.h +++ b/arch/parisc/kernel/perf_images.h @@ -1556,7 +1556,7 @@ static uint32_t onyx_images[][PCXU_IMAGE_SIZE/sizeof(uint32_t)] = { * IRTN_AV fires twice for every I-cache miss returning from RIB to the IFU. * It will not fire if a second I-cache miss is issued from the IFU to RIB * before the first returns. Therefore, if the IRTN_AV count is much less - * than 2x the ICORE_AV count, many speculative I-cache misses are occuring + * than 2x the ICORE_AV count, many speculative I-cache misses are occurring * which are "discovered" to be incorrect fairly quickly. * The ratio of I-cache miss transactions on Runway to the ICORE_AV count is * a measure of the effectiveness of instruction prefetching. This ratio diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 2ab7cd2ef50c..213c9a349673 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c @@ -242,7 +242,7 @@ long sys_ptrace(long request, pid_t pid, long addr, long data) * * Allow writing to Nullify, Divide-step-correction, * and carry/borrow bits. - * BEWARE, if you set N, and then single step, it wont + * BEWARE, if you set N, and then single step, it won't * stop on the nullified instruction. */ DBG(("sys_ptrace(POKEUSR, %d, %lx, %lx)\n", diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index f45c62784333..9c3f03f25415 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -32,7 +32,7 @@ #include <linux/timex.h> -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; /* xtime and wall_jiffies keep wall-clock time */ extern unsigned long wall_jiffies; diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c index a4558ff37fbe..e09a211576a1 100644 --- a/arch/ppc/4xx_io/serial_sicc.c +++ b/arch/ppc/4xx_io/serial_sicc.c @@ -139,7 +139,7 @@ #define _LSR_RX_ERR (_LSR_LB_BREAK | _LSR_FE_MASK | _LSR_OE_MASK | \ _LSR_PE_MASK ) -/* serial port reciever command register */ +/* serial port receiver command register */ #define _RCR_ER_MASK 0x80 /* enable receiver mask */ #define _RCR_DME_MASK 0x60 /* dma mode */ diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index b63d6b46ab54..3b2aa8b10570 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c @@ -2495,7 +2495,7 @@ int __init tdm8xx_sound_init(void) cp->cp_simode &= ~0x00000fff; /* Enable common receive/transmit clock pins, use IDL format. - * Sync on falling edge, transmit rising clock, recieve falling + * Sync on falling edge, transmit rising clock, receive falling * clock, delay 1 bit on both Tx and Rx. Common Tx/Rx clocks and * sync. * Connect SMC2 to TSA. diff --git a/arch/ppc/kernel/l2cr.S b/arch/ppc/kernel/l2cr.S index 4625af465870..6a94c425a537 100644 --- a/arch/ppc/kernel/l2cr.S +++ b/arch/ppc/kernel/l2cr.S @@ -136,7 +136,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) /**** Might be a good idea to set L2DO here - to prevent instructions from getting into the cache. But since we invalidate the next time we enable the cache it doesn't really matter. - Don't do this unless you accomodate all processor variations. + Don't do this unless you accommodate all processor variations. The bit moved on the 7450..... ****/ diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 3fef611a7df8..da774859939b 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -68,7 +68,7 @@ #include <asm/time.h> /* XXX false sharing with below? */ -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; unsigned long disarm_decr[NR_CPUS]; diff --git a/arch/ppc/mm/mem_pieces.c b/arch/ppc/mm/mem_pieces.c index 149d31773aad..196da48ccbf3 100644 --- a/arch/ppc/mm/mem_pieces.c +++ b/arch/ppc/mm/mem_pieces.c @@ -1,6 +1,6 @@ /* * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au> - * Changes to accomodate Power Macintoshes. + * Changes to accommodate Power Macintoshes. * Cort Dougan <cort@cs.nmt.edu> * Rewrites. * Grant Erickson <grant@lcse.umn.edu> diff --git a/arch/ppc/mm/mem_pieces.h b/arch/ppc/mm/mem_pieces.h index bc8e2861c405..cd481c6b3e75 100644 --- a/arch/ppc/mm/mem_pieces.h +++ b/arch/ppc/mm/mem_pieces.h @@ -1,6 +1,6 @@ /* * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au> - * Changes to accomodate Power Macintoshes. + * Changes to accommodate Power Macintoshes. * Cort Dougan <cort@cs.nmt.edu> * Rewrites. * Grant Erickson <grant@lcse.umn.edu> diff --git a/arch/ppc/platforms/4xx/ibmstbx25.h b/arch/ppc/platforms/4xx/ibmstbx25.h index 954831398c63..9a2efc366e9c 100644 --- a/arch/ppc/platforms/4xx/ibmstbx25.h +++ b/arch/ppc/platforms/4xx/ibmstbx25.h @@ -164,7 +164,7 @@ #define IBM_CPM_CPU 0x10000000 /* PPC405B3 clock control */ #define IBM_CPM_AUD 0x08000000 /* Audio Decoder */ #define IBM_CPM_EBIU 0x04000000 /* External Bus Interface Unit */ -#define IBM_CPM_IRR 0x02000000 /* Infrared reciever */ +#define IBM_CPM_IRR 0x02000000 /* Infrared receiver */ #define IBM_CPM_DMA 0x01000000 /* DMA controller */ #define IBM_CPM_UART2 0x00200000 /* Serial Control Port */ #define IBM_CPM_UART1 0x00100000 /* Serial 1 / Infrared */ diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c index 04140eda53ab..c36b8c34c405 100644 --- a/arch/ppc/platforms/pmac_feature.c +++ b/arch/ppc/platforms/pmac_feature.c @@ -50,7 +50,7 @@ extern unsigned long powersave_nap; /* * We use a single global lock to protect accesses. Each driver has - * to take care of it's own locking + * to take care of its own locking */ static spinlock_t feature_lock __pmacdata = SPIN_LOCK_UNLOCKED; diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c index 151e6f825860..630976fd53fb 100644 --- a/arch/ppc/syslib/mpc10x_common.c +++ b/arch/ppc/syslib/mpc10x_common.c @@ -109,7 +109,7 @@ mpc10x_bridge_init(struct pci_controller *hose, return -1; } - /* Make sure its a supported bridge */ + /* Make sure it's a supported bridge */ early_read_config_dword(hose, 0, PCI_DEVFN(0,0), diff --git a/arch/ppc64/boot/addRamDisk.c b/arch/ppc64/boot/addRamDisk.c index f940d0f99177..7f2c09473394 100644 --- a/arch/ppc64/boot/addRamDisk.c +++ b/arch/ppc64/boot/addRamDisk.c @@ -154,7 +154,7 @@ int main(int argc, char **argv) /* Process the Sysmap file to determine where _end is */ sysmapPages = sysmapLen / 4096; - /* read the whole file line by line, expect that it doesnt fail */ + /* read the whole file line by line, expect that it doesn't fail */ while ( fgets(inbuf, 4096, sysmap) ) ; /* search for _end in the last page of the system map */ ptr_end = strstr(inbuf, " _end"); diff --git a/arch/ppc64/boot/addSystemMap.c b/arch/ppc64/boot/addSystemMap.c index 03b9187d0c00..0faf37551da9 100644 --- a/arch/ppc64/boot/addSystemMap.c +++ b/arch/ppc64/boot/addSystemMap.c @@ -146,7 +146,7 @@ int main(int argc, char **argv) /* Process the Sysmap file to determine the true end of the kernel */ sysmapPages = sysmapLen / 4096; printf("System map pages to copy = %ld\n", sysmapPages); - /* read the whole file line by line, expect that it doesnt fail */ + /* read the whole file line by line, expect that it doesn't fail */ while ( fgets(inbuf, 4096, sysmap) ) ; /* search for _end in the last page of the system map */ ptr_end = strstr(inbuf, " _end"); diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index 6264f3155ca2..8a36c641f07e 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S @@ -109,7 +109,7 @@ __secondary_hold_spinloop: .llong 0x0 /* Secondary processors write this value with their cpu # */ - /* after they enter the spin loop immediatly below. */ + /* after they enter the spin loop immediately below. */ .globl __secondary_hold_acknowledge __secondary_hold_acknowledge: .llong 0x0 diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c index 7e0f5aa3f670..788effdc19a6 100644 --- a/arch/ppc64/kernel/ioctl32.c +++ b/arch/ppc64/kernel/ioctl32.c @@ -3315,7 +3315,7 @@ out: * * But how to keep track of these kernel buffers? We'd need to either * keep track of them in some table _or_ know about usbdevicefs internals - * (ie. the exact layout of it's file private, which is actually defined + * (ie. the exact layout of its file private, which is actually defined * in linux/usbdevice_fs.h, the layout of the async queues are private to * devio.c) * diff --git a/arch/ppc64/kernel/lmb.c b/arch/ppc64/kernel/lmb.c index b07040587c8b..81d3ed1ad964 100644 --- a/arch/ppc64/kernel/lmb.c +++ b/arch/ppc64/kernel/lmb.c @@ -73,7 +73,7 @@ lmb_init(void) _lmb->reserved.cnt = 1; } -/* This is only used here, it doesnt deserve to be in bitops.h */ +/* This is only used here, it doesn't deserve to be in bitops.h */ static __inline__ long cnt_trailing_zeros(unsigned long mask) { long cnt; diff --git a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c index f1e9f2d3f8a4..653759fcde14 100644 --- a/arch/ppc64/kernel/pSeries_lpar.c +++ b/arch/ppc64/kernel/pSeries_lpar.c @@ -461,7 +461,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, return -1; /* - * Since we try and ioremap PHBs we dont own, the pte insert + * Since we try and ioremap PHBs we don't own, the pte insert * will fail. However we must catch the failure in hash_page * or we will loop forever, so return -2 in this case. */ @@ -485,7 +485,7 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) for (i = 0; i < HPTES_PER_GROUP; i++) { - /* dont remove a bolted entry */ + /* don't remove a bolted entry */ lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset, (0x1UL << 4), &dummy1, &dummy2); diff --git a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c index 9f7b1651934d..f19cefd32715 100644 --- a/arch/ppc64/kernel/pci_dn.c +++ b/arch/ppc64/kernel/pci_dn.c @@ -150,7 +150,7 @@ is_devfn_node(struct device_node *dn, void *data) } /* This is the "slow" path for looking up a device_node from a - * pci_dev. It will hunt for the device under it's parent's + * pci_dev. It will hunt for the device under its parent's * phb and then update sysdata for a future fastpath. * * It may also do fixups on the actual device since this happens diff --git a/arch/ppc64/kernel/ras.c b/arch/ppc64/kernel/ras.c index c54143ed326e..d0af354a7701 100644 --- a/arch/ppc64/kernel/ras.c +++ b/arch/ppc64/kernel/ras.c @@ -94,7 +94,7 @@ void init_ras_IRQ(void) { /* * Handle power subsystem events (EPOW). * - * Presently we just log the event has occured. This should be fixed + * Presently we just log the event has occurred. This should be fixed * to examine the type of power failure and take appropriate action where * the time horizon permits something useful to be done. */ diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c index 389ac2d78eef..44bd8bb70914 100644 --- a/arch/ppc64/kernel/smp.c +++ b/arch/ppc64/kernel/smp.c @@ -51,7 +51,7 @@ int smp_threads_ready = 0; unsigned long cache_decay_ticks; -/* initialised so it doesnt end up in bss */ +/* initialised so it doesn't end up in bss */ unsigned long cpu_online_map = 0; static struct smp_ops_t *smp_ops; diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c index f534ae598edd..d008d5c6b39e 100644 --- a/arch/ppc64/kernel/time.c +++ b/arch/ppc64/kernel/time.c @@ -65,7 +65,7 @@ void smp_local_timer_interrupt(struct pt_regs *); -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; /* keep track of when we need to update the rtc */ time_t last_rtc_update; diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c index 4318a6c7318d..a2d0f517177b 100644 --- a/arch/ppc64/xmon/xmon.c +++ b/arch/ppc64/xmon/xmon.c @@ -2072,7 +2072,7 @@ find_tb_table(unsigned long codeaddr, struct tbtable *tab) int instr; int num_parms; - /* dont look for traceback table in userspace */ + /* don't look for traceback table in userspace */ if (codeaddr < PAGE_OFFSET) return 0; diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 800bbeb8016b..60f8059c5afa 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -46,7 +46,7 @@ #define TICK_SIZE tick -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; static ext_int_info_t ext_int_info_timer; static uint64_t xtime_cc; diff --git a/arch/s390x/kernel/time.c b/arch/s390x/kernel/time.c index 66115fc37677..53809f47e4b3 100644 --- a/arch/s390x/kernel/time.c +++ b/arch/s390x/kernel/time.c @@ -45,7 +45,7 @@ #define TICK_SIZE tick -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; static ext_int_info_t ext_int_info_timer; static uint64_t xtime_cc; diff --git a/arch/sh/kernel/fpu.c b/arch/sh/kernel/fpu.c index 70cac48db933..15abcfee266b 100644 --- a/arch/sh/kernel/fpu.c +++ b/arch/sh/kernel/fpu.c @@ -118,7 +118,7 @@ restore_fpu(struct task_struct *tsk) /* * Load the FPU with signalling NANS. This bit pattern we're using - * has the property that no matter wether considered as single or as + * has the property that no matter whether considered as single or as * double precission represents signaling NANS. */ diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index e44a5e5cf68b..ce84bd4af266 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -61,7 +61,7 @@ static void ack_none(unsigned int irq) { /* * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesnt deserve + * each architecture has to answer this themselves, it doesn't deserve * a generic callback i think. */ printk("unexpected IRQ trap at vector %02x\n", irq); diff --git a/arch/sh/kernel/pci-dma.c b/arch/sh/kernel/pci-dma.c index f941c3332e92..be0745b162c1 100644 --- a/arch/sh/kernel/pci-dma.c +++ b/arch/sh/kernel/pci-dma.c @@ -24,7 +24,7 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, ret = (void *) __get_free_pages(gfp, get_order(size)); if (ret != NULL) { - /* Is it neccessary to do the memset? */ + /* Is it necessary to do the memset? */ memset(ret, 0, size); *dma_handle = virt_to_bus(ret); } diff --git a/arch/sh/kernel/pci-sh7751.c b/arch/sh/kernel/pci-sh7751.c index 7159ecca92fc..9db302503b0a 100644 --- a/arch/sh/kernel/pci-sh7751.c +++ b/arch/sh/kernel/pci-sh7751.c @@ -285,7 +285,7 @@ void __init pcibios_init(void) struct pci_ops *bios = NULL; struct pci_ops *dir = NULL; - PCIDBG(1,"PCI: Starting intialization.\n"); + PCIDBG(1,"PCI: Starting initialization.\n"); #ifdef CONFIG_PCI_BIOS if ((pci_probe & PCI_PROBE_BIOS) && ((bios = pci_find_bios()))) { pci_probe |= PCI_BIOS_SORT; diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 5a17b0510284..3042f8483988 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -70,7 +70,7 @@ #endif /* CONFIG_CPU_SUBTYPE_ST40STB1 */ #endif /* __sh3__ or __SH4__ */ -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; extern unsigned long wall_jiffies; #define TICK_SIZE tick diff --git a/arch/sh/stboards/pcidma.c b/arch/sh/stboards/pcidma.c index 475311390fd6..bbaaded9cff5 100644 --- a/arch/sh/stboards/pcidma.c +++ b/arch/sh/stboards/pcidma.c @@ -24,7 +24,7 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, ret = (void *) __get_free_pages(gfp, get_order(size)); if (ret != NULL) { - /* Is it neccessary to do the memset? */ + /* Is it necessary to do the memset? */ memset(ret, 0, size); *dma_handle = virt_to_bus(ret); } diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c index e20422c9688e..814ea28ad6bf 100644 --- a/arch/sparc/kernel/init_task.c +++ b/arch/sparc/kernel/init_task.c @@ -12,7 +12,7 @@ static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); struct mm_struct init_mm = INIT_MM(init_mm); struct task_struct init_task = INIT_TASK(init_task); -/* .text section in head.S is aligned at 8k boundry and this gets linked +/* .text section in head.S is aligned at 8k boundary and this gets linked * right after that so that the init_thread_union is aligned properly as well. * If this is not aligned on a 8k boundry, then you should change code * in etrap.S which assumes it. diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 0c2d23b36896..3066f0cbc83b 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -599,7 +599,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, * must match what was provided for in a previous pci_map_single call. All * other usages are undefined. * - * After this call, reads by the cpu to the buffer are guarenteed to see + * After this call, reads by the cpu to the buffer are guaranteed to see * whatever the device wrote there. */ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size, diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index 0254734f1745..77e829f405bf 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c @@ -45,7 +45,7 @@ extern unsigned long wall_jiffies; -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; enum sparc_clock_type sp_clock_typ; diff --git a/arch/sparc/lib/blockops.S b/arch/sparc/lib/blockops.S index 3f09ec1dbaab..b018d18c79e2 100644 --- a/arch/sparc/lib/blockops.S +++ b/arch/sparc/lib/blockops.S @@ -38,7 +38,7 @@ * and (2 * PAGE_SIZE) (for kernel stacks) * and with a second arg of zero. We assume in * all of these cases that the buffer is aligned - * on at least an 8 byte boundry. + * on at least an 8 byte boundary. * * Therefore we special case them to make them * as fast as possible. diff --git a/arch/sparc/lib/checksum.S b/arch/sparc/lib/checksum.S index d02b6dfb2d87..3dc582592d8f 100644 --- a/arch/sparc/lib/checksum.S +++ b/arch/sparc/lib/checksum.S @@ -336,7 +336,7 @@ C_LABEL(__csum_partial_copy_sparc_generic): bne cc_dword_align ! yes, we check for short lengths there andcc %g1, 0xffffff80, %g0 ! can we use unrolled loop? 3: be 3f ! nope, less than one loop remains - andcc %o1, 4, %g0 ! dest aligned on 4 or 8 byte boundry? + andcc %o1, 4, %g0 ! dest aligned on 4 or 8 byte boundary? be ccdbl + 4 ! 8 byte aligned, kick ass 5: CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x00,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index e9aab3723ad1..9a55259ae6b2 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -2120,7 +2120,7 @@ static void __init get_srmmu_type(void) srmmu_is_bad(); } -/* dont laugh, static pagetables */ +/* don't laugh, static pagetables */ static void srmmu_check_pgt_cache(int low, int high) { } diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index 5b165f0d3b1b..1096a2df5e44 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c @@ -533,7 +533,7 @@ static inline void sun4c_init_ss2_cache_bug(void) } } -/* Addr is always aligned on a page boundry for us already. */ +/* Addr is always aligned on a page boundary for us already. */ static void sun4c_map_dma_area(unsigned long va, u32 addr, int len) { unsigned long page, end; @@ -1042,7 +1042,7 @@ static struct thread_info *sun4c_alloc_thread_info(void) get_locked_segment(addr); /* We are changing the virtual color of the page(s) - * so we must flush the cache to guarentee consistency. + * so we must flush the cache to guarantee consistency. */ sun4c_flush_page(pages); #ifndef CONFIG_SUN4 diff --git a/arch/sparc64/kernel/init_task.c b/arch/sparc64/kernel/init_task.c index 15f5c900bdc2..e0712ddcdcb6 100644 --- a/arch/sparc64/kernel/init_task.c +++ b/arch/sparc64/kernel/init_task.c @@ -12,7 +12,7 @@ static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); struct mm_struct init_mm = INIT_MM(init_mm); -/* .text section in head.S is aligned at 2 page boundry and this gets linked +/* .text section in head.S is aligned at 2 page boundary and this gets linked * right after that so that the init_thread_union is aligned properly as well. * We really don't need this special alignment like the Intel does, but * I do it anyways for completeness. diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index 4ca993184908..f31834f017dd 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -3947,7 +3947,7 @@ out: * * But how to keep track of these kernel buffers? We'd need to either * keep track of them in some table _or_ know about usbdevicefs internals - * (ie. the exact layout of it's file private, which is actually defined + * (ie. the exact layout of its file private, which is actually defined * in linux/usbdevice_fs.h, the layout of the async queues are private to * devio.c) * diff --git a/arch/sparc64/kernel/iommu_common.h b/arch/sparc64/kernel/iommu_common.h index 039744070ff6..ad791014419c 100644 --- a/arch/sparc64/kernel/iommu_common.h +++ b/arch/sparc64/kernel/iommu_common.h @@ -40,7 +40,7 @@ extern void verify_sglist(struct scatterlist *sg, int nents, iopte_t *iopte, int /* Two addresses are "virtually contiguous" if and only if: * 1) They are equal, or... - * 2) They are both on a page boundry + * 2) They are both on a page boundary */ #define VCONTIG(__X, __Y) (((__X) == (__Y)) || \ (((__X) | (__Y)) << (64UL - PAGE_SHIFT)) == 0UL) diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c index 5cc9117952e3..025639222b65 100644 --- a/arch/sparc64/kernel/pci_common.c +++ b/arch/sparc64/kernel/pci_common.c @@ -583,7 +583,7 @@ static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt * the PBM. * * However if that parent bridge has interrupt map/mask - * properties of it's own we use the PROM register property + * properties of its own we use the PROM register property * of the next child device on the path to PDEV. * * In detail the two cases are (note that the 'X' below is the diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c index 9a5f8a99cfdc..18b1997e1c64 100644 --- a/arch/sparc64/kernel/sbus.c +++ b/arch/sparc64/kernel/sbus.c @@ -24,7 +24,7 @@ #include "iommu_common.h" /* These should be allocated on an SMP_CACHE_BYTES - * aligned boundry for optimal performance. + * aligned boundary for optimal performance. * * On SYSIO, using an 8K page size we have 1GB of SBUS * DMA space mapped. We divide this space into equally diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index 3d716914b158..7503513d4bdc 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c @@ -47,7 +47,7 @@ unsigned long ds1287_regs = 0UL; extern unsigned long wall_jiffies; -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; static unsigned long mstk48t08_regs = 0UL; static unsigned long mstk48t59_regs = 0UL; diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 23e5a862f088..78901988b1ae 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c @@ -571,7 +571,7 @@ unsigned long __init cheetah_tune_scheduling(void) unsigned long flush_linesize = ecache_flush_linesize; unsigned long flush_size = ecache_flush_size; - /* Run through the whole cache to guarentee the timed loop + /* Run through the whole cache to guarantee the timed loop * is really displacing cache lines. */ __asm__ __volatile__("1: subcc %0, %4, %0\n\t" diff --git a/arch/sparc64/lib/U3copy_from_user.S b/arch/sparc64/lib/U3copy_from_user.S index a367d40e5854..c2ae2f4f4b8b 100644 --- a/arch/sparc64/lib/U3copy_from_user.S +++ b/arch/sparc64/lib/U3copy_from_user.S @@ -416,7 +416,7 @@ U3copy_from_user_toosmall: 2: VISEntryHalf ! MS+MS - /* Compute (len - (len % 8)) into %g2. This is guarenteed + /* Compute (len - (len % 8)) into %g2. This is guaranteed * to be nonzero. */ andn %o2, 0x7, %g2 ! A0 Group @@ -425,7 +425,7 @@ U3copy_from_user_toosmall: * one 8-byte longword past the end of src. It actually * does not, as %g2 is subtracted as loads are done from * src, so we always stop before running off the end. - * Also, we are guarenteed to have at least 0x10 bytes + * Also, we are guaranteed to have at least 0x10 bytes * to move here. */ sub %g2, 0x8, %g2 ! A0 Group (reg-dep) diff --git a/arch/sparc64/lib/U3copy_in_user.S b/arch/sparc64/lib/U3copy_in_user.S index e28d34ac05af..674e232b0a6b 100644 --- a/arch/sparc64/lib/U3copy_in_user.S +++ b/arch/sparc64/lib/U3copy_in_user.S @@ -447,7 +447,7 @@ U3copy_in_user_toosmall: 2: VISEntryHalf ! MS+MS - /* Compute (len - (len % 8)) into %g2. This is guarenteed + /* Compute (len - (len % 8)) into %g2. This is guaranteed * to be nonzero. */ andn %o2, 0x7, %g2 ! A0 Group @@ -456,7 +456,7 @@ U3copy_in_user_toosmall: * one 8-byte longword past the end of src. It actually * does not, as %g2 is subtracted as loads are done from * src, so we always stop before running off the end. - * Also, we are guarenteed to have at least 0x10 bytes + * Also, we are guaranteed to have at least 0x10 bytes * to move here. */ sub %g2, 0x8, %g2 ! A0 Group (reg-dep) diff --git a/arch/sparc64/lib/U3copy_to_user.S b/arch/sparc64/lib/U3copy_to_user.S index 055a61dc04b2..6b421fc2f12e 100644 --- a/arch/sparc64/lib/U3copy_to_user.S +++ b/arch/sparc64/lib/U3copy_to_user.S @@ -463,7 +463,7 @@ U3copy_to_user_toosmall: 2: VISEntryHalf ! MS+MS - /* Compute (len - (len % 8)) into %g2. This is guarenteed + /* Compute (len - (len % 8)) into %g2. This is guaranteed * to be nonzero. */ andn %o2, 0x7, %g2 ! A0 Group @@ -472,7 +472,7 @@ U3copy_to_user_toosmall: * one 8-byte longword past the end of src. It actually * does not, as %g2 is subtracted as loads are done from * src, so we always stop before running off the end. - * Also, we are guarenteed to have at least 0x10 bytes + * Also, we are guaranteed to have at least 0x10 bytes * to move here. */ sub %g2, 0x8, %g2 ! A0 Group (reg-dep) diff --git a/arch/sparc64/lib/U3memcpy.S b/arch/sparc64/lib/U3memcpy.S index a2f6bffedff8..45994010399e 100644 --- a/arch/sparc64/lib/U3memcpy.S +++ b/arch/sparc64/lib/U3memcpy.S @@ -344,7 +344,7 @@ U3memcpy_toosmall: 2: VISEntryHalf ! MS+MS - /* Compute (len - (len % 8)) into %g2. This is guarenteed + /* Compute (len - (len % 8)) into %g2. This is guaranteed * to be nonzero. */ andn %o2, 0x7, %g2 ! A0 Group @@ -353,7 +353,7 @@ U3memcpy_toosmall: * one 8-byte longword past the end of src. It actually * does not, as %g2 is subtracted as loads are done from * src, so we always stop before running off the end. - * Also, we are guarenteed to have at least 0x10 bytes + * Also, we are guaranteed to have at least 0x10 bytes * to move here. */ sub %g2, 0x8, %g2 ! A0 Group (reg-dep) diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c index 63895ce0202f..1c7138d4c174 100644 --- a/arch/sparc64/mm/hugetlbpage.c +++ b/arch/sparc64/mm/hugetlbpage.c @@ -25,6 +25,7 @@ spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED; extern long htlbpagemem; static void zap_hugetlb_resources(struct vm_area_struct *); +void free_huge_page(struct page *page); #define MAX_ID 32 struct htlbpagekey { @@ -64,6 +65,7 @@ static struct page *alloc_hugetlb_page(void) spin_unlock(&htlbpage_lock); set_page_count(page, 1); + page->lru.prev = (void *)free_huge_page; memset(page_address(page), 0, HPAGE_SIZE); return page; diff --git a/arch/sparc64/prom/misc.c b/arch/sparc64/prom/misc.c index 7315aa68e963..19c44e97e9ee 100644 --- a/arch/sparc64/prom/misc.c +++ b/arch/sparc64/prom/misc.c @@ -142,7 +142,7 @@ int prom_getprev(void) return prom_prev; } -/* Install Linux trap table so PROM uses that instead of it's own. */ +/* Install Linux trap table so PROM uses that instead of its own. */ void prom_set_trap_table(unsigned long tba) { p1275_cmd("SUNW,set-trap-table", P1275_INOUT(1, 0), tba); diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 53a79e319b20..ed749a24988b 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -45,7 +45,7 @@ static void ack_none(unsigned int irq) { /* * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesnt deserve + * each architecture has to answer this themselves, it doesn't deserve * a generic callback i think. */ #if CONFIG_X86 diff --git a/arch/v850/kernel/irq.c b/arch/v850/kernel/irq.c index 57b933476b80..7433c7f46653 100644 --- a/arch/v850/kernel/irq.c +++ b/arch/v850/kernel/irq.c @@ -48,7 +48,7 @@ static void ack_none(unsigned int irq) { /* * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesnt deserve + * each architecture has to answer this themselves, it doesn't deserve * a generic callback i think. */ printk("received IRQ %d with unknown interrupt type\n", irq); diff --git a/arch/v850/kernel/ma.c b/arch/v850/kernel/ma.c index 15a5c8fec137..0a44ed532823 100644 --- a/arch/v850/kernel/ma.c +++ b/arch/v850/kernel/ma.c @@ -61,7 +61,7 @@ void ma_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud) specific chips may have more). */ if (chan < 2) { unsigned bits = 0x3 << (chan * 3); - /* Specify that the relevent pins on the chip should do + /* Specify that the relevant pins on the chip should do serial I/O, not direct I/O. */ MA_PORT4_PMC |= bits; /* Specify that we're using the UART, not the CSI device. */ diff --git a/arch/v850/kernel/rte_cb_multi.c b/arch/v850/kernel/rte_cb_multi.c index 13db814a8919..b423efaf6411 100644 --- a/arch/v850/kernel/rte_cb_multi.c +++ b/arch/v850/kernel/rte_cb_multi.c @@ -67,7 +67,7 @@ void __init multi_init (void) if ((word & 0xFC0) == 0x780) { /* A `jr' insn, fix up its offset (and yes, the - wierd half-word swapping is intentional). */ + weird half-word swapping is intentional). */ unsigned short hi = word & 0xFFFF; unsigned short lo = word >> 16; unsigned long udisp22 diff --git a/arch/v850/kernel/rte_ma1_cb.c b/arch/v850/kernel/rte_ma1_cb.c index d4fb14e9b6a4..f22edc1af8fb 100644 --- a/arch/v850/kernel/rte_ma1_cb.c +++ b/arch/v850/kernel/rte_ma1_cb.c @@ -93,7 +93,7 @@ void __init mach_init_irqs (void) /* Turn on the timer. */ NB85E_TIMER_C_TMCC0 (tc) |= NB85E_TIMER_C_TMCC0_CAE; - /* Make sure the relevent port0/port1 pins are assigned + /* Make sure the relevant port0/port1 pins are assigned interrupt duty. We used INTP001-INTP011 (don't screw with INTP000 because the monitor uses it). */ MA_PORT0_PMC |= 0x4; /* P02 (INTP001) in IRQ mode. */ diff --git a/arch/v850/kernel/time.c b/arch/v850/kernel/time.c index a1ecf796407c..5558f6ca4145 100644 --- a/arch/v850/kernel/time.c +++ b/arch/v850/kernel/time.c @@ -25,7 +25,7 @@ #include "mach.h" -u64 jiffies_64; +u64 jiffies_64 = INITIAL_JIFFIES; #define TICK_SIZE (tick_nsec / 1000) diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c index a23409cf940f..9da5296018a5 100644 --- a/arch/x86_64/ia32/ia32_ioctl.c +++ b/arch/x86_64/ia32/ia32_ioctl.c @@ -3196,7 +3196,7 @@ out: * * But how to keep track of these kernel buffers? We'd need to either * keep track of them in some table _or_ know about usbdevicefs internals - * (ie. the exact layout of it's file private, which is actually defined + * (ie. the exact layout of its file private, which is actually defined * in linux/usbdevice_fs.h, the layout of the async queues are private to * devio.c) * diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index 0c2233e6d448..4f3520d829c9 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c @@ -292,7 +292,7 @@ void __init setup_local_APIC (void) __error_in_apic_c(); /* - * Double-check wether this APIC is really registered. + * Double-check whether this APIC is really registered. * This is meaningless in clustered apic mode, so we skip it. */ if (!clustered_apic_mode && @@ -948,7 +948,7 @@ void smp_local_timer_interrupt(struct pt_regs *regs) /* * Local APIC timer interrupt. This is the most natural way for doing * local interrupts, but local timer interrupts can be emulated by - * broadcast interrupts too. [in case the hw doesnt support APIC timers] + * broadcast interrupts too. [in case the hw doesn't support APIC timers] * * [ if a single-CPU system runs an SMP kernel then we call the local * interrupt as well. Thus we cannot inline the local irq ... ] diff --git a/arch/x86_64/kernel/bluesmoke.c b/arch/x86_64/kernel/bluesmoke.c index 12c339655be6..4a60fa6003a5 100644 --- a/arch/x86_64/kernel/bluesmoke.c +++ b/arch/x86_64/kernel/bluesmoke.c @@ -120,7 +120,7 @@ static void mce_checkregs (void *info) rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high); if ((low | high) != 0) { - printk (KERN_EMERG "MCE: The hardware reports a non fatal, correctable incident occured on CPU %d.\n", smp_processor_id()); + printk (KERN_EMERG "MCE: The hardware reports a non fatal, correctable incident occurred on CPU %d.\n", smp_processor_id()); printk (KERN_EMERG "Bank %d: %08x%08x\n", i, high, low); /* Scrub the error so we don't pick it up in MCE_RATE seconds time. */ diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index c82c2332b73b..2ead9043b5aa 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c @@ -204,7 +204,7 @@ void __init e820_reserve_resources(void) request_resource(&iomem_resource, res); if (e820.map[i].type == E820_RAM) { /* - * We dont't know which RAM region contains kernel data, + * We don't know which RAM region contains kernel data, * so we try it repeatedly and let the resource manager * test it. */ diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 0eed1e0c5913..02be6caeecc8 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c @@ -685,7 +685,7 @@ void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector) entry.vector = vector; /* - * The timer IRQ doesnt have to know that behind the + * The timer IRQ doesn't have to know that behind the * scene we have a 8259A-master in AEOI mode ... */ irq_desc[0].handler = &ioapic_edge_irq_type; @@ -1539,7 +1539,7 @@ static inline void check_timer(void) printk(" failed.\n"); if (nmi_watchdog) { - printk(KERN_WARNING "timer doesnt work through the IO-APIC - disabling NMI Watchdog!\n"); + printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); nmi_watchdog = 0; } diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c index ed43656b524e..a5c268e9ecc3 100644 --- a/arch/x86_64/kernel/irq.c +++ b/arch/x86_64/kernel/irq.c @@ -87,7 +87,7 @@ static void ack_none(unsigned int irq) { /* * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves, it doesnt deserve + * each architecture has to answer this themselves, it doesn't deserve * a generic callback i think. */ #if CONFIG_X86 diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c index 50523c5f9d2d..0d749d4e8fef 100644 --- a/arch/x86_64/kernel/nmi.c +++ b/arch/x86_64/kernel/nmi.c @@ -228,7 +228,7 @@ static spinlock_t nmi_print_lock = SPIN_LOCK_UNLOCKED; * as these watchdog NMI IRQs are generated on every CPU, we only * have to check the current processor. * - * since NMIs dont listen to _any_ locks, we have to be extremely + * since NMIs don't listen to _any_ locks, we have to be extremely * careful not to rely on unsafe variables. The printk might lock * up though, so we have to break up any console locks first ... * [when there will be more tty-related locks, break them up diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index 695fa5e59264..bbd2fbdd6d26 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c @@ -437,6 +437,7 @@ static __init int init_k8_gatt(agp_kern_info *info) } flush_gart(); + global_flush_tlb(); printk("PCI-DMA: aperture base @ %x size %u KB\n", aper_base, aper_size>>10); return 0; diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index 30e8405fd42d..f6449d6194c5 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c @@ -104,7 +104,7 @@ static void __init smp_store_cpu_info(int id) /* * TSC synchronization. * - * We first check wether all CPUs have their TSC's synchronized, + * We first check whether all CPUs have their TSC's synchronized, * then we print a warning if not, and always resync. */ @@ -774,7 +774,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) } /* - * If we couldnt find an SMP configuration at boot time, + * If we couldn't find an SMP configuration at boot time, * get out of here now! */ if (!smp_found_config) { diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index 5abb00455897..31ec31fc6408 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c @@ -30,7 +30,7 @@ #include <asm/apic.h> #endif -u64 jiffies_64; +u64 jiffies_64; extern int using_apic_timer; diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c index 2f10ba92beaf..f0503c3badc2 100644 --- a/arch/x86_64/mm/ioremap.c +++ b/arch/x86_64/mm/ioremap.c @@ -205,6 +205,7 @@ void *ioremap_nocache (unsigned long phys_addr, unsigned long size) iounmap(p); p = NULL; } + global_flush_tlb(); } return p; @@ -226,6 +227,7 @@ void iounmap(void *addr) change_page_attr(virt_to_page(__va(p->phys_addr)), p->size >> PAGE_SHIFT, PAGE_KERNEL); + global_flush_tlb(); } kfree(p); } diff --git a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c index a118a87fc612..2802dc2e84e0 100644 --- a/drivers/acorn/block/fd1772.c +++ b/drivers/acorn/block/fd1772.c @@ -1081,7 +1081,7 @@ static void finish_fdc(void) MotorOn = 1; START_TIMEOUT(); /* we must wait for the IRQ here, because the ST-DMA is - * released immediatly afterwards and the interrupt may be + * released immediately afterwards and the interrupt may be * delivered to the wrong driver. */ } diff --git a/drivers/acorn/block/mfmhd.c b/drivers/acorn/block/mfmhd.c index 01287e5452a4..fa97305e4c5b 100644 --- a/drivers/acorn/block/mfmhd.c +++ b/drivers/acorn/block/mfmhd.c @@ -406,7 +406,7 @@ static void issue_command(int command, unsigned char *cmdb, int len) outw(command, MFM_COMMAND); status = inw(MFM_STATUS); - DBG("issue_command: status immediatly after command issue: %02X:\n ", status >> 8); + DBG("issue_command: status immediately after command issue: %02X:\n ", status >> 8); } static void wait_for_completion(void) @@ -451,7 +451,7 @@ static void mfm_rw_intr(void) return; }; - /* OK so what ever happend its not an error, now I reckon we are left between + /* OK so what ever happened it's not an error, now I reckon we are left between a choice of command end or some data which is ready to be collected */ /* I think we have to transfer data while the interrupt line is on and its not any other type of interrupt */ diff --git a/drivers/acorn/net/ether3.c b/drivers/acorn/net/ether3.c index 5400ea3ba100..4ee35e3e39c8 100644 --- a/drivers/acorn/net/ether3.c +++ b/drivers/acorn/net/ether3.c @@ -101,7 +101,7 @@ typedef enum { /* * ether3 read/write. Slow things down a bit... - * The SEEQ8005 doesn't like us writing to it's registers + * The SEEQ8005 doesn't like us writing to its registers * too quickly. */ static inline void ether3_outb(int v, const int r) @@ -304,7 +304,7 @@ ether3_init_2(struct net_device *dev) /* * There is a problem with the NQ8005 in that it occasionally loses the * last two bytes. To get round this problem, we receive the CRC as - * well. That way, if we do loose the last two, then it doesn't matter. + * well. That way, if we do lose the last two, then it doesn't matter. */ ether3_outw(priv->regs.config1 | CFG1_TRANSEND, REG_CONFIG1); ether3_outw((TX_END>>8) - 1, REG_BUFWIN); diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c index c830ce9d3c4c..388eeb9e1dcb 100644 --- a/drivers/acpi/dispatcher/dsobject.c +++ b/drivers/acpi/dispatcher/dsobject.c @@ -396,7 +396,7 @@ acpi_ds_create_node ( return_ACPI_STATUS (status); } - /* Re-type the object according to it's argument */ + /* Re-type the object according to its argument */ node->type = ACPI_GET_OBJECT_TYPE (obj_desc); diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c index 58848dcd19a4..27092988918c 100644 --- a/drivers/acpi/events/evevent.c +++ b/drivers/acpi/events/evevent.c @@ -79,7 +79,7 @@ acpi_ev_initialize ( /* * Initialize the Fixed and General Purpose acpi_events prior. This is - * done prior to enabling SCIs to prevent interrupts from occuring + * done prior to enabling SCIs to prevent interrupts from occurring * before handers are installed. */ status = acpi_ev_fixed_event_initialize (); diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c index f348a12b47f1..30391790f539 100644 --- a/drivers/acpi/events/evrgnini.c +++ b/drivers/acpi/events/evrgnini.c @@ -410,7 +410,7 @@ acpi_ev_default_region_setup ( * Get the appropriate address space handler for a newly * created region. * - * This also performs address space specific intialization. For + * This also performs address space specific initialization. For * example, PCI regions must have an _ADR object that contains * a PCI address in the scope of the definition. This address is * required to perform an access to PCI config space. diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index fcc144d58db4..00d844228185 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c @@ -370,7 +370,7 @@ acpi_set_register ( /* * Status Registers are different from the rest. Clear by - * writing 1, writing 0 has no effect. So, the only relevent + * writing 1, writing 0 has no effect. So, the only relevant * information is the single bit we're interested in, all others should * be written as 0 so they will be left unchanged */ diff --git a/drivers/acpi/hardware/hwtimer.c b/drivers/acpi/hardware/hwtimer.c index 7807f520f18d..b8053a1d8193 100644 --- a/drivers/acpi/hardware/hwtimer.c +++ b/drivers/acpi/hardware/hwtimer.c @@ -133,7 +133,7 @@ acpi_get_timer ( * transitions (unlike many CPU timestamp counters) -- making it * a versatile and accurate timer. * - * Note that this function accomodates only a single timer + * Note that this function accommodates only a single timer * rollover. Thus for 24-bit timers, this function should only * be used for calculating durations less than ~4.6 seconds * (~20 minutes for 32-bit timers) -- calculations below diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 936ec223653b..f83a630ec7dc 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -351,7 +351,7 @@ acpi_power_transition ( /* * First we reference all power resources required in the target list - * (e.g. so the device doesn't loose power while transitioning). + * (e.g. so the device doesn't lose power while transitioning). */ for (i=0; i<tl->count; i++) { result = acpi_power_on(tl->handles[i]); diff --git a/drivers/acpi/resources/rsmemory.c b/drivers/acpi/resources/rsmemory.c index 65c04f185478..bde6f9904ab9 100644 --- a/drivers/acpi/resources/rsmemory.c +++ b/drivers/acpi/resources/rsmemory.c @@ -278,7 +278,7 @@ acpi_rs_memory32_range_resource ( /* * Point to the place in the output buffer where the data portion will * begin. - * 1. Set the RESOURCE_DATA * Data to point to it's own address, then + * 1. Set the RESOURCE_DATA * Data to point to its own address, then * 2. Set the pointer to the next address. * * NOTE: output_struct->Data is cast to u8, otherwise, this addition adds diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index f72966037995..3c25f7904418 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -105,7 +105,7 @@ int rx_pool_sizes[NP] = {128, 128, 128, 64, 64, 64, 32, 32}; The FS50 CAM (VP/VC match registers) always take the lowest channel number that matches. This is not a problem. - However, they also ignore wether the channel is enabled or + However, they also ignore whether the channel is enabled or not. This means that if you allocate channel 0 to 1.2 and then channel 1 to 0.0, then disabeling channel 0 and writing 0 to the match channel for channel 0 will "steal" the traffic from channel diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index d661b88855f1..878c3354b01a 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c @@ -2874,11 +2874,7 @@ static int __init hrz_probe (void) { // writes to adapter memory (handles IRQ and SMP) spin_lock_init (&dev->mem_lock); -#if LINUX_VERSION_CODE >= 0x20303 init_waitqueue_head (&dev->tx_queue); -#else - dev->tx_queue = 0; -#endif // vpi in 0..4, vci in 6..10 dev->atm_dev->ci_range.vpi_bits = vpi_bits; diff --git a/drivers/atm/horizon.h b/drivers/atm/horizon.h index fe4f2641233f..5e51d487b423 100644 --- a/drivers/atm/horizon.h +++ b/drivers/atm/horizon.h @@ -422,11 +422,7 @@ struct hrz_dev { unsigned int tx_regions; // number of remaining regions spinlock_t mem_lock; -#if LINUX_VERSION_CODE >= 0x20303 wait_queue_head_t tx_queue; -#else - struct wait_queue * tx_queue; -#endif u8 irq; long flags; diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index e25a6c8039ce..bfd57e3f62d9 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -436,7 +436,7 @@ ia_open_abr_vc(IADEV *dev, srv_cls_param_t *srv_p, if (crm == 0) crm = 1; f_abr_vc->f_crm = crm & 0xff; f_abr_vc->f_pcr = cellrate_to_float(srv_p->pcr); - icr = MIN( srv_p->icr, (srv_p->tbe > srv_p->frtt) ? + icr = min( srv_p->icr, (srv_p->tbe > srv_p->frtt) ? ((srv_p->tbe/srv_p->frtt)*1000000) : (1000000/(srv_p->frtt/srv_p->tbe))); f_abr_vc->f_icr = cellrate_to_float(icr); @@ -2071,7 +2071,7 @@ static int tx_init(struct atm_dev *dev) - UBR Table size is 4K - UBR wait queue is 4K since the table and wait queues are contiguous, all the bytes - can be intialized by one memeset. + can be initialized by one memeset. */ vcsize_sel = 0; diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h index 24acc4387a0a..1134bda43854 100644 --- a/drivers/atm/iphase.h +++ b/drivers/atm/iphase.h @@ -808,7 +808,6 @@ typedef struct { } r_vc_abr_entry; #define MRM 3 -#define MIN(x,y) ((x) < (y)) ? (x) : (y) typedef struct srv_cls_param { u32 class_type; /* CBR/VBR/ABR/UBR; use the enum above */ @@ -1017,13 +1016,8 @@ typedef struct iadev_t { spinlock_t tx_lock; IARTN_Q tx_return_q; u32 close_pending; -#if LINUX_VERSION_CODE >= 0x20303 wait_queue_head_t close_wait; wait_queue_head_t timeout_wait; -#else - struct wait_queue *close_wait; - struct wait_queue *timeout_wait; -#endif struct cpcs_trailer_desc *tx_buf; u16 num_tx_desc, tx_buf_sz, rate_limit; u32 tx_cell_cnt, tx_pkt_cnt; diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index e6788148675b..c688f0cd8e54 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1300,7 +1300,7 @@ static inline int vcc_tx_space(const struct lanai_vcc *lvcc, int endptr) #define DESCRIPTOR_AAL5_STREAM (0x00004000) #define DESCRIPTOR_CLP (0x00002000) -/* Add 32-bit descriptor with it's padding */ +/* Add 32-bit descriptor with its padding */ static inline void vcc_tx_add_aal5_descriptor(struct lanai_vcc *lvcc, u32 flags, int len) { diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 093e2dedbd90..c0b46bb3eef0 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -459,7 +459,7 @@ int bus_add_driver(struct device_driver * drv) * @drv: driver. * * Detach the driver from the devices it controls, and remove - * it from it's bus's list of drivers. Finally, we drop the reference + * it from its bus's list of drivers. Finally, we drop the reference * to the bus we took in bus_add_driver(). */ diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 2be329f76073..3673d27f32b8 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -351,7 +351,7 @@ static int cciss_open(struct inode *inode, struct file *filep) if (ctlr >= MAX_CTLR || hba[ctlr] == NULL) return -ENXIO; /* - * Root is allowed to open raw volume zero even if its not configured + * Root is allowed to open raw volume zero even if it's not configured * so array config can still work. I don't think I really like this, * but I'm already using way to many device nodes to claim another one * for "raw controller". diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 071ae3c8d30d..021b2c6f90f2 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c @@ -210,7 +210,7 @@ scsi_cmd_stack_setup(int ctlr, struct cciss_scsi_adapter_data_t *sa) stk = &sa->cmd_stack; size = sizeof(struct cciss_scsi_cmd_stack_elem_t) * CMD_STACK_SIZE; - // pci_alloc_consistent guarentees 32-bit DMA address will + // pci_alloc_consistent guarantees 32-bit DMA address will // be used stk->pool = (struct cciss_scsi_cmd_stack_elem_t *) diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 3a4bfd88b362..fdb49eb4cb4c 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c @@ -715,7 +715,7 @@ static int ida_open(struct inode *inode, struct file *filep) return -ENXIO; /* - * Root is allowed to open raw volume zero even if its not configured + * Root is allowed to open raw volume zero even if it's not configured * so array config can still work. I don't think I really like this, * but I'm already using way to many device nodes to claim another one * for "raw controller". diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c index 428e3afa3c99..dabb8fa2d211 100644 --- a/drivers/block/genhd.c +++ b/drivers/block/genhd.c @@ -1,17 +1,5 @@ /* - * Code extracted from - * linux/kernel/hd.c - * - * Copyright (C) 1991-1998 Linus Torvalds - * - * devfs support - jj, rgooch, 980122 - * - * Moved partition checking code to fs/partitions* - Russell King - * (linux@arm.uk.linux.org) - */ - -/* - * TODO: rip out the remaining init crap from this file --hch + * gendisk handling */ #include <linux/config.h> @@ -29,8 +17,9 @@ static struct subsystem block_subsys; +#define MAX_PROBE_HASH 23 /* random */ -struct blk_probe { +static struct blk_probe { struct blk_probe *next; dev_t dev; unsigned long range; @@ -38,21 +27,27 @@ struct blk_probe { struct gendisk *(*get)(dev_t dev, int *part, void *data); int (*lock)(dev_t, void *); void *data; -} *probes[MAX_BLKDEV]; +} *probes[MAX_PROBE_HASH]; -/* index in the above */ +/* index in the above - for now: assume no multimajor ranges */ static inline int dev_to_index(dev_t dev) { - return MAJOR(dev); + return MAJOR(dev) % MAX_PROBE_HASH; } +/* + * Register device numbers dev..(dev+range-1) + * range must be nonzero + * The hash chain is sorted on range, so that subranges can override. + */ void blk_register_region(dev_t dev, unsigned long range, struct module *module, - struct gendisk *(*probe)(dev_t, int *, void *), - int (*lock)(dev_t, void *), void *data) + struct gendisk *(*probe)(dev_t, int *, void *), + int (*lock)(dev_t, void *), void *data) { int index = dev_to_index(dev); struct blk_probe *p = kmalloc(sizeof(struct blk_probe), GFP_KERNEL); struct blk_probe **s; + p->owner = module; p->get = probe; p->lock = lock; @@ -71,6 +66,7 @@ void blk_unregister_region(dev_t dev, unsigned long range) { int index = dev_to_index(dev); struct blk_probe **s; + down_write(&block_subsys.rwsem); for (s = &probes[index]; *s; s = &(*s)->next) { struct blk_probe *p = *s; @@ -94,6 +90,7 @@ static struct gendisk *exact_match(dev_t dev, int *part, void *data) static int exact_lock(dev_t dev, void *data) { struct gendisk *p = data; + if (!get_disk(p)) return -1; return 0; @@ -109,14 +106,14 @@ static int exact_lock(dev_t dev, void *data) void add_disk(struct gendisk *disk) { disk->flags |= GENHD_FL_UP; - blk_register_region(MKDEV(disk->major, disk->first_minor), disk->minors, - NULL, exact_match, exact_lock, disk); + blk_register_region(MKDEV(disk->major, disk->first_minor), + disk->minors, NULL, exact_match, exact_lock, disk); register_disk(disk); elv_register_queue(disk); } EXPORT_SYMBOL(add_disk); -EXPORT_SYMBOL(del_gendisk); +EXPORT_SYMBOL(del_gendisk); /* in partitions/check.c */ void unlink_gendisk(struct gendisk *disk) { @@ -146,18 +143,17 @@ retry: struct gendisk *(*probe)(dev_t, int *, void *); struct module *owner; void *data; - if (p->dev > dev || p->dev + p->range <= dev) + + if (p->dev > dev || p->dev + p->range - 1 < dev) continue; - if (p->range >= best) { - up_read(&block_subsys.rwsem); - return NULL; - } + if (p->range - 1 >= best) + break; if (!try_module_get(p->owner)) continue; owner = p->owner; data = p->data; probe = p->get; - best = p->range; + best = p->range - 1; *part = dev - p->dev; if (p->lock && p->lock(dev, data) < 0) { module_put(owner); @@ -169,7 +165,7 @@ retry: module_put(owner); if (disk) return disk; - goto retry; + goto retry; /* this terminates: best decreases */ } up_read(&block_subsys.rwsem); return NULL; @@ -245,7 +241,7 @@ extern int blk_dev_init(void); static struct gendisk *base_probe(dev_t dev, int *part, void *data) { - char name[20]; + char name[30]; sprintf(name, "block-major-%d", MAJOR(dev)); request_module(name); return NULL; @@ -256,11 +252,11 @@ int __init device_init(void) struct blk_probe *base = kmalloc(sizeof(struct blk_probe), GFP_KERNEL); int i; memset(base, 0, sizeof(struct blk_probe)); - base->dev = MKDEV(1,0); - base->range = MKDEV(MAX_BLKDEV-1, 255) - base->dev + 1; + base->dev = 1; + base->range = ~0; /* range 1 .. ~0 */ base->get = base_probe; - for (i = 1; i < MAX_BLKDEV; i++) - probes[i] = base; + for (i = 0; i < MAX_PROBE_HASH; i++) + probes[i] = base; /* must remain last in chain */ blk_dev_init(); subsystem_register(&block_subsys); return 0; @@ -281,12 +277,14 @@ struct disk_attribute { ssize_t (*show)(struct gendisk *, char *); }; -static ssize_t disk_attr_show(struct kobject * kobj, struct attribute * attr, - char * page) +static ssize_t disk_attr_show(struct kobject *kobj, struct attribute *attr, + char *page) { - struct gendisk * disk = to_disk(kobj); - struct disk_attribute * disk_attr = container_of(attr,struct disk_attribute,attr); + struct gendisk *disk = to_disk(kobj); + struct disk_attribute *disk_attr = + container_of(attr,struct disk_attribute,attr); ssize_t ret = 0; + if (disk_attr->show) ret = disk_attr->show(disk,page); return ret; @@ -303,11 +301,11 @@ static ssize_t disk_dev_read(struct gendisk * disk, char *page) } static ssize_t disk_range_read(struct gendisk * disk, char *page) { - return sprintf(page, "%d\n",disk->minors); + return sprintf(page, "%d\n", disk->minors); } static ssize_t disk_size_read(struct gendisk * disk, char *page) { - return sprintf(page, "%llu\n",(unsigned long long)get_capacity(disk)); + return sprintf(page, "%llu\n", (unsigned long long)get_capacity(disk)); } static inline unsigned jiffies_to_msec(unsigned jif) diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 5d615b09de21..b7f765e80f16 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -1461,6 +1461,7 @@ void blk_insert_request(request_queue_t *q, struct request *rq, if (blk_rq_tagged(rq)) blk_queue_end_tag(q, rq); + drive_stat_acct(rq, rq->nr_sectors, 1); __elv_add_request(q, rq, !at_head, 0); q->request_fn(q); spin_unlock_irqrestore(q->queue_lock, flags); @@ -1892,7 +1893,7 @@ static inline void blk_partition_remap(struct bio *bio) } /** - * generic_make_request: hand a buffer to it's device driver for I/O + * generic_make_request: hand a buffer to its device driver for I/O * @bio: The bio describing the location in memory and on the device. * * generic_make_request() is used to make I/O requests of block diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c index b37fc8e944c7..b4218141e154 100644 --- a/drivers/block/scsi_ioctl.c +++ b/drivers/block/scsi_ioctl.c @@ -60,6 +60,7 @@ int blk_do_rq(request_queue_t *q, struct block_device *bdev, struct request *rq) rq->flags |= REQ_NOMERGE; rq->waiting = &wait; + drive_stat_acct(rq, rq->nr_sectors, 1); elv_add_request(q, rq, 1, 1); generic_unplug_device(q); wait_for_completion(&wait); diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 32fb511ebfd7..bb1a0cd651db 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -172,7 +172,7 @@ -- Defined CD_DVD and CD_CHANGER log levels. -- Fixed the CDROMREADxxx ioctls. -- CDROMPLAYTRKIND uses the GPCMD_PLAY_AUDIO_MSF command - too few - drives supported it. We loose the index part, however. + drives supported it. We lose the index part, however. -- Small modifications to accomodate opens of /dev/hdc1, required for ide-cd to handle multisession discs. -- Export cdrom_mode_sense and cdrom_mode_select. diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index 6381d7e9c60b..2a4916d5d380 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -341,7 +341,7 @@ * Trying to merge requests breaks this driver horribly (as in it goes * boom and apparently has done so since 2.3.41). As it is a legacy * driver for a horribly slow double speed CD on a hideous interface - * designed for polled operation, I won't loose any sleep in simply + * designed for polled operation, I won't lose any sleep in simply * disallowing merging. Paul G. 02/2001 * * Thu May 30 14:14:47 CEST 2002: diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 181c84c9760e..3a81ce8c0630 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -151,7 +151,7 @@ static char rcsid[] = * Revision 2.2.1.4 1998/08/04 11:02:50 ivan * /proc/cyclades implementation with great collaboration of * Marc Lewis <marc@blarg.net>; - * cyy_interrupt was changed to avoid occurence of kernel oopses + * cyy_interrupt was changed to avoid occurrence of kernel oopses * during PPP operation. * * Revision 2.2.1.3 1998/06/01 12:09:10 ivan diff --git a/drivers/char/drm/drm_vm.h b/drivers/char/drm/drm_vm.h index 683c085716d2..9101e1365804 100644 --- a/drivers/char/drm/drm_vm.h +++ b/drivers/char/drm/drm_vm.h @@ -147,7 +147,7 @@ struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma, } /* Special close routine which deletes map information if we are the last - * person to close a mapping and its not in the global maplist. + * person to close a mapping and it's not in the global maplist. */ void DRM(vm_shm_close)(struct vm_area_struct *vma) diff --git a/drivers/char/epca.c b/drivers/char/epca.c index 6e02d4ccd0f8..abd96731341c 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -897,7 +897,7 @@ static int pc_write(struct tty_struct * tty, int from_user, Remember copy_from_user WILL generate a page fault if the user memory being accessed has been swapped out. This can cause this routine to temporarily sleep while this page - fault is occuring. + fault is occurring. ----------------------------------------------------------------- */ @@ -1865,7 +1865,7 @@ int __init pc_init(void) case PCXI: board_id = inb((int)bd->port); if ((board_id & 0x1) == 0x1) - { /* Begin its an XI card */ + { /* Begin it's an XI card */ /* Is it a 64K board */ if ((board_id & 0x30) == 0) @@ -2743,11 +2743,11 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch) /* --------------------------------------------------------------- Command sets channels iflag structure on the board. Such things - as input soft flow control, handeling of parity errors, and - break handeling are all set here. + as input soft flow control, handling of parity errors, and + break handling are all set here. ------------------------------------------------------------------- */ - /* break handeling, parity handeling, input stripping, flow control chars */ + /* break handling, parity handling, input stripping, flow control chars */ fepcmd(ch, SETIFLAGS, (unsigned int) ch->fepiflag, 0, 0, 0); } @@ -3516,7 +3516,7 @@ static void pc_start(struct tty_struct *tty) /* ------------------------------------------------------------------ The below routines pc_throttle and pc_unthrottle are used to slow (And resume) the receipt of data into the kernels - receive buffers. The exact occurence of this depends on the + receive buffers. The exact occurrence of this depends on the size of the kernels receive buffer and what the 'watermarks' are set to for that buffer. See the n_ttys.c file for more details. diff --git a/drivers/char/ftape/lowlevel/ftape-calibr.c b/drivers/char/ftape/lowlevel/ftape-calibr.c index 1c9de0eed842..25ed389deb6c 100644 --- a/drivers/char/ftape/lowlevel/ftape-calibr.c +++ b/drivers/char/ftape/lowlevel/ftape-calibr.c @@ -56,7 +56,7 @@ static unsigned long ps_per_cycle = 0; * used directly to implement fine-grained timeouts. However, on * Alpha PCs, the 8254 is *not* used to implement the clock tick * (which is 1024 Hz, normally) and the 8254 timer runs at some - * "random" frequency (it seems to run at 18Hz, but its not safe to + * "random" frequency (it seems to run at 18Hz, but it's not safe to * rely on this value). Instead, we use the Alpha's "rpcc" * instruction to read cycle counts. As this is a 32 bit counter, * it will overflow only once per 30 seconds (on a 200MHz machine), diff --git a/drivers/char/ftape/lowlevel/ftape_syms.c b/drivers/char/ftape/lowlevel/ftape_syms.c index 96e0e3afdc46..f940f1e0d0ac 100644 --- a/drivers/char/ftape/lowlevel/ftape_syms.c +++ b/drivers/char/ftape/lowlevel/ftape_syms.c @@ -22,7 +22,7 @@ * * This file contains the symbols that the ftape low level * part of the QIC-40/80/3010/3020 floppy-tape driver "ftape" - * exports to it's high level clients + * exports to its high level clients */ #include <linux/config.h> diff --git a/drivers/char/ftape/zftape/zftape-vtbl.h b/drivers/char/ftape/zftape/zftape-vtbl.h index 34b320bdb552..efc3ffb9f368 100644 --- a/drivers/char/ftape/zftape/zftape-vtbl.h +++ b/drivers/char/ftape/zftape/zftape-vtbl.h @@ -176,7 +176,7 @@ static inline __s64 zft_check_for_eof(const zft_volinfo *vtbl, const zft_position *pos); /* this function decrements the zft_seg_pos counter if we are right - * at the beginning of a segment. This is to handel fsfm/bsfm -- we + * at the beginning of a segment. This is to handle fsfm/bsfm -- we * need to position before the eof mark. NOTE: zft_tape_pos is not * changed */ diff --git a/drivers/char/ftape/zftape/zftape-write.c b/drivers/char/ftape/zftape/zftape-write.c index 4f919a1d6c09..43129fdf0b0f 100644 --- a/drivers/char/ftape/zftape/zftape-write.c +++ b/drivers/char/ftape/zftape/zftape-write.c @@ -357,7 +357,7 @@ static int check_write_access(int req_len, *volume = zft_find_volume(pos->seg_pos); DUMP_VOLINFO(ft_t_noise, "", *volume); zft_just_before_eof = 0; - /* now merge with old data if neccessary */ + /* now merge with old data if necessary */ if (!zft_qic_mode && pos->seg_byte_pos != 0){ result = zft_fetch_segment(pos->seg_pos, zft_deblock_buf, diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index 8292ec37e316..a29bf19fdf38 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c @@ -142,14 +142,14 @@ int gs_write(struct tty_struct * tty, int from_user, /* Can't copy more? break out! */ if (c <= 0) break; - if (from_user) + if (from_user) { if (copy_from_user (port->xmit_buf + port->xmit_head, buf, c)) { up (& port->port_write_sem); return -EFAULT; } - else + } else memcpy (port->xmit_buf + port->xmit_head, buf, c); port -> xmit_cnt += c; diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c index 4fc496279576..d5136998932f 100644 --- a/drivers/char/hangcheck-timer.c +++ b/drivers/char/hangcheck-timer.c @@ -16,7 +16,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have recieved a copy of the GNU General Public + * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 021110-1307, USA. diff --git a/drivers/char/mwave/tp3780i.h b/drivers/char/mwave/tp3780i.h index 70fde5ceffca..fc049acc89e6 100644 --- a/drivers/char/mwave/tp3780i.h +++ b/drivers/char/mwave/tp3780i.h @@ -72,7 +72,7 @@ #define TP_CFG_DisableLBusTimeout 0 /* Enable LBus timeout */ #define TP_CFG_N_Divisor 32 /* Clock = 39.1608 Mhz */ #define TP_CFG_M_Multiplier 37 /* " */ -#define TP_CFG_PllBypass 0 /* dont bypass */ +#define TP_CFG_PllBypass 0 /* don't bypass */ #define TP_CFG_ChipletEnable 0xFFFF /* Enable all chiplets */ typedef struct { diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c index 947c077bf9fb..a849d3be3ff1 100644 --- a/drivers/char/n_hdlc.c +++ b/drivers/char/n_hdlc.c @@ -833,7 +833,7 @@ static unsigned int n_hdlc_tty_poll (struct tty_struct *tty, poll_wait(filp, &tty->read_wait, wait); poll_wait(filp, &tty->write_wait, wait); - /* set bits for operations that wont block */ + /* set bits for operations that won't block */ if(n_hdlc->rx_buf_list.head) mask |= POLLIN | POLLRDNORM; /* readable */ if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index 8ced8f6bd932..96daf9d5d80e 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c @@ -606,7 +606,7 @@ pc_proc_infos(unsigned char *nvram, char *buffer, int *len, #if MACH == COBALT -/* the cobalt CMOS has a wider range of it's checksum */ +/* the cobalt CMOS has a wider range of its checksum */ static int cobalt_check_checksum(void) { int i; diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c index 9ba493d84ebd..db1935fb69b2 100644 --- a/drivers/char/nwflash.c +++ b/drivers/char/nwflash.c @@ -215,7 +215,7 @@ static ssize_t flash_write(struct file *file, const char *buf, size_t size, loff temp = ((int) (p + count) >> 16) - nBlock + 1; /* - * write ends at exactly 64k boundry? + * write ends at exactly 64k boundary? */ if (((int) (p + count) & 0xFFFF) == 0) temp -= 1; diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 478df388a7cf..a5ff3a48a8fd 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -4505,7 +4505,7 @@ void mgslpc_sppp_rx_done(MGSLPC_INFO *info, char *buf, int size) if (debug_level >= DEBUG_LEVEL_INFO) printk("mgslpc_sppp_rx_done(%s)\n",info->netname); if (skb == NULL) { - printk(KERN_NOTICE "%s: cant alloc skb, dropping packet\n", + printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", info->netname); info->netstats.rx_dropped++; return; diff --git a/drivers/char/rio/list.h b/drivers/char/rio/list.h index ae7368d0fd86..a4f7f1f56255 100644 --- a/drivers/char/rio/list.h +++ b/drivers/char/rio/list.h @@ -111,7 +111,7 @@ static char *_rio_list_h_sccs = "@(#)list.h 1.9" ; /* ** can_remove_receive( PacketP, PortP ) returns non-zero if PKT_IN_USE is set ** for the next packet on the queue. It will also set PacketP to point to the -** relevent packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear, +** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear, ** then can_remove_receive() returns 0. */ #if defined(MIPS) || defined(nx6000) || defined(drs6000) || defined(UWsparc) diff --git a/drivers/char/rio/parmmap.h b/drivers/char/rio/parmmap.h index ea671002582f..46f99dfdac8d 100644 --- a/drivers/char/rio/parmmap.h +++ b/drivers/char/rio/parmmap.h @@ -31,7 +31,7 @@ ---------------------------------------------------------------------------- Date By Description ---------------------------------------------------------------------------- -6/4/1991 jonb Made changes to accomodate Mips R3230 bus +6/4/1991 jonb Made changes to accommodate Mips R3230 bus ***************************************************************************/ #ifndef _parmap_h diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index 418be1ff84b8..de86ff4ba922 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c @@ -464,7 +464,7 @@ static void rio_interrupt (int irq, void *ptr, struct pt_regs *regs) recursive calls will hang the machine in the interrupt routine. - hardware twiddling goes before "recursive". Otherwise when we - poll the card, and a recursive interrupt happens, we wont + poll the card, and a recursive interrupt happens, we won't ack the card, so it might keep on interrupting us. (especially level sensitive interrupt systems like PCI). diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c index 888dddce2006..a9b25ffcad97 100644 --- a/drivers/char/rio/rioinit.c +++ b/drivers/char/rio/rioinit.c @@ -145,7 +145,7 @@ struct RioHostInfo * info; p->RIOHosts[p->RIONumHosts].PaddrP = info->location; /* - ** Check that we are able to accomodate another host + ** Check that we are able to accommodate another host */ if ( p->RIONumHosts >= RIO_HOSTS ) { diff --git a/drivers/char/rio/rioparam.c b/drivers/char/rio/rioparam.c index 069172fec3e8..3b4aa82f162c 100644 --- a/drivers/char/rio/rioparam.c +++ b/drivers/char/rio/rioparam.c @@ -714,7 +714,7 @@ PKT *PktP; /* ** can_remove_receive(PktP,P) returns non-zero if PKT_IN_USE is set ** for the next packet on the queue. It will also set PktP to point to the -** relevent packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear, +** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear, ** then can_remove_receive() returns 0. */ int diff --git a/drivers/char/rio/rioroute.c b/drivers/char/rio/rioroute.c index ef28ba34247c..08c674258217 100644 --- a/drivers/char/rio/rioroute.c +++ b/drivers/char/rio/rioroute.c @@ -521,7 +521,7 @@ int RIORouteRup( struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP /* ** If either of the modules on this unit is read-only or write-only ** or none-xprint, then we need to transfer that info over to the - ** relevent ports. + ** relevant ports. */ if ( HostP->Mapping[ThisUnit].SysPort != NO_PORT ) { @@ -976,7 +976,7 @@ RIORemoveFromSavedTable(struct rio_info *p, struct Map *pMap) /* ** We loop for all entries even after finding an entry and ** zeroing it because we may have two entries to delete if - ** its a 16 port RTA. + ** it's a 16 port RTA. */ for (entry = 0; entry < TOTAL_MAP_ENTRIES; entry++) { diff --git a/drivers/char/rio/riotable.c b/drivers/char/rio/riotable.c index 39f488be7fea..5ed9b91496de 100644 --- a/drivers/char/rio/riotable.c +++ b/drivers/char/rio/riotable.c @@ -309,7 +309,7 @@ struct rio_info * p; } /* - ** wow! if we get here then its a goody! + ** wow! if we get here then it's a goody! */ /* diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c index 3e0de643fe2e..9f802fc1ae50 100644 --- a/drivers/char/rio/riotty.c +++ b/drivers/char/rio/riotty.c @@ -737,10 +737,10 @@ int RIOCookMode(struct ttystatics *tp) { /* - ** We cant handle tm.c_mstate != 0 on SCO - ** We cant handle mapping - ** We cant handle non-ttwrite line disc. - ** We cant handle lflag XCASE + ** We can't handle tm.c_mstate != 0 on SCO + ** We can't handle mapping + ** We can't handle non-ttwrite line disc. + ** We can't handle lflag XCASE ** We can handle oflag OPOST & (OCRNL, ONLCR, TAB3) */ diff --git a/drivers/char/rocket_int.h b/drivers/char/rocket_int.h index d1302f0afcad..c21c3f8c57e1 100644 --- a/drivers/char/rocket_int.h +++ b/drivers/char/rocket_int.h @@ -834,7 +834,7 @@ Return: WordIO_t: I/O address of a channel's TxRx Data register /*************************************************************************** Function: sInitChanDefaults -Purpose: Initialize a channel structure to it's default state. +Purpose: Initialize a channel structure to its default state. Call: sInitChanDefaults(ChP) CHANNEL_T *ChP; Ptr to the channel structure Comments: This function must be called once for every channel structure diff --git a/drivers/char/scc.h b/drivers/char/scc.h index 53a4cd2ae36f..51810f72f1a9 100644 --- a/drivers/char/scc.h +++ b/drivers/char/scc.h @@ -428,7 +428,7 @@ extern unsigned char scc_shadow[2][16]; * for that purpose. They assume that a local variable 'port' is * declared and pointing to the port's scc_struct entry. The * variants with "_NB" appended should be used if no other SCC - * accesses follow immediatly (within 0.5 usecs). They just skip the + * accesses follow immediately (within 0.5 usecs). They just skip the * final delay nops. * * Please note that accesses to SCC registers should only take place diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c index b8a01d45027d..889f13f6abb1 100644 --- a/drivers/char/ser_a2232.c +++ b/drivers/char/ser_a2232.c @@ -590,7 +590,7 @@ int ch, err, n, p; printk("A2232: 65EC02 software sent SYNC event, don't know what to do. Ignoring."); break; default: - printk("A2232: 65EC02 software broken, unknown event type %d occured.\n",ibuf[bufpos-1]); + printk("A2232: 65EC02 software broken, unknown event type %d occurred.\n",ibuf[bufpos-1]); } /* event type switch */ break; case A2232INCTL_CHAR: @@ -599,7 +599,7 @@ int ch, err, n, p; bufpos++; break; default: - printk("A2232: 65EC02 software broken, unknown data type %d occured.\n",cbuf[bufpos]); + printk("A2232: 65EC02 software broken, unknown data type %d occurred.\n",cbuf[bufpos]); bufpos++; } /* switch on input data type */ } /* while there's something in the buffer */ diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 445a73d134f8..14a9d956a9c1 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -1216,7 +1216,7 @@ static void sx_interrupt (int irq, void *ptr, struct pt_regs *regs) recursive calls will hang the machine in the interrupt routine. - hardware twiddling goes before "recursive". Otherwise when we - poll the card, and a recursive interrupt happens, we wont + poll the card, and a recursive interrupt happens, we won't ack the card, so it might keep on interrupting us. (especially level sensitive interrupt systems like PCI). diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 65cc412b4582..7261a336f5fd 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -4260,7 +4260,7 @@ int load_next_tx_holding_buffer(struct mgsl_struct *info) if ( info->tx_holding_count ) { /* determine if we have enough tx dma buffers - * to accomodate the next tx frame + * to accommodate the next tx frame */ struct tx_holding_buffer *ptx = &info->tx_holding_buffers[info->get_tx_holding_index]; @@ -7621,7 +7621,7 @@ BOOLEAN mgsl_dma_test( struct mgsl_struct *info ) status = info->rx_buffer_list[0].status; if ( status & (BIT8 + BIT3 + BIT1) ) { - /* receive error has occured */ + /* receive error has occurred */ rc = FALSE; } else { if ( memcmp( info->tx_buffer_list[0].virt_addr , @@ -8103,7 +8103,7 @@ void mgsl_sppp_rx_done(struct mgsl_struct *info, char *buf, int size) if (debug_level >= DEBUG_LEVEL_INFO) printk("mgsl_sppp_rx_done(%s)\n",info->netname); if (skb == NULL) { - printk(KERN_NOTICE "%s: cant alloc skb, dropping packet\n", + printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", info->netname); info->netstats.rx_dropped++; return; diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 69e4a0e1da20..1d00213626f4 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c @@ -1829,7 +1829,7 @@ static void sppp_rx_done(SLMP_INFO *info, char *buf, int size) if (debug_level >= DEBUG_LEVEL_INFO) printk("sppp_rx_done(%s)\n",info->netname); if (skb == NULL) { - printk(KERN_NOTICE "%s: cant alloc skb, dropping packet\n", + printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", info->netname); info->netstats.rx_dropped++; return; diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 68d571493ff8..bf81138476b9 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -1882,7 +1882,7 @@ again: buf = con_buf; } - /* At this point 'buf' is guarenteed to be a kernel buffer + /* At this point 'buf' is guaranteed to be a kernel buffer * and therefore no access to userspace (and therefore sleeping) * will be needed. The con_buf_sem serializes all tty based * console rendering and vcs write/read operations. We hold @@ -2872,7 +2872,7 @@ void reset_palette(int currcons) * this is done in order to maintain compatibility with the EGA/VGA fonts. It * is upto the actual low-level console-driver convert data into its favorite * format (maybe we should add a `fontoffset' field to the `display' - * structure so we wont have to convert the fontdata all the time. + * structure so we won't have to convert the fontdata all the time. * /Jes */ diff --git a/drivers/char/watchdog/i810-tco.c b/drivers/char/watchdog/i810-tco.c index 8f571d22fd58..2b853ab05a14 100644 --- a/drivers/char/watchdog/i810-tco.c +++ b/drivers/char/watchdog/i810-tco.c @@ -161,7 +161,7 @@ static int tco_timer_settimer (unsigned char tmrval) } /* - * Reload (trigger) the timer. Lock is needed so we dont reload it during + * Reload (trigger) the timer. Lock is needed so we don't reload it during * a reprogramming event */ @@ -218,7 +218,7 @@ static ssize_t i810tco_write (struct file *file, const char *data, tco_expect_close = 0; - /* scan to see wether or not we got the magic character */ + /* scan to see whether or not we got the magic character */ for (i = 0; i != len; i++) { u8 c; if(get_user(c, data+i)) diff --git a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c index b14f9ff7a861..5419394c236d 100644 --- a/drivers/char/watchdog/sbc60xxwdt.c +++ b/drivers/char/watchdog/sbc60xxwdt.c @@ -50,7 +50,7 @@ * * Why `V' ? Well, `V' is the character in ASCII for the value 86, * and we all know that 86 is _the_ most random number in the universe. - * Therefore it is the letter that has the slightest chance of occuring + * Therefore it is the letter that has the slightest chance of occurring * by chance, when the system becomes corrupted. * */ diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c index 74e5f7368d42..c7701656dcb2 100644 --- a/drivers/char/watchdog/wdt.c +++ b/drivers/char/watchdog/wdt.c @@ -175,7 +175,7 @@ static int wdt_status(void) * * Handle an interrupt from the board. These are raised when the status * map changes in what the board considers an interesting way. That means - * a failure condition occuring. + * a failure condition occurring. */ void wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs) diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c index 1e8b81c91969..dde9f8e54973 100644 --- a/drivers/char/watchdog/wdt_pci.c +++ b/drivers/char/watchdog/wdt_pci.c @@ -158,7 +158,7 @@ static int wdtpci_status(void) * * Handle an interrupt from the board. These are raised when the status * map changes in what the board considers an interesting way. That means - * a failure condition occuring. + * a failure condition occurring. */ static void wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) diff --git a/drivers/hotplug/acpiphp_glue.c b/drivers/hotplug/acpiphp_glue.c index 66895658f552..2f45ea991806 100644 --- a/drivers/hotplug/acpiphp_glue.c +++ b/drivers/hotplug/acpiphp_glue.c @@ -1357,7 +1357,7 @@ int acpiphp_check_bridge (struct acpiphp_bridge *bridge) if (sta != ACPI_STA_ALL) { retval = acpiphp_disable_slot(slot); if (retval) { - err("Error occured in enabling\n"); + err("Error occurred in enabling\n"); up(&slot->crit_sect); goto err_exit; } @@ -1368,7 +1368,7 @@ int acpiphp_check_bridge (struct acpiphp_bridge *bridge) if (sta == ACPI_STA_ALL) { retval = acpiphp_enable_slot(slot); if (retval) { - err("Error occured in enabling\n"); + err("Error occurred in enabling\n"); up(&slot->crit_sect); goto err_exit; } diff --git a/drivers/hotplug/ibmphp_core.c b/drivers/hotplug/ibmphp_core.c index 54bb89f0014b..74d9fd4ca029 100644 --- a/drivers/hotplug/ibmphp_core.c +++ b/drivers/hotplug/ibmphp_core.c @@ -1122,12 +1122,12 @@ static int enable_slot (struct hotplug_slot *hs) } /* Check to see the error of why it failed */ if ((SLOT_POWER (slot_cur->status)) && !(SLOT_PWRGD (slot_cur->status))) - err ("power fault occured trying to power up \n"); + err ("power fault occurred trying to power up \n"); else if (SLOT_BUS_SPEED (slot_cur->status)) { - err ("bus speed mismatch occured. please check current bus speed and card capability \n"); + err ("bus speed mismatch occurred. please check current bus speed and card capability \n"); print_card_capability (slot_cur); } else if (SLOT_BUS_MODE (slot_cur->ext_status)) { - err ("bus mode mismatch occured. please check current bus mode and card capability \n"); + err ("bus mode mismatch occurred. please check current bus mode and card capability \n"); print_card_capability (slot_cur); } ibmphp_update_slot_info (slot_cur); @@ -1145,11 +1145,11 @@ static int enable_slot (struct hotplug_slot *hs) rc = -EINVAL; if (SLOT_POWER (slot_cur->status) && !(SLOT_PWRGD (slot_cur->status))) { - err ("power fault occured trying to power up... \n"); + err ("power fault occurred trying to power up... \n"); goto error_power; } if (SLOT_POWER (slot_cur->status) && (SLOT_BUS_SPEED (slot_cur->status))) { - err ("bus speed mismatch occured. please check current bus speed and card capability \n"); + err ("bus speed mismatch occurred. please check current bus speed and card capability \n"); print_card_capability (slot_cur); goto error_power; } diff --git a/drivers/hotplug/ibmphp_res.c b/drivers/hotplug/ibmphp_res.c index 27cccc156b70..ace5e1dc68fb 100644 --- a/drivers/hotplug/ibmphp_res.c +++ b/drivers/hotplug/ibmphp_res.c @@ -740,7 +740,7 @@ int ibmphp_add_resource (struct resource_node *res) res->nextRange = NULL; } } else { - /* this is the case where it is 1st occurence of the range */ + /* this is the case where it is 1st occurrence of the range */ if (!res_prev) { /* at the beginning of the resource list */ res->next = NULL; diff --git a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c index eff6dd081745..a3adbe770f8c 100644 --- a/drivers/i2c/busses/i2c-amd8111.c +++ b/drivers/i2c/busses/i2c-amd8111.c @@ -8,10 +8,8 @@ * the Free Software Foundation version 2. */ -#include <linux/version.h> #include <linux/module.h> #include <linux/pci.h> -#include <asm/io.h> #include <linux/kernel.h> #include <linux/stddef.h> #include <linux/sched.h> @@ -19,6 +17,7 @@ #include <linux/init.h> #include <linux/i2c.h> #include <linux/delay.h> +#include <asm/io.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR ("Vojtech Pavlik <vojtech@suse.cz>"); @@ -204,8 +203,6 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, protocol |= AMD_SMB_PRTCL_BYTE_DATA; break; - case I2C_SMBUS_WORD_DATA_PEC: - protocol |= AMD_SMB_PRTCL_PEC; case I2C_SMBUS_WORD_DATA: amd_ec_write(smbus, AMD_SMB_CMD, command); if (read_write == I2C_SMBUS_WRITE) { @@ -215,8 +212,6 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, protocol |= AMD_SMB_PRTCL_WORD_DATA | pec; break; - case I2C_SMBUS_BLOCK_DATA_PEC: - protocol |= AMD_SMB_PRTCL_PEC; case I2C_SMBUS_BLOCK_DATA: amd_ec_write(smbus, AMD_SMB_CMD, command); if (read_write == I2C_SMBUS_WRITE) { @@ -238,8 +233,6 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, protocol |= AMD_SMB_PRTCL_I2C_BLOCK_DATA; break; - case I2C_SMBUS_PROC_CALL_PEC: - protocol |= AMD_SMB_PRTCL_PEC; case I2C_SMBUS_PROC_CALL: amd_ec_write(smbus, AMD_SMB_CMD, command); amd_ec_write(smbus, AMD_SMB_DATA, data->word); @@ -248,8 +241,6 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, read_write = I2C_SMBUS_READ; break; - case I2C_SMBUS_BLOCK_PROC_CALL_PEC: - protocol |= AMD_SMB_PRTCL_PEC; case I2C_SMBUS_BLOCK_PROC_CALL: protocol |= pec; len = min_t(u8, data->block[0], 31); @@ -261,6 +252,13 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, read_write = I2C_SMBUS_READ; break; + case I2C_SMBUS_WORD_DATA_PEC: + case I2C_SMBUS_BLOCK_DATA_PEC: + case I2C_SMBUS_PROC_CALL_PEC: + case I2C_SMBUS_BLOCK_PROC_CALL_PEC: + printk(KERN_WARNING "i2c-amd8111.c: Unexpected software PEC transaction %d\n.", size); + return -1; + default: printk(KERN_WARNING "i2c-amd8111.c: Unsupported transaction %d\n", size); return -1; @@ -296,18 +294,14 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, break; case I2C_SMBUS_WORD_DATA: - case I2C_SMBUS_WORD_DATA_PEC: case I2C_SMBUS_PROC_CALL: - case I2C_SMBUS_PROC_CALL_PEC: amd_ec_read(smbus, AMD_SMB_DATA, temp + 0); amd_ec_read(smbus, AMD_SMB_DATA + 1, temp + 1); data->word = (temp[1] << 8) | temp[0]; break; case I2C_SMBUS_BLOCK_DATA: - case I2C_SMBUS_BLOCK_DATA_PEC: case I2C_SMBUS_BLOCK_PROC_CALL: - case I2C_SMBUS_BLOCK_PROC_CALL_PEC: amd_ec_read(smbus, AMD_SMB_BCNT, &len); len = min_t(u8, len, 32); case I2C_SMBUS_I2C_BLOCK_DATA: @@ -320,13 +314,12 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, return 0; } + u32 amd8111_func(struct i2c_adapter *adapter) { return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | - I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_WORD_DATA_PEC | - I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_BLOCK_DATA_PEC | - I2C_FUNC_SMBUS_PROC_CALL | I2C_FUNC_SMBUS_PROC_CALL_PEC | - I2C_FUNC_SMBUS_BLOCK_PROC_CALL | I2C_FUNC_SMBUS_BLOCK_PROC_CALL_PEC | + I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA | + I2C_FUNC_SMBUS_PROC_CALL | I2C_FUNC_SMBUS_BLOCK_PROC_CALL | I2C_FUNC_SMBUS_I2C_BLOCK | I2C_FUNC_SMBUS_HWPEC_CALC; } @@ -337,78 +330,81 @@ static struct i2c_algorithm smbus_algorithm = { .functionality = amd8111_func, }; + +static struct pci_device_id amd8111_ids[] __devinitdata = { + { 0x1022, 0x746a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + { 0, } +}; + static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_id *id) { struct amd_smbus *smbus; + int error = -ENODEV; if (~pci_resource_flags(dev, 0) & IORESOURCE_IO) - return -1; + return -ENODEV; - if (!(smbus = (void*)kmalloc(sizeof(struct amd_smbus), GFP_KERNEL))) - return -1; + smbus = kmalloc(sizeof(struct amd_smbus), GFP_KERNEL); + if (!smbus) + return -ENOMEM; memset(smbus, 0, sizeof(struct amd_smbus)); - pci_set_drvdata(dev, smbus); smbus->dev = dev; smbus->base = pci_resource_start(dev, 0); smbus->size = pci_resource_len(dev, 0); - if (!request_region(smbus->base, smbus->size, "amd8111 SMBus 2.0")) { - kfree(smbus); - return -1; - } + if (!request_region(smbus->base, smbus->size, "amd8111 SMBus 2.0")) + goto out_kfree; smbus->adapter.owner = THIS_MODULE; - sprintf(smbus->adapter.name, "SMBus2 AMD8111 adapter at %04x", smbus->base); + sprintf(smbus->adapter.name, + "SMBus2 AMD8111 adapter at %04x", smbus->base); smbus->adapter.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD8111; smbus->adapter.algo = &smbus_algorithm; smbus->adapter.algo_data = smbus; - if (i2c_add_adapter(&smbus->adapter)) { - printk(KERN_WARNING "i2c-amd8111.c: Failed to register adapter.\n"); - release_region(smbus->base, smbus->size); - kfree(smbus); - return -1; - } + error = i2c_add_adapter(&smbus->adapter); + if (error) + goto out_release_region; pci_write_config_dword(smbus->dev, AMD_PCI_MISC, 0); - - printk(KERN_INFO "i2c-amd8111.c: AMD8111 SMBus 2.0 adapter at %#x\n", smbus->base); + pci_set_drvdata(dev, smbus); return 0; + + out_release_region: + release_region(smbus->base, smbus->size); + out_kfree: + kfree(smbus); + return -1; } + static void __devexit amd8111_remove(struct pci_dev *dev) { - struct amd_smbus *smbus = (void*) pci_get_drvdata(dev); - if (i2c_del_adapter(&smbus->adapter)) { - printk(KERN_WARNING "i2c-amd8111.c: Failed to unregister adapter.\n"); - return; - } + struct amd_smbus *smbus = pci_get_drvdata(dev); + + i2c_del_adapter(&smbus->adapter); release_region(smbus->base, smbus->size); kfree(smbus); } -static struct pci_device_id amd8111_id_table[] __devinitdata = -{{ 0x1022, 0x746a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - { 0 }}; - - static struct pci_driver amd8111_driver = { - .name = "amd8111 smbus 2.0", - .id_table = amd8111_id_table, - .probe = amd8111_probe, - .remove = __devexit_p(amd8111_remove), + .name = "amd8111 smbus 2.0", + .id_table = amd8111_ids, + .probe = amd8111_probe, + .remove = __devexit_p(amd8111_remove), }; -int __init amd8111_init(void) +static int __init i2c_amd8111_init(void) { return pci_module_init(&amd8111_driver); } -void __exit amd8111_exit(void) + +static void __exit i2c_amd8111_exit(void) { pci_unregister_driver(&amd8111_driver); } -module_init(amd8111_init); -module_exit(amd8111_exit); +module_init(i2c_amd8111_init); +module_exit(i2c_amd8111_exit); diff --git a/drivers/i2c/chips/adm1021.c b/drivers/i2c/chips/adm1021.c index 44bd127e5efe..5c15c7b4be1f 100644 --- a/drivers/i2c/chips/adm1021.c +++ b/drivers/i2c/chips/adm1021.c @@ -311,18 +311,14 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, goto error3; /* Register a new directory entry with module sensors */ - if ((i = i2c_register_entry(new_client, - type_name, - data->type == - adm1021 ? - adm1021_dir_table_template : - adm1021_max_dir_table_template, - THIS_MODULE)) < 0) { - err = i; + err = i2c_register_entry(new_client, type_name, + (data->type == adm1021) ? + adm1021_dir_table_template : + adm1021_max_dir_table_template); + if (err < 0) goto error4; - } - data->sysctl_id = i; + data->sysctl_id = err; /* Initialize the ADM1021 chip */ adm1021_init_client(new_client); return 0; diff --git a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c index 0ab250105a5a..e625528e7b3a 100644 --- a/drivers/i2c/chips/lm75.c +++ b/drivers/i2c/chips/lm75.c @@ -191,9 +191,8 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, goto error3; /* Register a new directory entry with module sensors */ - if ((i = i2c_register_entry(new_client, type_name, - lm75_dir_table_template, - THIS_MODULE)) < 0) { + i = i2c_register_entry(new_client, type_name, lm75_dir_table_template); + if (i < 0) { err = i; goto error4; } diff --git a/drivers/i2c/i2c-adap-ite.c b/drivers/i2c/i2c-adap-ite.c index 3f4e4ca01ab6..4f4024ed4c52 100644 --- a/drivers/i2c/i2c-adap-ite.c +++ b/drivers/i2c/i2c-adap-ite.c @@ -265,7 +265,7 @@ MODULE_PARM(own, "i"); MODULE_PARM(i2c_debug,"i"); -/* Called when module is loaded or when kernel is intialized. +/* Called when module is loaded or when kernel is initialized. * If MODULES is defined when this file is compiled, then this function will * resolve to init_module (the function called when insmod is invoked for a * module). Otherwise, this function is called early in the boot, when the diff --git a/drivers/i2c/i2c-algo-ibm_ocp.c b/drivers/i2c/i2c-algo-ibm_ocp.c index 288ac0aac284..63f2b96f37b6 100644 --- a/drivers/i2c/i2c-algo-ibm_ocp.c +++ b/drivers/i2c/i2c-algo-ibm_ocp.c @@ -758,7 +758,7 @@ static int iic_xfer(struct i2c_adapter *i2c_adap, // Check to see if the bus is busy // ret = iic_inb(adap, iic->extsts); - // Mask off the irrelevent bits + // Mask off the irrelevant bits ret = ret & 0x70; // When the bus is free, the BCS bits in the EXTSTS register are 0b100 if(ret != 0x40) return IIC_ERR_LOST_ARB; diff --git a/drivers/i2c/i2c-algo-ite.c b/drivers/i2c/i2c-algo-ite.c index 919a287fa7f3..7bc2d2eb1c26 100644 --- a/drivers/i2c/i2c-algo-ite.c +++ b/drivers/i2c/i2c-algo-ite.c @@ -860,7 +860,7 @@ MODULE_PARM_DESC(i2c_debug, * is loaded via insmod) when this file is compiled with MODULES defined. * Otherwise (i.e. if you want this driver statically linked to the kernel), * a pointer to this function is stored in a table and called - * during the intialization of the kernel (in do_basic_setup in /init/main.c) + * during the initialization of the kernel (in do_basic_setup in /init/main.c) * * All this functionality is complements of the macros defined in linux/init.h */ diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index f92f8bff0731..a95873033f0a 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -61,11 +61,9 @@ static DECLARE_MUTEX(driver_lock); /**** adapter list */ static struct i2c_adapter *adapters[I2C_ADAP_MAX]; -static int adap_count; /**** drivers list */ static struct i2c_driver *drivers[I2C_DRIVER_MAX]; -static int driver_count; /**** debug level */ static int i2c_debug; @@ -116,7 +114,6 @@ int i2c_add_adapter(struct i2c_adapter *adap) } adapters[i] = adap; - adap_count++; ADAP_UNLOCK(); /* init data types */ @@ -161,7 +158,6 @@ int i2c_add_adapter(struct i2c_adapter *adap) ERROR1: ADAP_LOCK(); adapters[i] = NULL; - adap_count--; ERROR0: ADAP_UNLOCK(); return res; @@ -227,7 +223,6 @@ int i2c_del_adapter(struct i2c_adapter *adap) #endif /* def CONFIG_PROC_FS */ adapters[i] = NULL; - adap_count--; ADAP_UNLOCK(); DEB(printk(KERN_DEBUG "i2c-core.o: adapter unregistered: %s\n",adap->name)); @@ -265,7 +260,6 @@ int i2c_add_driver(struct i2c_driver *driver) } drivers[i] = driver; - driver_count++; DRV_UNLOCK(); /* driver was successfully added */ @@ -361,7 +355,6 @@ int i2c_del_driver(struct i2c_driver *driver) } ADAP_UNLOCK(); drivers[i] = NULL; - driver_count--; DRV_UNLOCK(); DEB(printk(KERN_DEBUG "i2c-core.o: driver unregistered: %s\n",driver->name)); @@ -465,73 +458,6 @@ static void i2c_dec_use_client(struct i2c_client *client) module_put(client->adapter->owner); } -struct i2c_client *i2c_get_client(int driver_id, int adapter_id, - struct i2c_client *prev) -{ - int i,j; - - /* Will iterate through the list of clients in each adapter of adapters-list - in search for a client that matches the search criteria. driver_id or - adapter_id are ignored if set to 0. If both are ignored this returns - first client found. */ - - i = j = 0; - - /* set starting point */ - if(prev) - { - if(!(prev->adapter)) - return (struct i2c_client *) -EINVAL; - - for(j=0; j < I2C_ADAP_MAX; j++) - if(prev->adapter == adapters[j]) - break; - - /* invalid starting point? */ - if (I2C_ADAP_MAX == j) { - printk(KERN_WARNING " i2c-core.o: get_client adapter for client:[%s] not found\n", - prev->name); - return (struct i2c_client *) -ENODEV; - } - - for(i=0; i < I2C_CLIENT_MAX; i++) - if(prev == adapters[j]->clients[i]) - break; - - /* invalid starting point? */ - if (I2C_CLIENT_MAX == i) { - printk(KERN_WARNING " i2c-core.o: get_client client:[%s] not found\n", - prev->name); - return (struct i2c_client *) -ENODEV; - } - - i++; /* start from one after prev */ - } - - for(; j < I2C_ADAP_MAX; j++) - { - if(!adapters[j]) - continue; - - if(adapter_id && (adapters[j]->id != adapter_id)) - continue; - - for(; i < I2C_CLIENT_MAX; i++) - { - if(!adapters[j]->clients[i]) - continue; - - if(driver_id && (adapters[j]->clients[i]->driver->id != driver_id)) - continue; - if(adapters[j]->clients[i]->flags & I2C_CLIENT_ALLOW_USE) - return adapters[j]->clients[i]; - } - i = 0; - } - - return 0; -} - int i2c_use_client(struct i2c_client *client) { if (!i2c_inc_use_client(client)) @@ -1421,12 +1347,10 @@ EXPORT_SYMBOL(i2c_add_driver); EXPORT_SYMBOL(i2c_del_driver); EXPORT_SYMBOL(i2c_attach_client); EXPORT_SYMBOL(i2c_detach_client); -EXPORT_SYMBOL(i2c_get_client); EXPORT_SYMBOL(i2c_use_client); EXPORT_SYMBOL(i2c_release_client); EXPORT_SYMBOL(i2c_check_addr); - EXPORT_SYMBOL(i2c_master_send); EXPORT_SYMBOL(i2c_master_recv); EXPORT_SYMBOL(i2c_control); diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index da7934d2f978..4e69b84b609d 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -77,6 +77,7 @@ static struct file_operations i2cdev_fops = { static struct i2c_adapter *i2cdev_adaps[I2CDEV_ADAPS_MAX]; static struct i2c_driver i2cdev_driver = { + .owner = THIS_MODULE, .name = "i2c-dev dummy driver", .id = I2C_DRIVERID_I2CDEV, .flags = I2C_DF_DUMMY, @@ -340,47 +341,42 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd, return 0; } -int i2cdev_open (struct inode *inode, struct file *file) +static int i2cdev_open(struct inode *inode, struct file *file) { unsigned int minor = minor(inode->i_rdev); struct i2c_client *client; - if ((minor >= I2CDEV_ADAPS_MAX) || ! (i2cdev_adaps[minor])) { -#ifdef DEBUG - printk(KERN_DEBUG "i2c-dev.o: Trying to open unattached adapter i2c-%d\n", - minor); -#endif + if ((minor >= I2CDEV_ADAPS_MAX) || !(i2cdev_adaps[minor])) return -ENODEV; - } - /* Note that we here allocate a client for later use, but we will *not* - register this client! Yes, this is safe. No, it is not very clean. */ - if(! (client = kmalloc(sizeof(struct i2c_client),GFP_KERNEL))) + client = kmalloc(sizeof(*client), GFP_KERNEL); + if (!client) return -ENOMEM; - memcpy(client,&i2cdev_client_template,sizeof(struct i2c_client)); + memcpy(client, &i2cdev_client_template, sizeof(*client)); + + /* registered with adapter, passed as client to user */ client->adapter = i2cdev_adaps[minor]; file->private_data = client; - if (!try_module_get(i2cdev_adaps[minor]->owner)) { - kfree(client); - return -ENODEV; - } + /* use adapter module, i2c-dev handled with fops */ + if (!try_module_get(client->adapter->owner)) + goto out_kfree; -#ifdef DEBUG - printk(KERN_DEBUG "i2c-dev.o: opened i2c-%d\n",minor); -#endif return 0; + + out_kfree: + kfree(client); + return -ENODEV; } -static int i2cdev_release (struct inode *inode, struct file *file) +static int i2cdev_release(struct inode *inode, struct file *file) { - unsigned int minor = minor(inode->i_rdev); - kfree(file->private_data); - file->private_data=NULL; -#ifdef DEBUG - printk(KERN_DEBUG "i2c-dev.o: Closed: i2c-%d\n", minor); -#endif - module_put(i2cdev_adaps[minor]->owner); + struct i2c_client *client = file->private_data; + + module_put(client->adapter->owner); + kfree(client); + file->private_data = NULL; + return 0; } diff --git a/drivers/i2c/i2c-proc.c b/drivers/i2c/i2c-proc.c index a109bf62fdcd..2b2e752e0769 100644 --- a/drivers/i2c/i2c-proc.c +++ b/drivers/i2c/i2c-proc.c @@ -125,17 +125,12 @@ static int i2c_create_name(char **name, const char *prefix, ctl_template should be a template of the newly created directory. It is copied in memory. The extra2 field of each file is set to point to client. If any driver wants subdirectories within the newly created directory, - this function must be updated! - controlling_mod is the controlling module. It should usually be - THIS_MODULE when calling. Note that this symbol is not defined in - kernels before 2.3.13; define it to NULL in that case. We will not use it - for anything older than 2.3.27 anyway. */ + this function must be updated! */ int i2c_register_entry(struct i2c_client *client, const char *prefix, - ctl_table * ctl_template, - struct module *controlling_mod) + ctl_table * ctl_template) { int i, res, len, id; - ctl_table *new_table; + ctl_table *new_table, *client_tbl, *tbl; char *name; struct ctl_table_header *new_header; @@ -150,26 +145,33 @@ int i2c_register_entry(struct i2c_client *client, const char *prefix, kfree(name); return -ENOMEM; } - id += 256; + id += 256; + len = 0; while (ctl_template[len].procname) len++; - len += 7; - if (!(new_table = kmalloc(sizeof(ctl_table) * len, GFP_KERNEL))) { + if (!(new_table = kmalloc(sizeof(sysctl_table) + sizeof(ctl_table) * (len + 1), + GFP_KERNEL))) { kfree(name); return -ENOMEM; } - memcpy(new_table, sysctl_table, 6 * sizeof(ctl_table)); - new_table[0].child = &new_table[2]; - new_table[2].child = &new_table[4]; - new_table[4].child = &new_table[6]; - new_table[4].procname = name; - new_table[4].ctl_name = id; - memcpy(new_table + 6, ctl_template, (len - 6) * sizeof(ctl_table)); - for (i = 6; i < len; i++) - new_table[i].extra2 = client; + memcpy(new_table, sysctl_table, sizeof(sysctl_table)); + tbl = new_table; /* sys/ */ + tbl = tbl->child = tbl + 2; /* dev/ */ + tbl = tbl->child = tbl + 2; /* sensors/ */ + client_tbl = tbl->child = tbl + 2; /* XX-chip-YY-ZZ/ */ + + client_tbl->procname = name; + client_tbl->ctl_name = id; + client_tbl->child = client_tbl + 2; + + /* Next the client sysctls. --km */ + tbl = client_tbl->child; + memcpy(tbl, ctl_template, sizeof(ctl_table) * (len+1)); + for (i = 0; i < len; i++) + tbl[i].extra2 = client; if (!(new_header = register_sysctl_table(new_table, 0))) { printk(KERN_ERR "i2c-proc.o: error: sysctl interface not supported by kernel!\n"); @@ -178,21 +180,21 @@ int i2c_register_entry(struct i2c_client *client, const char *prefix, return -EPERM; } - i2c_entries[id - 256] = new_header; + i2c_entries[id - 256] = new_header; i2c_clients[id - 256] = client; + #ifdef DEBUG if (!new_header || !new_header->ctl_table || !new_header->ctl_table->child || !new_header->ctl_table->child->child || - !new_header->ctl_table->child->child->de) { + !new_header->ctl_table->child->child->de ) { printk (KERN_ERR "i2c-proc.o: NULL pointer when trying to install fill_inode fix!\n"); return id; } #endif /* DEBUG */ - new_header->ctl_table->child->child->de->owner = controlling_mod; - + client_tbl->de->owner = client->driver->owner; return id; } @@ -515,7 +517,7 @@ static int i2c_parse_reals(int *nrels, void *buffer, int bufsize, return 0; } -int i2c_write_reals(int nrels, void *buffer, size_t *bufsize, +static int i2c_write_reals(int nrels, void *buffer, size_t *bufsize, long *results, int magnitude) { #define BUFLEN 20 diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 174addd22796..9f3bb7919dd4 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c @@ -731,7 +731,7 @@ static int icside_dma_verbose(ide_drive_t *drive) static int icside_dma_timeout(ide_drive_t *drive) { - printk(KERN_ERR "%s: DMA timeout occured: ", drive->name); + printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); if (icside_dma_test_irq(drive)) return 0; diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index b08f8a60110d..5c721cb8e51e 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -19,7 +19,7 @@ * ftp://fission.dt.wdc.com/pub/standards/SFF_atapi/spec/SFF8020-r2.6/PS/8020r26.ps * ftp://ftp.avc-pioneer.com/Mtfuji4/Spec/Fuji4r10.pdf * - * Drives that deviate from these standards will be accomodated as much + * Drives that deviate from these standards will be accommodated as much * as possible via compile time or command-line options. Since I only have * a few drives, you generally need to send me patches... * diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index f212b0123c19..6b034958f454 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -196,9 +196,9 @@ EXPORT_SYMBOL_GPL(ide_dma_intr); * @drive: the drive to build the DMA table for * @rq: the request holding the sg list * - * Perform the PCI mapping magic neccessary to access the source or + * Perform the PCI mapping magic necessary to access the source or * target buffers of a request via PCI DMA. The lower layers of the - * kernel provide the neccessary cache management so that we can + * kernel provide the necessary cache management so that we can * operate in a portable fashion */ @@ -226,9 +226,9 @@ static int ide_build_sglist (ide_drive_t *drive, struct request *rq) * @drive: the drive to build the DMA table for * @rq: the request holding the sg list * - * Perform the PCI mapping magic neccessary to access the source or + * Perform the PCI mapping magic necessary to access the source or * target buffers of a taskfile request via PCI DMA. The lower layers - * of the kernel provide the neccessary cache management so that we can + * of the kernel provide the necessary cache management so that we can * operate in a portable fashion */ @@ -454,7 +454,7 @@ static int config_drive_for_dma (ide_drive_t *drive) * An IDE DMA transfer timed out. In the event of an error we ask * the driver to resolve the problem, if a DMA transfer is still * in progress we continue to wait (arguably we need to add a - * secondary 'I dont care what the drive thinks' timeout here) + * secondary 'I don't care what the drive thinks' timeout here) * Finally if we have an interrupt but for some reason got the * timeout first we complete the I/O. This can occur if an * interrupt is lost or due to bugs. diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 64ee462aaa97..03b16beb9f67 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -379,7 +379,7 @@ EXPORT_SYMBOL(ide_cmd); * @drive: drive the completion interrupt occurred on * * drive_cmd_intr() is invoked on completion of a special DRIVE_CMD. - * We do any neccessary daya reading and then wait for the drive to + * We do any necessary daya reading and then wait for the drive to * go non busy. At that point we may read the error data and complete * the request */ @@ -652,7 +652,7 @@ EXPORT_SYMBOL(ide_stall_queue); * @hwgroup: hardware group to select on * * choose_drive() selects the next drive which will be serviced. - * This is neccessary because the IDE layer can't issue commands + * This is necessary because the IDE layer can't issue commands * to both drives on the same cable, unlike SCSI. */ diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index ae4ccc4a3a7e..5a0ef435cd5c 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c @@ -327,7 +327,7 @@ static int config_chipset_for_dma (ide_drive_t *drive) #endif /* PDC202_DEBUG_CABLE */ break; default: - /* If its not one we know we should never + /* If it's not one we know we should never arrive here.. */ BUG(); } diff --git a/drivers/ide/pci/triflex.h b/drivers/ide/pci/triflex.h index 22ff96fdf82f..dcae6d0d7fb0 100644 --- a/drivers/ide/pci/triflex.h +++ b/drivers/ide/pci/triflex.h @@ -18,31 +18,26 @@ static int triflex_get_info(char *, char **, off_t, int); static ide_pci_device_t triflex_devices[] __devinitdata = { { - .vendor PCI_VENDOR_ID_COMPAQ, - .device PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE, - .name "TRIFLEX", - .init_chipset init_chipset_triflex, - .init_iops NULL, - .init_hwif init_hwif_triflex, - .channels 2, - .autodma AUTODMA, - .enablebits {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, - .bootable ON_BOARD, - .extra 0, + .vendor = PCI_VENDOR_ID_COMPAQ, + .device = PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE, + .name = "TRIFLEX", + .init_chipset = init_chipset_triflex, + .init_iops = NULL, + .init_hwif = init_hwif_triflex, + .channels = 2, + .autodma = AUTODMA, + .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, + .bootable = ON_BOARD, },{ - .vendor 0, - .device 0, - .channels 0, - .bootable EOL, + .bootable = EOL, } }; #ifdef CONFIG_PROC_FS static ide_pci_host_proc_t triflex_proc __initdata = { - name: "triflex", - set: 1, - get_info: triflex_get_info, - parent: NULL, + .name = "triflex", + .set = 1, + .get_info = triflex_get_info, }; #endif diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c index 8f4b257502ab..35b745e0e5cb 100644 --- a/drivers/ide/ppc/mpc8xx.c +++ b/drivers/ide/ppc/mpc8xx.c @@ -331,7 +331,7 @@ m8xx_ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, (0x80000000 >> ioport_dsc[data_port].irq); #ifdef CONFIG_IDE_8xx_PCCARD - /* Make sure we dont get garbage irq */ + /* Make sure we don't get garbage irq */ ((immap_t *) IMAP_ADDR)->im_pcmcia.pcmc_pscr = 0xFFFF; /* Enable falling edge irq */ diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index a015a445221a..a4cd566a98a4 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -1400,7 +1400,7 @@ pmac_ide_dma_test_irq (ide_drive_t *drive) * to system memory when the disk interrupt occurs. * * The trick here is to increment drive->waiting_for_dma, - * and return as if no interrupt occured. If the counter + * and return as if no interrupt occurred. If the counter * reach a certain timeout value, we then return 1. If * we really got the interrupt, it will happen right away * again. diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 8efb3067b435..ac88b17d4065 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -470,7 +470,7 @@ fixup_address: * @hwif: Hardware interface we are configuring * * Set up the DMA base for the interface. Enable the master bits as - * neccessary and attempt to bring the device DMA into a ready to use + * necessary and attempt to bring the device DMA into a ready to use * state */ @@ -573,7 +573,7 @@ static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, in * @index: ata index to update * * Scan the interfaces attached to this device and do any - * neccessary per port setup. Attach the devices and ask the + * necessary per port setup. Attach the devices and ask the * generic DMA layer to do its work for us. * * Normally called automaticall from do_ide_pci_setup_device, diff --git a/drivers/ieee1394/amdtp.c b/drivers/ieee1394/amdtp.c index a42c71cc4911..0b382a2af0e7 100644 --- a/drivers/ieee1394/amdtp.c +++ b/drivers/ieee1394/amdtp.c @@ -228,7 +228,7 @@ struct stream { /* The cycle_count and cycle_offset fields are used for the * synchronization timestamps (syt) in the cip header. They * are incremented by at least a cycle every time we put a - * time stamp in a packet. As we dont time stamp all + * time stamp in a packet. As we don't time stamp all * packages, cycle_count isn't updated in every cycle, and * sometimes it's incremented by 2. Thus, we have * cycle_count2, which is simply incremented by one with each @@ -748,7 +748,7 @@ static void fill_packet(struct stream *s, struct packet *packet, int nevents) /* This next addition should be modulo 8000 (0x1f40), * but we only use the lower 4 bits of cycle_count, so - * we dont need the modulo. */ + * we don't need the modulo. */ atomic_add(s->cycle_offset.integer / 3072, &s->cycle_count); s->cycle_offset.integer %= 3072; } diff --git a/drivers/ieee1394/dv1394-private.h b/drivers/ieee1394/dv1394-private.h index a9bad6289475..9fe654b0ffb9 100644 --- a/drivers/ieee1394/dv1394-private.h +++ b/drivers/ieee1394/dv1394-private.h @@ -488,7 +488,7 @@ struct video_card { struct frame *frames[DV1394_MAX_FRAMES]; /* n_frames also serves as an indicator that this struct video_card is - intialized and ready to run DMA buffers */ + initialized and ready to run DMA buffers */ int n_frames; diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 152e12155d38..9aadf74fdefc 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -663,7 +663,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev) * call to schedule our writes. */ /* XXX: Right now we accept that we don't exactly follow RFC. When - * we do, we will send ARP requests via GASP format, and so we wont + * we do, we will send ARP requests via GASP format, and so we won't * need this hack. */ spin_lock_irqsave (&priv->lock, flags); diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index 53fc95615f82..ea268b5b071b 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c @@ -827,7 +827,7 @@ static int ohci_transmit(struct hpsb_host *host, struct hpsb_packet *packet) return 0; } - /* Decide wether we have an iso, a request, or a response packet */ + /* Decide whether we have an iso, a request, or a response packet */ if (packet->type == hpsb_raw) d = &ohci->at_req_context; else if (packet->tcode == TCODE_ISO_DATA) { @@ -2266,7 +2266,7 @@ static void ohci_irq_handler(int irq, void *dev_id, if (event & OHCI1394_cycleInconsistent) { /* We subscribe to the cycleInconsistent event only to * clear the corresponding event bit... otherwise, - * isochronous cycleMatch DMA wont work. */ + * isochronous cycleMatch DMA won't work. */ DBGMSG(ohci->id, "OHCI1394_cycleInconsistent"); event &= ~OHCI1394_cycleInconsistent; } @@ -2366,7 +2366,7 @@ static void ohci_irq_handler(int irq, void *dev_id, if (!(node_id & 0x80000000)) { PRINT(KERN_ERR, ohci->id, "SelfID received, but NodeID invalid " - "(probably new bus reset occured): %08X", + "(probably new bus reset occurred): %08X", node_id); goto selfid_not_valid; } @@ -3530,7 +3530,7 @@ void ohci1394_init_iso_tasklet(struct ohci1394_iso_tasklet *tasklet, int type, tasklet_init(&tasklet->tasklet, func, data); tasklet->type = type; /* We init the tasklet->link field, so we can list_del() it - * without worrying wether it was added to the list or not. */ + * without worrying whether it was added to the list or not. */ INIT_LIST_HEAD(&tasklet->link); } diff --git a/drivers/ieee1394/ohci1394.h b/drivers/ieee1394/ohci1394.h index e7fca5a98ac0..234f1b153816 100644 --- a/drivers/ieee1394/ohci1394.h +++ b/drivers/ieee1394/ohci1394.h @@ -405,12 +405,12 @@ static inline u32 reg_read(const struct ti_ohci *ohci, int offset) truncated */ #define EVT_OVERRUN 0x5 /* A recv FIFO overflowed on reception of ISO packet */ -#define EVT_DESCRIPTOR_READ 0x6 /* An unrecoverable error occured while host was +#define EVT_DESCRIPTOR_READ 0x6 /* An unrecoverable error occurred while host was reading a descriptor block */ -#define EVT_DATA_READ 0x7 /* An error occured while host controller was +#define EVT_DATA_READ 0x7 /* An error occurred while host controller was attempting to read from host memory in the data stage of descriptor processing */ -#define EVT_DATA_WRITE 0x8 /* An error occured while host controller was +#define EVT_DATA_WRITE 0x8 /* An error occurred while host controller was attempting to write either during the data stage of descriptor processing, or when processing a single 16-bit host memory write */ diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c index 4779e7d23b02..e93bc36a77ef 100644 --- a/drivers/ieee1394/raw1394.c +++ b/drivers/ieee1394/raw1394.c @@ -2440,7 +2440,7 @@ static int raw1394_release(struct inode *inode, struct file *file) spin_unlock_irq(&host_info_lock); if (fail > 0) { printk(KERN_ERR "raw1394: during addr_list-release " - "error(s) occured \n"); + "error(s) occurred \n"); } while (!done) { diff --git a/drivers/isdn/eicon/adapter.h b/drivers/isdn/eicon/adapter.h index b861d3557904..fd0b79ab7103 100644 --- a/drivers/isdn/eicon/adapter.h +++ b/drivers/isdn/eicon/adapter.h @@ -185,7 +185,7 @@ extern IDI_CALL DivasIdiRequest[]; /* - * intialisation entry point + * initialisation entry point */ int DivasInit(void); diff --git a/drivers/isdn/eicon/eicon_idi.c b/drivers/isdn/eicon/eicon_idi.c index fc341e1b396c..f1e4df4477ec 100644 --- a/drivers/isdn/eicon/eicon_idi.c +++ b/drivers/isdn/eicon/eicon_idi.c @@ -2717,7 +2717,7 @@ idi_handle_ack_ok(eicon_card *ccard, eicon_chan *chan, eicon_RC *ack) int twaitpq = 0; if (ack->RcId != ((chan->e.ReqCh) ? chan->e.B2Id : chan->e.D3Id)) { - /* I dont know why this happens, should not ! */ + /* I don't know why this happens, should not ! */ /* just ignoring this RC */ eicon_log(ccard, 16, "idi_ack: Ch%d: RcId %d not equal to last %d\n", chan->No, ack->RcId, (chan->e.ReqCh) ? chan->e.B2Id : chan->e.D3Id); diff --git a/drivers/isdn/eicon/idi.c b/drivers/isdn/eicon/idi.c index 6167db1cdb87..6a675dbcc21e 100644 --- a/drivers/isdn/eicon/idi.c +++ b/drivers/isdn/eicon/idi.c @@ -435,7 +435,7 @@ void DivasOut(ADAPTER * a) a->ram_out(a, &ReqOut->ReqId, this->Id); a->ram_out(a, &ReqOut->ReqCh, this->ReqCh); - /* if its a specific request (no ASSIGN) ... */ + /* if it's a specific request (no ASSIGN) ... */ if(this->Id &0x1f) { diff --git a/drivers/isdn/hardware/eicon/dadapter.c b/drivers/isdn/hardware/eicon/dadapter.c index 929af7cc82ac..19b353eb4ef7 100644 --- a/drivers/isdn/hardware/eicon/dadapter.c +++ b/drivers/isdn/hardware/eicon/dadapter.c @@ -327,7 +327,7 @@ static void diva_notify_adapter_change (DESCRIPTOR* d, int removal) { Adapter array will be written to memory described by 'buffer' If the last adapter seen in the returned adapter array is IDI_DADAPTER or if last adapter in array does have type '0', then - it was enougth space in buffer to accomodate all available + it was enougth space in buffer to accommodate all available adapter descriptors *NOTE 1 (debug interface): The IDI adapter of type 'IDI_DIMAINT' does register as 'request' diff --git a/drivers/isdn/hardware/eicon/di.c b/drivers/isdn/hardware/eicon/di.c index cdfab30fa348..9ce6aa956d7f 100644 --- a/drivers/isdn/hardware/eicon/di.c +++ b/drivers/isdn/hardware/eicon/di.c @@ -169,7 +169,7 @@ void pr_out(ADAPTER * a) a->ram_outw(a, &ReqOut->XBuffer.length, length); a->ram_out(a, &ReqOut->ReqId, this->Id); a->ram_out(a, &ReqOut->ReqCh, this->ReqCh); - /* if its a specific request (no ASSIGN) ... */ + /* if it's a specific request (no ASSIGN) ... */ if(this->Id &0x1f) { /* if buffers are left in the list of data buffers do */ /* do chaining (LL_MDATA, N_MDATA) */ @@ -405,7 +405,7 @@ void scom_out(ADAPTER * a) a->ram_outw(a, &RAM->XBuffer.length, length); a->ram_out(a, &RAM->ReqId, this->Id); a->ram_out(a, &RAM->ReqCh, this->ReqCh); - /* if its a specific request (no ASSIGN) ... */ + /* if it's a specific request (no ASSIGN) ... */ if(this->Id &0x1f) { /* if buffers are left in the list of data buffers do */ /* chaining (LL_MDATA, N_MDATA) */ diff --git a/drivers/isdn/hardware/eicon/i4l_idi.c b/drivers/isdn/hardware/eicon/i4l_idi.c index 574cefc99b0d..8a49e52f6acf 100644 --- a/drivers/isdn/hardware/eicon/i4l_idi.c +++ b/drivers/isdn/hardware/eicon/i4l_idi.c @@ -2717,7 +2717,7 @@ idi_handle_ack_ok(eicon_card *ccard, eicon_chan *chan, eicon_RC *ack) int twaitpq = 0; if (ack->RcId != ((chan->e.ReqCh) ? chan->e.B2Id : chan->e.D3Id)) { - /* I dont know why this happens, should not ! */ + /* I don't know why this happens, should not ! */ /* just ignoring this RC */ eicon_log(ccard, 16, "idi_ack: Ch%d: RcId %d not equal to last %d\n", chan->No, ack->RcId, (chan->e.ReqCh) ? chan->e.B2Id : chan->e.D3Id); diff --git a/drivers/isdn/hardware/eicon/istream.c b/drivers/isdn/hardware/eicon/istream.c index cb1e88216e53..23139668d9b1 100644 --- a/drivers/isdn/hardware/eicon/istream.c +++ b/drivers/isdn/hardware/eicon/istream.c @@ -142,7 +142,7 @@ int diva_istream_write (void* context, return 0 if zero packet was received return -1 if stream is empty return -2 if read buffer does not profide sufficient space - to accomodate entire segment + to accommodate entire segment max_length should be at least 68 bytes ------------------------------------------------------------------- */ int diva_istream_read (void* context, diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c index e62bac451ae7..72b0c7e03e7d 100644 --- a/drivers/isdn/hisax/amd7930_fn.c +++ b/drivers/isdn/hisax/amd7930_fn.c @@ -42,7 +42,7 @@ * * Credits: * Programming the driver for Formula-n enter:now ISDN PCI and - * neccessary this driver for the used Amd 7930 D-channel-controller + * necessary this driver for the used Amd 7930 D-channel-controller * was spnsored by Formula-n Europe AG. * Thanks to Karsten Keil and Petr Novak, who gave me support in * Hisax-specific questions. @@ -317,7 +317,7 @@ Amd7930_empty_Dfifo(struct IsdnCardState *cs, int flag) QuickHex(t, cs->rcvbuf, cs->rcvidx); debugl1(cs, cs->dlog); } - /* moves recieved data in sk-buffer */ + /* moves received data in sk-buffer */ memcpy(skb_put(skb, cs->rcvidx), cs->rcvbuf, cs->rcvidx); skb_queue_tail(&cs->rq, skb); } diff --git a/drivers/isdn/hisax/asuscom.c b/drivers/isdn/hisax/asuscom.c index da25348e3fa1..b86727ba1add 100644 --- a/drivers/isdn/hisax/asuscom.c +++ b/drivers/isdn/hisax/asuscom.c @@ -283,7 +283,7 @@ setup_asuscom(struct IsdnCard *card) printk(KERN_ERR "AsusPnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { printk(KERN_ERR "AsusPnP: activate failed\n"); pnp_device_detach(pd); return 0; diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index 2385f77a52f0..d938e3dcf1c9 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -632,7 +632,7 @@ setup_avm_pcipnp(struct IsdnCard *card) printk(KERN_ERR "FritzPnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pnp_avm, NULL) < 0) { + if (pnp_activate_dev(pnp_avm) < 0) { printk(KERN_ERR "FritzPnP: activate failed\n"); pnp_device_detach(pnp_avm); return 0; diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index 09e5fe393311..c9cf0ddd04e9 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c @@ -600,7 +600,7 @@ setup_diva(struct IsdnCard *card) printk(KERN_ERR "Diva PnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { printk(KERN_ERR "Diva PnP: activate failed\n"); pnp_device_detach(pd); return 0; diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c index 645257c744bb..f9d4ed94ae31 100644 --- a/drivers/isdn/hisax/elsa.c +++ b/drivers/isdn/hisax/elsa.c @@ -864,7 +864,7 @@ setup_elsa(struct IsdnCard *card) printk(KERN_ERR "Elsa PnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { pnp_device_detach(pd); printk(KERN_ERR "Elsa PnP: activate failed\n"); return 0; diff --git a/drivers/isdn/hisax/enternow_pci.c b/drivers/isdn/hisax/enternow_pci.c index 913ff14167c8..7585bb59f1ba 100644 --- a/drivers/isdn/hisax/enternow_pci.c +++ b/drivers/isdn/hisax/enternow_pci.c @@ -49,7 +49,7 @@ * * Credits: * Programming the driver for Formula-n enter:now ISDN PCI and - * neccessary the driver for the used Amd 7930 D-channel-controller + * necessary the driver for the used Amd 7930 D-channel-controller * was spnsored by Formula-n Europe AG. * Thanks to Karsten Keil and Petr Novak, who gave me support in * Hisax-specific questions. diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c index 566cf36ae6cd..43679deac969 100644 --- a/drivers/isdn/hisax/hfc_sx.c +++ b/drivers/isdn/hisax/hfc_sx.c @@ -97,7 +97,7 @@ fifo_select(struct IsdnCardState *cs, u8 fifo) /******************************************/ /* reset the specified fifo to defaults. */ -/* If its a send fifo init needed markers */ +/* If it's a send fifo init needed markers */ /******************************************/ static void reset_fifo(struct IsdnCardState *cs, u8 fifo) @@ -1200,7 +1200,7 @@ setup_hfcsx(struct IsdnCard *card) printk(KERN_ERR "HFC PnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { printk(KERN_ERR "HFC PnP: activate failed\n"); pnp_device_detach(pd); return 0; diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c index 93b5a5df0958..ede8af634c80 100644 --- a/drivers/isdn/hisax/hfcscard.c +++ b/drivers/isdn/hisax/hfcscard.c @@ -193,7 +193,7 @@ setup_hfcs(struct IsdnCard *card) printk(KERN_ERR "HFC PnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { printk(KERN_ERR "HFC PnP: activate failed\n"); pnp_device_detach(pd); return 0; diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c index feb20780ec6b..6c5dd612a824 100644 --- a/drivers/isdn/hisax/isurf.c +++ b/drivers/isdn/hisax/isurf.c @@ -223,7 +223,7 @@ setup_isurf(struct IsdnCard *card) printk(KERN_ERR "ISurfPnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { printk(KERN_ERR "ISurfPnP: activate failed\n"); pnp_device_detach(pd); return 0; diff --git a/drivers/isdn/hisax/ix1_micro.c b/drivers/isdn/hisax/ix1_micro.c index 62b0f5f9d889..58bc3204235b 100644 --- a/drivers/isdn/hisax/ix1_micro.c +++ b/drivers/isdn/hisax/ix1_micro.c @@ -208,7 +208,7 @@ setup_ix1micro(struct IsdnCard *card) printk(KERN_ERR "ITK PnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { printk(KERN_ERR "ITK PnP: activate failed\n"); pnp_device_detach(pd); return 0; diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c index 75e4706ce9b7..a2cae62f6bcc 100644 --- a/drivers/isdn/hisax/l3dss1.c +++ b/drivers/isdn/hisax/l3dss1.c @@ -1603,7 +1603,7 @@ l3dss1_setup(struct l3_process *pc, u8 pr, void *arg) * Bearer Capabilities */ p = skb->data; - /* only the first occurence 'll be detected ! */ + /* only the first occurrence 'll be detected ! */ if ((p = findie(p, skb->len, 0x04, 0))) { if ((p[1] < 2) || (p[1] > 11)) err = 1; diff --git a/drivers/isdn/hisax/l3ni1.c b/drivers/isdn/hisax/l3ni1.c index b9001580be28..94ea0d0f7f47 100644 --- a/drivers/isdn/hisax/l3ni1.c +++ b/drivers/isdn/hisax/l3ni1.c @@ -1456,7 +1456,7 @@ l3ni1_setup(struct l3_process *pc, u8 pr, void *arg) * Bearer Capabilities */ p = skb->data; - /* only the first occurence 'll be detected ! */ + /* only the first occurrence 'll be detected ! */ if ((p = findie(p, skb->len, 0x04, 0))) { if ((p[1] < 2) || (p[1] > 11)) err = 1; diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c index 3e6aefa11a4e..e34cb5b57672 100644 --- a/drivers/isdn/hisax/niccy.c +++ b/drivers/isdn/hisax/niccy.c @@ -232,7 +232,7 @@ setup_niccy(struct IsdnCard *card) printk(KERN_ERR "NiccyPnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { printk(KERN_ERR "NiccyPnP: activate failed\n"); pnp_device_detach(pd); return 0; diff --git a/drivers/isdn/hisax/rawhdlc.c b/drivers/isdn/hisax/rawhdlc.c index abf82e12035f..4092bf67d58c 100644 --- a/drivers/isdn/hisax/rawhdlc.c +++ b/drivers/isdn/hisax/rawhdlc.c @@ -34,7 +34,7 @@ * end-of-frame would occur), so the transmitter performs * "bit-stuffing" - inserting a zero bit after every five one bits, * irregardless of the original bit after the five ones. Byte - * ordering is irrelevent at this point - the data is treated as a + * ordering is irrelevant at this point - the data is treated as a * string of bits, not bytes. Since no more than 5 ones may now occur * in a row, the flag sequence, with its 6 ones, is unique. * diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c index d88e43883bd8..54b18911b567 100644 --- a/drivers/isdn/hisax/sedlbauer.c +++ b/drivers/isdn/hisax/sedlbauer.c @@ -524,7 +524,7 @@ setup_sedlbauer(struct IsdnCard *card) printk(KERN_ERR "Sedlbauer PnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pd, NULL) < 0) { + if (pnp_activate_dev(pd) < 0) { printk(KERN_ERR "Sedlbauer PnP: activate failed\n"); pnp_device_detach(pd); return 0; diff --git a/drivers/isdn/hisax/teles3.c b/drivers/isdn/hisax/teles3.c index 06528fdfa5db..08aec06d3303 100644 --- a/drivers/isdn/hisax/teles3.c +++ b/drivers/isdn/hisax/teles3.c @@ -227,7 +227,7 @@ setup_teles3(struct IsdnCard *card) printk(KERN_ERR "Teles PnP: attach failed\n"); return 0; } - if (pnp_activate_dev(pnp_dev, NULL) < 0) { + if (pnp_activate_dev(pnp_dev) < 0) { printk(KERN_ERR "Teles PnP: activate failed\n"); pnp_device_detach(pnp_dev); return 0; diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c index dd3860405be2..122927a5544b 100644 --- a/drivers/isdn/hysdn/hycapi.c +++ b/drivers/isdn/hysdn/hycapi.c @@ -521,7 +521,7 @@ hycapi_rx_capipkt Receive a capi-message. All B3_DATA_IND are converted to 64K-extension compatible format. -New nccis are created if neccessary. +New nccis are created if necessary. *******************************************************************/ void @@ -702,7 +702,7 @@ hycapi_cleanup(void) /******************************************************************** hycapi_capi_create(hysdn_card *card) -Attach the card with it's capi-ctrl. +Attach the card with its capi-ctrl. *********************************************************************/ static void hycapi_fill_profile(hysdn_card *card) diff --git a/drivers/isdn/hysdn/hysdn_boot.c b/drivers/isdn/hysdn/hysdn_boot.c index bf8756c0954f..6c04281e57b8 100644 --- a/drivers/isdn/hysdn/hysdn_boot.c +++ b/drivers/isdn/hysdn/hysdn_boot.c @@ -357,7 +357,7 @@ EvalSysrTokData(hysdn_card * card, uchar * cp, int len) hysdn_addlog(card, "SysReady Token Data invalid CRC"); return (1); } - len--; /* dont check CRC byte */ + len--; /* don't check CRC byte */ while (len > 0) { if (*cp == SYSR_TOK_END) diff --git a/drivers/isdn/i4l/isdn_ppp_ccp.c b/drivers/isdn/i4l/isdn_ppp_ccp.c index 974468613755..155e76b1b3d0 100644 --- a/drivers/isdn/i4l/isdn_ppp_ccp.c +++ b/drivers/isdn/i4l/isdn_ppp_ccp.c @@ -197,7 +197,7 @@ ippp_ccp_reset_xmit(struct ippp_ccp *ccp, and increase ids only when an Ack is received for a given id */ id = ccp->reset->lastid++; - /* We always expect an Ack if the decompressor doesnt + /* We always expect an Ack if the decompressor doesn't know better */ rp->expra = 1; rp->dtval = 0; diff --git a/drivers/isdn/tpam/tpam_commands.c b/drivers/isdn/tpam/tpam_commands.c index d4c4339ab166..b83dd1934a7a 100644 --- a/drivers/isdn/tpam/tpam_commands.c +++ b/drivers/isdn/tpam/tpam_commands.c @@ -880,7 +880,7 @@ void tpam_recv_U3DataInd(tpam_card *card, struct sk_buff *skb) { memcpy(skb_put(result, len), data, len); } - /* In loop mode, resend the data immediatly */ + /* In loop mode, resend the data immediately */ if (card->loopmode) { struct sk_buff *loopskb; diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 9161022d90c9..f73a5b1eea29 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -1179,7 +1179,7 @@ pmu_queue_request(struct adb_request *req) static inline void wait_for_ack(void) { - /* Sightly increased the delay, I had one occurence of the message + /* Sightly increased the delay, I had one occurrence of the message * reported */ int timeout = 4000; @@ -2066,7 +2066,7 @@ int __openfirmware powerbook_sleep_G3(void) /* Make sure the decrementer won't interrupt us */ asm volatile("mtdec %0" : : "r" (0x7fffffff)); - /* Make sure any pending DEC interrupt occuring while we did + /* Make sure any pending DEC interrupt occurring while we did * the above didn't re-enable the DEC */ mb(); asm volatile("mtdec %0" : : "r" (0x7fffffff)); @@ -2211,7 +2211,7 @@ int __openfirmware powerbook_sleep_Core99(void) /* Make sure the decrementer won't interrupt us */ asm volatile("mtdec %0" : : "r" (0x7fffffff)); - /* Make sure any pending DEC interrupt occuring while we did + /* Make sure any pending DEC interrupt occurring while we did * the above didn't re-enable the DEC */ mb(); asm volatile("mtdec %0" : : "r" (0x7fffffff)); @@ -2376,7 +2376,7 @@ int __openfirmware powerbook_sleep_3400(void) /* Make sure the decrementer won't interrupt us */ asm volatile("mtdec %0" : : "r" (0x7fffffff)); - /* Make sure any pending DEC interrupt occuring while we did + /* Make sure any pending DEC interrupt occurring while we did * the above didn't re-enable the DEC */ mb(); asm volatile("mtdec %0" : : "r" (0x7fffffff)); diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 06bf868d5969..a758417cce2e 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -173,14 +173,18 @@ static void free_cell(struct hash_cell *hc) */ static int register_with_devfs(struct hash_cell *hc) { - char name[32]; struct gendisk *disk = dm_disk(hc->md); + char *name = kmalloc(DM_NAME_LEN + strlen(DM_DIR) + 1); + if (!name) { + return -ENOMEM; + } sprintf(name, DM_DIR "/%s", hc->name); devfs_register(NULL, name, DEVFS_FL_CURRENT_OWNER, disk->major, disk->first_minor, S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP, &dm_blk_dops, NULL); + kfree(name); return 0; } @@ -545,7 +549,7 @@ static inline int get_mode(struct dm_ioctl *param) static int check_name(const char *name) { - if (strchr(name, '/')) { + if (name[0] == '/') { DMWARN("invalid device name"); return -EINVAL; } @@ -887,6 +891,7 @@ static int reload(struct dm_ioctl *param, struct dm_ioctl *user) dm_table_put(t); return r; } + dm_table_put(t); /* md will have taken its own reference */ set_disk_ro(dm_disk(md), (param->flags & DM_READONLY_FLAG)); dm_put(md); @@ -1122,17 +1127,17 @@ int __init dm_interface_init(void) return 0; failed: + devfs_remove(DM_DIR "/control"); + if (misc_deregister(&_dm_misc) < 0) + DMERR("misc_deregister failed for control device"); dm_hash_exit(); - misc_deregister(&_dm_misc); return r; } void dm_interface_exit(void) { - dm_hash_exit(); - devfs_remove(DM_DIR "/control"); - if (misc_deregister(&_dm_misc) < 0) DMERR("misc_deregister failed for control device"); + dm_hash_exit(); } diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 1566186325cc..1dabc5dde4ce 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -79,7 +79,7 @@ static unsigned int int_log(unsigned long n, unsigned long base) } #define __HIGH(l, r) if (*(l) < (r)) *(l) = (r) -#define __LOW(l, r) if (*(l) < (r)) *(l) = (r) +#define __LOW(l, r) if (*(l) == 0 || *(l) > (r)) *(l) = (r) /* * Combine two io_restrictions, always taking the lower value. @@ -499,7 +499,7 @@ int dm_get_device(struct dm_target *ti, const char *path, sector_t start, } /* - * Decrement a devices use count and remove it if neccessary. + * Decrement a devices use count and remove it if necessary. */ void dm_put_device(struct dm_target *ti, struct dm_dev *dd) { @@ -591,7 +591,7 @@ int dm_table_add_target(struct dm_table *t, const char *type, tgt->type = dm_get_target_type(type); if (!tgt->type) { tgt->error = "unknown target type"; - goto bad; + return -EINVAL; } tgt->table = t; @@ -604,6 +604,7 @@ int dm_table_add_target(struct dm_table *t, const char *type, */ if (!adjoin(t, tgt)) { tgt->error = "Gap in table"; + r = -EINVAL; goto bad; } diff --git a/drivers/md/md.c b/drivers/md/md.c index 52203f4e0231..c5314a2c3719 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -119,7 +119,7 @@ static ctl_table raid_root_table[] = { .procname = "dev", .maxlen = 0, .mode = 0555, - .proc_handler = raid_dir_table, + .child = raid_dir_table, }, { .ctl_name = 0 } }; @@ -1427,7 +1427,7 @@ static int do_md_run(mddev_t * mddev) /* * 'default chunksize' in the old md code used to * be PAGE_SIZE, baaad. - * we abort here to be on the safe side. We dont + * we abort here to be on the safe side. We don't * want to continue the bad practice. */ printk(BAD_CHUNKSIZE); @@ -1731,7 +1731,7 @@ static void autorun_devices(void) mddev_unlock(mddev); } /* on success, candidates will be empty, on error - * it wont... + * it won't... */ ITERATE_RDEV_GENERIC(candidates,rdev,tmp) export_rdev(rdev); @@ -2290,7 +2290,7 @@ static int md_ioctl(struct inode *inode, struct file *file, } err = set_array_info(mddev, &info); if (err) { - printk(KERN_WARNING "md: couldnt set array info. %d\n", err); + printk(KERN_WARNING "md: couldn't set array info. %d\n", err); goto abort_unlock; } } diff --git a/drivers/media/dvb/av7110/saa7146.c b/drivers/media/dvb/av7110/saa7146.c index a636af50c31e..c7cbe9405b15 100644 --- a/drivers/media/dvb/av7110/saa7146.c +++ b/drivers/media/dvb/av7110/saa7146.c @@ -1396,7 +1396,7 @@ int i2c_reset(struct saa7146* saa) saa7146_write(saa->mem, MC2, (MASK_00 | MASK_16)); } - /* if any error is still present, a fatal error has occured ... */ + /* if any error is still present, a fatal error has occurred ... */ if ( SAA7146_I2C_BBR != (status = i2c_status_check(saa)) ) { hprintk("saa7146: i2c_reset: fatal error, status:0x%08x\n",status); return -EIO; @@ -1444,7 +1444,7 @@ int i2c_write_out(struct saa7146* saa, u32* data, int timeout) /* check for some other mysterious error; we don't handle this here */ if ( 0 != ( status & 0xff)) { - hprintk("saa7146: i2c_write_out: some error has occured\n"); + hprintk("saa7146: i2c_write_out: some error has occurred\n"); return -EIO; } @@ -1570,7 +1570,7 @@ int debi_transfer(struct saa7146* saa, struct saa7146_debi_transfer* dt) /* check, if DEBI still active */ u32 psr = saa7146_read(saa->mem, PSR); if (0 != (psr & SPCI_DEBI_S)) { - /* check, if error occured */ + /* check, if error occurred */ /* if ( 0 != (saa7146_read(saa->mem, SSR) & (MASK_23|MASK_22))) { */ if ( 0 != (saa7146_read(saa->mem, SSR) & (MASK_22))) { /* clear error status and indicate error */ diff --git a/drivers/media/dvb/av7110/saa7146_core.c b/drivers/media/dvb/av7110/saa7146_core.c index c8282431c291..dd4d5ed2e10b 100644 --- a/drivers/media/dvb/av7110/saa7146_core.c +++ b/drivers/media/dvb/av7110/saa7146_core.c @@ -222,7 +222,7 @@ int do_master_xfer (struct dvb_i2c_bus *i2c, struct i2c_msg msgs[], int num) * we do not start the whole rps1-engine... */ - /* if address-error occured, don't retry */ + /* if address-error occurred, don't retry */ if (i2c_write_out(a, &a->i2c[i], SAA7146_I2C_TIMEOUT) < 0) { hprintk (KERN_ERR "saa7146_core.o: " "i2c error in address phase\n"); diff --git a/drivers/media/radio/miropcm20-radio.c b/drivers/media/radio/miropcm20-radio.c index 743e79a891c2..a4bc55c93b7b 100644 --- a/drivers/media/radio/miropcm20-radio.c +++ b/drivers/media/radio/miropcm20-radio.c @@ -15,7 +15,7 @@ */ /* What ever you think about the ACI, version 0x07 is not very well! - * I cant get frequency, 'tuner status', 'tuner flags' or mute/mono + * I can't get frequency, 'tuner status', 'tuner flags' or mute/mono * conditions... Robert */ @@ -93,7 +93,7 @@ static int pcm20_getflags(struct pcm20_device *dev, __u32 *flags, __u16 *signal) } else { /* stereo */ *flags=VIDEO_TUNER_STEREO_ON; - /* I cant see stereo, when forced to mono */ + /* I can't see stereo, when forced to mono */ dev->stereo=1; } diff --git a/drivers/media/radio/miropcm20-rds-core.c b/drivers/media/radio/miropcm20-rds-core.c index bc2f1a70574e..79169561480e 100644 --- a/drivers/media/radio/miropcm20-rds-core.c +++ b/drivers/media/radio/miropcm20-rds-core.c @@ -91,7 +91,7 @@ static int rds_waitread(void) } } -/* dont use any ..._nowait() function if you are not sure what you do... */ +/* don't use any ..._nowait() function if you are not sure what you do... */ static inline void rds_rawwrite_nowait(unsigned char byte) { diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index 4eae614b4b00..9962c43c7b9b 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c @@ -262,7 +262,7 @@ static int isapnp_fmi_probe(void) return -ENODEV; if (pnp_device_attach(dev) < 0) return -EAGAIN; - if (pnp_activate_dev(dev, NULL) < 0) { + if (pnp_activate_dev(dev) < 0) { printk ("radio-sf16fmi: PnP configure failed (out of resources?)\n"); pnp_device_detach(dev); return -ENOMEM; diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index 2459573203b9..48392ff5cfd0 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c @@ -129,7 +129,7 @@ static int tt_setfreq(struct tt_device *dev, unsigned long freq1) long rest; unsigned char buffer[25]; /* we have to bit shift 25 registers */ - freq = freq1/160; /* convert the freq. to a nice to handel value */ + freq = freq1/160; /* convert the freq. to a nice to handle value */ for(i=24;i>-1;i--) buffer[i]=0; diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index 9c4922926a40..adf60dc729ee 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c @@ -33,7 +33,7 @@ #define DEBUG(x...) /* remove when no long debugging */ #define SAA7110_MAX_INPUT 9 /* 6 CVBS, 3 SVHS */ -#define SAA7110_MAX_OUTPUT 0 /* its a decoder only */ +#define SAA7110_MAX_OUTPUT 0 /* it's a decoder only */ #define I2C_SAA7110 0x9C /* or 0x9E */ diff --git a/drivers/media/video/zr36067.c b/drivers/media/video/zr36067.c index 837aa11651f0..357261e0a525 100644 --- a/drivers/media/video/zr36067.c +++ b/drivers/media/video/zr36067.c @@ -3629,7 +3629,7 @@ static int do_zoran_ioctl(struct zoran *zr, unsigned int cmd, ("%s: ioctl VIDIOCCAPTURE: %d\n", zr->name, v)); - /* If there is nothing to do, return immediatly */ + /* If there is nothing to do, return immediately */ if ((v && zr->v4l_overlay_active) || (!v && !zr->v4l_overlay_active)) @@ -4048,7 +4048,7 @@ static int do_zoran_ioctl(struct zoran *zr, unsigned int cmd, zr->params = bp; - /* Make changes of input and norm go into effect immediatly */ + /* Make changes of input and norm go into effect immediately */ /* We switch overlay off and on since a change in the norm needs different VFE settings */ diff --git a/drivers/media/video/zr36120_i2c.c b/drivers/media/video/zr36120_i2c.c index 0de59b9f15e6..c70fef75079e 100644 --- a/drivers/media/video/zr36120_i2c.c +++ b/drivers/media/video/zr36120_i2c.c @@ -86,7 +86,7 @@ void attach_inform(struct i2c_bus *bus, int id) if (ztv->tuner_type >= 0) { if (i2c_control_device(&ztv->i2c,I2C_DRIVERID_TUNER,TUNER_SET_TYPE,&ztv->tuner_type)<0) - DEBUG(printk(CARD_INFO "attach_inform; tuner wont be set to type %d\n",CARD,ztv->tuner_type)); + DEBUG(printk(CARD_INFO "attach_inform; tuner won't be set to type %d\n",CARD,ztv->tuner_type)); } break; default: diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index 6acf43bd712f..5b09c825cee5 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c @@ -242,7 +242,7 @@ lan_reply (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply) // would Oops because mf has already been set // to NULL. So after return from this func, // mpt_interrupt() will attempt to put (NULL) mf ptr - // item back onto it's adapter FreeQ - Oops!:-( + // item back onto its adapter FreeQ - Oops!:-( // It's Ok, since mpt_lan_send_turbo() *currently* // always returns 0, but..., just in case: diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 5560861ad1ee..64fc29943c62 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -116,7 +116,7 @@ typedef struct _BIG_SENSE_BUF { #define MPT_ICFLAG_ECHO 0x02 /* ReadBuffer Echo buffer format */ #define MPT_ICFLAG_PHYS_DISK 0x04 /* Any SCSI IO but do Phys Disk Format */ #define MPT_ICFLAG_TAGGED_CMD 0x08 /* Do tagged IO */ -#define MPT_ICFLAG_DID_RESET 0x20 /* Bus Reset occured with this command */ +#define MPT_ICFLAG_DID_RESET 0x20 /* Bus Reset occurred with this command */ #define MPT_ICFLAG_RESERVED 0x40 /* Reserved has been issued */ typedef struct _internal_cmd { @@ -4207,7 +4207,7 @@ static const char * ascq_set_strings_4max( /* * Need to check ASC here; if it is "special," then * the ASCQ is variable, and indicates failed component number. - * We must treat the ASCQ as a "dont care" while searching the + * We must treat the ASCQ as a "don't care" while searching the * mptscsih_ASCQ_Table[] by masking it off, and then restoring it later * on when we actually need to identify the failed component. */ diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index 61fe2369e8f4..24adce65bd11 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c @@ -798,7 +798,7 @@ static void i2ob_request(request_queue_t *q) /* * Queue depths probably belong with some kind of - * generic IOP commit control. Certainly its not right + * generic IOP commit control. Certainly it's not right * its global! */ if(atomic_read(&i2ob_queues[dev->unit]->queue_depth) >= dev->depth) @@ -1729,7 +1729,7 @@ static void i2o_block_exit(void) * We may get further callbacks for ourself. The i2o_core * code handles this case reasonably sanely. The problem here * is we shouldn't get them .. but a couple of cards feel - * obliged to tell us stuff we dont care about. + * obliged to tell us stuff we don't care about. * * This isnt ideal at all but will do for now. */ diff --git a/drivers/message/i2o/i2o_core.c b/drivers/message/i2o/i2o_core.c index 93ce837e421c..19eb8cc17f22 100644 --- a/drivers/message/i2o/i2o_core.c +++ b/drivers/message/i2o/i2o_core.c @@ -340,7 +340,7 @@ int i2o_remove_handler(struct i2o_handler *h) /* * Each I2O controller has a chain of devices on it. - * Each device has a pointer to it's LCT entry to be used + * Each device has a pointer to its LCT entry to be used * for fun purposes. */ @@ -2120,7 +2120,7 @@ static void i2o_sys_shutdown(void) * @iop: controller * * This function brings an I2O controller into HOLD state. The adapter - * is reset if neccessary and then the queues and resource table + * is reset if necessary and then the queues and resource table * are read. -1 is returned on a failure, 0 on success. * */ diff --git a/drivers/mtd/chips/amd_flash.c b/drivers/mtd/chips/amd_flash.c index 52a81d8a1139..83deb5ed90b8 100644 --- a/drivers/mtd/chips/amd_flash.c +++ b/drivers/mtd/chips/amd_flash.c @@ -120,10 +120,10 @@ static struct mtd_info *amd_flash_probe(struct map_info *map); static struct mtd_chip_driver amd_flash_chipdrv = { - probe: amd_flash_probe, - destroy: amd_flash_destroy, - name: "amd_flash", - module: THIS_MODULE + .probe = amd_flash_probe, + .destroy = amd_flash_destroy, + .name = "amd_flash", + .module = THIS_MODULE }; @@ -424,194 +424,194 @@ static struct mtd_info *amd_flash_probe(struct map_info *map) */ const struct amd_flash_info table[] = { { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV160DT, - name: "AMD AM29LV160DT", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x1F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x1F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x1FC000, erasesize: 0x04000, numblocks: 1 } + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV160DT, + .name = "AMD AM29LV160DT", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 } } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV160DB, - name: "AMD AM29LV160DB", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 31 } + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV160DB, + .name = "AMD AM29LV160DB", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 } } }, { - mfr_id: MANUFACTURER_TOSHIBA, - dev_id: TC58FVT160, - name: "Toshiba TC58FVT160", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x1F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x1F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x1FC000, erasesize: 0x04000, numblocks: 1 } + .mfr_id = MANUFACTURER_TOSHIBA, + .dev_id = TC58FVT160, + .name = "Toshiba TC58FVT160", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 } } }, { - mfr_id: MANUFACTURER_FUJITSU, - dev_id: MBM29LV160TE, - name: "Fujitsu MBM29LV160TE", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x1F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x1F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x1FC000, erasesize: 0x04000, numblocks: 1 } + .mfr_id = MANUFACTURER_FUJITSU, + .dev_id = MBM29LV160TE, + .name = "Fujitsu MBM29LV160TE", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 } } }, { - mfr_id: MANUFACTURER_TOSHIBA, - dev_id: TC58FVB160, - name: "Toshiba TC58FVB160", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 31 } + .mfr_id = MANUFACTURER_TOSHIBA, + .dev_id = TC58FVB160, + .name = "Toshiba TC58FVB160", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 } } }, { - mfr_id: MANUFACTURER_FUJITSU, - dev_id: MBM29LV160BE, - name: "Fujitsu MBM29LV160BE", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 31 } + .mfr_id = MANUFACTURER_FUJITSU, + .dev_id = MBM29LV160BE, + .name = "Fujitsu MBM29LV160BE", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 } } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BB, - name: "AMD AM29LV800BB", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 15 } + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BB, + .name = "AMD AM29LV800BB", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 15 } } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F800BB, - name: "AMD AM29F800BB", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 15 } + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F800BB, + .name = "AMD AM29F800BB", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 15 } } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BT, - name: "AMD AM29LV800BT", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x0F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x0F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x0FC000, erasesize: 0x04000, numblocks: 1 } + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BT, + .name = "AMD AM29LV800BT", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 } } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F800BT, - name: "AMD AM29F800BT", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x0F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x0F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x0FC000, erasesize: 0x04000, numblocks: 1 } + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F800BT, + .name = "AMD AM29F800BT", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 } } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BB, - name: "AMD AM29LV800BB", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x0F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x0F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x0FC000, erasesize: 0x04000, numblocks: 1 } + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BB, + .name = "AMD AM29LV800BB", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 } } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W800T, - name: "ST M29W800T", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x0F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x0F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x0FC000, erasesize: 0x04000, numblocks: 1 } + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W800T, + .name = "ST M29W800T", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 } } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W160DT, - name: "ST M29W160DT", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x1F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x1F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x1FC000, erasesize: 0x04000, numblocks: 1 } + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W160DT, + .name = "ST M29W160DT", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 } } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W160DB, - name: "ST M29W160DB", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 31 } + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W160DB, + .name = "ST M29W160DB", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 } } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29BDS323D, - name: "AMD AM29BDS323D", - size: 0x00400000, - numeraseregions: 3, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 48 }, - { offset: 0x300000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x3f0000, erasesize: 0x02000, numblocks: 8 }, + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29BDS323D, + .name = "AMD AM29BDS323D", + .size = 0x00400000, + .numeraseregions = 3, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 48 }, + { .offset = 0x300000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x3f0000, .erasesize = 0x02000, .numblocks = 8 }, } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29BDS643D, - name: "AMD AM29BDS643D", - size: 0x00800000, - numeraseregions: 3, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 96 }, - { offset: 0x600000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x7f0000, erasesize: 0x02000, numblocks: 8 }, + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29BDS643D, + .name = "AMD AM29BDS643D", + .size = 0x00800000, + .numeraseregions = 3, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 96 }, + { .offset = 0x600000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x7f0000, .erasesize = 0x02000, .numblocks = 8 }, } } }; diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 58dfc3527f94..5c6714cfea71 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -47,10 +47,10 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *, int); static struct mtd_info *cfi_intelext_setup (struct map_info *); static struct mtd_chip_driver cfi_intelext_chipdrv = { - probe: NULL, /* Not usable directly */ - destroy: cfi_intelext_destroy, - name: "cfi_cmdset_0001", - module: THIS_MODULE + .probe = NULL, /* Not usable directly */ + .destroy = cfi_intelext_destroy, + .name = "cfi_cmdset_0001", + .module = THIS_MODULE }; /* #define DEBUG_LOCK_BITS */ diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 5e4f3fe72cd2..a7cf7493a23f 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -43,10 +43,10 @@ static struct mtd_info *cfi_amdstd_setup (struct map_info *); static struct mtd_chip_driver cfi_amdstd_chipdrv = { - probe: NULL, /* Not usable directly */ - destroy: cfi_amdstd_destroy, - name: "cfi_cmdset_0002", - module: THIS_MODULE + .probe = NULL, /* Not usable directly */ + .destroy = cfi_amdstd_destroy, + .name = "cfi_cmdset_0002", + .module = THIS_MODULE }; struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c index f54d362a501f..0471edd27ed9 100644 --- a/drivers/mtd/chips/cfi_probe.c +++ b/drivers/mtd/chips/cfi_probe.c @@ -294,8 +294,8 @@ static void print_cfi_ident(struct cfi_ident *cfip) #endif /* DEBUG_CFI */ static struct chip_probe cfi_chip_probe = { - name: "CFI", - probe_chip: cfi_probe_chip + .name = "CFI", + .probe_chip = cfi_probe_chip }; struct mtd_info *cfi_probe(struct map_info *map) @@ -308,9 +308,9 @@ struct mtd_info *cfi_probe(struct map_info *map) } static struct mtd_chip_driver cfi_chipdrv = { - probe: cfi_probe, - name: "cfi_probe", - module: THIS_MODULE + .probe = cfi_probe, + .name = "cfi_probe", + .module = THIS_MODULE }; int __init cfi_probe_init(void) diff --git a/drivers/mtd/chips/jedec.c b/drivers/mtd/chips/jedec.c index 507b7e513c17..862bc4bb4c84 100644 --- a/drivers/mtd/chips/jedec.c +++ b/drivers/mtd/chips/jedec.c @@ -33,14 +33,51 @@ static unsigned long my_bank_size; /* Listing of parts and sizes. We need this table to learn the sector size of the chip and the total length */ -static const struct JEDECTable JEDEC_table[] = - {{0x013D,"AMD Am29F017D",2*1024*1024,64*1024,MTD_CAP_NORFLASH}, - {0x01AD,"AMD Am29F016",2*1024*1024,64*1024,MTD_CAP_NORFLASH}, - {0x01D5,"AMD Am29F080",1*1024*1024,64*1024,MTD_CAP_NORFLASH}, - {0x01A4,"AMD Am29F040",512*1024,64*1024,MTD_CAP_NORFLASH}, - {0x20E3,"AMD Am29W040B",512*1024,64*1024,MTD_CAP_NORFLASH}, - {0xC2AD,"Macronix MX29F016",2*1024*1024,64*1024,MTD_CAP_NORFLASH}, - {}}; +static const struct JEDECTable JEDEC_table[] = { + { + .jedec = 0x013D, + .name = "AMD Am29F017D", + .size = 2*1024*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0x01AD, + .name = "AMD Am29F016", + .size = 2*1024*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0x01D5, + .name = "AMD Am29F080", + .size = 1*1024*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0x01A4, + .name = "AMD Am29F040", + .size = 512*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0x20E3, + .name = "AMD Am29W040B", + .size = 512*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0xC2AD, + .name = "Macronix MX29F016", + .size = 2*1024*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { .jedec = 0x0 } +}; static const struct JEDECTable *jedec_idtoinf(__u8 mfr,__u8 id); static void jedec_sync(struct mtd_info *mtd) {}; @@ -54,9 +91,9 @@ static struct mtd_info *jedec_probe(struct map_info *map); static struct mtd_chip_driver jedec_chipdrv = { - probe: jedec_probe, - name: "jedec", - module: THIS_MODULE + .probe = jedec_probe, + .name = "jedec", + .module = THIS_MODULE }; /* Probe entry point */ diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c index 64fac448e2f7..f1e47a69bec9 100644 --- a/drivers/mtd/chips/jedec_probe.c +++ b/drivers/mtd/chips/jedec_probe.c @@ -75,176 +75,176 @@ struct amd_flash_info { static const struct amd_flash_info jedec_table[] = { { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV160DT, - name: "AMD AM29LV160DT", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,31), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV160DT, + .name = "AMD AM29LV160DT", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,31), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV160DB, - name: "AMD AM29LV160DB", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV160DB, + .name = "AMD AM29LV160DB", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,31) } }, { - mfr_id: MANUFACTURER_TOSHIBA, - dev_id: TC58FVT160, - name: "Toshiba TC58FVT160", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,31), + .mfr_id = MANUFACTURER_TOSHIBA, + .dev_id = TC58FVT160, + .name = "Toshiba TC58FVT160", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,31), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_FUJITSU, - dev_id: MBM29LV160TE, - name: "Fujitsu MBM29LV160TE", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,31), + .mfr_id = MANUFACTURER_FUJITSU, + .dev_id = MBM29LV160TE, + .name = "Fujitsu MBM29LV160TE", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,31), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_TOSHIBA, - dev_id: TC58FVB160, - name: "Toshiba TC58FVB160", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_TOSHIBA, + .dev_id = TC58FVB160, + .name = "Toshiba TC58FVB160", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,31) } }, { - mfr_id: MANUFACTURER_FUJITSU, - dev_id: MBM29LV160BE, - name: "Fujitsu MBM29LV160BE", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_FUJITSU, + .dev_id = MBM29LV160BE, + .name = "Fujitsu MBM29LV160BE", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,31) } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BB, - name: "AMD AM29LV800BB", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BB, + .name = "AMD AM29LV800BB", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,15), } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F800BB, - name: "AMD AM29F800BB", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F800BB, + .name = "AMD AM29F800BB", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,15), } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BT, - name: "AMD AM29LV800BT", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,15), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BT, + .name = "AMD AM29LV800BT", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,15), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F800BT, - name: "AMD AM29F800BT", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,15), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F800BT, + .name = "AMD AM29F800BT", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,15), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BB, - name: "AMD AM29LV800BB", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,15), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BB, + .name = "AMD AM29LV800BB", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,15), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W800T, - name: "ST M29W800T", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,15), + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W800T, + .name = "ST M29W800T", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,15), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W160DT, - name: "ST M29W160DT", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,31), + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W160DT, + .name = "ST M29W160DT", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,31), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W160DB, - name: "ST M29W160DB", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W160DB, + .name = "ST M29W160DB", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,31) } }, { - mfr_id: MANUFACTURER_ATMEL, - dev_id: AT49BV16X4, - name: "Atmel AT49BV16X4", - DevSize: SIZE_2MiB, - NumEraseRegions: 3, - regions: {ERASEINFO(0x02000,8), + .mfr_id = MANUFACTURER_ATMEL, + .dev_id = AT49BV16X4, + .name = "Atmel AT49BV16X4", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 3, + .regions = {ERASEINFO(0x02000,8), ERASEINFO(0x08000,2), ERASEINFO(0x10000,30) } }, { - mfr_id: MANUFACTURER_ATMEL, - dev_id: AT49BV16X4T, - name: "Atmel AT49BV16X4T", - DevSize: SIZE_2MiB, - NumEraseRegions: 3, - regions: {ERASEINFO(0x10000,30), + .mfr_id = MANUFACTURER_ATMEL, + .dev_id = AT49BV16X4T, + .name = "Atmel AT49BV16X4T", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 3, + .regions = {ERASEINFO(0x10000,30), ERASEINFO(0x08000,2), ERASEINFO(0x02000,8) } @@ -403,8 +403,8 @@ static int jedec_probe_chip(struct map_info *map, __u32 base, } static struct chip_probe jedec_chip_probe = { - name: "JEDEC", - probe_chip: jedec_probe_chip + .name = "JEDEC", + .probe_chip = jedec_probe_chip }; struct mtd_info *jedec_probe(struct map_info *map) @@ -417,9 +417,9 @@ struct mtd_info *jedec_probe(struct map_info *map) } static struct mtd_chip_driver jedec_chipdrv = { - probe: jedec_probe, - name: "jedec_probe", - module: THIS_MODULE + .probe = jedec_probe, + .name = "jedec_probe", + .module = THIS_MODULE }; int __init jedec_probe_init(void) diff --git a/drivers/mtd/chips/map_absent.c b/drivers/mtd/chips/map_absent.c index 9478d0e7920c..1c884572e2cc 100644 --- a/drivers/mtd/chips/map_absent.c +++ b/drivers/mtd/chips/map_absent.c @@ -36,10 +36,10 @@ static void map_absent_destroy (struct mtd_info *); static struct mtd_chip_driver map_absent_chipdrv = { - probe: map_absent_probe, - destroy: map_absent_destroy, - name: "map_absent", - module: THIS_MODULE + .probe = map_absent_probe, + .destroy = map_absent_destroy, + .name = "map_absent", + .module = THIS_MODULE }; static struct mtd_info *map_absent_probe(struct map_info *map) diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c index 287a25555b4f..872ee9e280fd 100644 --- a/drivers/mtd/chips/map_ram.c +++ b/drivers/mtd/chips/map_ram.c @@ -23,9 +23,9 @@ static struct mtd_info *map_ram_probe(struct map_info *map); static struct mtd_chip_driver mapram_chipdrv = { - probe: map_ram_probe, - name: "map_ram", - module: THIS_MODULE + .probe = map_ram_probe, + .name = "map_ram", + .module = THIS_MODULE }; static struct mtd_info *map_ram_probe(struct map_info *map) diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c index d077bacf1580..6d7f5146c97e 100644 --- a/drivers/mtd/chips/map_rom.c +++ b/drivers/mtd/chips/map_rom.c @@ -21,9 +21,9 @@ static void maprom_nop (struct mtd_info *); struct mtd_info *map_rom_probe(struct map_info *map); static struct mtd_chip_driver maprom_chipdrv = { - probe: map_rom_probe, - name: "map_rom", - module: THIS_MODULE + .probe = map_rom_probe, + .name = "map_rom", + .module = THIS_MODULE }; struct mtd_info *map_rom_probe(struct map_info *map) diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c index 85df53b919f9..df650c1dbc88 100644 --- a/drivers/mtd/chips/sharp.c +++ b/drivers/mtd/chips/sharp.c @@ -98,10 +98,10 @@ struct mtd_info *sharp_probe(struct map_info *map); static void sharp_destroy(struct mtd_info *mtd); static struct mtd_chip_driver sharp_chipdrv = { - probe: sharp_probe, - destroy: sharp_destroy, - name: "sharp", - module: THIS_MODULE + .probe = sharp_probe, + .destroy = sharp_destroy, + .name = "sharp", + .module = THIS_MODULE }; diff --git a/drivers/mtd/devices/blkmtd.c b/drivers/mtd/devices/blkmtd.c index 9b2438f01e5e..e29472dfe093 100644 --- a/drivers/mtd/devices/blkmtd.c +++ b/drivers/mtd/devices/blkmtd.c @@ -16,7 +16,7 @@ * thread writes pages out to the device in the background. This * ensures that writes are order even if a page is updated twice. * Also, since pages in the page cache are never marked as dirty, - * we dont have to worry about writepage() being called on some + * we don't have to worry about writepage() being called on some * random page which may not be in the write order. * * Erases are handled like writes, so the callback is called after @@ -33,7 +33,7 @@ * Page cache usage may still be a bit wrong. Check we are doing * everything properly. * - * Somehow allow writes to dirty the page cache so we dont use too + * Somehow allow writes to dirty the page cache so we don't use too * much memory making copies of outgoing pages. Need to handle case * where page x is written to, then page y, then page x again before * any of them have been committed to disk. @@ -217,7 +217,7 @@ static int blkmtd_readpage(mtd_raw_dev_data_t *rawdevice, struct page *page) DEBUG(3, "blkmtd: readpage: getting kiovec\n"); err = alloc_kiovec(1, &iobuf); if (err) { - printk("blkmtd: cant allocate kiobuf\n"); + printk("blkmtd: can't allocate kiobuf\n"); SetPageError(page); return err; } @@ -226,7 +226,7 @@ static int blkmtd_readpage(mtd_raw_dev_data_t *rawdevice, struct page *page) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,4) blocks = kmalloc(KIO_MAX_SECTORS * sizeof(*blocks)); if(blocks == NULL) { - printk("blkmtd: cant allocate iobuf blocks\n"); + printk("blkmtd: can't allocate iobuf blocks\n"); free_kiovec(1, &iobuf); SetPageError(page); return -ENOMEM; @@ -306,7 +306,7 @@ static int write_queue_task(void *data) daemonize("blkmtdd"); if(alloc_kiovec(1, &iobuf)) { - printk("blkmtd: write_queue_task cant allocate kiobuf\n"); + printk("blkmtd: write_queue_task can't allocate kiobuf\n"); return 0; } @@ -314,7 +314,7 @@ static int write_queue_task(void *data) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,4) blocks = kmalloc(KIO_MAX_SECTORS * sizeof(unsigned long)); if(blocks == NULL) { - printk("blkmtd: write_queue_task cant allocate iobuf blocks\n"); + printk("blkmtd: write_queue_task can't allocate iobuf blocks\n"); free_kiovec(1, &iobuf); return 0; } @@ -350,7 +350,7 @@ static int write_queue_task(void *data) int max_sectors = KIO_MAX_SECTORS >> (item->rawdevice->sector_bits - 9); /* If we are writing to the last page on the device and it doesn't end - * on a page boundary, subtract the number of sectors that dont exist. + * on a page boundary, subtract the number of sectors that don't exist. */ if(item->rawdevice->partial_last_page && (item->pagenr + item->pagecnt -1) == item->rawdevice->partial_last_page) { @@ -394,7 +394,7 @@ static int write_queue_task(void *data) err = brw_kiovec(WRITE, 1, &iobuf, item->rawdevice->binding, blocks, item->rawdevice->sector_size); DEBUG(3, "bklmtd: write_task: done, err = %d\n", err); if(err != (cursectors << item->rawdevice->sector_bits)) { - /* if an error occured - set this to exit the loop */ + /* if an error occurred - set this to exit the loop */ sectorcnt = 0; } else { sectorcnt -= cursectors; @@ -794,7 +794,7 @@ static int blkmtd_write(struct mtd_info *mtd, loff_t to, size_t len, page = grab_cache_page(&rawdevice->as, pagenr); DEBUG(3, "blkmtd: write: got page %d from page cache\n", pagenr); if(!page) { - printk("blkmtd: write: cant grab cache page %d\n", pagenr); + printk("blkmtd: write: can't grab cache page %d\n", pagenr); err = -EIO; goto write_err; } @@ -1090,7 +1090,7 @@ static int __init init_blkmtd(void) file = filp_open(device, mode, 0); if(IS_ERR(file)) { - printk("blkmtd: error, cant open device %s\n", device); + printk("blkmtd: error, can't open device %s\n", device); DEBUG(2, "blkmtd: filp_open returned %ld\n", PTR_ERR(file)); return 1; } @@ -1144,7 +1144,7 @@ static int __init init_blkmtd(void) DEBUG(1, "blkmtd: size = %ld\n", (long int)size); if(size == 0) { - printk("blkmtd: cant determine size\n"); + printk("blkmtd: can't determine size\n"); blkdev_put(bdev, BDEV_RAW); return 1; } diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index cbe5996c9ef7..d063d46d6a94 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c @@ -30,7 +30,7 @@ * * Notes: * Due to what I assume is more buggy SROM, the 64M PMC551 I - * have available claims that all 4 of it's DRAM banks have 64M + * have available claims that all 4 of its DRAM banks have 64M * of ram configured (making a grand total of 256M onboard). * This is slightly annoying since the BAR0 size reflects the * aperture size, not the dram size, and the V370PDC supplies no diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index b79f92b9cb9e..0ffe4751e857 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c @@ -155,8 +155,8 @@ static void ftl_notify_remove(struct mtd_info *mtd); void ftl_freepart(partition_t *part); static struct mtd_notifier ftl_notifier = { - add: ftl_notify_add, - remove: ftl_notify_remove, + .add = ftl_notify_add, + .remove = ftl_notify_remove, }; /* Partition state flags */ diff --git a/drivers/mtd/maps/autcpu12-nvram.c b/drivers/mtd/maps/autcpu12-nvram.c index db78b01e6438..9b3cd3c21354 100644 --- a/drivers/mtd/maps/autcpu12-nvram.c +++ b/drivers/mtd/maps/autcpu12-nvram.c @@ -83,17 +83,17 @@ void autcpu12_copy_to(struct map_info *map, unsigned long to, const void *from, static struct mtd_info *sram_mtd; struct map_info autcpu12_sram_map = { - name: "SRAM", - size: 32768, - buswidth: 8, - read8: autcpu12_read8, - read16: autcpu12_read16, - read32: autcpu12_read32, - copy_from: autcpu12_copy_from, - write8: autcpu12_write8, - write16: autcpu12_write16, - write32: autcpu12_write32, - copy_to: autcpu12_copy_to + .name = "SRAM", + .size = 32768, + .buswidth = 8, + .read8 = autcpu12_read8, + .read16 = autcpu12_read16, + .read32 = autcpu12_read32, + .copy_from = autcpu12_copy_from, + .write8 = autcpu12_write8, + .write16 = autcpu12_write16, + .write32 = autcpu12_write32, + .copy_to = autcpu12_copy_to }; static int __init init_autcpu12_sram (void) diff --git a/drivers/mtd/maps/cdb89712.c b/drivers/mtd/maps/cdb89712.c index 16b5a610d505..12097a7f1c3e 100644 --- a/drivers/mtd/maps/cdb89712.c +++ b/drivers/mtd/maps/cdb89712.c @@ -14,8 +14,6 @@ #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> - - __u8 cdb89712_read8(struct map_info *map, unsigned long ofs) { return __raw_readb(map->map_priv_1 + ofs); @@ -65,28 +63,27 @@ void cdb89712_copy_to(struct map_info *map, unsigned long to, const void *from, } } - static struct mtd_info *flash_mtd; struct map_info cdb89712_flash_map = { - name: "flash", - size: FLASH_SIZE, - buswidth: FLASH_WIDTH, - read8: cdb89712_read8, - read16: cdb89712_read16, - read32: cdb89712_read32, - copy_from: cdb89712_copy_from, - write8: cdb89712_write8, - write16: cdb89712_write16, - write32: cdb89712_write32, - copy_to: cdb89712_copy_to + .name = "flash", + .size = FLASH_SIZE, + .buswidth = FLASH_WIDTH, + .read8 = cdb89712_read8, + .read16 = cdb89712_read16, + .read32 = cdb89712_read32, + .copy_from = cdb89712_copy_from, + .write8 = cdb89712_write8, + .write16 = cdb89712_write16, + .write32 = cdb89712_write32, + .copy_to = cdb89712_copy_to }; struct resource cdb89712_flash_resource = { - name: "Flash", - start: FLASH_START, - end: FLASH_START + FLASH_SIZE - 1, - flags: IORESOURCE_IO | IORESOURCE_BUSY, + .name = "Flash", + .start = FLASH_START, + .end = FLASH_START + FLASH_SIZE - 1, + .flags = IORESOURCE_IO | IORESOURCE_BUSY, }; static int __init init_cdb89712_flash (void) @@ -139,31 +136,27 @@ out: return err; } - - - - static struct mtd_info *sram_mtd; struct map_info cdb89712_sram_map = { - name: "SRAM", - size: SRAM_SIZE, - buswidth: SRAM_WIDTH, - read8: cdb89712_read8, - read16: cdb89712_read16, - read32: cdb89712_read32, - copy_from: cdb89712_copy_from, - write8: cdb89712_write8, - write16: cdb89712_write16, - write32: cdb89712_write32, - copy_to: cdb89712_copy_to + .name = "SRAM", + .size = SRAM_SIZE, + .buswidth = SRAM_WIDTH, + .read8 = cdb89712_read8, + .read16 = cdb89712_read16, + .read32 = cdb89712_read32, + .copy_from = cdb89712_copy_from, + .write8 = cdb89712_write8, + .write16 = cdb89712_write16, + .write32 = cdb89712_write32, + .copy_to = cdb89712_copy_to }; struct resource cdb89712_sram_resource = { - name: "SRAM", - start: SRAM_START, - end: SRAM_START + SRAM_SIZE - 1, - flags: IORESOURCE_IO | IORESOURCE_BUSY, + .name = "SRAM", + .start = SRAM_START, + .end = SRAM_START + SRAM_SIZE - 1, + .flags = IORESOURCE_IO | IORESOURCE_BUSY, }; static int __init init_cdb89712_sram (void) @@ -212,29 +205,23 @@ out: return err; } - - - - - - static struct mtd_info *bootrom_mtd; struct map_info cdb89712_bootrom_map = { - name: "BootROM", - size: BOOTROM_SIZE, - buswidth: BOOTROM_WIDTH, - read8: cdb89712_read8, - read16: cdb89712_read16, - read32: cdb89712_read32, - copy_from: cdb89712_copy_from, + .name = "BootROM", + .size = BOOTROM_SIZE, + .buswidth = BOOTROM_WIDTH, + .read8 = cdb89712_read8, + .read16 = cdb89712_read16, + .read32 = cdb89712_read32, + .copy_from = cdb89712_copy_from, }; struct resource cdb89712_bootrom_resource = { - name: "BootROM", - start: BOOTROM_START, - end: BOOTROM_START + BOOTROM_SIZE - 1, - flags: IORESOURCE_IO | IORESOURCE_BUSY, + .name = "BootROM", + .start = BOOTROM_START, + .end = BOOTROM_START + BOOTROM_SIZE - 1, + .flags = IORESOURCE_IO | IORESOURCE_BUSY, }; static int __init init_cdb89712_bootrom (void) @@ -283,10 +270,6 @@ out: return err; } - - - - static int __init init_cdb89712_maps(void) { diff --git a/drivers/mtd/maps/ceiva.c b/drivers/mtd/maps/ceiva.c index 259a9a8b76c0..f99d2ccf1aec 100644 --- a/drivers/mtd/maps/ceiva.c +++ b/drivers/mtd/maps/ceiva.c @@ -76,15 +76,15 @@ static void clps_copy_to(struct map_info *map, unsigned long to, const void *fro } static struct map_info clps_map __initdata = { - name: "clps flash", - read8: clps_read8, - read16: clps_read16, - read32: clps_read32, - copy_from: clps_copy_from, - write8: clps_write8, - write16: clps_write16, - write32: clps_write32, - copy_to: clps_copy_to, + .name = "clps flash", + .read8 = clps_read8, + .read16 = clps_read16, + .read32 = clps_read32, + .copy_from = clps_copy_from, + .write8 = clps_write8, + .write16 = clps_write16, + .write32 = clps_write32, + .copy_to = clps_copy_to, }; #ifdef CONFIG_MTD_CEIVA_STATICMAP @@ -94,7 +94,7 @@ static struct map_info clps_map __initdata = { * * Please note: * 1. The flash size given should be the largest flash size that can - * be accomodated. + * be accommodated. * * 2. The bus width must defined in clps_setup_flash. * @@ -115,23 +115,25 @@ static struct map_info clps_map __initdata = { static struct mtd_partition ceiva_partitions[] = { { - name: "Ceiva BOOT partition", - size: BOOT_PARTITION_SIZE_KiB*1024, - offset: 0, - - },{ - name: "Ceiva parameters partition", - size: PARAMS_PARTITION_SIZE_KiB*1024, - offset: (16 + 8) * 1024, - },{ - name: "Ceiva kernel partition", - size: (KERNEL_PARTITION_SIZE_KiB)*1024, - offset: 0x20000, - - },{ - name: "Ceiva root filesystem partition", - offset: MTDPART_OFS_APPEND, - size: (ROOT_PARTITION_SIZE_KiB)*1024, + .name = "Ceiva BOOT partition", + .size = BOOT_PARTITION_SIZE_KiB*1024, + + }, + { + .name = "Ceiva parameters partition", + .size = PARAMS_PARTITION_SIZE_KiB*1024, + .offset = (16 + 8) * 1024, + }, + { + .name = "Ceiva kernel partition", + .size = (KERNEL_PARTITION_SIZE_KiB)*1024, + .offset = 0x20000, + + }, + { + .name = "Ceiva root filesystem partition", + .offset = MTDPART_OFS_APPEND, + .size = (ROOT_PARTITION_SIZE_KiB)*1024, } }; #endif diff --git a/drivers/mtd/maps/cfi_flagadm.c b/drivers/mtd/maps/cfi_flagadm.c index 6c74ab97dbeb..7e8a98b7c5f8 100644 --- a/drivers/mtd/maps/cfi_flagadm.c +++ b/drivers/mtd/maps/cfi_flagadm.c @@ -99,39 +99,39 @@ void flagadm_copy_to(struct map_info *map, unsigned long to, const void *from, s } struct map_info flagadm_map = { - name: "FlagaDM flash device", - size: FLASH_SIZE, - buswidth: 2, - read8: flagadm_read8, - read16: flagadm_read16, - read32: flagadm_read32, - copy_from: flagadm_copy_from, - write8: flagadm_write8, - write16: flagadm_write16, - write32: flagadm_write32, - copy_to: flagadm_copy_to + .name = "FlagaDM flash device", + .size = FLASH_SIZE, + .buswidth = 2, + .read8 = flagadm_read8, + .read16 = flagadm_read16, + .read32 = flagadm_read32, + .copy_from = flagadm_copy_from, + .write8 = flagadm_write8, + .write16 = flagadm_write16, + .write32 = flagadm_write32, + .copy_to = flagadm_copy_to }; struct mtd_partition flagadm_parts[] = { { - name : "Bootloader", - offset : FLASH_PARTITION0_ADDR, - size : FLASH_PARTITION0_SIZE + .name = "Bootloader", + .offset = FLASH_PARTITION0_ADDR, + .size = FLASH_PARTITION0_SIZE }, { - name : "Kernel image", - offset : FLASH_PARTITION1_ADDR, - size : FLASH_PARTITION1_SIZE + .name = "Kernel image", + .offset = FLASH_PARTITION1_ADDR, + .size = FLASH_PARTITION1_SIZE }, { - name : "Initial ramdisk image", - offset : FLASH_PARTITION2_ADDR, - size : FLASH_PARTITION2_SIZE + .name = "Initial ramdisk image", + .offset = FLASH_PARTITION2_ADDR, + .size = FLASH_PARTITION2_SIZE }, { - name : "Persistant storage", - offset : FLASH_PARTITION3_ADDR, - size : FLASH_PARTITION3_SIZE + .name = "Persistant storage", + .offset = FLASH_PARTITION3_ADDR, + .size = FLASH_PARTITION3_SIZE } }; diff --git a/drivers/mtd/maps/cstm_mips_ixx.c b/drivers/mtd/maps/cstm_mips_ixx.c index 3402da3ecdbd..74e8b2c73323 100644 --- a/drivers/mtd/maps/cstm_mips_ixx.c +++ b/drivers/mtd/maps/cstm_mips_ixx.c @@ -5,7 +5,7 @@ * Config with both CFI and JEDEC device support. * * Basically physmap.c with the addition of partitions and - * an array of mapping info to accomodate more than one flash type per board. + * an array of mapping info to accommodate more than one flash type per board. * * Copyright 2000 MontaVista Software Inc. * @@ -132,20 +132,15 @@ void cstm_mips_ixx_set_vpp(struct map_info *map,int vpp) } const struct map_info basic_cstm_mips_ixx_map = { - NULL, - 0, - 0, - cstm_mips_ixx_read8, - cstm_mips_ixx_read16, - cstm_mips_ixx_read32, - cstm_mips_ixx_copy_from, - cstm_mips_ixx_write8, - cstm_mips_ixx_write16, - cstm_mips_ixx_write32, - cstm_mips_ixx_copy_to, - cstm_mips_ixx_set_vpp, - 0, - 0 + .read8 = cstm_mips_ixx_read8, + .read16 = cstm_mips_ixx_read16, + .read32 = cstm_mips_ixx_read32, + .copy_from = cstm_mips_ixx_copy_from, + .write8 = cstm_mips_ixx_write8, + .write16 = cstm_mips_ixx_write16, + .write32 = cstm_mips_ixx_write32, + .copy_to = cstm_mips_ixx_copy_to, + .set_vpp = cstm_mips_ixx_set_vpp, }; /* board and partition description */ @@ -175,9 +170,8 @@ const struct cstm_mips_ixx_info cstm_mips_ixx_board_desc[PHYSMAP_NUMBER] = static struct mtd_partition cstm_mips_ixx_partitions[PHYSMAP_NUMBER][MAX_PHYSMAP_PARTITIONS] = { { // 28F128J3A in 2x16 configuration { - name: "main partition ", - size: 0x02000000, // 128 x 2 x 128k byte sectors - offset: 0, + .name = "main partition ", + .size = 0x02000000, // 128 x 2 x 128k byte sectors }, }, }; @@ -197,9 +191,8 @@ const struct cstm_mips_ixx_info cstm_mips_ixx_board_desc[PHYSMAP_NUMBER] = static struct mtd_partition cstm_mips_ixx_partitions[PHYSMAP_NUMBER][MAX_PHYSMAP_PARTITIONS] = { { { - name: "main partition", - size: CONFIG_MTD_CSTM_MIPS_IXX_LEN, - offset: 0, + .name = "main partition", + .size = CONFIG_MTD_CSTM_MIPS_IXX_LEN, }, }, }; diff --git a/drivers/mtd/maps/dbox2-flash.c b/drivers/mtd/maps/dbox2-flash.c index 2e5c30d802c2..59fea4335193 100644 --- a/drivers/mtd/maps/dbox2-flash.c +++ b/drivers/mtd/maps/dbox2-flash.c @@ -16,22 +16,28 @@ /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]= {{name: "BR bootloader", // raw - size: 128 * 1024, - offset: 0, - mask_flags: MTD_WRITEABLE}, - {name: "PPC bootloader", // flfs - size: 128 * 1024, - offset: MTDPART_OFS_APPEND, - mask_flags: 0}, - {name: "Kernel", // idxfs - size: 768 * 1024, - offset: MTDPART_OFS_APPEND, - mask_flags: 0}, - {name: "System", // jffs - size: MTDPART_SIZ_FULL, - offset: MTDPART_OFS_APPEND, - mask_flags: 0}}; +static struct mtd_partition partition_info[]= { + { + .name = "BR bootloader", /* raw */ + .size = 128 * 1024, + .mask_flags = MTD_WRITEABLE + }, + { + .name = "PPC bootloader", /* flfs */ + .size = 128 * 1024, + .offset = MTDPART_OFS_APPEND, + }, + { + .name = "Kernel", /* idxfs */ + .size = 768 * 1024, + .offset = MTDPART_OFS_APPEND, + }, + { + .name = "System", /* jffs */ + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, + } +}; #define NUM_PARTITIONS (sizeof(partition_info) / sizeof(partition_info[0])) @@ -84,17 +90,17 @@ void dbox2_flash_copy_to(struct map_info *map, unsigned long to, const void *fro } struct map_info dbox2_flash_map = { - name: "D-Box 2 flash memory", - size: WINDOW_SIZE, - buswidth: 4, - read8: dbox2_flash_read8, - read16: dbox2_flash_read16, - read32: dbox2_flash_read32, - copy_from: dbox2_flash_copy_from, - write8: dbox2_flash_write8, - write16: dbox2_flash_write16, - write32: dbox2_flash_write32, - copy_to: dbox2_flash_copy_to + .name = "D-Box 2 flash memory", + .size = WINDOW_SIZE, + .buswidth = 4, + .read8 = dbox2_flash_read8, + .read16 = dbox2_flash_read16, + .read32 = dbox2_flash_read32, + .copy_from = dbox2_flash_copy_from, + .write8 = dbox2_flash_write8, + .write16 = dbox2_flash_write16, + .write32 = dbox2_flash_write32, + .copy_to = dbox2_flash_copy_to }; int __init init_dbox2_flash(void) diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c index f030f3447302..835c9a1a7566 100644 --- a/drivers/mtd/maps/dc21285.c +++ b/drivers/mtd/maps/dc21285.c @@ -92,16 +92,16 @@ void dc21285_copy_to(struct map_info *map, unsigned long to, const void *from, s } struct map_info dc21285_map = { - name: "DC21285 flash", - size: 16*1024*1024, - read8: dc21285_read8, - read16: dc21285_read16, - read32: dc21285_read32, - copy_from: dc21285_copy_from, - write8: dc21285_write8, - write16: dc21285_write16, - write32: dc21285_write32, - copy_to: dc21285_copy_to + .name = "DC21285 flash", + .size = 16*1024*1024, + .read8 = dc21285_read8, + .read16 = dc21285_read16, + .read32 = dc21285_read32, + .copy_from = dc21285_copy_from, + .write8 = dc21285_write8, + .write16 = dc21285_write16, + .write32 = dc21285_write32, + .copy_to = dc21285_copy_to }; diff --git a/drivers/mtd/maps/edb7312.c b/drivers/mtd/maps/edb7312.c index 405429d92735..929a89f2ec8a 100644 --- a/drivers/mtd/maps/edb7312.c +++ b/drivers/mtd/maps/edb7312.c @@ -79,17 +79,17 @@ void edb7312nor_copy_to(struct map_info *map, unsigned long to, const void *from } struct map_info edb7312nor_map = { - name: "NOR flash on EDB7312", - size: WINDOW_SIZE, - buswidth: BUSWIDTH, - read8: edb7312nor_read8, - read16: edb7312nor_read16, - read32: edb7312nor_read32, - copy_from: edb7312nor_copy_from, - write8: edb7312nor_write8, - write16: edb7312nor_write16, - write32: edb7312nor_write32, - copy_to: edb7312nor_copy_to + .name = "NOR flash on EDB7312", + .size = WINDOW_SIZE, + .buswidth = BUSWIDTH, + .read8 = edb7312nor_read8, + .read16 = edb7312nor_read16, + .read32 = edb7312nor_read32, + .copy_from = edb7312nor_copy_from, + .write8 = edb7312nor_write8, + .write16 = edb7312nor_write16, + .write32 = edb7312nor_write32, + .copy_to = edb7312nor_copy_to }; #ifdef CONFIG_MTD_PARTITIONS @@ -97,23 +97,22 @@ struct map_info edb7312nor_map = { /* * MTD partitioning stuff */ -static struct mtd_partition static_partitions[3] = -{ - { - name: "ARMboot", - size: 0x40000, - offset: 0 - }, - { - name: "Kernel", - size: 0x200000, - offset: 0x40000 - }, - { - name: "RootFS", - size: 0xDC0000, - offset: 0x240000 - }, +static struct mtd_partition static_partitions[3] = { + { + .name = "ARMboot", + .size = 0x40000, + .offset = 0 + }, + { + .name = "Kernel", + .size = 0x200000, + .offset = 0x40000 + }, + { + .name = "RootFS", + .size = 0xDC0000, + .offset = 0x240000 + }, }; #define NB_OF(x) (sizeof (x) / sizeof (x[0])) diff --git a/drivers/mtd/maps/elan-104nc.c b/drivers/mtd/maps/elan-104nc.c index 1d6123ef4cf9..0c0308cc3337 100644 --- a/drivers/mtd/maps/elan-104nc.c +++ b/drivers/mtd/maps/elan-104nc.c @@ -58,15 +58,20 @@ static spinlock_t elan_104nc_spin = SPIN_LOCK_UNLOCKED; /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]={ - { name: "ELAN-104NC flash boot partition", - offset: 0, - size: 640*1024 }, - { name: "ELAN-104NC flash partition 1", - offset: 640*1024, - size: 896*1024 }, - { name: "ELAN-104NC flash partition 2", - offset: (640+896)*1024 } +static struct mtd_partition partition_info[] = { + { + .name = "ELAN-104NC flash boot partition", + .size = 640*1024 + }, + { + .name = "ELAN-104NC flash partition 1", + .offset = 640*1024, + .size = 896*1024 + }, + { + .name = "ELAN-104NC flash partition 2", + .offset = (640+896)*1024, + } }; #define NUM_PARTITIONS (sizeof(partition_info)/sizeof(partition_info[0])) @@ -195,19 +200,20 @@ static void elan_104nc_copy_to(struct map_info *map, unsigned long to, const voi } static struct map_info elan_104nc_map = { - name: "ELAN-104NC flash", - size: 8*1024*1024, /* this must be set to a maximum possible amount - of flash so the cfi probe routines find all - the chips */ - buswidth: 2, - read8: elan_104nc_read8, - read16: elan_104nc_read16, - read32: elan_104nc_read32, - copy_from: elan_104nc_copy_from, - write8: elan_104nc_write8, - write16: elan_104nc_write16, - write32: elan_104nc_write32, - copy_to: elan_104nc_copy_to + .name = "ELAN-104NC flash", + .size = 8*1024*1024, /* this must be set to a maximum + possible amount of flash so the + cfi probe routines find all + the chips */ + .buswidth = 2, + .read8 = elan_104nc_read8, + .read16 = elan_104nc_read16, + .read32 = elan_104nc_read32, + .copy_from = elan_104nc_copy_from, + .write8 = elan_104nc_write8, + .write16 = elan_104nc_write16, + .write32 = elan_104nc_write32, + .copy_to = elan_104nc_copy_to }; /* MTD device for all of the flash. */ diff --git a/drivers/mtd/maps/epxa10db-flash.c b/drivers/mtd/maps/epxa10db-flash.c index cb4c76e4bb71..fc4f0e92a06c 100644 --- a/drivers/mtd/maps/epxa10db-flash.c +++ b/drivers/mtd/maps/epxa10db-flash.c @@ -92,17 +92,17 @@ static void epxa_copy_to(struct map_info *map, unsigned long to, const void *fro static struct map_info epxa_map = { - name: "EPXA flash", - size: FLASH_SIZE, - buswidth: 2, - read8: epxa_read8, - read16: epxa_read16, - read32: epxa_read32, - copy_from: epxa_copy_from, - write8: epxa_write8, - write16: epxa_write16, - write32: epxa_write32, - copy_to: epxa_copy_to + .name = "EPXA flash", + .size = FLASH_SIZE, + .buswidth = 2, + .read8 = epxa_read8, + .read16 = epxa_read16, + .read32 = epxa_read32, + .copy_from = epxa_copy_from, + .write8 = epxa_write8, + .write16 = epxa_write16, + .write32 = epxa_write32, + .copy_to = epxa_copy_to }; diff --git a/drivers/mtd/maps/fortunet.c b/drivers/mtd/maps/fortunet.c index 98fd322e9523..9bddde021ce7 100644 --- a/drivers/mtd/maps/fortunet.c +++ b/drivers/mtd/maps/fortunet.c @@ -78,16 +78,16 @@ void fortunet_copy_to(struct map_info *map, unsigned long to, const void *from, } struct map_info default_map = { - size: DEF_WINDOW_SIZE, - buswidth: 4, - read8: fortunet_read8, - read16: fortunet_read16, - read32: fortunet_read32, - copy_from: fortunet_copy_from, - write8: fortunet_write8, - write16: fortunet_write16, - write32: fortunet_write32, - copy_to: fortunet_copy_to + .size = DEF_WINDOW_SIZE, + .buswidth = 4, + .read8 = fortunet_read8, + .read16 = fortunet_read16, + .read32 = fortunet_read32, + .copy_from = fortunet_copy_from, + .write8 = fortunet_write8, + .write16 = fortunet_write16, + .write32 = fortunet_write32, + .copy_to = fortunet_copy_to }; static char * __init get_string_option(char *dest,int dest_size,char *sor) diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c index 3dc382bc9511..4395677b4337 100644 --- a/drivers/mtd/maps/impa7.c +++ b/drivers/mtd/maps/impa7.c @@ -82,30 +82,30 @@ void impa7_copy_to(struct map_info *map, unsigned long to, const void *from, ssi static struct map_info impa7_map[NUM_FLASHBANKS] = { { - name: "impA7 NOR Flash Bank #0", - size: WINDOW_SIZE0, - buswidth: BUSWIDTH, - read8: impa7_read8, - read16: impa7_read16, - read32: impa7_read32, - copy_from: impa7_copy_from, - write8: impa7_write8, - write16: impa7_write16, - write32: impa7_write32, - copy_to: impa7_copy_to + .name = "impA7 NOR Flash Bank #0", + .size = WINDOW_SIZE0, + .buswidth = BUSWIDTH, + .read8 = impa7_read8, + .read16 = impa7_read16, + .read32 = impa7_read32, + .copy_from = impa7_copy_from, + .write8 = impa7_write8, + .write16 = impa7_write16, + .write32 = impa7_write32, + .copy_to = impa7_copy_to }, { - name: "impA7 NOR Flash Bank #1", - size: WINDOW_SIZE1, - buswidth: BUSWIDTH, - read8: impa7_read8, - read16: impa7_read16, - read32: impa7_read32, - copy_from: impa7_copy_from, - write8: impa7_write8, - write16: impa7_write16, - write32: impa7_write32, - copy_to: impa7_copy_to + .name = "impA7 NOR Flash Bank #1", + .size = WINDOW_SIZE1, + .buswidth = BUSWIDTH, + .read8 = impa7_read8, + .read16 = impa7_read16, + .read32 = impa7_read32, + .copy_from = impa7_copy_from, + .write8 = impa7_write8, + .write16 = impa7_write16, + .write32 = impa7_write32, + .copy_to = impa7_copy_to }, }; @@ -114,13 +114,12 @@ static struct map_info impa7_map[NUM_FLASHBANKS] = { /* * MTD partitioning stuff */ -static struct mtd_partition static_partitions[] = -{ - { - name: "FileSystem", - size: 0x800000, - offset: 0x00000000 - }, +static struct mtd_partition static_partitions[] = { + { + .name = "FileSystem", + .size = 0x800000, + .offset = 0x00000000 + }, }; #define NB_OF(x) (sizeof (x) / sizeof (x[0])) @@ -143,8 +142,8 @@ int __init init_impa7(void) const char *part_type = 0; int i; static struct { u_long addr; u_long size; } pt[NUM_FLASHBANKS] = { - { WINDOW_ADDR0, WINDOW_SIZE0 }, - { WINDOW_ADDR1, WINDOW_SIZE1 }, + { .addr = WINDOW_ADDR0, .size = WINDOW_SIZE0 }, + { .addr = WINDOW_ADDR1, .size = WINDOW_SIZE1 }, }; char mtdid[10]; int devicesfound = 0; diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c index cd58f8fae012..6afe145986d5 100644 --- a/drivers/mtd/maps/integrator-flash.c +++ b/drivers/mtd/maps/integrator-flash.c @@ -195,16 +195,16 @@ static void armflash_copy_to(struct map_info *map, unsigned long to, const void static struct map_info armflash_map = { - name: "AFS", - read8: armflash_read8, - read16: armflash_read16, - read32: armflash_read32, - copy_from: armflash_copy_from, - write8: armflash_write8, - write16: armflash_write16, - write32: armflash_write32, - copy_to: armflash_copy_to, - set_vpp: armflash_set_vpp, + .name = "AFS", + .read8 = armflash_read8, + .read16 = armflash_read16, + .read32 = armflash_read32, + .copy_from = armflash_copy_from, + .write8 = armflash_write8, + .write16 = armflash_write16, + .write32 = armflash_write32, + .copy_to = armflash_copy_to, + .set_vpp = armflash_set_vpp, }; static struct mtd_info *mtd; diff --git a/drivers/mtd/maps/iq80310.c b/drivers/mtd/maps/iq80310.c index 3a301135831b..81fba4828be6 100644 --- a/drivers/mtd/maps/iq80310.c +++ b/drivers/mtd/maps/iq80310.c @@ -67,38 +67,40 @@ static void iq80310_copy_to(struct map_info *map, unsigned long to, const void * } static struct map_info iq80310_map = { - name: "IQ80310 flash", - size: WINDOW_SIZE, - buswidth: BUSWIDTH, - read8: iq80310_read8, - read16: iq80310_read16, - read32: iq80310_read32, - copy_from: iq80310_copy_from, - write8: iq80310_write8, - write16: iq80310_write16, - write32: iq80310_write32, - copy_to: iq80310_copy_to + .name = "IQ80310 flash", + .size = WINDOW_SIZE, + .buswidth = BUSWIDTH, + .read8 = iq80310_read8, + .read16 = iq80310_read16, + .read32 = iq80310_read32, + .copy_from = iq80310_copy_from, + .write8 = iq80310_write8, + .write16 = iq80310_write16, + .write32 = iq80310_write32, + .copy_to = iq80310_copy_to }; static struct mtd_partition iq80310_partitions[4] = { { - name: "Firmware", - size: 0x00080000, - offset: 0, - mask_flags: MTD_WRITEABLE /* force read-only */ - },{ - name: "Kernel", - size: 0x000a0000, - offset: 0x00080000, - },{ - name: "Filesystem", - size: 0x00600000, - offset: 0x00120000 - },{ - name: "RedBoot", - size: 0x000e0000, - offset: 0x00720000, - mask_flags: MTD_WRITEABLE + .name = "Firmware", + .size = 0x00080000, + .mask_flags = MTD_WRITEABLE /* force read-only */ + }, + { + .name = "Kernel", + .size = 0x000a0000, + .offset = 0x00080000, + }, + { + .name = "Filesystem", + .size = 0x00600000, + .offset = 0x00120000 + }, + { + .name = "RedBoot", + .size = 0x000e0000, + .offset = 0x00720000, + .mask_flags = MTD_WRITEABLE } }; diff --git a/drivers/mtd/maps/l440gx.c b/drivers/mtd/maps/l440gx.c index 7f9b1f744d11..064eec463d4c 100644 --- a/drivers/mtd/maps/l440gx.c +++ b/drivers/mtd/maps/l440gx.c @@ -76,18 +76,18 @@ void l440gx_set_vpp(struct map_info *map, int vpp) } struct map_info l440gx_map = { - name: "L440GX BIOS", - size: WINDOW_SIZE, - buswidth: BUSWIDTH, - read8: l440gx_read8, - read16: l440gx_read16, - read32: l440gx_read32, - copy_from: l440gx_copy_from, - write8: l440gx_write8, - write16: l440gx_write16, - write32: l440gx_write32, - copy_to: l440gx_copy_to, - set_vpp: l440gx_set_vpp + .name = "L440GX BIOS", + .size = WINDOW_SIZE, + .buswidth = BUSWIDTH, + .read8 = l440gx_read8, + .read16 = l440gx_read16, + .read32 = l440gx_read32, + .copy_from = l440gx_copy_from, + .write8 = l440gx_write8, + .write16 = l440gx_write16, + .write32 = l440gx_write32, + .copy_to = l440gx_copy_to, + .set_vpp = l440gx_set_vpp }; static int __init init_l440gx(void) diff --git a/drivers/mtd/maps/netsc520.c b/drivers/mtd/maps/netsc520.c index e587f821e205..a2df8ac12055 100644 --- a/drivers/mtd/maps/netsc520.c +++ b/drivers/mtd/maps/netsc520.c @@ -93,27 +93,26 @@ static void netsc520_copy_to(struct map_info *map, unsigned long to, const void /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]={ - { - name: "NetSc520 boot kernel", - offset: 0, - size: 0xc0000 - }, - { - name: "NetSc520 Low BIOS", - offset: 0xc0000, - size: 0x40000 - }, - { - name: "NetSc520 file system", - offset: 0x100000, - size: 0xe80000 - }, - { - name: "NetSc520 High BIOS", - offset: 0xf80000, - size: 0x80000 - }, +static struct mtd_partition partition_info[] = { + { + .name = "NetSc520 boot kernel", + .size = 0xc0000 + }, + { + .name = "NetSc520 Low BIOS", + .offset = 0xc0000, + .size = 0x40000 + }, + { + .name = "NetSc520 file system", + .offset = 0x100000, + .size = 0xe80000 + }, + { + .name = "NetSc520 High BIOS", + .offset = 0xf80000, + .size = 0x80000 + }, }; #define NUM_PARTITIONS (sizeof(partition_info)/sizeof(partition_info[0])) @@ -127,18 +126,18 @@ static struct mtd_partition partition_info[]={ #define WINDOW_ADDR 0x00200000 static struct map_info netsc520_map = { - name: "netsc520 Flash Bank", - size: WINDOW_SIZE, - buswidth: 4, - read8: netsc520_read8, - read16: netsc520_read16, - read32: netsc520_read32, - copy_from: netsc520_copy_from, - write8: netsc520_write8, - write16: netsc520_write16, - write32: netsc520_write32, - copy_to: netsc520_copy_to, - map_priv_2: WINDOW_ADDR + .name = "netsc520 Flash Bank", + .size = WINDOW_SIZE, + .buswidth = 4, + .read8 = netsc520_read8, + .read16 = netsc520_read16, + .read32 = netsc520_read32, + .copy_from = netsc520_copy_from, + .write8 = netsc520_write8, + .write16 = netsc520_write16, + .write32 = netsc520_write32, + .copy_to = netsc520_copy_to, + .map_priv_2 = WINDOW_ADDR }; #define NUM_FLASH_BANKS (sizeof(netsc520_map)/sizeof(struct map_info)) diff --git a/drivers/mtd/maps/nora.c b/drivers/mtd/maps/nora.c index d9ffcc581efc..04c12214fa8b 100644 --- a/drivers/mtd/maps/nora.c +++ b/drivers/mtd/maps/nora.c @@ -58,17 +58,17 @@ void nora_copy_to(struct map_info *map, unsigned long to, const void *from, ssiz } struct map_info nora_map = { - name: "NORA", - size: WINDOW_SIZE, - buswidth: 2, - read8: nora_read8, - read16: nora_read16, - read32: nora_read32, - copy_from: nora_copy_from, - write8: nora_write8, - write16: nora_write16, - write32: nora_write32, - copy_to: nora_copy_to + .name = "NORA", + .size = WINDOW_SIZE, + .buswidth = 2, + .read8 = nora_read8, + .read16 = nora_read16, + .read32 = nora_read32, + .copy_from = nora_copy_from, + .write8 = nora_write8, + .write16 = nora_write16, + .write32 = nora_write32, + .copy_to = nora_copy_to }; @@ -106,64 +106,63 @@ static void nora_mtd_resume (struct mtd_info *mtd) static struct mtd_info nora_mtds[4] = { /* boot, kernel, ramdisk, fs */ { - type: MTD_NORFLASH, - flags: MTD_CAP_NORFLASH, - size: 0x60000, - erasesize: 0x20000, - name: "NORA boot firmware", - module: THIS_MODULE, - erase: nora_mtd_erase, - read: nora_mtd_read, - write: nora_mtd_write, - suspend: nora_mtd_suspend, - resume: nora_mtd_resume, - sync: nora_mtd_sync, - priv: (void *)0 + .type = MTD_NORFLASH, + .flags = MTD_CAP_NORFLASH, + .size = 0x60000, + .erasesize = 0x20000, + .name = "NORA boot firmware", + .module = THIS_MODULE, + .erase = nora_mtd_erase, + .read = nora_mtd_read, + .write = nora_mtd_write, + .suspend = nora_mtd_suspend, + .resume = nora_mtd_resume, + .sync = nora_mtd_sync, }, { - type: MTD_NORFLASH, - flags: MTD_CAP_NORFLASH, - size: 0x0a0000, - erasesize: 0x20000, - name: "NORA kernel", - module: THIS_MODULE, - erase: nora_mtd_erase, - read: nora_mtd_read, - write: nora_mtd_write, - suspend: nora_mtd_suspend, - resume: nora_mtd_resume, - sync: nora_mtd_sync, - priv: (void *)0x60000 + .type = MTD_NORFLASH, + .flags = MTD_CAP_NORFLASH, + .size = 0x0a0000, + .erasesize = 0x20000, + .name = "NORA kernel", + .module = THIS_MODULE, + .erase = nora_mtd_erase, + .read = nora_mtd_read, + .write = nora_mtd_write, + .suspend = nora_mtd_suspend, + .resume = nora_mtd_resume, + .sync = nora_mtd_sync, + .priv = (void *)0x60000 }, { - type: MTD_NORFLASH, - flags: MTD_CAP_NORFLASH, - size: 0x900000, - erasesize: 0x20000, - name: "NORA root filesystem", - module: THIS_MODULE, - erase: nora_mtd_erase, - read: nora_mtd_read, - write: nora_mtd_write, - suspend: nora_mtd_suspend, - resume: nora_mtd_resume, - sync: nora_mtd_sync, - priv: (void *)0x100000 + .type = MTD_NORFLASH, + .flags = MTD_CAP_NORFLASH, + .size = 0x900000, + .erasesize = 0x20000, + .name = "NORA root filesystem", + .module = THIS_MODULE, + .erase = nora_mtd_erase, + .read = nora_mtd_read, + .write = nora_mtd_write, + .suspend = nora_mtd_suspend, + .resume = nora_mtd_resume, + .sync = nora_mtd_sync, + .priv = (void *)0x100000 }, { - type: MTD_NORFLASH, - flags: MTD_CAP_NORFLASH, - size: 0x1600000, - erasesize: 0x20000, - name: "NORA second filesystem", - module: THIS_MODULE, - erase: nora_mtd_erase, - read: nora_mtd_read, - write: nora_mtd_write, - suspend: nora_mtd_suspend, - resume: nora_mtd_resume, - sync: nora_mtd_sync, - priv: (void *)0xa00000 + .type = MTD_NORFLASH, + .flags = MTD_CAP_NORFLASH, + .size = 0x1600000, + .erasesize = 0x20000, + .name = "NORA second filesystem", + .module = THIS_MODULE, + .erase = nora_mtd_erase, + .read = nora_mtd_read, + .write = nora_mtd_write, + .suspend = nora_mtd_suspend, + .resume = nora_mtd_resume, + .sync = nora_mtd_sync, + .priv = (void *)0xa00000 } }; diff --git a/drivers/mtd/maps/ocelot.c b/drivers/mtd/maps/ocelot.c index ceec5fb10295..ad92c425d18c 100644 --- a/drivers/mtd/maps/ocelot.c +++ b/drivers/mtd/maps/ocelot.c @@ -70,22 +70,22 @@ void ocelot_copy_to(struct map_info *map, unsigned long to, const void *from, ss static struct mtd_partition *parsed_parts; struct map_info ocelot_flash_map = { - name: "Ocelot boot flash", - size: FLASH_WINDOW_SIZE, - buswidth: FLASH_BUSWIDTH, - read8: ocelot_read8, - copy_from: ocelot_copy_from_cache, - write8: ocelot_write8, + .name = "Ocelot boot flash", + .size = FLASH_WINDOW_SIZE, + .buswidth = FLASH_BUSWIDTH, + .read8 = ocelot_read8, + .copy_from = ocelot_copy_from_cache, + .write8 = ocelot_write8, }; struct map_info ocelot_nvram_map = { - name: "Ocelot NVRAM", - size: NVRAM_WINDOW_SIZE, - buswidth: NVRAM_BUSWIDTH, - read8: ocelot_read8, - copy_from: ocelot_copy_from, - write8: ocelot_write8, - copy_to: ocelot_copy_to + .name = "Ocelot NVRAM", + .size = NVRAM_WINDOW_SIZE, + .buswidth = NVRAM_BUSWIDTH, + .read8 = ocelot_read8, + .copy_from = ocelot_copy_from, + .write8 = ocelot_write8, + .copy_to = ocelot_copy_to }; static int __init init_ocelot_maps(void) diff --git a/drivers/mtd/maps/octagon-5066.c b/drivers/mtd/maps/octagon-5066.c index 16cfd9ad6f89..89575be6f13b 100644 --- a/drivers/mtd/maps/octagon-5066.c +++ b/drivers/mtd/maps/octagon-5066.c @@ -151,32 +151,32 @@ static void oct5066_copy_to(struct map_info *map, unsigned long to, const void * static struct map_info oct5066_map[2] = { { - name: "Octagon 5066 Socket", - size: 512 * 1024, - buswidth: 1, - read8: oct5066_read8, - read16: oct5066_read16, - read32: oct5066_read32, - copy_from: oct5066_copy_from, - write8: oct5066_write8, - write16: oct5066_write16, - write32: oct5066_write32, - copy_to: oct5066_copy_to, - map_priv_1: 1<<6 + .name = "Octagon 5066 Socket", + .size = 512 * 1024, + .buswidth = 1, + .read8 = oct5066_read8, + .read16 = oct5066_read16, + .read32 = oct5066_read32, + .copy_from = oct5066_copy_from, + .write8 = oct5066_write8, + .write16 = oct5066_write16, + .write32 = oct5066_write32, + .copy_to = oct5066_copy_to, + .map_priv_1 = 1<<6 }, { - name: "Octagon 5066 Internal Flash", - size: 2 * 1024 * 1024, - buswidth: 1, - read8: oct5066_read8, - read16: oct5066_read16, - read32: oct5066_read32, - copy_from: oct5066_copy_from, - write8: oct5066_write8, - write16: oct5066_write16, - write32: oct5066_write32, - copy_to: oct5066_copy_to, - map_priv_1: 2<<6 + .name = "Octagon 5066 Internal Flash", + .size = 2 * 1024 * 1024, + .buswidth = 1, + .read8 = oct5066_read8, + .read16 = oct5066_read16, + .read32 = oct5066_read32, + .copy_from = oct5066_copy_from, + .write8 = oct5066_write8, + .write16 = oct5066_write16, + .write32 = oct5066_write32, + .copy_to = oct5066_copy_to, + .map_priv_1 = 2<<6 } }; diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c index ccc854980c6f..0ba1c33537ae 100644 --- a/drivers/mtd/maps/pci.c +++ b/drivers/mtd/maps/pci.c @@ -98,10 +98,10 @@ intel_iq80310_translate(struct map_pci_info *map, unsigned long ofs) } static struct mtd_pci_info intel_iq80310_info = { - init: intel_iq80310_init, - exit: intel_iq80310_exit, - translate: intel_iq80310_translate, - map_name: "cfi_probe", + .init = intel_iq80310_init, + .exit = intel_iq80310_exit, + .translate = intel_iq80310_translate, + .map_name = "cfi_probe", }; /* @@ -181,10 +181,10 @@ intel_dc21285_translate(struct map_pci_info *map, unsigned long ofs) } static struct mtd_pci_info intel_dc21285_info = { - init: intel_dc21285_init, - exit: intel_dc21285_exit, - translate: intel_dc21285_translate, - map_name: "jedec_probe", + .init = intel_dc21285_init, + .exit = intel_dc21285_exit, + .translate = intel_dc21285_translate, + .map_name = "jedec_probe", }; /* @@ -193,24 +193,22 @@ static struct mtd_pci_info intel_dc21285_info = { static struct pci_device_id mtd_pci_ids[] __devinitdata = { { - vendor: PCI_VENDOR_ID_INTEL, - device: 0x530d, - subvendor: PCI_ANY_ID, - subdevice: PCI_ANY_ID, - class: PCI_CLASS_MEMORY_OTHER << 8, - class_mask: 0xffff00, - driver_data: (unsigned long)&intel_iq80310_info, + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x530d, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .class = PCI_CLASS_MEMORY_OTHER << 8, + .class_mask = 0xffff00, + .driver_data = (unsigned long)&intel_iq80310_info, }, { - vendor: PCI_VENDOR_ID_DEC, - device: PCI_DEVICE_ID_DEC_21285, - subvendor: 0, /* DC21285 defaults to 0 on reset */ - subdevice: 0, /* DC21285 defaults to 0 on reset */ - class: 0, - class_mask: 0, - driver_data: (unsigned long)&intel_dc21285_info, + .vendor = PCI_VENDOR_ID_DEC, + .device = PCI_DEVICE_ID_DEC_21285, + .subvendor = 0, /* DC21285 defaults to 0 on reset */ + .subdevice = 0, /* DC21285 defaults to 0 on reset */ + .driver_data = (unsigned long)&intel_dc21285_info, }, - { 0, } + { .vendor = 0, } }; /* @@ -275,14 +273,14 @@ static void mtd_pci_copyto(struct map_info *_map, unsigned long to, const void * } static struct map_info mtd_pci_map = { - read8: mtd_pci_read8, - read16: mtd_pci_read16, - read32: mtd_pci_read32, - copy_from: mtd_pci_copyfrom, - write8: mtd_pci_write8, - write16: mtd_pci_write16, - write32: mtd_pci_write32, - copy_to: mtd_pci_copyto, + .read8 = mtd_pci_read8, + .read16 = mtd_pci_read16, + .read32 = mtd_pci_read32, + .copy_from = mtd_pci_copyfrom, + .write8 = mtd_pci_write8, + .write16 = mtd_pci_write16, + .write32 = mtd_pci_write32, + .copy_to = mtd_pci_copyto, }; static int __devinit @@ -359,10 +357,10 @@ mtd_pci_remove(struct pci_dev *dev) } static struct pci_driver mtd_pci_driver = { - name: "MTD PCI", - probe: mtd_pci_probe, - remove: mtd_pci_remove, - id_table: mtd_pci_ids, + .name = "MTD PCI", + .probe = mtd_pci_probe, + .remove = mtd_pci_remove, + .id_table = mtd_pci_ids, }; static int __init mtd_pci_maps_init(void) diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 253540f4f1b6..5243513f93e4 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -63,17 +63,17 @@ void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, s } struct map_info physmap_map = { - name: "Physically mapped flash", - size: WINDOW_SIZE, - buswidth: BUSWIDTH, - read8: physmap_read8, - read16: physmap_read16, - read32: physmap_read32, - copy_from: physmap_copy_from, - write8: physmap_write8, - write16: physmap_write16, - write32: physmap_write32, - copy_to: physmap_copy_to + .name = "Physically mapped flash", + .size = WINDOW_SIZE, + .buswidth = BUSWIDTH, + .read8 = physmap_read8, + .read16 = physmap_read16, + .read32 = physmap_read32, + .copy_from = physmap_copy_from, + .write8 = physmap_write8, + .write16 = physmap_write16, + .write32 = physmap_write32, + .copy_to = physmap_copy_to }; int __init init_physmap(void) diff --git a/drivers/mtd/maps/pnc2000.c b/drivers/mtd/maps/pnc2000.c index 17741e25cf25..ec3ba8c37e07 100644 --- a/drivers/mtd/maps/pnc2000.c +++ b/drivers/mtd/maps/pnc2000.c @@ -65,17 +65,17 @@ void pnc_copy_to(struct map_info *map, unsigned long to, const void *from, ssize } struct map_info pnc_map = { - name: "PNC-2000", - size: WINDOW_SIZE, - buswidth: 4, - read8: pnc_read8, - read16: pnc_read16, - read32: pnc_read32, - copy_from: pnc_copy_from, - write8: pnc_write8, - write16: pnc_write16, - write32: pnc_write32, - copy_to: pnc_copy_to + .name = "PNC-2000", + .size = WINDOW_SIZE, + .buswidth = 4, + .read8 = pnc_read8, + .read16 = pnc_read16, + .read32 = pnc_read32, + .copy_from = pnc_copy_from, + .write8 = pnc_write8, + .write16 = pnc_write16, + .write32 = pnc_write32, + .copy_to = pnc_copy_to }; @@ -84,19 +84,18 @@ struct map_info pnc_map = { */ static struct mtd_partition pnc_partitions[3] = { { - name: "PNC-2000 boot firmware", - size: 0x20000, - offset: 0 + .name = "PNC-2000 boot firmware", + .size = 0x20000, }, { - name: "PNC-2000 kernel", - size: 0x1a0000, - offset: 0x20000 + .name = "PNC-2000 kernel", + .size = 0x1a0000, + .offset = 0x20000 }, { - name: "PNC-2000 filesystem", - size: 0x240000, - offset: 0x1c0000 + .name = "PNC-2000 filesystem", + .size = 0x240000, + .offset = 0x1c0000 } }; diff --git a/drivers/mtd/maps/rpxlite.c b/drivers/mtd/maps/rpxlite.c index 41b168fce91d..3cd1a1e0283c 100644 --- a/drivers/mtd/maps/rpxlite.c +++ b/drivers/mtd/maps/rpxlite.c @@ -61,17 +61,17 @@ void rpxlite_copy_to(struct map_info *map, unsigned long to, const void *from, s } struct map_info rpxlite_map = { - name: "RPX", - size: WINDOW_SIZE, - buswidth: 4, - read8: rpxlite_read8, - read16: rpxlite_read16, - read32: rpxlite_read32, - copy_from: rpxlite_copy_from, - write8: rpxlite_write8, - write16: rpxlite_write16, - write32: rpxlite_write32, - copy_to: rpxlite_copy_to + .name = "RPX", + .size = WINDOW_SIZE, + .buswidth = 4, + .read8 = rpxlite_read8, + .read16 = rpxlite_read16, + .read32 = rpxlite_read32, + .copy_from = rpxlite_copy_from, + .write8 = rpxlite_write8, + .write16 = rpxlite_write16, + .write32 = rpxlite_write32, + .copy_to = rpxlite_copy_to }; int __init init_rpxlite(void) diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index d85f6c42fa23..6548a8ef1eec 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c @@ -96,7 +96,7 @@ static struct map_info sa1100_map __initdata = { * 1. We no longer support static flash mappings via the machine io_desc * structure. * 2. The flash size given should be the largest flash size that can - * be accomodated. + * be accommodated. * * The MTD layer will detect flash chip aliasing and reduce the size of * the map accordingly. diff --git a/drivers/mtd/maps/sbc_gxx.c b/drivers/mtd/maps/sbc_gxx.c index 2ea82481099e..429d25eb0c10 100644 --- a/drivers/mtd/maps/sbc_gxx.c +++ b/drivers/mtd/maps/sbc_gxx.c @@ -90,15 +90,20 @@ static spinlock_t sbc_gxx_spin = SPIN_LOCK_UNLOCKED; /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]={ - { name: "SBC-GXx flash boot partition", - offset: 0, - size: BOOT_PARTITION_SIZE_KiB*1024 }, - { name: "SBC-GXx flash data partition", - offset: BOOT_PARTITION_SIZE_KiB*1024, - size: (DATA_PARTITION_SIZE_KiB)*1024 }, - { name: "SBC-GXx flash application partition", - offset: (BOOT_PARTITION_SIZE_KiB+DATA_PARTITION_SIZE_KiB)*1024 } +static struct mtd_partition partition_info[] = { + { + .name = "SBC-GXx flash boot partition", + .size = BOOT_PARTITION_SIZE_KiB*1024 + }, + { + .name = "SBC-GXx flash data partition", + .offset = BOOT_PARTITION_SIZE_KiB*1024, + .size = (DATA_PARTITION_SIZE_KiB)*1024 + }, + { + .name = "SBC-GXx flash application partition", + .offset = (BOOT_PARTITION_SIZE_KiB+DATA_PARTITION_SIZE_KiB)*1024 + } }; #define NUM_PARTITIONS 3 @@ -203,19 +208,20 @@ static void sbc_gxx_copy_to(struct map_info *map, unsigned long to, const void * } static struct map_info sbc_gxx_map = { - name: "SBC-GXx flash", - size: MAX_SIZE_KiB*1024, /* this must be set to a maximum possible amount - of flash so the cfi probe routines find all - the chips */ - buswidth: 1, - read8: sbc_gxx_read8, - read16: sbc_gxx_read16, - read32: sbc_gxx_read32, - copy_from: sbc_gxx_copy_from, - write8: sbc_gxx_write8, - write16: sbc_gxx_write16, - write32: sbc_gxx_write32, - copy_to: sbc_gxx_copy_to + .name = "SBC-GXx flash", + .size = MAX_SIZE_KiB*1024, /* this must be set to a maximum + possible amount of flash so + the cfi probe routines find + all the chips */ + .buswidth = 1, + .read8 = sbc_gxx_read8, + .read16 = sbc_gxx_read16, + .read32 = sbc_gxx_read32, + .copy_from = sbc_gxx_copy_from, + .write8 = sbc_gxx_write8, + .write16 = sbc_gxx_write16, + .write32 = sbc_gxx_write32, + .copy_to = sbc_gxx_copy_to }; /* MTD device for all of the flash. */ diff --git a/drivers/mtd/maps/sc520cdp.c b/drivers/mtd/maps/sc520cdp.c index 0f10e4ebedb6..ea1607584459 100644 --- a/drivers/mtd/maps/sc520cdp.c +++ b/drivers/mtd/maps/sc520cdp.c @@ -125,46 +125,46 @@ static void sc520cdp_copy_to(struct map_info *map, unsigned long to, const void static struct map_info sc520cdp_map[] = { { - name: "SC520CDP Flash Bank #0", - size: WINDOW_SIZE_0, - buswidth: 4, - read8: sc520cdp_read8, - read16: sc520cdp_read16, - read32: sc520cdp_read32, - copy_from: sc520cdp_copy_from, - write8: sc520cdp_write8, - write16: sc520cdp_write16, - write32: sc520cdp_write32, - copy_to: sc520cdp_copy_to, - map_priv_2: WINDOW_ADDR_0 + .name = "SC520CDP Flash Bank #0", + .size = WINDOW_SIZE_0, + .buswidth = 4, + .read8 = sc520cdp_read8, + .read16 = sc520cdp_read16, + .read32 = sc520cdp_read32, + .copy_from = sc520cdp_copy_from, + .write8 = sc520cdp_write8, + .write16 = sc520cdp_write16, + .write32 = sc520cdp_write32, + .copy_to = sc520cdp_copy_to, + .map_priv_2 = WINDOW_ADDR_0 }, { - name: "SC520CDP Flash Bank #1", - size: WINDOW_SIZE_1, - buswidth: 4, - read8: sc520cdp_read8, - read16: sc520cdp_read16, - read32: sc520cdp_read32, - copy_from: sc520cdp_copy_from, - write8: sc520cdp_write8, - write16: sc520cdp_write16, - write32: sc520cdp_write32, - copy_to: sc520cdp_copy_to, - map_priv_2: WINDOW_ADDR_1 + .name = "SC520CDP Flash Bank #1", + .size = WINDOW_SIZE_1, + .buswidth = 4, + .read8 = sc520cdp_read8, + .read16 = sc520cdp_read16, + .read32 = sc520cdp_read32, + .copy_from = sc520cdp_copy_from, + .write8 = sc520cdp_write8, + .write16 = sc520cdp_write16, + .write32 = sc520cdp_write32, + .copy_to = sc520cdp_copy_to, + .map_priv_2 = WINDOW_ADDR_1 }, { - name: "SC520CDP DIL Flash", - size: WINDOW_SIZE_2, - buswidth: 1, - read8: sc520cdp_read8, - read16: sc520cdp_read16, - read32: sc520cdp_read32, - copy_from: sc520cdp_copy_from, - write8: sc520cdp_write8, - write16: sc520cdp_write16, - write32: sc520cdp_write32, - copy_to: sc520cdp_copy_to, - map_priv_2: WINDOW_ADDR_2 + .name = "SC520CDP DIL Flash", + .size = WINDOW_SIZE_2, + .buswidth = 1, + .read8 = sc520cdp_read8, + .read16 = sc520cdp_read16, + .read32 = sc520cdp_read32, + .copy_from = sc520cdp_copy_from, + .write8 = sc520cdp_write8, + .write16 = sc520cdp_write16, + .write32 = sc520cdp_write32, + .copy_to = sc520cdp_copy_to, + .map_priv_2 = WINDOW_ADDR_2 }, }; diff --git a/drivers/mtd/maps/solutionengine.c b/drivers/mtd/maps/solutionengine.c index 93d12d7fe93c..9aa062fcf688 100644 --- a/drivers/mtd/maps/solutionengine.c +++ b/drivers/mtd/maps/solutionengine.c @@ -42,19 +42,19 @@ static struct mtd_info *eprom_mtd; static struct mtd_partition *parsed_parts; struct map_info soleng_eprom_map = { - name: "Solution Engine EPROM", - size: 0x400000, - buswidth: 4, - copy_from: soleng_copy_from, + .name = "Solution Engine EPROM", + .size = 0x400000, + .buswidth = 4, + .copy_from = soleng_copy_from, }; struct map_info soleng_flash_map = { - name: "Solution Engine FLASH", - size: 0x400000, - buswidth: 4, - read32: soleng_read32, - copy_from: soleng_copy_from, - write32: soleng_write32, + .name = "Solution Engine FLASH", + .size = 0x400000, + .buswidth = 4, + .read32 = soleng_read32, + .copy_from = soleng_copy_from, + .write32 = soleng_write32, }; static int __init init_soleng_maps(void) diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c index b431bf2276d4..aef5fd170de7 100644 --- a/drivers/mtd/maps/sun_uflash.c +++ b/drivers/mtd/maps/sun_uflash.c @@ -91,17 +91,17 @@ void uflash_copy_to(struct map_info *map, unsigned long to, const void *from, } struct map_info uflash_map_templ = { - name: "SUNW,???-????", - size: UFLASH_WINDOW_SIZE, - buswidth: UFLASH_BUSWIDTH, - read8: uflash_read8, - read16: uflash_read16, - read32: uflash_read32, - copy_from: uflash_copy_from, - write8: uflash_write8, - write16: uflash_write16, - write32: uflash_write32, - copy_to: uflash_copy_to + .name = "SUNW,???-????", + .size = UFLASH_WINDOW_SIZE, + .buswidth = UFLASH_BUSWIDTH, + .read8 = uflash_read8, + .read16 = uflash_read16, + .read32 = uflash_read32, + .copy_from = uflash_copy_from, + .write8 = uflash_write8, + .write16 = uflash_write16, + .write32 = uflash_write32, + .copy_to = uflash_copy_to }; int uflash_devinit(struct linux_ebus_device* edev) diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c index b7c22c460a69..5af066d0f2a4 100644 --- a/drivers/mtd/maps/tqm8xxl.c +++ b/drivers/mtd/maps/tqm8xxl.c @@ -92,17 +92,16 @@ void tqm8xxl_copy_to(struct map_info *map, unsigned long to, const void *from, s } struct map_info tqm8xxl_map = { - name: "TQM8xxL", - //size: WINDOW_SIZE, - buswidth: 4, - read8: tqm8xxl_read8, - read16: tqm8xxl_read16, - read32: tqm8xxl_read32, - copy_from: tqm8xxl_copy_from, - write8: tqm8xxl_write8, - write16: tqm8xxl_write16, - write32: tqm8xxl_write32, - copy_to: tqm8xxl_copy_to + .name = "TQM8xxL", + .buswidth = 4, + .read8 = tqm8xxl_read8, + .read16 = tqm8xxl_read16, + .read32 = tqm8xxl_read32, + .copy_from = tqm8xxl_copy_from, + .write8 = tqm8xxl_write8, + .write16 = tqm8xxl_write16, + .write32 = tqm8xxl_write32, + .copy_to = tqm8xxl_copy_to }; /* @@ -125,40 +124,39 @@ static unsigned long tqm8xxl_max_flash_size = 0x00800000; */ static struct mtd_partition tqm8xxl_partitions[] = { { - name: "ppcboot", - offset: 0x00000000, - size: 0x00020000, /* 128KB */ - mask_flags: MTD_WRITEABLE, /* force read-only */ + .name = "ppcboot", + .offset = 0x00000000, + .size = 0x00020000, /* 128KB */ + .mask_flags = MTD_WRITEABLE, /* force read-only */ }, { - name: "kernel", /* default kernel image */ - offset: 0x00020000, - size: 0x000e0000, - mask_flags: MTD_WRITEABLE, /* force read-only */ + .name = "kernel", /* default kernel image */ + .offset = 0x00020000, + .size = 0x000e0000, + .mask_flags = MTD_WRITEABLE, /* force read-only */ }, { - name: "user", - offset: 0x00100000, - size: 0x00100000, + .name = "user", + .offset = 0x00100000, + .size = 0x00100000, }, { - name: "initrd", - offset: 0x00200000, - size: 0x00200000, + .name = "initrd", + .offset = 0x00200000, + .size = 0x00200000, } }; /* partition definition for second flahs bank */ static struct mtd_partition tqm8xxl_fs_partitions[] = { { - name: "cramfs", - offset: 0x00000000, - size: 0x00200000, + .name = "cramfs", + .offset = 0x00000000, + .size = 0x00200000, }, { - name: "jffs", - offset: 0x00200000, - size: 0x00200000, - //size: MTDPART_SIZ_FULL, + .name = "jffs", + .offset = 0x00200000, + .size = 0x00200000, } }; #endif diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c index 0e93a1e2696f..63b3275bcb6f 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c @@ -66,15 +66,15 @@ void uclinux_copy_to(struct map_info *map, unsigned long to, const void *from, s /****************************************************************************/ struct map_info uclinux_ram_map = { - name: "RAM", - read8: uclinux_read8, - read16: uclinux_read16, - read32: uclinux_read32, - copy_from: uclinux_copy_from, - write8: uclinux_write8, - write16: uclinux_write16, - write32: uclinux_write32, - copy_to: uclinux_copy_to, + .name = "RAM", + .read8 = uclinux_read8, + .read16 = uclinux_read16, + .read32 = uclinux_read32, + .copy_from = uclinux_copy_from, + .write8 = uclinux_write8, + .write16 = uclinux_write16, + .write32 = uclinux_write32, + .copy_to = uclinux_copy_to, }; struct mtd_info *uclinux_ram_mtdinfo; @@ -82,7 +82,7 @@ struct mtd_info *uclinux_ram_mtdinfo; /****************************************************************************/ struct mtd_partition uclinux_romfs[] = { - { name: "ROMfs", offset: 0 } + { .name = "ROMfs", .offset = 0 } }; #define NUM_PARTITIONS (sizeof(uclinux_romfs) / sizeof(uclinux_romfs[0])) diff --git a/drivers/mtd/maps/vmax301.c b/drivers/mtd/maps/vmax301.c index 4fd2f631e12d..4c68f5384ead 100644 --- a/drivers/mtd/maps/vmax301.c +++ b/drivers/mtd/maps/vmax301.c @@ -142,34 +142,33 @@ static void vmax301_copy_to(struct map_info *map, unsigned long to, const void * static struct map_info vmax_map[2] = { { - name: "VMAX301 Internal Flash", - size: 3*2*1024*1024, - buswidth: 1, - read8: vmax301_read8, - read16: vmax301_read16, - read32: vmax301_read32, - copy_from: vmax301_copy_from, - write8: vmax301_write8, - write16: vmax301_write16, - write32: vmax301_write32, - copy_to: vmax301_copy_to, - map_priv_1: WINDOW_START + WINDOW_LENGTH, - map_priv_2: 0xFFFFFFFF + .name = "VMAX301 Internal Flash", + .size = 3*2*1024*1024, + .buswidth = 1, + .read8 = vmax301_read8, + .read16 = vmax301_read16, + .read32 = vmax301_read32, + .copy_from = vmax301_copy_from, + .write8 = vmax301_write8, + .write16 = vmax301_write16, + .write32 = vmax301_write32, + .copy_to = vmax301_copy_to, + .map_priv_1 = WINDOW_START + WINDOW_LENGTH, + .map_priv_2 = 0xFFFFFFFF }, { - name: "VMAX301 Socket", - size: 0, - buswidth: 1, - read8: vmax301_read8, - read16: vmax301_read16, - read32: vmax301_read32, - copy_from: vmax301_copy_from, - write8: vmax301_write8, - write16: vmax301_write16, - write32: vmax301_write32, - copy_to: vmax301_copy_to, - map_priv_1: WINDOW_START + (3*WINDOW_LENGTH), - map_priv_2: 0xFFFFFFFF + .name = "VMAX301 Socket", + .buswidth = 1, + .read8 = vmax301_read8, + .read16 = vmax301_read16, + .read32 = vmax301_read32, + .copy_from = vmax301_copy_from, + .write8 = vmax301_write8, + .write16 = vmax301_write16, + .write32 = vmax301_write32, + .copy_to = vmax301_copy_to, + .map_priv_1 = WINDOW_START + (3*WINDOW_LENGTH), + .map_priv_2 = 0xFFFFFFFF } }; diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 81de629c020f..0e48d9c0e809 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -19,8 +19,8 @@ static void mtd_notify_add(struct mtd_info* mtd); static void mtd_notify_remove(struct mtd_info* mtd); static struct mtd_notifier notifier = { - add: mtd_notify_add, - remove: mtd_notify_remove, + .add = mtd_notify_add, + .remove = mtd_notify_remove, }; #endif @@ -445,13 +445,13 @@ static int mtd_ioctl(struct inode *inode, struct file *file, } /* memory_ioctl */ static struct file_operations mtd_fops = { - owner: THIS_MODULE, - llseek: mtd_lseek, /* lseek */ - read: mtd_read, /* read */ - write: mtd_write, /* write */ - ioctl: mtd_ioctl, /* ioctl */ - open: mtd_open, /* open */ - release: mtd_close, /* release */ + .owner = THIS_MODULE, + .llseek = mtd_lseek, /* lseek */ + .read = mtd_read, /* read */ + .write = mtd_write, /* write */ + .ioctl = mtd_ioctl, /* ioctl */ + .open = mtd_open, /* open */ + .release = mtd_close, /* release */ }; diff --git a/drivers/mtd/nand/spia.c b/drivers/mtd/nand/spia.c index df2f7bc6c560..e798ddf2a7c9 100644 --- a/drivers/mtd/nand/spia.c +++ b/drivers/mtd/nand/spia.c @@ -66,12 +66,15 @@ __setup("spia_peddr=",spia_peddr); * Define partitions for flash device */ const static struct mtd_partition partition_info[] = { - { name: "SPIA flash partition 1", - offset: 0, - size: 2*1024*1024 }, - { name: "SPIA flash partition 2", - offset: 2*1024*1024, - size: 6*1024*1024 } + { + .name = "SPIA flash partition 1", + .size = 2*1024*1024 + }, + { + .name = "SPIA flash partition 2", + .offset = 2*1024*1024, + .size = 6*1024*1024 + } }; #define NUM_PARTITIONS 2 diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c index d980dfc8c1a4..b4d8d5599986 100644 --- a/drivers/mtd/nftlcore.c +++ b/drivers/mtd/nftlcore.c @@ -914,8 +914,8 @@ static struct block_device_operations nftl_fops = ****************************************************************************/ static struct mtd_notifier nftl_notifier = { - add: NFTL_notify_add, - remove: NFTL_notify_remove + .add = NFTL_notify_add, + .remove = NFTL_notify_remove }; extern char nftlmountrev[]; diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c index f11199a62fd8..dd71901bcf32 100644 --- a/drivers/net/3c501.c +++ b/drivers/net/3c501.c @@ -494,7 +494,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev) * @regs: Register data (surplus to our requirements) * * Handle the ether interface interrupts. The 3c501 needs a lot more - * hand holding than most cards. In paticular we get a transmit interrupt + * hand holding than most cards. In particular we get a transmit interrupt * with a collision error because the board firmware isnt capable of rewinding * its own transmit buffer pointers. It can however count to 16 for us. * @@ -684,7 +684,7 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs) * @dev: Device to pull the packets from * * We have a good packet. Well, not really "good", just mostly not broken. - * We must check everything to see if it is good. In paticular we occasionally + * We must check everything to see if it is good. In particular we occasionally * get wild packet sizes from the card. If the packet seems sane we PIO it * off the card and queue it for the protocol layers. */ diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index 5e52613c2f1c..39fc773bfb4b 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c @@ -693,7 +693,7 @@ MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_EL2_CARDS) "i"); MODULE_PARM(xcvr, "1-" __MODULE_STRING(MAX_EL2_CARDS) "i"); MODULE_PARM_DESC(io, "I/O base address(es)"); MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)"); -MODULE_PARM_DESC(xcvr, "tranceiver(s) (0=internal, 1=external)"); +MODULE_PARM_DESC(xcvr, "transceiver(s) (0=internal, 1=external)"); MODULE_DESCRIPTION("3Com ISA EtherLink II, II/16 (3c503, 3c503/16) driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 815bac11cc72..fa7af13f3ed4 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -385,7 +385,7 @@ static int __init el3_probe(int card_idx) idev))) { if (pnp_device_attach(idev) < 0) continue; - if (pnp_activate_dev(idev, NULL) < 0) { + if (pnp_activate_dev(idev) < 0) { __again: pnp_device_detach(idev); continue; @@ -1139,7 +1139,7 @@ el3_netdev_get_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd) int ioaddr = dev->base_addr; EL3WINDOW(0); - /* obtain current tranceiver via WN4_MEDIA? */ + /* obtain current transceiver via WN4_MEDIA? */ tmp = inw(ioaddr + WN0_ADDR_CONF); ecmd->transceiver = XCVR_INTERNAL; switch (tmp >> 14) { @@ -1548,7 +1548,7 @@ MODULE_PARM(xcvr,"1-12i"); MODULE_PARM(max_interrupt_work, "i"); MODULE_PARM_DESC(debug, "debug level (0-6)"); MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)"); -MODULE_PARM_DESC(xcvr,"tranceiver(s) (0=internal, 1=external)"); +MODULE_PARM_DESC(xcvr,"transceiver(s) (0=internal, 1=external)"); MODULE_PARM_DESC(max_interrupt_work, "maximum events handled per interrupt"); #ifdef __ISAPNP__ MODULE_PARM(nopnp, "i"); diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index b23de1cec0d1..74b275e5a0b3 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c @@ -469,7 +469,7 @@ static int corkscrew_scan(struct net_device *dev) if (pnp_device_attach(idev) < 0) continue; - if (pnp_activate_dev(idev, NULL) < 0) { + if (pnp_activate_dev(idev) < 0) { printk("pnp activate failed (out of resources?)\n"); pnp_device_detach(idev); return -ENOMEM; diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index a6526037a62a..3ab32fc653ac 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c @@ -227,7 +227,7 @@ static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); * Because MCA bus is a real bus and we can scan for cards we could do a * single scan for all boards here. Right now we use the passed in device * structure and scan for only one board. This needs fixing for modules - * in paticular. + * in particular. */ int __init mc32_probe(struct net_device *dev) @@ -1168,7 +1168,7 @@ static void mc32_update_stats(struct net_device *dev) * the stack or, if the packet is near MTU sized, we allocate * another buffer and flip the old one up the stack. * - * We must succeed in keeping a buffer on the ring. If neccessary we + * We must succeed in keeping a buffer on the ring. If necessary we * will toss a received packet rather than lose a ring entry. Once * the first uncompleted descriptor is found, we move the * End-Of-List bit to include the buffers just processed. diff --git a/drivers/net/8390.c b/drivers/net/8390.c index 17b108c09f03..37c417e3f7ce 100644 --- a/drivers/net/8390.c +++ b/drivers/net/8390.c @@ -277,7 +277,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) /* Mask interrupts from the ethercard. SMP: We have to grab the lock here otherwise the IRQ handler on another CPU can flip window and race the IRQ mask set. We end - up trashing the mcast filter not disabling irqs if we dont lock */ + up trashing the mcast filter not disabling irqs if we don't lock */ spin_lock_irqsave(&ei_local->page_lock, flags); outb_p(0x00, e8390_base + EN0_IMR); @@ -417,7 +417,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) * Handle the ether interface interrupts. We pull packets from * the 8390 via the card specific functions and fire them at the networking * stack. We also handle transmit completions and wake the transmit path if - * neccessary. We also update the counters and do other housekeeping as + * necessary. We also update the counters and do other housekeeping as * needed. */ diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 5d0ef4856b07..e05a28c98a94 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c @@ -1378,7 +1378,7 @@ static int __init ace_init(struct net_device *dev) * On this platform, we know what the best dma settings * are. We use 64-byte maximum bursts, because if we * burst larger than the cache line size (or even cross - * a 64byte boundry in a single burst) the UltraSparc + * a 64byte boundary in a single burst) the UltraSparc * PCI controller will disconnect at 64-byte multiples. * * Read-multiple will be properly enabled above, and when diff --git a/drivers/net/atp.c b/drivers/net/atp.c index b93aca8f9d6e..2deac9a550f3 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c @@ -162,7 +162,7 @@ MODULE_PARM_DESC(max_interrupt_work, "ATP maximum events handled per interrupt") MODULE_PARM_DESC(debug, "ATP debug level (0-7)"); MODULE_PARM_DESC(io, "ATP I/O base address(es)"); MODULE_PARM_DESC(irq, "ATP IRQ number(s)"); -MODULE_PARM_DESC(xcvr, "ATP tranceiver(s) (0=internal, 1=external)"); +MODULE_PARM_DESC(xcvr, "ATP transceiver(s) (0=internal, 1=external)"); /* The number of low I/O ports used by the ethercard. */ #define ETHERCARD_TOTAL_SIZE 3 diff --git a/drivers/net/b44.h b/drivers/net/b44.h index 35d87e9c1ddb..c06416d3d7a6 100644 --- a/drivers/net/b44.h +++ b/drivers/net/b44.h @@ -424,7 +424,7 @@ struct dma_desc { }; /* There are only 12 bits in the DMA engine for descriptor offsetting - * so the table must be aligned on a boundry of this. + * so the table must be aligned on a boundary of this. */ #define DMA_TABLE_BYTES 4096 diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 759b4ec37889..7cdac3742f8f 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c @@ -1112,7 +1112,7 @@ net_open(struct net_device *dev) int i; int ret; -#ifndef CONFIG_SH_HICOSH4 /* uses irq#1, so this wont work */ +#ifndef CONFIG_SH_HICOSH4 /* uses irq#1, so this won't work */ if (dev->irq < 2) { /* Allow interrupts to be generated by the chip */ /* Cirrus' release had this: */ diff --git a/drivers/net/declance.c b/drivers/net/declance.c index e57ccf08b4d6..d9635b1b3b56 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c @@ -887,7 +887,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) cp_to_buf((char *) lp->tx_buf_ptr_cpu[entry], skb->data, skblen); /* Clear the slack of the packet, do I need this? */ - /* For a firewall its a good idea - AC */ + /* For a firewall it's a good idea - AC */ /* if (len != skblen) memset ((char *) &ib->tx_buf [entry][skblen], 0, (len - skblen) << 1); diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c index 8274c099a3d3..934e5c147daa 100644 --- a/drivers/net/dgrs.c +++ b/drivers/net/dgrs.c @@ -274,7 +274,7 @@ check_board_dma(struct net_device *dev0) ulong x; /* - * If Space.c says not to use DMA, or if its not a PLX based + * If Space.c says not to use DMA, or if it's not a PLX based * PCI board, or if the expansion ROM space is not PCI * configured, then return false. */ @@ -331,10 +331,10 @@ check_board_dma(struct net_device *dev0) * Initiate DMA using PLX part on PCI board. Spin the * processor until completed. All addresses are physical! * - * If pciaddr is NULL, then its a chaining DMA, and lcladdr is + * If pciaddr is NULL, then it's a chaining DMA, and lcladdr is * the address of the first DMA descriptor in the chain. * - * If pciaddr is not NULL, then its a single DMA. + * If pciaddr is not NULL, then it's a single DMA. * * In either case, "lcladdr" must have been fixed up to make * sure the MSB isn't set using the S2DMA macro before passing @@ -511,7 +511,7 @@ again: if (priv0->use_dma && priv0->dmadesc_h && len > 64) { /* - * If we can use DMA and its a long frame, copy it using + * If we can use DMA and it's a long frame, copy it using * DMA chaining. */ DMACHAIN *ddp_h; /* Host virtual DMA desc. pointer */ @@ -583,7 +583,7 @@ again: else if (priv0->use_dma) { /* - * If we can use DMA and its a shorter frame, copy it + * If we can use DMA and it's a shorter frame, copy it * using single DMA transfers. */ uchar *phys_p; diff --git a/drivers/net/e100/e100_config.c b/drivers/net/e100/e100_config.c index 3cd58243ebd8..bff330628916 100644 --- a/drivers/net/e100/e100_config.c +++ b/drivers/net/e100/e100_config.c @@ -149,7 +149,7 @@ e100_config_init_82550(struct e100_private *bdp) * 32 from the RFD base address, instead of at offset 16. */ bdp->config[7] |= CB_CFIG_EXTENDED_RFD; - /* put the chip into D102 receive mode. This is neccessary + /* put the chip into D102 receive mode. This is necessary * for any parsing and offloading features. */ bdp->config[22] = CB_CFIG_RECEIVE_GAMLA_MODE; diff --git a/drivers/net/e100/e100_eeprom.c b/drivers/net/e100/e100_eeprom.c index 708ed8647b6c..c5618c1a2ca4 100644 --- a/drivers/net/e100/e100_eeprom.c +++ b/drivers/net/e100/e100_eeprom.c @@ -138,7 +138,7 @@ eeprom_reset_semaphore(struct e100_private *adapter) // is then passed to the read/write functions. // // Returns: -// Size of the eeprom, or zero if an error occured +// Size of the eeprom, or zero if an error occurred //---------------------------------------------------------------------------------------- u16 e100_eeprom_size(struct e100_private *adapter) diff --git a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c index cec594bd7d0c..08c7df15f2d3 100644 --- a/drivers/net/e100/e100_main.c +++ b/drivers/net/e100/e100_main.c @@ -1949,7 +1949,7 @@ e100_rx_srv(struct e100_private *bdp) /* to allow manipulation with current skb we need to unlink it */ list_del(&(rx_struct->list_elem)); - /* do not free & unmap badly recieved packet. + /* do not free & unmap badly received packet. * move it to the end of skb list for reuse */ if (!(rfd_status & RFD_STATUS_OK)) { e100_add_skb_to_end(bdp, rx_struct); @@ -2236,7 +2236,7 @@ e100_start_cu(struct e100_private *bdp, tcb_t *tcb) spin_lock_irqsave(&(bdp->bd_lock), lock_flag); switch (bdp->next_cu_cmd) { case RESUME_NO_WAIT: - /*last cu command was a CU_RESMUE if this is a 558 or newer we dont need to + /*last cu command was a CU_RESMUE if this is a 558 or newer we don't need to * wait for command word to clear, we reach here only if we are bachlor */ e100_exec_cmd(bdp, SCB_CUC_RESUME); diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c index e9ff7b327fa2..3977ed08f27b 100644 --- a/drivers/net/e2100.c +++ b/drivers/net/e2100.c @@ -389,7 +389,7 @@ MODULE_PARM(xcvr, "1-" __MODULE_STRING(MAX_E21_CARDS) "i"); MODULE_PARM_DESC(io, "I/O base address(es)"); MODULE_PARM_DESC(irq, "IRQ number(s)"); MODULE_PARM_DESC(mem, " memory base address(es)"); -MODULE_PARM_DESC(xcvr, "tranceiver(s) (0=internal, 1=external)"); +MODULE_PARM_DESC(xcvr, "transceiver(s) (0=internal, 1=external)"); MODULE_DESCRIPTION("Cabletron E2100 ISA ethernet driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index f28ff3b571c0..4ae5522a9835 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -148,7 +148,7 @@ MODULE_PARM(rx_copybreak, "i"); MODULE_PARM(max_interrupt_work, "i"); MODULE_PARM(multicast_filter_limit, "i"); MODULE_PARM_DESC(debug, "debug level (0-6)"); -MODULE_PARM_DESC(options, "Bits 0-3: tranceiver type, bit 4: full duplex, bit 5: 100Mbps"); +MODULE_PARM_DESC(options, "Bits 0-3: transceiver type, bit 4: full duplex, bit 5: 100Mbps"); MODULE_PARM_DESC(full_duplex, "full duplex setting(s) (1)"); MODULE_PARM_DESC(congenb, "Enable congestion control (1)"); MODULE_PARM_DESC(txfifo, "Tx FIFO threshold in 4 byte units, (0-15)"); diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c index c46a48570f71..9c973bfb4710 100644 --- a/drivers/net/eth16i.c +++ b/drivers/net/eth16i.c @@ -1231,7 +1231,7 @@ static void eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs) /* Turn off all interrupts from adapter */ outw(ETH16I_INTR_OFF, ioaddr + TX_INTR_REG); - /* eth16i_tx wont be called */ + /* eth16i_tx won't be called */ spin_lock(&lp->lock); status = inw(ioaddr + TX_STATUS_REG); /* Get the status */ diff --git a/drivers/net/fc/iph5526.c b/drivers/net/fc/iph5526.c index 91bcc8df5c37..4eaa4a26299d 100644 --- a/drivers/net/fc/iph5526.c +++ b/drivers/net/fc/iph5526.c @@ -499,7 +499,7 @@ u_char *addr; fi->q.ptr_tachyon_header[i] = fi->q.ptr_tachyon_header_base + 16*i; /* Allocate memory for indices. - * Indices should be aligned on 32 byte boundries. + * Indices should be aligned on 32 byte boundaries. */ fi->q.host_ocq_cons_indx = kmalloc(2*32, GFP_KERNEL); if (fi->q.host_ocq_cons_indx == NULL){ @@ -748,7 +748,7 @@ int index, no_of_entries = 0; else if (current_IMQ_index < fi->q.imq_cons_indx) no_of_entries = IMQ_LENGTH - (fi->q.imq_cons_indx - current_IMQ_index); - /* We dont want to look at the same IMQ entry again. + /* We don't want to look at the same IMQ entry again. */ temp_imq_cons_indx = fi->q.imq_cons_indx + 1; if (no_of_entries != 0) @@ -2263,7 +2263,7 @@ u_int r_ctl = RCTL_ELS_UCTL; u_int type = TYPE_ELS | SEQUENCE_INITIATIVE | FIRST_SEQUENCE; u_int my_mtu = fi->g.my_mtu; ENTER("tx_logi"); - /* We dont want interrupted for our own logi. + /* We don't want interrupted for our own logi. * It screws up the port discovery process. */ if (d_id == fi->g.my_id) @@ -2567,7 +2567,7 @@ int count = 0; } /* Perform Port Discovery after timer expires. * We are giving time for the ADISCed nodes to respond - * so that we dont have to perform PLOGI to those whose + * so that we don't have to perform PLOGI to those whose * login are _still_ valid. */ fi->explore_timer.function = port_discovery_timer; @@ -3527,7 +3527,7 @@ u_int s_id; /* There might be some new nodes to be * discovered. But, some of the earlier * requests as a result of the RSCN might be - * in progress. We dont want to duplicate that + * in progress. We don't want to duplicate that * effort. So letz call SCR after a lag. */ fi->explore_timer.function = scr_timer; diff --git a/drivers/net/fc/tach_structs.h b/drivers/net/fc/tach_structs.h index ef7ecd7dce8c..f59a3d0e84d7 100644 --- a/drivers/net/fc/tach_structs.h +++ b/drivers/net/fc/tach_structs.h @@ -248,7 +248,7 @@ struct globals { volatile u_char n_port_try; volatile u_char nport_timer_set; volatile u_char lport_timer_set; - /* Hmmm... We dont want to Initialize while closing */ + /* Hmmm... We don't want to Initialize while closing */ u_char dont_init; u_int my_node_name_high; u_int my_node_name_low; diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 0fd6b99eabe4..539e9d434d10 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -828,7 +828,7 @@ static phy_info_t phy_info_lxt970 = { /* * I had some nice ideas of running the MDIO faster... * The 971 should support 8MHz and I tried it, but things acted really - * wierd, so 2.5 MHz ought to be enough for anyone... + * weird, so 2.5 MHz ought to be enough for anyone... */ static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev) diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 1b05e18e1a12..64e247a7338f 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c @@ -316,7 +316,7 @@ V. Recent Changes the new buffer or the function returns non-zero which should case the scheduler to reschedule the buffer later. -01/15/1999 EPK Some adjustments were made to the chip intialization. +01/15/1999 EPK Some adjustments were made to the chip initialization. End-to-end flow control should now be fully active and the interrupt algorithm vars have been changed. These could probably use further tuning. diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index e937514b7ccd..c9e486c3d7d7 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c @@ -2811,7 +2811,7 @@ static int hp100_login_to_vg_hub(struct net_device *dev, u_short force_relogin) printk("hp100: %s: Problem logging into the HUB.\n", dev->name); if (lp->chip == HP100_CHIPID_LASSEN) { /* Check allowed Register to find out why there is a problem. */ - val = hp100_inw(TRAIN_ALLOW); /* wont work on non-ETR card */ + val = hp100_inw(TRAIN_ALLOW); /* won't work on non-ETR card */ #ifdef HP100_DEBUG_TRAINING printk("hp100: %s: MAC Configuration requested: 0x%04x, HUB allowed: 0x%04x\n", dev->name, hp100_inw(TRAIN_REQUEST), val); #endif @@ -2868,7 +2868,7 @@ static void hp100_cascade_reset(struct net_device *dev, u_short enable) hp100_andb(~HP100_PCI_RESET, PCICTRL2); hp100_orb(HP100_PCI_RESET, PCICTRL2); /* Wait for min. 300 ns */ - /* we cant use jiffies here, because it may be */ + /* we can't use jiffies here, because it may be */ /* that we have disabled the timer... */ udelay(400); hp100_andb(~HP100_PCI_RESET, PCICTRL2); diff --git a/drivers/net/irda/actisys-sir.c b/drivers/net/irda/actisys-sir.c index 530b33830050..b5a171db8e53 100644 --- a/drivers/net/irda/actisys-sir.c +++ b/drivers/net/irda/actisys-sir.c @@ -207,7 +207,7 @@ static int actisys_change_speed(struct sir_dev *dev, unsigned speed) * o second put the dongle in a know state * * The dongle is powered of the RTS and DTR lines. In the dongle, there - * is a big capacitor to accomodate the current spikes. This capacitor + * is a big capacitor to accommodate the current spikes. This capacitor * takes a least 50 ms to be charged. In theory, the Bios set those lines * up, so by the time we arrive here we should be set. It doesn't hurt * to be on the conservative side, so we will wait... diff --git a/drivers/net/irda/actisys.c b/drivers/net/irda/actisys.c index dfa05c9d6974..7c27c160e307 100644 --- a/drivers/net/irda/actisys.c +++ b/drivers/net/irda/actisys.c @@ -217,7 +217,7 @@ static int actisys_change_speed(struct irda_task *task) * o second put the dongle in a know state * * The dongle is powered of the RTS and DTR lines. In the dongle, there - * is a big capacitor to accomodate the current spikes. This capacitor + * is a big capacitor to accommodate the current spikes. This capacitor * takes a least 50 ms to be charged. In theory, the Bios set those lines * up, so by the time we arrive here we should be set. It doesn't hurt * to be on the conservative side, so we will wait... diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index c42db630930d..5ef44cfe3da4 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c @@ -120,7 +120,7 @@ static struct net_device_stats *irda_usb_net_get_stats(struct net_device *dev); /************************ TRANSMIT ROUTINES ************************/ /* * Receive packets from the IrDA stack and send them on the USB pipe. - * Handle speed change, timeout and lot's of uglyness... + * Handle speed change, timeout and lot's of ugliness... */ /*------------------------------------------------------------------*/ diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index 21160eb0e671..3049b0f6e74f 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c @@ -532,7 +532,7 @@ static int irtty_open(struct tty_struct *tty) tty->driver.flush_buffer(tty); /* from old irtty - but what is it good for? - * we _are_ the ldisc and we _dont_ implement flush_buffer! + * we _are_ the ldisc and we _don't_ implement flush_buffer! * * if (tty->ldisc.flush_buffer) * tty->ldisc.flush_buffer(tty); diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index 09823085fa2d..e14b8d2bbf60 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c @@ -569,7 +569,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n /* instead of adding tests to protect against drv->do_write==NULL * at several places we refuse to create a sir_dev instance for - * drivers which dont implement do_write. + * drivers which don't implement do_write. */ if (!drv || !drv->do_write) return NULL; diff --git a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c index cf292968b241..293c05c27cd0 100644 --- a/drivers/net/irda/sir_kthread.c +++ b/drivers/net/irda/sir_kthread.c @@ -151,7 +151,7 @@ static int irda_thread(void *startup) while (irda_rq_queue.thread != NULL) { - set_task_state(current, TASK_UNINTERRUPTIBLE); + set_task_state(current, TASK_INTERRUPTIBLE); add_wait_queue(&irda_rq_queue.kick, &wait); if (list_empty(&irda_rq_queue.request_list)) schedule(); diff --git a/drivers/net/ne.c b/drivers/net/ne.c index a165a94d7bd9..7884fd7479ee 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c @@ -205,7 +205,7 @@ static int __init ne_probe_isapnp(struct net_device *dev) /* Avoid already found cards from previous calls */ if (pnp_device_attach(idev) < 0) continue; - if (pnp_activate_dev(idev, NULL) < 0) { + if (pnp_activate_dev(idev) < 0) { pnp_device_detach(idev); continue; } diff --git a/drivers/net/pcmcia/Kconfig b/drivers/net/pcmcia/Kconfig index 6694fadeaae6..53c5dc6afaa8 100644 --- a/drivers/net/pcmcia/Kconfig +++ b/drivers/net/pcmcia/Kconfig @@ -153,19 +153,5 @@ config PCMCIA_IBMTR The module will be called ibmtr_cs. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. -config AIRONET4500_CS - tristate "Aironet 4500/4800 PCMCIA support" - depends on NET_PCMCIA_RADIO && AIRONET4500 && PCMCIA - help - Say Y here if you have a PCMCIA Aironet 4500/4800 card which you - want to use with the standard PCMCIA cardservices provided by the - pcmcia-cs package. - - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called aironet4500_cs. If you want to - compile it as a module, say M here and read - <file:Documentation/modules.txt>. - endmenu diff --git a/drivers/net/pcmcia/Makefile b/drivers/net/pcmcia/Makefile index 50457c8a41cd..87d2d99f4c14 100644 --- a/drivers/net/pcmcia/Makefile +++ b/drivers/net/pcmcia/Makefile @@ -13,7 +13,4 @@ obj-$(CONFIG_PCMCIA_XIRC2PS) += xirc2ps_cs.o obj-$(CONFIG_ARCNET_COM20020_CS)+= com20020_cs.o obj-$(CONFIG_PCMCIA_AXNET) += axnet_cs.o -# 16-bit wireless client drivers -obj-$(CONFIG_AIRONET4500_CS) += aironet4500_cs.o - obj-$(CONFIG_PCMCIA_IBMTR) += ibmtr_cs.o diff --git a/drivers/net/pcmcia/aironet4500_cs.c b/drivers/net/pcmcia/aironet4500_cs.c deleted file mode 100644 index 9ae3ae026278..000000000000 --- a/drivers/net/pcmcia/aironet4500_cs.c +++ /dev/null @@ -1,706 +0,0 @@ -/* - * Aironet 4500 Pcmcia driver - * - * Elmer Joandi, Januar 1999 - * Copyright Elmer Joandi, all rights restricted - * - * - * Revision 0.1 ,started 30.12.1998 - * - * - */ - -#define DRV_NAME "aironet4500_cs" -#define DRV_VERSION "0.1" - -static const char *awc_version = -DRV_NAME ".c v" DRV_VERSION " 1/1/99 Elmer Joandi, elmer@ylenurme.ee.\n"; - - -#include <linux/module.h> -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/ptrace.h> -#include <linux/slab.h> -#include <linux/string.h> -#include <linux/timer.h> -#include <linux/interrupt.h> -#include <linux/in.h> -#include <linux/ethtool.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/skbuff.h> -#include <linux/if_arp.h> -#include <linux/ioport.h> - -#include <pcmcia/version.h> -#include <pcmcia/cs_types.h> -#include <pcmcia/cs.h> -#include <pcmcia/cistpl.h> -#include <pcmcia/cisreg.h> -#include <pcmcia/ciscode.h> -#include <pcmcia/ds.h> - -#include <asm/uaccess.h> -#include <asm/io.h> -#include <asm/system.h> -#include <asm/bitops.h> - -#include "../aironet4500.h" - -static u_int irq_mask = 0x5eF8; -static int awc_ports[] = {0x140,0x100,0xc0, 0x80 }; -#if LINUX_VERSION_CODE > 0x20100 -MODULE_PARM(irq_mask, "i"); - -#endif - - -#define RUN_AT(x) (jiffies+(x)) - -#ifdef PCMCIA_DEBUG -static int pc_debug = PCMCIA_DEBUG; -MODULE_PARM(pc_debug, "i"); -#define PC_DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version = -"aironet4500_cs.c v0.1 1/1/99 Elmer Joandi, elmer@ylenurme.ee.\n"; -#else -#define PC_DEBUG(n, args...) -#endif - -/* Index of functions. */ - -static dev_info_t dev_info = "aironet4500_cs"; - -static dev_link_t *awc_attach(void); -static void awc_detach(dev_link_t *); -static void awc_release(u_long arg); -static int awc_event(event_t event, int priority, - event_callback_args_t *args); - -static dev_link_t *dev_list; - -static void cs_error(client_handle_t handle, int func, int ret) -{ -#if CS_RELEASE_CODE < 0x2911 - CardServices(ReportError, dev_info, (void *)func, (void *)ret); -#else - error_info_t err = { func, ret }; - CardServices(ReportError, handle, &err); -#endif -} - -#define CFG_CHECK(fn, args...) if (CardServices(fn, args) != 0) goto next_entry - -static void flush_stale_links(void) -{ - dev_link_t *link, *next; - for (link = dev_list; link; link = next) { - next = link->next; - if (link->state & DEV_STALE_LINK) - awc_detach(link); - } -} - - -/* - We never need to do anything when a awc device is "initialized" - by the net software, because we only register already-found cards. -*/ - -static int awc_pcmcia_init(struct net_device *dev) -{ - return awc_init(dev); - -} - -static int awc_pcmcia_open(struct net_device *dev) -{ - dev_link_t *link; - int status; - - for (link = dev_list; link; link = link->next) - if (link->priv == dev) break; - if (!DEV_OK(link)) - return -ENODEV; - - status = awc_open(dev); - - if (!status ) - link->open++; - - return status; -} - -static int awc_pcmcia_close(struct net_device *dev) -{ -// int ioaddr = dev->base_addr; - dev_link_t *link; - int ret; - - for (link = dev_list; link; link = link->next) - if (link->priv == dev) break; - if (link == NULL) - return -ENODEV; - - PC_DEBUG(2, "%s: closing device.\n", dev->name); - - link->open--; - ret = awc_close(dev); - - if (link->state & DEV_STALE_CONFIG) { - link->release.expires = RUN_AT( HZ/20 ); - link->state |= DEV_RELEASE_PENDING; - add_timer(&link->release); - } - return ret; -} - -static int netdev_ethtool_ioctl (struct net_device *dev, void *useraddr) -{ - u32 ethcmd; - - /* dev_ioctl() in ../../net/core/dev.c has already checked - capable(CAP_NET_ADMIN), so don't bother with that here. */ - - if (get_user(ethcmd, (u32 *)useraddr)) - return -EFAULT; - - switch (ethcmd) { - - case ETHTOOL_GDRVINFO: { - struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; - strcpy (info.driver, DRV_NAME); - strcpy (info.version, DRV_VERSION); - sprintf(info.bus_info, "PCMCIA 0x%lx", dev->base_addr); - if (copy_to_user (useraddr, &info, sizeof (info))) - return -EFAULT; - return 0; - } - -#ifdef PCMCIA_DEBUG - /* get message-level */ - case ETHTOOL_GMSGLVL: { - struct ethtool_value edata = {ETHTOOL_GMSGLVL}; - edata.data = pc_debug; - if (copy_to_user(useraddr, &edata, sizeof(edata))) - return -EFAULT; - return 0; - } - /* set message-level */ - case ETHTOOL_SMSGLVL: { - struct ethtool_value edata; - if (copy_from_user(&edata, useraddr, sizeof(edata))) - return -EFAULT; - pc_debug = edata.data; - return 0; - } -#endif - - default: - break; - } - - return -EOPNOTSUPP; -} - -static int awc_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - switch (cmd) { - case SIOCETHTOOL: - return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data); - - default: - return -EOPNOTSUPP; - } - return 0; -} - -/* - awc_attach() creates an "instance" of the driver, allocating - local data structures for one device. The device is registered - with Card Services. -*/ - -static dev_link_t *awc_attach(void) -{ - client_reg_t client_reg; - dev_link_t *link = NULL; - struct net_device *dev = NULL; - int ret; - - PC_DEBUG(0, "awc_attach()\n"); - flush_stale_links(); - - /* Create the PC card device object. */ - link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL); - if (!link) - return NULL; - memset(link, 0, sizeof(struct dev_link_t)); - - link->dev = kmalloc(sizeof(struct dev_node_t), GFP_KERNEL); - if (!link->dev) { - kfree(link); - return NULL; - } - - memset(link->dev, 0, sizeof(struct dev_node_t)); - - init_timer(&link->release); - link->release.function = &awc_release; - link->release.data = (u_long)link; -// link->io.NumPorts1 = 32; - link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; -// link->io.IOAddrLines = 5; - link->irq.Attributes = IRQ_HANDLE_PRESENT ; // |IRQ_TYPE_EXCLUSIVE ; - link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID; - link->irq.IRQInfo2 = irq_mask; - link->irq.Handler = &awc_interrupt; - link->conf.Attributes = CONF_ENABLE_IRQ; - link->conf.Vcc = 50; - link->conf.IntType = INT_MEMORY_AND_IO; - link->conf.ConfigIndex = 1; - link->conf.Present = PRESENT_OPTION; - - /* Create the network device object. */ - - dev = kmalloc(sizeof(struct net_device ), GFP_KERNEL); -// dev = init_etherdev(0, sizeof(struct awc_private) ); - if (!dev ) { - printk(KERN_CRIT "out of mem on dev alloc \n"); - kfree(link->dev); - kfree(link); - return NULL; - }; - memset(dev,0,sizeof(struct net_device)); - dev->priv = kmalloc(sizeof(struct awc_private), GFP_KERNEL); - if (!dev->priv ) {printk(KERN_CRIT "out of mem on dev priv alloc \n"); return NULL;}; - memset(dev->priv,0,sizeof(struct awc_private)); - -// link->dev->minor = dev->minor; -// link->dev->major = dev->major; - - /* The 4500-specific entries in the device structure. */ - -// dev->tx_queue_len = tx_queue_len; - - dev->hard_start_xmit = &awc_start_xmit; -// dev->set_config = &awc_config_misiganes,aga mitte awc_config; - dev->get_stats = &awc_get_stats; -// dev->set_multicast_list = &awc_set_multicast_list; - dev->do_ioctl = &awc_ioctl; - - strcpy(dev->name, ((struct awc_private *)dev->priv)->node.dev_name); - - ether_setup(dev); - - dev->init = &awc_pcmcia_init; - dev->open = &awc_pcmcia_open; - dev->stop = &awc_pcmcia_close; - - link->priv = dev; -#if CS_RELEASE_CODE > 0x2911 - link->irq.Instance = dev; -#endif - - /* Register with Card Services */ - link->next = dev_list; - dev_list = link; - - - client_reg.dev_info = &dev_info; - client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; - client_reg.EventMask = - CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | - CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | - CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; - client_reg.event_handler = &awc_event; - client_reg.Version = 0x0210; - client_reg.event_callback_args.client_data = link; - ret = CardServices(RegisterClient, &link->handle, &client_reg); - if (ret != 0) { - cs_error(link->handle, RegisterClient, ret); - awc_detach(link); - return NULL; - } - - return link; -} /* awc_attach */ - -/* - - This deletes a driver "instance". The device is de-registered - with Card Services. If it has been released, all local data - structures are freed. Otherwise, the structures will be freed - when the device is released. - -*/ - -static void awc_detach(dev_link_t *link) -{ - dev_link_t **linkp; - unsigned long flags; - int i=0; - - DEBUG(0, "awc_detach(0x%p)\n", link); - - /* Locate device structure */ - for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) - if (*linkp == link) break; - if (*linkp == NULL) - return; - - save_flags(flags); - cli(); - if (link->state & DEV_RELEASE_PENDING) { - del_timer(&link->release); - link->state &= ~DEV_RELEASE_PENDING; - } - restore_flags(flags); - - if (link->state & DEV_CONFIG) { - awc_release((u_long)link); - if (link->state & DEV_STALE_CONFIG) { - link->state |= DEV_STALE_LINK; - return; - } - } - - if (link->handle) - CardServices(DeregisterClient, link->handle); - - /* Unlink device structure, free bits */ - *linkp = link->next; - - i=0; - while ( i < MAX_AWCS) { - if (!aironet4500_devices[i]) - {i++; continue;} - if (aironet4500_devices[i] == link->priv){ - if (awc_proc_unset_fun) - awc_proc_unset_fun(i); - - aironet4500_devices[i]=0; - } - i++; - } - - if (link->priv) { - //struct net_device *dev = link->priv; - // dam dam damn mif (dev->priv) - // kfree(dev->priv); - kfree(link->priv); - } - kfree(link->dev); - kfree(link); - -} /* awc_detach */ - -/* - - awc_pcmcia_config() is scheduled to run after a CARD_INSERTION event - is received, to configure the PCMCIA socket, and to make the - ethernet device available to the system. - -*/ - -#define CS_CHECK(fn, args...) \ -while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed - -static void awc_pcmcia_config(dev_link_t *link) -{ - client_handle_t handle; - struct net_device *dev; - struct awc_private *lp; - tuple_t tuple; - int ii; - cisparse_t parse; - u_short buf[64]; - int last_fn, last_ret, i = 0; -// int ioaddr; - u16 *phys_addr; - int retval; - - handle = link->handle; - dev = link->priv; - phys_addr = (u16 *)dev->dev_addr; - - PC_DEBUG(0, "awc_pcmcia_config(0x%p)\n", link); - - tuple.Attributes = 0; - tuple.DesiredTuple = CISTPL_CONFIG; - CS_CHECK(GetFirstTuple, handle, &tuple); - tuple.TupleData = (cisdata_t *)buf; - tuple.TupleDataMax = 64; - tuple.TupleOffset = 0; - CS_CHECK(GetTupleData, handle, &tuple); - CS_CHECK(ParseTuple, handle, &tuple, &parse); - link->conf.ConfigBase = parse.config.base; - link->conf.Present = parse.config.rmask[0]; - - - /* Configure card */ - link->state |= DEV_CONFIG; - - tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; - CS_CHECK(GetFirstTuple, handle, &tuple); - - while (1) { - cistpl_cftable_entry_t dflt = { 0 }; - cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); - CFG_CHECK(GetTupleData, handle, &tuple); - CFG_CHECK(ParseTuple, handle, &tuple, &parse); - - if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; - if (cfg->index == 0) goto next_entry; - link->conf.ConfigIndex = cfg->index; - - /* Use power settings for Vcc and Vpp if present */ - /* Note that the CIS values need to be rescaled */ - if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) - link->conf.Vcc = cfg->vcc.param[CISTPL_POWER_VNOM]/10000; - else if (dflt.vcc.present & (1<<CISTPL_POWER_VNOM)) - link->conf.Vcc = dflt.vcc.param[CISTPL_POWER_VNOM]/10000; - - if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM)) - link->conf.Vpp1 = link->conf.Vpp2 = - cfg->vpp1.param[CISTPL_POWER_VNOM]/10000; - else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM)) - link->conf.Vpp1 = link->conf.Vpp2 = - dflt.vpp1.param[CISTPL_POWER_VNOM]/10000; - - /* Do we need to allocate an interrupt? */ - if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) - link->conf.Attributes |= CONF_ENABLE_IRQ; - - /* IO window settings */ - link->io.NumPorts1 = link->io.NumPorts2 = 0; - if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { - cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; - link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; - if (!(io->flags & CISTPL_IO_8BIT)) - link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; - if (!(io->flags & CISTPL_IO_16BIT)) { - - link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; - printk(KERN_CRIT "8-bit IO not supported on this aironet 4500 driver \n"); - } - link->io.BasePort1 = io->win[0].base; - - link->io.NumPorts1 = io->win[0].len; - if (io->nwin > 1) { - link->io.Attributes2 = link->io.Attributes1; - link->io.BasePort2 = io->win[1].base; - link->io.NumPorts2 = io->win[1].len; - } - } - ii = 0; - last_fn = RequestIO; - while ((last_ret = CardServices(RequestIO, link->handle, &link->io)) ){ - - if (ii > 4) - goto cs_failed; - link->io.BasePort1 = awc_ports[ii]; - ii++; - }; - - - break; - - next_entry: - if (CardServices(GetNextTuple, handle, &tuple)) - break; - } - - if (link->conf.Attributes & CONF_ENABLE_IRQ){ - - ii = 0; last_fn = RequestIRQ; - while ((last_ret = CardServices(RequestIRQ, link->handle, &link->irq)) ){ - - ii++; - while (!(irq_mask & (1 << ii) ) && ii < 15) - ii++; - link->irq.IRQInfo2 = 1 << ii; - - if(ii > 15) - goto cs_failed; - printk("trying irq %d , mask %x \n",ii, link->irq.IRQInfo2); - - }; - } - - CS_CHECK(RequestConfiguration, link->handle, &link->conf); - - - dev->irq = link->irq.AssignedIRQ; - dev->base_addr = link->io.BasePort1; - - - awc_private_init( dev); - - - - retval = register_netdev(dev); - if (retval != 0) { - printk(KERN_NOTICE "awc_cs: register_netdev() failed for dev %x retval %x\n",(unsigned int)dev,retval); - goto failed; - } - - if(awc_pcmcia_init(dev)) goto failed; - - i=0; - while (aironet4500_devices[i] && i < MAX_AWCS-1) i++; - if (!aironet4500_devices[i]){ - aironet4500_devices[i]=dev; - if (awc_proc_set_fun) - awc_proc_set_fun(i); - } - - - link->state &= ~DEV_CONFIG_PENDING; - - lp = (struct awc_private *)dev->priv; - - DEBUG(1,"pcmcia config complete on port %x \n",(unsigned int)dev->base_addr); - - return; - -cs_failed: - cs_error(link->handle, last_fn, last_ret); - link->dev=NULL; -failed: - - awc_release((u_long)link); - return; - -} /* awc_pcmcia_config */ - -/* - After a card is removed, awc_release() will unregister the net - device, and release the PCMCIA configuration. If the device is - still open, this will be postponed until it is closed. - -*/ - -static void awc_release(u_long arg) -{ - dev_link_t *link = (dev_link_t *)arg; - struct net_device *dev = link->priv; - - DEBUG(0, "awc_release(0x%p)\n", link); - - if (link->open) { - DEBUG(1, "awc_cs: release postponed, '%s' still open\n", - link->dev->dev_name); - link->state |= DEV_STALE_CONFIG; - return; - } - - CardServices(ReleaseConfiguration, link->handle); - CardServices(ReleaseIO, link->handle, &link->io); - CardServices(ReleaseIRQ, link->handle, &link->irq); - - CardServices(ReleaseWindow, link->win); - if (link->dev) - unregister_netdev(dev); - // link->dev = NULL; - - link->state &= ~DEV_CONFIG; - if (link->state & DEV_STALE_LINK) - awc_detach(link); - -} /* awc_release */ - -/* - - The card status event handler. Mostly, this schedules other - stuff to run after an event is received. A CARD_REMOVAL event - also sets some flags to discourage the net drivers from trying - to talk to the card any more. -*/ - -static int awc_event(event_t event, int priority, - event_callback_args_t *args) -{ - dev_link_t *link = args->client_data; - struct net_device *dev = link->priv; - - PC_DEBUG(1, "awc_event(0x%06x)\n", event); - - switch (event) { - case CS_EVENT_CARD_REMOVAL: - link->state &= ~DEV_PRESENT; - if (link->state & DEV_CONFIG) { - netif_device_detach(dev); - link->release.expires = RUN_AT( HZ/20 ); - add_timer(&link->release); - } - break; - case CS_EVENT_CARD_INSERTION: - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; - awc_pcmcia_config(link); - break; - case CS_EVENT_PM_SUSPEND: - link->state |= DEV_SUSPEND; - /* Fall through... */ - case CS_EVENT_RESET_PHYSICAL: - if (link->state & DEV_CONFIG) { - if (link->open) - netif_device_detach(dev); - - CardServices(ReleaseConfiguration, link->handle); - } - break; - case CS_EVENT_PM_RESUME: - link->state &= ~DEV_SUSPEND; - /* Fall through... */ - case CS_EVENT_CARD_RESET: - if (link->state & DEV_CONFIG) { - CardServices(RequestConfiguration, link->handle, &link->conf); - if (link->open) { - // awc_reset(dev); - netif_device_attach(dev); - } - } - break; - } - return 0; -} /* awc_event */ - - - -static int __init aironet_cs_init(void) -{ - servinfo_t serv; - - /* Always emit the version, before any failure. */ - printk(KERN_INFO"%s", awc_version); - PC_DEBUG(0, "%s\n", version); - CardServices(GetCardServicesInfo, &serv); - if (serv.Revision != CS_RELEASE_CODE) { - printk(KERN_NOTICE "awc_cs: Card Services release " - "does not match!\n"); - return -1; - } - register_pcmcia_driver(&dev_info, &awc_attach, &awc_detach); - return 0; -} - -static void __exit aironet_cs_exit(void) -{ - DEBUG(0, "awc_cs: unloading %c ",'\n'); - unregister_pcmcia_driver(&dev_info); - - while (dev_list != NULL) { - if (dev_list->state & DEV_CONFIG) - awc_release((u_long)dev_list); - awc_detach(dev_list); - } - -// while (dev_list != NULL) -// awc_detach(dev_list); -} - -module_init(aironet_cs_init); -module_exit(aironet_cs_exit); -MODULE_LICENSE("GPL"); diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 5a89478b13d9..36d9b30b2bd2 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c @@ -1226,7 +1226,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) /* Mask interrupts from the ethercard. SMP: We have to grab the lock here otherwise the IRQ handler on another CPU can flip window and race the IRQ mask set. We end - up trashing the mcast filter not disabling irqs if we dont lock */ + up trashing the mcast filter not disabling irqs if we don't lock */ spin_lock_irqsave(&ei_local->page_lock, flags); outb_p(0x00, e8390_base + EN0_IMR); @@ -1341,7 +1341,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) * Handle the ether interface interrupts. We pull packets from * the 8390 via the card specific functions and fire them at the networking * stack. We also handle transmit completions and wake the transmit path if - * neccessary. We also update the counters and do other housekeeping as + * necessary. We also update the counters and do other housekeeping as * needed. */ diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 6886831b76b6..662f966802b4 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c @@ -292,7 +292,7 @@ static void pppoe_flush_dev(struct net_device *dev) /* Now restart from the beginning of this * hash chain. We always NULL out pppoe_dev - * so we are guarenteed to make forward + * so we are guaranteed to make forward * progress. */ po = item_hash_table[hash]; diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c index 6f1e1dd56ff1..5bd2a9588b1f 100644 --- a/drivers/net/sb1000.c +++ b/drivers/net/sb1000.c @@ -170,7 +170,7 @@ sb1000_probe(struct net_device *dev) if (pnp_device_attach(idev) < 0) continue; - if (pnp_activate_dev(idev, NULL) < 0) { + if (pnp_activate_dev(idev) < 0) { __again: pnp_device_detach(idev); continue; diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 43452d32bbb6..e641e8c0a87d 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c @@ -512,7 +512,7 @@ static void sbmac_mii_senddata(struct sbmac_softc *s,unsigned int data, int bitc * regidx = index of register to read * * Return value: - * value read, or 0 if an error occured. + * value read, or 0 if an error occurred. ********************************************************************* */ static unsigned int sbmac_mii_read(struct sbmac_softc *s,int phyaddr,int regidx) @@ -554,7 +554,7 @@ static unsigned int sbmac_mii_read(struct sbmac_softc *s,int phyaddr,int regidx) SBMAC_WRITECSR(s->sbm_mdio,M_MAC_MDIO_DIR_INPUT); /* - * If an error occured, the PHY will signal '1' back + * If an error occurred, the PHY will signal '1' back */ error = SBMAC_READCSR(s->sbm_mdio) & M_MAC_MDIO_IN; diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index c1596c4fa593..97166e223db4 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c @@ -1971,7 +1971,7 @@ static int sis900_set_config(struct net_device *dev, struct ifmap *map) status = mdio_read(dev, mii_phy->phy_addr, MII_CONTROL); /* enable auto negotiation and reset the negotioation - (I dont really know what the auto negatiotiation reset + (I don't really know what the auto negatiotiation reset really means, but it sounds for me right to do one here)*/ mdio_write(dev, mii_phy->phy_addr, MII_CONTROL, status | MII_CNTL_AUTO | MII_CNTL_RST_AUTO); diff --git a/drivers/net/sk98lin/h/lm80.h b/drivers/net/sk98lin/h/lm80.h index 0e165bb0bd00..8ac65aba36ed 100644 --- a/drivers/net/sk98lin/h/lm80.h +++ b/drivers/net/sk98lin/h/lm80.h @@ -126,7 +126,7 @@ extern "C" { #define LM80_IS_BTI (1<<1) /* state of BTI# pin */ #define LM80_IS_FAN1 (1<<2) /* count limit exceeded for Fan 1 */ #define LM80_IS_FAN2 (1<<3) /* count limit exceeded for Fan 2 */ -#define LM80_IS_CI (1<<4) /* Chassis Intrusion occured */ +#define LM80_IS_CI (1<<4) /* Chassis Intrusion occurred */ #define LM80_IS_OS (1<<5) /* OS temperature limit exceeded */ /* bit 6 and 7 are reserved in LM80_ISRC_2 */ #define LM80_IS_HT_IRQ_MD (1<<6) /* Hot temperature interrupt mode */ diff --git a/drivers/net/sk98lin/h/skdrv1st.h b/drivers/net/sk98lin/h/skdrv1st.h index 4f8e30868e9f..f055f98fa379 100644 --- a/drivers/net/sk98lin/h/skdrv1st.h +++ b/drivers/net/sk98lin/h/skdrv1st.h @@ -72,7 +72,7 @@ * Description: * * This is the first include file of the driver, which includes all - * neccessary system header files and some of the GEnesis header files. + * necessary system header files and some of the GEnesis header files. * It also defines some basic items. * * Include File Hierarchy: diff --git a/drivers/net/sk98lin/h/skdrv2nd.h b/drivers/net/sk98lin/h/skdrv2nd.h index 97f24392a949..e524a4686108 100644 --- a/drivers/net/sk98lin/h/skdrv2nd.h +++ b/drivers/net/sk98lin/h/skdrv2nd.h @@ -85,7 +85,7 @@ * Description: * * This is the second include file of the driver, which includes all other - * neccessary files and defines all structures and constants used by the + * necessary files and defines all structures and constants used by the * driver and the common modules. * * Include File Hierarchy: diff --git a/drivers/net/sk98lin/h/xmac_ii.h b/drivers/net/sk98lin/h/xmac_ii.h index 0044a053a8b7..2d5b1fe4d40d 100644 --- a/drivers/net/sk98lin/h/xmac_ii.h +++ b/drivers/net/sk98lin/h/xmac_ii.h @@ -279,7 +279,7 @@ extern "C" { * XMAC Bit Definitions * * If the bit access behaviour differs from the register access behaviour - * (r/w, ro) this is docomented after the bit number. The following bit + * (r/w, ro) this is documented after the bit number. The following bit * access behaviours are used: * (sc) self clearing * (ro) read only @@ -413,7 +413,7 @@ extern "C" { #define XM_ST_BC (1L<<7) /* Bit 7: Broadcast packet */ #define XM_ST_MC (1L<<6) /* Bit 6: Multicast packet */ #define XM_ST_UC (1L<<5) /* Bit 5: Unicast packet */ -#define XM_ST_TX_UR (1L<<4) /* Bit 4: FIFO Underrun occured */ +#define XM_ST_TX_UR (1L<<4) /* Bit 4: FIFO Underrun occurred */ #define XM_ST_CS_ERR (1L<<3) /* Bit 3: Carrier Sense Error */ #define XM_ST_LAT_COL (1L<<2) /* Bit 2: Late Collision Error */ #define XM_ST_MUL_COL (1L<<1) /* Bit 1: Multiple Collisions */ diff --git a/drivers/net/sk98lin/skcsum.c b/drivers/net/sk98lin/skcsum.c index 81bcc067ce11..cf245cc07afe 100644 --- a/drivers/net/sk98lin/skcsum.c +++ b/drivers/net/sk98lin/skcsum.c @@ -195,7 +195,7 @@ static const char SysKonnectFileId[] = "@(#)" * zero.) * * Note: - * There is a bug in the ASIC whic may lead to wrong checksums. + * There is a bug in the ASIC which may lead to wrong checksums. * * Arguments: * pAc - A pointer to the adapter context struct. diff --git a/drivers/net/sk98lin/skgehwt.c b/drivers/net/sk98lin/skgehwt.c index 26a5dea873c6..65a0da869042 100644 --- a/drivers/net/sk98lin/skgehwt.c +++ b/drivers/net/sk98lin/skgehwt.c @@ -61,14 +61,14 @@ * fix: chg pAc -> pAC * * Revision 1.4 1998/08/10 14:14:52 gklug - * rmv: unneccessary SK_ADDR macro + * rmv: unnecessary SK_ADDR macro * * Revision 1.3 1998/08/07 12:53:44 gklug * fix: first compiled version * * Revision 1.2 1998/08/07 09:19:29 gklug * adapt functions to the C coding conventions - * rmv unneccessary functions. + * rmv unnecessary functions. * * Revision 1.1 1998/08/05 11:28:36 gklug * first version: adapted from SMT/FDDI diff --git a/drivers/net/sk98lin/skgepnmi.c b/drivers/net/sk98lin/skgepnmi.c index e85dcfb87e62..1adaaec44be8 100644 --- a/drivers/net/sk98lin/skgepnmi.c +++ b/drivers/net/sk98lin/skgepnmi.c @@ -236,7 +236,7 @@ * -Fixed bug for RX counters. On an RX overflow interrupt the high * words of all RX counters were incremented. * -SET operations on FLOWCTRL_MODE and LINK_MODE accept now the - * value 0, which has no effect. It is usefull for multiple instance + * value 0, which has no effect. It is useful for multiple instance * SETs. * * Revision 1.37 1998/11/20 08:02:04 mhaveman @@ -1639,7 +1639,7 @@ int Level) /* Initialization level */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed - * SK_PNMI_ERR_GENERAL A general severe internal error occured + * SK_PNMI_ERR_GENERAL A general severe internal error occurred * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to take * the data. * SK_PNMI_ERR_UNKNOWN_OID The requested OID is unknown @@ -1672,13 +1672,13 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * Description: * Calls a general sub-function for all this stuff. The preset does * the same as a set, but returns just before finally setting the - * new value. This is usefull to check if a set might be successfull. + * new value. This is useful to check if a set might be successful. * If as instance a -1 is passed, an array of values is supposed and * all instance of the OID will be set. * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -1716,13 +1716,13 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * Description: * Calls a general sub-function for all this stuff. The preset does * the same as a set, but returns just before finally setting the - * new value. This is usefull to check if a set might be successfull. + * new value. This is useful to check if a set might be successful. * If as instance a -1 is passed, an array of values is supposed and * all instance of the OID will be set. * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -1766,7 +1766,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed - * SK_PNMI_ERR_GENERAL A general severe internal error occured + * SK_PNMI_ERR_GENERAL A general severe internal error occurred * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to take * the data. * SK_PNMI_ERR_UNKNOWN_NET The requested NetIndex doesn't exist @@ -1935,7 +1935,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * Description: * Calls a general sub-function for all this set stuff. The preset does * the same as a set, but returns just before finally setting the - * new value. This is usefull to check if a set might be successfull. + * new value. This is useful to check if a set might be successful. * The sub-function runs through the IdTable, checks which OIDs are able * to set, and calls the handler function of the OID to perform the * preset. The return value of the function will also be stored in @@ -1944,7 +1944,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -1983,7 +1983,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -2934,7 +2934,7 @@ SK_U32 Id) /* Object identifier to be searched */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3002,7 +3002,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3137,7 +3137,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3280,7 +3280,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3427,7 +3427,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3639,7 +3639,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -3758,7 +3758,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -4003,7 +4003,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -4482,7 +4482,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -5189,7 +5189,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -5498,7 +5498,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -5698,7 +5698,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -6362,7 +6362,7 @@ SK_U32 NetIndex) /* NetIndex (0..n), in single net mode allways zero */ * * Returns: * SK_PNMI_ERR_OK The request was successfully performed. - * SK_PNMI_ERR_GENERAL A general severe internal error occured. + * SK_PNMI_ERR_GENERAL A general severe internal error occurred. * SK_PNMI_ERR_TOO_SHORT The passed buffer is too short to contain * the correct data (e.g. a 32bit value is * needed, but a 16 bit value was passed). @@ -6813,7 +6813,7 @@ unsigned int PhysPortIndex) /* Physical port index */ * * Description: * The COMMON module only tells us if the mode is half or full duplex. - * But in the decade of auto sensing it is usefull for the user to + * But in the decade of auto sensing it is useful for the user to * know if the mode was negotiated or forced. Therefore we have a * look to the mode, which was last used by the negotiation process. * @@ -7364,7 +7364,7 @@ SK_U32 NetIndex) * * Description: * The trap buffer stores various events. A user application somehow - * gets notified that an event occured and retrieves the trap buffer + * gets notified that an event occurred and retrieves the trap buffer * contens (or simply polls the buffer). The buffer is organized as * a ring which stores the newest traps at the beginning. The oldest * traps are overwritten by the newest ones. Each trap entry has a diff --git a/drivers/net/sk98lin/skgesirq.c b/drivers/net/sk98lin/skgesirq.c index ae54fa21d2b8..b8306c6b3414 100644 --- a/drivers/net/sk98lin/skgesirq.c +++ b/drivers/net/sk98lin/skgesirq.c @@ -736,14 +736,14 @@ SK_U32 Istatus) /* Interrupt status word */ /* Check whether XMACs are correctly initialized */ if ((Istatus & (IS_PA_TO_RX1 | IS_PA_TO_TX1)) && !pAC->GIni.GP[MAC_1].PState) { - /* XMAC was not initialized but Packet timeout occured */ + /* XMAC was not initialized but Packet timeout occurred */ SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E004, SKERR_SIRQ_E004MSG); } if ((Istatus & (IS_PA_TO_RX2 | IS_PA_TO_TX2)) && !pAC->GIni.GP[MAC_2].PState) { - /* XMAC was not initialized but Packet timeout occured */ + /* XMAC was not initialized but Packet timeout occurred */ SK_ERR_LOG(pAC, SK_ERRCL_SW | SK_ERRCL_INIT, SKERR_SIRQ_E005, SKERR_SIRQ_E005MSG); } @@ -1111,7 +1111,7 @@ int Port) /* Which port should be checked */ * otherwise the Linux driver will have a problem. */ /* - * We received a bunch of frames or no CRC error occured on the + * We received a bunch of frames or no CRC error occurred on the * network -> ok. */ pPrt->PPrevRx = RxCts; @@ -1379,7 +1379,7 @@ int Port) /* Which port should be checked */ pPrt->PAutoNegTOCt ++; /* - * Timeout occured. + * Timeout occurred. * What do we need now? */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM, @@ -1389,7 +1389,7 @@ int Port) /* Which port should be checked */ if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE && pPrt->PLipaAutoNeg != SK_LIPA_AUTO) { /* - * Timeout occured + * Timeout occurred * Set Link manually up. */ SkHWSenseSetNext(pAC, IoC, Port, SK_LMODE_FULL); @@ -1872,7 +1872,7 @@ int Port) /* Which port should be checked */ pPrt->PAutoNegTimeOut ++; if (pPrt->PAutoNegTimeOut >= SK_AND_MAX_TO) { /* - * Timeout occured. + * Timeout occurred. * What do we need now? */ SK_DBG_MSG(pAC,SK_DBGMOD_HWM, @@ -1882,7 +1882,7 @@ int Port) /* Which port should be checked */ if (pPrt->PLinkModeConf == SK_LMODE_AUTOSENSE && pPrt->PLipaAutoNeg != SK_LIPA_AUTO) { /* - * Timeout occured + * Timeout occurred * Set Link manually up. */ SkHWSenseSetNext(pAC, IoC, Port, diff --git a/drivers/net/sk98lin/ski2c.c b/drivers/net/sk98lin/ski2c.c index f5fbd7642c58..17e0ff982444 100644 --- a/drivers/net/sk98lin/ski2c.c +++ b/drivers/net/sk98lin/ski2c.c @@ -178,7 +178,7 @@ * Revision 1.2 1998/08/11 07:27:15 gklug * add: functions of the interface * adapt rest of source to C coding Conventions - * rmv: unneccessary code taken from Mona Lisa + * rmv: unnecessary code taken from Mona Lisa * * Revision 1.1 1998/06/19 14:28:43 malthoff * Created. Sources taken from ML Projekt. diff --git a/drivers/net/sk98lin/skqueue.c b/drivers/net/sk98lin/skqueue.c index 13c7ab90a8a1..afa18368759b 100644 --- a/drivers/net/sk98lin/skqueue.c +++ b/drivers/net/sk98lin/skqueue.c @@ -153,7 +153,7 @@ SK_EVPARA Para) /* Event parameter */ * send command to state machine * end * return error reported by individual Event function - * 0 if no error occured. + * 0 if no error occurred. */ int SkEventDispatcher( SK_AC *pAC, /* Adapters Context */ diff --git a/drivers/net/sk98lin/skvpd.c b/drivers/net/sk98lin/skvpd.c index 0ac799a0f99e..b08d78e73fe5 100644 --- a/drivers/net/sk98lin/skvpd.c +++ b/drivers/net/sk98lin/skvpd.c @@ -563,7 +563,7 @@ SK_IOC IoC) /* IO Context */ /* * find the Keyword 'key' in the VPD buffer and fills the - * parameter sturct 'p' with it's values + * parameter sturct 'p' with its values * * returns *p success * 0: parameter was not found or VPD encoding error diff --git a/drivers/net/sk98lin/skxmac2.c b/drivers/net/sk98lin/skxmac2.c index 67c2fa53361a..24178522d85a 100644 --- a/drivers/net/sk98lin/skxmac2.c +++ b/drivers/net/sk98lin/skxmac2.c @@ -596,7 +596,7 @@ int Port) /* port to stop (MAC_1 + n) */ * none, National: 80ns). * * ATTENTION: - * It is absolutely neccessary to reset the SW_RST Bit first + * It is absolutely necessary to reset the SW_RST Bit first * before calling this function. * * Returns: diff --git a/drivers/net/sk_mca.c b/drivers/net/sk_mca.c index a7705ea6ea6e..bab062f98c88 100644 --- a/drivers/net/sk_mca.c +++ b/drivers/net/sk_mca.c @@ -45,7 +45,7 @@ History: May 23nd, 1999 can receive frames, send frames May 24th, 1999 - modularized intialization of LANCE + modularized initialization of LANCE loadable as module still Tx problem :-( May 26th, 1999 @@ -581,7 +581,7 @@ static u16 irqstart_handler(struct SKMCA_NETDEV *dev, u16 oldcsr0) return GetLANCE(dev, LANCE_CSR0); } -/* did we loose blocks due to a FIFO overrun ? */ +/* did we lose blocks due to a FIFO overrun ? */ static u16 irqmiss_handler(struct SKMCA_NETDEV *dev, u16 oldcsr0) { diff --git a/drivers/net/skfp/h/smc.h b/drivers/net/skfp/h/smc.h index 5164b8900906..94325915e0d5 100644 --- a/drivers/net/skfp/h/smc.h +++ b/drivers/net/skfp/h/smc.h @@ -320,7 +320,7 @@ struct s_srf_evc { u_char evc_rep_required ; /* report required */ u_short evc_para ; /* SMT Para Number */ u_char *evc_cond_state ; /* condition state */ - u_char *evc_multiple ; /* multiple occurence */ + u_char *evc_multiple ; /* multiple occurrence */ } ; /* diff --git a/drivers/net/skfp/hwt.c b/drivers/net/skfp/hwt.c index 7d51b8b8bb3b..50755ba8a1aa 100644 --- a/drivers/net/skfp/hwt.c +++ b/drivers/net/skfp/hwt.c @@ -264,7 +264,7 @@ struct s_smc *smc ; * para start start time * duration time to wait * - * NOTE: The fuction will return immediatly, if the timer is not + * NOTE: The fuction will return immediately, if the timer is not * started ************************/ void hwt_wait_time(smc,start,duration) diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index 470c637dfb8f..a3521c2773a5 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c @@ -265,7 +265,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, /* Bail if the TCP packet isn't `compressible' (i.e., ACK isn't set or * some other control bit is set). Also uncompressible if - * its a runt. + * it's a runt. */ if(hlen > isize || th->syn || th->fin || th->rst || ! (th->ack)){ diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c index a98fb49a2985..c687bc1a4a1c 100644 --- a/drivers/net/smc-ultra.c +++ b/drivers/net/smc-ultra.c @@ -293,7 +293,7 @@ static int __init ultra_probe_isapnp(struct net_device *dev) /* Avoid already found cards from previous calls */ if (pnp_device_attach(idev) < 0) continue; - if (pnp_activate_dev(idev, NULL) < 0) { + if (pnp_activate_dev(idev) < 0) { __again: pnp_device_detach(idev); continue; diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 4a8d9c4f6819..7c139fdafea6 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c @@ -2991,7 +2991,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev, gem_begin_auto_negotiation(gp, NULL); spin_unlock_irq(&gp->lock); - /* It is guarenteed that the returned buffer will be at least + /* It is guaranteed that the returned buffer will be at least * PAGE_SIZE aligned. */ gp->init_block = (struct gem_init_block *) diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h index fa113a607ce1..d9ac2f8c47c5 100644 --- a/drivers/net/sungem.h +++ b/drivers/net/sungem.h @@ -562,7 +562,7 @@ */ /* Statistics Registers. All of these registers are 16-bits and - * track occurances of a specific event. GEM can be configured + * track occurrences of a specific event. GEM can be configured * to interrupt the host cpu when any of these counters overflow. * They should all be explicitly initialized to zero when the interface * is brought up. @@ -830,7 +830,7 @@ struct gem_txd { * RX Kick register) by the driver it must make sure the buffers are * truly ready and that the ownership bits are set properly. * - * Even though GEM modifies the RX descriptors, it guarentees that the + * Even though GEM modifies the RX descriptors, it guarantees that the * buffer DMA address field will stay the same when it performs these * updates. Therefore it can be used to keep track of DMA mappings * by the host driver just as in the TX descriptor case above. diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index d557c6b6341e..3fce7daceeb3 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c @@ -1198,7 +1198,7 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, unsigned long tr * (ETH_FRAME_LEN + 64 + 2) = (1514 + 64 + 2) = 1580 bytes. * * First our alloc_skb() routine aligns the data base to a 64 byte - * boundry. We now have 0xf001b040 as our skb data address. We + * boundary. We now have 0xf001b040 as our skb data address. We * plug this into the receive descriptor address. * * Next, we skb_reserve() 2 bytes to account for the Happy Meal offset. @@ -1651,7 +1651,7 @@ static int happy_meal_init(struct happy_meal *hp) hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE); /* This chip really rots, for the receiver sometimes when you - * write to it's control registers not all the bits get there + * write to its control registers not all the bits get there * properly. I cannot think of a sane way to provide complete * coverage for this hardware bug yet. */ diff --git a/drivers/net/sunhme.h b/drivers/net/sunhme.h index efa319e0ed1a..a93fd44d61b5 100644 --- a/drivers/net/sunhme.h +++ b/drivers/net/sunhme.h @@ -298,7 +298,7 @@ #define CSCONFIG_NDISABLE 0x8000 /* Disable NRZI */ /* Happy Meal descriptor rings and such. - * All descriptor rings must be aligned on a 2K boundry. + * All descriptor rings must be aligned on a 2K boundary. * All receive buffers must be 64 byte aligned. * Always write the address first before setting the ownership * bits to avoid races with the hardware scanning the ring. diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 3ca201cb6d8d..69ae9c2a6a2a 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c @@ -647,7 +647,7 @@ static void lance_piocopy_to_skb(struct sk_buff *skb, volatile void *piobuf, int u8 *p8; unsigned long pbuf = (unsigned long) piobuf; - /* We know here that both src and dest are on a 16bit boundry. */ + /* We know here that both src and dest are on a 16bit boundary. */ *p16++ = sbus_readw(pbuf); p32 = (u32 *) p16; pbuf += 2; diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index b37ce4a383db..8f48359a3496 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -25,6 +25,7 @@ #include <linux/if_vlan.h> #include <linux/ip.h> #include <linux/tcp.h> +#include <linux/workqueue.h> #include <asm/system.h> #include <asm/io.h> @@ -54,8 +55,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "1.4" -#define DRV_MODULE_RELDATE "Feb 1, 2003" +#define DRV_MODULE_VERSION "1.4c" +#define DRV_MODULE_RELDATE "Feb 18, 2003" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -216,6 +217,12 @@ static void tg3_disable_ints(struct tg3 *tp) tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW); } +static inline void tg3_cond_int(struct tg3 *tp) +{ + if (tp->hw_status->status & SD_STATUS_UPDATED) + tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); +} + static void tg3_enable_ints(struct tg3 *tp) { tw32(TG3PCI_MISC_HOST_CTRL, @@ -223,9 +230,55 @@ static void tg3_enable_ints(struct tg3 *tp) tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000000); tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW); - if (tp->hw_status->status & SD_STATUS_UPDATED) - tw32(GRC_LOCAL_CTRL, - tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); + tg3_cond_int(tp); +} + +/* these netif_xxx funcs should be moved into generic net layer */ +static void netif_poll_disable(struct net_device *dev) +{ + while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(1); + } +} + +static inline void netif_poll_enable(struct net_device *dev) +{ + clear_bit(__LINK_STATE_RX_SCHED, &dev->state); +} + +/* same as netif_rx_complete, except that local_irq_save(flags) + * has already been issued + */ +static inline void __netif_rx_complete(struct net_device *dev) +{ + if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); + list_del(&dev->poll_list); + clear_bit(__LINK_STATE_RX_SCHED, &dev->state); +} + +static inline void netif_tx_disable(struct net_device *dev) +{ + spin_lock_bh(&dev->xmit_lock); + netif_stop_queue(dev); + spin_unlock_bh(&dev->xmit_lock); +} + +static inline void tg3_netif_stop(struct tg3 *tp) +{ + netif_poll_disable(tp->dev); + netif_tx_disable(tp->dev); +} + +static inline void tg3_netif_start(struct tg3 *tp) +{ + netif_wake_queue(tp->dev); + /* NOTE: unconditional netif_wake_queue is only appropriate + * so long as all callers are assured to have free tx slots + * (such as after tg3_init_hw) + */ + netif_poll_enable(tp->dev); + tg3_cond_int(tp); } static void tg3_switch_clocks(struct tg3 *tp) @@ -387,7 +440,6 @@ static int tg3_phy_reset(struct tg3 *tp, int force) } static int tg3_setup_phy(struct tg3 *); -static int tg3_halt(struct tg3 *); static int tg3_set_power_state(struct tg3 *tp, int state) { @@ -458,8 +510,6 @@ static int tg3_set_power_state(struct tg3 *tp, int state) tg3_setup_phy(tp); } - tg3_halt(tp); - pci_read_config_word(tp->pdev, pm + PCI_PM_PMC, &power_caps); if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) { @@ -2044,7 +2094,12 @@ static int tg3_poll(struct net_device *netdev, int *budget) spin_unlock(&tp->tx_lock); } - /* run RX thread, within the bounds set by NAPI */ + spin_unlock_irqrestore(&tp->lock, flags); + + /* run RX thread, within the bounds set by NAPI. + * All RX "locking" is done by ensuring outside + * code synchronizes with dev->poll() + */ done = 1; if (sblk->idx[0].rx_producer != tp->rx_rcb_ptr) { int orig_budget = *budget; @@ -2064,12 +2119,12 @@ static int tg3_poll(struct net_device *netdev, int *budget) /* if no more work, tell net stack and NIC we're done */ if (done) { - netif_rx_complete(netdev); + spin_lock_irqsave(&tp->lock, flags); + __netif_rx_complete(netdev); tg3_enable_ints(tp); + spin_unlock_irqrestore(&tp->lock, flags); } - spin_unlock_irqrestore(&tp->lock, flags); - return (done ? 0 : 1); } @@ -2136,17 +2191,21 @@ static void tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs) static void tg3_init_rings(struct tg3 *); static int tg3_init_hw(struct tg3 *); +static int tg3_halt(struct tg3 *); -static void tg3_tx_timeout(struct net_device *dev) +static void tg3_reset_task(void *_data) { - struct tg3 *tp = dev->priv; + struct tg3 *tp = _data; + unsigned int restart_timer; - printk(KERN_ERR PFX "%s: transmit timed out, resetting\n", - dev->name); + tg3_netif_stop(tp); spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); + restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER; + tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; + tg3_halt(tp); tg3_init_rings(tp); tg3_init_hw(tp); @@ -2154,7 +2213,20 @@ static void tg3_tx_timeout(struct net_device *dev) spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); - netif_wake_queue(dev); + tg3_netif_start(tp); + + if (restart_timer) + mod_timer(&tp->timer, jiffies + 1); +} + +static void tg3_tx_timeout(struct net_device *dev) +{ + struct tg3 *tp = dev->priv; + + printk(KERN_ERR PFX "%s: transmit timed out, resetting\n", + dev->name); + + schedule_work(&tp->reset_task); } #if !PCI_DMA_BUS_IS_PHYS @@ -2194,7 +2266,7 @@ static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, int i; #if !PCI_DMA_BUS_IS_PHYS - /* IOMMU, just map the guilty area again which is guarenteed to + /* IOMMU, just map the guilty area again which is guaranteed to * use different addresses. */ @@ -2229,7 +2301,7 @@ static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, return -1; } - /* New SKB is guarenteed to be linear. */ + /* New SKB is guaranteed to be linear. */ entry = *start; new_addr = pci_map_single(tp->pdev, new_skb->data, new_skb->len, PCI_DMA_TODEVICE); @@ -2686,6 +2758,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu) return 0; } + tg3_netif_stop(tp); spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); @@ -2698,6 +2771,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu) spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); + tg3_netif_start(tp); return 0; } @@ -3073,6 +3147,7 @@ out: static void tg3_chip_reset(struct tg3 *tp) { u32 val; + u32 flags_save; /* Force NVRAM to settle. * This deals with a chip bug which can result in EEPROM @@ -3089,8 +3164,21 @@ static void tg3_chip_reset(struct tg3 *tp) } } + /* + * We must avoid the readl() that normally takes place. + * It locks machines, causes machine checks, and other + * fun things. So, temporarily disable the 5701 + * hardware workaround, while we do the reset. + */ + flags_save = tp->tg3_flags; + tp->tg3_flags &= ~TG3_FLAG_5701_REG_WRITE_BUG; + + /* do the reset */ tw32(GRC_MISC_CFG, GRC_MISC_CFG_CORECLK_RESET); + /* restore 5701 hardware bug workaround flag */ + tp->tg3_flags = flags_save; + /* Flush PCI posted writes. The normal MMIO registers * are inaccessible at this time so this is the only * way to make this reliably. I tried to use indirect @@ -3303,7 +3391,7 @@ static u32 tg3FwRodata[(TG3_FW_RODATA_LEN / sizeof(u32)) + 1] = { 0x00000000 }; -#if 0 /* All zeros, dont eat up space with it. */ +#if 0 /* All zeros, don't eat up space with it. */ u32 tg3FwData[(TG3_FW_DATA_LEN / sizeof(u32)) + 1] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 @@ -3736,7 +3824,7 @@ u32 tg3TsoFwRodata[] = { 0x00000000 }; -#if 0 /* All zeros, dont eat up space with it. */ +#if 0 /* All zeros, don't eat up space with it. */ u32 tg3TsoFwData[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 @@ -4394,9 +4482,11 @@ static void tg3_timer(unsigned long __opaque) } if (!(tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { - tg3_halt(tp); - tg3_init_rings(tp); - tg3_init_hw(tp); + tp->tg3_flags2 |= TG3_FLG2_RESTART_TIMER; + spin_unlock(&tp->tx_lock); + spin_unlock_irqrestore(&tp->lock, flags); + schedule_work(&tp->reset_task); + return; } /* This part only runs once per second. */ @@ -4527,8 +4617,6 @@ static int tg3_open(struct net_device *dev) return err; } - netif_start_queue(dev); - spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); @@ -4537,6 +4625,8 @@ static int tg3_open(struct net_device *dev) spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); + netif_start_queue(dev); + return 0; } @@ -5302,6 +5392,7 @@ static int tg3_ethtool_ioctl (struct net_device *dev, void *useraddr) (ering.tx_pending > TG3_TX_RING_SIZE - 1)) return -EINVAL; + tg3_netif_stop(tp); spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); @@ -5315,6 +5406,7 @@ static int tg3_ethtool_ioctl (struct net_device *dev, void *useraddr) netif_wake_queue(tp->dev); spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); + tg3_netif_start(tp); return 0; } @@ -5337,6 +5429,7 @@ static int tg3_ethtool_ioctl (struct net_device *dev, void *useraddr) if (copy_from_user(&epause, useraddr, sizeof(epause))) return -EFAULT; + tg3_netif_stop(tp); spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); if (epause.autoneg) @@ -5356,6 +5449,7 @@ static int tg3_ethtool_ioctl (struct net_device *dev, void *useraddr) tg3_init_hw(tp); spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); + tg3_netif_start(tp); return 0; } @@ -5941,7 +6035,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) /* Force memory write invalidate off. If we leave it on, * then on 5700_BX chips we have to enable a workaround. - * The workaround is to set the TG3PCI_DMA_RW_CTRL boundry + * The workaround is to set the TG3PCI_DMA_RW_CTRL boundary * to match the cacheline size. The Broadcom driver have this * workaround but turns MWI off all the times so never uses * it. This seems to suggest that the workaround is insufficient. @@ -6710,6 +6804,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, spin_lock_init(&tp->lock); spin_lock_init(&tp->tx_lock); spin_lock_init(&tp->indirect_lock); + PREPARE_WORK(&tp->reset_task, tg3_reset_task, tp); tp->regs = (unsigned long) ioremap(tg3reg_base, tg3reg_len); if (tp->regs == 0UL) { @@ -6851,6 +6946,8 @@ static int tg3_suspend(struct pci_dev *pdev, u32 state) if (!netif_running(dev)) return 0; + tg3_netif_stop(tp); + spin_lock_irq(&tp->lock); spin_lock(&tp->tx_lock); tg3_disable_ints(tp); @@ -6877,6 +6974,7 @@ static int tg3_suspend(struct pci_dev *pdev, u32 state) spin_unlock_irq(&tp->lock); netif_device_attach(dev); + tg3_netif_start(tp); } return err; @@ -6907,6 +7005,8 @@ static int tg3_resume(struct pci_dev *pdev) spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); + tg3_netif_start(tp); + return 0; } diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index c682bf7d28d5..4aeae5c1eb69 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h @@ -1821,6 +1821,8 @@ struct tg3 { #define TG3_FLAG_GOT_SERDES_FLOWCTL 0x20000000 #define TG3_FLAG_SPLIT_MODE 0x40000000 #define TG3_FLAG_INIT_COMPLETE 0x80000000 + u32 tg3_flags2; +#define TG3_FLG2_RESTART_TIMER 0x00000001 u32 split_mode_max_reqs; #define SPLIT_MODE_5704_MAX_REQ 3 @@ -1889,6 +1891,7 @@ struct tg3 { struct tg3_hw_stats *hw_stats; dma_addr_t stats_mapping; + struct work_struct reset_task; }; #endif /* !(_T3_H) */ diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index 0521aee7e66c..e9282a3075de 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c @@ -1630,7 +1630,7 @@ u32 TLan_HandleDummy( struct net_device *dev, u16 host_int ) * host_int The contents of the HOST_INT * port. * - * This driver is structured to determine EOC occurances by + * This driver is structured to determine EOC occurrences by * reading the CSTAT member of the list structure. Tx EOC * interrupts are disabled via the DIO INTDIS register. * However, TLAN chips before revision 3.0 didn't have this @@ -1753,7 +1753,7 @@ u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int ) * host_int The contents of the HOST_INT * port. * - * This driver is structured to determine EOC occurances by + * This driver is structured to determine EOC occurrences by * reading the CSTAT member of the list structure. Rx EOC * interrupts are disabled via the DIO INTDIS register. * However, TLAN chips before revision 3.0 didn't have this @@ -2399,7 +2399,7 @@ void TLan_SetMac( struct net_device *dev, int areg, char *mac ) * dev A pointer to the device structure of the * TLAN device having the PHYs to be detailed. * - * This function prints the registers a PHY (aka tranceiver). + * This function prints the registers a PHY (aka transceiver). * ********************************************************************/ @@ -2515,7 +2515,7 @@ void TLan_PhyPowerDown( struct net_device *dev ) /* Wait for 50 ms and powerup * This is abitrary. It is intended to make sure the - * tranceiver settles. + * transceiver settles. */ TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_PUP ); @@ -2535,7 +2535,7 @@ void TLan_PhyPowerUp( struct net_device *dev ) TLan_MiiWriteReg( dev, priv->phy[priv->phyNum], MII_GEN_CTL, value ); TLan_MiiSync(dev->base_addr); /* Wait for 500 ms and reset the - * tranceiver. The TLAN docs say both 50 ms and + * transceiver. The TLAN docs say both 50 ms and * 500 ms, so do the longer, just in case. */ TLan_SetTimer( dev, (HZ/20), TLAN_TIMER_PHY_RESET ); @@ -2650,7 +2650,7 @@ void TLan_PhyStartLink( struct net_device *dev ) TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tctl ); } - /* Wait for 2 sec to give the tranceiver time + /* Wait for 2 sec to give the transceiver time * to establish link. */ TLan_SetTimer( dev, (4*HZ), TLAN_TIMER_FINISH_RESET ); diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c index 1dcacd767c7f..455702a8cd18 100644 --- a/drivers/net/tokenring/lanstreamer.c +++ b/drivers/net/tokenring/lanstreamer.c @@ -542,7 +542,7 @@ static int streamer_reset(struct net_device *dev) writew(readw(streamer_mmio + LAPWWO) + 6, streamer_mmio + LAPA); if (readw(streamer_mmio + LAPD)) { - printk(KERN_INFO "tokenring card intialization failed. errorcode : %x\n", + printk(KERN_INFO "tokenring card initialization failed. errorcode : %x\n", ntohs(readw(streamer_mmio + LAPD))); release_region(dev->base_addr, STREAMER_IO_SPACE); return -1; diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c index 955235cd5777..3e7aea7205bf 100644 --- a/drivers/net/tokenring/madgemc.c +++ b/drivers/net/tokenring/madgemc.c @@ -80,7 +80,7 @@ static void madgemc_setint(struct net_device *dev, int val); static void madgemc_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* - * These work around paging, however they dont guarentee you're on the + * These work around paging, however they don't guarentee you're on the * right page. */ #define SIFREADB(reg) (inb(dev->base_addr + ((reg<0x8)?reg:reg-0x8))) diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index 7a0aef9c2898..47892a9fbc5d 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c @@ -384,7 +384,7 @@ static int __devinit olympic_init(struct net_device *dev) } #endif if(readw(init_srb+6)) { - printk(KERN_INFO "tokenring card intialization failed. errorcode : %x\n",readw(init_srb+6)); + printk(KERN_INFO "tokenring card initialization failed. errorcode : %x\n",readw(init_srb+6)); return -ENODEV; } diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 3c506f7e8ff5..ab9fe88f42a0 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c @@ -417,7 +417,7 @@ static int smctr_alloc_shared_memory(struct net_device *dev) tp->tx_buff_end[BUG_QUEUE] = (__u16 *)smctr_malloc(dev, 0); /* Allocate MAC receive data buffers. - * MAC Rx buffer doesn't have to be on a 256 byte boundry. + * MAC Rx buffer doesn't have to be on a 256 byte boundary. */ tp->rx_buff_head[MAC_QUEUE] = (__u16 *)smctr_malloc(dev, RX_DATA_BUFFER_SIZE * tp->num_rx_bdbs[MAC_QUEUE]); @@ -438,7 +438,7 @@ static int smctr_alloc_shared_memory(struct net_device *dev) * To guarantee a minimum of 256 contigous memory to * UM_Receive_Packet's lookahead pointer, before a page * change or ring end is encountered, place each rx buffer on - * a 256 byte boundry. + * a 256 byte boundary. */ smctr_malloc(dev, TO_256_BYTE_BOUNDRY(tp->sh_mem_used)); tp->rx_buff_head[NON_MAC_QUEUE] = (__u16 *)smctr_malloc(dev, @@ -1331,7 +1331,7 @@ static unsigned int smctr_get_num_rx_bdbs(struct net_device *dev) mem_used += tp->tx_buff_size[BUG_QUEUE]; /* Allocate MAC receive data buffers. - * MAC receive buffers don't have to be on a 256 byte boundry. + * MAC receive buffers don't have to be on a 256 byte boundary. */ mem_used += RX_DATA_BUFFER_SIZE * tp->num_rx_bdbs[MAC_QUEUE]; @@ -1348,7 +1348,7 @@ static unsigned int smctr_get_num_rx_bdbs(struct net_device *dev) * * Make sure the mem_used offset at this point is the * same as in allocate_shared memory or the following - * boundry adjustment will be incorrect (i.e. not allocating + * boundary adjustment will be incorrect (i.e. not allocating * the non-mac receive buffers above cannot change the 256 * byte offset). * @@ -3930,7 +3930,7 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size, return (err); } -/* Adapter RAM test. Incremental word ODD boundry data test. */ +/* Adapter RAM test. Incremental word ODD boundary data test. */ static int smctr_ram_memory_test(struct net_device *dev) { struct net_local *tp = (struct net_local *)dev->priv; @@ -3947,7 +3947,7 @@ static int smctr_ram_memory_test(struct net_device *dev) pages_of_ram = tp->ram_size / tp->ram_usable; pword = tp->ram_access; - /* Incremental word ODD boundry test. */ + /* Incremental word ODD boundary test. */ for(page = 0; (page < pages_of_ram) && (~err); page++, start_pattern += 0x8000) { @@ -5598,7 +5598,7 @@ static int smctr_update_tx_chain(struct net_device *dev, FCBlock *fcb, /* if all transmit buffer are cleared * need to set the tx_buff_curr[] to tx_buff_head[] * otherwise, tx buffer will be segregate and cannot - * accomodate and buffer greater than (curr - head) and + * accommodate and buffer greater than (curr - head) and * (end - curr) since we do not allow wrap around allocation. */ if(tp->tx_buff_used[queue] == 0) diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c index 4baf18f9e728..a64472c6670b 100644 --- a/drivers/net/tulip/interrupt.c +++ b/drivers/net/tulip/interrupt.c @@ -487,7 +487,7 @@ void tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs) * to the 21142/3 docs that is). * -- rmk */ - printk(KERN_ERR "%s: (%lu) System Error occured (%d)\n", + printk(KERN_ERR "%s: (%lu) System Error occurred (%d)\n", dev->name, tp->nir, error); } /* Clear all error sources, included undocumented ones! */ diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 8f1092b9cc40..9ce35ad6a029 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -1306,7 +1306,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, /* Intel Saturn. Switch to 8 long words burst, 8 long word cache aligned Aries might need this too. The Saturn errata are not pretty reading but - thankfully its an old 486 chipset. + thankfully it's an old 486 chipset. */ if (pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424, NULL)) { diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index 4b8da8198846..c53d9fb9acb1 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c @@ -597,7 +597,7 @@ static int eeprom_read(long addr, int location) #define mdio_delay(mdio_addr) readl(mdio_addr) /* Set iff a MII transceiver on any interface requires mdio preamble. - This only set with older tranceivers, so the extra + This only set with older transceivers, so the extra code size of a per-interface flag is not worthwhile. */ static char mii_preamble_required = 1; diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index 2a261cabacbf..95fea6ea9cd1 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c @@ -121,7 +121,7 @@ static struct net_device_stats *xircom_get_stats(struct net_device *dev); static void investigate_read_descriptor(struct net_device *dev,struct xircom_private *card, int descnr, unsigned int bufferoffset); static void investigate_write_descriptor(struct net_device *dev, struct xircom_private *card, int descnr, unsigned int bufferoffset); static void read_mac_address(struct xircom_private *card); -static void tranceiver_voodoo(struct xircom_private *card); +static void transceiver_voodoo(struct xircom_private *card); static void initialize_card(struct xircom_private *card); static void trigger_transmit(struct xircom_private *card); static void trigger_receive(struct xircom_private *card); @@ -301,7 +301,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ /* start the transmitter to get a heartbeat */ /* TODO: send 2 dummy packets here */ - tranceiver_voodoo(private); + transceiver_voodoo(private); spin_lock_irqsave(&private->lock,flags); activate_transmitter(private); @@ -1116,15 +1116,15 @@ static void read_mac_address(struct xircom_private *card) /* - tranceiver_voodoo() enables the external UTP plug thingy. + transceiver_voodoo() enables the external UTP plug thingy. it's called voodoo as I stole this code and cannot cross-reference it with the specification. */ -static void tranceiver_voodoo(struct xircom_private *card) +static void transceiver_voodoo(struct xircom_private *card) { unsigned long flags; - enter("tranceiver_voodoo"); + enter("transceiver_voodoo"); /* disable all powermanagement */ pci_write_config_dword(card->pdev, PCI_POWERMGMT, 0x0000); @@ -1143,7 +1143,7 @@ static void tranceiver_voodoo(struct xircom_private *card) spin_unlock_irqrestore(&card->lock, flags); netif_start_queue(card->dev); - leave("tranceiver_voodoo"); + leave("transceiver_voodoo"); } diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c index d51e7ebb4f2e..393537705c89 100644 --- a/drivers/net/tulip/xircom_tulip_cb.c +++ b/drivers/net/tulip/xircom_tulip_cb.c @@ -486,7 +486,7 @@ static void find_mii_transceivers(struct net_device *dev) /* * To quote Arjan van de Ven: - * tranceiver_voodoo() enables the external UTP plug thingy. + * transceiver_voodoo() enables the external UTP plug thingy. * it's called voodoo as I stole this code and cannot cross-reference * it with the specification. * Actually it seems to go like this: diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index bce91ab68e9b..5635a9d9706d 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c @@ -132,7 +132,7 @@ static int backoff; Both 'options[]' and 'full_duplex[]' should exist for driver interoperability. The media type is usually passed in 'options[]'. - The default is autonegotation for speed and duplex. + The default is autonegotiation for speed and duplex. This should rarely be overridden. Use option values 0x10/0x20 for 10Mbps, 0x100,0x200 for 100Mbps. Use option values 0x10 and 0x100 for forcing half duplex fixed speed. @@ -368,6 +368,8 @@ enum chip_capability_flags { #else #define RHINE_IOTYPE (PCI_USES_IO | PCI_USES_MASTER | PCI_ADDR0) #endif +/* Beware of PCI posted writes */ +#define IOSYNC do { readb(dev->base_addr + StationAddr); } while (0) /* directly indexed by enum via_rhine_chips, above */ static struct via_rhine_chip_info via_rhine_chip_info[] __devinitdata = @@ -403,7 +405,8 @@ enum register_offsets { MIICmd=0x70, MIIRegAddr=0x71, MIIData=0x72, MACRegEEcsr=0x74, ConfigA=0x78, ConfigB=0x79, ConfigC=0x7A, ConfigD=0x7B, RxMissed=0x7C, RxCRCErrs=0x7E, MiscCmd=0x81, - StickyHW=0x83, WOLcrClr=0xA4, WOLcgClr=0xA7, PwrcsrClr=0xAC, + StickyHW=0x83, IntrStatus2=0x84, WOLcrClr=0xA4, WOLcgClr=0xA7, + PwrcsrClr=0xAC, }; /* Bits in ConfigD */ @@ -430,6 +433,8 @@ enum intr_status_bits { IntrTxAborted=0x2000, IntrLinkChange=0x4000, IntrRxWakeUp=0x8000, IntrNormalSummary=0x0003, IntrAbnormalSummary=0xC260, + IntrTxDescRace=0x080000, /* mapped from IntrStatus2 */ + IntrTxErrSummary=0x082210, }; /* The Rx and Tx buffer descriptors. */ @@ -527,14 +532,28 @@ static struct net_device_stats *via_rhine_get_stats(struct net_device *dev); static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int via_rhine_close(struct net_device *dev); +static inline u32 get_intr_status(struct net_device *dev) +{ + long ioaddr = dev->base_addr; + struct netdev_private *np = dev->priv; + u32 intr_status; + + intr_status = readw(ioaddr + IntrStatus); + /* On Rhine-II, Bit 3 indicates Tx descriptor write-back race. */ + if (np->chip_id == VT6102) + intr_status |= readb(ioaddr + IntrStatus2) << 16; + return intr_status; +} + static void wait_for_reset(struct net_device *dev, int chip_id, char *name) { long ioaddr = dev->base_addr; + int boguscnt = 20; - udelay(5); + IOSYNC; if (readw(ioaddr + ChipCmd) & CmdReset) { - printk(KERN_INFO "%s: Reset did not complete in 5 us. " + printk(KERN_INFO "%s: Reset not complete yet. " "Trying harder.\n", name); /* Rhine-II needs to be forced sometimes */ @@ -543,12 +562,14 @@ static void wait_for_reset(struct net_device *dev, int chip_id, char *name) /* VT86C100A may need long delay after reset (dlink) */ /* Seen on Rhine-II as well (rl) */ - udelay(100); + while ((readw(ioaddr + ChipCmd) & CmdReset) && --boguscnt); + udelay(5); + } if (debug > 1) printk(KERN_INFO "%s: Reset %s.\n", name, - (readw(ioaddr + ChipCmd) & CmdReset) ? "failed" : "succeeded"); + boguscnt ? "succeeded" : "failed"); } #ifdef USE_MEM @@ -1226,6 +1247,7 @@ static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev) { struct netdev_private *np = dev->priv; unsigned entry; + u32 intr_status; /* Caution: the write order is important here, set the field with the "ownership" bits last. */ @@ -1275,8 +1297,15 @@ static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev) /* Non-x86 Todo: explicitly flush cache lines here. */ - /* Wake the potentially-idle transmit channel. */ - writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); + /* + * Wake the potentially-idle transmit channel unless errors are + * pending (the ISR must sort them out first). + */ + intr_status = get_intr_status(dev); + if ((intr_status & IntrTxErrSummary) == 0) { + writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); + } + IOSYNC; if (np->cur_tx == np->dirty_tx + TX_QUEUE_LEN) netif_stop_queue(dev); @@ -1303,38 +1332,51 @@ static void via_rhine_interrupt(int irq, void *dev_instance, struct pt_regs *rgs ioaddr = dev->base_addr; - while ((intr_status = readw(ioaddr + IntrStatus))) { + while ((intr_status = get_intr_status(dev))) { /* Acknowledge all of the current interrupt sources ASAP. */ + if (intr_status & IntrTxDescRace) + writeb(0x08, ioaddr + IntrStatus2); writew(intr_status & 0xffff, ioaddr + IntrStatus); + IOSYNC; if (debug > 4) - printk(KERN_DEBUG "%s: Interrupt, status %4.4x.\n", + printk(KERN_DEBUG "%s: Interrupt, status %8.8x.\n", dev->name, intr_status); if (intr_status & (IntrRxDone | IntrRxErr | IntrRxDropped | IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf)) via_rhine_rx(dev); - if (intr_status & (IntrTxDone | IntrTxError | IntrTxUnderrun | - IntrTxAborted)) + if (intr_status & (IntrTxErrSummary | IntrTxDone)) { + if (intr_status & IntrTxErrSummary) { + int cnt = 20; + /* Avoid scavenging before Tx engine turned off */ + while ((readw(ioaddr+ChipCmd) & CmdTxOn) && --cnt) + udelay(5); + if (debug > 2 && !cnt) + printk(KERN_WARNING "%s: via_rhine_interrupt() " + "Tx engine still on.\n", + dev->name); + } via_rhine_tx(dev); + } /* Abnormal error summary/uncommon events handlers. */ if (intr_status & (IntrPCIErr | IntrLinkChange | IntrStatsMax | IntrTxError | IntrTxAborted | - IntrTxUnderrun)) + IntrTxUnderrun | IntrTxDescRace)) via_rhine_error(dev, intr_status); if (--boguscnt < 0) { printk(KERN_WARNING "%s: Too much work at interrupt, " - "status=0x%4.4x.\n", + "status=%#8.8x.\n", dev->name, intr_status); break; } } if (debug > 3) - printk(KERN_DEBUG "%s: exiting interrupt, status=%4.4x.\n", + printk(KERN_DEBUG "%s: exiting interrupt, status=%8.8x.\n", dev->name, readw(ioaddr + IntrStatus)); } @@ -1512,7 +1554,8 @@ static void via_rhine_rx(struct net_device *dev) } /* Pre-emptively restart Rx engine. */ - writew(CmdRxDemand | np->chip_cmd, dev->base_addr + ChipCmd); + writew(readw(dev->base_addr + ChipCmd) | CmdRxOn | CmdRxDemand, + dev->base_addr + ChipCmd); } /* Clears the "tally counters" for CRC errors and missed frames(?). @@ -1526,15 +1569,35 @@ static inline void clear_tally_counters(const long ioaddr) readw(ioaddr + RxMissed); } -static inline void via_rhine_restart_tx(struct net_device *dev) { +static void via_rhine_restart_tx(struct net_device *dev) { struct netdev_private *np = dev->priv; + long ioaddr = dev->base_addr; int entry = np->dirty_tx % TX_RING_SIZE; + u32 intr_status; - /* We know better than the chip where it should continue */ - writel(np->tx_ring_dma + entry * sizeof(struct tx_desc), - dev->base_addr + TxRingPtr); + /* + * If new errors occured, we need to sort them out before doing Tx. + * In that case the ISR will be back here RSN anyway. + */ + intr_status = get_intr_status(dev); + + if ((intr_status & IntrTxErrSummary) == 0) { + + /* We know better than the chip where it should continue. */ + writel(np->tx_ring_dma + entry * sizeof(struct tx_desc), + ioaddr + TxRingPtr); + + writew(CmdTxDemand | np->chip_cmd, ioaddr + ChipCmd); + IOSYNC; + } + else { + /* This should never happen */ + if (debug > 1) + printk(KERN_WARNING "%s: via_rhine_restart_tx() " + "Another error occured %8.8x.\n", + dev->name, intr_status); + } - writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); } static void via_rhine_error(struct net_device *dev, int intr_status) @@ -1564,9 +1627,8 @@ static void via_rhine_error(struct net_device *dev, int intr_status) } if (intr_status & IntrTxAborted) { if (debug > 1) - printk(KERN_INFO "%s: Abort %4.4x, frame dropped.\n", + printk(KERN_INFO "%s: Abort %8.8x, frame dropped.\n", dev->name, intr_status); - via_rhine_restart_tx(dev); } if (intr_status & IntrTxUnderrun) { if (np->tx_thresh < 0xE0) @@ -1575,15 +1637,21 @@ static void via_rhine_error(struct net_device *dev, int intr_status) printk(KERN_INFO "%s: Transmitter underrun, Tx " "threshold now %2.2x.\n", dev->name, np->tx_thresh); - via_rhine_restart_tx(dev); } + if (intr_status & IntrTxDescRace) { + if (debug > 2) + printk(KERN_INFO "%s: Tx descriptor write-back race.\n", + dev->name); + } + if (intr_status & ( IntrTxAborted | IntrTxUnderrun | IntrTxDescRace )) + via_rhine_restart_tx(dev); + if (intr_status & ~( IntrLinkChange | IntrStatsMax | IntrTxUnderrun | - IntrTxError | IntrTxAborted | IntrNormalSummary)) { + IntrTxError | IntrTxAborted | IntrNormalSummary | + IntrTxDescRace )) { if (debug > 1) - printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n", - dev->name, intr_status); - /* Recovery for other fault sources not known. */ - writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); + printk(KERN_ERR "%s: Something Wicked happened! %8.8x.\n", + dev->name, intr_status); } spin_unlock (&np->lock); diff --git a/drivers/net/wan/comx-hw-munich.c b/drivers/net/wan/comx-hw-munich.c index fc5d622ecbd1..80be08dd1086 100644 --- a/drivers/net/wan/comx-hw-munich.c +++ b/drivers/net/wan/comx-hw-munich.c @@ -1304,7 +1304,7 @@ static void MUNICH_interrupt(int irq, void *dev_id, struct pt_regs *regs) ch = (struct comx_channel *)dev->priv; hw = (struct slicecom_privdata *)ch->HW_privdata; - /* We dont trust the "Tx available" info from the TIQ, but check */ + /* We don't trust the "Tx available" info from the TIQ, but check */ /* every ring if there is some free room */ if (ch->init_status && netif_running(dev)) diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index 8feb17b43d4f..4a73fcd995a0 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c @@ -14,7 +14,7 @@ * 0.15 Mike Mclagan Packet freeing, bug in kmalloc call * DLCI_RET handling * 0.20 Mike McLagan More conservative on which packets - * are returned for retry and whic are + * are returned for retry and which are * are dropped. If DLCI_RET_DROP is * returned from the FRAD, the packet is * sent back to Linux for re-transmission diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c index 6899fa436344..c5561f75cefb 100644 --- a/drivers/net/wan/dscc4.c +++ b/drivers/net/wan/dscc4.c @@ -47,7 +47,7 @@ * Tx direction * When the tx ring is full, the xmit routine issues a call to netdev_stop. * The device is supposed to be enabled again during an ALLS irq (we could - * use HI but as it's easy to loose events, it's fscked). + * use HI but as it's easy to lose events, it's fscked). * * Rx direction * The received frames aren't supposed to span over multiple receiving areas. diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c index 3c8aab035220..94b90f4fa985 100644 --- a/drivers/net/wan/hostess_sv11.c +++ b/drivers/net/wan/hostess_sv11.c @@ -55,13 +55,13 @@ struct sv11_device static void hostess_input(struct z8530_channel *c, struct sk_buff *skb) { - /* Drop the CRC - its not a good idea to try and negotiate it ;) */ + /* Drop the CRC - it's not a good idea to try and negotiate it ;) */ skb_trim(skb, skb->len-2); skb->protocol=__constant_htons(ETH_P_WAN_PPP); skb->mac.raw=skb->data; skb->dev=c->netdevice; /* - * Send it to the PPP layer. We dont have time to process + * Send it to the PPP layer. We don't have time to process * it right now. */ netif_rx(skb); diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index bf13c8182eb8..d94ceadfcb9e 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c @@ -1024,7 +1024,7 @@ static struct net_device *lmc_probe1 (struct net_device *dev, unsigned long ioad } -/* This is the entry point. This is what is called immediatly. */ +/* This is the entry point. This is what is called immediately. */ /* This goes out and finds the card */ int lmc_probe_fake(struct net_device *dev) /*fold00*/ @@ -2149,7 +2149,7 @@ static void lmc_softreset (lmc_softc_t * const sc) /*fold00*/ /* owned by 21140 */ sc->lmc_rxring[i].status = 0x80000000; - /* used to be PKT_BUF_SZ now uses skb since we loose some to head room */ + /* used to be PKT_BUF_SZ now uses skb since we lose some to head room */ sc->lmc_rxring[i].length = skb->end - skb->data; /* use to be tail which is dumb since you're thinking why write diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 799ae4b34377..a1b1265462c9 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c @@ -684,7 +684,7 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, /* * if CRC is right but framelen incorrect then transmitter - * error was occured... drop entire packet + * error was occurred... drop entire packet */ else if( (frame_ok = skip_tail( dev->base_addr, framelen, crc )) != 0 ) diff --git a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c index 347ae5cdfa1b..350ad8d2e627 100644 --- a/drivers/net/wan/sdla_chdlc.c +++ b/drivers/net/wan/sdla_chdlc.c @@ -3529,7 +3529,7 @@ static int config_chdlc (sdla_t *card) card->devname); }else{ /* IP addresses are the same and the link is up, - * we dont have to do anything here. Therefore, exit */ + * we don't have to do anything here. Therefore, exit */ return 0; } } diff --git a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c index 24087bc98c2d..776067f9da35 100644 --- a/drivers/net/wan/sdla_fr.c +++ b/drivers/net/wan/sdla_fr.c @@ -107,7 +107,7 @@ * the if clause for it(0,dev->tbusy) * forever. * The code got into this stage due to an -* interrupt occuring within the if clause for +* interrupt occurring within the if clause for * set_bit(0,dev->tbusy). Since an interrupt * disables furhter transmit interrupt and * makes dev->tbusy = 0, this effect was undone @@ -1726,7 +1726,7 @@ if_send_start_and_exit: /*============================================================================ - * Setup so that a frame can be transmitted on the occurence of a transmit + * Setup so that a frame can be transmitted on the occurrence of a transmit * interrupt. */ static int setup_for_delayed_transmit (netdevice_t* dev, struct sk_buff *skb) @@ -2071,7 +2071,7 @@ static void fr_isr (sdla_t* card) ++card->statistics.isr_intr_test; break; - case FR_INTR_DLC: /* Event interrupt occured */ + case FR_INTR_DLC: /* Event interrupt occurred */ mbox->cmd.command = FR_READ_STATUS; mbox->cmd.length = 0; err = sdla_exec(mbox) ? mbox->cmd.result : CMD_TIMEOUT; @@ -2747,7 +2747,7 @@ static int handle_IPXWAN(unsigned char *sendpacket, return 1; } - /* If we get here, its an IPX-data packet so it'll get passed up the + /* If we get here, it's an IPX-data packet so it'll get passed up the * stack. * switch the network numbers */ diff --git a/drivers/net/wan/sdla_ppp.c b/drivers/net/wan/sdla_ppp.c index 99758a4d1ab9..84aebf89af5f 100644 --- a/drivers/net/wan/sdla_ppp.c +++ b/drivers/net/wan/sdla_ppp.c @@ -2004,7 +2004,7 @@ void event_intr (sdla_t *card) (unsigned long)card->u.p.txbuf, *card->u.p.txbuf_next, (unsigned long)card->rxmb, *card->u.p.rxbuf_next); - /* Tell timer interrupt that PPP event occured */ + /* Tell timer interrupt that PPP event occurred */ ppp_priv_area->timer_int_enabled |= TMR_INT_ENABLED_PPP_EVENT; flags->imask |= PPP_INTR_TIMER; @@ -2221,7 +2221,7 @@ static int handle_IPXWAN(unsigned char *sendpacket, char *devname, unsigned char return 1; } else { - //If we get here's its an IPX-data packet, so it'll get passed up the stack. + //If we get here it's an IPX-data packet, so it'll get passed up the stack. //switch the network numbers switch_net_numbers(sendpacket, network_number, 1); @@ -3418,7 +3418,7 @@ static int config_ppp (sdla_t *card) card->devname); }else{ /* IP addresses are the same and the link is up, - * we dont have to do anything here. Therefore, exit */ + * we don't have to do anything here. Therefore, exit */ return 0; } } diff --git a/drivers/net/wan/sdla_x25.c b/drivers/net/wan/sdla_x25.c index 9d96cb7be147..ae81009299c3 100644 --- a/drivers/net/wan/sdla_x25.c +++ b/drivers/net/wan/sdla_x25.c @@ -1598,7 +1598,7 @@ if_send_crit_exit: } /*============================================================================ - * Setup so that a frame can be transmitted on the occurence of a transmit + * Setup so that a frame can be transmitted on the occurrence of a transmit * interrupt. *===========================================================================*/ @@ -3064,7 +3064,7 @@ dflt_1: /* Bug Fix: Mar 14 2000 * The Protocol violation error conditions were - * not handeled previously */ + * not handled previously */ switch (mb->cmd.pktType & 0x7F){ @@ -3178,7 +3178,7 @@ dflt_2: * when clearing a call because protocol encapsulation is not * supported. * 4. If an incoming call is received while a call request is - * pending (i.e. call collision has occured), the incoming call + * pending (i.e. call collision has occurred), the incoming call * shall be rejected and call request shall be retried. *====================================================================*/ @@ -4088,7 +4088,7 @@ static int handle_IPXWAN(unsigned char *sendpacket, char *devname, unsigned char return 1; } else { - /*If we get here its an IPX-data packet, so it'll get passed up the stack. + /*If we get here it's an IPX-data packet, so it'll get passed up the stack. */ /* switch the network numbers */ switch_net_numbers(sendpacket, network_number, 1); diff --git a/drivers/net/wan/sdlamain.c b/drivers/net/wan/sdlamain.c index 5322b2f91e55..2971fc56c059 100644 --- a/drivers/net/wan/sdlamain.c +++ b/drivers/net/wan/sdlamain.c @@ -38,7 +38,7 @@ * replaced it with 'wandev->enable_tx_int'. * May 29, 1997 Jaspreet Singh Flow Control Problem * added "wandev->tx_int_enabled=1" line in the -* init module. This line intializes the flag for +* init module. This line initializes the flag for * preventing Interrupt disabled with device set to * busy * Jan 15, 1997 Gene Kozin Version 3.1.0 @@ -434,7 +434,7 @@ static int setup (wan_device_t* wandev, wandev_conf_t* conf) } /* If the current card has already been configured - * or its a piggyback card, do not try to allocate + * or it's a piggyback card, do not try to allocate * resources. */ if (!card->wandev.piggyback && !card->configured){ diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c index e7e14c2988db..2f337392ef91 100644 --- a/drivers/net/wan/sealevel.c +++ b/drivers/net/wan/sealevel.c @@ -56,13 +56,13 @@ struct slvl_board static void sealevel_input(struct z8530_channel *c, struct sk_buff *skb) { - /* Drop the CRC - its not a good idea to try and negotiate it ;) */ + /* Drop the CRC - it's not a good idea to try and negotiate it ;) */ skb_trim(skb, skb->len-2); skb->protocol=htons(ETH_P_WAN_PPP); skb->mac.raw=skb->data; skb->dev=c->netdevice; /* - * Send it to the PPP layer. We dont have time to process + * Send it to the PPP layer. We don't have time to process * it right now. */ netif_rx(skb); diff --git a/drivers/net/wan/wanpipe_multppp.c b/drivers/net/wan/wanpipe_multppp.c index 5da0141cd6fe..c79791c59e3b 100644 --- a/drivers/net/wan/wanpipe_multppp.c +++ b/drivers/net/wan/wanpipe_multppp.c @@ -2283,7 +2283,7 @@ static int intr_test( sdla_t* card) Intr_test_counter = 0; - /* The critical flag is unset because during intialization (if_open) + /* The critical flag is unset because during initialization (if_open) * we want the interrupts to be enabled so that when the wpc_isr is * called it does not exit due to critical flag set. */ diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index 79235cbce134..d2473ea84eec 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c @@ -1634,7 +1634,7 @@ static void z8530_rx_done(struct z8530_channel *c) write_zsreg(c, R0, RES_Rx_CRC); } else - /* Can't occur as we dont reenable the DMA irq until + /* Can't occur as we don't reenable the DMA irq until after the flip is done */ printk(KERN_WARNING "%s: DMA flip overrun!\n", c->netdevice->name); diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 03a0ac178846..ec4f5e344502 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig @@ -6,13 +6,13 @@ menu "Wireless LAN (non-hamradio)" depends on NETDEVICES config NET_RADIO - bool "Wireless LAN (non-hamradio)" + bool "Wireless LAN drivers (non-hamradio) & Wireless Extensions" ---help--- Support for wireless LANs and everything having to do with radio, but not with amateur radio or FM broadcasting. Saying Y here also enables the Wireless Extensions (creates - /proc/net/wireless and enables ifconfig access). The Wireless + /proc/net/wireless and enables iwconfig access). The Wireless Extension is a generic API allowing a driver to expose to the user space configuration and statistics specific to common Wireless LANs. The beauty of it is that a single set of tool can support all the @@ -28,6 +28,11 @@ config NET_RADIO special kernel support are available from <ftp://shadow.cabi.net/pub/Linux/>. +# Note : the cards are obsolete (can't buy them anymore), but the drivers +# are not, as people are still using them... +comment "Obsolete Wireless cards support (pre-802.11)" + depends on NET_RADIO && (INET || ISA || PCMCIA) + config STRIP tristate "STRIP (Metricom starmode radio IP)" depends on NET_RADIO && INET @@ -68,10 +73,6 @@ config ARLAN On some computers the card ends up in non-valid state after some time. Use a ping-reset script to clear it. -comment "Wireless ISA/PCI cards support" - depends on NET_RADIO && (ISA || PCI || ALL_PPC || PCMCIA) - -# Good old obsolete Wavelan. config WAVELAN tristate "AT&T/Lucent old WaveLAN & DEC RoamAbout DS ISA support" depends on NET_RADIO && ISA @@ -102,7 +103,54 @@ config WAVELAN module, say M here and read <file:Documentation/modules.txt> as well as <file:Documentation/networking/net-modules.txt>. -# 802.11b cards +config PCMCIA_WAVELAN + tristate "AT&T/Lucent old WaveLAN Pcmcia wireless support" + depends on NET_RADIO && PCMCIA + help + Say Y here if you intend to attach an AT&T/Lucent Wavelan PCMCIA + (PC-card) wireless Ethernet networking card to your computer. This + driver is for the non-IEEE-802.11 Wavelan cards. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called wavelan_cs. If you want to compile it + as a module, say M here and read <file:Documentation/modules.txt>. + If unsure, say N. + +config PCMCIA_NETWAVE + tristate "Xircom Netwave AirSurfer Pcmcia wireless support" + depends on NET_RADIO && PCMCIA + help + Say Y here if you intend to attach this type of PCMCIA (PC-card) + wireless Ethernet networking card to your computer. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called netwave_cs. If you want to compile it + as a module, say M here and read <file:Documentation/modules.txt>. + If unsure, say N. + +comment "Wireless 802.11 Frequency Hopping cards support" + depends on NET_RADIO && PCMCIA + +config PCMCIA_RAYCS + tristate "Aviator/Raytheon 2.4MHz wireless support" + depends on NET_RADIO && PCMCIA + ---help--- + Say Y here if you intend to attach an Aviator/Raytheon PCMCIA + (PC-card) wireless Ethernet networking card to your computer. + Please read the file <file:Documentation/networking/ray_cs.txt> for + details. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called ray_cs. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. If + unsure, say N. + +comment "Wireless 802.11b ISA/PCI cards support" + depends on NET_RADIO && (ISA || PCI || ALL_PPC || PCMCIA) + config AIRO tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards" depends on NET_RADIO && (ISA || PCI) @@ -175,41 +223,12 @@ config PCI_HERMES this variety. # If Pcmcia is compiled in, offer Pcmcia cards... -comment "Wireless Pcmcia/Cardbus cards support" - depends on NET_RADIO && PCMCIA - -# Obsolete cards -config PCMCIA_NETWAVE - tristate "Xircom Netwave AirSurfer Pcmcia wireless support" - depends on NET_RADIO && PCMCIA - help - Say Y here if you intend to attach this type of PCMCIA (PC-card) - wireless Ethernet networking card to your computer. - - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called netwave_cs. If you want to compile it - as a module, say M here and read <file:Documentation/modules.txt>. - If unsure, say N. - -config PCMCIA_WAVELAN - tristate "AT&T/Lucent old Wavelan Pcmcia wireless support" +comment "Wireless 802.11b Pcmcia/Cardbus cards support" depends on NET_RADIO && PCMCIA - help - Say Y here if you intend to attach an AT&T/Lucent Wavelan PCMCIA - (PC-card) wireless Ethernet networking card to your computer. This - driver is for the non-IEEE-802.11 Wavelan cards. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called wavelan_cs. If you want to compile it - as a module, say M here and read <file:Documentation/modules.txt>. - If unsure, say N. - -# 802.11b cards config PCMCIA_HERMES tristate "Hermes PCMCIA card support" - depends on PCMCIA!=n && HERMES + depends on NET_RADIO && PCMCIA && HERMES ---help--- A driver for "Hermes" chipset based PCMCIA wireless adaptors, such as the Lucent WavelanIEEE/Orinoco cards and their OEM (Cabletron/ @@ -249,34 +268,6 @@ config AIRO_CS for location). You also want to check out the PCMCIA-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>. -config NET_PCMCIA_RADIO - bool "PCMCIA Wireless LAN" - depends on NET_PCMCIA - help - Say Y here if you would like to use a PCMCIA (PC-card) device to - connect to a wireless local area network. Then say Y to the driver - for your particular card below. - - To use your PC-cards, you will need supporting software from David - Hinds' pcmcia-cs package (see the file <file:Documentation/Changes> - for location). You also want to check out the PCMCIA-HOWTO, - available from <http://www.linuxdoc.org/docs.html#howto>. - -config PCMCIA_RAYCS - tristate "Aviator/Raytheon 2.4MHz wireless support" - depends on NET_PCMCIA_RADIO && PCMCIA - ---help--- - Say Y here if you intend to attach an Aviator/Raytheon PCMCIA - (PC-card) wireless Ethernet networking card to your computer. - Please read the file <file:Documentation/networking/ray_cs.txt> for - details. - - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ray_cs. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. If - unsure, say N. - # yes, this works even when no drivers are selected config NET_WIRELESS bool diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 43fe33074421..67f5eefaf8bb 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -970,7 +970,7 @@ struct airo_info { int open; struct net_device *dev; /* Note, we can have MAX_FIDS outstanding. FIDs are 16-bits, so we - use the high bit to mark wether it is in use. */ + use the high bit to mark whether it is in use. */ #define MAX_FIDS 6 int fids[MAX_FIDS]; int registered; @@ -2213,7 +2213,7 @@ static void enable_interrupts( struct airo_info *ai ) { /* Enable the interrupts */ OUT4500( ai, EVINTEN, STATUS_INTS ); /* Note there is a race condition between the last two lines that - I dont know how to get rid of right now... */ + I don't know how to get rid of right now... */ } static void disable_interrupts( struct airo_info *ai ) { @@ -5126,7 +5126,7 @@ static int airo_set_scan(struct net_device *dev, Resp rsp; /* 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... diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c index a69e86af4dff..ccd6e2ea3848 100644 --- a/drivers/net/wireless/arlan-proc.c +++ b/drivers/net/wireless/arlan-proc.c @@ -79,7 +79,7 @@ static const char *arlan_diagnostic_info_string(struct net_device *dev) case 0xFB: return "ERROR BackBone failure "; case 0xFA: - return "ERROR tranceiver not found "; + return "ERROR transceiver not found "; case 0xF9: return "ERROR no more address space "; case 0xF8: diff --git a/drivers/net/wireless/arlan.c b/drivers/net/wireless/arlan.c index e92b7725746f..eebd299c1dd9 100644 --- a/drivers/net/wireless/arlan.c +++ b/drivers/net/wireless/arlan.c @@ -567,7 +567,7 @@ static inline void arlan_command_process(struct net_device *dev) break; times++; } - /* if long command, we wont repeat trying */ ; + /* if long command, we won't repeat trying */ ; if (priv->card_polling_interval > 1) break; times++; diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index bac10011aea6..c2d12d4440b9 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c @@ -117,7 +117,7 @@ * o Init of priv->tx_rate_ctrl in firmware specific section. * o Prism2/Symbol rate, upto should be 0xF and not 0x15. Doh ! * o Spectrum card always need cor_reset (for every reset) - * o Fix cor_reset to not loose bit 7 in the register + * o Fix cor_reset to not lose bit 7 in the register * o flush_stale_links to remove zombie Pcmcia instances * o Ack previous hermes event before reset * Me (with my little hands) @@ -4166,7 +4166,7 @@ orinoco_proc_dev_init(struct net_device *dev) e = create_proc_read_entry("buf", S_IFREG | S_IRUGO, priv->dir_dev, orinoco_proc_get_hermes_buf, priv); if (! e) { - printk(KERN_ERR "Unable to intialize /proc/hermes/%s/buf\n", dev->name); + printk(KERN_ERR "Unable to initialize /proc/hermes/%s/buf\n", dev->name); goto fail; } diff --git a/drivers/net/wireless/todo.txt b/drivers/net/wireless/todo.txt index a23e938419f5..32234018de72 100644 --- a/drivers/net/wireless/todo.txt +++ b/drivers/net/wireless/todo.txt @@ -2,28 +2,14 @@ ------------- 1) Bring other kernel Wireless LAN drivers here - Already done : - o hermes.c/orinoco.c -> Wavelan IEEE driver + Airport driver - o airo.c/airo_cs.c -> Ben's Aironet driver - o wavelan.c -> old Wavelan ISA driver - o wavelan_cs.c -> old Wavelan Pcmcia driver - o netwave_cs.c -> Netwave Pcmcia driver - Drivers likely to go : - o ray_cs.c -> Raytheon/Aviator driver (maintainer MIA) - Drivers I have absolutely no control over : - o arlan.c -> old Aironet Arlan 655 (need to ask Elmer) - o aironet4500_xxx.c -> Elmer's Aironet driver (need to ask Elmer) - o strip.c -> Metricom's stuff. Not a wlan. Hum... - - ETA : Kernel 2.5.X + Completed 2) Bring new Wireless LAN driver not yet in the kernel there See my web page for details + In particular : HostAP 3) Misc o Mark wavelan, wavelan_cs, netwave_cs drivers as obsolete o Maybe arlan.c, ray_cs.c and strip.c also deserve to be obsolete - o Use new Probe/module stuff in wavelan.c - o New Wireless Extension API (pending) Jean II diff --git a/drivers/net/wireless/wavelan_cs.h b/drivers/net/wireless/wavelan_cs.h index 755df6f7c021..29cff6daf860 100644 --- a/drivers/net/wireless/wavelan_cs.h +++ b/drivers/net/wireless/wavelan_cs.h @@ -60,7 +60,7 @@ /* The detection of the wavelan card is made by reading the MAC address * from the card and checking it. If you have a non AT&T product (OEM, * like DEC RoamAbout, or Digital Ocean, Epson, ...), you must modify this - * part to accomodate your hardware... + * part to accommodate your hardware... */ const unsigned char MAC_ADDRESSES[][3] = { diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index dff1c393dd4e..4fa584004afa 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -924,7 +924,7 @@ ccio_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents) ** can't change. And we need the offset from the first ** chunk - not the last one. Ergo Successive chunks ** must start on page boundaries and dove tail - ** with it's predecessor. + ** with its predecessor. */ sg_dma_len(vcontig_sg) = vcontig_len; diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index 67e63ecd5ccd..38d480f19920 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -755,7 +755,7 @@ static int __init dino_common_init(struct parisc_device *dev, /* ** This enables DINO to generate interrupts when it sees - ** any of it's inputs *change*. Just asserting an IRQ + ** any of its inputs *change*. Just asserting an IRQ ** before it's enabled (ie unmasked) isn't good enough. */ gsc_writel(eim, dino_dev->hba.base_addr+DINO_IAR0); diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 70463f9e53f6..501e351f0381 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -1114,7 +1114,7 @@ sba_fill_pdir( /* ** Two address ranges are DMA contiguous *iff* "end of prev" and -** "start of next" are both on a page boundry. +** "start of next" are both on a page boundary. ** ** (shift left is a quick trick to mask off upper bits) */ @@ -1219,7 +1219,7 @@ sba_coalesce_chunks( struct ioc *ioc, ** can't change. And we need the offset from the first ** chunk - not the last one. Ergo Successive chunks ** must start on page boundaries and dove tail - ** with it's predecessor. + ** with its predecessor. */ sg_dma_len(vcontig_sg) = vcontig_len; diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 06b0a38dd927..f73904c74e13 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -35,7 +35,7 @@ * All registers are 8 bits wide and read/write. If your hardware differs * only in register addresses (eg because your registers are on 32-bit * word boundaries) then you can alter the constants in parport_pc.h to - * accomodate this. + * accommodate this. * * Note that the ECP registers may not start at offset 0x400 for PCI cards, * but rather will start at port->base_hi. @@ -422,7 +422,7 @@ static size_t parport_pc_epp_read_data (struct parport *port, void *buf, status = inb (STATUS (port)); if (status & 0x01) { /* EPP timeout should never occur... */ - printk (KERN_DEBUG "%s: EPP timeout occured while talking to " + printk (KERN_DEBUG "%s: EPP timeout occurred while talking to " "w91284pic (should not have done)\n", port->name); clear_epp_timeout (port); } diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 6403c6153fa9..bc95bdefa0f5 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -846,7 +846,7 @@ static void __init isa_probe(void) printk("PNP "); - if (pnp_activate_dev(dev, NULL) < 0) { + if (pnp_activate_dev(dev) < 0) { printk("activate failed\n"); pnp_device_detach(dev); break; diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 925f885c47b6..7f3830e18b0f 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -1582,7 +1582,7 @@ dasd_sleep_on_immediatly(dasd_ccw_req_t * cqr) /* * Cancels a request that was started with dasd_sleep_on_req. - * This is usefull to timeout requests. The request will be + * This is useful to timeout requests. The request will be * terminated if it is currently in i/o. * Returns 1 if the request has been terminated. */ diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c index 59d584a40c86..4b6259951c0d 100644 --- a/drivers/s390/block/dasd_3990_erp.c +++ b/drivers/s390/block/dasd_3990_erp.c @@ -197,7 +197,7 @@ dasd_3990_erp_examine(dasd_ccw_req_t * cqr, struct irb * irb) * DASD_3990_ERP_CLEANUP * * DESCRIPTION - * Removes the already build but not neccessary ERP request and sets + * Removes the already build but not necessary ERP request and sets * the status of the original cqr / erp to the given (final) status * * PARAMETER diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 12af93a2dec9..acdca8a9abef 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -467,7 +467,7 @@ dasd_diag_dump_sense(dasd_device_t *device, dasd_ccw_req_t * req, * the diag_bio_t for each block has 16 bytes. * That makes: * (8192 - 96 - 8) / 16 = 505.5 blocks at maximum. - * We want to fit two into the available memory so that we can immediatly + * We want to fit two into the available memory so that we can immediately * start the next request if one finishes off. That makes 252.75 blocks * for one request. Give a little safety and the result is 240. */ diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 55ce8a8a092f..9feae5747cd3 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -1427,7 +1427,7 @@ dasd_eckd_dump_sense(struct dasd_device_t *device, dasd_ccw_req_t * req, * addition we have one define extent ccw + 16 bytes of data and one * locate record ccw + 16 bytes of data. That makes: * (8192 - 24 - 136 - 8 - 16 - 8 - 16) / 16 = 499 blocks at maximum. - * We want to fit two into the available memory so that we can immediatly + * We want to fit two into the available memory so that we can immediately * start the next request if one finishes off. That makes 249.5 blocks * for one request. Give a little safety and the result is 240. */ diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index 442f2bd28cd0..7756963481d0 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c @@ -389,7 +389,7 @@ dasd_fba_dump_sense(struct dasd_device_t *device, dasd_ccw_req_t * req, * locate record ccw for each block (stupid devices!) + 16 bytes of data. * That makes: * (8192 - 24 - 136 - 8 - 16) / 40 = 200.2 blocks at maximum. - * We want to fit two into the available memory so that we can immediatly + * We want to fit two into the available memory so that we can immediately * start the next request if one finishes off. That makes 100.1 blocks * for one request. Give a little safety and the result is 96. */ diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 3da6ae5d8799..f34c8dcf2702 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -312,10 +312,10 @@ raw3215_timeout(unsigned long __data) } /* - * Function to conditionally start an IO. A read is started immediatly, - * a write is only started immediatly if the flush flag is on or the + * Function to conditionally start an IO. A read is started immediately, + * a write is only started immediately if the flush flag is on or the * amount of data is bigger than RAW3215_MIN_WRITE. If a write is not - * done immediatly a timer is started with a delay of RAW3215_TIMEOUT. + * done immediately a timer is started with a delay of RAW3215_TIMEOUT. */ static inline void raw3215_try_io(struct raw3215_info *raw) diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index d0419c1664db..60f5a3bd4fe6 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c @@ -26,7 +26,7 @@ #define SCLP_CORE_PRINT_HEADER "sclp low level driver: " /* - * decides wether we make use of the macro MACHINE_IS_VM to + * decides whether we make use of the macro MACHINE_IS_VM to * configure the driver for VM at run time (a little bit * different behaviour); otherwise we use the default * settings in sclp_data.init_ioctls diff --git a/drivers/s390/char/sclp_rw.c b/drivers/s390/char/sclp_rw.c index 1dd82a0ed83c..0f964f966a60 100644 --- a/drivers/s390/char/sclp_rw.c +++ b/drivers/s390/char/sclp_rw.c @@ -192,7 +192,7 @@ sclp_write(struct sclp_buffer *buffer, * under VM (Why does VM interpret \n but the native machine doesn't ?) * * Depending on i/o-control setting the message is always written - * immediatly or we wait for a final new line maybe coming with the + * immediately or we wait for a final new line maybe coming with the * next message. Besides we avoid a buffer overrun by writing its * content. * diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 5aa774cc386b..7a3b2b645361 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c @@ -288,7 +288,7 @@ ccw_device_online(struct ccw_device *cdev) } /* Is Set Path Group supported? */ if (!cdev->private->flags.pgid_supp) { - /* No, set state online immediatly. */ + /* No, set state online immediately. */ ccw_device_done(cdev, DEV_STATE_ONLINE); return 0; } @@ -333,7 +333,7 @@ ccw_device_offline(struct ccw_device *cdev) return -EBUSY; /* Is Set Path Group supported? */ if (!cdev->private->flags.pgid_supp) { - /* No, set state offline immediatly. */ + /* No, set state offline immediately. */ ccw_device_done(cdev, DEV_STATE_OFFLINE); return 0; } diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h index 960735162da1..ffae6208402c 100644 --- a/drivers/s390/cio/qdio.h +++ b/drivers/s390/cio/qdio.h @@ -27,7 +27,7 @@ #define IQDIO_DELAY_TARGET 0 #define QDIO_BUSY_BIT_PATIENCE 2000 /* in microsecs */ #define IQDIO_GLOBAL_LAPS 2 /* GLOBAL_LAPS are not used as we */ -#define IQDIO_GLOBAL_LAPS_INT 1 /* dont global summary */ +#define IQDIO_GLOBAL_LAPS_INT 1 /* don't global summary */ #define IQDIO_LOCAL_LAPS 4 #define IQDIO_LOCAL_LAPS_INT 1 #define IQDIO_GLOBAL_SUMMARY_CC_MASK 2 diff --git a/drivers/s390/net/iucv.h b/drivers/s390/net/iucv.h index 6cbeb27b704e..a882449aa8e3 100644 --- a/drivers/s390/net/iucv.h +++ b/drivers/s390/net/iucv.h @@ -214,7 +214,7 @@ typedef struct { * pgm_data- application data passed to interrupt handlers * Output: NA * Return: address of handler - * (0) - Error occured, registration not completed. + * (0) - Error occurred, registration not completed. * NOTE: Exact cause of failure will be recorded in syslog. */ iucv_handle_t iucv_register_program (uchar pgmname[16], diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index da486692d151..28561f88c350 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -1206,7 +1206,7 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb, card->stats.tx_packets++; dev_kfree_skb(skb); if (card->tx_emitted <= 0) - /* If this is the first tx buffer emit it immediatly. */ + /* If this is the first tx buffer emit it immediately. */ __lcs_emit_txbuffer(card); return 0; } diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index bf97d2efafa5..f3b87d84afd0 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -810,7 +810,7 @@ static void envctrl_init_fanstat(struct i2c_child_t *pchild) pchild->fan_mask |= chnls_mask[(pchild->chnl_array[i]).chnl_no]; /* We only need to know if this child has fan status monitored. - * We dont care which channels since we have the mask already. + * We don't care which channels since we have the mask already. */ pchild->mon_type[0] = ENVCTRL_FANSTAT_MON; } @@ -842,7 +842,7 @@ static void envctrl_init_globaladdr(struct i2c_child_t *pchild) } /* We only need to know if this child has global addressing - * line monitored. We dont care which channels since we know + * line monitored. We don't care which channels since we know * the mask already (ENVCTRL_GLOBALADDR_ADDR_MASK). */ pchild->mon_type[0] = ENVCTRL_GLOBALADDR_MON; @@ -858,7 +858,7 @@ static void envctrl_init_voltage_status(struct i2c_child_t *pchild) pchild->voltage_mask |= chnls_mask[(pchild->chnl_array[i]).chnl_no]; /* We only need to know if this child has voltage status monitored. - * We dont care which channels since we have the mask already. + * We don't care which channels since we have the mask already. */ pchild->mon_type[0] = ENVCTRL_VOLTAGESTAT_MON; } @@ -1115,7 +1115,7 @@ done: envctrl_dev.minor); } - /* Note above traversal routine post-incremented 'i' to accomodate + /* Note above traversal routine post-incremented 'i' to accommodate * a next child device, so we decrement before reverse-traversal of * child devices. */ diff --git a/drivers/scsi/AM53C974.c b/drivers/scsi/AM53C974.c index 9858d1cebc70..14c981aa0225 100644 --- a/drivers/scsi/AM53C974.c +++ b/drivers/scsi/AM53C974.c @@ -2091,7 +2091,7 @@ static void AM53C974_intr_reselect(struct Scsi_Host *instance, unsigned char sta goto EXIT_ABORT; } msg[0] = AM53C974_read_8(FFREG); - if (!msg[0] & 0x80) { + if (!(msg[0] & 0x80)) { printk("scsi%d: error: expecting IDENTIFY message, got ", instance->host_no); print_msg(msg); hostdata->aborted = 1; diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c index 9b07421da52b..5619924ea7df 100644 --- a/drivers/scsi/FlashPoint.c +++ b/drivers/scsi/FlashPoint.c @@ -3846,7 +3846,7 @@ int SetDevWideMode(PSCCBcard pCurrCard,PUCB p_ucb) } else { - if(!currTar_Info->TarEEValue & EE_WIDE_SCSI) + if(!(currTar_Info->TarEEValue & EE_WIDE_SCSI)) { return(0); } @@ -7529,7 +7529,7 @@ void sinits(PSCCB p_sccb, UCHAR p_card) * * $Workfile: phase.c $ * - * Description: Functions to intially handle the SCSI bus phase when + * Description: Functions to initially handle the SCSI bus phase when * the target asserts request (and the automation is not * enabled to handle the situation). * @@ -10866,7 +10866,7 @@ int DiagBusMaster(ULONG port) * Function: DiagEEPROM * * Description: Verfiy checksum and 'Key' and initialize the EEPROM if - * neccessary. + * necessary. * *---------------------------------------------------------------------*/ diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index fb816a946135..e54a6b1253d7 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -1325,9 +1325,9 @@ config SCSI_QLOGIC_FC_FIRMWARE bool "Include loadable firmware in driver" depends on SCSI_QLOGIC_FC help - Say Y to include ISP2100 Fabric Initiator/Target Firmware, with + Say Y to include ISP2X00 Fabric Initiator/Target Firmware, with expanded LUN addressing and FcTape (FCP-2) support, in the - Qlogic QLA 1280 driver. This is required on some platforms. + qlogicfc driver. This is required on some platforms. config SCSI_QLOGIC_1280 tristate "Qlogic QLA 1280 SCSI support" diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index 9476d3d106bd..eeb170856e1f 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile @@ -120,13 +120,11 @@ obj-$(CONFIG_BLK_DEV_SD) += sd_mod.o obj-$(CONFIG_BLK_DEV_SR) += sr_mod.o obj-$(CONFIG_CHR_DEV_SG) += sg.o -scsi_mod-objs := scsi.o hosts.o scsi_ioctl.o constants.o scsicam.o \ - scsi_error.o scsi_lib.o scsi_scan.o scsi_syms.o \ - scsi_sysfs.o - -ifdef CONFIG_PROC_FS -scsi_mod-objs += scsi_proc.o -endif +scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \ + scsicam.o scsi_error.o scsi_lib.o \ + scsi_scan.o scsi_syms.o scsi_sysfs.o +scsi_mod-$(CONFIG_PROC_FS) += scsi_proc.o +scsi_mod-$(CONFIG_X86_PC9800) += scsi_pc98.o sd_mod-objs := sd.o sr_mod-objs := sr.o sr_ioctl.o sr_vendor.o diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 2142d518584f..6a435d551611 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -2750,7 +2750,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) { phase = PHASE_MSGIN; NCR5380_transfer_pio(instance, &phase, &len, &data); - if (!msg[0] & 0x80) { + if (!(msg[0] & 0x80)) { printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no); print_msg(msg); abort = 1; diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c index 766595ef1ba9..a1f8470c1a5f 100644 --- a/drivers/scsi/NCR53C9x.c +++ b/drivers/scsi/NCR53C9x.c @@ -2942,7 +2942,7 @@ static int check_singlebyte_msg(struct NCR_ESP *esp, /* Target negotiates for synchronous transfers before we do, this * is legal although very strange. What is even funnier is that * the SCSI2 standard specifically recommends against targets doing - * this because so many initiators cannot cope with this occuring. + * this because so many initiators cannot cope with this occurring. */ static int target_with_ants_in_pants(struct NCR_ESP *esp, Scsi_Cmnd *SCptr, diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c index bc37f06cb42b..c891b7e312f8 100644 --- a/drivers/scsi/NCR53c406a.c +++ b/drivers/scsi/NCR53c406a.c @@ -472,7 +472,7 @@ static int __init NCR53c406a_detect(Scsi_Host_Template * tpnt) return 0; } - DEB(printk("NCR53c406a BIOS found at %X\n", (unsigned int) bios_base); + DEB(printk("NCR53c406a BIOS found at 0x%x\n", (unsigned int) bios_base); ); #endif /* USE_BIOS */ @@ -487,14 +487,14 @@ static int __init NCR53c406a_detect(Scsi_Host_Template * tpnt) } else { for (i = 0; i < PORT_COUNT && !port_base; i++) { if (!request_region(ports[i], 0x10, "NCR53c406a")) { - DEB(printk("NCR53c406a: port %x in use\n", ports[i])); + DEB(printk("NCR53c406a: port 0x%x in use\n", ports[i])); } else { - VDEB(printk("NCR53c406a: port %x available\n", ports[i])); + VDEB(printk("NCR53c406a: port 0x%x available\n", ports[i])); outb(C5_IMG, ports[i] + 0x0d); /* reg set 1 */ if ((inb(ports[i] + 0x0e) ^ inb(ports[i] + 0x0e)) == 7 && (inb(ports[i] + 0x0e) ^ inb(ports[i] + 0x0e)) == 7 && (inb(ports[i] + 0x0e) & 0xf8) == 0x58) { port_base = ports[i]; VDEB(printk("NCR53c406a: Sig register valid\n")); - VDEB(printk("port_base=%x\n", port_base)); + VDEB(printk("port_base=0x%x\n", port_base)); break; } release_region(ports[i], 0x10); @@ -523,7 +523,7 @@ static int __init NCR53c406a_detect(Scsi_Host_Template * tpnt) } #endif - DEB(printk("NCR53c406a: using port_base %x\n", port_base)); + DEB(printk("NCR53c406a: using port_base 0x%x\n", port_base)); tpnt->present = 1; tpnt->proc_name = "NCR53c406a"; @@ -611,11 +611,11 @@ static void __init NCR53c406a_setup(char *str, int *ints) for (i = 0; i < PORT_COUNT && !port_base; i++) if (ports[i] == ints[1]) { port_base = ints[1]; - DEB(printk("NCR53c406a: Specified port_base 0x%X\n", port_base); + DEB(printk("NCR53c406a: Specified port_base 0x%x\n", port_base); ) } if (!port_base) { - printk("NCR53c406a: Invalid PORTBASE 0x%X specified\n", ints[1]); + printk("NCR53c406a: Invalid PORTBASE 0x%x specified\n", ints[1]); return; } @@ -638,7 +638,7 @@ static void __init NCR53c406a_setup(char *str, int *ints) if (ints[0] > 2) fast_pio = ints[3]; - DEB(printk("NCR53c406a: port_base=0x%X, irq=%d, fast_pio=%d\n", port_base, irq_level, fast_pio);) + DEB(printk("NCR53c406a: port_base=0x%x, irq=%d, fast_pio=%d\n", port_base, irq_level, fast_pio);) } __setup("ncr53c406a=", NCR53c406a_setup); diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index 88ca2f6fd58f..5f82aae19edb 100644 --- a/drivers/scsi/aacraid/comminit.c +++ b/drivers/scsi/aacraid/comminit.c @@ -210,7 +210,7 @@ int aac_detach(struct aac_dev *detach) /** * aac_comm_init - Initialise FSA data structures - * @dev: Adapter to intialise + * @dev: Adapter to initialise * * Initializes the data structures that are required for the FSA commuication * interface to operate. diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index d5e9408cebd7..d5f744dfe467 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -79,7 +79,7 @@ void fib_map_free(struct aac_dev *dev) * fib_setup - setup the fibs * @dev: Adapter to set up * - * Allocate the PCI space for the fibs, map it and then intialise the + * Allocate the PCI space for the fibs, map it and then initialise the * fib area, the unmapped fib data and also the free list */ diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index b624dc0ef49d..95af5d5f81d0 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -60,7 +60,7 @@ #define AAC_DRIVERNAME "aacraid" MODULE_AUTHOR("Red Hat Inc and Adaptec"); -MODULE_DESCRIPTION("Supports Dell PERC2, 2/Si, 3/Si, 3/Di, Adaptec 2120S, 2200S, 5400S, and HP NetRAID-4M devices. http://domsch.com/linux/ or http://linux.adaptec.com"); +MODULE_DESCRIPTION("Supports Dell PERC2, 2/Si, 3/Si, 3/Di, PERC 320/DC, Adaptec 2120S, 2200S, 5400S, and HP NetRAID-4M devices. http://domsch.com/linux/ or http://linux.adaptec.com"); MODULE_LICENSE("GPL"); MODULE_PARM(nondasd, "i"); MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on"); @@ -96,6 +96,7 @@ static struct aac_driver_ident aac_drivers[] = { { 0x9005, 0x0285, 0x9005, 0x0286, aac_rx_init, "aacraid", "ADAPTEC ", "Adaptec 2120S ", 1 }, /* Adaptec 2120S (Crusader)*/ { 0x9005, 0x0285, 0x9005, 0x0285, aac_rx_init, "aacraid", "ADAPTEC ", "Adaptec 2200S ", 2 }, /* Adaptec 2200S (Vulcan)*/ { 0x9005, 0x0285, 0x9005, 0x0287, aac_rx_init, "aacraid", "ADAPTEC ", "Adaptec 2200S ", 2 }, /* Adaptec 2200S (Vulcan-2m)*/ + { 0x9005, 0x0285, 0x1028, 0x0287, aac_rx_init, "percraid", "DELL ", "PERCRAID ", 2 }, /* Dell PERC 320/DC */ { 0x1011, 0x0046, 0x9005, 0x0365, aac_sa_init, "aacraid", "ADAPTEC ", "Adaptec 5400S ", 4 }, /* Adaptec 5400S (Mustang)*/ { 0x1011, 0x0046, 0x9005, 0x0364, aac_sa_init, "aacraid", "ADAPTEC ", "AAC-364 ", 4 }, /* Adaptec 5400S (Mustang)*/ { 0x1011, 0x0046, 0x9005, 0x1364, aac_sa_init, "percraid", "DELL ", "PERCRAID ", 4 }, /* Dell PERC2 "Quad Channel" */ @@ -110,10 +111,10 @@ static int aac_cfg_open(struct inode * inode, struct file * file); static int aac_cfg_release(struct inode * inode,struct file * file); static struct file_operations aac_cfg_fops = { - owner: THIS_MODULE, - ioctl: aac_cfg_ioctl, - open: aac_cfg_open, - release: aac_cfg_release + .owner = THIS_MODULE, + .ioctl = aac_cfg_ioctl, + .open = aac_cfg_open, + .release = aac_cfg_release }; static int aac_detect(Scsi_Host_Template *); diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 0e9b75f14d71..3eb4d6c06e07 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -1131,7 +1131,7 @@ int aha152x_detect(Scsi_Host_Template * tpnt) while ( setup_count<ARRAY_SIZE(setup) && (dev=pnp_find_dev(NULL, ISAPNP_VENDOR('A','D','P'), ISAPNP_FUNCTION(0x1505), dev)) ) { if (pnp_device_attach(dev) < 0) continue; - if (pnp_activate_dev(dev, NULL) < 0) { + if (pnp_activate_dev(dev) < 0) { pnp_device_detach(dev); continue; } @@ -2663,7 +2663,7 @@ static void datai_run(struct Scsi_Host *shpnt) * STCNT to trigger ENSWRAP interrupt, instead of * polling for DFIFOFULL */ - the_time=jiffies + 10*HZ; + the_time=jiffies + 100*HZ; while(TESTLO(DMASTAT, DFIFOFULL|INTSTAT) && time_before(jiffies,the_time)) barrier(); @@ -2676,7 +2676,7 @@ static void datai_run(struct Scsi_Host *shpnt) if(TESTHI(DMASTAT, DFIFOFULL)) { fifodata = 128; } else { - the_time=jiffies + 10*HZ; + the_time=jiffies + 100*HZ; while(TESTLO(SSTAT2, SEMPTY) && time_before(jiffies,the_time)) barrier(); @@ -2832,7 +2832,7 @@ static void datao_run(struct Scsi_Host *shpnt) CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length; } - the_time=jiffies + 10*HZ; + the_time=jiffies + 100*HZ; while(TESTLO(DMASTAT, DFIFOEMP|INTSTAT) && time_before(jiffies,the_time)) barrier(); diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 622a6932a29f..8c6ae0ee7000 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -1161,7 +1161,7 @@ static int __init aha1542_detect(Scsi_Host_Template * tpnt) if(pnp_device_attach(pdev)<0) continue; - if(pnp_activate_dev(pdev, NULL)<0) { + if(pnp_activate_dev(pdev)<0) { pnp_device_detach(pdev); continue; } diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h index c1b587287f7e..8197906e03e5 100644 --- a/drivers/scsi/aic7xxx/aic79xx.h +++ b/drivers/scsi/aic7xxx/aic79xx.h @@ -180,7 +180,7 @@ do { \ /* * Define the size of our QIN and QOUT FIFOs. They must be a power of 2 - * in size and accomodate as many transactions as can be queued concurrently. + * in size and accommodate as many transactions as can be queued concurrently. */ #define AHD_QIN_SIZE AHD_MAX_QUEUE #define AHD_QOUT_SIZE AHD_MAX_QUEUE @@ -365,7 +365,7 @@ typedef enum { /* * The driver keeps up to MAX_SCB scb structures per card in memory. The SCB - * consists of a "hardware SCB" mirroring the fields availible on the card + * consists of a "hardware SCB" mirroring the fields available on the card * and additional information the kernel stores for each transaction. * * To minimize space utilization, a portion of the hardware scb stores diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index b3807a5fd5ca..eb877417ab72 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c @@ -516,7 +516,7 @@ ahd_handle_hwerrint(struct ahd_softc *ahd) ahd_dump_card_state(ahd); panic("BRKADRINT"); - /* Tell everyone that this HBA is no longer availible */ + /* Tell everyone that this HBA is no longer available */ ahd_abort_scbs(ahd, CAM_TARGET_WILDCARD, ALL_CHANNELS, CAM_LUN_WILDCARD, SCB_LIST_NULL, ROLE_UNKNOWN, CAM_NO_HBA); @@ -3755,9 +3755,9 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo) devinfo->target, &tstate); /* - * Parse as much of the message as is availible, + * Parse as much of the message as is available, * rejecting it if we don't support it. When - * the entire message is availible and has been + * the entire message is available and has been * handled, return MSGLOOP_MSGCOMPLETE, indicating * that we have parsed an entire message. * @@ -6016,7 +6016,7 @@ ahd_chip_init(struct ahd_softc *ahd) * Now that termination is set, wait for up * to 500ms for our transceivers to settle. If * the adapter does not have a cable attached, - * the tranceivers may never settle, so don't + * the transceivers may never settle, so don't * complain if we fail here. */ for (wait = 10000; diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index c59edd4c3a67..b67dd10f98d2 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -801,7 +801,6 @@ ahd_linux_map_seg(struct ahd_softc *ahd, struct scb *scb, /************************ Host template entry points *************************/ static int ahd_linux_detect(Scsi_Host_Template *); -static int ahd_linux_release(struct Scsi_Host *); static const char *ahd_linux_info(struct Scsi_Host *); static int ahd_linux_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) @@ -811,6 +810,7 @@ static void ahd_linux_slave_destroy(Scsi_Device *); static int ahd_linux_biosparam(struct scsi_device*, struct block_device*, sector_t, int[]); #else +static int ahd_linux_release(struct Scsi_Host *); static void ahd_linux_select_queue_depth(struct Scsi_Host *host, Scsi_Device *scsi_devs); static int ahd_linux_biosparam(Disk *, kdev_t, int[]); @@ -874,7 +874,7 @@ ahd_linux_detect(Scsi_Host_Template *template) ahd_list_lockinit(); #ifdef CONFIG_PCI - ahd_linux_pci_probe(template); + ahd_linux_pci_init(); #endif /* @@ -894,6 +894,7 @@ ahd_linux_detect(Scsi_Host_Template *template) return (found); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) /* * Free the passed in Scsi_Host memory structures prior to unloading the * module. @@ -925,6 +926,7 @@ ahd_linux_release(struct Scsi_Host * host) ahd_list_unlock(&l); return (0); } +#endif /* * Return a string describing the driver. @@ -1664,9 +1666,9 @@ ahd_linux_bus_reset(Scsi_Cmnd *cmd) } Scsi_Host_Template aic79xx_driver_template = { + .module = THIS_MODULE, + .name = "aic79xx", .proc_info = ahd_linux_proc_info, - .detect = ahd_linux_detect, - .release = ahd_linux_release, .info = ahd_linux_info, .queuecommand = ahd_linux_queue, .eh_abort_handler = ahd_linux_abort, @@ -1698,18 +1700,17 @@ Scsi_Host_Template aic79xx_driver_template = { #endif #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) - .name = "aic79xx", .slave_alloc = ahd_linux_slave_alloc, .slave_configure = ahd_linux_slave_configure, .slave_destroy = ahd_linux_slave_destroy, #else + .detect = ahd_linux_detect, + .release = ahd_linux_release, .select_queue_depths = ahd_linux_select_queue_depth, .use_new_eh_code = 1, #endif }; -#define driver_template aic79xx_driver_template -#include "scsi_module.c" /**************************** Tasklet Handler *********************************/ static void @@ -2381,9 +2382,8 @@ ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template) ahd_set_name(ahd, new_name); } host->unique_id = ahd->unit; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) - scsi_set_device(host, &ahd->dev_softc->dev); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) && \ + LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) scsi_set_pci_device(host, ahd->dev_softc); #endif ahd_linux_initialize_scsi_bus(ahd); @@ -2410,6 +2410,10 @@ ahd_linux_register_host(struct ahd_softc *ahd, Scsi_Host_Template *template) ahd_intr_enable(ahd, TRUE); ahd_linux_start_dv(ahd); ahd_unlock(ahd, &s); + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + scsi_add_host(host, &ahd->dev_softc->dev); +#endif return (0); } @@ -2556,8 +2560,12 @@ ahd_platform_free(struct ahd_softc *ahd) __WCLONE) == -ERESTARTSYS); } ahd_teardown_runq_tasklet(ahd); - if (ahd->platform_data->host != NULL) + if (ahd->platform_data->host != NULL) { +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + scsi_remove_host(ahd->platform_data->host); +#endif scsi_unregister(ahd->platform_data->host); + } /* destroy all of the device and target objects */ for (i = 0; i < AHD_NUM_TARGETS; i++) { @@ -2595,21 +2603,17 @@ ahd_platform_free(struct ahd_softc *ahd) 0x1000); #endif } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - /* XXX Need an instance detach in the PCI code */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) && \ + LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) + /* + * In 2.4 we detach from the scsi midlayer before the PCI + * layer invokes our remove callback. + */ if (ahd->dev_softc != NULL) ahd->dev_softc->driver = NULL; #endif free(ahd->platform_data, M_DEVBUF); } - if (TAILQ_EMPTY(&ahd_tailq)) { - unregister_reboot_notifier(&ahd_linux_notifier); -#ifdef CONFIG_PCI -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - pci_unregister_driver(&aic79xx_pci_driver); -#endif -#endif - } } void @@ -5315,3 +5319,30 @@ ahd_platform_dump_card_state(struct ahd_softc *ahd) } } } + +static int __init ahd_linux_init(void) +{ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + return (ahd_linux_detect(&aic79xx_driver_template) ? 0 : -ENODEV); +#else + scsi_register_module(MODULE_SCSI_HA, &aic79xx_driver_template); + if (!driver_template.present) { + scsi_unregister_module(MODULE_SCSI_HA, + &aic79xx_driver_template); + return (-ENODEV); + } + + return (0); +#endif +} + +static void __exit ahd_linux_exit(void) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + scsi_unregister_module(MODULE_SCSI_HA, &aic79xx_driver_template); +#endif + ahd_linux_pci_exit(); +} + +module_init(ahd_linux_init); +module_exit(ahd_linux_exit); diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h index e7c7c0896113..e1267e9bb297 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/drivers/scsi/aic7xxx/aic79xx_osm.h @@ -952,7 +952,8 @@ void ahd_power_state_change(struct ahd_softc *ahd, #include <linux/bios32.h> #endif -int ahd_linux_pci_probe(Scsi_Host_Template *); +int ahd_linux_pci_init(void); +void ahd_linux_pci_exit(void); int ahd_pci_map_registers(struct ahd_softc *ahd); int ahd_pci_map_int(struct ahd_softc *ahd); diff --git a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c index e8e0261dbf8f..eb09fd3b13a5 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm_pci.c @@ -183,14 +183,21 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) pci_set_drvdata(pdev, ahd); - if (aic79xx_detect_complete) + if (aic79xx_detect_complete) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ahd_linux_register_host(ahd, &aic79xx_driver_template); +#else + printf("aic79xx: ignoring PCI device found after " + "initialization\n"); + return (-ENODEV); +#endif + } #endif return (0); } int -ahd_linux_pci_probe(Scsi_Host_Template *template) +ahd_linux_pci_init(void) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) return (pci_module_init(&aic79xx_pci_driver)); @@ -219,6 +226,12 @@ ahd_linux_pci_probe(Scsi_Host_Template *template) #endif } +void +ahd_linux_pci_exit(void) +{ + pci_unregister_driver(&aic79xx_pci_driver); +} + static int ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, u_long *base, u_long *base2) diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h index a30deb3f9b24..b797b01998a2 100644 --- a/drivers/scsi/aic7xxx/aic7xxx.h +++ b/drivers/scsi/aic7xxx/aic7xxx.h @@ -372,7 +372,7 @@ typedef enum { /* * The driver keeps up to MAX_SCB scb structures per card in memory. The SCB - * consists of a "hardware SCB" mirroring the fields availible on the card + * consists of a "hardware SCB" mirroring the fields available on the card * and additional information the kernel stores for each transaction. * * To minimize space utilization, a portion of the hardware scb stores diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index ce2598e1b97e..0eedbbae0200 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c @@ -389,7 +389,7 @@ ahc_handle_brkadrint(struct ahc_softc *ahc) ahc_dump_card_state(ahc); - /* Tell everyone that this HBA is no longer availible */ + /* Tell everyone that this HBA is no longer available */ ahc_abort_scbs(ahc, CAM_TARGET_WILDCARD, ALL_CHANNELS, CAM_LUN_WILDCARD, SCB_LIST_NULL, ROLE_UNKNOWN, CAM_NO_HBA); @@ -2988,9 +2988,9 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) targ_scsirate = tinfo->scsirate; /* - * Parse as much of the message as is availible, + * Parse as much of the message as is available, * rejecting it if we don't support it. When - * the entire message is availible and has been + * the entire message is available and has been * handled, return MSGLOOP_MSGCOMPLETE, indicating * that we have parsed an entire message. * @@ -4999,7 +4999,7 @@ ahc_init(struct ahc_softc *ahc) /* * Wait for up to 500ms for our transceivers * to settle. If the adapter does not have - * a cable attached, the tranceivers may + * a cable attached, the transceivers may * never settle, so don't complain if we * fail here. */ diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 9d6ac33a2d48..894238bf3398 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -108,7 +108,7 @@ * but are not limited to: * * 1: Import of the latest FreeBSD sequencer code for this driver - * 2: Modification of kernel code to accomodate different sequencer semantics + * 2: Modification of kernel code to accommodate different sequencer semantics * 3: Extensive changes throughout kernel portion of driver to improve * abort/reset processing and error hanndling * 4: Other work contributed by various people on the Internet @@ -875,7 +875,7 @@ ahc_linux_detect(Scsi_Host_Template *template) ahc_list_lockinit(); #ifdef CONFIG_PCI - ahc_linux_pci_probe(template); + ahc_linux_pci_init(); #endif if (aic7xxx_no_probe == 0) @@ -1266,9 +1266,9 @@ ahc_linux_bus_reset(Scsi_Cmnd *cmd) } Scsi_Host_Template aic7xxx_driver_template = { + .module = THIS_MODULE, + .name = "aic7xxx", .proc_info = ahc_linux_proc_info, - .detect = ahc_linux_detect, - .release = ahc_linux_release, .info = ahc_linux_info, .queuecommand = ahc_linux_queue, .eh_abort_handler = ahc_linux_abort, @@ -1300,19 +1300,17 @@ Scsi_Host_Template aic7xxx_driver_template = { #endif #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) - .name = "aic7xxx", .slave_alloc = ahc_linux_slave_alloc, .slave_configure = ahc_linux_slave_configure, .slave_destroy = ahc_linux_slave_destroy, #else + .detect = ahc_linux_detect, + .release = ahc_linux_release, .select_queue_depths = ahc_linux_select_queue_depth, .use_new_eh_code = 1, #endif }; -#define driver_template aic7xxx_driver_template -#include "scsi_module.c" - /**************************** Tasklet Handler *********************************/ static void @@ -1861,9 +1859,8 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template) ahc_set_name(ahc, new_name); } host->unique_id = ahc->unit; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) - scsi_set_device(host, &ahc->dev_softc->dev); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,4) && \ + LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) scsi_set_pci_device(host, ahc->dev_softc); #endif ahc_linux_initialize_scsi_bus(ahc); @@ -1897,6 +1894,10 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template) ahc_intr_enable(ahc, TRUE); ahc_linux_start_dv(ahc); ahc_unlock(ahc, &s); + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + scsi_add_host(host, (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); +#endif return (0); } @@ -2075,8 +2076,12 @@ ahc_platform_free(struct ahc_softc *ahc) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) tasklet_kill(&ahc->platform_data->runq_tasklet); #endif - if (ahc->platform_data->host != NULL) + if (ahc->platform_data->host != NULL) { +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + scsi_remove_host(ahc->platform_data->host); +#endif scsi_unregister(ahc->platform_data->host); + } /* destroy all of the device and target objects */ for (i = 0; i < AHC_NUM_TARGETS; i++) { @@ -2112,19 +2117,16 @@ ahc_platform_free(struct ahc_softc *ahc) #endif } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - /* XXX Need an instance detach in the PCI code */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + /* + * In 2.4 we detach from the scsi midlayer before the PCI + * layer invokes our remove callback. + */ if (ahc->dev_softc != NULL) ahc->dev_softc->driver = NULL; #endif - free(ahc->platform_data, M_DEVBUF); - } - if (TAILQ_EMPTY(&ahc_tailq)) { - unregister_reboot_notifier(&ahc_linux_notifier); -#ifdef CONFIG_PCI -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - pci_unregister_driver(&aic7xxx_pci_driver); -#endif #endif + free(ahc->platform_data, M_DEVBUF); } } @@ -5182,3 +5184,51 @@ ahc_platform_dump_card_state(struct ahc_softc *ahc) } } } + +static int __init ahc_linux_init(void) +{ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + return (ahc_linux_detect(&aic7xxx_driver_template) ? 0 : -ENODEV); +#else + scsi_register_module(MODULE_SCSI_HA, &aic7xxx_driver_template); + if (!driver_template.present) { + scsi_unregister_module(MODULE_SCSI_HA, + &aic7xxx_driver_template); + return (-ENODEV); + } + + return (0); +#endif +} + +static void __exit ahc_linux_exit(void) +{ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + struct ahc_softc *ahc; + + ahc_linux_pci_exit(); + + /* + * Get rid of the non-pci devices. + * + * XXX(hch): switch over eisa support to new LDM-based API + */ + TAILQ_FOREACH(ahc, &ahc_tailq, links) + ahc_linux_release(ahc->platform_data->host); +#else + scsi_unregister_module(MODULE_SCSI_HA, &aic7xxx_driver_template); + + /* + * In 2.4 we have to unregister from the PCI core _after_ + * unregistering from the scsi midlayer to avoid danling references. + * + * The 2.4 scsi midlayer is so f***ed.. + */ + ahc_linux_pci_exit(); +#endif + + unregister_reboot_notifier(&ahc_linux_notifier); +} + +module_init(ahc_linux_init); +module_exit(ahc_linux_exit); diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index e400114b9ca7..da982de00533 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h @@ -912,7 +912,8 @@ int aic7770_map_int(struct ahc_softc *ahc, u_int irq); #include <linux/bios32.h> #endif -int ahc_linux_pci_probe(Scsi_Host_Template *); +int ahc_linux_pci_init(void); +void ahc_linux_pci_exit(void); int ahc_pci_map_registers(struct ahc_softc *ahc); int ahc_pci_map_int(struct ahc_softc *ahc); diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 5c7bb1a2e002..b6dcea5c9d5d 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c @@ -179,14 +179,21 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) pci_set_drvdata(pdev, ahc); - if (aic7xxx_detect_complete) + if (aic7xxx_detect_complete) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ahc_linux_register_host(ahc, &aic7xxx_driver_template); +#else + printf("aic7xxx: ignoring PCI device found after " + "initialization\n"); + return (-ENODEV); +#endif + } #endif return (0); } int -ahc_linux_pci_probe(Scsi_Host_Template *template) +ahc_linux_pci_init(void) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) return (pci_module_init(&aic7xxx_pci_driver)); @@ -215,6 +222,12 @@ ahc_linux_pci_probe(Scsi_Host_Template *template) #endif } +void +ahc_linux_pci_exit(void) +{ + pci_unregister_driver(&aic7xxx_pci_driver); +} + static int ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base) { diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index e1860dbaf3bf..2235335c7ecc 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c @@ -111,7 +111,7 @@ * but are not limited to: * * 1: Import of the latest FreeBSD sequencer code for this driver - * 2: Modification of kernel code to accomodate different sequencer semantics + * 2: Modification of kernel code to accommodate different sequencer semantics * 3: Extensive changes throughout kernel portion of driver to improve * abort/reset processing and error hanndling * 4: Other work contributed by various people on the Internet @@ -4609,8 +4609,8 @@ aic7xxx_handle_seqint(struct aic7xxx_host *p, unsigned char intstat) * handler do the rest. We don't want to unpause the sequencer yet * though so we'll return early. We also have to make sure that * we clear the SEQINT *BEFORE* we set the REQINIT handler active - * or else it's possible on VLB cards to loose the first REQINIT - * interrupt. Edge triggered EISA cards could also loose this + * or else it's possible on VLB cards to lose the first REQINIT + * interrupt. Edge triggered EISA cards could also lose this * interrupt, although PCI and level triggered cards should not * have this problem since they continually interrupt the kernel * until we take care of the situation. @@ -4945,9 +4945,9 @@ aic7xxx_parse_msg(struct aic7xxx_host *p, struct aic7xxx_scb *scb) target_mask = (0x01 << tindex); /* - * Parse as much of the message as is availible, + * Parse as much of the message as is available, * rejecting it if we don't support it. When - * the entire message is availible and has been + * the entire message is available and has been * handled, return TRUE indicating that we have * parsed an entire message. */ @@ -10392,7 +10392,7 @@ aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) aic7xxx_done_cmds_complete(p); /* If the command was already complete or just completed, then we didn't * do a reset, return FAILED */ - if(!scb->flags & SCB_ACTIVE) + if(!(scb->flags & SCB_ACTIVE)) return FAILED; pause_sequencer(p); @@ -10615,7 +10615,7 @@ aic7xxx_abort(Scsi_Cmnd *cmd) aic7xxx_done_cmds_complete(p); /* If the command was already complete or just completed, then we didn't * do a reset, return FAILED */ - if(!scb->flags & SCB_ACTIVE) + if(!(scb->flags & SCB_ACTIVE)) return FAILED; pause_sequencer(p); diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index f7a944485be2..df9da107d11b 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c @@ -2543,7 +2543,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) phase = PHASE_MSGIN; NCR5380_transfer_pio(instance, &phase, &len, &data); - if (!msg[0] & 0x80) { + if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); print_msg(msg); do_abort(instance); @@ -2953,7 +2953,7 @@ static int NCR5380_reset( Scsi_Cmnd *cmd, unsigned int reset_flags) * on any queue, so they won't be retried ... * * Conclusion: either scsi.c disables timeout for all resetted commands - * immediately, or we loose! As of linux-2.0.20 it doesn't. + * immediately, or we lose! As of linux-2.0.20 it doesn't. */ /* After the reset, there are no more connected or disconnected commands diff --git a/drivers/scsi/cpqfcTScontrol.c b/drivers/scsi/cpqfcTScontrol.c index 6534321d600c..0945a44536a7 100644 --- a/drivers/scsi/cpqfcTScontrol.c +++ b/drivers/scsi/cpqfcTScontrol.c @@ -586,7 +586,7 @@ int CpqTsInitializeFrameManager( void *pChip, int opcode) -// This "look ahead" function examines the IMQ for occurence of +// This "look ahead" function examines the IMQ for occurrence of // "type". Returns 1 if found, 0 if not. static int PeekIMQEntry( PTACHYON fcChip, ULONG type) { diff --git a/drivers/scsi/cpqfcTSinit.c b/drivers/scsi/cpqfcTSinit.c index e9d57386e838..05301d82aa24 100644 --- a/drivers/scsi/cpqfcTSinit.c +++ b/drivers/scsi/cpqfcTSinit.c @@ -1514,7 +1514,7 @@ int cpqfcTS_eh_abort(Scsi_Cmnd *Cmnd) Exchanges->fcExchange[i].timeOut = 10; // seconds default (changed later) // Since we need to immediately return the aborted Cmnd to Scsi - // upper layers, we can't make future reference to any of it's + // upper layers, we can't make future reference to any of its // fields (e.g the Nexus). cpqfcTSPutLinkQue( cpqfcHBAdata, BLS_ABTS, &i); diff --git a/drivers/scsi/cpqfcTSworker.c b/drivers/scsi/cpqfcTSworker.c index a45c448dc40b..7f5b643431a3 100644 --- a/drivers/scsi/cpqfcTSworker.c +++ b/drivers/scsi/cpqfcTSworker.c @@ -79,7 +79,7 @@ // synchronously (i.e. each of the 30k I/O had to be started one at a // time by sending a starting frame via Tachyon's outbound que). -// To accomodate kernel "module" build, this driver limits the exchanges +// To accommodate kernel "module" build, this driver limits the exchanges // to 256, because of the contiguous physical memory limitation of 128M. // Typical FC Exchanges are opened presuming the FC frames start without errors, diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 2916acf21f87..61c55a71812c 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -86,7 +86,7 @@ static dpt_sig_S DPTI_sig = { #elif defined(__alpha__) PROC_ALPHA , #else - (-1), + (-1),(-1) #endif FT_HBADRVR, 0, OEM_DPT, OS_LINUX, CAP_OVERLAP, DEV_ALL, ADF_ALL_SC5, 0, 0, DPT_VERSION, DPT_REVISION, DPT_SUBREVISION, @@ -1135,7 +1135,8 @@ static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout) // to support async LCT get wait_data->next = adpt_post_wait_queue; adpt_post_wait_queue = wait_data; - adpt_post_wait_id = (++adpt_post_wait_id & 0x7fff); + adpt_post_wait_id++; + adpt_post_wait_id &= 0x7fff; wait_data->id = adpt_post_wait_id; spin_unlock_irqrestore(&adpt_post_wait_lock, flags); @@ -1252,7 +1253,7 @@ static void adpt_i2o_post_wait_complete(u32 context, int status) } } spin_unlock(&adpt_post_wait_lock); - // If this happens we loose commands that probably really completed + // If this happens we lose commands that probably really completed printk(KERN_DEBUG"dpti: Could Not find task %d in wait queue\n",context); printk(KERN_DEBUG" Tasks in wait queue:\n"); for(p1 = adpt_post_wait_queue; p1; p1 = p1->next) { diff --git a/drivers/scsi/esp.c b/drivers/scsi/esp.c index a6eb8a9730fb..7d76267890a4 100644 --- a/drivers/scsi/esp.c +++ b/drivers/scsi/esp.c @@ -3567,7 +3567,7 @@ static int check_singlebyte_msg(struct esp *esp) /* Target negotiates for synchronous transfers before we do, this * is legal although very strange. What is even funnier is that * the SCSI2 standard specifically recommends against targets doing - * this because so many initiators cannot cope with this occuring. + * this because so many initiators cannot cope with this occurring. */ static int target_with_ants_in_pants(struct esp *esp, Scsi_Cmnd *SCptr, diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index ec83c7d6d207..362fc0d22bec 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -725,13 +725,13 @@ static int fdomain_isa_detect( int *irq, int *iobase ) switch (Quantum) { case 2: /* ISA_200S */ case 3: /* ISA_250MG */ - base = readb(bios_base + 0x1fa2) + (readb(bios_base + 0x1fa3) << 8); + base = isa_readb(bios_base + 0x1fa2) + (isa_readb(bios_base + 0x1fa3) << 8); break; case 4: /* ISA_200S (another one) */ - base = readb(bios_base + 0x1fa3) + (readb(bios_base + 0x1fa4) << 8); + base = isa_readb(bios_base + 0x1fa3) + (isa_readb(bios_base + 0x1fa4) << 8); break; default: - base = readb(bios_base + 0x1fcc) + (readb(bios_base + 0x1fcd) << 8); + base = isa_readb(bios_base + 0x1fcc) + (isa_readb(bios_base + 0x1fcd) << 8); break; } @@ -1777,7 +1777,7 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev, offset = bios_base + 0x1f31 + drive * 25; break; } - memcpy_fromio( &i, offset, sizeof( struct drive_info ) ); + isa_memcpy_fromio( &i, offset, sizeof( struct drive_info ) ); info_array[0] = i.heads; info_array[1] = i.sectors; info_array[2] = i.cylinders; diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 1b279782d0c9..d54dd434f4fc 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c @@ -323,7 +323,7 @@ int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt) printk(KERN_ERR "dtc436e probe: attach failed\n"); continue; } - if (pnp_activate_dev(dev, NULL) < 0) { + if (pnp_activate_dev(dev) < 0) { printk(KERN_ERR "dtc436e probe: activate failed\n"); pnp_device_detach(dev); continue; diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 4bb5cd8b38d9..2254530f9ad7 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -28,7 +28,7 @@ * * * $Log: gdth.c,v $ * Revision 1.61 2002/10/03 09:35:22 boji - * Fixed SCREENSERVICE intialisation in SMP cases. + * Fixed SCREENSERVICE initialisation in SMP cases. * Added checks for gdth_polling before GDTH_HA_LOCK * * Revision 1.60 2002/02/05 09:35:22 achim diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h index 237e56dfbc41..ed3e08986e7a 100644 --- a/drivers/scsi/gdth.h +++ b/drivers/scsi/gdth.h @@ -915,7 +915,7 @@ typedef struct { unchar ldr_no; /* log. drive no. */ unchar rw_attribs; /* r/w attributes */ unchar cluster_type; /* cluster properties */ - unchar media_changed; /* Flag:MOUNT/UNMOUNT occured */ + unchar media_changed; /* Flag:MOUNT/UNMOUNT occurred*/ ulong32 start_sec; /* start sector */ } hdr[MAX_LDRIVES]; /* host drives */ struct { diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 93c5167999bc..5624b82f7af5 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -270,21 +270,6 @@ int scsi_remove_host(struct Scsi_Host *shost) if (scsi_check_device_busy(sdev)) return 1; - /* - * Next we detach the high level drivers from the Scsi_Device - * structures - */ - list_for_each_entry(sdev, &shost->my_devices, siblings) { - scsi_detach_device(sdev); - - /* If something still attached, punt */ - if (sdev->attached) { - printk(KERN_ERR "Attached usage count = %d\n", - sdev->attached); - return 1; - } - } - scsi_forget_host(shost); return 0; } diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index b79ad61bb7a9..9025464ac05a 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -1801,7 +1801,7 @@ error: /* */ /* Routine Description: */ /* Fill in a single scb sg_list element from an address */ -/* return a -1 if a breakup occured */ +/* return a -1 if a breakup occurred */ /****************************************************************************/ static inline int ips_fill_scb_sg_single(ips_ha_t *ha, dma_addr_t busaddr, ips_scb_t *scb, int indx, unsigned int e_len) @@ -2737,7 +2737,7 @@ ips_next(ips_ha_t *ha, int intr) { scb->dcdb.cmd_attribute = ips_command_direction[scb->scsi_cmd->cmnd[0]]; - if (!scb->dcdb.cmd_attribute & 0x3) + if (!(scb->dcdb.cmd_attribute & 0x3)) scb->dcdb.transfer_length = 0; if (scb->data_len >= IPS_MAX_XFER) { @@ -3315,7 +3315,7 @@ ips_done(ips_ha_t *ha, ips_scb_t *scb) { scb->dcdb.transfer_length = scb->data_len; scb->dcdb.cmd_attribute |= ips_command_direction[scb->scsi_cmd->cmnd[0]]; - if (!scb->dcdb.cmd_attribute & 0x3) + if (!(scb->dcdb.cmd_attribute & 0x3)) scb->dcdb.transfer_length = 0; if (scb->data_len >= IPS_MAX_XFER) { diff --git a/drivers/scsi/mac_NCR5380.c b/drivers/scsi/mac_NCR5380.c index 2fe5a1c5b76e..b51eda3f8110 100644 --- a/drivers/scsi/mac_NCR5380.c +++ b/drivers/scsi/mac_NCR5380.c @@ -2694,7 +2694,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) phase = PHASE_MSGIN; NCR5380_transfer_pio(instance, &phase, &len, &data); - if (!msg[0] & 0x80) { + if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); print_msg(msg); do_abort(instance); @@ -3082,7 +3082,7 @@ static int NCR5380_reset( Scsi_Cmnd *cmd, unsigned int reset_flags) * on any queue, so they won't be retried ... * * Conclusion: either scsi.c disables timeout for all resetted commands - * immediately, or we loose! As of linux-2.0.20 it doesn't. + * immediately, or we lose! As of linux-2.0.20 it doesn't. */ /* After the reset, there are no more connected or disconnected commands diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 9fd98b34e45c..6e6cf37b63f2 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -309,7 +309,7 @@ * Thu Mar 15 18:38:11 EST 2001 - AM * * Firmware version check removed if subsysid==0x1111 and - * subsysvid==0x1111, since its not yet initialized. + * subsysvid==0x1111, since it's not yet initialized. * * changes made to correctly calculate the base in mega_findCard. * @@ -1714,7 +1714,7 @@ static int mega_driver_ioctl (mega_host_config * megaCfg, Scsi_Cmnd * SCpnt) unsigned char *data = (unsigned char *) SCpnt->request_buffer; mega_driver_info driver_info; - /* If this is not our command dont do anything */ + /* If this is not our command don't do anything */ if (SCpnt->cmnd[0] != M_RD_DRIVER_IOCTL_INTERFACE) return 0; @@ -2879,7 +2879,7 @@ static int mega_findCard (Scsi_Host_Template * pHostTmpl, #endif } - /* Hmmm...Should we not make this more modularized so that in future we dont add + /* Hmmm...Should we not make this more modularized so that in future we don't add for each firmware */ if (flag & BOARD_QUARTZ) { @@ -2906,7 +2906,7 @@ static int mega_findCard (Scsi_Host_Template * pHostTmpl, * pci_vendor_id not subsysvid - AM */ - /* If we dont detect this valid subsystem vendor id's + /* If we don't detect this valid subsystem vendor id's we refuse to load the driver PART of PC200X compliance */ diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index a2f23287c20c..a02be17066af 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -1536,7 +1536,7 @@ static struct script script0 __initdata = { /* ** Now there are 4 possibilities: ** - ** (1) The ncr looses arbitration. + ** (1) The ncr loses arbitration. ** This is ok, because it will try again, ** when the bus becomes idle. ** (But beware of the timeout function!) @@ -3090,7 +3090,7 @@ ncr_script_copy_and_bind (ncb_p np, ncrcmd *src, ncrcmd *dst, int len) case 0x8: /* ** JUMP / CALL - ** dont't relocate if relative :-) + ** don't relocate if relative :-) */ if (opcode & 0x00800000) relocs = 0; @@ -5852,7 +5852,7 @@ static void ncr_getsync(ncb_p np, u_char sfac, u_char *fakp, u_char *scntl3p) /* ** Why not to try the immediate lower divisor and to choose ** the one that allows the fastest output speed ? - ** We dont want input speed too much greater than output speed. + ** We don't want input speed too much greater than output speed. */ if (div >= 1 && fak < 8) { u_long fak2, per2; diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index 08da7288b6eb..dc1ed6a764ba 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c @@ -939,7 +939,7 @@ static int nsp32_reselection(nsp32_hw_data *data, unsigned char newlun) /* * If reselected New ID:LUN is not existed * or current nexus is not existed, unexpected - * reselection is occured. Send reject message. + * reselection is occurred. Send reject message. */ if (newid >= MAX_TARGET || newlun >= MAX_LUN) { nsp32_msg(KERN_WARNING, "unknown id/lun"); @@ -1333,7 +1333,7 @@ static void do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs) /* * AutoSCSI Interrupt. - * Note: This interrupt is occured when AutoSCSI is finished. Then + * Note: This interrupt is occurred when AutoSCSI is finished. Then * check SCSIEXECUTEPHASE, and do appropriate action. Each phases are * recorded when AutoSCSI sequencer has been processed. */ @@ -1345,7 +1345,7 @@ static void do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs) /* Selection Timeout, go busfree phase. */ if (auto_stat & SELECTION_TIMEOUT) { nsp32_dbg(NSP32_DEBUG_INTR, - "selection timeout occured"); + "selection timeout occurred"); SCpnt->result = DID_TIME_OUT << 16; nsp32_scsi_done(data, SCpnt); @@ -1357,7 +1357,7 @@ static void do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs) * MsgOut phase was processed. * If MSG_IN_OCCUER is not set, then MsgOut phase is * completed. Thus, msgoutlen must reset. Otherwise, - * nothing to do here. If MSG_OUT_OCCUER is occured, + * nothing to do here. If MSG_OUT_OCCUER is occurred, * then we will encounter the condition and check. */ if (!(auto_stat & MSG_IN_OCCUER) && @@ -1515,7 +1515,7 @@ static void do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs) /* PCI_IRQ */ if (irq_stat & IRQSTATUS_PCI_IRQ) { - nsp32_dbg(NSP32_DEBUG_INTR, "PCI IRQ occured"); + nsp32_dbg(NSP32_DEBUG_INTR, "PCI IRQ occurred"); /* Do nothing */ } @@ -1524,7 +1524,7 @@ static void do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs) nsp32_msg(KERN_ERR, "Received unexpected BMCNTERR IRQ! "); /* * TODO: To be implemented improving bus master - * transfer reliablity when BMCNTERR is occured in + * transfer reliablity when BMCNTERR is occurred in * AutoSCSI phase described in specification. */ } @@ -2300,7 +2300,7 @@ static int nsp32_busfree_occur(nsp32_hw_data *data, unsigned short execph) } else { /* * On the contrary, if unexpected bus free is - * occured, then negotiation is failed. Fall + * occurred, then negotiation is failed. Fall * back to ASYNC mode. */ nsp32_set_async(data, data->curtarget); @@ -2338,7 +2338,7 @@ static int nsp32_busfree_occur(nsp32_hw_data *data, unsigned short execph) return (TRUE); } else { /* Unexpected bus free */ - nsp32_msg(KERN_WARNING, "unexpected bus free occured"); + nsp32_msg(KERN_WARNING, "unexpected bus free occurred"); /* DID_ERROR? */ //SCpnt->result = (DID_OK << 16) | (SCpnt->SCp.Message << 8) | (SCpnt->SCp.Status << 0); @@ -2426,7 +2426,7 @@ static void nsp32_msgout_occur(nsp32_hw_data *data) "enter: msgoutlen: 0x%x", data->msgoutlen); /* - * If MsgOut phase is occured without having any + * If MsgOut phase is occurred without having any * message, then No_Operation is sent (SCSI-2). */ if (data->msgoutlen == 0) { @@ -2614,7 +2614,7 @@ static void nsp32_msgin_occur(nsp32_hw_data *data, unsigned long irq_status, case COMMAND_COMPLETE: case DISCONNECT: /* - * These messages should not be occured. + * These messages should not be occurred. * They should be processed on AutoSCSI sequencer. */ nsp32_msg(KERN_WARNING, @@ -2654,7 +2654,7 @@ static void nsp32_msgin_occur(nsp32_hw_data *data, unsigned long irq_status, case SAVE_POINTERS: /* - * These messages should not be occured. + * These messages should not be occurred. * They should be processed on AutoSCSI sequencer. */ nsp32_msg (KERN_WARNING, diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c index cda75b428d50..14c983e278d4 100644 --- a/drivers/scsi/oktagon_esp.c +++ b/drivers/scsi/oktagon_esp.c @@ -245,7 +245,7 @@ oktagon_notify_reboot(struct notifier_block *this, unsigned long code, void *x) if((code == SYS_DOWN || code == SYS_HALT) && (esp = current_esp)) { esp_bootup_reset(esp,esp->eregs); - udelay(500); /* Settle time. Maybe unneccessary. */ + udelay(500); /* Settle time. Maybe unnecessary. */ } return NOTIFY_DONE; } diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 5d99e11bf066..3cb40759ef34 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c @@ -2,7 +2,7 @@ A driver for Future Domain-compatible PCMCIA SCSI cards - fdomain_cs.c 1.43 2000/06/12 21:27:25 + fdomain_cs.c 1.47 2001/10/13 00:08:52 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -19,8 +19,8 @@ are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the - terms of the GNU General Public License version 2 (the "GPL"), in which - case the provisions of the GPL are applicable instead of the + terms of the GNU General Public License version 2 (the "GPL"), in + which case the provisions of the GPL are applicable instead of the above. If you wish to allow the use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the MPL, indicate your decision @@ -53,27 +53,30 @@ #include <pcmcia/cistpl.h> #include <pcmcia/ds.h> -#ifdef PCMCIA_DEBUG -static int pc_debug = PCMCIA_DEBUG; -MODULE_PARM(pc_debug, "i"); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version = -"fdomain_cs.c 1.43 2000/06/12 21:27:25 (David Hinds)"; -#else -#define DEBUG(n, args...) -#endif - /*====================================================================*/ -/* Parameters that can be set with 'insmod' */ +/* Module parameters */ + +MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>"); +MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver"); +MODULE_LICENSE("Dual MPL/GPL"); + +#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i") /* Bit map of interrupts to choose from */ -static u_int irq_mask = 0xdeb8; +INT_MODULE_PARM(irq_mask, 0xdeb8); static int irq_list[4] = { -1 }; - -MODULE_PARM(irq_mask, "i"); MODULE_PARM(irq_list, "1-4i"); +#ifdef PCMCIA_DEBUG +INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG); +#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) +static char *version = +"fdomain_cs.c 1.47 2001/10/13 00:08:52 (David Hinds)"; +#else +#define DEBUG(n, args...) +#endif + /*====================================================================*/ typedef struct scsi_info_t { @@ -213,6 +216,7 @@ static void fdomain_config(dev_link_t *link) u_char tuple_data[64]; Scsi_Device *dev; dev_node_t *node, **tail; + char str[16]; struct Scsi_Host *host; DEBUG(0, "fdomain_config(0x%p)\n", link); @@ -253,7 +257,8 @@ static void fdomain_config(dev_link_t *link) ints[0] = 2; ints[1] = link->io.BasePort1; ints[2] = link->irq.AssignedIRQ; - fdomain_setup("PCMCIA setup", ints); + sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); + fdomain_setup(str, ints); scsi_register_host(&driver_template); diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 92c9489cd12b..662a7cc517a8 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c @@ -128,7 +128,7 @@ MODULE_PARM(free_ports, "i"); MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0 (=no))"); /* /usr/src/linux/drivers/scsi/hosts.h */ -static Scsi_Host_Template driver_template = { +static Scsi_Host_Template nsp_driver_template = { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)) .proc_name = "nsp_cs", /* kernel 2.4 */ #else @@ -136,8 +136,10 @@ static Scsi_Host_Template driver_template = { #endif .proc_info = nsp_proc_info, .name = "WorkBit NinjaSCSI-3/32Bi(16bit)", +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) .detect = nsp_detect, .release = nsp_release, +#endif .info = nsp_info, .queuecommand = nsp_queuecommand, /* .eh_strategy_handler = nsp_eh_strategy,*/ @@ -1215,7 +1217,7 @@ timer_out: /*----------------------------------------------------------------*/ /* look for ninja3 card and init if found */ /*----------------------------------------------------------------*/ -static int nsp_detect(Scsi_Host_Template *sht) +static struct Scsi_Host *__nsp_detect(Scsi_Host_Template *sht) { struct Scsi_Host *host; /* registered host structure */ nsp_hw_data *data = &nsp_data; @@ -1225,7 +1227,7 @@ static int nsp_detect(Scsi_Host_Template *sht) request_region(data->BaseAddress, data->NumAddress, "nsp_cs"); host = scsi_register(sht, 0); if(host == NULL) - return 0; + return NULL; host->unique_id = data->BaseAddress; host->io_port = data->BaseAddress; @@ -1252,7 +1254,13 @@ static int nsp_detect(Scsi_Host_Template *sht) //MOD_INC_USE_COUNT; - return 1; /* detect done. */ + return host; +} + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) +static int nsp_detect(Scsi_Host_Template *sht) +{ + return (__nsp_detect(sht) != NULL); } static int nsp_release(struct Scsi_Host *shpnt) @@ -1271,6 +1279,7 @@ static int nsp_release(struct Scsi_Host *shpnt) return 0; } +#endif /*----------------------------------------------------------------*/ /* return info string */ @@ -1763,55 +1772,53 @@ static void nsp_cs_config(dev_link_t *link) } #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)) - scsi_register_host(&driver_template); + host = __nsp_detect(&nsp_driver_template); #else - scsi_register_module(MODULE_SCSI_HA, &driver_template); + scsi_register_module(MODULE_SCSI_HA, &nsp_driver_template); + for (host = scsi_hostlist; host != NULL; host = host->next) { + if (host->hostt == &nsp_driver_template) + break; #endif + if (!host) + goto cs_failed; + DEBUG(0, "GET_SCSI_INFO\n"); tail = &link->dev; info->ndev = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)) - for (host = scsi_host_get_next(NULL); host; - host = scsi_host_get_next(host)) { -#else - for (host = scsi_hostlist; host != NULL; host = host->next) { -#endif - if (host->hostt == &driver_template) { - list_for_each_entry (dev, &host->my_devices, siblings) { - u_long arg[2], id; - kernel_scsi_ioctl(dev, SCSI_IOCTL_GET_IDLUN, arg); - id = (arg[0]&0x0f) + ((arg[0]>>4)&0xf0) + - ((arg[0]>>8)&0xf00) + ((arg[0]>>12)&0xf000); - node = &info->node[info->ndev]; - node->minor = 0; - switch (dev->type) { - case TYPE_TAPE: - node->major = SCSI_TAPE_MAJOR; - sprintf(node->dev_name, "st#%04lx", id); - break; - case TYPE_DISK: - case TYPE_MOD: - node->major = SCSI_DISK0_MAJOR; - sprintf(node->dev_name, "sd#%04lx", id); - break; - case TYPE_ROM: - case TYPE_WORM: - node->major = SCSI_CDROM_MAJOR; - sprintf(node->dev_name, "sr#%04lx", id); - break; - default: - node->major = SCSI_GENERIC_MAJOR; - sprintf(node->dev_name, "sg#%04lx", id); - break; - } - *tail = node; tail = &node->next; - info->ndev++; - info->host = dev->host; - } + list_for_each_entry (dev, &host->my_devices, siblings) { + u_long arg[2], id; + kernel_scsi_ioctl(dev, SCSI_IOCTL_GET_IDLUN, arg); + id = (arg[0]&0x0f) + ((arg[0]>>4)&0xf0) + + ((arg[0]>>8)&0xf00) + ((arg[0]>>12)&0xf000); + node = &info->node[info->ndev]; + node->minor = 0; + switch (dev->type) { + case TYPE_TAPE: + node->major = SCSI_TAPE_MAJOR; + sprintf(node->dev_name, "st#%04lx", id); + break; + case TYPE_DISK: + case TYPE_MOD: + node->major = SCSI_DISK0_MAJOR; + sprintf(node->dev_name, "sd#%04lx", id); + break; + case TYPE_ROM: + case TYPE_WORM: + node->major = SCSI_CDROM_MAJOR; + sprintf(node->dev_name, "sr#%04lx", id); + break; + default: + node->major = SCSI_GENERIC_MAJOR; + sprintf(node->dev_name, "sg#%04lx", id); + break; } + *tail = node; tail = &node->next; + info->ndev++; + info->host = dev->host; } + *tail = NULL; if (info->ndev == 0) { printk(KERN_INFO "nsp_cs: no SCSI devices found\n"); @@ -1839,6 +1846,10 @@ static void nsp_cs_config(dev_link_t *link) req.Base+req.Size-1); printk("\n"); +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) + scsi_add_host(host, NULL); +#endif + link->state &= ~DEV_CONFIG_PENDING; return; @@ -1859,6 +1870,7 @@ cs_failed: static void nsp_cs_release(u_long arg) { dev_link_t *link = (dev_link_t *)arg; + scsi_info_t *info = link->priv; DEBUG(0, "%s(0x%p)\n", __FUNCTION__, link); @@ -1874,10 +1886,11 @@ static void nsp_cs_release(u_long arg) } /* Unlink the device chain */ -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)) - scsi_unregister_host(&driver_template); +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,2)) + scsi_unregister_module(MODULE_SCSI_HA, &nsp_driver_template); #else - scsi_unregister_module(MODULE_SCSI_HA, &driver_template); + scsi_remove_host(info->host); + scsi_unregister(info->host); #endif link->dev = NULL; diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index 73368cf79b2a..c8e9ae2f7878 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h @@ -280,8 +280,6 @@ static void nsp_cs_detach(dev_link_t *); static unsigned int nsphw_start_selection(Scsi_Cmnd *SCpnt, nsp_hw_data *data); static void nsp_start_timer(Scsi_Cmnd *SCpnt, nsp_hw_data *data, int time); -static int nsp_detect(Scsi_Host_Template * ); -static int nsp_release(struct Scsi_Host *shpnt); static const char *nsp_info(struct Scsi_Host *shpnt); static int nsp_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout); diff --git a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c index f973a25fe23d..2bb9ad10ba73 100644 --- a/drivers/scsi/qlogicfc.c +++ b/drivers/scsi/qlogicfc.c @@ -1563,7 +1563,7 @@ void isp2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs) /* * if any of the following are true we do not * call scsi_done. if the status is CS_ABORTED - * we dont have to call done because the upper + * we don't have to call done because the upper * level should already know its aborted. */ if (hostdata->handle_serials[le_hand] != Cmnd->serial_number diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index a9ca081ffd60..0dabe708d8aa 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c @@ -776,7 +776,7 @@ static void qpti_get_clock(struct qlogicpti *qpti) } /* The request and response queues must each be aligned - * on a page boundry. + * on a page boundary. */ static int __init qpti_map_queues(struct qlogicpti *qpti) { diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 3e3c3a4fe932..5632d669ca7a 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -1308,7 +1308,8 @@ void scsi_device_put(struct scsi_device *sdev) void scsi_set_device_offline(struct scsi_device *sdev) { struct scsi_cmnd *scmd; - int cmds_active = 0; + LIST_HEAD(active_list); + struct list_head *lh, *lh_sf; unsigned long flags; sdev->online = FALSE; @@ -1324,15 +1325,17 @@ void scsi_set_device_offline(struct scsi_device *sdev) if (!scsi_delete_timer(scmd)) { continue; } - - ++cmds_active; - - scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD); + list_add_tail(&scmd->eh_entry, &active_list); } } spin_unlock_irqrestore(&sdev->list_lock, flags); - if (!cmds_active) { + if (!list_empty(&active_list)) { + list_for_each_safe(lh, lh_sf, &active_list) { + scmd = list_entry(lh, struct scsi_cmnd, eh_entry); + scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD); + } + } else { /* FIXME: Send online state change hotplug event */ } } diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h index 60721e3052d1..449227234b0e 100644 --- a/drivers/scsi/scsi.h +++ b/drivers/scsi/scsi.h @@ -503,8 +503,9 @@ static inline void scsi_proc_host_rm(struct Scsi_Host *); /* * Prototypes for functions in scsi_scan.c */ -extern int scsi_add_single_device(uint, uint, uint, uint); -extern int scsi_remove_single_device(uint, uint, uint, uint); +extern struct scsi_device *scsi_add_device(struct Scsi_Host *, + uint, uint, uint); +extern int scsi_remove_device(struct scsi_device *); extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); /* diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index c027e8648c50..bcb7adda023c 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -194,7 +194,7 @@ int scsi_set_medium_removal(Scsi_Device *dev, char state) * of the given command. There is no way to override this. * - Data transfers are limited to PAGE_SIZE (4K on i386, 8K on alpha). * - The length (x + y) must be at least OMAX_SB_LEN bytes long to - * accomodate the sense buffer when an error occurs. + * accommodate the sense buffer when an error occurs. * The sense buffer is truncated to OMAX_SB_LEN (16) bytes so that * old code will not be surprised. * - If a Unix error occurs (e.g. ENOMEM) then the user will receive diff --git a/drivers/scsi/scsi_pc98.c b/drivers/scsi/scsi_pc98.c new file mode 100644 index 000000000000..d35e673b2162 --- /dev/null +++ b/drivers/scsi/scsi_pc98.c @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2003 Osamu Tomita <tomita@cinet.co.jp> + * + * PC9801 BIOS geometry handling. + */ + +#include <linux/module.h> +#include <linux/fs.h> +#include <linux/kernel.h> +#include <linux/genhd.h> +#include <linux/blk.h> +#include <asm/pc9800.h> + +#include "scsi.h" +#include "hosts.h" + + +/* XXX - For now, we assume the first (i.e. having the least host_no) + real (i.e. non-emulated) host adapter shall be BIOS-controlled one. + We *SHOULD* invent another way. */ +static inline struct Scsi_Host *first_real_host(void) +{ + struct Scsi_Host *shost = NULL; + + while ((shost = scsi_host_get_next(shost))) { + if (!shost->hostt->emulated) + break; + } + + return shost; +} + +static int pc98_first_bios_param(struct scsi_device *sdev, int *ip) +{ + const u8 *p = (&__PC9800SCA(u8, PC9800SCA_SCSI_PARAMS) + sdev->id * 4); + + ip[0] = p[1]; /* # of heads */ + ip[1] = p[0]; /* # of sectors/track */ + ip[2] = *(u16 *)&p[2] & 0x0fff; /* # of cylinders */ + if (p[3] & (1 << 6)) { /* #-of-cylinders is 16-bit */ + ip[2] |= (ip[0] & 0xf0) << 8; + ip[0] &= 0x0f; + } + + return 0; +} + +int pc98_bios_param(struct scsi_device *sdev, struct block_device *bdev, + sector_t capacity, int *ip) +{ + static struct Scsi_Host *first_real = first_real_host(); + + if (sdev->host == first_real && sdev->id < 7 && + __PC9800SCA_TEST_BIT(PC9800SCA_DISK_EQUIPS, sdev->id)) + return pc98_first_bios_param(sdev, ip); + + /* Assume PC-9801-92 compatible parameters for HAs without BIOS. */ + ip[0] = 8; + ip[1] = 32; + ip[2] = capacity / (8 * 32); + if (ip[2] > 65535) { /* if capacity >= 8GB */ + /* Recent on-board adapters seem to use this parameter. */ + ip[1] = 128; + ip[2] = capacity / (8 * 128); + if (ip[2] > 65535) { /* if capacity >= 32GB */ + /* Clip the number of cylinders. Currently + this is the limit that we deal with. */ + ip[2] = 65535; + } + } + + return 0; +} + +EXPORT_SYMBOL(pc98_bios_param); diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index a3bafc01181e..7df4feef4938 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -398,6 +398,50 @@ static void scsi_dump_status(int level) } #endif /* CONFIG_SCSI_LOGGING */ +static int scsi_add_single_device(uint host, uint channel, uint id, uint lun) +{ + struct Scsi_Host *shost; + struct scsi_device *sdev; + int error = -ENODEV; + + shost = scsi_host_hn_get(host); + if (!shost) + return -ENODEV; + + if (!scsi_find_device(shost, channel, id, lun)) { + sdev = scsi_add_device(shost, channel, id, lun); + if (IS_ERR(sdev)) + error = PTR_ERR(sdev); + else + error = 0; + } + + scsi_host_put(shost); + return error; +} + +static int scsi_remove_single_device(uint host, uint channel, uint id, uint lun) +{ + struct scsi_device *sdev; + struct Scsi_Host *shost; + int error = -ENODEV; + + shost = scsi_host_hn_get(host); + if (!shost) + return -ENODEV; + sdev = scsi_find_device(shost, channel, id, lun); + if (!sdev) + goto out; + if (sdev->access_count) + goto out; + + error = scsi_remove_device(sdev); +out: + scsi_host_put(shost); + return error; +} + + static int proc_scsi_gen_write(struct file * file, const char * buf, unsigned long length, void *data) { diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 5606dee0c915..46c283d26a20 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -189,6 +189,8 @@ struct dev_info scsi_static_device_list[] __initdata = { {"HITACHI", "DF500", "*", BLIST_SPARSELUN}, {"HITACHI", "DF600", "*", BLIST_SPARSELUN}, {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, + {"SUN", "T300", "*", BLIST_SPARSELUN}, + {"SUN", "T4", "*", BLIST_SPARSELUN}, { NULL, NULL, NULL, 0 }, }; @@ -1259,14 +1261,6 @@ static int scsi_add_lun(Scsi_Device *sdev, Scsi_Request *sreq, return SCSI_SCAN_LUN_PRESENT; } -static void scsi_remove_lun(struct scsi_device *sdev) -{ - devfs_unregister(sdev->de); - scsi_device_unregister(sdev); - - scsi_free_sdev(sdev); -} - /** * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it * @sdevscan: probe the LUN corresponding to this Scsi_Device @@ -1284,90 +1278,77 @@ static void scsi_remove_lun(struct scsi_device *sdev) * SCSI_SCAN_LUN_PRESENT: a new Scsi_Device was allocated and initialized **/ static int scsi_probe_and_add_lun(struct Scsi_Host *host, - struct request_queue **q, uint channel, uint id, - uint lun, int *bflagsp) + struct request_queue **q, uint channel, uint id, uint lun, + int *bflagsp, struct scsi_device **sdevp) { - Scsi_Device *sdev = NULL; - Scsi_Request *sreq = NULL; - unsigned char *scsi_result = NULL; - int bflags; - int res; + struct scsi_device *sdev; + struct scsi_request *sreq; + unsigned char *result; + int bflags, res = SCSI_SCAN_NO_RESPONSE; sdev = scsi_alloc_sdev(host, q, channel, id, lun); - if (sdev == NULL) - return SCSI_SCAN_NO_RESPONSE; + if (!sdev) + goto out; sreq = scsi_allocate_request(sdev); - if (sreq == NULL) { - printk(ALLOC_FAILURE_MSG, __FUNCTION__); - res = SCSI_SCAN_NO_RESPONSE; - goto bail_out; - } + if (!sreq) + goto out_free_sdev; + result = kmalloc(256, GFP_ATOMIC | + (host->unchecked_isa_dma) ? __GFP_DMA : 0); + if (!result) + goto out_free_sreq; + + scsi_probe_lun(sreq, result, &bflags); + if (sreq->sr_result) + goto out_free_result; + /* - * The sreq is for use only with sdevscan. + * result contains valid SCSI INQUIRY data. */ - - scsi_result = kmalloc(256, GFP_ATOMIC | - (host->unchecked_isa_dma) ? - GFP_DMA : 0); - if (scsi_result == NULL) { - printk(ALLOC_FAILURE_MSG, __FUNCTION__); - res = SCSI_SCAN_NO_RESPONSE; - goto bail_out; - } - - scsi_probe_lun(sreq, scsi_result, &bflags); - if (sreq->sr_result) - res = SCSI_SCAN_NO_RESPONSE; - else { + if ((result[0] >> 5) == 3) { /* - * scsi_result contains valid SCSI INQUIRY data. + * For a Peripheral qualifier 3 (011b), the SCSI + * spec says: The device server is not capable of + * supporting a physical device on this logical + * unit. + * + * For disks, this implies that there is no + * logical disk configured at sdev->lun, but there + * is a target id responding. */ - if ((scsi_result[0] >> 5) == 3) { - /* - * For a Peripheral qualifier 3 (011b), the SCSI - * spec says: The device server is not capable of - * supporting a physical device on this logical - * unit. - * - * For disks, this implies that there is no - * logical disk configured at sdev->lun, but there - * is a target id responding. - */ - SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO + SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: peripheral qualifier of 3," " no device added\n")); - res = SCSI_SCAN_TARGET_PRESENT; - } else { - res = scsi_add_lun(sdev, sreq, scsi_result, &bflags); - if (res == SCSI_SCAN_LUN_PRESENT) { - if ((bflags & BLIST_KEY) != 0) { - sdev->lockable = 0; - scsi_unlock_floptical(sreq, - scsi_result); - /* - * scsi_result no longer contains - * the INQUIRY data. - */ - } - if (bflagsp != NULL) - *bflagsp = bflags; - } + res = SCSI_SCAN_TARGET_PRESENT; + goto out_free_result; + } + + res = scsi_add_lun(sdev, sreq, result, &bflags); + if (res == SCSI_SCAN_LUN_PRESENT) { + if (bflags & BLIST_KEY) { + sdev->lockable = 0; + scsi_unlock_floptical(sreq, result); } + if (bflagsp) + *bflagsp = bflags; } -bail_out: - if (scsi_result != NULL) - kfree(scsi_result); - if (sreq != NULL) - scsi_release_request(sreq); - if (res != SCSI_SCAN_LUN_PRESENT) { - if(q) { + + out_free_result: + kfree(result); + out_free_sreq: + scsi_release_request(sreq); + out_free_sdev: + if (res == SCSI_SCAN_LUN_PRESENT) { + if (*sdevp) + *sdevp = sdev; + } else { + if (q) { *q = sdev->request_queue; sdev->request_queue = NULL; } scsi_free_sdev(sdev); } + out: return res; - } /** @@ -1453,8 +1434,8 @@ static void scsi_sequential_lun_scan(struct Scsi_Host *shost, * sparse_lun. */ for (lun = 1; lun < max_dev_lun; ++lun) - if ((scsi_probe_and_add_lun(shost, q, channel, id, lun, NULL) - != SCSI_SCAN_LUN_PRESENT) && !sparse_lun) + if ((scsi_probe_and_add_lun(shost, q, channel, id, lun, + NULL, NULL) != SCSI_SCAN_LUN_PRESENT) && !sparse_lun) return; } @@ -1669,7 +1650,7 @@ static int scsi_report_lun_scan(Scsi_Device *sdev, struct request_queue **q, int res; res = scsi_probe_and_add_lun(sdev->host, q, - sdev->channel, sdev->id, lun, NULL); + sdev->channel, sdev->id, lun, NULL, NULL); if (res == SCSI_SCAN_NO_RESPONSE) { /* * Got some results, but now none, abort. @@ -1691,55 +1672,33 @@ static int scsi_report_lun_scan(Scsi_Device *sdev, struct request_queue **q, } -int scsi_add_single_device(uint host, uint channel, uint id, uint lun) +struct scsi_device *scsi_add_device(struct Scsi_Host *shost, + uint channel, uint id, uint lun) { - struct Scsi_Host *shost; - int error = -ENODEV; struct scsi_device *sdev; + int error = -ENODEV, res; - shost = scsi_host_hn_get(host); - if (!shost) - return -ENODEV; - if(scsi_find_device(shost, channel, id, lun) != NULL) - goto out; + res = scsi_probe_and_add_lun(shost, NULL, channel, id, lun, + NULL, &sdev); + if (res == SCSI_SCAN_LUN_PRESENT) + error = scsi_attach_device(sdev); - if (scsi_probe_and_add_lun(shost, NULL, channel, id, lun, NULL) == - SCSI_SCAN_LUN_PRESENT) { - error = 0; - sdev = scsi_find_device(shost, channel, id, lun); - scsi_attach_device(sdev); - } -out: - scsi_host_put(shost); - return error; + if (error) + sdev = ERR_PTR(error); + return sdev; } -int scsi_remove_single_device(uint host, uint channel, uint id, uint lun) +int scsi_remove_device(struct scsi_device *sdev) { - struct scsi_device *sdev; - struct Scsi_Host *shost; - int error = -ENODEV; - - shost = scsi_host_hn_get(host); - if (!shost) - return -ENODEV; - sdev = scsi_find_device(shost, channel, id, lun); - if (!sdev) - goto out; - - error = -EBUSY; - if (sdev->access_count) - goto out; scsi_detach_device(sdev); if (sdev->attached) - goto out; + return -EINVAL; - scsi_remove_lun(sdev); - error = 0; + devfs_unregister(sdev->de); + scsi_device_unregister(sdev); -out: - scsi_host_put(shost); - return error; + scsi_free_sdev(sdev); + return 0; } /** @@ -1778,9 +1737,8 @@ static void scsi_scan_target(struct Scsi_Host *shost, struct request_queue **q, * Scan LUN 0, if there is some response, scan further. Ideally, we * would not configure LUN 0 until all LUNs are scanned. */ - res = scsi_probe_and_add_lun(shost, q, channel, id, 0, &bflags); + res = scsi_probe_and_add_lun(shost, q, channel, id, 0, &bflags, &sdev); if (res == SCSI_SCAN_LUN_PRESENT) { - sdev = scsi_find_device(shost, channel, id, 0); if (scsi_report_lun_scan(sdev, q, bflags) != 0) /* * The REPORT LUN did not scan the target, @@ -1846,9 +1804,13 @@ void scsi_scan_host(struct Scsi_Host *shost) void scsi_forget_host(struct Scsi_Host *shost) { struct list_head *le, *lh; + struct scsi_device *sdev; - list_for_each_safe(le, lh, &shost->my_devices) - scsi_remove_lun(list_entry(le, struct scsi_device, siblings)); + list_for_each_safe(le, lh, &shost->my_devices) { + sdev = list_entry(le, struct scsi_device, siblings); + + scsi_remove_device(sdev); + } } /* diff --git a/drivers/scsi/scsi_syms.c b/drivers/scsi/scsi_syms.c index f34595cd4059..bfe99315162c 100644 --- a/drivers/scsi/scsi_syms.c +++ b/drivers/scsi/scsi_syms.c @@ -78,6 +78,8 @@ EXPORT_SYMBOL(scsi_slave_attach); EXPORT_SYMBOL(scsi_slave_detach); EXPORT_SYMBOL(scsi_device_get); EXPORT_SYMBOL(scsi_device_put); +EXPORT_SYMBOL(scsi_add_device); +EXPORT_SYMBOL(scsi_remove_device); EXPORT_SYMBOL(scsi_set_device_offline); /* diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 13aa0d8b8280..ab2c022e717f 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -678,7 +678,7 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt) */ /* An error occurred */ - if (driver_byte(result) != 0 && /* An error occured */ + if (driver_byte(result) != 0 && /* An error occurred */ SCpnt->sense_buffer[0] == 0xF0) { /* Sense data is valid */ switch (SCpnt->sense_buffer[2]) { case MEDIUM_ERROR: @@ -719,7 +719,7 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt) case RECOVERED_ERROR: /* - * An error occured, but it recovered. Inform the + * An error occurred, but it recovered. Inform the * user, but make sure that it's not treated as a * hard error. */ diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c index ba482000859c..aff2408f2800 100644 --- a/drivers/scsi/seagate.c +++ b/drivers/scsi/seagate.c @@ -493,7 +493,7 @@ int __init seagate_st0x_detect (Scsi_Host_Template * tpnt) /* * At all times, we will use IRQ 5. Should also check for IRQ3 - * if we loose our first interrupt. + * if we lose our first interrupt. */ instance = scsi_register (tpnt, 0); if (instance == NULL) diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c index 28e609099d9b..0b7e93bcc289 100644 --- a/drivers/scsi/sgiwd93.c +++ b/drivers/scsi/sgiwd93.c @@ -4,10 +4,13 @@ * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * 1999 Andrew R. Baker (andrewb@uab.edu) * - Support for 2nd SCSI controller on Indigo2 + * 2001 Florian Lohoff (flo@rfc822.org) + * - Delete HPC scatter gather (Read corruption on + * multiple disks) + * - Cleanup wback cache handling * * (In all truth, Jed Schimmel wrote all this code.) * - * $Id: sgiwd93.c,v 1.19 2000/02/04 07:40:47 ralf Exp $ */ #include <linux/init.h> #include <linux/types.h> @@ -36,32 +39,13 @@ struct hpc_chunk { struct hpc_dma_desc desc; - unsigned long padding; + u32 _padding; /* align to quadword boundary */ }; struct Scsi_Host *sgiwd93_host = NULL; struct Scsi_Host *sgiwd93_host1 = NULL; /* Wuff wuff, wuff, wd33c93.c, wuff wuff, object oriented, bow wow. */ -static inline void write_wd33c93_count(const wd33c93_regs regs, - unsigned long value) -{ - *regs.SASR = WD_TRANSFER_COUNT_MSB; - *regs.SCMD = ((value >> 16) & 0xff); - *regs.SCMD = ((value >> 8) & 0xff); - *regs.SCMD = ((value >> 0) & 0xff); -} - -static inline unsigned long read_wd33c93_count(const wd33c93_regs regs) -{ - unsigned long value; - - *regs.SASR = WD_TRANSFER_COUNT_MSB; - value = (*regs.SCMD << 16); - value |= (*regs.SCMD << 8); - value |= (*regs.SCMD << 0); - return value; -} /* XXX woof! */ static void sgiwd93_intr(int irq, void *dev_id, struct pt_regs *regs) @@ -82,7 +66,6 @@ void fill_hpc_entries (struct hpc_chunk **hcp, char *addr, unsigned long len) unsigned long physaddr; unsigned long count; - dma_cache_wback_inv((unsigned long)addr,len); physaddr = PHYSADDR(addr); while (len) { /* @@ -101,7 +84,6 @@ void fill_hpc_entries (struct hpc_chunk **hcp, char *addr, unsigned long len) static int dma_setup(Scsi_Cmnd *cmd, int datainp) { struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)cmd->host->hostdata; - const wd33c93_regs regs = hdata->regs; struct hpc3_scsiregs *hregs = (struct hpc3_scsiregs *) cmd->host->base; struct hpc_chunk *hcp = (struct hpc_chunk *) hdata->dma_bounce_buffer; @@ -112,46 +94,17 @@ static int dma_setup(Scsi_Cmnd *cmd, int datainp) hdata->dma_dir = datainp; - if(cmd->SCp.buffers_residual) { - struct scatterlist *slp = cmd->SCp.buffer; - int i, totlen = 0; + /* + * wd33c93 shouldn't pass us bogus dma_setups, but + * it does:-( The other wd33c93 drivers deal with + * it the same way (which isn't that obvious). + * IMHO a better fix would be, not to do these + * dma setups in the first place + */ + if (cmd->SCp.ptr == NULL) + return 1; -#ifdef DEBUG_DMA - printk("SCLIST<"); -#endif - for(i = 0; i <= cmd->SCp.buffers_residual; i++) { -#ifdef DEBUG_DMA - printk("[%p,%d]", - page_address(slp[i].page) + slp[i].offset, - slp[i].length); -#endif - fill_hpc_entries (&hcp, - page_address(slp[i].page) + slp[i].offset, - slp[i].length); - totlen += slp[i].length; - } -#ifdef DEBUG_DMA - printk(">tlen<%d>", totlen); -#endif - hdata->dma_bounce_len = totlen; /* a trick... */ - write_wd33c93_count(regs, totlen); - } else { - /* Non-scattered dma. */ -#ifdef DEBUG_DMA - printk("ONEBUF<%p,%d>", cmd->SCp.ptr, cmd->SCp.this_residual); -#endif - /* - * wd33c93 shouldn't pass us bogus dma_setups, but - * it does:-( The other wd33c93 drivers deal with - * it the same way (which isn't that obvious). - * IMHO a better fix would be, not to do these - * dma setups in the first place - */ - if (cmd->SCp.ptr == NULL) - return 1; - fill_hpc_entries (&hcp, cmd->SCp.ptr,cmd->SCp.this_residual); - write_wd33c93_count(regs, cmd->SCp.this_residual); - } + fill_hpc_entries (&hcp, cmd->SCp.ptr,cmd->SCp.this_residual); /* To make sure, if we trip an HPC bug, that we transfer * every single byte, we tag on an extra zero length dma @@ -166,10 +119,14 @@ static int dma_setup(Scsi_Cmnd *cmd, int datainp) /* Start up the HPC. */ hregs->ndptr = PHYSADDR(hdata->dma_bounce_buffer); - if(datainp) + if(datainp) { + dma_cache_inv((unsigned long) cmd->SCp.ptr, cmd->SCp.this_residual); hregs->ctrl = (HPC3_SCTRL_ACTIVE); - else + } else { + dma_cache_wback_inv((unsigned long) cmd->SCp.ptr, cmd->SCp.this_residual); hregs->ctrl = (HPC3_SCTRL_ACTIVE | HPC3_SCTRL_DIR); + } + return 0; } @@ -177,7 +134,6 @@ static void dma_stop(struct Scsi_Host *instance, Scsi_Cmnd *SCpnt, int status) { struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)instance->hostdata; - const wd33c93_regs regs = hdata->regs; struct hpc3_scsiregs *hregs; if (!SCpnt) @@ -197,44 +153,6 @@ static void dma_stop(struct Scsi_Host *instance, Scsi_Cmnd *SCpnt, } hregs->ctrl = 0; - /* See how far we got and update scatterlist state if necessary. */ - if(SCpnt->SCp.buffers_residual) { - struct scatterlist *slp = SCpnt->SCp.buffer; - int totlen, wd93_residual, transferred, i; - - /* Yep, we were doing the scatterlist thang. */ - totlen = hdata->dma_bounce_len; - wd93_residual = read_wd33c93_count(regs); - transferred = totlen - wd93_residual; - -#ifdef DEBUG_DMA - printk("tlen<%d>resid<%d>transf<%d> ", - totlen, wd93_residual, transferred); -#endif - - /* Avoid long winded partial-transfer search for common case. */ - if(transferred != totlen) { - /* This is the nut case. */ -#ifdef DEBUG_DMA - printk("Jed was here..."); -#endif - for(i = 0; i <= SCpnt->SCp.buffers_residual; i++) { - if(slp[i].length >= transferred) - break; - transferred -= slp[i].length; - } - } else { - /* This is the common case. */ -#ifdef DEBUG_DMA - printk("did it all..."); -#endif - i = SCpnt->SCp.buffers_residual; - } - SCpnt->SCp.buffer = &slp[i]; - SCpnt->SCp.buffers_residual = SCpnt->SCp.buffers_residual - i; - SCpnt->SCp.ptr = (char *) page_address(slp[i].page) + slp[i].offset; - SCpnt->SCp.this_residual = slp[i].length; - } #ifdef DEBUG_DMA printk("\n"); #endif @@ -264,6 +182,9 @@ static inline void init_hpc_chain(uchar *buf) }; hcp--; hcp->desc.pnext = PHYSADDR(buf); + + /* Force flush to memory */ + dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE); } int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) @@ -273,8 +194,8 @@ int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) struct hpc3_scsiregs *hregs1 = &hpc3c0->scsi_chan1; struct WD33C93_hostdata *hdata; struct WD33C93_hostdata *hdata1; - uchar *buf; wd33c93_regs regs; + uchar *buf; if(called) return 0; /* Should bitch on the console about this... */ @@ -294,10 +215,10 @@ int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) return 0; } init_hpc_chain(buf); - dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE); + /* HPC_SCSI_REG0 | 0x03 | KSEG1 */ - regs.SASR = (volatile unsigned char *)KSEG1ADDR (0x1fbc0003); - regs.SCMD = (volatile unsigned char *)KSEG1ADDR (0x1fbc0007); + regs.SASR = (unsigned char*) KSEG1ADDR (0x1fbc0003); + regs.SCMD = (unsigned char*) KSEG1ADDR (0x1fbc0007); wd33c93_init(sgiwd93_host, regs, dma_setup, dma_stop, WD33C93_FS_16_20); hdata = (struct WD33C93_hostdata *)sgiwd93_host->hostdata; @@ -329,17 +250,16 @@ int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) return 1; /* We registered host0 so return success*/ } init_hpc_chain(buf); - dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE); + /* HPC_SCSI_REG1 | 0x03 | KSEG1 */ - regs.SASR = (volatile unsigned char *)KSEG1ADDR (0x1fbc8003); - regs.SCMD = (volatile unsigned char *)KSEG1ADDR (0x1fbc8007); + regs.SASR = (unsigned char*) KSEG1ADDR(0x1fbc8003); + regs.SCMD = (unsigned char*) KSEG1ADDR(0x1fbc8007); wd33c93_init(sgiwd93_host1, regs, dma_setup, dma_stop, - WD33C93_FS_16_20); + WD33C93_FS_16_20); hdata1 = (struct WD33C93_hostdata *)sgiwd93_host1->hostdata; hdata1->no_sync = 0; hdata1->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf)); - dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE); if (request_irq(SGI_WD93_1_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host1)) { printk(KERN_WARNING "sgiwd93: Could not allocate irq %d (for host1).\n", SGI_WD93_1_IRQ); diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 0de2e7c68206..e7bd41baaad4 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -26,7 +26,7 @@ * Modified by Richard Gooch <rgooch@atnf.csiro.au> to support devfs * * Modified by Jens Axboe <axboe@suse.de> - support DVD-RAM - * transparently and loose the GHOST hack + * transparently and lose the GHOST hack * * Modified by Arnaldo Carvalho de Melo <acme@conectiva.com.br> * check resource allocation in sr_init and some cleanups diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 0dce7891db30..51f31ea12961 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -2963,7 +2963,7 @@ static int nbr_partitions(Scsi_Tape *STp) set the size of partition 1. There is no size field for the default partition. Michael Schaefer's Sony SDT-7000 returns two descriptors and the second is used to set the size of partition 1 (this is what the SCSI-3 standard specifies). - The following algorithm is used to accomodate both drives: if the number of + The following algorithm is used to accommodate both drives: if the number of partition size fields is greater than the maximum number of additional partitions in the mode page, the second field is used. Otherwise the first field is used. diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 62ee4cf8e5f3..7ab4086e6f26 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c @@ -2564,7 +2564,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) msg[0] = NCR5380_read(CURRENT_SCSI_DATA_REG); #endif - if (!msg[0] & 0x80) { + if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); print_msg(msg); do_abort(instance); @@ -2970,7 +2970,7 @@ static int NCR5380_reset( Scsi_Cmnd *cmd, unsigned int reset_flags) * on any queue, so they won't be retried ... * * Conclusion: either scsi.c disables timeout for all resetted commands - * immediately, or we loose! As of linux-2.0.20 it doesn't. + * immediately, or we lose! As of linux-2.0.20 it doesn't. */ /* After the reset, there are no more connected or disconnected commands diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c index 7fd253d96f8a..978e81e9e602 100644 --- a/drivers/scsi/sun3_scsi.c +++ b/drivers/scsi/sun3_scsi.c @@ -543,7 +543,7 @@ static int sun3scsi_dma_finish(int write_flag) #if 1 // check to empty the fifo on a read if(!write_flag) { - int tmo = 200000; /* 2 sec */ + int tmo = 20000; /* .2 sec */ while(1) { if(dregs->csr & CSR_FIFO_EMPTY) diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c index 961324401447..86c0d9a5b1f6 100644 --- a/drivers/scsi/sym53c416.c +++ b/drivers/scsi/sym53c416.c @@ -679,7 +679,7 @@ int __init sym53c416_detect(Scsi_Host_Template *tpnt) printk(KERN_WARNING "sym53c416: unable to attach PnP device.\n"); continue; } - if(pnp_activate_dev(idev, NULL)<0) + if(pnp_activate_dev(idev) < 0) { printk(KERN_WARNING "sym53c416: unable to activate PnP device.\n"); pnp_device_detach(idev); diff --git a/drivers/scsi/sym53c8xx.c b/drivers/scsi/sym53c8xx.c index cae16c9d3f5d..c9ae078c96f1 100644 --- a/drivers/scsi/sym53c8xx.c +++ b/drivers/scsi/sym53c8xx.c @@ -2677,7 +2677,7 @@ static struct script script0 __initdata = { /* ** Now there are 4 possibilities: ** - ** (1) The ncr looses arbitration. + ** (1) The ncr loses arbitration. ** This is ok, because it will try again, ** when the bus becomes idle. ** (But beware of the timeout function!) @@ -3653,7 +3653,7 @@ static struct scripth scripth0 __initdata = { ** some target to reset or some disconnected ** job to abort. Since error recovery is a serious ** busyness, we will really reset the SCSI BUS, if - ** case of a SCSI interrupt occuring in this path. + ** case of a SCSI interrupt occurring in this path. */ /* @@ -4631,7 +4631,7 @@ ncr_script_copy_and_bind (ncb_p np,ncrcmd *src,ncrcmd *dst,int len) case 0x8: /* ** JUMP / CALL - ** dont't relocate if relative :-) + ** don't relocate if relative :-) */ if (opcode & 0x00800000) relocs = 0; @@ -6984,7 +6984,7 @@ static void ncr_soft_reset(ncb_p np) INW (nc_sist); } else if (istat & DIP) { - if (INB (nc_dstat) & ABRT); + if (INB (nc_dstat) & ABRT) break; } UDELAY(5); @@ -7953,7 +7953,7 @@ static void ncr_getsync(ncb_p np, u_char sfac, u_char *fakp, u_char *scntl3p) /* ** Why not to try the immediate lower divisor and to choose ** the one that allows the fastest output speed ? - ** We dont want input speed too much greater than output speed. + ** We don't want input speed too much greater than output speed. */ if (div >= 1 && fak < 8) { u_long fak2, per2; @@ -9092,7 +9092,7 @@ void ncr_int_udc (ncb_p np) ccb_p cp = ncr_ccb_from_dsa(np, dsa); /* - * Fix Up. Some disks respond to a PPR negotation with + * Fix Up. Some disks respond to a PPR negotiation with * a bus free instead of a message reject. * Disable ppr negotiation if this is first time * tried ppr negotiation. diff --git a/drivers/scsi/sym53c8xx_2/sym_conf.h b/drivers/scsi/sym53c8xx_2/sym_conf.h index 0877411a8fe7..8bc52f731a5a 100644 --- a/drivers/scsi/sym53c8xx_2/sym_conf.h +++ b/drivers/scsi/sym53c8xx_2/sym_conf.h @@ -244,7 +244,7 @@ * But for HVD/SE only capable chips (825a, 875, 885), * the driver uses some heuristic to probe against HVD. * Normally, the chip senses the DIFFSENS signal and - * should switch its BUS tranceivers to high impedance + * should switch its BUS transceivers to high impedance * in situation of the driver having been wrong about * the actual BUS mode. May-be, the BUS mode probing of * the driver is safe, but, given that it may be partially diff --git a/drivers/scsi/sym53c8xx_2/sym_fw.c b/drivers/scsi/sym53c8xx_2/sym_fw.c index 46858e893e2a..bcdd7c5297e0 100644 --- a/drivers/scsi/sym53c8xx_2/sym_fw.c +++ b/drivers/scsi/sym53c8xx_2/sym_fw.c @@ -539,7 +539,7 @@ void sym_fw_bind_script (hcb_p np, u32 *start, int len) case 0x8: /* * JUMP / CALL - * dont't relocate if relative :-) + * don't relocate if relative :-) */ if (opcode & 0x00800000) relocs = 0; diff --git a/drivers/scsi/sym53c8xx_2/sym_fw1.h b/drivers/scsi/sym53c8xx_2/sym_fw1.h index a859a05fbd4f..52df93b22d4c 100644 --- a/drivers/scsi/sym53c8xx_2/sym_fw1.h +++ b/drivers/scsi/sym53c8xx_2/sym_fw1.h @@ -340,7 +340,7 @@ static struct SYM_FWA_SCR SYM_FWA_SCR = { /* * Now there are 4 possibilities: * - * (1) The chip looses arbitration. + * (1) The chip loses arbitration. * This is ok, because it will try again, * when the bus becomes idle. * (But beware of the timeout function!) @@ -1361,7 +1361,7 @@ static struct SYM_FWB_SCR SYM_FWB_SCR = { * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ #ifdef SYM_CONF_TARGET_ROLE_SUPPORT diff --git a/drivers/scsi/sym53c8xx_2/sym_fw2.h b/drivers/scsi/sym53c8xx_2/sym_fw2.h index e494e1736a76..a6fbc2a7cdae 100644 --- a/drivers/scsi/sym53c8xx_2/sym_fw2.h +++ b/drivers/scsi/sym53c8xx_2/sym_fw2.h @@ -320,7 +320,7 @@ static struct SYM_FWA_SCR SYM_FWA_SCR = { /* * Now there are 4 possibilities: * - * (1) The chip looses arbitration. + * (1) The chip loses arbitration. * This is ok, because it will try again, * when the bus becomes idle. * (But beware of the timeout function!) @@ -1246,7 +1246,7 @@ static struct SYM_FWB_SCR SYM_FWB_SCR = { * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ #ifdef SYM_CONF_TARGET_ROLE_SUPPORT /* diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index 09dd64a262be..8a62efc349a3 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c @@ -125,7 +125,7 @@ void sym_mdelay(int ms) { mdelay(ms); } * * The whole SCSI sub-system under Linux is basically single-threaded. * Everything, including low-level driver interrupt routine, happens - * whith the `io_request_lock' held. + * with the `io_request_lock' held. * The sym53c8xx-1.x drivers series ran their interrupt code using a * spin mutex per controller. This added complexity without improving * scalability significantly. the sym-2 driver still use a spinlock diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index 7f37b6e2fb2f..53b204acda75 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c @@ -234,7 +234,7 @@ static void sym_soft_reset (hcb_p np) INW (nc_sist); } else if (istat & DIP) { - if (INB (nc_dstat) & ABRT); + if (INB (nc_dstat) & ABRT) break; } UDELAY(5); diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c index 37bb9c87e677..f9cb9e3c8d1e 100644 --- a/drivers/scsi/wd33c93.c +++ b/drivers/scsi/wd33c93.c @@ -1,7 +1,4 @@ /* - * wd33c93.c - Linux-68k device driver for the Commodore - * Amiga A2091/590 SCSI controller card - * * Copyright (c) 1996 John Shifflett, GeoLog Consulting * john@geolog.com * jshiffle@netcom.com @@ -15,8 +12,9 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * + */ + +/* * Drew Eckhardt's excellent 'Generic NCR5380' sources from Linux-PC * provided much of the inspiration and some of the code for this * driver. Everything I know about Amiga DMA was gleaned from careful @@ -76,38 +74,26 @@ #include <linux/config.h> #include <linux/module.h> -#include <asm/system.h> #include <linux/sched.h> #include <linux/string.h> #include <linux/delay.h> #include <linux/version.h> #include <linux/init.h> -#include <asm/irq.h> #include <linux/blk.h> +#include <asm/irq.h> #include "scsi.h" #include "hosts.h" - -#define WD33C93_VERSION "1.25" -#define WD33C93_DATE "09/Jul/1997" -/* NOTE: 1.25 for m68k is related to in2000-1.31 for x86 */ - -/* - * Note - the following defines have been moved to 'wd33c93.h': - * - * PROC_INTERFACE - * PROC_STATISTICS - * SYNC_DEBUG - * DEBUGGING_ON - * DEBUG_DEFAULTS - * - */ - - #include "wd33c93.h" +#define WD33C93_VERSION "1.26" +#define WD33C93_DATE "22/Feb/2003" + +MODULE_AUTHOR("John Shifflett"); +MODULE_DESCRIPTION("Generic WD33C93 SCSI driver"); +MODULE_LICENSE("GPL"); /* * 'setup_strings' is a single string used to pass operating parameters and @@ -163,172 +149,223 @@ */ /* Normally, no defaults are specified */ -static char *setup_args[] = - {"","","","","","","","",""}; +static char *setup_args[] = { "", "", "", "", "", "", "", "", "" }; -/* filled in by 'insmod' */ -static char *setup_strings = 0; - -#ifdef MODULE_PARM +static char *setup_strings; MODULE_PARM(setup_strings, "s"); -#endif - +static void wd33c93_execute(struct Scsi_Host *instance); -static inline uchar read_wd33c93(const wd33c93_regs regs, uchar reg_num) +#ifdef CONFIG_WD33C93_PIO +static inline uchar +read_wd33c93(const wd33c93_regs regs, uchar reg_num) { - *regs.SASR = reg_num; - mb(); - return(*regs.SCMD); + uchar data; + + outb(reg_num, *regs.SASR); + data = inb(*regs.SCMD); + return data; } +static inline unsigned long +read_wd33c93_count(const wd33c93_regs regs) +{ + unsigned long value; -#define READ_AUX_STAT() (*regs.SASR) + outb(WD_TRANSFER_COUNT_MSB, *regs.SASR); + value = inb(*regs.SCMD) << 16; + value |= inb(*regs.SCMD) << 8; + value |= inb(*regs.SCMD); + return value; +} +static inline uchar +read_aux_stat(const wd33c93_regs regs) +{ + return inb(*regs.SASR); +} -static inline void write_wd33c93(const wd33c93_regs regs, uchar reg_num, - uchar value) +static inline void +write_wd33c93(const wd33c93_regs regs, uchar reg_num, uchar value) { - *regs.SASR = reg_num; - mb(); - *regs.SCMD = value; - mb(); + outb(reg_num, *regs.SASR); + outb(value, *regs.SCMD); } +static inline void +write_wd33c93_count(const wd33c93_regs regs, unsigned long value) +{ + outb(WD_TRANSFER_COUNT_MSB, *regs.SASR); + outb((value >> 16) & 0xff, *regs.SCMD); + outb((value >> 8) & 0xff, *regs.SCMD); + outb( value & 0xff, *regs.SCMD); +} + +#define write_wd33c93_cmd(regs, cmd) \ + write_wd33c93((regs), WD_COMMAND, (cmd)) -static inline void write_wd33c93_cmd(const wd33c93_regs regs, uchar cmd) +static inline void +write_wd33c93_cdb(const wd33c93_regs regs, uint len, uchar cmnd[]) { - *regs.SASR = WD_COMMAND; - mb(); - *regs.SCMD = cmd; - mb(); + int i; + + outb(WD_CDB_1, *regs.SASR); + for (i=0; i<len; i++) + outb(cmnd[i], *regs.SCMD); } +#else /* CONFIG_WD33C93_PIO */ +static inline uchar +read_wd33c93(const wd33c93_regs regs, uchar reg_num) +{ + *regs.SASR = reg_num; + mb(); + return (*regs.SCMD); +} -static inline uchar read_1_byte(const wd33c93_regs regs) +static unsigned long +read_wd33c93_count(const wd33c93_regs regs) { -uchar asr; -uchar x = 0; - - write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); - write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO|0x80); - do { - asr = READ_AUX_STAT(); - if (asr & ASR_DBR) - x = read_wd33c93(regs, WD_DATA); - } while (!(asr & ASR_INT)); - return x; + unsigned long value; + + *regs.SASR = WD_TRANSFER_COUNT_MSB; + mb(); + value = *regs.SCMD << 16; + value |= *regs.SCMD << 8; + value |= *regs.SCMD; + mb(); + return value; } +static inline uchar +read_aux_stat(const wd33c93_regs regs) +{ + return *regs.SASR; +} -static void write_wd33c93_count(const wd33c93_regs regs, unsigned long value) +static inline void +write_wd33c93(const wd33c93_regs regs, uchar reg_num, uchar value) { - *regs.SASR = WD_TRANSFER_COUNT_MSB; - mb(); - *regs.SCMD = value >> 16; - *regs.SCMD = value >> 8; - *regs.SCMD = value; - mb(); + *regs.SASR = reg_num; + mb(); + *regs.SCMD = value; + mb(); } +static void +write_wd33c93_count(const wd33c93_regs regs, unsigned long value) +{ + *regs.SASR = WD_TRANSFER_COUNT_MSB; + mb(); + *regs.SCMD = value >> 16; + *regs.SCMD = value >> 8; + *regs.SCMD = value; + mb(); +} -static unsigned long read_wd33c93_count(const wd33c93_regs regs) +static inline void +write_wd33c93_cmd(const wd33c93_regs regs, uchar cmd) { -unsigned long value; - - *regs.SASR = WD_TRANSFER_COUNT_MSB; - mb(); - value = *regs.SCMD << 16; - value |= *regs.SCMD << 8; - value |= *regs.SCMD; - mb(); - return value; + *regs.SASR = WD_COMMAND; + mb(); + *regs.SCMD = cmd; + mb(); } +static inline void +write_wd33c93_cdb(const wd33c93_regs regs, uint len, uchar cmnd[]) +{ + int i; + + *regs.SASR = WD_CDB_1; + for (i = 0; i < len; i++) + *regs.SCMD = cmnd[i]; +} +#endif /* CONFIG_WD33C93_PIO */ + +static inline uchar +read_1_byte(const wd33c93_regs regs) +{ + uchar asr; + uchar x = 0; + + write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); + write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO | 0x80); + do { + asr = read_aux_stat(regs); + if (asr & ASR_DBR) + x = read_wd33c93(regs, WD_DATA); + } while (!(asr & ASR_INT)); + return x; +} /* The 33c93 needs to be told which direction a command transfers its * data; we use this function to figure it out. Returns true if there * will be a DATA_OUT phase with this command, false otherwise. * (Thanks to Joerg Dorchain for the research and suggestion.) */ -static int is_dir_out(Scsi_Cmnd *cmd) +static inline int +is_dir_out(Scsi_Cmnd * cmd) { - switch (cmd->cmnd[0]) { - case WRITE_6: case WRITE_10: case WRITE_12: - case WRITE_LONG: case WRITE_SAME: case WRITE_BUFFER: - case WRITE_VERIFY: case WRITE_VERIFY_12: - case COMPARE: case COPY: case COPY_VERIFY: - case SEARCH_EQUAL: case SEARCH_HIGH: case SEARCH_LOW: - case SEARCH_EQUAL_12: case SEARCH_HIGH_12: case SEARCH_LOW_12: - case FORMAT_UNIT: case REASSIGN_BLOCKS: case RESERVE: - case MODE_SELECT: case MODE_SELECT_10: case LOG_SELECT: - case SEND_DIAGNOSTIC: case CHANGE_DEFINITION: case UPDATE_BLOCK: - case SET_WINDOW: case MEDIUM_SCAN: case SEND_VOLUME_TAG: - case 0xea: - return 1; - default: - return 0; - } + return cmd->sc_data_direction == SCSI_DATA_WRITE; } - - static struct sx_period sx_table[] = { - { 1, 0x20}, - {252, 0x20}, - {376, 0x30}, - {500, 0x40}, - {624, 0x50}, - {752, 0x60}, - {876, 0x70}, - {1000,0x00}, - {0, 0} }; - -static int round_period(unsigned int period) + {1, 0x20}, + {252, 0x20}, + {376, 0x30}, + {500, 0x40}, + {624, 0x50}, + {752, 0x60}, + {876, 0x70}, + {1000, 0x00}, + {0, 0} +}; + +static int +round_period(unsigned int period) { -int x; - - for (x=1; sx_table[x].period_ns; x++) { - if ((period <= sx_table[x-0].period_ns) && - (period > sx_table[x-1].period_ns)) { - return x; - } - } - return 7; + int x; + + for (x = 1; sx_table[x].period_ns; x++) { + if ((period <= sx_table[x - 0].period_ns) && + (period > sx_table[x - 1].period_ns)) { + return x; + } + } + return 7; } -static uchar calc_sync_xfer(unsigned int period, unsigned int offset) +static uchar +calc_sync_xfer(unsigned int period, unsigned int offset) { -uchar result; + uchar result; - period *= 4; /* convert SDTR code to ns */ - result = sx_table[round_period(period)].reg_value; - result |= (offset < OPTIMUM_SX_OFF)?offset:OPTIMUM_SX_OFF; - return result; + period *= 4; /* convert SDTR code to ns */ + result = sx_table[round_period(period)].reg_value; + result |= (offset < OPTIMUM_SX_OFF) ? offset : OPTIMUM_SX_OFF; + return result; } - - -static void wd33c93_execute(struct Scsi_Host *instance); - -int wd33c93_queuecommand (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) +int +wd33c93_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) { - struct WD33C93_hostdata *hostdata; - Scsi_Cmnd *tmp; + struct WD33C93_hostdata *hostdata; + Scsi_Cmnd *tmp; - hostdata = (struct WD33C93_hostdata *)cmd->host->hostdata; + hostdata = (struct WD33C93_hostdata *) cmd->device->host->hostdata; -DB(DB_QUEUE_COMMAND,printk("Q-%d-%02x-%ld( ",cmd->target,cmd->cmnd[0],cmd->pid)) + DB(DB_QUEUE_COMMAND, + printk("Q-%d-%02x-%ld( ", cmd->device->id, cmd->cmnd[0], cmd->pid)) /* Set up a few fields in the Scsi_Cmnd structure for our own use: * - host_scribble is the pointer to the next cmd in the input queue * - scsi_done points to the routine we call when a cmd is finished * - result is what you'd expect */ - - cmd->host_scribble = NULL; - cmd->scsi_done = done; - cmd->result = 0; + cmd->host_scribble = NULL; + cmd->scsi_done = done; + cmd->result = 0; /* We use the Scsi_Pointer structure that's included with each command * as a scratchpad (as it's intended to be used!). The handy thing about @@ -345,19 +382,18 @@ DB(DB_QUEUE_COMMAND,printk("Q-%d-%02x-%ld( ",cmd->target,cmd->cmnd[0],cmd->pid)) * - SCp.phase records this command's SRCID_ER bit setting */ - if (cmd->use_sg) { - cmd->SCp.buffer = (struct scatterlist *)cmd->buffer; - cmd->SCp.buffers_residual = cmd->use_sg - 1; - cmd->SCp.ptr = page_address(cmd->SCp.buffer->page)+ - cmd->SCp.buffer->offset; - cmd->SCp.this_residual = cmd->SCp.buffer->length; - } - else { - cmd->SCp.buffer = NULL; - cmd->SCp.buffers_residual = 0; - cmd->SCp.ptr = (char *)cmd->request_buffer; - cmd->SCp.this_residual = cmd->request_bufflen; - } + if (cmd->use_sg) { + cmd->SCp.buffer = (struct scatterlist *) cmd->buffer; + cmd->SCp.buffers_residual = cmd->use_sg - 1; + cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + + cmd->SCp.buffer->offset; + cmd->SCp.this_residual = cmd->SCp.buffer->length; + } else { + cmd->SCp.buffer = NULL; + cmd->SCp.buffers_residual = 0; + cmd->SCp.ptr = (char *) cmd->request_buffer; + cmd->SCp.this_residual = cmd->request_bufflen; + } /* WD docs state that at the conclusion of a "LEVEL2" command, the * status byte can be retrieved from the LUN register. Apparently, @@ -376,41 +412,37 @@ DB(DB_QUEUE_COMMAND,printk("Q-%d-%02x-%ld( ",cmd->target,cmd->cmnd[0],cmd->pid)) * status byte is stored. */ - cmd->SCp.Status = ILLEGAL_STATUS_BYTE; + cmd->SCp.Status = ILLEGAL_STATUS_BYTE; - /* - * Add the cmd to the end of 'input_Q'. Note that REQUEST SENSE - * commands are added to the head of the queue so that the desired - * sense data is not lost before REQUEST_SENSE executes. - */ + /* + * Add the cmd to the end of 'input_Q'. Note that REQUEST SENSE + * commands are added to the head of the queue so that the desired + * sense data is not lost before REQUEST_SENSE executes. + */ - spin_lock_irq(&hostdata->lock); + spin_lock_irq(&hostdata->lock); - if (!(hostdata->input_Q) || (cmd->cmnd[0] == REQUEST_SENSE)) { - cmd->host_scribble = (uchar *)hostdata->input_Q; - hostdata->input_Q = cmd; - } - else { /* find the end of the queue */ - for (tmp=(Scsi_Cmnd *)hostdata->input_Q; tmp->host_scribble; - tmp=(Scsi_Cmnd *)tmp->host_scribble) - ; - tmp->host_scribble = (uchar *)cmd; - } + if (!(hostdata->input_Q) || (cmd->cmnd[0] == REQUEST_SENSE)) { + cmd->host_scribble = (uchar *) hostdata->input_Q; + hostdata->input_Q = cmd; + } else { /* find the end of the queue */ + for (tmp = (Scsi_Cmnd *) hostdata->input_Q; tmp->host_scribble; + tmp = (Scsi_Cmnd *) tmp->host_scribble) ; + tmp->host_scribble = (uchar *) cmd; + } /* We know that there's at least one command in 'input_Q' now. * Go see if any of them are runnable! */ - wd33c93_execute(cmd->host); + wd33c93_execute(cmd->device->host); -DB(DB_QUEUE_COMMAND,printk(")Q-%ld ",cmd->pid)) + DB(DB_QUEUE_COMMAND, printk(")Q-%ld ", cmd->pid)) - spin_unlock_irq(&hostdata->lock); - return 0; + spin_unlock_irq(&hostdata->lock); + return 0; } - - /* * This routine attempts to start a scsi command. If the host_card is * already connected, we give up immediately. Otherwise, look through @@ -421,64 +453,60 @@ DB(DB_QUEUE_COMMAND,printk(")Q-%ld ",cmd->pid)) * the wd33c93_intr itself, which means that a wd33c93 interrupt * cannot occur while we are in here. */ -static void wd33c93_execute (struct Scsi_Host *instance) +static void +wd33c93_execute(struct Scsi_Host *instance) { -struct WD33C93_hostdata *hostdata = (struct WD33C93_hostdata *)instance->hostdata; -const wd33c93_regs regs = hostdata->regs; -Scsi_Cmnd *cmd, *prev; -int i; - -DB(DB_EXECUTE,printk("EX(")) - - if (hostdata->selecting || hostdata->connected) { - -DB(DB_EXECUTE,printk(")EX-0 ")) - - return; - } - - /* - * Search through the input_Q for a command destined - * for an idle target/lun. - */ - - cmd = (Scsi_Cmnd *)hostdata->input_Q; - prev = 0; - while (cmd) { - if (!(hostdata->busy[cmd->target] & (1 << cmd->lun))) - break; - prev = cmd; - cmd = (Scsi_Cmnd *)cmd->host_scribble; - } - - /* quit if queue empty or all possible targets are busy */ - - if (!cmd) { - -DB(DB_EXECUTE,printk(")EX-1 ")) - - return; - } - - /* remove command from queue */ - - if (prev) - prev->host_scribble = cmd->host_scribble; - else - hostdata->input_Q = (Scsi_Cmnd *)cmd->host_scribble; + struct WD33C93_hostdata *hostdata = + (struct WD33C93_hostdata *) instance->hostdata; + const wd33c93_regs regs = hostdata->regs; + Scsi_Cmnd *cmd, *prev; + + DB(DB_EXECUTE, printk("EX(")) + if (hostdata->selecting || hostdata->connected) { + DB(DB_EXECUTE, printk(")EX-0 ")) + return; + } + + /* + * Search through the input_Q for a command destined + * for an idle target/lun. + */ + + cmd = (Scsi_Cmnd *) hostdata->input_Q; + prev = 0; + while (cmd) { + if (!(hostdata->busy[cmd->device->id] & (1 << cmd->device->lun))) + break; + prev = cmd; + cmd = (Scsi_Cmnd *) cmd->host_scribble; + } + + /* quit if queue empty or all possible targets are busy */ + + if (!cmd) { + DB(DB_EXECUTE, printk(")EX-1 ")) + return; + } + + /* remove command from queue */ + + if (prev) + prev->host_scribble = cmd->host_scribble; + else + hostdata->input_Q = (Scsi_Cmnd *) cmd->host_scribble; #ifdef PROC_STATISTICS - hostdata->cmd_cnt[cmd->target]++; + hostdata->cmd_cnt[cmd->device->id]++; #endif - /* - * Start the selection process - */ + /* + * Start the selection process + */ - if (is_dir_out(cmd)) - write_wd33c93(regs, WD_DESTINATION_ID, cmd->target); - else - write_wd33c93(regs, WD_DESTINATION_ID, cmd->target | DSTID_DPD); + if (is_dir_out(cmd)) + write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id); + else + write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id | DSTID_DPD); /* Now we need to figure out whether or not this command is a good * candidate for disconnect/reselect. We guess to the best of our @@ -503,55 +531,58 @@ DB(DB_EXECUTE,printk(")EX-1 ")) * to change around and experiment with for now. */ - cmd->SCp.phase = 0; /* assume no disconnect */ - if (hostdata->disconnect == DIS_NEVER) - goto no; - if (hostdata->disconnect == DIS_ALWAYS) - goto yes; - if (cmd->device->type == 1) /* tape drive? */ - goto yes; - if (hostdata->disconnected_Q) /* other commands disconnected? */ - goto yes; - if (!(hostdata->input_Q)) /* input_Q empty? */ - goto no; - for (prev=(Scsi_Cmnd *)hostdata->input_Q; prev; - prev=(Scsi_Cmnd *)prev->host_scribble) { - if ((prev->target != cmd->target) || (prev->lun != cmd->lun)) { - for (prev=(Scsi_Cmnd *)hostdata->input_Q; prev; - prev=(Scsi_Cmnd *)prev->host_scribble) - prev->SCp.phase = 1; - goto yes; - } - } - goto no; - -yes: - cmd->SCp.phase = 1; + cmd->SCp.phase = 0; /* assume no disconnect */ + if (hostdata->disconnect == DIS_NEVER) + goto no; + if (hostdata->disconnect == DIS_ALWAYS) + goto yes; + if (cmd->device->type == 1) /* tape drive? */ + goto yes; + if (hostdata->disconnected_Q) /* other commands disconnected? */ + goto yes; + if (!(hostdata->input_Q)) /* input_Q empty? */ + goto no; + for (prev = (Scsi_Cmnd *) hostdata->input_Q; prev; + prev = (Scsi_Cmnd *) prev->host_scribble) { + if ((prev->device->id != cmd->device->id) || + (prev->device->lun != cmd->device->lun)) { + for (prev = (Scsi_Cmnd *) hostdata->input_Q; prev; + prev = (Scsi_Cmnd *) prev->host_scribble) + prev->SCp.phase = 1; + goto yes; + } + } + + goto no; + + yes: + cmd->SCp.phase = 1; #ifdef PROC_STATISTICS - hostdata->disc_allowed_cnt[cmd->target]++; + hostdata->disc_allowed_cnt[cmd->device->id]++; #endif -no: + no: - write_wd33c93(regs, WD_SOURCE_ID, ((cmd->SCp.phase)?SRCID_ER:0)); + write_wd33c93(regs, WD_SOURCE_ID, ((cmd->SCp.phase) ? SRCID_ER : 0)); - write_wd33c93(regs, WD_TARGET_LUN, cmd->lun); - write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER,hostdata->sync_xfer[cmd->target]); - hostdata->busy[cmd->target] |= (1 << cmd->lun); + write_wd33c93(regs, WD_TARGET_LUN, cmd->device->lun); + write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER, + hostdata->sync_xfer[cmd->device->id]); + hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); - if ((hostdata->level2 == L2_NONE) || - (hostdata->sync_stat[cmd->target] == SS_UNSET)) { + if ((hostdata->level2 == L2_NONE) || + (hostdata->sync_stat[cmd->device->id] == SS_UNSET)) { - /* - * Do a 'Select-With-ATN' command. This will end with - * one of the following interrupts: - * CSR_RESEL_AM: failure - can try again later. - * CSR_TIMEOUT: failure - give up. - * CSR_SELECT: success - proceed. - */ + /* + * Do a 'Select-With-ATN' command. This will end with + * one of the following interrupts: + * CSR_RESEL_AM: failure - can try again later. + * CSR_TIMEOUT: failure - give up. + * CSR_SELECT: success - proceed. + */ - hostdata->selecting = cmd; + hostdata->selecting = cmd; /* Every target has its own synchronous transfer setting, kept in the * sync_xfer array, and a corresponding status byte in sync_stat[]. @@ -565,119 +596,115 @@ no: * later, but at that time we'll negotiate for async by specifying a * sync fifo depth of 0. */ - if (hostdata->sync_stat[cmd->target] == SS_UNSET) - hostdata->sync_stat[cmd->target] = SS_FIRST; - hostdata->state = S_SELECTING; - write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */ - write_wd33c93_cmd(regs, WD_CMD_SEL_ATN); - } - - else { - - /* - * Do a 'Select-With-ATN-Xfer' command. This will end with - * one of the following interrupts: - * CSR_RESEL_AM: failure - can try again later. - * CSR_TIMEOUT: failure - give up. - * anything else: success - proceed. - */ - - hostdata->connected = cmd; - write_wd33c93(regs, WD_COMMAND_PHASE, 0); - - /* copy command_descriptor_block into WD chip - * (take advantage of auto-incrementing) - */ - - *regs.SASR = WD_CDB_1; - for (i=0; i<cmd->cmd_len; i++) - *regs.SCMD = cmd->cmnd[i]; - - /* The wd33c93 only knows about Group 0, 1, and 5 commands when - * it's doing a 'select-and-transfer'. To be safe, we write the - * size of the CDB into the OWN_ID register for every case. This - * way there won't be problems with vendor-unique, audio, etc. - */ - - write_wd33c93(regs, WD_OWN_ID, cmd->cmd_len); - - /* When doing a non-disconnect command with DMA, we can save - * ourselves a DATA phase interrupt later by setting everything - * up ahead of time. - */ - - if ((cmd->SCp.phase == 0) && (hostdata->no_dma == 0)) { - if (hostdata->dma_setup(cmd, - (is_dir_out(cmd))?DATA_OUT_DIR:DATA_IN_DIR)) - write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */ - else { - write_wd33c93_count(regs, cmd->SCp.this_residual); - write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_DMA); - hostdata->dma = D_DMA_RUNNING; - } - } - else - write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */ - - hostdata->state = S_RUNNING_LEVEL2; - write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); - } - - /* - * Since the SCSI bus can handle only 1 connection at a time, - * we get out of here now. If the selection fails, or when - * the command disconnects, we'll come back to this routine - * to search the input_Q again... - */ - -DB(DB_EXECUTE,printk("%s%ld)EX-2 ",(cmd->SCp.phase)?"d:":"",cmd->pid)) + if (hostdata->sync_stat[cmd->device->id] == SS_UNSET) + hostdata->sync_stat[cmd->device->id] = SS_FIRST; + hostdata->state = S_SELECTING; + write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */ + write_wd33c93_cmd(regs, WD_CMD_SEL_ATN); + } else { + + /* + * Do a 'Select-With-ATN-Xfer' command. This will end with + * one of the following interrupts: + * CSR_RESEL_AM: failure - can try again later. + * CSR_TIMEOUT: failure - give up. + * anything else: success - proceed. + */ + + hostdata->connected = cmd; + write_wd33c93(regs, WD_COMMAND_PHASE, 0); + + /* copy command_descriptor_block into WD chip + * (take advantage of auto-incrementing) + */ + + write_wd33c93_cdb(regs, cmd->cmd_len, cmd->cmnd); + + /* The wd33c93 only knows about Group 0, 1, and 5 commands when + * it's doing a 'select-and-transfer'. To be safe, we write the + * size of the CDB into the OWN_ID register for every case. This + * way there won't be problems with vendor-unique, audio, etc. + */ + + write_wd33c93(regs, WD_OWN_ID, cmd->cmd_len); + + /* When doing a non-disconnect command with DMA, we can save + * ourselves a DATA phase interrupt later by setting everything + * up ahead of time. + */ + + if ((cmd->SCp.phase == 0) && (hostdata->no_dma == 0)) { + if (hostdata->dma_setup(cmd, + (is_dir_out(cmd)) ? DATA_OUT_DIR + : DATA_IN_DIR)) + write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */ + else { + write_wd33c93_count(regs, + cmd->SCp.this_residual); + write_wd33c93(regs, WD_CONTROL, + CTRL_IDI | CTRL_EDI | CTRL_DMA); + hostdata->dma = D_DMA_RUNNING; + } + } else + write_wd33c93_count(regs, 0); /* guarantee a DATA_PHASE interrupt */ + + hostdata->state = S_RUNNING_LEVEL2; + write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); + } + + /* + * Since the SCSI bus can handle only 1 connection at a time, + * we get out of here now. If the selection fails, or when + * the command disconnects, we'll come back to this routine + * to search the input_Q again... + */ + + DB(DB_EXECUTE, + printk("%s%ld)EX-2 ", (cmd->SCp.phase) ? "d:" : "", cmd->pid)) } - - -static void transfer_pio(const wd33c93_regs regs, uchar *buf, int cnt, - int data_in_dir, struct WD33C93_hostdata *hostdata) +static void +transfer_pio(const wd33c93_regs regs, uchar * buf, int cnt, + int data_in_dir, struct WD33C93_hostdata *hostdata) { -uchar asr; - -DB(DB_TRANSFER,printk("(%p,%d,%s:",buf,cnt,data_in_dir?"in":"out")) - - write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); - write_wd33c93_count(regs, cnt); - write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO); - if (data_in_dir) { - do { - asr = READ_AUX_STAT(); - if (asr & ASR_DBR) - *buf++ = read_wd33c93(regs, WD_DATA); - } while (!(asr & ASR_INT)); - } - else { - do { - asr = READ_AUX_STAT(); - if (asr & ASR_DBR) - write_wd33c93(regs, WD_DATA, *buf++); - } while (!(asr & ASR_INT)); - } - - /* Note: we are returning with the interrupt UN-cleared. - * Since (presumably) an entire I/O operation has - * completed, the bus phase is probably different, and - * the interrupt routine will discover this when it - * responds to the uncleared int. - */ + uchar asr; + + DB(DB_TRANSFER, + printk("(%p,%d,%s:", buf, cnt, data_in_dir ? "in" : "out")) + + write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); + write_wd33c93_count(regs, cnt); + write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO); + if (data_in_dir) { + do { + asr = read_aux_stat(regs); + if (asr & ASR_DBR) + *buf++ = read_wd33c93(regs, WD_DATA); + } while (!(asr & ASR_INT)); + } else { + do { + asr = read_aux_stat(regs); + if (asr & ASR_DBR) + write_wd33c93(regs, WD_DATA, *buf++); + } while (!(asr & ASR_INT)); + } + + /* Note: we are returning with the interrupt UN-cleared. + * Since (presumably) an entire I/O operation has + * completed, the bus phase is probably different, and + * the interrupt routine will discover this when it + * responds to the uncleared int. + */ } - - -static void transfer_bytes(const wd33c93_regs regs, Scsi_Cmnd *cmd, - int data_in_dir) +static void +transfer_bytes(const wd33c93_regs regs, Scsi_Cmnd * cmd, int data_in_dir) { -struct WD33C93_hostdata *hostdata; -unsigned long length; + struct WD33C93_hostdata *hostdata; + unsigned long length; - hostdata = (struct WD33C93_hostdata *)cmd->host->hostdata; + hostdata = (struct WD33C93_hostdata *) cmd->device->host->hostdata; /* Normally, you'd expect 'this_residual' to be non-zero here. * In a series of scatter-gather transfers, however, this @@ -687,38 +714,31 @@ unsigned long length; * now we need to setup the next scatter-gather buffer as the * source or destination for THIS transfer. */ - if (!cmd->SCp.this_residual && cmd->SCp.buffers_residual) { - ++cmd->SCp.buffer; - --cmd->SCp.buffers_residual; - cmd->SCp.this_residual = cmd->SCp.buffer->length; - cmd->SCp.ptr = page_address(cmd->SCp.buffer->page)+ - cmd->SCp.buffer->offset; - } + if (!cmd->SCp.this_residual && cmd->SCp.buffers_residual) { + ++cmd->SCp.buffer; + --cmd->SCp.buffers_residual; + cmd->SCp.this_residual = cmd->SCp.buffer->length; + cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + + cmd->SCp.buffer->offset; + } - write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER,hostdata->sync_xfer[cmd->target]); + write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER, + hostdata->sync_xfer[cmd->device->id]); /* 'hostdata->no_dma' is TRUE if we don't even want to try DMA. * Update 'this_residual' and 'ptr' after 'transfer_pio()' returns. */ - if (hostdata->no_dma) - goto use_transfer_pio; - -/* 'dma_setup()' will return TRUE if we can't do DMA. - * Update 'this_residual' and 'ptr' after 'transfer_pio()' returns. - */ - - else if (hostdata->dma_setup(cmd, data_in_dir)) { -use_transfer_pio: + if (hostdata->no_dma || hostdata->dma_setup(cmd, data_in_dir)) { #ifdef PROC_STATISTICS - hostdata->pio_cnt++; + hostdata->pio_cnt++; #endif - transfer_pio(regs, (uchar *)cmd->SCp.ptr, cmd->SCp.this_residual, - data_in_dir, hostdata); - length = cmd->SCp.this_residual; - cmd->SCp.this_residual = read_wd33c93_count(regs); - cmd->SCp.ptr += (length - cmd->SCp.this_residual); - } + transfer_pio(regs, (uchar *) cmd->SCp.ptr, + cmd->SCp.this_residual, data_in_dir, hostdata); + length = cmd->SCp.this_residual; + cmd->SCp.this_residual = read_wd33c93_count(regs); + cmd->SCp.ptr += (length - cmd->SCp.this_residual); + } /* We are able to do DMA (in fact, the Amiga hardware is * already going!), so start up the wd33c93 in DMA mode. @@ -729,51 +749,50 @@ use_transfer_pio: * until then. */ - else { + else { #ifdef PROC_STATISTICS - hostdata->dma_cnt++; + hostdata->dma_cnt++; #endif - write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_DMA); - write_wd33c93_count(regs, cmd->SCp.this_residual); - - if ((hostdata->level2 >= L2_DATA) || - (hostdata->level2 == L2_BASIC && cmd->SCp.phase == 0)) { - write_wd33c93(regs, WD_COMMAND_PHASE, 0x45); - write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); - hostdata->state = S_RUNNING_LEVEL2; - } - else - write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO); - - hostdata->dma = D_DMA_RUNNING; - } + write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_DMA); + write_wd33c93_count(regs, cmd->SCp.this_residual); + + if ((hostdata->level2 >= L2_DATA) || + (hostdata->level2 == L2_BASIC && cmd->SCp.phase == 0)) { + write_wd33c93(regs, WD_COMMAND_PHASE, 0x45); + write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); + hostdata->state = S_RUNNING_LEVEL2; + } else + write_wd33c93_cmd(regs, WD_CMD_TRANS_INFO); + + hostdata->dma = D_DMA_RUNNING; + } } - - -void wd33c93_intr (struct Scsi_Host *instance) +void +wd33c93_intr(struct Scsi_Host *instance) { -struct WD33C93_hostdata *hostdata = (struct WD33C93_hostdata *)instance->hostdata; -const wd33c93_regs regs = hostdata->regs; -Scsi_Cmnd *patch, *cmd; -uchar asr, sr, phs, id, lun, *ucp, msg; -unsigned long length, flags; + struct WD33C93_hostdata *hostdata = + (struct WD33C93_hostdata *) instance->hostdata; + const wd33c93_regs regs = hostdata->regs; + Scsi_Cmnd *patch, *cmd; + uchar asr, sr, phs, id, lun, *ucp, msg; + unsigned long length, flags; - asr = READ_AUX_STAT(); - if (!(asr & ASR_INT) || (asr & ASR_BSY)) - return; + asr = read_aux_stat(regs); + if (!(asr & ASR_INT) || (asr & ASR_BSY)) + return; - spin_lock_irqsave(&hostdata->lock, flags); + spin_lock_irqsave(&hostdata->lock, flags); #ifdef PROC_STATISTICS - hostdata->int_cnt++; + hostdata->int_cnt++; #endif - cmd = (Scsi_Cmnd *)hostdata->connected; /* assume we're connected */ - sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear the interrupt */ - phs = read_wd33c93(regs, WD_COMMAND_PHASE); + cmd = (Scsi_Cmnd *) hostdata->connected; /* assume we're connected */ + sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear the interrupt */ + phs = read_wd33c93(regs, WD_COMMAND_PHASE); -DB(DB_INTR,printk("{%02x:%02x-",asr,sr)) + DB(DB_INTR, printk("{%02x:%02x-", asr, sr)) /* After starting a DMA transfer, the next interrupt * is guaranteed to be in response to completion of @@ -789,76 +808,74 @@ DB(DB_INTR,printk("{%02x:%02x-",asr,sr)) * whatever is needed, we go on and service the WD3393 * interrupt normally. */ - - if (hostdata->dma == D_DMA_RUNNING) { -DB(DB_TRANSFER,printk("[%p/%d:",cmd->SCp.ptr,cmd->SCp.this_residual)) - hostdata->dma_stop(cmd->host, cmd, 1); - hostdata->dma = D_DMA_OFF; - length = cmd->SCp.this_residual; - cmd->SCp.this_residual = read_wd33c93_count(regs); - cmd->SCp.ptr += (length - cmd->SCp.this_residual); -DB(DB_TRANSFER,printk("%p/%d]",cmd->SCp.ptr,cmd->SCp.this_residual)) - } + if (hostdata->dma == D_DMA_RUNNING) { + DB(DB_TRANSFER, + printk("[%p/%d:", cmd->SCp.ptr, cmd->SCp.this_residual)) + hostdata->dma_stop(cmd->device->host, cmd, 1); + hostdata->dma = D_DMA_OFF; + length = cmd->SCp.this_residual; + cmd->SCp.this_residual = read_wd33c93_count(regs); + cmd->SCp.ptr += (length - cmd->SCp.this_residual); + DB(DB_TRANSFER, + printk("%p/%d]", cmd->SCp.ptr, cmd->SCp.this_residual)) + } /* Respond to the specific WD3393 interrupt - there are quite a few! */ - - switch (sr) { - - case CSR_TIMEOUT: -DB(DB_INTR,printk("TIMEOUT")) - - if (hostdata->state == S_RUNNING_LEVEL2) - hostdata->connected = NULL; - else { - cmd = (Scsi_Cmnd *)hostdata->selecting; /* get a valid cmd */ - hostdata->selecting = NULL; - } - - cmd->result = DID_NO_CONNECT << 16; - hostdata->busy[cmd->target] &= ~(1 << cmd->lun); - hostdata->state = S_UNCONNECTED; - cmd->scsi_done(cmd); - - /* From esp.c: - * There is a window of time within the scsi_done() path - * of execution where interrupts are turned back on full - * blast and left that way. During that time we could - * reconnect to a disconnected command, then we'd bomb - * out below. We could also end up executing two commands - * at _once_. ...just so you know why the restore_flags() - * is here... - */ - - spin_unlock_irqrestore(&hostdata->lock, flags); + switch (sr) { + case CSR_TIMEOUT: + DB(DB_INTR, printk("TIMEOUT")) + + if (hostdata->state == S_RUNNING_LEVEL2) + hostdata->connected = NULL; + else { + cmd = (Scsi_Cmnd *) hostdata->selecting; /* get a valid cmd */ + hostdata->selecting = NULL; + } + + cmd->result = DID_NO_CONNECT << 16; + hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); + hostdata->state = S_UNCONNECTED; + cmd->scsi_done(cmd); + + /* From esp.c: + * There is a window of time within the scsi_done() path + * of execution where interrupts are turned back on full + * blast and left that way. During that time we could + * reconnect to a disconnected command, then we'd bomb + * out below. We could also end up executing two commands + * at _once_. ...just so you know why the restore_flags() + * is here... + */ + + spin_unlock_irqrestore(&hostdata->lock, flags); /* We are not connected to a target - check to see if there * are commands waiting to be executed. */ - wd33c93_execute(instance); - break; - + wd33c93_execute(instance); + break; /* Note: this interrupt should not occur in a LEVEL2 command */ - case CSR_SELECT: + case CSR_SELECT: + DB(DB_INTR, printk("SELECT")) + hostdata->connected = cmd = + (Scsi_Cmnd *) hostdata->selecting; + hostdata->selecting = NULL; -DB(DB_INTR,printk("SELECT")) - hostdata->connected = cmd = (Scsi_Cmnd *)hostdata->selecting; - hostdata->selecting = NULL; + /* construct an IDENTIFY message with correct disconnect bit */ - /* construct an IDENTIFY message with correct disconnect bit */ + hostdata->outgoing_msg[0] = (0x80 | 0x00 | cmd->device->lun); + if (cmd->SCp.phase) + hostdata->outgoing_msg[0] |= 0x40; - hostdata->outgoing_msg[0] = (0x80 | 0x00 | cmd->lun); - if (cmd->SCp.phase) - hostdata->outgoing_msg[0] |= 0x40; - - if (hostdata->sync_stat[cmd->target] == SS_FIRST) { + if (hostdata->sync_stat[cmd->device->id] == SS_FIRST) { #ifdef SYNC_DEBUG -printk(" sending SDTR "); + printk(" sending SDTR "); #endif - hostdata->sync_stat[cmd->target] = SS_WAITING; + hostdata->sync_stat[cmd->device->id] = SS_WAITING; /* Tack on a 2nd message to ask about synchronous transfers. If we've * been asked to do only asynchronous transfers on this device, we @@ -866,158 +883,155 @@ printk(" sending SDTR "); * solve the problems some people have had with GVP's Guru ROM. */ - hostdata->outgoing_msg[1] = EXTENDED_MESSAGE; - hostdata->outgoing_msg[2] = 3; - hostdata->outgoing_msg[3] = EXTENDED_SDTR; - if (hostdata->no_sync & (1 << cmd->target)) { - hostdata->outgoing_msg[4] = hostdata->default_sx_per/4; - hostdata->outgoing_msg[5] = 0; - } - else { - hostdata->outgoing_msg[4] = OPTIMUM_SX_PER/4; - hostdata->outgoing_msg[5] = OPTIMUM_SX_OFF; - } - hostdata->outgoing_len = 6; - } - else - hostdata->outgoing_len = 1; - - hostdata->state = S_CONNECTED; - spin_unlock_irqrestore(&hostdata->lock, flags); - break; - - - case CSR_XFER_DONE|PHS_DATA_IN: - case CSR_UNEXP |PHS_DATA_IN: - case CSR_SRV_REQ |PHS_DATA_IN: -DB(DB_INTR,printk("IN-%d.%d",cmd->SCp.this_residual,cmd->SCp.buffers_residual)) - transfer_bytes(regs, cmd, DATA_IN_DIR); - if (hostdata->state != S_RUNNING_LEVEL2) - hostdata->state = S_CONNECTED; - spin_unlock_irqrestore(&hostdata->lock, flags); - break; - - - case CSR_XFER_DONE|PHS_DATA_OUT: - case CSR_UNEXP |PHS_DATA_OUT: - case CSR_SRV_REQ |PHS_DATA_OUT: -DB(DB_INTR,printk("OUT-%d.%d",cmd->SCp.this_residual,cmd->SCp.buffers_residual)) - transfer_bytes(regs, cmd, DATA_OUT_DIR); - if (hostdata->state != S_RUNNING_LEVEL2) - hostdata->state = S_CONNECTED; - spin_unlock_irqrestore(&hostdata->lock, flags); - break; - + hostdata->outgoing_msg[1] = EXTENDED_MESSAGE; + hostdata->outgoing_msg[2] = 3; + hostdata->outgoing_msg[3] = EXTENDED_SDTR; + if (hostdata->no_sync & (1 << cmd->device->id)) { + hostdata->outgoing_msg[4] = + hostdata->default_sx_per / 4; + hostdata->outgoing_msg[5] = 0; + } else { + hostdata->outgoing_msg[4] = OPTIMUM_SX_PER / 4; + hostdata->outgoing_msg[5] = OPTIMUM_SX_OFF; + } + hostdata->outgoing_len = 6; + } else + hostdata->outgoing_len = 1; + + hostdata->state = S_CONNECTED; + spin_unlock_irqrestore(&hostdata->lock, flags); + break; + + case CSR_XFER_DONE | PHS_DATA_IN: + case CSR_UNEXP | PHS_DATA_IN: + case CSR_SRV_REQ | PHS_DATA_IN: + DB(DB_INTR, + printk("IN-%d.%d", cmd->SCp.this_residual, + cmd->SCp.buffers_residual)) + transfer_bytes(regs, cmd, DATA_IN_DIR); + if (hostdata->state != S_RUNNING_LEVEL2) + hostdata->state = S_CONNECTED; + spin_unlock_irqrestore(&hostdata->lock, flags); + break; + + case CSR_XFER_DONE | PHS_DATA_OUT: + case CSR_UNEXP | PHS_DATA_OUT: + case CSR_SRV_REQ | PHS_DATA_OUT: + DB(DB_INTR, + printk("OUT-%d.%d", cmd->SCp.this_residual, + cmd->SCp.buffers_residual)) + transfer_bytes(regs, cmd, DATA_OUT_DIR); + if (hostdata->state != S_RUNNING_LEVEL2) + hostdata->state = S_CONNECTED; + spin_unlock_irqrestore(&hostdata->lock, flags); + break; /* Note: this interrupt should not occur in a LEVEL2 command */ - case CSR_XFER_DONE|PHS_COMMAND: - case CSR_UNEXP |PHS_COMMAND: - case CSR_SRV_REQ |PHS_COMMAND: -DB(DB_INTR,printk("CMND-%02x,%ld",cmd->cmnd[0],cmd->pid)) - transfer_pio(regs, cmd->cmnd, cmd->cmd_len, DATA_OUT_DIR, hostdata); - hostdata->state = S_CONNECTED; - spin_unlock_irqrestore(&hostdata->lock, flags); - break; - - - case CSR_XFER_DONE|PHS_STATUS: - case CSR_UNEXP |PHS_STATUS: - case CSR_SRV_REQ |PHS_STATUS: -DB(DB_INTR,printk("STATUS=")) - - cmd->SCp.Status = read_1_byte(regs); -DB(DB_INTR,printk("%02x",cmd->SCp.Status)) - if (hostdata->level2 >= L2_BASIC) { - sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear interrupt */ - hostdata->state = S_RUNNING_LEVEL2; - write_wd33c93(regs, WD_COMMAND_PHASE, 0x50); - write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); - } - else { - hostdata->state = S_CONNECTED; - } - spin_unlock_irqrestore(&hostdata->lock, flags); - break; - - - case CSR_XFER_DONE|PHS_MESS_IN: - case CSR_UNEXP |PHS_MESS_IN: - case CSR_SRV_REQ |PHS_MESS_IN: -DB(DB_INTR,printk("MSG_IN=")) - - msg = read_1_byte(regs); - sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear interrupt */ - - hostdata->incoming_msg[hostdata->incoming_ptr] = msg; - if (hostdata->incoming_msg[0] == EXTENDED_MESSAGE) - msg = EXTENDED_MESSAGE; - else - hostdata->incoming_ptr = 0; - - cmd->SCp.Message = msg; - switch (msg) { - - case COMMAND_COMPLETE: -DB(DB_INTR,printk("CCMP-%ld",cmd->pid)) - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_PRE_CMP_DISC; - break; - - case SAVE_POINTERS: -DB(DB_INTR,printk("SDP")) - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_CONNECTED; - break; - - case RESTORE_POINTERS: -DB(DB_INTR,printk("RDP")) - if (hostdata->level2 >= L2_BASIC) { - write_wd33c93(regs, WD_COMMAND_PHASE, 0x45); - write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); - hostdata->state = S_RUNNING_LEVEL2; - } - else { - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_CONNECTED; - } - break; - - case DISCONNECT: -DB(DB_INTR,printk("DIS")) - cmd->device->disconnect = 1; - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_PRE_TMP_DISC; - break; - - case MESSAGE_REJECT: -DB(DB_INTR,printk("REJ")) + case CSR_XFER_DONE | PHS_COMMAND: + case CSR_UNEXP | PHS_COMMAND: + case CSR_SRV_REQ | PHS_COMMAND: + DB(DB_INTR, printk("CMND-%02x,%ld", cmd->cmnd[0], cmd->pid)) + transfer_pio(regs, cmd->cmnd, cmd->cmd_len, DATA_OUT_DIR, + hostdata); + hostdata->state = S_CONNECTED; + spin_unlock_irqrestore(&hostdata->lock, flags); + break; + + case CSR_XFER_DONE | PHS_STATUS: + case CSR_UNEXP | PHS_STATUS: + case CSR_SRV_REQ | PHS_STATUS: + DB(DB_INTR, printk("STATUS=")) + cmd->SCp.Status = read_1_byte(regs); + DB(DB_INTR, printk("%02x", cmd->SCp.Status)) + if (hostdata->level2 >= L2_BASIC) { + sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear interrupt */ + hostdata->state = S_RUNNING_LEVEL2; + write_wd33c93(regs, WD_COMMAND_PHASE, 0x50); + write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); + } else { + hostdata->state = S_CONNECTED; + } + spin_unlock_irqrestore(&hostdata->lock, flags); + break; + + case CSR_XFER_DONE | PHS_MESS_IN: + case CSR_UNEXP | PHS_MESS_IN: + case CSR_SRV_REQ | PHS_MESS_IN: + DB(DB_INTR, printk("MSG_IN=")) + + msg = read_1_byte(regs); + sr = read_wd33c93(regs, WD_SCSI_STATUS); /* clear interrupt */ + + hostdata->incoming_msg[hostdata->incoming_ptr] = msg; + if (hostdata->incoming_msg[0] == EXTENDED_MESSAGE) + msg = EXTENDED_MESSAGE; + else + hostdata->incoming_ptr = 0; + + cmd->SCp.Message = msg; + switch (msg) { + + case COMMAND_COMPLETE: + DB(DB_INTR, printk("CCMP-%ld", cmd->pid)) + write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); + hostdata->state = S_PRE_CMP_DISC; + break; + + case SAVE_POINTERS: + DB(DB_INTR, printk("SDP")) + write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); + hostdata->state = S_CONNECTED; + break; + + case RESTORE_POINTERS: + DB(DB_INTR, printk("RDP")) + if (hostdata->level2 >= L2_BASIC) { + write_wd33c93(regs, WD_COMMAND_PHASE, 0x45); + write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); + hostdata->state = S_RUNNING_LEVEL2; + } else { + write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); + hostdata->state = S_CONNECTED; + } + break; + + case DISCONNECT: + DB(DB_INTR, printk("DIS")) + cmd->device->disconnect = 1; + write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); + hostdata->state = S_PRE_TMP_DISC; + break; + + case MESSAGE_REJECT: + DB(DB_INTR, printk("REJ")) #ifdef SYNC_DEBUG -printk("-REJ-"); + printk("-REJ-"); #endif - if (hostdata->sync_stat[cmd->target] == SS_WAITING) - hostdata->sync_stat[cmd->target] = SS_SET; - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_CONNECTED; - break; + if (hostdata->sync_stat[cmd->device->id] == SS_WAITING) + hostdata->sync_stat[cmd->device->id] = SS_SET; + write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); + hostdata->state = S_CONNECTED; + break; - case EXTENDED_MESSAGE: -DB(DB_INTR,printk("EXT")) + case EXTENDED_MESSAGE: + DB(DB_INTR, printk("EXT")) - ucp = hostdata->incoming_msg; + ucp = hostdata->incoming_msg; #ifdef SYNC_DEBUG -printk("%02x",ucp[hostdata->incoming_ptr]); + printk("%02x", ucp[hostdata->incoming_ptr]); #endif - /* Is this the last byte of the extended message? */ + /* Is this the last byte of the extended message? */ - if ((hostdata->incoming_ptr >= 2) && - (hostdata->incoming_ptr == (ucp[1] + 1))) { + if ((hostdata->incoming_ptr >= 2) && + (hostdata->incoming_ptr == (ucp[1] + 1))) { - switch (ucp[2]) { /* what's the EXTENDED code? */ - case EXTENDED_SDTR: - id = calc_sync_xfer(ucp[3],ucp[4]); - if (hostdata->sync_stat[cmd->target] != SS_WAITING) { + switch (ucp[2]) { /* what's the EXTENDED code? */ + case EXTENDED_SDTR: + id = calc_sync_xfer(ucp[3], ucp[4]); + if (hostdata->sync_stat[cmd->device->id] != + SS_WAITING) { /* A device has sent an unsolicited SDTR message; rather than go * through the effort of decoding it and then figuring out what @@ -1028,123 +1042,140 @@ printk("%02x",ucp[hostdata->incoming_ptr]); * specifically ask for sync transfers, we won't do any. */ - write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */ - hostdata->outgoing_msg[0] = EXTENDED_MESSAGE; - hostdata->outgoing_msg[1] = 3; - hostdata->outgoing_msg[2] = EXTENDED_SDTR; - hostdata->outgoing_msg[3] = hostdata->default_sx_per/4; - hostdata->outgoing_msg[4] = 0; - hostdata->outgoing_len = 5; - hostdata->sync_xfer[cmd->target] = - calc_sync_xfer(hostdata->default_sx_per/4,0); - } - else { - hostdata->sync_xfer[cmd->target] = id; - } + write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */ + hostdata->outgoing_msg[0] = + EXTENDED_MESSAGE; + hostdata->outgoing_msg[1] = 3; + hostdata->outgoing_msg[2] = + EXTENDED_SDTR; + hostdata->outgoing_msg[3] = + hostdata->default_sx_per / + 4; + hostdata->outgoing_msg[4] = 0; + hostdata->outgoing_len = 5; + hostdata->sync_xfer[cmd->device->id] = + calc_sync_xfer(hostdata-> + default_sx_per + / 4, 0); + } else { + hostdata->sync_xfer[cmd->device->id] = id; + } #ifdef SYNC_DEBUG -printk("sync_xfer=%02x",hostdata->sync_xfer[cmd->target]); + printk("sync_xfer=%02x", + hostdata->sync_xfer[cmd->device->id]); #endif - hostdata->sync_stat[cmd->target] = SS_SET; - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_CONNECTED; - break; - case EXTENDED_WDTR: - write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */ - printk("sending WDTR "); - hostdata->outgoing_msg[0] = EXTENDED_MESSAGE; - hostdata->outgoing_msg[1] = 2; - hostdata->outgoing_msg[2] = EXTENDED_WDTR; - hostdata->outgoing_msg[3] = 0; /* 8 bit transfer width */ - hostdata->outgoing_len = 4; - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_CONNECTED; - break; - default: - write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */ - printk("Rejecting Unknown Extended Message(%02x). ",ucp[2]); - hostdata->outgoing_msg[0] = MESSAGE_REJECT; - hostdata->outgoing_len = 1; - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_CONNECTED; - break; - } - hostdata->incoming_ptr = 0; - } - - /* We need to read more MESS_IN bytes for the extended message */ - - else { - hostdata->incoming_ptr++; - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_CONNECTED; - } - break; - - default: - printk("Rejecting Unknown Message(%02x) ",msg); - write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */ - hostdata->outgoing_msg[0] = MESSAGE_REJECT; - hostdata->outgoing_len = 1; - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - hostdata->state = S_CONNECTED; - } - spin_unlock_irqrestore(&hostdata->lock, flags); - break; - + hostdata->sync_stat[cmd->device->id] = + SS_SET; + write_wd33c93_cmd(regs, + WD_CMD_NEGATE_ACK); + hostdata->state = S_CONNECTED; + break; + case EXTENDED_WDTR: + write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */ + printk("sending WDTR "); + hostdata->outgoing_msg[0] = + EXTENDED_MESSAGE; + hostdata->outgoing_msg[1] = 2; + hostdata->outgoing_msg[2] = + EXTENDED_WDTR; + hostdata->outgoing_msg[3] = 0; /* 8 bit transfer width */ + hostdata->outgoing_len = 4; + write_wd33c93_cmd(regs, + WD_CMD_NEGATE_ACK); + hostdata->state = S_CONNECTED; + break; + default: + write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */ + printk + ("Rejecting Unknown Extended Message(%02x). ", + ucp[2]); + hostdata->outgoing_msg[0] = + MESSAGE_REJECT; + hostdata->outgoing_len = 1; + write_wd33c93_cmd(regs, + WD_CMD_NEGATE_ACK); + hostdata->state = S_CONNECTED; + break; + } + hostdata->incoming_ptr = 0; + } + + /* We need to read more MESS_IN bytes for the extended message */ + + else { + hostdata->incoming_ptr++; + write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); + hostdata->state = S_CONNECTED; + } + break; + + default: + printk("Rejecting Unknown Message(%02x) ", msg); + write_wd33c93_cmd(regs, WD_CMD_ASSERT_ATN); /* want MESS_OUT */ + hostdata->outgoing_msg[0] = MESSAGE_REJECT; + hostdata->outgoing_len = 1; + write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); + hostdata->state = S_CONNECTED; + } + spin_unlock_irqrestore(&hostdata->lock, flags); + break; /* Note: this interrupt will occur only after a LEVEL2 command */ - case CSR_SEL_XFER_DONE: + case CSR_SEL_XFER_DONE: /* Make sure that reselection is enabled at this point - it may * have been turned off for the command that just completed. */ - write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER); - if (phs == 0x60) { -DB(DB_INTR,printk("SX-DONE-%ld",cmd->pid)) - cmd->SCp.Message = COMMAND_COMPLETE; - lun = read_wd33c93(regs, WD_TARGET_LUN); -DB(DB_INTR,printk(":%d.%d",cmd->SCp.Status,lun)) - hostdata->connected = NULL; - hostdata->busy[cmd->target] &= ~(1 << cmd->lun); - hostdata->state = S_UNCONNECTED; - if (cmd->SCp.Status == ILLEGAL_STATUS_BYTE) - cmd->SCp.Status = lun; - if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != GOOD) - cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16); - else - cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); - cmd->scsi_done(cmd); + write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER); + if (phs == 0x60) { + DB(DB_INTR, printk("SX-DONE-%ld", cmd->pid)) + cmd->SCp.Message = COMMAND_COMPLETE; + lun = read_wd33c93(regs, WD_TARGET_LUN); + DB(DB_INTR, printk(":%d.%d", cmd->SCp.Status, lun)) + hostdata->connected = NULL; + hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); + hostdata->state = S_UNCONNECTED; + if (cmd->SCp.Status == ILLEGAL_STATUS_BYTE) + cmd->SCp.Status = lun; + if (cmd->cmnd[0] == REQUEST_SENSE + && cmd->SCp.Status != GOOD) + cmd->result = + (cmd-> + result & 0x00ffff) | (DID_ERROR << 16); + else + cmd->result = + cmd->SCp.Status | (cmd->SCp.Message << 8); + cmd->scsi_done(cmd); /* We are no longer connected to a target - check to see if * there are commands waiting to be executed. */ - spin_unlock_irqrestore(&hostdata->lock, flags); - wd33c93_execute(instance); - } - else { - printk("%02x:%02x:%02x-%ld: Unknown SEL_XFER_DONE phase!!---",asr,sr,phs,cmd->pid); - spin_unlock_irqrestore(&hostdata->lock, flags); - } - break; - + spin_unlock_irqrestore(&hostdata->lock, flags); + wd33c93_execute(instance); + } else { + printk + ("%02x:%02x:%02x-%ld: Unknown SEL_XFER_DONE phase!!---", + asr, sr, phs, cmd->pid); + spin_unlock_irqrestore(&hostdata->lock, flags); + } + break; /* Note: this interrupt will occur only after a LEVEL2 command */ - case CSR_SDP: -DB(DB_INTR,printk("SDP")) - hostdata->state = S_RUNNING_LEVEL2; - write_wd33c93(regs, WD_COMMAND_PHASE, 0x41); - write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); - spin_unlock_irqrestore(&hostdata->lock, flags); - break; + case CSR_SDP: + DB(DB_INTR, printk("SDP")) + hostdata->state = S_RUNNING_LEVEL2; + write_wd33c93(regs, WD_COMMAND_PHASE, 0x41); + write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); + spin_unlock_irqrestore(&hostdata->lock, flags); + break; - - case CSR_XFER_DONE|PHS_MESS_OUT: - case CSR_UNEXP |PHS_MESS_OUT: - case CSR_SRV_REQ |PHS_MESS_OUT: -DB(DB_INTR,printk("MSG_OUT=")) + case CSR_XFER_DONE | PHS_MESS_OUT: + case CSR_UNEXP | PHS_MESS_OUT: + case CSR_SRV_REQ | PHS_MESS_OUT: + DB(DB_INTR, printk("MSG_OUT=")) /* To get here, we've probably requested MESSAGE_OUT and have * already put the correct bytes in outgoing_msg[] and filled @@ -1158,21 +1189,19 @@ DB(DB_INTR,printk("MSG_OUT=")) * NOP messages in these situations results in no harm and * makes everyone happy. */ - - if (hostdata->outgoing_len == 0) { - hostdata->outgoing_len = 1; - hostdata->outgoing_msg[0] = NOP; - } - transfer_pio(regs, hostdata->outgoing_msg, hostdata->outgoing_len, - DATA_OUT_DIR, hostdata); -DB(DB_INTR,printk("%02x",hostdata->outgoing_msg[0])) - hostdata->outgoing_len = 0; - hostdata->state = S_CONNECTED; - spin_unlock_irqrestore(&hostdata->lock, flags); - break; - - - case CSR_UNEXP_DISC: + if (hostdata->outgoing_len == 0) { + hostdata->outgoing_len = 1; + hostdata->outgoing_msg[0] = NOP; + } + transfer_pio(regs, hostdata->outgoing_msg, + hostdata->outgoing_len, DATA_OUT_DIR, hostdata); + DB(DB_INTR, printk("%02x", hostdata->outgoing_msg[0])) + hostdata->outgoing_len = 0; + hostdata->state = S_CONNECTED; + spin_unlock_irqrestore(&hostdata->lock, flags); + break; + + case CSR_UNEXP_DISC: /* I think I've seen this after a request-sense that was in response * to an error condition, but not sure. We certainly need to do @@ -1186,353 +1215,387 @@ DB(DB_INTR,printk("%02x",hostdata->outgoing_msg[0])) * have been turned off for the command that just completed. */ - write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER); - if (cmd == NULL) { - printk(" - Already disconnected! "); - hostdata->state = S_UNCONNECTED; - spin_unlock_irqrestore(&hostdata->lock, flags); - return; - } -DB(DB_INTR,printk("UNEXP_DISC-%ld",cmd->pid)) - hostdata->connected = NULL; - hostdata->busy[cmd->target] &= ~(1 << cmd->lun); - hostdata->state = S_UNCONNECTED; - if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != GOOD) - cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16); - else - cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); - cmd->scsi_done(cmd); + write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER); + if (cmd == NULL) { + printk(" - Already disconnected! "); + hostdata->state = S_UNCONNECTED; + spin_unlock_irqrestore(&hostdata->lock, flags); + return; + } + DB(DB_INTR, printk("UNEXP_DISC-%ld", cmd->pid)) + hostdata->connected = NULL; + hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); + hostdata->state = S_UNCONNECTED; + if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != GOOD) + cmd->result = + (cmd->result & 0x00ffff) | (DID_ERROR << 16); + else + cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); + cmd->scsi_done(cmd); /* We are no longer connected to a target - check to see if * there are commands waiting to be executed. */ - /* look above for comments on scsi_done() */ - spin_unlock_irqrestore(&hostdata->lock, flags); - wd33c93_execute(instance); - break; + /* look above for comments on scsi_done() */ + spin_unlock_irqrestore(&hostdata->lock, flags); + wd33c93_execute(instance); + break; - - case CSR_DISC: + case CSR_DISC: /* Make sure that reselection is enabled at this point - it may * have been turned off for the command that just completed. */ - write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER); -DB(DB_INTR,printk("DISC-%ld",cmd->pid)) - if (cmd == NULL) { - printk(" - Already disconnected! "); - hostdata->state = S_UNCONNECTED; - } - switch (hostdata->state) { - case S_PRE_CMP_DISC: - hostdata->connected = NULL; - hostdata->busy[cmd->target] &= ~(1 << cmd->lun); - hostdata->state = S_UNCONNECTED; -DB(DB_INTR,printk(":%d",cmd->SCp.Status)) - if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != GOOD) - cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16); - else - cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); - cmd->scsi_done(cmd); - break; - case S_PRE_TMP_DISC: - case S_RUNNING_LEVEL2: - cmd->host_scribble = (uchar *)hostdata->disconnected_Q; - hostdata->disconnected_Q = cmd; - hostdata->connected = NULL; - hostdata->state = S_UNCONNECTED; + write_wd33c93(regs, WD_SOURCE_ID, SRCID_ER); + DB(DB_INTR, printk("DISC-%ld", cmd->pid)) + if (cmd == NULL) { + printk(" - Already disconnected! "); + hostdata->state = S_UNCONNECTED; + } + switch (hostdata->state) { + case S_PRE_CMP_DISC: + hostdata->connected = NULL; + hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); + hostdata->state = S_UNCONNECTED; + DB(DB_INTR, printk(":%d", cmd->SCp.Status)) + if (cmd->cmnd[0] == REQUEST_SENSE + && cmd->SCp.Status != GOOD) + cmd->result = + (cmd-> + result & 0x00ffff) | (DID_ERROR << 16); + else + cmd->result = + cmd->SCp.Status | (cmd->SCp.Message << 8); + cmd->scsi_done(cmd); + break; + case S_PRE_TMP_DISC: + case S_RUNNING_LEVEL2: + cmd->host_scribble = (uchar *) hostdata->disconnected_Q; + hostdata->disconnected_Q = cmd; + hostdata->connected = NULL; + hostdata->state = S_UNCONNECTED; #ifdef PROC_STATISTICS - hostdata->disc_done_cnt[cmd->target]++; + hostdata->disc_done_cnt[cmd->device->id]++; #endif - break; - default: - printk("*** Unexpected DISCONNECT interrupt! ***"); - hostdata->state = S_UNCONNECTED; - } + break; + default: + printk("*** Unexpected DISCONNECT interrupt! ***"); + hostdata->state = S_UNCONNECTED; + } /* We are no longer connected to a target - check to see if * there are commands waiting to be executed. */ - spin_unlock_irqrestore(&hostdata->lock, flags); - wd33c93_execute(instance); - break; - - - case CSR_RESEL_AM: - case CSR_RESEL: -DB(DB_INTR,printk("RESEL%s", sr == CSR_RESEL_AM ? "_AM" : "")) - - /* Old chips (pre -A ???) don't have advanced features and will - * generate CSR_RESEL. In that case we have to extract the LUN the - * hard way (see below). - * First we have to make sure this reselection didn't - * happen during Arbitration/Selection of some other device. - * If yes, put losing command back on top of input_Q. - */ - - if (hostdata->level2 <= L2_NONE) { - - if (hostdata->selecting) { - cmd = (Scsi_Cmnd *)hostdata->selecting; - hostdata->selecting = NULL; - hostdata->busy[cmd->target] &= ~(1 << cmd->lun); - cmd->host_scribble = (uchar *)hostdata->input_Q; - hostdata->input_Q = cmd; - } - } - - else { - - if (cmd) { - if (phs == 0x00) { - hostdata->busy[cmd->target] &= ~(1 << cmd->lun); - cmd->host_scribble = (uchar *)hostdata->input_Q; - hostdata->input_Q = cmd; - } - else { - printk("---%02x:%02x:%02x-TROUBLE: Intrusive ReSelect!---",asr,sr,phs); - while (1) - printk("\r"); - } - } - - } - - /* OK - find out which device reselected us. */ - - id = read_wd33c93(regs, WD_SOURCE_ID); - id &= SRCID_MASK; - - /* and extract the lun from the ID message. (Note that we don't - * bother to check for a valid message here - I guess this is - * not the right way to go, but...) - */ - - if (sr == CSR_RESEL_AM) { - lun = read_wd33c93(regs, WD_DATA); - if (hostdata->level2 < L2_RESELECT) - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - lun &= 7; - } - else { - /* Old chip; wait for msgin phase to pick up the LUN. */ - for (lun = 255; lun; lun--) { - if ((asr = READ_AUX_STAT()) & ASR_INT) - break; - udelay(10); - } - if (!(asr & ASR_INT)) { - printk("wd33c93: Reselected without IDENTIFY\n"); - lun = 0; - } - else { - /* Verify this is a change to MSG_IN and read the message */ - sr = read_wd33c93(regs, WD_SCSI_STATUS); - if (sr == (CSR_ABORT | PHS_MESS_IN) || - sr == (CSR_UNEXP | PHS_MESS_IN) || - sr == (CSR_SRV_REQ | PHS_MESS_IN)) { - /* Got MSG_IN, grab target LUN */ - lun = read_1_byte(regs); - /* Now we expect a 'paused with ACK asserted' int.. */ - asr = READ_AUX_STAT(); - if (!(asr & ASR_INT)) { - udelay(10); - asr = READ_AUX_STAT(); - if (!(asr & ASR_INT)) - printk("wd33c93: No int after LUN on RESEL (%02x)\n", - asr); - } - sr = read_wd33c93(regs, WD_SCSI_STATUS); - if (sr != CSR_MSGIN) - printk("wd33c93: Not paused with ACK on RESEL (%02x)\n", - sr); - lun &= 7; - write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); - } - else { - printk("wd33c93: Not MSG_IN on reselect (%02x)\n", sr); - lun = 0; - } - } - } - - /* Now we look for the command that's reconnecting. */ - - cmd = (Scsi_Cmnd *)hostdata->disconnected_Q; - patch = NULL; - while (cmd) { - if (id == cmd->target && lun == cmd->lun) - break; - patch = cmd; - cmd = (Scsi_Cmnd *)cmd->host_scribble; - } - - /* Hmm. Couldn't find a valid command.... What to do? */ - - if (!cmd) { - printk("---TROUBLE: target %d.%d not in disconnect queue---",id,lun); - spin_unlock_irqrestore(&hostdata->lock, flags); - return; - } - - /* Ok, found the command - now start it up again. */ - - if (patch) - patch->host_scribble = cmd->host_scribble; - else - hostdata->disconnected_Q = (Scsi_Cmnd *)cmd->host_scribble; - hostdata->connected = cmd; - - /* We don't need to worry about 'initialize_SCp()' or 'hostdata->busy[]' - * because these things are preserved over a disconnect. - * But we DO need to fix the DPD bit so it's correct for this command. - */ - - if (is_dir_out(cmd)) - write_wd33c93(regs, WD_DESTINATION_ID, cmd->target); - else - write_wd33c93(regs, WD_DESTINATION_ID, cmd->target | DSTID_DPD); - if (hostdata->level2 >= L2_RESELECT) { - write_wd33c93_count(regs, 0); /* we want a DATA_PHASE interrupt */ - write_wd33c93(regs, WD_COMMAND_PHASE, 0x45); - write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); - hostdata->state = S_RUNNING_LEVEL2; - } - else - hostdata->state = S_CONNECTED; - -DB(DB_INTR,printk("-%ld",cmd->pid)) - spin_unlock_irqrestore(&hostdata->lock, flags); - break; - - default: - printk("--UNKNOWN INTERRUPT:%02x:%02x:%02x--",asr,sr,phs); - spin_unlock_irqrestore(&hostdata->lock, flags); - } - -DB(DB_INTR,printk("} ")) + spin_unlock_irqrestore(&hostdata->lock, flags); + wd33c93_execute(instance); + break; + + case CSR_RESEL_AM: + case CSR_RESEL: + DB(DB_INTR, printk("RESEL%s", sr == CSR_RESEL_AM ? "_AM" : "")) + + /* Old chips (pre -A ???) don't have advanced features and will + * generate CSR_RESEL. In that case we have to extract the LUN the + * hard way (see below). + * First we have to make sure this reselection didn't + * happen during Arbitration/Selection of some other device. + * If yes, put losing command back on top of input_Q. + */ + if (hostdata->level2 <= L2_NONE) { + + if (hostdata->selecting) { + cmd = (Scsi_Cmnd *) hostdata->selecting; + hostdata->selecting = NULL; + hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); + cmd->host_scribble = + (uchar *) hostdata->input_Q; + hostdata->input_Q = cmd; + } + } + + else { + + if (cmd) { + if (phs == 0x00) { + hostdata->busy[cmd->device->id] &= + ~(1 << cmd->device->lun); + cmd->host_scribble = + (uchar *) hostdata->input_Q; + hostdata->input_Q = cmd; + } else { + printk + ("---%02x:%02x:%02x-TROUBLE: Intrusive ReSelect!---", + asr, sr, phs); + while (1) + printk("\r"); + } + } + + } + + /* OK - find out which device reselected us. */ + + id = read_wd33c93(regs, WD_SOURCE_ID); + id &= SRCID_MASK; + + /* and extract the lun from the ID message. (Note that we don't + * bother to check for a valid message here - I guess this is + * not the right way to go, but...) + */ + + if (sr == CSR_RESEL_AM) { + lun = read_wd33c93(regs, WD_DATA); + if (hostdata->level2 < L2_RESELECT) + write_wd33c93_cmd(regs, WD_CMD_NEGATE_ACK); + lun &= 7; + } else { + /* Old chip; wait for msgin phase to pick up the LUN. */ + for (lun = 255; lun; lun--) { + if ((asr = read_aux_stat(regs)) & ASR_INT) + break; + udelay(10); + } + if (!(asr & ASR_INT)) { + printk + ("wd33c93: Reselected without IDENTIFY\n"); + lun = 0; + } else { + /* Verify this is a change to MSG_IN and read the message */ + sr = read_wd33c93(regs, WD_SCSI_STATUS); + if (sr == (CSR_ABORT | PHS_MESS_IN) || + sr == (CSR_UNEXP | PHS_MESS_IN) || + sr == (CSR_SRV_REQ | PHS_MESS_IN)) { + /* Got MSG_IN, grab target LUN */ + lun = read_1_byte(regs); + /* Now we expect a 'paused with ACK asserted' int.. */ + asr = read_aux_stat(regs); + if (!(asr & ASR_INT)) { + udelay(10); + asr = read_aux_stat(regs); + if (!(asr & ASR_INT)) + printk + ("wd33c93: No int after LUN on RESEL (%02x)\n", + asr); + } + sr = read_wd33c93(regs, WD_SCSI_STATUS); + if (sr != CSR_MSGIN) + printk + ("wd33c93: Not paused with ACK on RESEL (%02x)\n", + sr); + lun &= 7; + write_wd33c93_cmd(regs, + WD_CMD_NEGATE_ACK); + } else { + printk + ("wd33c93: Not MSG_IN on reselect (%02x)\n", + sr); + lun = 0; + } + } + } + + /* Now we look for the command that's reconnecting. */ + + cmd = (Scsi_Cmnd *) hostdata->disconnected_Q; + patch = NULL; + while (cmd) { + if (id == cmd->device->id && lun == cmd->device->lun) + break; + patch = cmd; + cmd = (Scsi_Cmnd *) cmd->host_scribble; + } + + /* Hmm. Couldn't find a valid command.... What to do? */ + + if (!cmd) { + printk + ("---TROUBLE: target %d.%d not in disconnect queue---", + id, lun); + spin_unlock_irqrestore(&hostdata->lock, flags); + return; + } + + /* Ok, found the command - now start it up again. */ + + if (patch) + patch->host_scribble = cmd->host_scribble; + else + hostdata->disconnected_Q = + (Scsi_Cmnd *) cmd->host_scribble; + hostdata->connected = cmd; + + /* We don't need to worry about 'initialize_SCp()' or 'hostdata->busy[]' + * because these things are preserved over a disconnect. + * But we DO need to fix the DPD bit so it's correct for this command. + */ + + if (is_dir_out(cmd)) + write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id); + else + write_wd33c93(regs, WD_DESTINATION_ID, + cmd->device->id | DSTID_DPD); + if (hostdata->level2 >= L2_RESELECT) { + write_wd33c93_count(regs, 0); /* we want a DATA_PHASE interrupt */ + write_wd33c93(regs, WD_COMMAND_PHASE, 0x45); + write_wd33c93_cmd(regs, WD_CMD_SEL_ATN_XFER); + hostdata->state = S_RUNNING_LEVEL2; + } else + hostdata->state = S_CONNECTED; + + DB(DB_INTR, printk("-%ld", cmd->pid)) + spin_unlock_irqrestore(&hostdata->lock, flags); + break; + + default: + printk("--UNKNOWN INTERRUPT:%02x:%02x:%02x--", asr, sr, phs); + spin_unlock_irqrestore(&hostdata->lock, flags); + } + + DB(DB_INTR, printk("} ")) } +static void +reset_wd33c93(struct Scsi_Host *instance) +{ + struct WD33C93_hostdata *hostdata = + (struct WD33C93_hostdata *) instance->hostdata; + const wd33c93_regs regs = hostdata->regs; + uchar sr; + +#ifdef CONFIG_SGI_IP22 + { + int busycount = 0; + extern void sgiwd93_reset(unsigned long); + /* wait 'til the chip gets some time for us */ + while ((READ_AUX_STAT() & ASR_BSY) && busycount++ < 100) + udelay (10); + /* + * there are scsi devices out there, which manage to lock up + * the wd33c93 in a busy condition. In this state it won't + * accept the reset command. The only way to solve this is to + * give the chip a hardware reset (if possible). The code below + * does this for the SGI Indy, where this is possible + */ + /* still busy ? */ + if (READ_AUX_STAT() & ASR_BSY) + sgiwd93_reset(instance->base); /* yeah, give it the hard one */ + } +#endif + + write_wd33c93(regs, WD_OWN_ID, OWNID_EAF | OWNID_RAF | + instance->this_id | hostdata->clock_freq); + write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); + write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER, + calc_sync_xfer(hostdata->default_sx_per / 4, + DEFAULT_SX_OFF)); + write_wd33c93(regs, WD_COMMAND, WD_CMD_RESET); -static void reset_wd33c93(struct Scsi_Host *instance) -{ -struct WD33C93_hostdata *hostdata = (struct WD33C93_hostdata *)instance->hostdata; -const wd33c93_regs regs = hostdata->regs; -uchar sr; - - write_wd33c93(regs, WD_OWN_ID, OWNID_EAF | OWNID_RAF | - instance->this_id | hostdata->clock_freq); - write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); - write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER, - calc_sync_xfer(hostdata->default_sx_per/4,DEFAULT_SX_OFF)); - write_wd33c93(regs, WD_COMMAND, WD_CMD_RESET); #ifdef CONFIG_MVME147_SCSI - udelay(25); /* The old wd33c93 on MVME147 needs this, at least */ + udelay(25); /* The old wd33c93 on MVME147 needs this, at least */ #endif - while (!(READ_AUX_STAT() & ASR_INT)) - ; - sr = read_wd33c93(regs, WD_SCSI_STATUS); - - hostdata->microcode = read_wd33c93(regs, WD_CDB_1); - if (sr == 0x00) - hostdata->chip = C_WD33C93; - else if (sr == 0x01) { - write_wd33c93(regs, WD_QUEUE_TAG, 0xa5); /* any random number */ - sr = read_wd33c93(regs, WD_QUEUE_TAG); - if (sr == 0xa5) { - hostdata->chip = C_WD33C93B; - write_wd33c93(regs, WD_QUEUE_TAG, 0); - } - else - hostdata->chip = C_WD33C93A; - } - else - hostdata->chip = C_UNKNOWN_CHIP; - - write_wd33c93(regs, WD_TIMEOUT_PERIOD, TIMEOUT_PERIOD_VALUE); - write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); + while (!(read_aux_stat(regs) & ASR_INT)) + ; + sr = read_wd33c93(regs, WD_SCSI_STATUS); + + hostdata->microcode = read_wd33c93(regs, WD_CDB_1); + if (sr == 0x00) + hostdata->chip = C_WD33C93; + else if (sr == 0x01) { + write_wd33c93(regs, WD_QUEUE_TAG, 0xa5); /* any random number */ + sr = read_wd33c93(regs, WD_QUEUE_TAG); + if (sr == 0xa5) { + hostdata->chip = C_WD33C93B; + write_wd33c93(regs, WD_QUEUE_TAG, 0); + } else + hostdata->chip = C_WD33C93A; + } else + hostdata->chip = C_UNKNOWN_CHIP; + + write_wd33c93(regs, WD_TIMEOUT_PERIOD, TIMEOUT_PERIOD_VALUE); + write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); } - - -int wd33c93_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) +int +wd33c93_reset(Scsi_Cmnd * SCpnt, unsigned int reset_flags) { -struct Scsi_Host *instance; -struct WD33C93_hostdata *hostdata; -int i; - - instance = SCpnt->host; - hostdata = (struct WD33C93_hostdata *)instance->hostdata; - - printk("scsi%d: reset. ", instance->host_no); - disable_irq(instance->irq); - - ((struct WD33C93_hostdata *)instance->hostdata)->dma_stop(instance,NULL,0); - for (i = 0; i < 8; i++) { - hostdata->busy[i] = 0; - hostdata->sync_xfer[i] = calc_sync_xfer(DEFAULT_SX_PER/4,DEFAULT_SX_OFF); - hostdata->sync_stat[i] = SS_UNSET; /* using default sync values */ - } - hostdata->input_Q = NULL; - hostdata->selecting = NULL; - hostdata->connected = NULL; - hostdata->disconnected_Q = NULL; - hostdata->state = S_UNCONNECTED; - hostdata->dma = D_DMA_OFF; - hostdata->incoming_ptr = 0; - hostdata->outgoing_len = 0; - - reset_wd33c93(instance); - SCpnt->result = DID_RESET << 16; - enable_irq(instance->irq); - return 0; + struct Scsi_Host *instance; + struct WD33C93_hostdata *hostdata; + int i; + + instance = SCpnt->device->host; + hostdata = (struct WD33C93_hostdata *) instance->hostdata; + + printk("scsi%d: reset. ", instance->host_no); + disable_irq(instance->irq); + + hostdata->dma_stop(instance, NULL, 0); + for (i = 0; i < 8; i++) { + hostdata->busy[i] = 0; + hostdata->sync_xfer[i] = + calc_sync_xfer(DEFAULT_SX_PER / 4, DEFAULT_SX_OFF); + hostdata->sync_stat[i] = SS_UNSET; /* using default sync values */ + } + hostdata->input_Q = NULL; + hostdata->selecting = NULL; + hostdata->connected = NULL; + hostdata->disconnected_Q = NULL; + hostdata->state = S_UNCONNECTED; + hostdata->dma = D_DMA_OFF; + hostdata->incoming_ptr = 0; + hostdata->outgoing_len = 0; + + reset_wd33c93(instance); + SCpnt->result = DID_RESET << 16; + enable_irq(instance->irq); + return 0; } - - -int wd33c93_abort (Scsi_Cmnd *cmd) +int +wd33c93_abort(Scsi_Cmnd * cmd) { -struct Scsi_Host *instance; -struct WD33C93_hostdata *hostdata; -wd33c93_regs regs; -Scsi_Cmnd *tmp, *prev; + struct Scsi_Host *instance; + struct WD33C93_hostdata *hostdata; + wd33c93_regs regs; + Scsi_Cmnd *tmp, *prev; - disable_irq(cmd->host->irq); + disable_irq(cmd->device->host->irq); - instance = cmd->host; - hostdata = (struct WD33C93_hostdata *)instance->hostdata; - regs = hostdata->regs; + instance = cmd->device->host; + hostdata = (struct WD33C93_hostdata *) instance->hostdata; + regs = hostdata->regs; /* * Case 1 : If the command hasn't been issued yet, we simply remove it * from the input_Q. */ - tmp = (Scsi_Cmnd *)hostdata->input_Q; - prev = 0; - while (tmp) { - if (tmp == cmd) { - if (prev) - prev->host_scribble = cmd->host_scribble; - else - hostdata->input_Q = (Scsi_Cmnd *)cmd->host_scribble; - cmd->host_scribble = NULL; - cmd->result = DID_ABORT << 16; - printk("scsi%d: Abort - removing command %ld from input_Q. ", - instance->host_no, cmd->pid); - enable_irq(cmd->host->irq); - cmd->scsi_done(cmd); - return SCSI_ABORT_SUCCESS; - } - prev = tmp; - tmp = (Scsi_Cmnd *)tmp->host_scribble; - } + tmp = (Scsi_Cmnd *) hostdata->input_Q; + prev = 0; + while (tmp) { + if (tmp == cmd) { + if (prev) + prev->host_scribble = cmd->host_scribble; + else + hostdata->input_Q = + (Scsi_Cmnd *) cmd->host_scribble; + cmd->host_scribble = NULL; + cmd->result = DID_ABORT << 16; + printk + ("scsi%d: Abort - removing command %ld from input_Q. ", + instance->host_no, cmd->pid); + enable_irq(cmd->device->host->irq); + cmd->scsi_done(cmd); + return SCSI_ABORT_SUCCESS; + } + prev = tmp; + tmp = (Scsi_Cmnd *) tmp->host_scribble; + } /* * Case 2 : If the command is connected, we're going to fail the abort @@ -1545,64 +1608,66 @@ Scsi_Cmnd *tmp, *prev; * we fail. */ - if (hostdata->connected == cmd) { - uchar sr, asr; - unsigned long timeout; + if (hostdata->connected == cmd) { + uchar sr, asr; + unsigned long timeout; - printk("scsi%d: Aborting connected command %ld - ", - instance->host_no, cmd->pid); + printk("scsi%d: Aborting connected command %ld - ", + instance->host_no, cmd->pid); - printk("stopping DMA - "); - if (hostdata->dma == D_DMA_RUNNING) { - hostdata->dma_stop(instance, cmd, 0); - hostdata->dma = D_DMA_OFF; - } + printk("stopping DMA - "); + if (hostdata->dma == D_DMA_RUNNING) { + hostdata->dma_stop(instance, cmd, 0); + hostdata->dma = D_DMA_OFF; + } - printk("sending wd33c93 ABORT command - "); - write_wd33c93(regs, WD_CONTROL, CTRL_IDI | CTRL_EDI | CTRL_POLLED); - write_wd33c93_cmd(regs, WD_CMD_ABORT); + printk("sending wd33c93 ABORT command - "); + write_wd33c93(regs, WD_CONTROL, + CTRL_IDI | CTRL_EDI | CTRL_POLLED); + write_wd33c93_cmd(regs, WD_CMD_ABORT); /* Now we have to attempt to flush out the FIFO... */ - printk("flushing fifo - "); - timeout = 1000000; - do { - asr = READ_AUX_STAT(); - if (asr & ASR_DBR) - read_wd33c93(regs, WD_DATA); - } while (!(asr & ASR_INT) && timeout-- > 0); - sr = read_wd33c93(regs, WD_SCSI_STATUS); - printk("asr=%02x, sr=%02x, %ld bytes un-transferred (timeout=%ld) - ", - asr, sr, read_wd33c93_count(regs), timeout); - - /* - * Abort command processed. - * Still connected. - * We must disconnect. - */ - - printk("sending wd33c93 DISCONNECT command - "); - write_wd33c93_cmd(regs, WD_CMD_DISCONNECT); - - timeout = 1000000; - asr = READ_AUX_STAT(); - while ((asr & ASR_CIP) && timeout-- > 0) - asr = READ_AUX_STAT(); - sr = read_wd33c93(regs, WD_SCSI_STATUS); - printk("asr=%02x, sr=%02x.",asr,sr); - - hostdata->busy[cmd->target] &= ~(1 << cmd->lun); - hostdata->connected = NULL; - hostdata->state = S_UNCONNECTED; - cmd->result = DID_ABORT << 16; + printk("flushing fifo - "); + timeout = 1000000; + do { + asr = read_aux_stat(regs); + if (asr & ASR_DBR) + read_wd33c93(regs, WD_DATA); + } while (!(asr & ASR_INT) && timeout-- > 0); + sr = read_wd33c93(regs, WD_SCSI_STATUS); + printk + ("asr=%02x, sr=%02x, %ld bytes un-transferred (timeout=%ld) - ", + asr, sr, read_wd33c93_count(regs), timeout); + + /* + * Abort command processed. + * Still connected. + * We must disconnect. + */ + + printk("sending wd33c93 DISCONNECT command - "); + write_wd33c93_cmd(regs, WD_CMD_DISCONNECT); + + timeout = 1000000; + asr = read_aux_stat(regs); + while ((asr & ASR_CIP) && timeout-- > 0) + asr = read_aux_stat(regs); + sr = read_wd33c93(regs, WD_SCSI_STATUS); + printk("asr=%02x, sr=%02x.", asr, sr); + + hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); + hostdata->connected = NULL; + hostdata->state = S_UNCONNECTED; + cmd->result = DID_ABORT << 16; /* sti();*/ - wd33c93_execute (instance); + wd33c93_execute(instance); - enable_irq(cmd->host->irq); - cmd->scsi_done(cmd); - return SCSI_ABORT_SUCCESS; - } + enable_irq(cmd->device->host->irq); + cmd->scsi_done(cmd); + return SCSI_ABORT_SUCCESS; + } /* * Case 3: If the command is currently disconnected from the bus, @@ -1610,17 +1675,18 @@ Scsi_Cmnd *tmp, *prev; * an ABORT_SNOOZE and hope for the best... */ - tmp = (Scsi_Cmnd *)hostdata->disconnected_Q; - while (tmp) { - if (tmp == cmd) { - printk("scsi%d: Abort - command %ld found on disconnected_Q - ", - instance->host_no, cmd->pid); - printk("returning ABORT_SNOOZE. "); - enable_irq(cmd->host->irq); - return SCSI_ABORT_SNOOZE; - } - tmp = (Scsi_Cmnd *)tmp->host_scribble; - } + tmp = (Scsi_Cmnd *) hostdata->disconnected_Q; + while (tmp) { + if (tmp == cmd) { + printk + ("scsi%d: Abort - command %ld found on disconnected_Q - ", + instance->host_no, cmd->pid); + printk("returning ABORT_SNOOZE. "); + enable_irq(cmd->device->host->irq); + return SCSI_ABORT_SNOOZE; + } + tmp = (Scsi_Cmnd *) tmp->host_scribble; + } /* * Case 4 : If we reached this point, the command was not found in any of @@ -1633,16 +1699,14 @@ Scsi_Cmnd *tmp, *prev; */ /* sti();*/ - wd33c93_execute (instance); + wd33c93_execute(instance); - enable_irq(cmd->host->irq); - printk("scsi%d: warning : SCSI command probably completed successfully" - " before abortion. ", instance->host_no); - return SCSI_ABORT_NOT_RUNNING; + enable_irq(cmd->device->host->irq); + printk("scsi%d: warning : SCSI command probably completed successfully" + " before abortion. ", instance->host_no); + return SCSI_ABORT_NOT_RUNNING; } - - #define MAX_WD33C93_HOSTS 4 #define MAX_SETUP_ARGS ((int)(sizeof(setup_args) / sizeof(char *))) #define SETUP_BUFFER_SIZE 200 @@ -1650,238 +1714,224 @@ static char setup_buffer[SETUP_BUFFER_SIZE]; static char setup_used[MAX_SETUP_ARGS]; static int done_setup = 0; -int wd33c93_setup (char *str) +int +wd33c93_setup(char *str) { - int i; - char *p1,*p2; - - /* The kernel does some processing of the command-line before calling - * this function: If it begins with any decimal or hex number arguments, - * ints[0] = how many numbers found and ints[1] through [n] are the values - * themselves. str points to where the non-numeric arguments (if any) - * start: We do our own parsing of those. We construct synthetic 'nosync' - * keywords out of numeric args (to maintain compatibility with older - * versions) and then add the rest of the arguments. - */ - - p1 = setup_buffer; - *p1 = '\0'; -#if 0 -/* - * Old style command line arguments are now dead - */ - if (ints[0]) { - for (i=0; i<ints[0]; i++) { - x = vsprintf(p1,"nosync:0x%02x,",&(ints[i+1])); - p1 += x; - } - } -#endif - if (str) - strncpy(p1, str, SETUP_BUFFER_SIZE - strlen(setup_buffer)); - setup_buffer[SETUP_BUFFER_SIZE - 1] = '\0'; - p1 = setup_buffer; - i = 0; - while (*p1 && (i < MAX_SETUP_ARGS)) { - p2 = strchr(p1, ','); - if (p2) { - *p2 = '\0'; - if (p1 != p2) - setup_args[i] = p1; - p1 = p2 + 1; - i++; - } - else { - setup_args[i] = p1; - break; - } - } - for (i=0; i<MAX_SETUP_ARGS; i++) - setup_used[i] = 0; - done_setup = 1; - - return 1; + int i; + char *p1, *p2; + + /* The kernel does some processing of the command-line before calling + * this function: If it begins with any decimal or hex number arguments, + * ints[0] = how many numbers found and ints[1] through [n] are the values + * themselves. str points to where the non-numeric arguments (if any) + * start: We do our own parsing of those. We construct synthetic 'nosync' + * keywords out of numeric args (to maintain compatibility with older + * versions) and then add the rest of the arguments. + */ + + p1 = setup_buffer; + *p1 = '\0'; + if (str) + strncpy(p1, str, SETUP_BUFFER_SIZE - strlen(setup_buffer)); + setup_buffer[SETUP_BUFFER_SIZE - 1] = '\0'; + p1 = setup_buffer; + i = 0; + while (*p1 && (i < MAX_SETUP_ARGS)) { + p2 = strchr(p1, ','); + if (p2) { + *p2 = '\0'; + if (p1 != p2) + setup_args[i] = p1; + p1 = p2 + 1; + i++; + } else { + setup_args[i] = p1; + break; + } + } + for (i = 0; i < MAX_SETUP_ARGS; i++) + setup_used[i] = 0; + done_setup = 1; + + return 1; } - -__setup("wd33c93", wd33c93_setup); - +__setup("wd33c9=", wd33c93_setup); /* check_setup_args() returns index if key found, 0 if not */ - -static int check_setup_args(char *key, int *flags, int *val, char *buf) +static int +check_setup_args(char *key, int *flags, int *val, char *buf) { -int x; -char *cp; - - for (x=0; x<MAX_SETUP_ARGS; x++) { - if (setup_used[x]) - continue; - if (!strncmp(setup_args[x], key, strlen(key))) - break; - if (!strncmp(setup_args[x], "next", strlen("next"))) - return 0; - } - if (x == MAX_SETUP_ARGS) - return 0; - setup_used[x] = 1; - cp = setup_args[x] + strlen(key); - *val = -1; - if (*cp != ':') - return ++x; - cp++; - if ((*cp >= '0') && (*cp <= '9')) { - *val = simple_strtoul(cp,NULL,0); - } - return ++x; + int x; + char *cp; + + for (x = 0; x < MAX_SETUP_ARGS; x++) { + if (setup_used[x]) + continue; + if (!strncmp(setup_args[x], key, strlen(key))) + break; + if (!strncmp(setup_args[x], "next", strlen("next"))) + return 0; + } + if (x == MAX_SETUP_ARGS) + return 0; + setup_used[x] = 1; + cp = setup_args[x] + strlen(key); + *val = -1; + if (*cp != ':') + return ++x; + cp++; + if ((*cp >= '0') && (*cp <= '9')) { + *val = simple_strtoul(cp, NULL, 0); + } + return ++x; } - - -void wd33c93_init(struct Scsi_Host *instance, const wd33c93_regs regs, - dma_setup_t setup, dma_stop_t stop, int clock_freq) +void +wd33c93_init(struct Scsi_Host *instance, const wd33c93_regs regs, + dma_setup_t setup, dma_stop_t stop, int clock_freq) { -struct WD33C93_hostdata *hostdata; -int i; -int flags; -int val; -char buf[32]; - - if (!done_setup && setup_strings) - wd33c93_setup(setup_strings); - - hostdata = (struct WD33C93_hostdata *)instance->hostdata; - - hostdata->regs = regs; - hostdata->clock_freq = clock_freq; - hostdata->dma_setup = setup; - hostdata->dma_stop = stop; - hostdata->dma_bounce_buffer = NULL; - hostdata->dma_bounce_len = 0; - for (i = 0; i < 8; i++) { - hostdata->busy[i] = 0; - hostdata->sync_xfer[i] = calc_sync_xfer(DEFAULT_SX_PER/4,DEFAULT_SX_OFF); - hostdata->sync_stat[i] = SS_UNSET; /* using default sync values */ + struct WD33C93_hostdata *hostdata; + int i; + int flags; + int val; + char buf[32]; + + if (!done_setup && setup_strings) + wd33c93_setup(setup_strings); + + hostdata = (struct WD33C93_hostdata *) instance->hostdata; + + hostdata->regs = regs; + hostdata->clock_freq = clock_freq; + hostdata->dma_setup = setup; + hostdata->dma_stop = stop; + hostdata->dma_bounce_buffer = NULL; + hostdata->dma_bounce_len = 0; + for (i = 0; i < 8; i++) { + hostdata->busy[i] = 0; + hostdata->sync_xfer[i] = + calc_sync_xfer(DEFAULT_SX_PER / 4, DEFAULT_SX_OFF); + hostdata->sync_stat[i] = SS_UNSET; /* using default sync values */ #ifdef PROC_STATISTICS - hostdata->cmd_cnt[i] = 0; - hostdata->disc_allowed_cnt[i] = 0; - hostdata->disc_done_cnt[i] = 0; + hostdata->cmd_cnt[i] = 0; + hostdata->disc_allowed_cnt[i] = 0; + hostdata->disc_done_cnt[i] = 0; #endif - } - hostdata->input_Q = NULL; - hostdata->selecting = NULL; - hostdata->connected = NULL; - hostdata->disconnected_Q = NULL; - hostdata->state = S_UNCONNECTED; - hostdata->dma = D_DMA_OFF; - hostdata->level2 = L2_BASIC; - hostdata->disconnect = DIS_ADAPTIVE; - hostdata->args = DEBUG_DEFAULTS; - hostdata->incoming_ptr = 0; - hostdata->outgoing_len = 0; - hostdata->default_sx_per = DEFAULT_SX_PER; - hostdata->no_sync = 0xff; /* sync defaults to off */ - hostdata->no_dma = 0; /* default is DMA enabled */ + } + hostdata->input_Q = NULL; + hostdata->selecting = NULL; + hostdata->connected = NULL; + hostdata->disconnected_Q = NULL; + hostdata->state = S_UNCONNECTED; + hostdata->dma = D_DMA_OFF; + hostdata->level2 = L2_BASIC; + hostdata->disconnect = DIS_ADAPTIVE; + hostdata->args = DEBUG_DEFAULTS; + hostdata->incoming_ptr = 0; + hostdata->outgoing_len = 0; + hostdata->default_sx_per = DEFAULT_SX_PER; + hostdata->no_sync = 0xff; /* sync defaults to off */ + hostdata->no_dma = 0; /* default is DMA enabled */ #ifdef PROC_INTERFACE - hostdata->proc = PR_VERSION|PR_INFO|PR_STATISTICS| - PR_CONNECTED|PR_INPUTQ|PR_DISCQ| - PR_STOP; + hostdata->proc = PR_VERSION | PR_INFO | PR_STATISTICS | + PR_CONNECTED | PR_INPUTQ | PR_DISCQ | PR_STOP; #ifdef PROC_STATISTICS - hostdata->dma_cnt = 0; - hostdata->pio_cnt = 0; - hostdata->int_cnt = 0; + hostdata->dma_cnt = 0; + hostdata->pio_cnt = 0; + hostdata->int_cnt = 0; #endif #endif - - if (check_setup_args("nosync",&flags,&val,buf)) - hostdata->no_sync = val; - - if (check_setup_args("nodma",&flags,&val,buf)) - hostdata->no_dma = (val == -1) ? 1 : val; - - if (check_setup_args("period",&flags,&val,buf)) - hostdata->default_sx_per = sx_table[round_period((unsigned int)val)].period_ns; - - if (check_setup_args("disconnect",&flags,&val,buf)) { - if ((val >= DIS_NEVER) && (val <= DIS_ALWAYS)) - hostdata->disconnect = val; - else - hostdata->disconnect = DIS_ADAPTIVE; - } - - if (check_setup_args("level2",&flags,&val,buf)) - hostdata->level2 = val; - - if (check_setup_args("debug",&flags,&val,buf)) - hostdata->args = val & DB_MASK; - - if (check_setup_args("clock",&flags,&val,buf)) { - if (val>7 && val<11) - val = WD33C93_FS_8_10; - else if (val>11 && val<16) - val = WD33C93_FS_12_15; - else if (val>15 && val<21) - val = WD33C93_FS_16_20; - else - val = WD33C93_FS_8_10; - hostdata->clock_freq = val; - } - - if ((i = check_setup_args("next",&flags,&val,buf))) { - while (i) - setup_used[--i] = 1; - } - + if (check_setup_args("nosync", &flags, &val, buf)) + hostdata->no_sync = val; + + if (check_setup_args("nodma", &flags, &val, buf)) + hostdata->no_dma = (val == -1) ? 1 : val; + + if (check_setup_args("period", &flags, &val, buf)) + hostdata->default_sx_per = + sx_table[round_period((unsigned int) val)].period_ns; + + if (check_setup_args("disconnect", &flags, &val, buf)) { + if ((val >= DIS_NEVER) && (val <= DIS_ALWAYS)) + hostdata->disconnect = val; + else + hostdata->disconnect = DIS_ADAPTIVE; + } + + if (check_setup_args("level2", &flags, &val, buf)) + hostdata->level2 = val; + + if (check_setup_args("debug", &flags, &val, buf)) + hostdata->args = val & DB_MASK; + + if (check_setup_args("clock", &flags, &val, buf)) { + if (val > 7 && val < 11) + val = WD33C93_FS_8_10; + else if (val > 11 && val < 16) + val = WD33C93_FS_12_15; + else if (val > 15 && val < 21) + val = WD33C93_FS_16_20; + else + val = WD33C93_FS_8_10; + hostdata->clock_freq = val; + } + + if ((i = check_setup_args("next", &flags, &val, buf))) { + while (i) + setup_used[--i] = 1; + } #ifdef PROC_INTERFACE - if (check_setup_args("proc",&flags,&val,buf)) - hostdata->proc = val; + if (check_setup_args("proc", &flags, &val, buf)) + hostdata->proc = val; #endif - - spin_lock_irq(&hostdata->lock); - reset_wd33c93(instance); - spin_unlock_irq(&hostdata->lock); - - printk("wd33c93-%d: chip=%s/%d no_sync=0x%x no_dma=%d",instance->host_no, - (hostdata->chip==C_WD33C93)?"WD33c93": - (hostdata->chip==C_WD33C93A)?"WD33c93A": - (hostdata->chip==C_WD33C93B)?"WD33c93B":"unknown", - hostdata->microcode,hostdata->no_sync,hostdata->no_dma); + spin_lock_irq(&hostdata->lock); + reset_wd33c93(instance); + spin_unlock_irq(&hostdata->lock); + + printk("wd33c93-%d: chip=%s/%d no_sync=0x%x no_dma=%d", + instance->host_no, + (hostdata->chip == C_WD33C93) ? "WD33c93" : (hostdata->chip == + C_WD33C93A) ? + "WD33c93A" : (hostdata->chip == + C_WD33C93B) ? "WD33c93B" : "unknown", + hostdata->microcode, hostdata->no_sync, hostdata->no_dma); #ifdef DEBUGGING_ON - printk(" debug_flags=0x%02x\n",hostdata->args); + printk(" debug_flags=0x%02x\n", hostdata->args); #else - printk(" debugging=OFF\n"); + printk(" debugging=OFF\n"); #endif - printk(" setup_args="); - for (i=0; i<MAX_SETUP_ARGS; i++) - printk("%s,",setup_args[i]); - printk("\n"); - printk(" Version %s - %s, Compiled %s at %s\n", - WD33C93_VERSION,WD33C93_DATE,__DATE__,__TIME__); + printk(" setup_args="); + for (i = 0; i < MAX_SETUP_ARGS; i++) + printk("%s,", setup_args[i]); + printk("\n"); + printk(" Version %s - %s, Compiled %s at %s\n", + WD33C93_VERSION, WD33C93_DATE, __DATE__, __TIME__); } - -int wd33c93_proc_info(char *buf, char **start, off_t off, int len, int hn, int in) +int +wd33c93_proc_info(char *buf, char **start, off_t off, int len, int hn, int in) { #ifdef PROC_INTERFACE -char *bp; -char tbuf[128]; -struct Scsi_Host *instance; -struct WD33C93_hostdata *hd; -Scsi_Cmnd *cmd; -int x,i; -static int stop = 0; - - instance = scsi_host_hn_get(hn); - if (!instance) { - printk("*** Hmm... Can't find host #%d!\n",hn); - return (-ESRCH); - } - hd = (struct WD33C93_hostdata *)instance->hostdata; + char *bp; + char tbuf[128]; + struct Scsi_Host *instance; + struct WD33C93_hostdata *hd; + Scsi_Cmnd *cmd; + int x, i; + static int stop = 0; + + instance = scsi_host_hn_get(hn); + if (!instance) { + printk("*** Hmm... Can't find host #%d!\n", hn); + return (-ESRCH); + } + hd = (struct WD33C93_hostdata *) instance->hostdata; /* If 'in' is TRUE we need to _read_ the proc file. We accept the following * keywords (same format as command-line, but only ONE per read): @@ -1893,148 +1943,146 @@ static int stop = 0; * nodma */ - if (in) { - buf[len] = '\0'; - bp = buf; - if (!strncmp(bp,"debug:",6)) { - bp += 6; - hd->args = simple_strtoul(bp,NULL,0) & DB_MASK; - } - else if (!strncmp(bp,"disconnect:",11)) { - bp += 11; - x = simple_strtoul(bp,NULL,0); - if (x < DIS_NEVER || x > DIS_ALWAYS) - x = DIS_ADAPTIVE; - hd->disconnect = x; - } - else if (!strncmp(bp,"period:",7)) { - bp += 7; - x = simple_strtoul(bp,NULL,0); - hd->default_sx_per = sx_table[round_period((unsigned int)x)].period_ns; - } - else if (!strncmp(bp,"resync:",7)) { - bp += 7; - x = simple_strtoul(bp,NULL,0); - for (i=0; i<7; i++) - if (x & (1<<i)) - hd->sync_stat[i] = SS_UNSET; - } - else if (!strncmp(bp,"proc:",5)) { - bp += 5; - hd->proc = simple_strtoul(bp,NULL,0); - } - else if (!strncmp(bp,"nodma:",6)) { - bp += 6; - hd->no_dma = simple_strtoul(bp,NULL,0); - } - else if (!strncmp(bp,"level2:",7)) { - bp += 7; - hd->level2 = simple_strtoul(bp,NULL,0); - } - return len; - } - - spin_lock_irq(&hd->lock); - bp = buf; - *bp = '\0'; - if (hd->proc & PR_VERSION) { - sprintf(tbuf,"\nVersion %s - %s. Compiled %s %s", - WD33C93_VERSION,WD33C93_DATE,__DATE__,__TIME__); - strcat(bp,tbuf); - } - if (hd->proc & PR_INFO) { - sprintf(tbuf,"\nclock_freq=%02x no_sync=%02x no_dma=%d", - hd->clock_freq,hd->no_sync,hd->no_dma); - strcat(bp,tbuf); - strcat(bp,"\nsync_xfer[] = "); - for (x=0; x<7; x++) { - sprintf(tbuf,"\t%02x",hd->sync_xfer[x]); - strcat(bp,tbuf); - } - strcat(bp,"\nsync_stat[] = "); - for (x=0; x<7; x++) { - sprintf(tbuf,"\t%02x",hd->sync_stat[x]); - strcat(bp,tbuf); - } - } + if (in) { + buf[len] = '\0'; + bp = buf; + if (!strncmp(bp, "debug:", 6)) { + bp += 6; + hd->args = simple_strtoul(bp, NULL, 0) & DB_MASK; + } else if (!strncmp(bp, "disconnect:", 11)) { + bp += 11; + x = simple_strtoul(bp, NULL, 0); + if (x < DIS_NEVER || x > DIS_ALWAYS) + x = DIS_ADAPTIVE; + hd->disconnect = x; + } else if (!strncmp(bp, "period:", 7)) { + bp += 7; + x = simple_strtoul(bp, NULL, 0); + hd->default_sx_per = + sx_table[round_period((unsigned int) x)].period_ns; + } else if (!strncmp(bp, "resync:", 7)) { + bp += 7; + x = simple_strtoul(bp, NULL, 0); + for (i = 0; i < 7; i++) + if (x & (1 << i)) + hd->sync_stat[i] = SS_UNSET; + } else if (!strncmp(bp, "proc:", 5)) { + bp += 5; + hd->proc = simple_strtoul(bp, NULL, 0); + } else if (!strncmp(bp, "nodma:", 6)) { + bp += 6; + hd->no_dma = simple_strtoul(bp, NULL, 0); + } else if (!strncmp(bp, "level2:", 7)) { + bp += 7; + hd->level2 = simple_strtoul(bp, NULL, 0); + } + return len; + } + + spin_lock_irq(&hd->lock); + bp = buf; + *bp = '\0'; + if (hd->proc & PR_VERSION) { + sprintf(tbuf, "\nVersion %s - %s. Compiled %s %s", + WD33C93_VERSION, WD33C93_DATE, __DATE__, __TIME__); + strcat(bp, tbuf); + } + if (hd->proc & PR_INFO) { + sprintf(tbuf, "\nclock_freq=%02x no_sync=%02x no_dma=%d", + hd->clock_freq, hd->no_sync, hd->no_dma); + strcat(bp, tbuf); + strcat(bp, "\nsync_xfer[] = "); + for (x = 0; x < 7; x++) { + sprintf(tbuf, "\t%02x", hd->sync_xfer[x]); + strcat(bp, tbuf); + } + strcat(bp, "\nsync_stat[] = "); + for (x = 0; x < 7; x++) { + sprintf(tbuf, "\t%02x", hd->sync_stat[x]); + strcat(bp, tbuf); + } + } #ifdef PROC_STATISTICS - if (hd->proc & PR_STATISTICS) { - strcat(bp,"\ncommands issued: "); - for (x=0; x<7; x++) { - sprintf(tbuf,"\t%ld",hd->cmd_cnt[x]); - strcat(bp,tbuf); - } - strcat(bp,"\ndisconnects allowed:"); - for (x=0; x<7; x++) { - sprintf(tbuf,"\t%ld",hd->disc_allowed_cnt[x]); - strcat(bp,tbuf); - } - strcat(bp,"\ndisconnects done: "); - for (x=0; x<7; x++) { - sprintf(tbuf,"\t%ld",hd->disc_done_cnt[x]); - strcat(bp,tbuf); - } - sprintf(tbuf,"\ninterrupts: %ld, DATA_PHASE ints: %ld DMA, %ld PIO", - hd->int_cnt,hd->dma_cnt,hd->pio_cnt); - strcat(bp,tbuf); - } + if (hd->proc & PR_STATISTICS) { + strcat(bp, "\ncommands issued: "); + for (x = 0; x < 7; x++) { + sprintf(tbuf, "\t%ld", hd->cmd_cnt[x]); + strcat(bp, tbuf); + } + strcat(bp, "\ndisconnects allowed:"); + for (x = 0; x < 7; x++) { + sprintf(tbuf, "\t%ld", hd->disc_allowed_cnt[x]); + strcat(bp, tbuf); + } + strcat(bp, "\ndisconnects done: "); + for (x = 0; x < 7; x++) { + sprintf(tbuf, "\t%ld", hd->disc_done_cnt[x]); + strcat(bp, tbuf); + } + sprintf(tbuf, + "\ninterrupts: %ld, DATA_PHASE ints: %ld DMA, %ld PIO", + hd->int_cnt, hd->dma_cnt, hd->pio_cnt); + strcat(bp, tbuf); + } #endif - if (hd->proc & PR_CONNECTED) { - strcat(bp,"\nconnected: "); - if (hd->connected) { - cmd = (Scsi_Cmnd *)hd->connected; - sprintf(tbuf," %ld-%d:%d(%02x)", - cmd->pid, cmd->target, cmd->lun, cmd->cmnd[0]); - strcat(bp,tbuf); - } - } - if (hd->proc & PR_INPUTQ) { - strcat(bp,"\ninput_Q: "); - cmd = (Scsi_Cmnd *)hd->input_Q; - while (cmd) { - sprintf(tbuf," %ld-%d:%d(%02x)", - cmd->pid, cmd->target, cmd->lun, cmd->cmnd[0]); - strcat(bp,tbuf); - cmd = (Scsi_Cmnd *)cmd->host_scribble; - } - } - if (hd->proc & PR_DISCQ) { - strcat(bp,"\ndisconnected_Q:"); - cmd = (Scsi_Cmnd *)hd->disconnected_Q; - while (cmd) { - sprintf(tbuf," %ld-%d:%d(%02x)", - cmd->pid, cmd->target, cmd->lun, cmd->cmnd[0]); - strcat(bp,tbuf); - cmd = (Scsi_Cmnd *)cmd->host_scribble; - } - } - strcat(bp,"\n"); - spin_unlock_irq(&hd->lock); - *start = buf; - if (stop) { - stop = 0; - return 0; - } - if (off > 0x40000) /* ALWAYS stop after 256k bytes have been read */ - stop = 1;; - if (hd->proc & PR_STOP) /* stop every other time */ - stop = 1; - return strlen(bp); - -#else /* PROC_INTERFACE */ - - return 0; - -#endif /* PROC_INTERFACE */ + if (hd->proc & PR_CONNECTED) { + strcat(bp, "\nconnected: "); + if (hd->connected) { + cmd = (Scsi_Cmnd *) hd->connected; + sprintf(tbuf, " %ld-%d:%d(%02x)", + cmd->pid, cmd->device->id, cmd->device->lun, cmd->cmnd[0]); + strcat(bp, tbuf); + } + } + if (hd->proc & PR_INPUTQ) { + strcat(bp, "\ninput_Q: "); + cmd = (Scsi_Cmnd *) hd->input_Q; + while (cmd) { + sprintf(tbuf, " %ld-%d:%d(%02x)", + cmd->pid, cmd->device->id, cmd->device->lun, cmd->cmnd[0]); + strcat(bp, tbuf); + cmd = (Scsi_Cmnd *) cmd->host_scribble; + } + } + if (hd->proc & PR_DISCQ) { + strcat(bp, "\ndisconnected_Q:"); + cmd = (Scsi_Cmnd *) hd->disconnected_Q; + while (cmd) { + sprintf(tbuf, " %ld-%d:%d(%02x)", + cmd->pid, cmd->device->id, cmd->device->lun, cmd->cmnd[0]); + strcat(bp, tbuf); + cmd = (Scsi_Cmnd *) cmd->host_scribble; + } + } + strcat(bp, "\n"); + spin_unlock_irq(&hd->lock); + *start = buf; + if (stop) { + stop = 0; + return 0; + } + if (off > 0x40000) /* ALWAYS stop after 256k bytes have been read */ + stop = 1;; + if (hd->proc & PR_STOP) /* stop every other time */ + stop = 1; + return strlen(bp); + +#else /* PROC_INTERFACE */ + + return 0; + +#endif /* PROC_INTERFACE */ } -#ifdef MODULE -int init_module(void) { return 0; } -void cleanup_module(void) {} -#endif -void wd33c93_release(void) +void +wd33c93_release(void) { } -MODULE_LICENSE("GPL"); +EXPORT_SYMBOL(wd33c93_reset); +EXPORT_SYMBOL(wd33c93_init); +EXPORT_SYMBOL(wd33c93_release); +EXPORT_SYMBOL(wd33c93_abort); +EXPORT_SYMBOL(wd33c93_queuecommand); +EXPORT_SYMBOL(wd33c93_intr); diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 3a3d267c434b..c64005036bb1 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c @@ -237,7 +237,7 @@ serial21285_set_termios(struct uart_port *port, struct termios *termios, struct termios *old) { unsigned long flags; - unsigned int quot, h_lcr; + unsigned int baud, quot, h_lcr; /* * We don't support modem control lines. @@ -253,7 +253,8 @@ serial21285_set_termios(struct uart_port *port, struct termios *termios, /* * Ask the core to calculate the divisor for us. */ - quot = uart_get_divisor(port, termios, old); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + quot = uart_get_divisor(port, baud); switch (termios->c_cflag & CSIZE) { case CS5: @@ -286,7 +287,7 @@ serial21285_set_termios(struct uart_port *port, struct termios *termios, /* * Update the per-port timeout. */ - uart_update_timeout(port, termios->c_cflag, quot); + uart_update_timeout(port, termios->c_cflag, baud); /* * Which character status flags are we interested in? diff --git a/drivers/serial/68328serial.h b/drivers/serial/68328serial.h index fa21e0ae1def..79371be0d951 100644 --- a/drivers/serial/68328serial.h +++ b/drivers/serial/68328serial.h @@ -93,7 +93,7 @@ struct serial_struct { * board I would assume that RXRE is the safest setting. * * For EZ328 I use RXHE (Half empty) interrupt to reduce the number of - * interrupts. RXFE (receive queue full) causes the system to loose data + * interrupts. RXFE (receive queue full) causes the system to lose data * at least at 115200 baud * * If your board is busy doing other stuff, you might consider to use diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index d71cbbfe13e9..2ef3044214d4 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -159,7 +159,8 @@ static const struct serial_uart_config uart_config[PORT_MAX_8250+1] = { { "16C950/954", 128, UART_CLEAR_FIFO | UART_USE_FIFO }, { "ST16654", 64, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, { "XR16850", 128, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, - { "RSA", 2048, UART_CLEAR_FIFO | UART_USE_FIFO } + { "RSA", 2048, UART_CLEAR_FIFO | UART_USE_FIFO }, + { "NS16550A", 16, UART_CLEAR_FIFO | UART_USE_FIFO | UART_NATSEMI } }; static _INLINE_ unsigned int serial_in(struct uart_8250_port *up, int offset) @@ -482,6 +483,40 @@ static void autoconfig_16550a(struct uart_8250_port *up) } /* + * Check for a National Semiconductor SuperIO chip. + * Attempt to switch to bank 2, read the value of the LOOP bit + * from EXCR1. Switch back to bank 0, change it in MCR. Then + * switch back to bank 2, read it from EXCR1 again and check + * it's changed. If so, set baud_base in EXCR2 to 921600. + */ + serial_outp(up, UART_LCR, 0); + status1 = serial_in(up, UART_MCR); + serial_outp(up, UART_LCR, 0xE0); + status2 = serial_in(up, 0x02); /* EXCR1 */ + + if (!((status2 ^ status1) & UART_MCR_LOOP)) { + serial_outp(up, UART_LCR, 0); + serial_outp(up, UART_MCR, status1 ^ UART_MCR_LOOP); + serial_outp(up, UART_LCR, 0xE0); + status2 = serial_in(up, 0x02); /* EXCR1 */ + serial_outp(up, UART_LCR, 0); + serial_outp(up, UART_MCR, status1); + + if ((status2 ^ status1) & UART_MCR_LOOP) { + serial_outp(up, UART_LCR, 0xE0); + status1 = serial_in(up, 0x04); /* EXCR1 */ + status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ + status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ + serial_outp(up, 0x04, status1); + serial_outp(up, UART_LCR, 0); + + up->port.type = PORT_NS16550A; + up->port.uartclk = 921600*16; + return; + } + } + + /* * No EFR. Try to detect a TI16750, which only sets bit 5 of * the IIR when 64 byte FIFO mode is enabled when DLAB is set. * Try setting it with and without DLAB set. Cheap clones @@ -1241,7 +1276,7 @@ static int serial8250_startup(struct uart_port *port) /* * Finally, enable interrupts. Note: Modem status interrupts - * are set via set_termios(), which will be occuring imminently + * are set via set_termios(), which will be occurring imminently * anyway, so we don't enable them here. */ up->ier = UART_IER_RLSI | UART_IER_RDI; @@ -1318,6 +1353,26 @@ static void serial8250_shutdown(struct uart_port *port) serial_unlink_irq_chain(up); } +static unsigned int serial8250_get_divisor(struct uart_port *port, unsigned int baud) +{ + unsigned int quot; + + /* + * Handle magic divisors for baud rates above baud_base on + * SMSC SuperIO chips. + */ + if ((port->flags & UPF_MAGIC_MULTIPLIER) && + baud == (port->uartclk/4)) + quot = 0x8001; + else if ((port->flags & UPF_MAGIC_MULTIPLIER) && + baud == (port->uartclk/8)) + quot = 0x8002; + else + quot = uart_get_divisor(port, baud); + + return quot; +} + static void serial8250_set_termios(struct uart_port *port, struct termios *termios, struct termios *old) @@ -1325,7 +1380,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios, struct uart_8250_port *up = (struct uart_8250_port *)port; unsigned char cval, fcr = 0; unsigned long flags; - unsigned int quot; + unsigned int baud, quot; switch (termios->c_cflag & CSIZE) { case CS5: @@ -1357,7 +1412,8 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios, /* * Ask the core to calculate the divisor for us. */ - quot = uart_get_divisor(port, termios, old); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + quot = serial8250_get_divisor(port, baud); /* * Work around a bug in the Oxford Semiconductor 952 rev B @@ -1369,7 +1425,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios, quot ++; if (uart_config[up->port.type].flags & UART_USE_FIFO) { - if ((up->port.uartclk / quot) < (2400 * 16)) + if (baud < 2400) fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1; #ifdef CONFIG_SERIAL_8250_RSA else if (up->port.type == PORT_RSA) @@ -1390,7 +1446,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios, /* * Update the per-port timeout. */ - uart_update_timeout(port, termios->c_cflag, quot); + uart_update_timeout(port, termios->c_cflag, baud); up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; if (termios->c_iflag & INPCK) @@ -1434,7 +1490,13 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios, serial_outp(up, UART_EFR, termios->c_cflag & CRTSCTS ? UART_EFR_CTS :0); } - serial_outp(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ + + if (uart_config[up->port.type].flags & UART_NATSEMI) { + /* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */ + serial_outp(up, UART_LCR, 0xe0); + } else { + serial_outp(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ + } serial_outp(up, UART_DLL, quot & 0xff); /* LS of divisor */ serial_outp(up, UART_DLM, quot >> 8); /* MS of divisor */ if (up->port.type == PORT_16750) @@ -1989,7 +2051,7 @@ static int __register_serial(struct serial_struct *req, int line) * port exists and is in use an error is returned. If the port * is not currently in the table it is added. * - * The port is then probed and if neccessary the IRQ is autodetected + * The port is then probed and if necessary the IRQ is autodetected * If this fails an error is returned. * * On success the port is ready to use and the line number is returned. diff --git a/drivers/serial/amba.c b/drivers/serial/amba.c index c9ce0272e4c6..e5ab6135b8db 100644 --- a/drivers/serial/amba.c +++ b/drivers/serial/amba.c @@ -408,12 +408,13 @@ ambauart_set_termios(struct uart_port *port, struct termios *termios, { unsigned int lcr_h, old_cr; unsigned long flags; - unsigned int quot; + unsigned int baud, quot; /* * Ask the core to calculate the divisor for us. */ - quot = uart_get_divisor(port, termios, old); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + quot = uart_get_divisor(port, baud); switch (termios->c_cflag & CSIZE) { case CS5: @@ -444,7 +445,7 @@ ambauart_set_termios(struct uart_port *port, struct termios *termios, /* * Update the per-port timeout. */ - uart_update_timeout(port, termios->c_cflag, quot); + uart_update_timeout(port, termios->c_cflag, baud); port->read_status_mask = AMBA_UARTRSR_OE; if (termios->c_iflag & INPCK) diff --git a/drivers/serial/anakin.c b/drivers/serial/anakin.c index 389888efce5c..5512e7b86d7e 100644 --- a/drivers/serial/anakin.c +++ b/drivers/serial/anakin.c @@ -287,7 +287,7 @@ anakin_set_termios(struct uart_port *port, struct termios *termios, struct termios *old) { unsigned long flags; - unsigned int quot; + unsigned int baud, quot; /* * We don't support parity, stop bits, or anything other @@ -304,11 +304,12 @@ anakin_set_termios(struct uart_port *port, struct termios *termios, /* * Ask the core to calculate the divisor for us. */ - quot = uart_get_divisor(port, termios, old); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + quot = uart_get_divisor(port, baud); spin_lock_irqsave(&port->lock, flags); - uart_update_timeout(port, termios->c_cflag, quot); + uart_update_timeout(port, termios->c_cflag, baud); while (!(anakin_in(port, 0x10) & TXEMPTY)) barrier(); diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index a3c1fc468e2c..7c21b52f6f51 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c @@ -320,7 +320,7 @@ static void clps711xuart_set_termios(struct uart_port *port, struct termios *termios, struct termios *old) { - unsigned int ubrlcr, quot; + unsigned int ubrlcr, baud, quot; unsigned long flags; /* @@ -331,7 +331,8 @@ clps711xuart_set_termios(struct uart_port *port, struct termios *termios, /* * Ask the core to calculate the divisor for us. */ - quot = uart_get_divisor(port, termios, old); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + quot = uart_get_divisor(port, baud); switch (termios->c_cflag & CSIZE) { case CS5: @@ -362,7 +363,7 @@ clps711xuart_set_termios(struct uart_port *port, struct termios *termios, /* * Update the per-port timeout. */ - uart_update_timeout(port, termios->c_cflag, quot); + uart_update_timeout(port, termios->c_cflag, baud); port->read_status_mask = UARTDR_OVERR; if (termios->c_iflag & INPCK) diff --git a/drivers/serial/core.c b/drivers/serial/core.c index 4541e7b7be15..f72a6ce64618 100644 --- a/drivers/serial/core.c +++ b/drivers/serial/core.c @@ -271,7 +271,7 @@ static void uart_shutdown(struct uart_info *info) */ void uart_update_timeout(struct uart_port *port, unsigned int cflag, - unsigned int quot) + unsigned int baud) { unsigned int bits; @@ -305,7 +305,7 @@ uart_update_timeout(struct uart_port *port, unsigned int cflag, * Figure the timeout to send the above number of bits. * Add .02 seconds of slop */ - port->timeout = (HZ * bits) / (port->uartclk / (16 * quot)) + HZ/50; + port->timeout = (HZ * bits) / baud + HZ/50; } EXPORT_SYMBOL(uart_update_timeout); @@ -321,6 +321,12 @@ EXPORT_SYMBOL(uart_update_timeout); * Decode the termios structure into a numeric baud rate, * taking account of the magic 38400 baud rate (with spd_* * flags), and mapping the %B0 rate to 9600 baud. + * + * If the new baud rate is invalid, try the old termios setting. + * If it's still invalid, we try 9600 baud. + * + * Update the @termios structure to reflect the baud rate + * we're actually going to be using. */ unsigned int uart_get_baud_rate(struct uart_port *port, struct termios *termios, @@ -383,26 +389,14 @@ EXPORT_SYMBOL(uart_get_baud_rate); /** * uart_get_divisor - return uart clock divisor * @port: uart_port structure describing the port. - * @termios: desired termios settings - * @old_termios: the original port settings, or NULL - * - * Calculate the uart clock divisor for the port. If the - * divisor is invalid, try the old termios setting. If - * the divisor is still invalid, we try 9600 baud. + * @baud: desired baud rate * - * Update the @termios structure to reflect the baud rate - * we're actually going to be using. - * - * If 9600 baud fails, we return a zero divisor. + * Calculate the uart clock divisor for the port. */ unsigned int -uart_get_divisor(struct uart_port *port, struct termios *termios, - struct termios *old_termios) +uart_get_divisor(struct uart_port *port, unsigned int baud) { - unsigned int quot, baud, max = port->uartclk / 16; - - /* Determine divisor based on baud rate */ - baud = uart_get_baud_rate(port, termios, old_termios, 0, max); + unsigned int quot; /* * Old custom speed handling. @@ -832,8 +826,17 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo) goto exit; if (info->flags & UIF_INITIALIZED) { if (((old_flags ^ port->flags) & UPF_SPD_MASK) || - old_custom_divisor != port->custom_divisor) + old_custom_divisor != port->custom_divisor) { + /* If they're setting up a custom divisor or speed, + * instead of clearing it, then bitch about it. No + * need to rate-limit; it's CAP_SYS_ADMIN only. */ + if (port->flags & UPF_SPD_MASK) { + printk(KERN_NOTICE "%s sets custom speed on %s%d. This is deprecated.\n", + current->comm, info->tty->driver.name, + info->port->line); + } uart_change_speed(info, NULL); + } } else retval = uart_startup(info, 1); exit: @@ -2024,11 +2027,11 @@ static int uart_pm(struct pm_dev *dev, pm_request_t rqst, void *data) switch (rqst) { case PM_SUSPEND: case PM_RESUME: - err = uart_pm_set_state(state, (int)data, dev->state); + err = uart_pm_set_state(state, (int)(long)data, dev->state); break; case PM_SET_WAKEUP: - err = uart_pm_set_wakeup(state, (int)data); + err = uart_pm_set_wakeup(state, (int)(long)data); break; } return err; diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index e06be8ade214..c9eb302fc00d 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c @@ -327,7 +327,7 @@ static void sa1100_int(int irq, void *dev_id, struct pt_regs *regs) sa1100_rx_chars(sport, regs); } - /* Clear the relevent break bits */ + /* Clear the relevant break bits */ if (status & (UTSR0_RBB | UTSR0_REB)) UART_PUT_UTSR0(sport, status & (UTSR0_RBB | UTSR0_REB)); @@ -441,7 +441,7 @@ sa1100_set_termios(struct uart_port *port, struct termios *termios, { struct sa1100_port *sport = (struct sa1100_port *)port; unsigned long flags; - unsigned int utcr0, old_utcr3, quot; + unsigned int utcr0, old_utcr3, baud, quot; unsigned int old_csize = old ? old->c_cflag & CSIZE : CS8; /* @@ -470,7 +470,8 @@ sa1100_set_termios(struct uart_port *port, struct termios *termios, /* * Ask the core to calculate the divisor for us. */ - quot = uart_get_divisor(port, termios, old); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + quot = uart_get_divisor(port, baud); spin_lock_irqsave(&sport->port.lock, flags); @@ -507,7 +508,7 @@ sa1100_set_termios(struct uart_port *port, struct termios *termios, /* * Update the per-port timeout. */ - uart_update_timeout(port, termios->c_cflag, quot); + uart_update_timeout(port, termios->c_cflag, baud); /* * disable interrupts and drain transmitter diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index f2dc14483c2a..ed418f25fc11 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -713,7 +713,7 @@ static int sunsu_startup(struct uart_port *port) /* * Finally, enable interrupts. Note: Modem status interrupts - * are set via set_termios(), which will be occuring imminently + * are set via set_termios(), which will be occurring imminently * anyway, so we don't enable them here. */ up->ier = UART_IER_RLSI | UART_IER_RDI; @@ -852,7 +852,7 @@ sunsu_change_speed(struct uart_port *port, unsigned int cflag, /* * Update the per-port timeout. */ - uart_update_timeout(port, cflag, quot); + uart_update_timeout(port, cflag, (port->uartclk / (16 * quot))); up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; if (iflag & INPCK) @@ -919,12 +919,13 @@ static void sunsu_set_termios(struct uart_port *port, struct termios *termios, struct termios *old) { - unsigned int quot; + unsigned int baud, quot; /* * Ask the core to calculate the divisor for us. */ - quot = uart_get_divisor(port, termios, old); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + quot = uart_get_divisor(port, baud); sunsu_change_speed(port, termios->c_cflag, termios->c_iflag, quot); } diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 9be9260b7006..ab61f6342a99 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -48,7 +48,7 @@ #include "sunzilog.h" /* On 32-bit sparcs we need to delay after register accesses - * to accomodate sun4 systems, but we do not need to flush writes. + * to accommodate sun4 systems, but we do not need to flush writes. * On 64-bit sparc we only need to flush single writes to ensure * completion. */ diff --git a/drivers/serial/uart00.c b/drivers/serial/uart00.c index 8071a2556950..eb4b478c0f8f 100644 --- a/drivers/serial/uart00.c +++ b/drivers/serial/uart00.c @@ -317,7 +317,7 @@ static void uart00_set_termios(struct uart_port *port, struct termios *termios, struct termios *old) { - unsigned int uart_mc, old_ies, quot; + unsigned int uart_mc, old_ies, baud, quot; unsigned long flags; /* @@ -328,7 +328,8 @@ uart00_set_termios(struct uart_port *port, struct termios *termios, /* * Ask the core to calculate the divisor for us. */ - quot = uart_get_divisor(port, termios, old); + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + quot = uart_get_divisor(port, baud); /* byte size and parity */ switch (termios->c_cflag & CSIZE) { @@ -358,7 +359,7 @@ uart00_set_termios(struct uart_port *port, struct termios *termios, /* * Update the per-port timeout. */ - uart_update_timeout(port, termios->c_cflag, quot); + uart_update_timeout(port, termios->c_cflag, baud); port->read_status_mask = UART_RDS_OE_MSK; if (termios->c_iflag & INPCK) diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index cfc22ade4547..581d69203bc5 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -7717,7 +7717,7 @@ int __init ixj_probe_isapnp(int *cnt) printk("pnp attach failed %d \n", result); break; } - if (pnp_activate_dev(dev, NULL) < 0) { + if (pnp_activate_dev(dev) < 0) { printk("pnp activate failed (out of resources?)\n"); pnp_device_detach(dev); return -ENOMEM; diff --git a/drivers/usb/class/bluetty.c b/drivers/usb/class/bluetty.c index 0a1f56e63cde..d7cc97c9eff1 100644 --- a/drivers/usb/class/bluetty.c +++ b/drivers/usb/class/bluetty.c @@ -267,7 +267,7 @@ static inline struct usb_bluetooth* get_usb_bluetooth (struct usb_bluetooth *blu { if (!bluetooth || bluetooth_paranoia_check (bluetooth, function)) { - /* then say that we dont have a valid usb_bluetooth thing, which will + /* then say that we don't have a valid usb_bluetooth thing, which will * end up generating -ENODEV return values */ return NULL; } diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index c104506eeafb..2fe106a21ace 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c @@ -417,7 +417,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) if (unlikely (ehci->pshadow [frame].ptr != 0)) { // FIXME -- just link toward the end, before any qh with a shorter period, -// AND accomodate it already having been linked here (after some other qh) +// AND accommodate it already having been linked here (after some other qh) // AS WELL AS updating the schedule checking logic BUG (); diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index 4ebfbdec3ff3..602b597cedab 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -213,7 +213,7 @@ static int mdc800_endpoint_equals (struct usb_endpoint_descriptor *a,struct usb_ /* - * Checks wether the camera responds busy + * Checks whether the camera responds busy */ static int mdc800_isBusy (char* ch) { @@ -229,7 +229,7 @@ static int mdc800_isBusy (char* ch) /* - * Checks wether the Camera is ready + * Checks whether the Camera is ready */ static int mdc800_isReady (char *ch) { diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index ad7e24b05fb4..de4272086259 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c @@ -572,7 +572,7 @@ static void mts_command_done( struct urb *transfer, struct pt_regs *regs ) MTS_DEBUG_GOT_HERE(); context->srb->result = DID_ABORT<<16; } else { - /* A genuine error has occured */ + /* A genuine error has occurred */ MTS_DEBUG_GOT_HERE(); context->srb->result = DID_ERROR<<16; diff --git a/drivers/usb/media/konicawc.c b/drivers/usb/media/konicawc.c index 86cc8b3628c0..90049bc8993a 100644 --- a/drivers/usb/media/konicawc.c +++ b/drivers/usb/media/konicawc.c @@ -266,7 +266,7 @@ static int konicawc_compress_iso(struct uvd *uvd, struct urb *dataurb, struct ur sts &= ~0x40; } - /* work out the button status, but dont do + /* work out the button status, but don't do anything with it for now */ if(button != cam->buttonsts) { @@ -607,7 +607,7 @@ static int konicawc_set_video_mode(struct uvd *uvd, struct video_window *vw) } if(newsize > MAX_FRAME_SIZE) { - DEBUG(1, "couldnt find size %d,%d", x, y); + DEBUG(1, "couldn't find size %d,%d", x, y); return -EINVAL; } @@ -806,7 +806,7 @@ static int konicawc_probe(struct usb_interface *intf, const struct usb_device_id while(i--) { usb_free_urb(cam->sts_urb[i]); } - err("cant allocate urbs"); + err("can't allocate urbs"); return -ENOMEM; } } diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c index c9f43dc14f0b..28132e35a4a7 100644 --- a/drivers/usb/misc/auerswald.c +++ b/drivers/usb/misc/auerswald.c @@ -1946,7 +1946,7 @@ static int auerswald_probe (struct usb_interface *intf, if (intf->altsetting->desc.bInterfaceNumber != 0) return -ENODEV; - /* allocate memory for our device and intialize it */ + /* allocate memory for our device and initialize it */ cp = kmalloc (sizeof(auerswald_t), GFP_KERNEL); if (cp == NULL) { err ("out of memory"); diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 1a7057ae1ac4..69abd70e79cf 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c @@ -159,7 +159,7 @@ static int kobil_startup (struct usb_serial *serial) } usb_set_serial_port_data(serial->port, priv); - // search for the neccessary endpoints + // search for the necessary endpoints pdev = serial->dev; actconfig = pdev->actconfig; interface = actconfig->interface; diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h index 78175b05171d..5389343ecaf7 100644 --- a/drivers/usb/serial/usb-serial.h +++ b/drivers/usb/serial/usb-serial.h @@ -342,7 +342,7 @@ static inline struct usb_serial* get_usb_serial (struct usb_serial_port *port, c if (!port || port_paranoia_check (port, function) || serial_paranoia_check (port->serial, function)) { - /* then say that we dont have a valid usb_serial thing, which will + /* then say that we don't have a valid usb_serial thing, which will * end up genrating -ENODEV return values */ return NULL; } diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c index 8c723e012997..db22ea34a3b5 100644 --- a/drivers/usb/storage/freecom.c +++ b/drivers/usb/storage/freecom.c @@ -240,7 +240,7 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us) * may not work, but that is a condition that should never happen. */ while (fst->Status & FCM_STATUS_BUSY) { - US_DEBUGP("20 second USB/ATAPI bridge TIMEOUT occured!\n"); + US_DEBUGP("20 second USB/ATAPI bridge TIMEOUT occurred!\n"); US_DEBUGP("fst->Status is %x\n", fst->Status); /* Get the status again */ diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 2912543d7300..b5c7e6745b1a 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -498,7 +498,7 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i goto exit; } - /* allocate memory for our device state and intialize it */ + /* allocate memory for our device state and initialize it */ dev = kmalloc (sizeof(struct usb_skel), GFP_KERNEL); if (dev == NULL) { err ("Out of memory"); diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index a98aa38199b8..1a5410518e0b 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -274,9 +274,9 @@ display of sprites, I use the following policy on horizontal panning and the hardware cursor: - - if you want to start display DMA too early, you loose the ability to + - if you want to start display DMA too early, you lose the ability to do smooth horizontal panning (xpanstep 1 -> 64). - - if you want to go even further, you loose the hardware cursor too. + - if you want to go even further, you lose the hardware cursor too. IMHO a hardware cursor is more important for X than horizontal scrolling, so that's my motivation. diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c index 69bb72d5777a..73db07b72347 100644 --- a/drivers/video/controlfb.c +++ b/drivers/video/controlfb.c @@ -554,7 +554,7 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro /* - * Called from fbmem.c for probing & intializing + * Called from fbmem.c for probing & initializing */ int __init control_init(void) { diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index e21e8e38e931..0d88606bb6d0 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c @@ -1697,7 +1697,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb) unsigned char val; #if defined(__sparc_v9__) -#error "You loose, consult DaveM." +#error "You lose, consult DaveM." #elif defined(__sparc__) /* * SPARC does not have an "outb" instruction, so we generate diff --git a/drivers/video/macfb.c b/drivers/video/macfb.c index f589222abde0..12d5e7710b37 100644 --- a/drivers/video/macfb.c +++ b/drivers/video/macfb.c @@ -223,7 +223,7 @@ static int dafb_setpalette (unsigned int regno, unsigned int red, local_irq_save(flags); /* fbdev will set an entire colourmap, but X won't. Hopefully - this should accomodate both of them */ + this should accommodate both of them */ if (regno != lastreg+1) { int i; diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c index 0790fbf9db7d..78781ac6aa32 100644 --- a/drivers/video/pvr2fb.c +++ b/drivers/video/pvr2fb.c @@ -15,7 +15,7 @@ * an odd scheme for converting hardware values to/from framebuffer values, here are * some hacked-up formulas: * - * The Dreamcast has screen offsets from each side of it's four borders and the start + * The Dreamcast has screen offsets from each side of its four borders and the start * offsets of the display window. I used these values to calculate 'pseudo' values * (think of them as placeholders) for the fb video mode, so that when it came time * to convert these values back into their hardware values, I could just add mode- diff --git a/drivers/video/retz3fb.c b/drivers/video/retz3fb.c index fb5e1020908c..0c9f67a3d501 100644 --- a/drivers/video/retz3fb.c +++ b/drivers/video/retz3fb.c @@ -1379,7 +1379,7 @@ int __init retz3fb_init(void) zinfo->base = ioremap(board_addr, board_size); zinfo->regs = zinfo->base; zinfo->fbmem = zinfo->base + VIDEO_MEM_OFFSET; - /* Get memory size - for now we asume its a 4MB board */ + /* Get memory size - for now we asume it's a 4MB board */ zinfo->fbsize = 0x00400000; /* 4 MB */ zinfo->physregs = board_addr; zinfo->physfbmem = board_addr + VIDEO_MEM_OFFSET; diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index 39da1994574d..3d96bd9bd6dc 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c @@ -1370,7 +1370,7 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi) #ifdef CONFIG_SA1100_HUW_WEBPANEL #error Move me into __sa1100fb_lcd_power and/or __sa1100fb_backlight_power if (machine_is_huw_webpanel()) { - // dont forget to set the control lines to zero (?) + // don't forget to set the control lines to zero (?) DPRINTK("ShutDown HuW LCD controller\n"); BCR_clear(BCR_TFT_ENA + BCR_CCFL_POW + BCR_PWM_BACKLIGHT); } diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index d23f97ed5617..90abf200ad73 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c @@ -35,7 +35,7 @@ wich one should i use ? is there any preferred one ? It seems ARGB is the one ... -TODO: in set_var check the validity of timings (hsync vsync)... --TODO: check and recheck the use of sst_wait_idle : we dont flush the fifo via +-TODO: check and recheck the use of sst_wait_idle : we don't flush the fifo via a nop command. so it's ok as long as the commands we pass don't go through the fifo. warning: issuing a nop command seems to need pci_fifo -FIXME: in case of failure in the init sequence, be sure we return to a safe diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c index b1028793967f..cee4bb9552d9 100644 --- a/fs/adfs/dir_f.c +++ b/fs/adfs/dir_f.c @@ -259,7 +259,7 @@ adfs_obj2dir(struct adfs_direntry *de, struct object_info *obj) /* * get a directory entry. Note that the caller is responsible - * for holding the relevent locks. + * for holding the relevant locks. */ int __adfs_dir_get(struct adfs_dir *dir, int pos, struct object_info *obj) diff --git a/fs/afs/vnode.c b/fs/afs/vnode.c index ab2d7b241fc3..8fe1cc583413 100644 --- a/fs/afs/vnode.c +++ b/fs/afs/vnode.c @@ -272,7 +272,7 @@ int afs_vnode_fetch_data(afs_vnode_t *vnode, struct afs_rxfs_fetch_descriptor *d /*****************************************************************************/ /* * break any outstanding callback on a vnode - * - only relevent to server that issued it + * - only relevant to server that issued it */ int afs_vnode_give_up_callback(afs_vnode_t *vnode) { diff --git a/fs/befs/ChangeLog b/fs/befs/ChangeLog index 3ad7c308be08..ce8c787916be 100644 --- a/fs/befs/ChangeLog +++ b/fs/befs/ChangeLog @@ -117,7 +117,7 @@ Version 0.6 (2001-12-15) * Rewrote datastream positon lookups. (datastream.c) [WD] -* Moved the TODO list to it's own file. +* Moved the TODO list to its own file. Version 0.50 (2001-11-13) diff --git a/fs/befs/btree.c b/fs/befs/btree.c index c5ed07677b69..b885cf1822e0 100644 --- a/fs/befs/btree.c +++ b/fs/befs/btree.c @@ -41,7 +41,7 @@ /* Befs B+tree structure: * * The first thing in the tree is the tree superblock. It tells you - * all kinds of usefull things about the tree, like where the rootnode + * all kinds of useful things about the tree, like where the rootnode * is located, and the size of the nodes (always 1024 with current version * of BeOS). * diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 67821952734b..0b5772d6fc94 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -541,7 +541,7 @@ befs_utf2nls(struct super_block *sb, const char *in, wchar_t uni; int unilen, utflen; char *result; - int maxlen = in_len; /* The utf8->nls conversion cant make more chars */ + int maxlen = in_len; /* The utf8->nls conversion can't make more chars */ befs_debug(sb, "---> utf2nls()"); @@ -334,7 +334,7 @@ oom: * @bdev: I/O target * * Return the approximate number of pages we can send to this target. - * There's no guarentee that you will be able to fit this number of pages + * There's no guarantee that you will be able to fit this number of pages * into a bio, it does not account for dynamic restrictions that vary * on offset. */ @@ -383,7 +383,7 @@ int bio_add_page(struct bio *bio, struct page *page, unsigned int len, return 0; /* - * we might loose a segment or two here, but rather that than + * we might lose a segment or two here, but rather that than * make this too complex. */ retry_segments: diff --git a/fs/buffer.c b/fs/buffer.c index db30b305962a..9258e2d6b6fe 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2495,7 +2495,7 @@ int block_write_full_page(struct page *page, get_block_t *get_block, /* * The page straddles i_size. It must be zeroed out on each and every - * writepage invokation because it may be mmapped. "A file is mapped + * writepage invocation because it may be mmapped. "A file is mapped * in multiples of the page size. For a file that is not a multiple of * the page size, the remaining memory is zeroed when mapped, and * writes to that region are not written out to the file." @@ -2584,7 +2584,7 @@ int submit_bh(int rw, struct buffer_head * bh) * BH_Lock state bit), any buffer that appears to be clean when doing a * write request, and any buffer that appears to be up-to-date when doing * read request. Further it marks as clean buffers that are processed for - * writing (the buffer cache wont assume that they are actually clean until + * writing (the buffer cache won't assume that they are actually clean until * the buffer gets unlocked). * * ll_rw_block sets b_end_io to simple completion handler that marks diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h index c0b1ed049983..f4b7ed7ee4ff 100644 --- a/fs/cifs/cifs_unicode.h +++ b/fs/cifs/cifs_unicode.h @@ -99,7 +99,7 @@ UniStrcat(wchar_t * ucs1, const wchar_t * ucs2) * UniStrchr: Find a character in a string * * Returns: - * Address of first occurance of character in string + * Address of first occurrence of character in string * or NULL if the character is not in the string */ static inline wchar_t * diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index d21e513937fc..10bc936bbe70 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h @@ -1245,7 +1245,7 @@ typedef struct smb_com_transaction2_get_dfs_refer_req { __u8 Reserved3; __u16 SubCommand; /* one setup word */ __u16 ByteCount; - __u8 Pad[3]; /* Win2K has sent 0x0F01 (max resp length perhaps?) followed by one byte pad - doesnt seem to matter though */ + __u8 Pad[3]; /* Win2K has sent 0x0F01 (max resp length perhaps?) followed by one byte pad - doesn't seem to matter though */ __u16 MaxReferralLevel; char RequestFileName[1]; } TRANSACTION2_GET_DFS_REFER_REQ; diff --git a/fs/dcache.c b/fs/dcache.c index a93b44eb0d84..ef29520b5325 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1004,8 +1004,11 @@ struct dentry * d_lookup(struct dentry * parent, struct qstr * name) */ if (unlikely(move_count != dentry->d_move_count)) break; - if (!d_unhashed(dentry)) - found = dget(dentry); + if (!d_unhashed(dentry)) { + atomic_inc(&dentry->d_count); + dentry->d_vfs_flags |= DCACHE_REFERENCED; + found = dentry; + } spin_unlock(&dentry->d_lock); break; } diff --git a/fs/devfs/base.c b/fs/devfs/base.c index b82077b01ec1..b1f69f0afed1 100644 --- a/fs/devfs/base.c +++ b/fs/devfs/base.c @@ -1312,7 +1312,7 @@ static struct devfs_entry *get_devfs_entry_from_vfs_inode (struct inode *inode) * free_dentry - Free the dentry for a device entry and invalidate inode. * @de: The entry. * - * This must only be called after the entry has been unhooked from it's + * This must only be called after the entry has been unhooked from its * parent directory. */ @@ -1584,7 +1584,7 @@ static int _devfs_unhook (struct devfs_entry *de) /** - * _devfs_unregister - Unregister a device entry from it's parent. + * _devfs_unregister - Unregister a device entry from its parent. * @dir: The parent directory. * @de: The entry to unregister. * @@ -2658,7 +2658,7 @@ static int devfs_rmdir (struct inode *dir, struct dentry *dentry) else de->u.dir.no_more_additions = TRUE; write_unlock (&de->u.dir.lock); if (err) return err; - /* Now unhook the directory from it's parent */ + /* Now unhook the directory from its parent */ write_lock (&de->parent->u.dir.lock); if ( !_devfs_unhook (de) ) err = -ENOENT; write_unlock (&de->parent->u.dir.lock); diff --git a/fs/direct-io.c b/fs/direct-io.c index ea502932379a..d0d1677d18b8 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -42,7 +42,7 @@ /* * This code generally works in units of "dio_blocks". A dio_block is * somewhere between the hard sector size and the filesystem block size. it - * is determined on a per-invokation basis. When talking to the filesystem + * is determined on a per-invocation basis. When talking to the filesystem * we need to convert dio_blocks to fs_blocks by scaling the dio_block quantity * down by dio->blkfactor. Similarly, fs-blocksize quantities are converted * to bio_block quantities by shifting left by blkfactor. diff --git a/fs/eventpoll.c b/fs/eventpoll.c index dd886ac3488b..292cb491d30e 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -97,7 +97,7 @@ /* * Remove the item from the list and perform its initialization. - * This is usefull for us because we can test if the item is linked + * This is useful for us because we can test if the item is linked * using "EP_IS_LINKED(p)". */ #define EP_LIST_DEL(p) do { list_del(p); INIT_LIST_HEAD(p); } while (0) @@ -950,7 +950,7 @@ static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead, po } else { - /* We have to signal that an error occured */ + /* We have to signal that an error occurred */ epi->nwait = -1; } } diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index c694cfc798e8..9367f43f4acb 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c @@ -419,7 +419,7 @@ ext2_acl_chmod(struct inode *inode) */ static size_t ext2_xattr_list_acl_access(char *list, struct inode *inode, - const char *name, int name_len, int flags) + const char *name, int name_len) { const size_t size = sizeof(XATTR_NAME_ACL_ACCESS); @@ -432,7 +432,7 @@ ext2_xattr_list_acl_access(char *list, struct inode *inode, static size_t ext2_xattr_list_acl_default(char *list, struct inode *inode, - const char *name, int name_len, int flags) + const char *name, int name_len) { const size_t size = sizeof(XATTR_NAME_ACL_DEFAULT); @@ -465,7 +465,7 @@ ext2_xattr_get_acl(struct inode *inode, int type, void *buffer, size_t size) static int ext2_xattr_get_acl_access(struct inode *inode, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { if (strcmp(name, "") != 0) return -EINVAL; @@ -474,7 +474,7 @@ ext2_xattr_get_acl_access(struct inode *inode, const char *name, static int ext2_xattr_get_acl_default(struct inode *inode, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { if (strcmp(name, "") != 0) return -EINVAL; diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 72fd8b2c4b54..2383ec92098e 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -199,7 +199,7 @@ ext2_xattr_handler(int name_index) */ ssize_t ext2_getxattr(struct dentry *dentry, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { struct ext2_xattr_handler *handler; struct inode *inode = dentry->d_inode; @@ -207,7 +207,7 @@ ext2_getxattr(struct dentry *dentry, const char *name, handler = ext2_xattr_resolve_name(&name); if (!handler) return -EOPNOTSUPP; - return handler->get(inode, name, buffer, size, flags); + return handler->get(inode, name, buffer, size); } /* @@ -217,9 +217,9 @@ ext2_getxattr(struct dentry *dentry, const char *name, * BKL held [before 2.5.x] */ ssize_t -ext2_listxattr(struct dentry *dentry, char *buffer, size_t size, int flags) +ext2_listxattr(struct dentry *dentry, char *buffer, size_t size) { - return ext2_xattr_list(dentry->d_inode, buffer, size, flags); + return ext2_xattr_list(dentry->d_inode, buffer, size); } /* @@ -250,7 +250,7 @@ ext2_setxattr(struct dentry *dentry, const char *name, * BKL held [before 2.5.x] */ int -ext2_removexattr(struct dentry *dentry, const char *name, int flags) +ext2_removexattr(struct dentry *dentry, const char *name) { struct ext2_xattr_handler *handler; struct inode *inode = dentry->d_inode; @@ -258,7 +258,7 @@ ext2_removexattr(struct dentry *dentry, const char *name, int flags) handler = ext2_xattr_resolve_name(&name); if (!handler) return -EOPNOTSUPP; - return handler->set(inode, name, NULL, 0, flags | XATTR_REPLACE); + return handler->set(inode, name, NULL, 0, XATTR_REPLACE); } /* @@ -371,8 +371,7 @@ cleanup: * used / required on success. */ int -ext2_xattr_list(struct inode *inode, char *buffer, size_t buffer_size, - int flags) +ext2_xattr_list(struct inode *inode, char *buffer, size_t buffer_size) { struct buffer_head *bh = NULL; struct ext2_xattr_entry *entry; @@ -412,7 +411,7 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list", handler = ext2_xattr_handler(entry->e_name_index); if (handler) size += handler->list(NULL, inode, entry->e_name, - entry->e_name_len, flags); + entry->e_name_len); } if (ext2_xattr_cache_insert(bh)) @@ -435,7 +434,7 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list", handler = ext2_xattr_handler(entry->e_name_index); if (handler) buf += handler->list(buf, inode, entry->e_name, - entry->e_name_len, flags); + entry->e_name_len); } error = size; diff --git a/fs/ext2/xattr.h b/fs/ext2/xattr.h index 5221a575ad5d..1fdb6f970b66 100644 --- a/fs/ext2/xattr.h +++ b/fs/ext2/xattr.h @@ -58,9 +58,9 @@ struct ext2_xattr_entry { struct ext2_xattr_handler { char *prefix; size_t (*list)(char *list, struct inode *inode, const char *name, - int name_len, int flags); + int name_len); int (*get)(struct inode *inode, const char *name, void *buffer, - size_t size, int flags); + size_t size); int (*set)(struct inode *inode, const char *name, const void *buffer, size_t size, int flags); }; @@ -69,12 +69,12 @@ extern int ext2_xattr_register(int, struct ext2_xattr_handler *); extern void ext2_xattr_unregister(int, struct ext2_xattr_handler *); extern int ext2_setxattr(struct dentry *, const char *, const void *, size_t, int); -extern ssize_t ext2_getxattr(struct dentry *, const char *, void *, size_t, int); -extern ssize_t ext2_listxattr(struct dentry *, char *, size_t, int); -extern int ext2_removexattr(struct dentry *, const char *, int); +extern ssize_t ext2_getxattr(struct dentry *, const char *, void *, size_t); +extern ssize_t ext2_listxattr(struct dentry *, char *, size_t); +extern int ext2_removexattr(struct dentry *, const char *); extern int ext2_xattr_get(struct inode *, int, const char *, void *, size_t); -extern int ext2_xattr_list(struct inode *, char *, size_t, int flags); +extern int ext2_xattr_list(struct inode *, char *, size_t); extern int ext2_xattr_set(struct inode *, int, const char *, const void *, size_t, int); extern void ext2_xattr_delete_inode(struct inode *); diff --git a/fs/ext2/xattr_trusted.c b/fs/ext2/xattr_trusted.c index bfe2cc2e4f26..d9478aed723f 100644 --- a/fs/ext2/xattr_trusted.c +++ b/fs/ext2/xattr_trusted.c @@ -16,11 +16,11 @@ static size_t ext2_xattr_trusted_list(char *list, struct inode *inode, - const char *name, int name_len, int flags) + const char *name, int name_len) { const int prefix_len = sizeof(XATTR_TRUSTED_PREFIX)-1; - if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN))) + if (!capable(CAP_SYS_ADMIN)) return 0; if (list) { @@ -33,11 +33,11 @@ ext2_xattr_trusted_list(char *list, struct inode *inode, static int ext2_xattr_trusted_get(struct inode *inode, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { if (strcmp(name, "") == 0) return -EINVAL; - if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN))) + if (!capable(CAP_SYS_ADMIN)) return -EPERM; return ext2_xattr_get(inode, EXT2_XATTR_INDEX_TRUSTED, name, buffer, size); @@ -49,7 +49,7 @@ ext2_xattr_trusted_set(struct inode *inode, const char *name, { if (strcmp(name, "") == 0) return -EINVAL; - if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN))) + if (!capable(CAP_SYS_ADMIN)) return -EPERM; return ext2_xattr_set(inode, EXT2_XATTR_INDEX_TRUSTED, name, value, size, flags); diff --git a/fs/ext2/xattr_user.c b/fs/ext2/xattr_user.c index cdcc78e6a713..027beb89c7e0 100644 --- a/fs/ext2/xattr_user.c +++ b/fs/ext2/xattr_user.c @@ -19,12 +19,11 @@ static size_t ext2_xattr_user_list(char *list, struct inode *inode, - const char *name, int name_len, int flags) + const char *name, int name_len) { const int prefix_len = sizeof(XATTR_USER_PREFIX)-1; - if (!(flags & XATTR_KERNEL_CONTEXT) && - !test_opt(inode->i_sb, XATTR_USER)) + if (!test_opt(inode->i_sb, XATTR_USER)) return 0; if (list) { @@ -37,49 +36,46 @@ ext2_xattr_user_list(char *list, struct inode *inode, static int ext2_xattr_user_get(struct inode *inode, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { + int error; + if (strcmp(name, "") == 0) return -EINVAL; - if (!(flags & XATTR_KERNEL_CONTEXT)) { - int error; - - if (!test_opt(inode->i_sb, XATTR_USER)) - return -EOPNOTSUPP; + if (!test_opt(inode->i_sb, XATTR_USER)) + return -EOPNOTSUPP; #ifdef CONFIG_EXT2_FS_POSIX_ACL - error = ext2_permission_locked(inode, MAY_READ); + error = ext2_permission_locked(inode, MAY_READ); #else - error = permission(inode, MAY_READ); + error = permission(inode, MAY_READ); #endif - if (error) - return error; - } - return ext2_xattr_get(inode, EXT2_XATTR_INDEX_USER, name, - buffer, size); + if (error) + return error; + + return ext2_xattr_get(inode, EXT2_XATTR_INDEX_USER, name, buffer, size); } static int ext2_xattr_user_set(struct inode *inode, const char *name, const void *value, size_t size, int flags) { + int error; + if (strcmp(name, "") == 0) return -EINVAL; + if (!test_opt(inode->i_sb, XATTR_USER)) + return -EOPNOTSUPP; if ( !S_ISREG(inode->i_mode) && (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) return -EPERM; - if (!(flags & XATTR_KERNEL_CONTEXT)) { - int error; - - if (!test_opt(inode->i_sb, XATTR_USER)) - return -EOPNOTSUPP; #ifdef CONFIG_EXT2_FS_POSIX_ACL - error = ext2_permission_locked(inode, MAY_WRITE); + error = ext2_permission_locked(inode, MAY_WRITE); #else - error = permission(inode, MAY_WRITE); + error = permission(inode, MAY_WRITE); #endif - if (error) - return error; - } + if (error) + return error; + return ext2_xattr_set(inode, EXT2_XATTR_INDEX_USER, name, value, size, flags); } diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c index eeaef931bd11..fc6c53e936bb 100644 --- a/fs/ext3/acl.c +++ b/fs/ext3/acl.c @@ -431,7 +431,7 @@ ext3_acl_chmod(struct inode *inode) */ static size_t ext3_xattr_list_acl_access(char *list, struct inode *inode, - const char *name, int name_len, int flags) + const char *name, int name_len) { const size_t size = sizeof(XATTR_NAME_ACL_ACCESS); @@ -444,7 +444,7 @@ ext3_xattr_list_acl_access(char *list, struct inode *inode, static size_t ext3_xattr_list_acl_default(char *list, struct inode *inode, - const char *name, int name_len, int flags) + const char *name, int name_len) { const size_t size = sizeof(XATTR_NAME_ACL_DEFAULT); @@ -477,7 +477,7 @@ ext3_xattr_get_acl(struct inode *inode, int type, void *buffer, size_t size) static int ext3_xattr_get_acl_access(struct inode *inode, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { if (strcmp(name, "") != 0) return -EINVAL; @@ -486,7 +486,7 @@ ext3_xattr_get_acl_access(struct inode *inode, const char *name, static int ext3_xattr_get_acl_default(struct inode *inode, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { if (strcmp(name, "") != 0) return -EINVAL; diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c index 936ed5234988..e51368478f9c 100644 --- a/fs/ext3/dir.c +++ b/fs/ext3/dir.c @@ -33,12 +33,17 @@ static unsigned char ext3_filetype_table[] = { static int ext3_readdir(struct file *, void *, filldir_t); static int ext3_dx_readdir(struct file * filp, void * dirent, filldir_t filldir); +static int ext3_release_dir (struct inode * inode, + struct file * filp); struct file_operations ext3_dir_operations = { .read = generic_read_dir, .readdir = ext3_readdir, /* we take BKL. needed?*/ .ioctl = ext3_ioctl, /* BKL held */ .fsync = ext3_sync_file, /* BKL held */ +#ifdef CONFIG_EXT3_INDEX + .release = ext3_release_dir, +#endif }; @@ -275,7 +280,11 @@ static void free_rb_tree_fname(struct rb_root *root) */ parent = n->rb_parent; fname = rb_entry(n, struct fname, rb_hash); - kfree(fname); + while (fname) { + struct fname * old = fname; + fname = fname->next; + kfree (old); + } if (!parent) root->rb_node = 0; else if (parent->rb_left == n) @@ -481,4 +490,13 @@ finished: UPDATE_ATIME(inode); return 0; } + +static int ext3_release_dir (struct inode * inode, struct file * filp) +{ + if (is_dx(inode) && filp->private_data) + ext3_htree_free_dir_info(filp->private_data); + + return 0; +} + #endif diff --git a/fs/ext3/file.c b/fs/ext3/file.c index 3afb4e946097..7a329a70a6f2 100644 --- a/fs/ext3/file.c +++ b/fs/ext3/file.c @@ -55,29 +55,61 @@ static int ext3_open_file (struct inode * inode, struct file * filp) return 0; } -/* - * ext3_file_write(). - * - * Most things are done in ext3_prepare_write() and ext3_commit_write(). - */ - static ssize_t ext3_file_write(struct kiocb *iocb, const char *buf, size_t count, loff_t pos) { struct file *file = iocb->ki_filp; struct inode *inode = file->f_dentry->d_inode; + int ret, err; + + ret = generic_file_aio_write(iocb, buf, count, pos); /* - * Nasty: if the file is subject to synchronous writes then we need - * to force generic_osync_inode() to call ext3_write_inode(). - * We do that by marking the inode dirty. This adds much more - * computational expense than we need, but we're going to sync - * anyway. + * Skip flushing if there was an error, or if nothing was written. + */ + if (ret <= 0) + return ret; + + /* + * If the inode is IS_SYNC, or is O_SYNC and we are doing data + * journalling then we need to make sure that we force the transaction + * to disk to keep all metadata uptodate synchronously. */ - if (IS_SYNC(inode) || (file->f_flags & O_SYNC)) - mark_inode_dirty(inode); + if (file->f_flags & O_SYNC) { + /* + * If we are non-data-journaled, then the dirty data has + * already been flushed to backing store by generic_osync_inode, + * and the inode has been flushed too if there have been any + * modifications other than mere timestamp updates. + * + * Open question --- do we care about flushing timestamps too + * if the inode is IS_SYNC? + */ + if (!ext3_should_journal_data(inode)) + return ret; + + goto force_commit; + } - return generic_file_aio_write(iocb, buf, count, pos); + /* + * So we know that there has been no forced data flush. If the inode + * is marked IS_SYNC, we need to force one ourselves. + */ + if (!IS_SYNC(inode)) + return ret; + + /* + * Open question #2 --- should we force data to disk here too? If we + * don't, the only impact is that data=writeback filesystems won't + * flush data to disk automatically on IS_SYNC, only metadata (but + * historically, that is what ext2 has done.) + */ + +force_commit: + err = ext3_force_commit(inode->i_sb); + if (err) + return err; + return ret; } struct file_operations ext3_file_operations = { diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c index 0ab7a4ee0c62..d20beb60bb45 100644 --- a/fs/ext3/xattr.c +++ b/fs/ext3/xattr.c @@ -195,7 +195,7 @@ ext3_xattr_handler(int name_index) */ ssize_t ext3_getxattr(struct dentry *dentry, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { struct ext3_xattr_handler *handler; struct inode *inode = dentry->d_inode; @@ -203,7 +203,7 @@ ext3_getxattr(struct dentry *dentry, const char *name, handler = ext3_xattr_resolve_name(&name); if (!handler) return -EOPNOTSUPP; - return handler->get(inode, name, buffer, size, flags); + return handler->get(inode, name, buffer, size); } /* @@ -212,9 +212,9 @@ ext3_getxattr(struct dentry *dentry, const char *name, * dentry->d_inode->i_sem down */ ssize_t -ext3_listxattr(struct dentry *dentry, char *buffer, size_t size, int flags) +ext3_listxattr(struct dentry *dentry, char *buffer, size_t size) { - return ext3_xattr_list(dentry->d_inode, buffer, size, flags); + return ext3_xattr_list(dentry->d_inode, buffer, size); } /* @@ -243,7 +243,7 @@ ext3_setxattr(struct dentry *dentry, const char *name, * dentry->d_inode->i_sem down */ int -ext3_removexattr(struct dentry *dentry, const char *name, int flags) +ext3_removexattr(struct dentry *dentry, const char *name) { struct ext3_xattr_handler *handler; struct inode *inode = dentry->d_inode; @@ -251,7 +251,7 @@ ext3_removexattr(struct dentry *dentry, const char *name, int flags) handler = ext3_xattr_resolve_name(&name); if (!handler) return -EOPNOTSUPP; - return handler->set(inode, name, NULL, 0, flags | XATTR_REPLACE); + return handler->set(inode, name, NULL, 0, XATTR_REPLACE); } /* @@ -364,8 +364,7 @@ cleanup: * used / required on success. */ int -ext3_xattr_list(struct inode *inode, char *buffer, size_t buffer_size, - int flags) +ext3_xattr_list(struct inode *inode, char *buffer, size_t buffer_size) { struct buffer_head *bh = NULL; struct ext3_xattr_entry *entry; @@ -405,7 +404,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_list", handler = ext3_xattr_handler(entry->e_name_index); if (handler) size += handler->list(NULL, inode, entry->e_name, - entry->e_name_len, flags); + entry->e_name_len); } if (ext3_xattr_cache_insert(bh)) @@ -428,7 +427,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_list", handler = ext3_xattr_handler(entry->e_name_index); if (handler) buf += handler->list(buf, inode, entry->e_name, - entry->e_name_len, flags); + entry->e_name_len); } error = size; diff --git a/fs/ext3/xattr.h b/fs/ext3/xattr.h index f0a50a5cacf3..ff3e10d8d701 100644 --- a/fs/ext3/xattr.h +++ b/fs/ext3/xattr.h @@ -57,9 +57,9 @@ struct ext3_xattr_entry { struct ext3_xattr_handler { char *prefix; size_t (*list)(char *list, struct inode *inode, const char *name, - int name_len, int flags); + int name_len); int (*get)(struct inode *inode, const char *name, void *buffer, - size_t size, int flags); + size_t size); int (*set)(struct inode *inode, const char *name, const void *buffer, size_t size, int flags); }; @@ -68,12 +68,12 @@ extern int ext3_xattr_register(int, struct ext3_xattr_handler *); extern void ext3_xattr_unregister(int, struct ext3_xattr_handler *); extern int ext3_setxattr(struct dentry *, const char *, const void *, size_t, int); -extern ssize_t ext3_getxattr(struct dentry *, const char *, void *, size_t, int); -extern ssize_t ext3_listxattr(struct dentry *, char *, size_t, int); -extern int ext3_removexattr(struct dentry *, const char *, int); +extern ssize_t ext3_getxattr(struct dentry *, const char *, void *, size_t); +extern ssize_t ext3_listxattr(struct dentry *, char *, size_t); +extern int ext3_removexattr(struct dentry *, const char *); extern int ext3_xattr_get(struct inode *, int, const char *, void *, size_t); -extern int ext3_xattr_list(struct inode *, char *, size_t, int flags); +extern int ext3_xattr_list(struct inode *, char *, size_t); extern int ext3_xattr_set(struct inode *, int, const char *, const void *, size_t, int); extern int ext3_xattr_set_handle(handle_t *, struct inode *, int, const char *, const void *, size_t, int); @@ -97,7 +97,7 @@ ext3_xattr_get(struct inode *inode, int name_index, const char *name, } static inline int -ext3_xattr_list(struct inode *inode, void *buffer, size_t size, int flags) +ext3_xattr_list(struct inode *inode, void *buffer, size_t size) { return -EOPNOTSUPP; } diff --git a/fs/ext3/xattr_trusted.c b/fs/ext3/xattr_trusted.c index fe8c7768dc8e..45b1549c4491 100644 --- a/fs/ext3/xattr_trusted.c +++ b/fs/ext3/xattr_trusted.c @@ -17,11 +17,11 @@ static size_t ext3_xattr_trusted_list(char *list, struct inode *inode, - const char *name, int name_len, int flags) + const char *name, int name_len) { const int prefix_len = sizeof(XATTR_TRUSTED_PREFIX)-1; - if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN))) + if (!capable(CAP_SYS_ADMIN)) return 0; if (list) { @@ -34,11 +34,11 @@ ext3_xattr_trusted_list(char *list, struct inode *inode, static int ext3_xattr_trusted_get(struct inode *inode, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { if (strcmp(name, "") == 0) return -EINVAL; - if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN))) + if (!capable(CAP_SYS_ADMIN)) return -EPERM; return ext3_xattr_get(inode, EXT3_XATTR_INDEX_TRUSTED, name, buffer, size); @@ -50,7 +50,7 @@ ext3_xattr_trusted_set(struct inode *inode, const char *name, { if (strcmp(name, "") == 0) return -EINVAL; - if (!((flags & XATTR_KERNEL_CONTEXT) || capable(CAP_SYS_ADMIN))) + if (!capable(CAP_SYS_ADMIN)) return -EPERM; return ext3_xattr_set(inode, EXT3_XATTR_INDEX_TRUSTED, name, value, size, flags); diff --git a/fs/ext3/xattr_user.c b/fs/ext3/xattr_user.c index 0ba3ac0be5dd..b93a74ded763 100644 --- a/fs/ext3/xattr_user.c +++ b/fs/ext3/xattr_user.c @@ -21,12 +21,11 @@ static size_t ext3_xattr_user_list(char *list, struct inode *inode, - const char *name, int name_len, int flags) + const char *name, int name_len) { const int prefix_len = sizeof(XATTR_USER_PREFIX)-1; - if (!(flags & XATTR_KERNEL_CONTEXT) && - !test_opt(inode->i_sb, XATTR_USER)) + if (!test_opt(inode->i_sb, XATTR_USER)) return 0; if (list) { @@ -39,49 +38,46 @@ ext3_xattr_user_list(char *list, struct inode *inode, static int ext3_xattr_user_get(struct inode *inode, const char *name, - void *buffer, size_t size, int flags) + void *buffer, size_t size) { + int error; + if (strcmp(name, "") == 0) return -EINVAL; - if (!(flags & XATTR_KERNEL_CONTEXT)) { - int error; - - if (!test_opt(inode->i_sb, XATTR_USER)) - return -EOPNOTSUPP; + if (!test_opt(inode->i_sb, XATTR_USER)) + return -EOPNOTSUPP; #ifdef CONFIG_EXT3_FS_POSIX_ACL - error = ext3_permission_locked(inode, MAY_READ); + error = ext3_permission_locked(inode, MAY_READ); #else - error = permission(inode, MAY_READ); + error = permission(inode, MAY_READ); #endif - if (error) - return error; - } - return ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name, - buffer, size); + if (error) + return error; + + return ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name, buffer, size); } static int ext3_xattr_user_set(struct inode *inode, const char *name, const void *value, size_t size, int flags) { + int error; + if (strcmp(name, "") == 0) return -EINVAL; + if (!test_opt(inode->i_sb, XATTR_USER)) + return -EOPNOTSUPP; if ( !S_ISREG(inode->i_mode) && (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) return -EPERM; - if (!(flags & XATTR_KERNEL_CONTEXT)) { - int error; - - if (!test_opt(inode->i_sb, XATTR_USER)) - return -EOPNOTSUPP; #ifdef CONFIG_EXT3_FS_POSIX_ACL - error = ext3_permission_locked(inode, MAY_WRITE); + error = ext3_permission_locked(inode, MAY_WRITE); #else - error = permission(inode, MAY_WRITE); + error = permission(inode, MAY_WRITE); #endif - if (error) - return error; - } + if (error) + return error; + return ext3_xattr_set(inode, EXT3_XATTR_INDEX_USER, name, value, size, flags); } diff --git a/fs/hpfs/dnode.c b/fs/hpfs/dnode.c index eaac1e98d62b..fbe4b03e3ab4 100644 --- a/fs/hpfs/dnode.c +++ b/fs/hpfs/dnode.c @@ -188,7 +188,7 @@ struct hpfs_dirent *hpfs_add_de(struct super_block *s, struct dnode *d, unsigned return de; } -/* Delete dirent and don't care about it's subtree */ +/* Delete dirent and don't care about its subtree */ void hpfs_delete_de(struct super_block *s, struct dnode *d, struct hpfs_dirent *de) { diff --git a/fs/inode.c b/fs/inode.c index 4179e6a45075..4c609aebb191 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -81,6 +81,16 @@ static LIST_HEAD(anon_hash_chain); /* for inodes with NULL i_sb */ spinlock_t inode_lock = SPIN_LOCK_UNLOCKED; /* + * iprune_sem provides exclusion between the kswapd or try_to_free_pages + * icache shrinking path, and the umount path. Without this exclusion, + * by the time prune_icache calls iput for the inode whose pages it has + * been invalidating, or by the time it calls clear_inode & destroy_inode + * from its final dispose_list, the struct super_block they refer to + * (for inode->i_sb->s_op) may already have been freed and reused. + */ +static DECLARE_MUTEX(iprune_sem); + +/* * Statistics gathering.. */ struct inodes_stat_t inodes_stat; @@ -320,6 +330,7 @@ int invalidate_inodes(struct super_block * sb) int busy; LIST_HEAD(throw_away); + down(&iprune_sem); spin_lock(&inode_lock); busy = invalidate_list(&inode_in_use, sb, &throw_away); busy |= invalidate_list(&inode_unused, sb, &throw_away); @@ -328,6 +339,7 @@ int invalidate_inodes(struct super_block * sb) spin_unlock(&inode_lock); dispose_list(&throw_away); + up(&iprune_sem); return busy; } @@ -395,6 +407,7 @@ static void prune_icache(int nr_to_scan) int nr_scanned; unsigned long reap = 0; + down(&iprune_sem); spin_lock(&inode_lock); for (nr_scanned = 0; nr_scanned < nr_to_scan; nr_scanned++) { struct inode *inode; @@ -429,7 +442,10 @@ static void prune_icache(int nr_to_scan) } inodes_stat.nr_unused -= nr_pruned; spin_unlock(&inode_lock); + dispose_list(&freeable); + up(&iprune_sem); + if (current_is_kswapd) mod_page_state(kswapd_inodesteal, reap); else diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c index 2b8500757fae..8aa1f8969832 100644 --- a/fs/jbd/revoke.c +++ b/fs/jbd/revoke.c @@ -577,7 +577,7 @@ int journal_set_revoke(journal_t *journal, record = find_revoke_record(journal, blocknr); if (record) { - /* If we have multiple occurences, only record the + /* If we have multiple occurrences, only record the * latest sequence number in the hashed record */ if (tid_gt(sequence, record->sequence)) record->sequence = sequence; diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c index 64edfea3d531..83dfe53fe91b 100644 --- a/fs/jffs2/compr_rtime.c +++ b/fs/jffs2/compr_rtime.c @@ -13,7 +13,7 @@ * Very simple lz77-ish encoder. * * Theory of operation: Both encoder and decoder have a list of "last - * occurances" for every possible source-value; after sending the + * occurrences" for every possible source-value; after sending the * first source-byte, the second byte indicated the "run" length of * matches * diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index 0d3a45444f15..52db99c54481 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -1112,7 +1112,7 @@ int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks) * current allocation in place if the number of additional blocks * can fit into a dmap, the last block of the current allocation * is not the last block of the file system, and the start of the - * inplace extension is not on an allocation group boundry. + * inplace extension is not on an allocation group boundary. */ if (addnblocks > BPERDMAP || extblkno >= bmp->db_mapsize || (extblkno & (bmp->db_agsize - 1)) == 0) { diff --git a/fs/jfs/jfs_xattr.h b/fs/jfs/jfs_xattr.h index 0e5ae78b0964..acc196e66c70 100644 --- a/fs/jfs/jfs_xattr.h +++ b/fs/jfs/jfs_xattr.h @@ -57,8 +57,8 @@ extern int __jfs_setxattr(struct inode *, const char *, const void *, size_t, extern int jfs_setxattr(struct dentry *, const char *, const void *, size_t, int); extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t); -extern ssize_t jfs_getxattr(struct dentry *, const char *, void *, size_t, int); -extern ssize_t jfs_listxattr(struct dentry *, char *, size_t, int); -extern int jfs_removexattr(struct dentry *, const char *, int); +extern ssize_t jfs_getxattr(struct dentry *, const char *, void *, size_t); +extern ssize_t jfs_listxattr(struct dentry *, char *, size_t); +extern int jfs_removexattr(struct dentry *, const char *); #endif /* H_JFS_XATTR */ diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 19d3e5b4e8a5..a9c455de618b 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -962,13 +962,12 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data, } ssize_t jfs_getxattr(struct dentry *dentry, const char *name, void *data, - size_t buf_size, int flags) + size_t buf_size) { return __jfs_getxattr(dentry->d_inode, name, data, buf_size); } -ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size, - int flags) +ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size) { struct inode *inode = dentry->d_inode; char *buffer; @@ -1014,7 +1013,7 @@ ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size, return size; } -int jfs_removexattr(struct dentry *dentry, const char *name, int flags) +int jfs_removexattr(struct dentry *dentry, const char *name) { return __jfs_setxattr(dentry->d_inode, name, 0, 0, XATTR_REPLACE); } diff --git a/fs/mpage.c b/fs/mpage.c index 3460144c1894..45f79b8da045 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -598,7 +598,7 @@ out: * If a page is already under I/O, generic_writepages() skips it, even * if it's dirty. This is desirable behaviour for memory-cleaning writeback, * but it is INCORRECT for data-integrity system calls such as fsync(). fsync() - * and msync() need to guarentee that all the data which was dirty at the time + * and msync() need to guarantee that all the data which was dirty at the time * the call was made get new I/O started against them. So if called_for_sync() * is true, we must wait for existing IO to complete. * diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 370b10e5fa01..03c01534a522 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -626,7 +626,7 @@ exp_export(struct nfsctl_export *nxp) exp = exp_get_by_name(clp, nd.mnt, nd.dentry, NULL); - /* must make sure there wont be an ex_fsid clash */ + /* must make sure there won't be an ex_fsid clash */ if ((nxp->ex_flags & NFSEXP_FSID) && (fsid_key = exp_get_fsid_key(clp, nxp->ex_dev)) && !IS_ERR(fsid_key) && diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 2271aed96c42..db77e132a71e 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1770,7 +1770,7 @@ nfsd4_encode_readlink(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_r * XXX: By default, the ->readlink() VFS op will truncate symlinks * if they would overflow the buffer. Is this kosher in NFSv4? If * not, one easy fix is: if ->readlink() precisely fills the buffer, - * assume that truncation occured, and return NFS4ERR_RESOURCE. + * assume that truncation occurred, and return NFS4ERR_RESOURCE. */ nfserr = nfsd_readlink(readlink->rl_rqstp, readlink->rl_fhp, page, &maxcount); if (nfserr) diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 7cc70b08b27d..7eed97e690a3 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -77,7 +77,7 @@ static ssize_t (*write_op[])(struct file *, char *, size_t) = { }; /* an argresp is stored in an allocated page and holds the - * size of the argument or response, along with it's content + * size of the argument or response, along with its content */ struct argresp { ssize_t size; diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 8e80a2be182a..f69f5c599eb3 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c @@ -942,7 +942,7 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc) * the below memcpy() already takes care of the mmap-at-end-of-file * requirements. If the file is converted to a non-resident one, then * the code path use is switched to the non-resident one where the - * zeroing happens on each ntfs_writepage() invokation. + * zeroing happens on each ntfs_writepage() invocation. * * The above also applies nicely when i_size is decreased. * @@ -1087,7 +1087,7 @@ static int ntfs_prepare_nonresident_write(struct page *page, if (block >= ablock) { // TODO: block is above allocated_size, need to - // allocate it. Best done in one go to accomodate not + // allocate it. Best done in one go to accommodate not // only block but all above blocks up to and including: // ((page->index << PAGE_CACHE_SHIFT) + to + blocksize // - 1) >> blobksize_bits. Obviously will need to round diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index 6e09b5eecb52..f2e945da1db9 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c @@ -830,7 +830,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol, goto io_error; for (deltaxcn = (s8)buf[b--]; b > b2; b--) deltaxcn = (deltaxcn << 8) + buf[b]; - /* Change the current lcn to it's new value. */ + /* Change the current lcn to its new value. */ lcn += deltaxcn; #ifdef DEBUG /* diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h index e055b6df65de..bccc0e9e00d4 100644 --- a/fs/ntfs/layout.h +++ b/fs/ntfs/layout.h @@ -152,7 +152,7 @@ typedef enum { * been written to disk. The values 0 and -1 (ie. 0xffff) are not used. All * last u16's of each sector have to be equal to the usn (during reading) or * are set to it (during writing). If they are not, an incomplete multi sector - * transfer has occured when the data was written. + * transfer has occurred when the data was written. * The maximum size for the update sequence array is fixed to: * maximum size = usa_ofs + (usa_count * 2) = 510 bytes * The 510 bytes comes from the fact that the last u16 in the array has to diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 6ca688ebb928..95f3cb04112f 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -202,7 +202,7 @@ err_out: * records/inodes present in the page before I/O can proceed. In that case we * wouldn't need to bother with PG_locked and PG_uptodate as nobody will be * accessing anything without owning the mrec_lock semaphore. But we do need - * to use them because of the read_cache_page() invokation and the code becomes + * to use them because of the read_cache_page() invocation and the code becomes * so much simpler this way that it is well worth it. * * The mft record is now ours and we return a pointer to it. You need to check diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index 262075ef25fb..ada7835cee6d 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c @@ -233,7 +233,7 @@ handle_name: m = NULL; ctx = NULL; - /* Check if a conversion error occured. */ + /* Check if a conversion error occurred. */ if ((signed)nls_name.len < 0) { err = (signed)nls_name.len; goto err_out; diff --git a/fs/proc/array.c b/fs/proc/array.c index 37fb278f96d7..186864bb7898 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -358,7 +358,8 @@ int proc_pid_stat(struct task_struct *task, char * buffer) nice, 0UL /* removed */, jiffies_to_clock_t(task->it_real_value), - (unsigned long long) jiffies_64_to_clock_t(task->start_time), + (unsigned long long) + jiffies_64_to_clock_t(task->start_time - INITIAL_JIFFIES), vsize, mm ? mm->rss : 0, /* you might want to shift this left 3 */ task->rlim[RLIMIT_RSS].rlim_cur, diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 92167d0ecb5f..ca32b7fab254 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -104,7 +104,7 @@ static int uptime_read_proc(char *page, char **start, off_t off, unsigned long uptime_remainder; int len; - uptime = get_jiffies_64(); + uptime = get_jiffies_64() - INITIAL_JIFFIES; uptime_remainder = (unsigned long) do_div(uptime, HZ); #if HZ!=100 @@ -320,7 +320,7 @@ static int kstat_read_proc(char *page, char **start, off_t off, { int i, len; extern unsigned long total_forks; - u64 jif = get_jiffies_64(); + u64 jif = get_jiffies_64() - INITIAL_JIFFIES; unsigned int sum = 0, user = 0, nice = 0, system = 0, idle = 0, iowait = 0; for (i = 0 ; i < NR_CPUS; i++) { diff --git a/fs/quota_v2.c b/fs/quota_v2.c index b67fde8fd9a2..4f26a84efea3 100644 --- a/fs/quota_v2.c +++ b/fs/quota_v2.c @@ -415,7 +415,7 @@ static int v2_write_dquot(struct dquot *dquot) if (!dquot->dq_off) if ((ret = dq_insert_tree(dquot)) < 0) { - printk(KERN_ERR "VFS: Error %Zd occured while creating quota.\n", ret); + printk(KERN_ERR "VFS: Error %Zd occurred while creating quota.\n", ret); return ret; } filp = sb_dqopt(dquot->dq_sb)->files[type]; diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c index aef5c01340ba..0e5c173f5634 100644 --- a/fs/reiserfs/do_balan.c +++ b/fs/reiserfs/do_balan.c @@ -1381,7 +1381,7 @@ static int check_before_balancing (struct tree_balance * tb) if ( cur_tb ) { reiserfs_panic (tb->tb_sb, "vs-12335: check_before_balancing: " "suspect that schedule occurred based on cur_tb not being null at this point in code. " - "do_balance cannot properly handle schedule occuring while it runs."); + "do_balance cannot properly handle schedule occurring while it runs."); } /* double check that buffers that we will modify are unlocked. (fix_nodes should already have diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 045247937245..d90636bfe358 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -1629,7 +1629,7 @@ struct buffer_head * reiserfs_breada (struct block_device *dev, int block, int b /* ** read and replay the log ** on a clean unmount, the journal header's next unflushed pointer will be to an invalid -** transaction. This tests that before finding all the transactions in the log, whic makes normal mount times fast. +** transaction. This tests that before finding all the transactions in the log, which makes normal mount times fast. ** ** After a crash, this starts with the next unflushed transaction, and replays until it finds one too old, or invalid. ** @@ -1913,7 +1913,7 @@ static int journal_init_dev( struct super_block *super, result = -ENOMEM; if( result != 0 ) printk( "sh-458: journal_init_dev: cannot init journal device\n '%s': %i", - kdevname( to_kdev_t(jdev) ), result ); + bdevname(journal->j_dev_bd), result ); else if (jdev != super->s_dev) { set_blocksize(journal->j_dev_bd, super->s_blocksize); @@ -1931,7 +1931,7 @@ static int journal_init_dev( struct super_block *super, printk( "journal_init_dev: '%s' is not a block device", jdev_name ); result = -ENOTBLK; } else if( jdev_inode -> i_bdev == NULL ) { - printk( "journal_init_dev: bdev unintialized for '%s'", jdev_name ); + printk( "journal_init_dev: bdev uninitialized for '%s'", jdev_name ); result = -ENOMEM; } else { /* ok */ @@ -1946,7 +1946,7 @@ static int journal_init_dev( struct super_block *super, if( result != 0 ) { release_journal_dev( super, journal ); } - printk( "journal_init_dev: journal device: %s", kdevname(to_kdev_t(jdev)) ); + printk( "journal_init_dev: journal device: %s", bdevname(journal->j_dev_bd)); return result; } @@ -2523,7 +2523,7 @@ int show_reiserfs_locks(void) { ** haven't hit disk yet. called from bitmap.c ** ** if it starts flushing things, it ors SCHEDULE_OCCURRED into repeat. -** note, this is just if schedule has a chance of occuring. I need to +** note, this is just if schedule has a chance of occurring. I need to ** change flush_commit_lists to have a repeat parameter too. ** */ diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c index 12d163c85d2e..37c3b0f45196 100644 --- a/fs/reiserfs/lbalance.c +++ b/fs/reiserfs/lbalance.c @@ -1192,7 +1192,7 @@ void leaf_paste_entries ( } - /* change item key if neccessary (when we paste before 0-th entry */ + /* change item key if necessary (when we paste before 0-th entry */ if (!before) { set_le_ih_k_offset (ih, deh_offset(new_dehs)); diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 8d6dfeec1e06..da39bbabadca 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -1495,7 +1495,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th, /* Repeat this loop until we either cut the item without needing - to balance, or we fix_nodes without schedule occuring */ + to balance, or we fix_nodes without schedule occurring */ while ( 1 ) { /* Determine the balance mode, position of the first byte to be cut, and size to be cut. In case of the indirect item diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 198bdfec0d90..b461b4c324f3 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -1356,7 +1356,7 @@ static int reiserfs_statfs (struct super_block * s, struct statfs * buf) buf->f_bavail = buf->f_bfree; buf->f_blocks = sb_block_count(rs) - sb_bmap_nr(rs) - 1; buf->f_bsize = s->s_blocksize; - /* changed to accomodate gcc folks.*/ + /* changed to accommodate gcc folks.*/ buf->f_type = REISERFS_SUPER_MAGIC; return 0; } diff --git a/fs/seq_file.c b/fs/seq_file.c index ac5ab8beba9e..7d2b18a7bfe4 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -250,7 +250,7 @@ int seq_release(struct inode *inode, struct file *file) * @s: string * @esc: set of characters that need escaping * - * Puts string into buffer, replacing each occurence of character from + * Puts string into buffer, replacing each occurrence of character from * @esc with usual octal escape. Returns 0 in case of success, -1 - in * case of overflow. */ diff --git a/fs/udf/dir.c b/fs/udf/dir.c index 78d6bc0acfef..748d63e1a2a9 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -19,7 +19,7 @@ * * HISTORY * - * 10/05/98 dgb Split directory operations into it's own file + * 10/05/98 dgb Split directory operations into its own file * Implemented directory reads via do_udf_readdir * 10/06/98 Made directory operations work! * 11/17/98 Rewrote directory to support ICBTAG_FLAG_AD_LONG diff --git a/fs/xattr.c b/fs/xattr.c index 6b6c7094a037..9463c877bcb2 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -160,7 +160,7 @@ getxattr(struct dentry *d, char *name, void *value, size_t size) if (error) goto out; down(&d->d_inode->i_sem); - error = d->d_inode->i_op->getxattr(d, kname, kvalue, size, 0); + error = d->d_inode->i_op->getxattr(d, kname, kvalue, size); up(&d->d_inode->i_sem); } @@ -233,7 +233,7 @@ listxattr(struct dentry *d, char *list, size_t size) if (error) goto out; down(&d->d_inode->i_sem); - error = d->d_inode->i_op->listxattr(d, klist, size, 0); + error = d->d_inode->i_op->listxattr(d, klist, size); up(&d->d_inode->i_sem); } @@ -308,7 +308,7 @@ removexattr(struct dentry *d, char *name) if (error) goto out; down(&d->d_inode->i_sem); - error = d->d_inode->i_op->removexattr(d, kname, 0); + error = d->d_inode->i_op->removexattr(d, kname); up(&d->d_inode->i_sem); } out: diff --git a/fs/xfs/linux/xfs_globals.c b/fs/xfs/linux/xfs_globals.c index 7a8d9d753189..e645e61238ad 100644 --- a/fs/xfs/linux/xfs_globals.c +++ b/fs/xfs/linux/xfs_globals.c @@ -37,9 +37,18 @@ #include <xfs.h> +/* + * System memory size - used to scale certain data structures in XFS. + */ unsigned long xfs_physmem; /* + * Tunable XFS parameters. xfs_params is required even when CONFIG_SYSCTL=n, + * other XFS code uses these values. + */ +xfs_param_t xfs_params = { 0, 1, 0, 0, 0 }; + +/* * Used to serialize atomicIncWithWrap. */ spinlock_t Atomic_spin = SPIN_LOCK_UNLOCKED; diff --git a/fs/xfs/linux/xfs_iops.c b/fs/xfs/linux/xfs_iops.c index 82fc4ad60ec1..65ef55576483 100644 --- a/fs/xfs/linux/xfs_iops.c +++ b/fs/xfs/linux/xfs_iops.c @@ -523,7 +523,7 @@ linvfs_truncate( */ #define SYSTEM_NAME "system." /* VFS shared names/values */ -#define ROOT_NAME "xfsroot." /* XFS ondisk names/values */ +#define ROOT_NAME "trusted." /* root's own names/values */ #define USER_NAME "user." /* user's own names/values */ STATIC xattr_namespace_t xfs_namespace_array[] = { { .name= SYSTEM_NAME, .namelen= sizeof(SYSTEM_NAME)-1,.exists= NULL }, @@ -590,7 +590,7 @@ linvfs_setxattr( error = -EINVAL; if (flags & XATTR_CREATE) return error; - error = -ENOATTR; + error = -EOPNOTSUPP; p += xfs_namespaces[SYSTEM_NAMES].namelen; if (strcmp(p, POSIXACL_ACCESS) == 0) { error = xfs_acl_vset(vp, (void *) data, size, @@ -632,7 +632,7 @@ linvfs_setxattr( VOP_ATTR_SET(vp, p, (void *) data, size, xflags, NULL, error); return -error; } - return -ENOATTR; + return -EOPNOTSUPP; } STATIC ssize_t @@ -640,8 +640,7 @@ linvfs_getxattr( struct dentry *dentry, const char *name, void *data, - size_t size, - int flags) + size_t size) { ssize_t error; int xflags = 0; @@ -651,7 +650,7 @@ linvfs_getxattr( if (strncmp(name, xfs_namespaces[SYSTEM_NAMES].name, xfs_namespaces[SYSTEM_NAMES].namelen) == 0) { - error = -ENOATTR; + error = -EOPNOTSUPP; p += xfs_namespaces[SYSTEM_NAMES].namelen; if (strcmp(p, POSIXACL_ACCESS) == 0) { error = xfs_acl_vget(vp, data, size, _ACL_TYPE_ACCESS); @@ -690,7 +689,7 @@ linvfs_getxattr( error = -size; return -error; } - return -ENOATTR; + return -EOPNOTSUPP; } @@ -698,8 +697,7 @@ STATIC ssize_t linvfs_listxattr( struct dentry *dentry, char *data, - size_t size, - int flags) + size_t size) { ssize_t error; int result = 0; @@ -743,8 +741,7 @@ linvfs_listxattr( STATIC int linvfs_removexattr( struct dentry *dentry, - const char *name, - int flags) + const char *name) { int error; int xflags = 0; @@ -754,7 +751,7 @@ linvfs_removexattr( if (strncmp(name, xfs_namespaces[SYSTEM_NAMES].name, xfs_namespaces[SYSTEM_NAMES].namelen) == 0) { - error = -ENOATTR; + error = -EOPNOTSUPP; p += xfs_namespaces[SYSTEM_NAMES].namelen; if (strcmp(p, POSIXACL_ACCESS) == 0) error = xfs_acl_vremove(vp, _ACL_TYPE_ACCESS); @@ -782,7 +779,7 @@ linvfs_removexattr( VOP_ATTR_REMOVE(vp, p, xflags, NULL, error); return -error; } - return -ENOATTR; + return -EOPNOTSUPP; } diff --git a/fs/xfs/linux/xfs_sysctl.c b/fs/xfs/linux/xfs_sysctl.c index 37d2b99c418a..321e549626cd 100644 --- a/fs/xfs/linux/xfs_sysctl.c +++ b/fs/xfs/linux/xfs_sysctl.c @@ -34,17 +34,10 @@ #include <linux/sysctl.h> #include <linux/proc_fs.h> -/* - * Tunable XFS parameters - */ - -extern struct xfsstats xfsstats; STATIC ulong xfs_min[XFS_PARAM] = { 0, 0, 0, 0, 0 }; STATIC ulong xfs_max[XFS_PARAM] = { 1, 1, 1, 1, 127 }; -xfs_param_t xfs_params = { 0, 1, 0, 0, 0 }; - static struct ctl_table_header *xfs_table_header; diff --git a/fs/xfs/linux/xfs_sysctl.h b/fs/xfs/linux/xfs_sysctl.h index eeafff926067..476b41499f5f 100644 --- a/fs/xfs/linux/xfs_sysctl.h +++ b/fs/xfs/linux/xfs_sysctl.h @@ -64,8 +64,8 @@ extern xfs_param_t xfs_params; extern void xfs_sysctl_register(void); extern void xfs_sysctl_unregister(void); #else -static __inline void xfs_sysctl_register(void) { }; -static __inline void xfs_sysctl_unregister(void) { }; -#endif +# define xfs_sysctl_register() do { } while (0) +# define xfs_sysctl_unregister() do { } while (0) +#endif /* CONFIG_SYSCTL */ #endif /* __XFS_SYSCTL_H__ */ diff --git a/fs/xfs/pagebuf/page_buf.c b/fs/xfs/pagebuf/page_buf.c index 05e086ad25df..41cd10f73b84 100644 --- a/fs/xfs/pagebuf/page_buf.c +++ b/fs/xfs/pagebuf/page_buf.c @@ -57,6 +57,7 @@ #include <linux/sysctl.h> #include <linux/proc_fs.h> #include <linux/workqueue.h> +#include <linux/suspend.h> #include <support/debug.h> #include <support/kmem.h> @@ -155,37 +156,35 @@ struct pbstats pbstats; * Pagebuf hashing */ -/* This structure must be a power of 2 long for the hash to work */ +#define NBITS 8 +#define NHASH (1<<NBITS) + typedef struct { struct list_head pb_hash; int pb_count; spinlock_t pb_hash_lock; } pb_hash_t; -static pb_hash_t *pbhash; -static unsigned int pb_hash_mask; -static unsigned int pb_hash_shift; -static unsigned int pb_order; +STATIC pb_hash_t pbhash[NHASH]; #define pb_hash(pb) &pbhash[pb->pb_hash_index] -/* - * This hash is the same one as used on the Linux buffer cache, - * see fs/buffer.c - */ - -#define _hashfn(dev,block) \ - ((((dev)<<(pb_hash_shift - 6)) ^ ((dev)<<(pb_hash_shift - 9))) ^ \ - (((block)<<(pb_hash_shift - 6)) ^ ((block) >> 13) ^ \ - ((block) << (pb_hash_shift - 12)))) - -static inline int +STATIC int _bhash( dev_t dev, loff_t base) { + int bit, hval; + base >>= 9; - - return (_hashfn(dev, base) & pb_hash_mask); + /* + * dev_t is 16 bits, loff_t is always 64 bits + */ + base ^= dev; + for (bit = hval = 0; base != 0 && bit < sizeof(base) * 8; bit += NBITS) { + hval ^= (int)base & (NHASH-1); + base >>= NBITS; + } + return hval; } /* @@ -703,8 +702,7 @@ found: * are in memory. The buffer may have unallocated holes, if * some, but not all, of the blocks are in memory. Even where * pages are present in the buffer, not all of every page may be - * valid. The file system may use pagebuf_segment to visit the - * various segments of the buffer. + * valid. */ page_buf_t * pagebuf_find( /* find buffer for block */ @@ -721,11 +719,10 @@ pagebuf_find( /* find buffer for block */ * pagebuf_get * * pagebuf_get assembles a buffer covering the specified range. - * Some or all of the blocks in the range may be valid. The file - * system may use pagebuf_segment to visit the various segments - * of the buffer. Storage in memory for all portions of the - * buffer will be allocated, although backing storage may not be. - * If PBF_READ is set in flags, pagebuf_read + * Some or all of the blocks in the range may be valid. Storage + * in memory for all portions of the buffer will be allocated, + * although backing storage may not be. If PBF_READ is set in + * flags, pagebuf_iostart is called also. */ page_buf_t * pagebuf_get( /* allocate a buffer */ @@ -1200,8 +1197,10 @@ pagebuf_iostart( /* start I/O on a buffer */ return status; } - pb->pb_flags &= ~(PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_DELWRI|PBF_READ_AHEAD); - pb->pb_flags |= flags & (PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_SYNC|PBF_READ_AHEAD); + pb->pb_flags &= + ~(PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_DELWRI|PBF_READ_AHEAD); + pb->pb_flags |= flags & + (PBF_READ|PBF_WRITE|PBF_ASYNC|PBF_SYNC|PBF_READ_AHEAD); BUG_ON(pb->pb_bn == PAGE_BUF_DADDR_NULL); @@ -1298,7 +1297,6 @@ int pagebuf_iorequest( /* start real I/O */ page_buf_t *pb) /* buffer to convey to device */ { - int status = 0; int i, map_i, total_nr_pages, nr_pages; struct bio *bio; int offset = pb->pb_offset; @@ -1313,7 +1311,7 @@ pagebuf_iorequest( /* start real I/O */ if (pb->pb_flags & PBF_DELWRI) { pagebuf_delwri_queue(pb, 1); - return status; + return 0; } /* Set the count to 1 initially, this will stop an I/O @@ -1413,10 +1411,11 @@ next_chunk: io_submitted: if (atomic_dec_and_test(&pb->pb_io_remaining) == 1) { + pb->pb_locked = 0; pagebuf_iodone(pb, 0); } - return status < 0 ? status : 0; + return 0; } /* @@ -1459,7 +1458,7 @@ pagebuf_mapout_locked( caddr_t pagebuf_offset( page_buf_t *pb, - off_t offset) + size_t offset) { struct page *page; @@ -1586,6 +1585,10 @@ pagebuf_daemon( INIT_LIST_HEAD(&tmp); do { + /* swsusp */ + if (current->flags & PF_FREEZE) + refrigerator(PF_IOTHREAD); + if (pbd_active == 1) { del_timer(&pb_daemon_timer); pb_daemon_timer.expires = jiffies + @@ -1864,39 +1867,7 @@ pagebuf_shaker(void) int __init pagebuf_init(void) { - int order, mempages, i; - unsigned int nr_hash; - extern int xfs_physmem; - - mempages = xfs_physmem >>= 16; - mempages *= sizeof(pb_hash_t); - for (order = 0; (1 << order) < mempages; order++) - ; - - if (order > 3) order = 3; /* cap us at 2K buckets */ - - do { - unsigned long tmp; - - nr_hash = (PAGE_SIZE << order) / sizeof(pb_hash_t); - nr_hash = 1 << (ffs(nr_hash) - 1); - pb_hash_mask = (nr_hash - 1); - tmp = nr_hash; - pb_hash_shift = 0; - while((tmp >>= 1UL) != 0UL) - pb_hash_shift++; - - pbhash = (pb_hash_t *) - __get_free_pages(GFP_KERNEL, order); - pb_order = order; - } while (pbhash == NULL && --order > 0); - printk("pagebuf cache hash table entries: %d (order: %d, %ld bytes)\n", - nr_hash, order, (PAGE_SIZE << order)); - - for(i = 0; i < nr_hash; i++) { - spin_lock_init(&pbhash[i].pb_hash_lock); - INIT_LIST_HEAD(&pbhash[i].pb_hash); - } + int i; pagebuf_table_header = register_sysctl_table(pagebuf_root_table, 1); @@ -1914,6 +1885,11 @@ pagebuf_init(void) return -ENOMEM; } + for (i = 0; i < NHASH; i++) { + spin_lock_init(&pbhash[i].pb_hash_lock); + INIT_LIST_HEAD(&pbhash[i].pb_hash); + } + #ifdef PAGEBUF_TRACE pb_trace.buf = (pagebuf_trace_t *)kmalloc( PB_TRACE_BUFSIZE * sizeof(pagebuf_trace_t), GFP_KERNEL); @@ -1940,7 +1916,6 @@ pagebuf_terminate(void) kmem_cache_destroy(pagebuf_cache); kmem_shake_deregister(pagebuf_shaker); - free_pages((unsigned long)pbhash, pb_order); unregister_sysctl_table(pagebuf_table_header); #ifdef CONFIG_PROC_FS diff --git a/fs/xfs/pagebuf/page_buf.h b/fs/xfs/pagebuf/page_buf.h index 52bde568a638..cba1771eba37 100644 --- a/fs/xfs/pagebuf/page_buf.h +++ b/fs/xfs/pagebuf/page_buf.h @@ -215,8 +215,8 @@ typedef struct page_buf_s { unsigned short pb_error; /* error code on I/O */ unsigned short pb_page_count; /* size of page array */ unsigned short pb_offset; /* page offset in first page */ - unsigned short pb_hash_index; /* hash table index */ unsigned char pb_locked; /* page array is locked */ + unsigned char pb_hash_index; /* hash table index */ struct page **pb_pages; /* array of page pointers */ struct page *pb_page_array[PB_PAGES]; /* inline pages */ #ifdef PAGEBUF_LOCK_TRACKING @@ -329,7 +329,7 @@ extern int pagebuf_iorequest( /* start real I/O */ extern int pagebuf_iowait( /* wait for buffer I/O done */ page_buf_t *); /* buffer to wait on */ -extern caddr_t pagebuf_offset(page_buf_t *, off_t); +extern caddr_t pagebuf_offset(page_buf_t *, size_t); extern void pagebuf_iomove( /* move data in/out of pagebuf */ page_buf_t *, /* buffer to manipulate */ diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c index 524238f6f922..e8a60e5c7f19 100644 --- a/fs/xfs/support/debug.c +++ b/fs/xfs/support/debug.c @@ -85,8 +85,8 @@ void cmn_err(register int level, char *fmt, ...) { char *fp = fmt; + ulong flags; int len; - unsigned long flags; va_list ap; level &= XFS_ERR_MASK; @@ -110,8 +110,8 @@ cmn_err(register int level, char *fmt, ...) void icmn_err(register int level, char *fmt, va_list ap) { + ulong flags; int len; - int flags; level &= XFS_ERR_MASK; if(level > XFS_MAX_ERR_LEVEL) diff --git a/fs/xfs/xfs_attr.h b/fs/xfs/xfs_attr.h index 0184e7b72cab..de61abd0dcb0 100644 --- a/fs/xfs/xfs_attr.h +++ b/fs/xfs/xfs_attr.h @@ -69,7 +69,7 @@ /* * The maximum size (into the kernel or returned from the kernel) of an * attribute value or the buffer used for an attr_list() call. Larger - * sizes will result in an E2BIG return code. + * sizes will result in an ERANGE return code. */ #define ATTR_MAX_VALUELEN (64*1024) /* max length of a value */ diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 6dd7d0b23c4b..0867745661bf 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c @@ -1374,7 +1374,7 @@ xfs_attr_leaf_toosmall(xfs_da_state_t *state, int *action) count * sizeof(xfs_attr_leaf_entry_t) + INT_GET(leaf->hdr.usedbytes, ARCH_CONVERT); if (bytes > (state->blocksize >> 1)) { - *action = 0; /* blk over 50%, dont try to join */ + *action = 0; /* blk over 50%, don't try to join */ return(0); } diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 4c8755b42071..945c4d7570ad 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -153,7 +153,7 @@ typedef struct pb_target xfs_buftarg_t; #define XFS_BUF_PTR(bp) (xfs_caddr_t)((bp)->pb_addr) -extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, off_t offset) +extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, size_t offset) { if (bp->pb_flags & PBF_MAPPED) return XFS_BUF_PTR(bp) + offset; diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index b5acad2dcb36..e89b2cbbed44 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -924,7 +924,7 @@ xfs_buf_item_relse( /* - * Add the given log item with it's callback to the list of callbacks + * Add the given log item with its callback to the list of callbacks * to be called when the buffer's I/O completes. If it is not set * already, set the buffer's b_iodone() routine to be * xfs_buf_iodone_callbacks() and link the log item into the list of diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index b42ce0313a5b..b8fc94e8be2b 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c @@ -830,8 +830,8 @@ xfs_da_node_toosmall(xfs_da_state_t *state, int *action) node = (xfs_da_intnode_t *)info; count = INT_GET(node->hdr.count, ARCH_CONVERT); if (count > (state->node_ents >> 1)) { - *action = 0; /* blk over 50%, dont try to join */ - return(0); /* blk over 50%, dont try to join */ + *action = 0; /* blk over 50%, don't try to join */ + return(0); /* blk over 50%, don't try to join */ } /* diff --git a/fs/xfs/xfs_dir_leaf.c b/fs/xfs/xfs_dir_leaf.c index 8dfb1ab6ff2f..267565a82e89 100644 --- a/fs/xfs/xfs_dir_leaf.c +++ b/fs/xfs/xfs_dir_leaf.c @@ -1341,7 +1341,7 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action) count * ((uint)sizeof(xfs_dir_leaf_name_t)-1) + INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); if (bytes > (state->blocksize >> 1)) { - *action = 0; /* blk over 50%, dont try to join */ + *action = 0; /* blk over 50%, don't try to join */ return(0); } diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index b27349c69538..2a8c831e5716 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c @@ -840,7 +840,7 @@ xfs_qm_dqlookup( * Given the file system, inode OR id, and type (UDQUOT/GDQUOT), return a * a locked dquot, doing an allocation (if requested) as needed. * When both an inode and an id are given, the inode's id takes precedence. - * That is, if the id changes while we dont hold the ilock inside this + * That is, if the id changes while we don't hold the ilock inside this * function, the new dquot is returned, not necessarily the one requested * in the id argument. */ @@ -1449,7 +1449,7 @@ xfs_qm_dqpurge( xfs_dqtrace_entry(dqp, "DQPURGE ->DQFLUSH: DQDIRTY"); /* dqflush unlocks dqflock */ /* - * Given that dqpurge is a very rare occurence, it is OK + * Given that dqpurge is a very rare occurrence, it is OK * that we're holding the hashlist and mplist locks * across the disk write. But, ... XXXsup * diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 9c21a670f53d..eb54238024e8 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1001,7 +1001,7 @@ xfs_iread_extents( } /* - * Allocate an inode on disk and return a copy of it's in-core version. + * Allocate an inode on disk and return a copy of its in-core version. * The in-core inode is locked exclusively. Set mode, nlink, and rdev * appropriately within the inode. The uid and gid for the inode are * set according to the contents of the given cred structure. diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h index 02955f0c0b46..e6c1a8a78351 100644 --- a/fs/xfs/xfs_log.h +++ b/fs/xfs/xfs_log.h @@ -53,11 +53,11 @@ * endian issues in treating two 32 bit numbers as one 64 bit number */ static -#ifdef __GNUC__ -# if !((__GNUC__ == 2) && (__GNUC_MINOR__ == 95)) +#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95) +__attribute__((unused)) /* gcc 2.95 miscompiles this when inlined */ +#else __inline__ #endif -#endif xfs_lsn_t _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2, xfs_arch_t arch) { if (CYCLE_LSN(lsn1, arch) != CYCLE_LSN(lsn2, arch)) diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 6fa2f67a7416..d6ad9949b3aa 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1023,7 +1023,7 @@ xfs_mountfs( /* * If the xfs quota code isn't installed, * we have to reset the quotachk'd bit. - * If an error occured, qm_mount_quotas code + * If an error occurred, qm_mount_quotas code * has already disabled quotas. So, just finish * mounting, and get on with the boring life * without disk quotas. diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c index 478b2686fc7b..19c83f9d4700 100644 --- a/fs/xfs/xfs_trans_dquot.c +++ b/fs/xfs/xfs_trans_dquot.c @@ -755,7 +755,7 @@ xfs_trans_reserve_quota_bydquots( /* * Lock the dquot and change the reservation if we can. - * This doesnt change the actual usage, just the reservation. + * This doesn't change the actual usage, just the reservation. * The inode sent in is locked. * * Returns 0 on success, EDQUOT or other errors otherwise diff --git a/include/asm-alpha/mman.h b/include/asm-alpha/mman.h index ded73a94a99d..caa92997d4fe 100644 --- a/include/asm-alpha/mman.h +++ b/include/asm-alpha/mman.h @@ -39,7 +39,7 @@ #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_SPACEAVAIL 5 /* ensure resources are available */ -#define MADV_DONTNEED 6 /* dont need these pages */ +#define MADV_DONTNEED 6 /* don't need these pages */ /* compatibility flags */ #define MAP_ANON MAP_ANONYMOUS diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index 472a96bdd49b..3f88b46f8dfe 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h @@ -97,7 +97,7 @@ extern dma_addr_t pci_map_page(struct pci_dev *, struct page *, /* Unmap a single streaming mode DMA translation. The DMA_ADDR and SIZE must match what was provided for in a previous pci_map_single call. All other usages are undefined. After this call, reads by - the cpu to the buffer are guarenteed to see whatever the device + the cpu to the buffer are guaranteed to see whatever the device wrote there. */ extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int); diff --git a/include/asm-alpha/rwsem.h b/include/asm-alpha/rwsem.h index c3abe5d2d41b..8e058a67c9a4 100644 --- a/include/asm-alpha/rwsem.h +++ b/include/asm-alpha/rwsem.h @@ -7,7 +7,7 @@ */ #ifndef _LINUX_RWSEM_H -#error please dont include asm/rwsem.h directly, use linux/rwsem.h instead +#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" #endif #ifdef __KERNEL__ diff --git a/include/asm-arm/arch-sa1100/simpad.h b/include/asm-arm/arch-sa1100/simpad.h index 4f9e10343b30..1527250bd0eb 100644 --- a/include/asm-arm/arch-sa1100/simpad.h +++ b/include/asm-arm/arch-sa1100/simpad.h @@ -46,7 +46,7 @@ #define IRQ_GPIO_CF_IRQ IRQ_GPIO1 #define IRQ_GPIO_CF_CD IRQ_GPIO24 -// CS3 Latch is write only, a shadow is neccessary +// CS3 Latch is write only, a shadow is necessary #define CS3BUSTYPE unsigned volatile long #define CS3_BASE 0xf1000000 diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h index 569c247bc7dc..622bde7dbf60 100644 --- a/include/asm-arm/bitops.h +++ b/include/asm-arm/bitops.h @@ -9,7 +9,7 @@ * * Please note that the code in this file should never be included * from user space. Many of these are not implemented in assembler - * since they would be too costly. Also, they require priviledged + * since they would be too costly. Also, they require privileged * instructions (which are not available from user mode) to ensure * that they are atomic. */ diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h index 2abed4e4e500..88d7ac58b97c 100644 --- a/include/asm-arm/proc-fns.h +++ b/include/asm-arm/proc-fns.h @@ -125,7 +125,7 @@ #if 0 * The following is to fool mkdep into generating the correct - * dependencies. Without this, it cant figure out that this + * dependencies. Without this, it can't figure out that this * file does indeed depend on the cpu-*.h files. #include <asm/cpu-single.h> #include <asm/cpu-multi26.h> diff --git a/include/asm-cris/namei.h b/include/asm-cris/namei.h index f244273e332a..8a3be7a6d9f6 100644 --- a/include/asm-cris/namei.h +++ b/include/asm-cris/namei.h @@ -9,7 +9,7 @@ /* used to find file-system prefixes for doing emulations * see for example asm-sparc/namei.h - * we dont use it... + * we don't use it... */ #define __emul_prefix() NULL diff --git a/include/asm-cris/processor.h b/include/asm-cris/processor.h index 01deef34990e..61c75282ac43 100644 --- a/include/asm-cris/processor.h +++ b/include/asm-cris/processor.h @@ -65,7 +65,7 @@ struct thread_struct { /* * At user->kernel entry, the pt_regs struct is stacked on the top of the kernel-stack. * This macro allows us to find those regs for a task. - * Notice that subsequent pt_regs stackings, like recursive interrupts occuring while + * Notice that subsequent pt_regs stackings, like recursive interrupts occurring while * we're in the kernel, won't affect this - only the first user->kernel transition * registers are reached by this. */ diff --git a/include/asm-cris/uaccess.h b/include/asm-cris/uaccess.h index 3d5d1f5d1e41..41d66748c16b 100644 --- a/include/asm-cris/uaccess.h +++ b/include/asm-cris/uaccess.h @@ -126,7 +126,7 @@ extern unsigned long search_exception_table(unsigned long); * This gets kind of ugly. We want to return _two_ values in "get_user()" * and yet we don't want to do any pointers, because that is too much * of a performance impact. Thus we have a few rather ugly macros here, - * and hide all the uglyness from the user. + * and hide all the ugliness from the user. * * The "__xxx" versions of the user access functions are versions that * do not verify the address space, that must have been done previously diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h index 1572455d35f7..c07d7698b2df 100644 --- a/include/asm-i386/mach-bigsmp/mach_apic.h +++ b/include/asm-i386/mach-bigsmp/mach_apic.h @@ -10,7 +10,7 @@ ((phys_apic) & (~0xf)) ) #endif -#define no_balance_irq (1) +#define NO_BALANCE_IRQ (1) #define esr_disable (1) static inline int apic_id_registered(void) diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-i386/mach-default/do_timer.h index e41ce3fe29da..8ac79726f5d1 100644 --- a/include/asm-i386/mach-default/do_timer.h +++ b/include/asm-i386/mach-default/do_timer.h @@ -67,7 +67,7 @@ static inline int do_timer_overflow(int count) #ifdef BUGGY_NEPTUN_TIMER /* * for the Neptun bug we know that the 'latch' - * command doesnt latch the high and low value + * command doesn't latch the high and low value * of the counter atomically. Thus we have to * substract 256 from the counter * ... funny, isnt it? :) diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h index 0f2c11b413d5..bbdcfd41407d 100644 --- a/include/asm-i386/mach-default/mach_apic.h +++ b/include/asm-i386/mach-default/mach_apic.h @@ -9,7 +9,7 @@ #define TARGET_CPUS 0x01 #endif -#define no_balance_irq (0) +#define NO_BALANCE_IRQ (0) #define esr_disable (0) #define INT_DELIVERY_MODE dest_LowestPrio diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h index 84b36fe4ee7c..c835254d3fb1 100644 --- a/include/asm-i386/mach-numaq/mach_apic.h +++ b/include/asm-i386/mach-numaq/mach_apic.h @@ -5,7 +5,7 @@ #define TARGET_CPUS (0xf) -#define no_balance_irq (1) +#define NO_BALANCE_IRQ (1) #define esr_disable (1) #define INT_DELIVERY_MODE dest_LowestPrio diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h index ac24bc91723d..4003d5c070ed 100644 --- a/include/asm-i386/mach-summit/mach_apic.h +++ b/include/asm-i386/mach-summit/mach_apic.h @@ -4,7 +4,7 @@ extern int x86_summit; #define esr_disable (x86_summit ? 1 : 0) -#define no_balance_irq (0) +#define NO_BALANCE_IRQ (0) #define XAPIC_DEST_CPUS_MASK 0x0Fu #define XAPIC_DEST_CLUSTER_MASK 0xF0u diff --git a/include/asm-i386/mach-visws/cobalt.h b/include/asm-i386/mach-visws/cobalt.h index 12d623fee6ec..33c36225a042 100644 --- a/include/asm-i386/mach-visws/cobalt.h +++ b/include/asm-i386/mach-visws/cobalt.h @@ -60,7 +60,7 @@ #define CO_APIC_PCIA_BASE0 0 /* and 1 */ /* slot 0, line 0 */ #define CO_APIC_PCIA_BASE123 5 /* and 6 */ /* slot 0, line 1 */ -#define CO_APIC_PIIX4_USB 7 /* this one is wierd */ +#define CO_APIC_PIIX4_USB 7 /* this one is weird */ /* Lithium PCI Bridge B -- "the one with PIIX4" */ #define CO_APIC_PCIB_BASE0 8 /* and 9-12 *//* slot 0, line 0 */ diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index eae3564e686f..d69ef1c023c5 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h @@ -12,6 +12,8 @@ #ifdef CONFIG_X86_NUMAQ #include <asm/numaq.h> +#elif CONFIG_X86_SUMMIT +#include <asm/srat.h> #else #define pfn_to_nid(pfn) (0) #endif /* CONFIG_X86_NUMAQ */ diff --git a/include/asm-i386/numaq.h b/include/asm-i386/numaq.h index 1d9c8d48f06a..0009c2bf21de 100644 --- a/include/asm-i386/numaq.h +++ b/include/asm-i386/numaq.h @@ -168,6 +168,10 @@ struct sys_cfg_data { struct eachquadmem eq[MAX_NUMNODES]; /* indexed by quad id */ }; +static inline unsigned long get_zholes_size(int nid) +{ + return 0; +} #endif /* CONFIG_X86_NUMAQ */ #endif /* NUMAQ_H */ diff --git a/include/asm-i386/numnodes.h b/include/asm-i386/numnodes.h index 2b63299604ef..8d14f4ad7ef3 100644 --- a/include/asm-i386/numnodes.h +++ b/include/asm-i386/numnodes.h @@ -5,6 +5,8 @@ #ifdef CONFIG_X86_NUMAQ #include <asm/numaq.h> +#elif CONFIG_X86_SUMMIT +#include <asm/srat.h> #else #define MAX_NUMNODES 1 #endif /* CONFIG_X86_NUMAQ */ diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 3ed0d710ba82..6d9d647c8c24 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h @@ -24,7 +24,7 @@ #else /* - * On older X86 processors its not a win to use MMX here it seems. + * On older X86 processors it's not a win to use MMX here it seems. * Maybe the K6-III ? */ @@ -49,6 +49,7 @@ typedef struct { unsigned long long pgd; } pgd_t; typedef struct { unsigned long pte_low; } pte_t; typedef struct { unsigned long pmd; } pmd_t; typedef struct { unsigned long pgd; } pgd_t; +#define boot_pte_t pte_t /* or would you rather have a typedef */ #define pte_val(x) ((x).pte_low) #define HPAGE_SHIFT 22 #endif diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h index 9f8bdc13adac..c4dbf4cc6cb1 100644 --- a/include/asm-i386/pgtable-2level.h +++ b/include/asm-i386/pgtable-2level.h @@ -42,7 +42,7 @@ static inline int pgd_present(pgd_t pgd) { return 1; } #define set_pte(pteptr, pteval) (*(pteptr) = pteval) #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) /* - * (pmds are folded into pgds so this doesnt get actually called, + * (pmds are folded into pgds so this doesn't get actually called, * but the define is needed for a generic inline function.) */ #define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) diff --git a/include/asm-i386/rwsem.h b/include/asm-i386/rwsem.h index 99f682b5d82a..7625a675852f 100644 --- a/include/asm-i386/rwsem.h +++ b/include/asm-i386/rwsem.h @@ -33,7 +33,7 @@ #define _I386_RWSEM_H #ifndef _LINUX_RWSEM_H -#error please dont include asm/rwsem.h directly, use linux/rwsem.h instead +#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" #endif #ifdef __KERNEL__ diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h index b4415eef62ce..986da200e5c8 100644 --- a/include/asm-i386/semaphore.h +++ b/include/asm-i386/semaphore.h @@ -76,7 +76,7 @@ static inline void sema_init (struct semaphore *sem, int val) * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); * * i'd rather use the more flexible initialization above, but sadly - * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well. + * GCC 2.7.2.3 emits a bogus warning. EGCS doesn't. Oh well. */ atomic_set(&sem->count, val); sem->sleepers = 0; diff --git a/include/asm-i386/sigcontext.h b/include/asm-i386/sigcontext.h index b51145936aac..b16c6c12a860 100644 --- a/include/asm-i386/sigcontext.h +++ b/include/asm-i386/sigcontext.h @@ -11,7 +11,7 @@ * Pentium III FXSR, SSE support * Gareth Hughes <gareth@valinux.com>, May 2000 * - * The FPU state data structure has had to grow to accomodate the + * The FPU state data structure has had to grow to accommodate the * extended FPU state required by the Streaming SIMD Extensions. * There is no documented standard to accomplish this at the moment. */ diff --git a/include/asm-i386/srat.h b/include/asm-i386/srat.h new file mode 100644 index 000000000000..4d30e7201287 --- /dev/null +++ b/include/asm-i386/srat.h @@ -0,0 +1,46 @@ +/* + * Some of the code in this file has been gleaned from the 64 bit + * discontigmem support code base. + * + * Copyright (C) 2002, IBM Corp. + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or + * NON INFRINGEMENT. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Send feedback to Pat Gaughen <gone@us.ibm.com> + */ + +#ifndef _ASM_SRAT_H_ +#define _ASM_SRAT_H_ + +/* + * each element in pfnnode_map represents 256 MB (2^28) of pages. + * so, to represent 64GB we need 256 elements. + */ +#define MAX_ELEMENTS 256 +#define PFN_TO_ELEMENT(pfn) ((pfn)>>(28 - PAGE_SHIFT)) + +extern int pfnnode_map[]; +#define pfn_to_nid(pfn) ({ pfnnode_map[PFN_TO_ELEMENT(pfn)]; }) +#define pfn_to_pgdat(pfn) NODE_DATA(pfn_to_nid(pfn)) +#define PHYSADDR_TO_NID(pa) pfn_to_nid(pa >> PAGE_SHIFT) +#define MAX_NUMNODES 8 +extern void get_memcfg_from_srat(void); +extern unsigned long *get_zholes_size(int); +#define get_memcfg_numa() get_memcfg_from_srat() + +#endif /* _ASM_SRAT_H_ */ diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h index a3c50a5ecdfe..7394563bd138 100644 --- a/include/asm-i386/uaccess.h +++ b/include/asm-i386/uaccess.h @@ -101,7 +101,7 @@ extern int fixup_exception(struct pt_regs *regs); * This gets kind of ugly. We want to return _two_ values in "get_user()" * and yet we don't want to do any pointers, because that is too much * of a performance impact. Thus we have a few rather ugly macros here, - * and hide all the uglyness from the user. + * and hide all the ugliness from the user. * * The "__xxx" versions of the user access functions are versions that * do not verify the address space, that must have been done previously @@ -258,7 +258,7 @@ unsigned long __copy_to_user_ll(void *to, const void *from, unsigned long n); unsigned long __copy_from_user_ll(void *to, const void *from, unsigned long n); /* - * Here we special-case 1, 2 and 4-byte copy_*_user invokations. On a fault + * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault * we return the initial request size (1, 2 or 4), as copy_*_user should do. * If a store crosses a page boundary and gets a fault, the x86 will not write * anything, so this is accurate. diff --git a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h index 50ce45597d9f..4c68b860bdf3 100644 --- a/include/asm-ia64/mmzone.h +++ b/include/asm-ia64/mmzone.h @@ -44,7 +44,7 @@ * Note that IO addresses are NOT considered valid addresses. * * Note, many platforms can simply check if kaddr exceeds a specific size. - * (However, this wont work on SGI platforms since IO space is embedded + * (However, this won't work on SGI platforms since IO space is embedded * within the range of valid memory addresses & nodes have holes in the * address range between banks). */ diff --git a/include/asm-ia64/sn/klconfig.h b/include/asm-ia64/sn/klconfig.h index 697ff4cd8a43..2bfc1708ac14 100644 --- a/include/asm-ia64/sn/klconfig.h +++ b/include/asm-ia64/sn/klconfig.h @@ -273,7 +273,7 @@ typedef struct kl_config_hdr { * Each BOARD consists of COMPONENTs and the BOARD structure has * pointers (offsets) to its COMPONENT structure. * The COMPONENT structure has version info, size and speed info, revision, - * error info and the NIC info. This structure can accomodate any + * error info and the NIC info. This structure can accommodate any * BOARD with arbitrary COMPONENT composition. * * The ERRORINFO part of each BOARD has error information diff --git a/include/asm-ia64/sn/pci/bridge.h b/include/asm-ia64/sn/pci/bridge.h index 13b7416dc1b4..ebbc59ad0d1b 100644 --- a/include/asm-ia64/sn/pci/bridge.h +++ b/include/asm-ia64/sn/pci/bridge.h @@ -14,7 +14,7 @@ * bridge.h - header file for bridge chip and bridge portion of xbridge chip * * Also including offsets for unique PIC registers. - * The PIC asic is a follow-on to Xbridge and most of it's registers are + * The PIC asic is a follow-on to Xbridge and most of its registers are * identical to those of Xbridge. PIC is different than Xbridge in that * it will accept 64 bit register access and that, in some cases, data * is kept in bits 63:32. PIC registers that are identical to Xbridge @@ -1684,7 +1684,7 @@ typedef volatile struct bridge_s { /* RRB clear register */ #define BRIDGE_RRB_CLEAR(r) (0x00000001<<(r)) -/* Defines for the virtual channels so we dont hardcode 0-3 within code */ +/* Defines for the virtual channels so we don't hardcode 0-3 within code */ #define VCHAN0 0 /* virtual channel 0 (ie. the "normal" channel) */ #define VCHAN1 1 /* virtual channel 1 */ #define VCHAN2 2 /* virtual channel 2 - PIC only */ diff --git a/include/asm-ia64/sn/pci/pcibr_private.h b/include/asm-ia64/sn/pci/pcibr_private.h index 183a7e9adfec..569aba5e2b35 100644 --- a/include/asm-ia64/sn/pci/pcibr_private.h +++ b/include/asm-ia64/sn/pci/pcibr_private.h @@ -578,7 +578,7 @@ struct pcibr_soft_s { #ifdef LATER toid_t bserr_toutid; /* Timeout started by errintr */ #endif /* LATER */ - iopaddr_t bserr_addr; /* Address where error occured */ + iopaddr_t bserr_addr; /* Address where error occurred */ uint64_t bserr_intstat; /* interrupts active at error dump */ } bs_errinfo; diff --git a/include/asm-ia64/sn/pda.h b/include/asm-ia64/sn/pda.h index 20c7772d7427..a6e5c3046137 100644 --- a/include/asm-ia64/sn/pda.h +++ b/include/asm-ia64/sn/pda.h @@ -84,10 +84,10 @@ typedef struct pda_s { * the IA64 cpu_data area. A full page is allocated for the cp_data area for each * cpu but only a small amout of the page is actually used. We put the SNIA PDA * in the same page as the cpu_data area. Note that there is a check in the setup - * code to verify that we dont overflow the page. + * code to verify that we don't overflow the page. * * Seems like we should should cache-line align the pda so that any changes in the - * size of the cpu_data area dont change cache layout. Should we align to 32, 64, 128 + * size of the cpu_data area don't change cache layout. Should we align to 32, 64, 128 * or 512 boundary. Each has merits. For now, pick 128 but should be revisited later. */ DECLARE_PER_CPU(struct pda_s, pda_percpu); diff --git a/include/asm-ia64/sn/sn1/mmzone_sn1.h b/include/asm-ia64/sn/sn1/mmzone_sn1.h index 5202f5544187..a9e1f9cdd1b9 100644 --- a/include/asm-ia64/sn/sn1/mmzone_sn1.h +++ b/include/asm-ia64/sn/sn1/mmzone_sn1.h @@ -130,7 +130,7 @@ typedef signed short cnodeid_t; /* * Calculate a "goal" value to be passed to __alloc_bootmem_node for allocating structures on - * nodes so that they dont alias to the same line in the cache as the previous allocated structure. + * nodes so that they don't alias to the same line in the cache as the previous allocated structure. * This macro takes an address of the end of previous allocation, rounds it to a page boundary & * changes the node number. */ diff --git a/include/asm-ia64/sn/sn2/mmzone_sn2.h b/include/asm-ia64/sn/sn2/mmzone_sn2.h index 9acc591629e3..e495529d7873 100644 --- a/include/asm-ia64/sn/sn2/mmzone_sn2.h +++ b/include/asm-ia64/sn/sn2/mmzone_sn2.h @@ -137,7 +137,7 @@ typedef signed short cnodeid_t; /* * Calculate a "goal" value to be passed to __alloc_bootmem_node for allocating structures on - * nodes so that they dont alias to the same line in the cache as the previous allocated structure. + * nodes so that they don't alias to the same line in the cache as the previous allocated structure. * This macro takes an address of the end of previous allocation, rounds it to a page boundary & * changes the node number. */ diff --git a/include/asm-ia64/sn/sn2/shub_mmr.h b/include/asm-ia64/sn/sn2/shub_mmr.h index 74ea3a961ad7..61aa480414d8 100644 --- a/include/asm-ia64/sn/sn2/shub_mmr.h +++ b/include/asm-ia64/sn/sn2/shub_mmr.h @@ -2720,7 +2720,7 @@ #define SH_NI0_LLP_ERR_RETRY_COUNT_MASK 0x0000000000ff0000 /* SH_NI0_LLP_ERR_RETRY_TIMEOUT */ -/* Description: Indicates a retry timeout has occured */ +/* Description: Indicates a retry timeout has occurred */ #define SH_NI0_LLP_ERR_RETRY_TIMEOUT_SHFT 24 #define SH_NI0_LLP_ERR_RETRY_TIMEOUT_MASK 0x0000000001000000 @@ -3017,7 +3017,7 @@ #define SH_NI1_LLP_ERR_RETRY_COUNT_MASK 0x0000000000ff0000 /* SH_NI1_LLP_ERR_RETRY_TIMEOUT */ -/* Description: Indicates a retry timeout has occured */ +/* Description: Indicates a retry timeout has occurred */ #define SH_NI1_LLP_ERR_RETRY_TIMEOUT_SHFT 24 #define SH_NI1_LLP_ERR_RETRY_TIMEOUT_MASK 0x0000000001000000 @@ -26034,7 +26034,7 @@ #define SH_PIO_WRITE_STATUS_0_INIT 0x8000000000000000 /* SH_PIO_WRITE_STATUS_0_MULTI_WRITE_ERROR */ -/* Description: More than one PIO write error occured */ +/* Description: More than one PIO write error occurred */ #define SH_PIO_WRITE_STATUS_0_MULTI_WRITE_ERROR_SHFT 0 #define SH_PIO_WRITE_STATUS_0_MULTI_WRITE_ERROR_MASK 0x0000000000000001 @@ -26073,7 +26073,7 @@ #define SH_PIO_WRITE_STATUS_1_INIT 0x8000000000000000 /* SH_PIO_WRITE_STATUS_1_MULTI_WRITE_ERROR */ -/* Description: More than one PIO write error occured */ +/* Description: More than one PIO write error occurred */ #define SH_PIO_WRITE_STATUS_1_MULTI_WRITE_ERROR_SHFT 0 #define SH_PIO_WRITE_STATUS_1_MULTI_WRITE_ERROR_MASK 0x0000000000000001 diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h index 6b6106def193..3a56e4aeff32 100644 --- a/include/asm-ia64/sn/sn_cpuid.h +++ b/include/asm-ia64/sn/sn_cpuid.h @@ -47,7 +47,7 @@ * hard_smp_processor_id()- cpu_physical_id of current processor * cpu_physical_id(cpuid) - convert a <cpuid> to a <physical_cpuid> * cpu_logical_id(phy_id) - convert a <physical_cpuid> to a <cpuid> - * * not real efficient - dont use in perf critical code + * * not real efficient - don't use in perf critical code * * LID - processor defined register (see PRM V2). * diff --git a/include/asm-m68k/dvma.h b/include/asm-m68k/dvma.h index 7a1653507f82..7e538dd748c0 100644 --- a/include/asm-m68k/dvma.h +++ b/include/asm-m68k/dvma.h @@ -45,7 +45,7 @@ extern void dvma_free(void *vaddr); #define IOMMU_ENTRIES 120 /* empirical kludge -- dvma regions only seem to work right on 0x10000 - byte boundries */ + byte boundaries */ #define DVMA_REGION_SIZE 0x10000 #define DVMA_ALIGN(addr) (((addr)+DVMA_REGION_SIZE-1) & \ ~(DVMA_REGION_SIZE-1)) diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index 6acb7ffdde15..cf88ccb5a47a 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h @@ -250,7 +250,7 @@ static inline void isa_delay(void) #define readl(addr) in_le32(addr) #define writel(val,addr) out_le32((addr),(val)) -/* those can be defined for both ISA and PCI - it wont work though */ +/* those can be defined for both ISA and PCI - it won't work though */ #define readb(addr) in_8(addr) #define readw(addr) in_le16(addr) #define writeb(val,addr) out_8((addr),(val)) diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index 6c09c4f01e07..f6c1eaf22a2c 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h @@ -164,7 +164,7 @@ static inline void *__va(unsigned long x) * NOTE: virtual isn't really correct, actually it should be the offset into the * memory node, but we have no highmem, so that works for now. * TODO: implement (fast) pfn<->pgdat_idx conversion functions, this makes lots - * of the shifts unneccessary. + * of the shifts unnecessary. */ #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) diff --git a/include/asm-m68k/posix_types.h b/include/asm-m68k/posix_types.h index fa372b22616c..4c25b4248450 100644 --- a/include/asm-m68k/posix_types.h +++ b/include/asm-m68k/posix_types.h @@ -22,6 +22,8 @@ typedef int __kernel_ptrdiff_t; typedef long __kernel_time_t; typedef long __kernel_suseconds_t; typedef long __kernel_clock_t; +typedef int __kernel_timer_t; +typedef int __kernel_clockid_t; typedef int __kernel_daddr_t; typedef char * __kernel_caddr_t; typedef unsigned short __kernel_uid16_t; diff --git a/include/asm-m68k/swim_iop.h b/include/asm-m68k/swim_iop.h index 12df2635f1ac..f29b67876b01 100644 --- a/include/asm-m68k/swim_iop.h +++ b/include/asm-m68k/swim_iop.h @@ -60,7 +60,7 @@ #define gcrOnMFMErr -400 /* GCR (400/800K) on HD media */ #define verErr -84 /* verify failed */ -#define fmt2Err -83 /* cant get enough sync during format */ +#define fmt2Err -83 /* can't get enough sync during format */ #define fmt1Err -82 /* can't find sector 0 after track format */ #define sectNFErr -81 /* can't find sector */ #define seekErr -80 /* drive error during seek */ diff --git a/include/asm-m68knommu/MC68328.h b/include/asm-m68knommu/MC68328.h index a302a341316b..4f5a9845f5be 100644 --- a/include/asm-m68knommu/MC68328.h +++ b/include/asm-m68knommu/MC68328.h @@ -1237,10 +1237,10 @@ typedef volatile struct { #define RTCISR WORD_REF(RTCISR_ADDR) #define RTCISR_SW 0x0001 /* Stopwatch timed out */ -#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occured */ -#define RTCISR_ALM 0x0004 /* Alarm interrupt has occured */ -#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occured */ -#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occured */ +#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occurred */ +#define RTCISR_ALM 0x0004 /* Alarm interrupt has occurred */ +#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occurred */ +#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occurred */ /* * RTC Interrupt Enable Register diff --git a/include/asm-m68knommu/MC68EZ328.h b/include/asm-m68knommu/MC68EZ328.h index 5ea3c4d858b7..801933da4c70 100644 --- a/include/asm-m68knommu/MC68EZ328.h +++ b/include/asm-m68knommu/MC68EZ328.h @@ -1071,19 +1071,19 @@ typedef volatile struct { #define RTCISR WORD_REF(RTCISR_ADDR) #define RTCISR_SW 0x0001 /* Stopwatch timed out */ -#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occured */ -#define RTCISR_ALM 0x0004 /* Alarm interrupt has occured */ -#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occured */ -#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occured */ -#define RTCISR_HR 0x0020 /* 1-hour interrupt has occured */ -#define RTCISR_SAM0 0x0100 /* 4Hz / 4.6875Hz interrupt has occured */ -#define RTCISR_SAM1 0x0200 /* 8Hz / 9.3750Hz interrupt has occured */ -#define RTCISR_SAM2 0x0400 /* 16Hz / 18.7500Hz interrupt has occured */ -#define RTCISR_SAM3 0x0800 /* 32Hz / 37.5000Hz interrupt has occured */ -#define RTCISR_SAM4 0x1000 /* 64Hz / 75.0000Hz interrupt has occured */ -#define RTCISR_SAM5 0x2000 /* 128Hz / 150.0000Hz interrupt has occured */ -#define RTCISR_SAM6 0x4000 /* 256Hz / 300.0000Hz interrupt has occured */ -#define RTCISR_SAM7 0x8000 /* 512Hz / 600.0000Hz interrupt has occured */ +#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occurred */ +#define RTCISR_ALM 0x0004 /* Alarm interrupt has occurred */ +#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occurred */ +#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occurred */ +#define RTCISR_HR 0x0020 /* 1-hour interrupt has occurred */ +#define RTCISR_SAM0 0x0100 /* 4Hz / 4.6875Hz interrupt has occurred */ +#define RTCISR_SAM1 0x0200 /* 8Hz / 9.3750Hz interrupt has occurred */ +#define RTCISR_SAM2 0x0400 /* 16Hz / 18.7500Hz interrupt has occurred */ +#define RTCISR_SAM3 0x0800 /* 32Hz / 37.5000Hz interrupt has occurred */ +#define RTCISR_SAM4 0x1000 /* 64Hz / 75.0000Hz interrupt has occurred */ +#define RTCISR_SAM5 0x2000 /* 128Hz / 150.0000Hz interrupt has occurred */ +#define RTCISR_SAM6 0x4000 /* 256Hz / 300.0000Hz interrupt has occurred */ +#define RTCISR_SAM7 0x8000 /* 512Hz / 600.0000Hz interrupt has occurred */ /* * RTC Interrupt Enable Register diff --git a/include/asm-m68knommu/MC68VZ328.h b/include/asm-m68knommu/MC68VZ328.h index 74ba3076b749..df74322f37ed 100644 --- a/include/asm-m68knommu/MC68VZ328.h +++ b/include/asm-m68knommu/MC68VZ328.h @@ -1167,19 +1167,19 @@ typedef struct { #define RTCISR WORD_REF(RTCISR_ADDR) #define RTCISR_SW 0x0001 /* Stopwatch timed out */ -#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occured */ -#define RTCISR_ALM 0x0004 /* Alarm interrupt has occured */ -#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occured */ -#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occured */ -#define RTCISR_HR 0x0020 /* 1-hour interrupt has occured */ -#define RTCISR_SAM0 0x0100 /* 4Hz / 4.6875Hz interrupt has occured */ -#define RTCISR_SAM1 0x0200 /* 8Hz / 9.3750Hz interrupt has occured */ -#define RTCISR_SAM2 0x0400 /* 16Hz / 18.7500Hz interrupt has occured */ -#define RTCISR_SAM3 0x0800 /* 32Hz / 37.5000Hz interrupt has occured */ -#define RTCISR_SAM4 0x1000 /* 64Hz / 75.0000Hz interrupt has occured */ -#define RTCISR_SAM5 0x2000 /* 128Hz / 150.0000Hz interrupt has occured */ -#define RTCISR_SAM6 0x4000 /* 256Hz / 300.0000Hz interrupt has occured */ -#define RTCISR_SAM7 0x8000 /* 512Hz / 600.0000Hz interrupt has occured */ +#define RTCISR_MIN 0x0002 /* 1-minute interrupt has occurred */ +#define RTCISR_ALM 0x0004 /* Alarm interrupt has occurred */ +#define RTCISR_DAY 0x0008 /* 24-hour rollover interrupt has occurred */ +#define RTCISR_1HZ 0x0010 /* 1Hz interrupt has occurred */ +#define RTCISR_HR 0x0020 /* 1-hour interrupt has occurred */ +#define RTCISR_SAM0 0x0100 /* 4Hz / 4.6875Hz interrupt has occurred */ +#define RTCISR_SAM1 0x0200 /* 8Hz / 9.3750Hz interrupt has occurred */ +#define RTCISR_SAM2 0x0400 /* 16Hz / 18.7500Hz interrupt has occurred */ +#define RTCISR_SAM3 0x0800 /* 32Hz / 37.5000Hz interrupt has occurred */ +#define RTCISR_SAM4 0x1000 /* 64Hz / 75.0000Hz interrupt has occurred */ +#define RTCISR_SAM5 0x2000 /* 128Hz / 150.0000Hz interrupt has occurred */ +#define RTCISR_SAM6 0x4000 /* 256Hz / 300.0000Hz interrupt has occurred */ +#define RTCISR_SAM7 0x8000 /* 512Hz / 600.0000Hz interrupt has occurred */ /* * RTC Interrupt Enable Register diff --git a/include/asm-m68knommu/mcftimer.h b/include/asm-m68knommu/mcftimer.h index 33bfb3fc25d3..0f47164c33a9 100644 --- a/include/asm-m68knommu/mcftimer.h +++ b/include/asm-m68knommu/mcftimer.h @@ -40,6 +40,18 @@ #define MCFTIMER_TCN 0x06 /* Timer Counter reg (r/w) */ #define MCFTIMER_TER 0x11 /* Timer Event reg (r/w) */ +struct mcftimer { + unsigned short tmr; /* Timer Mode reg (r/w) */ + unsigned short reserved1; + unsigned short trr; /* Timer Reference (r/w) */ + unsigned short reserved2; + unsigned short tcr; /* Timer Capture reg (r/w) */ + unsigned short reserved3; + unsigned short tcn; /* Timer Counter reg (r/w) */ + unsigned short reserved4; + unsigned char reserved5; + unsigned char ter; /* Timer Event reg (r/w) */ +} __attribute__((packed)); /* * Bit definitions for the Timer Mode Register (TMR). diff --git a/include/asm-m68knommu/siginfo.h b/include/asm-m68knommu/siginfo.h index f201705c9af0..b18e5f4064ae 100644 --- a/include/asm-m68knommu/siginfo.h +++ b/include/asm-m68knommu/siginfo.h @@ -1 +1,6 @@ -#include <asm-m68k/siginfo.h> +#ifndef _M68KNOMMU_SIGINFO_H +#define _M68KNOMMU_SIGINFO_H + +#include <asm-generic/siginfo.h> + +#endif diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h index 9e0e8e2085f4..976e6cb1db26 100644 --- a/include/asm-m68knommu/unistd.h +++ b/include/asm-m68knommu/unistd.h @@ -221,6 +221,8 @@ #define __NR_setfsuid32 215 #define __NR_setfsgid32 216 +#define NR_syscalls 256 + /* user-visible error numbers are in the range -1 - -122: see <asm-m68k/errno.h> */ diff --git a/include/asm-mips/ddb5xxx/ddb5xxx.h b/include/asm-mips/ddb5xxx/ddb5xxx.h index bdb8756470e6..c018fcfbc865 100644 --- a/include/asm-mips/ddb5xxx/ddb5xxx.h +++ b/include/asm-mips/ddb5xxx/ddb5xxx.h @@ -34,7 +34,7 @@ * that are true for all DDB 5xxx boards. The modification is based on * * uPD31577(VRC5477) VR5432-SDRAM/PCI Bridge (Luke) - * Preliminary Specification Decoment, Rev 1.1, 27 Dec, 2000 + * Preliminary Specification Document, Rev 1.1, 27 Dec, 2000 * */ diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index d3a28b7a6bd7..ea791fc15eb7 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h @@ -528,7 +528,7 @@ __BUILD_SET_CP0(config,CP0_CONFIG) #define CE1_SP_HINT_TO_SHARED_SC_BLOCKS 15 /* - * These flags define in which priviledge mode the counters count events + * These flags define in which privilege mode the counters count events */ #define CEB_USER 8 /* Count events in user mode, EXL = ERL = 0 */ #define CEB_SUPERVISOR 4 /* Count events in supvervisor mode EXL = ERL = 0 */ diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 1ae7c25df61f..84c9bd2b9bfb 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -102,7 +102,7 @@ extern inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, * must match what was provided for in a previous pci_map_single call. All * other usages are undefined. * - * After this call, reads by the cpu to the buffer are guarenteed to see + * After this call, reads by the cpu to the buffer are guaranteed to see * whatever the device wrote there. */ extern inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 3ca40f63456e..8a0fb426172f 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -291,7 +291,7 @@ extern inline void pte_clear(pte_t *ptep) } /* - * (pmds are folded into pgds so this doesnt get actually called, + * (pmds are folded into pgds so this doesn't get actually called, * but the define is needed for a generic inline function.) */ #define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 39c92d464d14..a2df351da263 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -228,7 +228,7 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t) * Do necessary setup to start up a newly executed thread. */ #define start_thread(regs, new_pc, new_sp) do { \ - /* New thread looses kernel privileges. */ \ + /* New thread loses kernel privileges. */ \ regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KU_USER;\ regs->cp0_epc = new_pc; \ regs->regs[29] = new_sp; \ diff --git a/include/asm-mips64/mipsregs.h b/include/asm-mips64/mipsregs.h index 7be03cffab46..ecbf30176e82 100644 --- a/include/asm-mips64/mipsregs.h +++ b/include/asm-mips64/mipsregs.h @@ -310,7 +310,7 @@ __BUILD_SET_CP0(config,CP0_CONFIG) #define CE1_SP_HINT_TO_SHARED_SC_BLOCKS 15 /* - * These flags define in which priviledge mode the counters count events + * These flags define in which privilege mode the counters count events */ #define CEB_USER 8 /* Count events in user mode, EXL = ERL = 0 */ #define CEB_SUPERVISOR 4 /* Count events in supvervisor mode EXL = ERL = 0 */ diff --git a/include/asm-mips64/pci.h b/include/asm-mips64/pci.h index d18ee0cd62ba..a7cc388c5824 100644 --- a/include/asm-mips64/pci.h +++ b/include/asm-mips64/pci.h @@ -126,7 +126,7 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, * must match what was provided for in a previous pci_map_single call. All * other usages are undefined. * - * After this call, reads by the cpu to the buffer are guarenteed to see + * After this call, reads by the cpu to the buffer are guaranteed to see * whatever the device wrote there. */ static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, diff --git a/include/asm-mips64/pgtable.h b/include/asm-mips64/pgtable.h index b32768e57d16..b47b11682135 100644 --- a/include/asm-mips64/pgtable.h +++ b/include/asm-mips64/pgtable.h @@ -318,7 +318,7 @@ extern inline void pte_clear(pte_t *ptep) } /* - * (pmds are folded into pgds so this doesnt get actually called, + * (pmds are folded into pgds so this doesn't get actually called, * but the define is needed for a generic inline function.) */ #define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) diff --git a/include/asm-mips64/processor.h b/include/asm-mips64/processor.h index d92f39dd714a..e9eabd0347c0 100644 --- a/include/asm-mips64/processor.h +++ b/include/asm-mips64/processor.h @@ -256,7 +256,7 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t) do { \ unsigned long __status; \ \ - /* New thread looses kernel privileges. */ \ + /* New thread loses kernel privileges. */ \ __status = regs->cp0_status & ~(ST0_CU0|ST0_FR|ST0_KSU); \ __status |= KSU_USER; \ __status |= (current->thread.mflags & MF_32BIT) ? 0 : ST0_FR; \ diff --git a/include/asm-mips64/sn/klconfig.h b/include/asm-mips64/sn/klconfig.h index f083950aebd7..2485f3d051b7 100644 --- a/include/asm-mips64/sn/klconfig.h +++ b/include/asm-mips64/sn/klconfig.h @@ -293,7 +293,7 @@ typedef struct kl_config_hdr { * Each BOARD consists of COMPONENTs and the BOARD structure has * pointers (offsets) to its COMPONENT structure. * The COMPONENT structure has version info, size and speed info, revision, - * error info and the NIC info. This structure can accomodate any + * error info and the NIC info. This structure can accommodate any * BOARD with arbitrary COMPONENT composition. * * The ERRORINFO part of each BOARD has error information diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h index 681a1fb4c928..226db77c5cb6 100644 --- a/include/asm-parisc/assembly.h +++ b/include/asm-parisc/assembly.h @@ -381,7 +381,7 @@ /* cr11 (sar) is a funny one. 5 bits on PA1.1 and 6 bit on PA2.0 * For PA2.0 mtsar or mtctl always write 6 bits, but mfctl only * reads 5 bits. Use mfctl,w to read all six bits. Otherwise - * we loose the 6th bit on a save/restore over interrupt. + * we lose the 6th bit on a save/restore over interrupt. */ mfctl,w %cr11, %r1 STREG %r1, PT_SAR (\regs) diff --git a/include/asm-parisc/eisa_eeprom.h b/include/asm-parisc/eisa_eeprom.h index 5b229737a6b4..5ba85370533e 100644 --- a/include/asm-parisc/eisa_eeprom.h +++ b/include/asm-parisc/eisa_eeprom.h @@ -25,7 +25,7 @@ struct eeprom_header u_int8_t ver_maj; u_int8_t ver_min; u_int8_t num_slots; /* number of EISA slots in system */ - u_int16_t csum; /* checksum, I dont know how to calulate this */ + u_int16_t csum; /* checksum, I don't know how to calulate this */ u_int8_t pad[10]; } __attribute__ ((packed)); diff --git a/include/asm-parisc/mman.h b/include/asm-parisc/mman.h index 0ae731597f20..b5c3bd6ced72 100644 --- a/include/asm-parisc/mman.h +++ b/include/asm-parisc/mman.h @@ -32,7 +32,7 @@ #define MADV_RANDOM 1 /* expect random page references */ #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ -#define MADV_DONTNEED 4 /* dont need these pages */ +#define MADV_DONTNEED 4 /* don't need these pages */ #define MADV_SPACEAVAIL 5 /* insure that resources are reserved */ #define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */ #define MADV_VPS_INHERIT 7 /* Inherit parents page size */ diff --git a/include/asm-parisc/pdc_chassis.h b/include/asm-parisc/pdc_chassis.h index 43e205d828da..df844ae34916 100644 --- a/include/asm-parisc/pdc_chassis.h +++ b/include/asm-parisc/pdc_chassis.h @@ -116,7 +116,7 @@ void __init parisc_pdc_chassis_init(void); PDC_CHASSIS_LED_ATTN_OFF | \ PDC_CHASSIS_LED_FAULT_ON | \ PDC_CHASSIS_LED_VALID ) -/* Unexpected reboot occured - Executing non-OS code */ +/* Unexpected reboot occurred - Executing non-OS code */ #define PDC_CHASSIS_LSTATE_NONOS_UNEXP (PDC_CHASSIS_LED_RUN_FLASH | \ PDC_CHASSIS_LED_ATTN_OFF | \ PDC_CHASSIS_LED_FAULT_FLASH | \ diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index ff0f8f9acf62..b8f25854778d 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h @@ -58,7 +58,7 @@ typedef unsigned long pgprot_t; #endif -/* align addr on a size boundry - adjust address up if needed -- Cort */ +/* align addr on a size boundary - adjust address up if needed -- Cort */ #define _ALIGN(addr,size) (((addr)+(size)-1)&(~((size)-1))) /* to align the pointer to the (next) page boundary */ diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h index 51bb269cf589..ffba2d3734ee 100644 --- a/include/asm-ppc/uaccess.h +++ b/include/asm-ppc/uaccess.h @@ -65,7 +65,7 @@ extern void sort_exception_table(void); * This gets kind of ugly. We want to return _two_ values in "get_user()" * and yet we don't want to do any pointers, because that is too much * of a performance impact. Thus we have a few rather ugly macros here, - * and hide all the uglyness from the user. + * and hide all the ugliness from the user. * * The "__xxx" versions of the user access functions are versions that * do not verify the address space, that must have been done previously diff --git a/include/asm-ppc/uninorth.h b/include/asm-ppc/uninorth.h index 111a1113938b..b8e30135ea41 100644 --- a/include/asm-ppc/uninorth.h +++ b/include/asm-ppc/uninorth.h @@ -111,7 +111,7 @@ #define UNI_N_ARB_CTRL_QACK_DELAY105 0x00 /* This one _might_ return the CPU number of the CPU reading it; - * the bootROM decides wether to boot or to sleep/spinloop depending + * the bootROM decides whether to boot or to sleep/spinloop depending * on this register beeing 0 or not */ #define UNI_N_CPU_NUMBER 0x0050 diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h index 865f2bbdeb35..ab3fc4b61cd2 100644 --- a/include/asm-ppc64/page.h +++ b/include/asm-ppc64/page.h @@ -114,11 +114,11 @@ static inline int get_order(unsigned long size) #endif /* __ASSEMBLY__ */ -/* align addr on a size boundry - adjust address up/down if needed */ +/* align addr on a size boundary - adjust address up/down if needed */ #define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) #define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) -/* align addr on a size boundry - adjust address up if needed */ +/* align addr on a size boundary - adjust address up if needed */ #define _ALIGN(addr,size) _ALIGN_UP(addr,size) /* to align the pointer to the (next) double word boundary */ diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h index 3b13d9cd1fd8..3f3c45af31a3 100644 --- a/include/asm-ppc64/pgtable.h +++ b/include/asm-ppc64/pgtable.h @@ -198,7 +198,7 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)]; * Find an entry in a page-table-directory. We combine the address region * (the high order N bits) and the pgd portion of the address. */ -/* to avoid overflow in free_pgtables we dont use PTRS_PER_PGD here */ +/* to avoid overflow in free_pgtables we don't use PTRS_PER_PGD here */ #define pgd_index(address) (((address) >> (PGDIR_SHIFT)) & 0x7ff) #define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) diff --git a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h index b9aa02095afa..625a0af94a1d 100644 --- a/include/asm-ppc64/uaccess.h +++ b/include/asm-ppc64/uaccess.h @@ -73,7 +73,7 @@ extern void sort_exception_table(void); * This gets kind of ugly. We want to return _two_ values in "get_user()" * and yet we don't want to do any pointers, because that is too much * of a performance impact. Thus we have a few rather ugly macros here, - * and hide all the uglyness from the user. + * and hide all the ugliness from the user. * * The "__xxx" versions of the user access functions are versions that * do not verify the address space, that must have been done previously diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h index 33e529f2a985..37a20bbced3f 100644 --- a/include/asm-s390/ccwdev.h +++ b/include/asm-s390/ccwdev.h @@ -120,7 +120,7 @@ struct ccw_driver { /* device is no longer available */ int (*set_online) (struct ccw_device *); int (*set_offline) (struct ccw_device *); - struct device_driver driver; /* higher level structure, dont init + struct device_driver driver; /* higher level structure, don't init this from your driver */ char *name; }; diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 14a0b0966a91..8b4d6679712e 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h @@ -154,7 +154,7 @@ static inline void __load_psw_mask (unsigned long mask) } /* - * Function to stop a processor until an interruption occured + * Function to stop a processor until an interruption occurred */ static inline void enabled_wait(void) { diff --git a/include/asm-s390/rwsem.h b/include/asm-s390/rwsem.h index 6cdb35473f59..dec5c522ff7e 100644 --- a/include/asm-s390/rwsem.h +++ b/include/asm-s390/rwsem.h @@ -38,7 +38,7 @@ */ #ifndef _LINUX_RWSEM_H -#error please dont include asm/rwsem.h directly, use linux/rwsem.h instead +#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" #endif #ifdef __KERNEL__ diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h index dc52bf8a7acb..fc16a65a356b 100644 --- a/include/asm-s390/types.h +++ b/include/asm-s390/types.h @@ -32,7 +32,7 @@ typedef __signed__ long long __s64; typedef unsigned long long __u64; #endif /* A address type so that arithmetic can be done on it & it can be upgraded to - 64 bit when neccessary + 64 bit when necessary */ typedef __u32 addr_t; typedef __s32 saddr_t; diff --git a/include/asm-s390x/ccwdev.h b/include/asm-s390x/ccwdev.h index 33e529f2a985..37a20bbced3f 100644 --- a/include/asm-s390x/ccwdev.h +++ b/include/asm-s390x/ccwdev.h @@ -120,7 +120,7 @@ struct ccw_driver { /* device is no longer available */ int (*set_online) (struct ccw_device *); int (*set_offline) (struct ccw_device *); - struct device_driver driver; /* higher level structure, dont init + struct device_driver driver; /* higher level structure, don't init this from your driver */ char *name; }; diff --git a/include/asm-s390x/processor.h b/include/asm-s390x/processor.h index 64a35797af7f..d90e535a0e74 100644 --- a/include/asm-s390x/processor.h +++ b/include/asm-s390x/processor.h @@ -168,7 +168,7 @@ static inline void __load_psw_mask (unsigned long mask) } /* - * Function to stop a processor until an interruption occured + * Function to stop a processor until an interruption occurred */ static inline void enabled_wait(void) { diff --git a/include/asm-s390x/rwsem.h b/include/asm-s390x/rwsem.h index c40062c2875c..9ffabfed0afe 100644 --- a/include/asm-s390x/rwsem.h +++ b/include/asm-s390x/rwsem.h @@ -38,7 +38,7 @@ */ #ifndef _LINUX_RWSEM_H -#error please dont include asm/rwsem.h directly, use linux/rwsem.h instead +#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" #endif #ifdef __KERNEL__ diff --git a/include/asm-s390x/types.h b/include/asm-s390x/types.h index 2ee9dcb2260b..1163af6aec8d 100644 --- a/include/asm-s390x/types.h +++ b/include/asm-s390x/types.h @@ -32,7 +32,7 @@ typedef unsigned long __u64; /* * A address type so that arithmetic can be done on it & it can be upgraded to - * 64 bit when neccessary + * 64 bit when necessary */ typedef unsigned long addr_t; diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h index d580d57aad0b..f9690c521d19 100644 --- a/include/asm-sh/pci.h +++ b/include/asm-sh/pci.h @@ -118,7 +118,7 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, * must match what was provided for in a previous pci_map_single call. All * other usages are undefined. * - * After this call, reads by the cpu to the buffer are guarenteed to see + * After this call, reads by the cpu to the buffer are guaranteed to see * whatever the device wrote there. */ static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, diff --git a/include/asm-sh/semaphore.h b/include/asm-sh/semaphore.h index 9d37ec9a483f..5ec7e3ae768f 100644 --- a/include/asm-sh/semaphore.h +++ b/include/asm-sh/semaphore.h @@ -54,7 +54,7 @@ static inline void sema_init (struct semaphore *sem, int val) * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); * * i'd rather use the more flexible initialization above, but sadly - * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well. + * GCC 2.7.2.3 emits a bogus warning. EGCS doesn't. Oh well. */ atomic_set(&sem->count, val); sem->sleepers = 0; diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h index 53d6d6e546a5..2c40d116e5c7 100644 --- a/include/asm-sparc/pci.h +++ b/include/asm-sparc/pci.h @@ -59,7 +59,7 @@ extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, * must match what was provided for in a previous pci_map_single call. All * other usages are undefined. * - * After this call, reads by the cpu to the buffer are guarenteed to see + * After this call, reads by the cpu to the buffer are guaranteed to see * whatever the device wrote there. */ extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction); diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h index cff85b7a9878..d4b7771eb0c6 100644 --- a/include/asm-sparc/uaccess.h +++ b/include/asm-sparc/uaccess.h @@ -89,7 +89,7 @@ extern void __ret_efault(void); * This gets kind of ugly. We want to return _two_ values in "get_user()" * and yet we don't want to do any pointers, because that is too much * of a performance impact. Thus we have a few rather ugly macros here, - * and hide all the uglyness from the user. + * and hide all the ugliness from the user. */ #define put_user(x,ptr) ({ \ unsigned long __pu_addr = (unsigned long)(ptr); \ diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index af595343fefc..f3dc10516fdf 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -59,7 +59,7 @@ struct pci_iommu { unsigned long iommu_ctxflush; /* IOMMU context flush register */ /* This is a register in the PCI controller, which if - * read will have no side-effects but will guarentee + * read will have no side-effects but will guarantee * completion of all previous writes into IOMMU/STC. */ unsigned long write_complete_reg; diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 79c738565f5d..53a010006c41 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h @@ -67,7 +67,7 @@ extern dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, * must match what was provided for in a previous pci_map_single call. All * other usages are undefined. * - * After this call, reads by the cpu to the buffer are guarenteed to see + * After this call, reads by the cpu to the buffer are guaranteed to see * whatever the device wrote there. */ extern void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction); diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h index fb100f981554..7d3e788980e1 100644 --- a/include/asm-sparc64/rwsem.h +++ b/include/asm-sparc64/rwsem.h @@ -8,7 +8,7 @@ #define _SPARC64_RWSEM_H #ifndef _LINUX_RWSEM_H -#error please dont include asm/rwsem.h directly, use linux/rwsem.h instead +#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" #endif #ifdef __KERNEL__ diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h index 3f04ac105de9..62e5e5416e25 100644 --- a/include/asm-sparc64/uaccess.h +++ b/include/asm-sparc64/uaccess.h @@ -96,7 +96,7 @@ extern void __ret_efault(void); * This gets kind of ugly. We want to return _two_ values in "get_user()" * and yet we don't want to do any pointers, because that is too much * of a performance impact. Thus we have a few rather ugly macros here, - * and hide all the uglyness from the user. + * and hide all the ugliness from the user. */ #define put_user(x,ptr) ({ \ unsigned long __pu_addr = (unsigned long)(ptr); \ diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index 2771f2305830..236dd25497bf 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h @@ -226,7 +226,7 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval) } /* - * (pmds are folded into pgds so this doesnt get actually called, + * (pmds are folded into pgds so this doesn't get actually called, * but the define is needed for a generic inline function.) */ #define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) diff --git a/include/asm-v850/sim.h b/include/asm-v850/sim.h index 41554b9cb650..ae041981a54b 100644 --- a/include/asm-v850/sim.h +++ b/include/asm-v850/sim.h @@ -22,7 +22,7 @@ #define PLATFORM_LONG "GDB V850E simulator" -/* We use a wierd value for RAM, not just 0, for testing purposes. +/* We use a weird value for RAM, not just 0, for testing purposes. These must match the values used in the linker script. */ #define RAM_ADDR 0x8F000000 #define RAM_SIZE 0x01000000 diff --git a/include/asm-x86_64/rwsem.h b/include/asm-x86_64/rwsem.h index ec30383d6b9c..fdada1f26b74 100644 --- a/include/asm-x86_64/rwsem.h +++ b/include/asm-x86_64/rwsem.h @@ -34,7 +34,7 @@ #define _X8664_RWSEM_H #ifndef _LINUX_RWSEM_H -#error please dont include asm/rwsem.h directly, use linux/rwsem.h instead +#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" #endif #ifdef __KERNEL__ diff --git a/include/asm-x86_64/semaphore.h b/include/asm-x86_64/semaphore.h index f3d4293d9d8d..6f42c7af790b 100644 --- a/include/asm-x86_64/semaphore.h +++ b/include/asm-x86_64/semaphore.h @@ -78,7 +78,7 @@ static inline void sema_init (struct semaphore *sem, int val) * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); * * i'd rather use the more flexible initialization above, but sadly - * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well. + * GCC 2.7.2.3 emits a bogus warning. EGCS doesn't. Oh well. */ atomic_set(&sem->count, val); sem->sleepers = 0; diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index 14fa21f8b302..ca14f103d480 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h @@ -79,7 +79,7 @@ struct exception_table_entry * This gets kind of ugly. We want to return _two_ values in "get_user()" * and yet we don't want to do any pointers, because that is too much * of a performance impact. Thus we have a few rather ugly macros here, - * and hide all the uglyness from the user. + * and hide all the ugliness from the user. * * The "__xxx" versions of the user access functions are versions that * do not verify the address space, that must have been done previously diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 0e701c0c2c34..26e04ac5ebca 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -79,7 +79,7 @@ typedef struct { struct acpi_table_rsdt { struct acpi_table_header header; - u32 entry[1]; + u32 entry[8]; } __attribute__ ((packed)); /* Extended System Description Table (XSDT) */ diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 4d6235fb96cf..85fa5a42642d 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h @@ -141,7 +141,7 @@ struct CYZ_BOOT_CTRL { /****************** ****************** *******************/ /* * The data types defined below are used in all ZFIRM interface - * data structures. They accomodate differences between HW + * data structures. They accommodate differences between HW * architectures and compilers. */ diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 339a770eedbd..bb9e6b8b15c2 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -262,6 +262,8 @@ extern char * d_path(struct dentry *, struct vfsmount *, char *, int); static __inline__ struct dentry * dget(struct dentry *dentry) { if (dentry) { + if (!atomic_read(&dentry->d_count)) + BUG(); atomic_inc(&dentry->d_count); dentry->d_vfs_flags |= DCACHE_REFERENCED; } diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index e672ac588767..9856a89ee414 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -22,7 +22,7 @@ struct ethtool_cmd { u8 duplex; /* Duplex, half or full */ u8 port; /* Which connector port */ u8 phy_address; - u8 transceiver; /* Which tranceiver to use */ + u8 transceiver; /* Which transceiver to use */ u8 autoneg; /* Enable or disable autonegotiation */ u32 maxtxpkt; /* Tx pkts before generating tx int */ u32 maxrxpkt; /* Rx pkts before generating rx int */ @@ -336,7 +336,7 @@ struct ethtool_stats { #define PORT_FIBRE 0x03 #define PORT_BNC 0x04 -/* Which tranceiver to use. */ +/* Which transceiver to use. */ #define XCVR_INTERNAL 0x00 #define XCVR_EXTERNAL 0x01 #define XCVR_DUMMY1 0x02 diff --git a/include/linux/fs.h b/include/linux/fs.h index 8a59101ca774..51d5ab2c19a5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -743,9 +743,9 @@ struct inode_operations { int (*setattr) (struct dentry *, struct iattr *); int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); - ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t,int); - ssize_t (*listxattr) (struct dentry *, char *, size_t, int); - int (*removexattr) (struct dentry *, const char *, int); + ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); + ssize_t (*listxattr) (struct dentry *, char *, size_t); + int (*removexattr) (struct dentry *, const char *); }; struct seq_file; diff --git a/include/linux/ghash.h b/include/linux/ghash.h deleted file mode 100644 index 278f6c2f630d..000000000000 --- a/include/linux/ghash.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * include/linux/ghash.h -- generic hashing with fuzzy retrieval - * - * (C) 1997 Thomas Schoebel-Theuer - * - * The algorithms implemented here seem to be a completely new invention, - * and I'll publish the fundamentals in a paper. - */ - -#ifndef _GHASH_H -#define _GHASH_H -/* HASHSIZE _must_ be a power of two!!! */ - - -#define DEF_HASH_FUZZY_STRUCTS(NAME,HASHSIZE,TYPE) \ -\ -struct NAME##_table {\ - TYPE * hashtable[HASHSIZE];\ - TYPE * sorted_list;\ - int nr_entries;\ -};\ -\ -struct NAME##_ptrs {\ - TYPE * next_hash;\ - TYPE * prev_hash;\ - TYPE * next_sorted;\ - TYPE * prev_sorted;\ -}; - -#define DEF_HASH_FUZZY(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\ -\ -LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ -{\ - int ix = HASHFN(elem->KEY);\ - TYPE ** base = &tbl->hashtable[ix];\ - TYPE * ptr = *base;\ - TYPE * prev = NULL;\ -\ - tbl->nr_entries++;\ - while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\ - base = &ptr->PTRS.next_hash;\ - prev = ptr;\ - ptr = *base;\ - }\ - elem->PTRS.next_hash = ptr;\ - elem->PTRS.prev_hash = prev;\ - if(ptr) {\ - ptr->PTRS.prev_hash = elem;\ - }\ - *base = elem;\ -\ - ptr = prev;\ - if(!ptr) {\ - ptr = tbl->sorted_list;\ - prev = NULL;\ - } else {\ - prev = ptr->PTRS.prev_sorted;\ - }\ - while(ptr) {\ - TYPE * next = ptr->PTRS.next_hash;\ - if(next && KEYCMP(next->KEY, elem->KEY)) {\ - prev = ptr;\ - ptr = next;\ - } else if(KEYCMP(ptr->KEY, elem->KEY)) {\ - prev = ptr;\ - ptr = ptr->PTRS.next_sorted;\ - } else\ - break;\ - }\ - elem->PTRS.next_sorted = ptr;\ - elem->PTRS.prev_sorted = prev;\ - if(ptr) {\ - ptr->PTRS.prev_sorted = elem;\ - }\ - if(prev) {\ - prev->PTRS.next_sorted = elem;\ - } else {\ - tbl->sorted_list = elem;\ - }\ -}\ -\ -LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ -{\ - TYPE * next = elem->PTRS.next_hash;\ - TYPE * prev = elem->PTRS.prev_hash;\ -\ - tbl->nr_entries--;\ - if(next)\ - next->PTRS.prev_hash = prev;\ - if(prev)\ - prev->PTRS.next_hash = next;\ - else {\ - int ix = HASHFN(elem->KEY);\ - tbl->hashtable[ix] = next;\ - }\ -\ - next = elem->PTRS.next_sorted;\ - prev = elem->PTRS.prev_sorted;\ - if(next)\ - next->PTRS.prev_sorted = prev;\ - if(prev)\ - prev->PTRS.next_sorted = next;\ - else\ - tbl->sorted_list = next;\ -}\ -\ -LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\ -{\ - int ix = hashfn(pos);\ - TYPE * ptr = tbl->hashtable[ix];\ - while(ptr && KEYCMP(ptr->KEY, pos))\ - ptr = ptr->PTRS.next_hash;\ - if(ptr && !KEYEQ(ptr->KEY, pos))\ - ptr = NULL;\ - return ptr;\ -}\ -\ -LINKAGE TYPE * find_##NAME##_hash_fuzzy(struct NAME##_table * tbl, KEYTYPE pos)\ -{\ - int ix;\ - int offset;\ - TYPE * ptr;\ - TYPE * next;\ -\ - ptr = tbl->sorted_list;\ - if(!ptr || KEYCMP(pos, ptr->KEY))\ - return NULL;\ - ix = HASHFN(pos);\ - offset = HASHSIZE;\ - do {\ - offset >>= 1;\ - next = tbl->hashtable[(ix+offset) & ((HASHSIZE)-1)];\ - if(next && (KEYCMP(next->KEY, pos) || KEYEQ(next->KEY, pos))\ - && KEYCMP(ptr->KEY, next->KEY))\ - ptr = next;\ - } while(offset);\ -\ - for(;;) {\ - next = ptr->PTRS.next_hash;\ - if(next) {\ - if(KEYCMP(next->KEY, pos)) {\ - ptr = next;\ - continue;\ - }\ - }\ - next = ptr->PTRS.next_sorted;\ - if(next && KEYCMP(next->KEY, pos)) {\ - ptr = next;\ - continue;\ - }\ - return ptr;\ - }\ - return NULL;\ -} - -#define DEF_HASH_STRUCTS(NAME,HASHSIZE,TYPE) \ -\ -struct NAME##_table {\ - TYPE * hashtable[HASHSIZE];\ - int nr_entries;\ -};\ -\ -struct NAME##_ptrs {\ - TYPE * next_hash;\ - TYPE * prev_hash;\ -}; - -#define DEF_HASH(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\ -\ -LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ -{\ - int ix = HASHFN(elem->KEY);\ - TYPE ** base = &tbl->hashtable[ix];\ - TYPE * ptr = *base;\ - TYPE * prev = NULL;\ -\ - tbl->nr_entries++;\ - while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\ - base = &ptr->PTRS.next_hash;\ - prev = ptr;\ - ptr = *base;\ - }\ - elem->PTRS.next_hash = ptr;\ - elem->PTRS.prev_hash = prev;\ - if(ptr) {\ - ptr->PTRS.prev_hash = elem;\ - }\ - *base = elem;\ -}\ -\ -LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ -{\ - TYPE * next = elem->PTRS.next_hash;\ - TYPE * prev = elem->PTRS.prev_hash;\ -\ - tbl->nr_entries--;\ - if(next)\ - next->PTRS.prev_hash = prev;\ - if(prev)\ - prev->PTRS.next_hash = next;\ - else {\ - int ix = HASHFN(elem->KEY);\ - tbl->hashtable[ix] = next;\ - }\ -}\ -\ -LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\ -{\ - int ix = hashfn(pos);\ - TYPE * ptr = tbl->hashtable[ix];\ - while(ptr && KEYCMP(ptr->KEY, pos))\ - ptr = ptr->PTRS.next_hash;\ - if(ptr && !KEYEQ(ptr->KEY, pos))\ - ptr = NULL;\ - return ptr;\ -} - -#endif diff --git a/include/linux/i2c-proc.h b/include/linux/i2c-proc.h index c1433e5f916b..618734230d46 100644 --- a/include/linux/i2c-proc.h +++ b/include/linux/i2c-proc.h @@ -69,8 +69,7 @@ extern int i2c_proc_real(ctl_table * ctl, int write, struct file *filp, these functions must be updated! */ extern int i2c_register_entry(struct i2c_client *client, const char *prefix, - ctl_table * ctl_template, - struct module *controlling_mod); + ctl_table * ctl_template); extern void i2c_deregister_entry(int id); diff --git a/include/linux/if.h b/include/linux/if.h index 734578911ba8..898cfdf1bb14 100644 --- a/include/linux/if.h +++ b/include/linux/if.h @@ -59,7 +59,7 @@ #define IF_IFACE_X21 0x1002 /* X.21 serial interface */ #define IF_IFACE_T1 0x1003 /* T1 telco serial interface */ #define IF_IFACE_E1 0x1004 /* E1 telco serial interface */ -#define IF_IFACE_SYNC_SERIAL 0x1005 /* cant'b be set by software */ +#define IF_IFACE_SYNC_SERIAL 0x1005 /* can't be set by software */ /* For definitions see hdlc.h */ #define IF_PROTO_HDLC 0x2000 /* raw HDLC protocol */ diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index e14d3f10872e..9479a550b924 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h @@ -166,7 +166,7 @@ struct ipmi_msg typedef struct ipmi_user *ipmi_user_t; /* - * Stuff coming from the recieve interface comes as one of these. + * Stuff coming from the receive interface comes as one of these. * They are allocated, the receiver must free them with * ipmi_free_recv_msg() when done with the message. The link is not * used after the message is delivered, so the upper layer may use the diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index bb1e0128228c..96dc2be6a496 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -28,7 +28,7 @@ static inline u64 get_jiffies_64(void) * These inlines deal with timer wrapping correctly. You are * strongly encouraged to use them * 1. Because people otherwise forget - * 2. Because if the timer wrap changes in future you wont have to + * 2. Because if the timer wrap changes in future you won't have to * alter your driver code. * * time_after(a,b) returns true if the time a is after time b. diff --git a/include/linux/mm.h b/include/linux/mm.h index c68771c27d88..5cef04a2623e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -232,11 +232,15 @@ static inline void get_page(struct page *page) static inline void put_page(struct page *page) { if (PageCompound(page)) { - page = (struct page *)page->lru.next; - if (page->lru.prev) { /* destructor? */ - (*(void (*)(struct page *))page->lru.prev)(page); - return; + if (put_page_testzero(page)) { + page = (struct page *)page->lru.next; + if (page->lru.prev) { /* destructor? */ + (*(void (*)(struct page *))page->lru.prev)(page); + } else { + __page_cache_release(page); + } } + return; } if (!PageReserved(page) && put_page_testzero(page)) __page_cache_release(page); diff --git a/include/linux/n_r3964.h b/include/linux/n_r3964.h index 0b063cd07af2..2352bcd31a06 100644 --- a/include/linux/n_r3964.h +++ b/include/linux/n_r3964.h @@ -165,7 +165,7 @@ struct r3964_block_header { unsigned int length; /* length in chars without header */ unsigned char *data; /* usually data is located - immediatly behind this struct */ + immediately behind this struct */ unsigned int locks; /* only used in rx_buffer */ struct r3964_block_header *next; diff --git a/include/linux/net.h b/include/linux/net.h index cecc941476a7..0576c4713cf3 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -210,23 +210,23 @@ SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_are (file, sock, vma)) \ \ static struct proto_ops name##_ops = { \ - family: fam, \ + .family = fam, \ \ - release: __lock_##name##_release, \ - bind: __lock_##name##_bind, \ - connect: __lock_##name##_connect, \ - socketpair: __lock_##name##_socketpair, \ - accept: __lock_##name##_accept, \ - getname: __lock_##name##_getname, \ - poll: __lock_##name##_poll, \ - ioctl: __lock_##name##_ioctl, \ - listen: __lock_##name##_listen, \ - shutdown: __lock_##name##_shutdown, \ - setsockopt: __lock_##name##_setsockopt, \ - getsockopt: __lock_##name##_getsockopt, \ - sendmsg: __lock_##name##_sendmsg, \ - recvmsg: __lock_##name##_recvmsg, \ - mmap: __lock_##name##_mmap, \ + .release = __lock_##name##_release, \ + .bind = __lock_##name##_bind, \ + .connect = __lock_##name##_connect, \ + .socketpair = __lock_##name##_socketpair, \ + .accept = __lock_##name##_accept, \ + .getname = __lock_##name##_getname, \ + .poll = __lock_##name##_poll, \ + .ioctl = __lock_##name##_ioctl, \ + .listen = __lock_##name##_listen, \ + .shutdown = __lock_##name##_shutdown, \ + .setsockopt = __lock_##name##_setsockopt, \ + .getsockopt = __lock_##name##_getsockopt, \ + .sendmsg = __lock_##name##_sendmsg, \ + .recvmsg = __lock_##name##_recvmsg, \ + .mmap = __lock_##name##_mmap, \ }; #endif diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index f4ac435bf141..b52a2af25f1f 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h @@ -9,7 +9,7 @@ #define _LINUX_RWSEM_SPINLOCK_H #ifndef _LINUX_RWSEM_H -#error please dont include linux/rwsem-spinlock.h directly, use linux/rwsem.h instead +#error "please don't include linux/rwsem-spinlock.h directly, use linux/rwsem.h instead" #endif #include <linux/spinlock.h> diff --git a/include/linux/sdla_x25.h b/include/linux/sdla_x25.h index c110c1a835f7..57db980e27ad 100644 --- a/include/linux/sdla_x25.h +++ b/include/linux/sdla_x25.h @@ -154,7 +154,7 @@ typedef struct X25Cmd #define X25RES_INVAL_CALL_ARG 0x3A /* errorneous call arguments */ #define X25RES_INVAL_CALL_DATA 0x3B /* errorneous call user data */ #define X25RES_ASYNC_PACKET 0x40 /* asynchronous packet received */ -#define X25RES_PROTO_VIOLATION 0x41 /* protocol violation occured */ +#define X25RES_PROTO_VIOLATION 0x41 /* protocol violation occurred */ #define X25RES_PKT_TIMEOUT 0x42 /* X.25 packet time out */ #define X25RES_PKT_RETRY_LIMIT 0x43 /* X.25 packet retry limit exceeded */ /*----- Command-dependent results -----*/ diff --git a/include/linux/serial.h b/include/linux/serial.h index b0469a236a13..aceee0c46cd8 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h @@ -91,6 +91,7 @@ struct serial_uart_config { #define UART_CLEAR_FIFO 0x01 #define UART_USE_FIFO 0x02 #define UART_STARTECH 0x04 +#define UART_NATSEMI 0x08 /* * Definitions for async_struct (and serial_struct) flags field diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index a3422e7a903a..3412f8b7f2ce 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -37,7 +37,8 @@ #define PORT_16654 11 #define PORT_16850 12 #define PORT_RSA 13 -#define PORT_MAX_8250 13 /* max port ID */ +#define PORT_NS16550A 14 +#define PORT_MAX_8250 14 /* max port ID */ /* * ARM specific type numbers. These are not currently guaranteed @@ -172,6 +173,7 @@ struct uart_port { #define UPF_LOW_LATENCY (1 << 13) #define UPF_BUGGY_UART (1 << 14) #define UPF_AUTOPROBE (1 << 15) +#define UPF_MAGIC_MULTIPLIER (1 << 16) #define UPF_BOOT_ONLYMCA (1 << 22) #define UPF_CONS_FLOW (1 << 23) #define UPF_SHARE_IRQ (1 << 24) @@ -179,7 +181,7 @@ struct uart_port { #define UPF_RESOURCES (1 << 30) #define UPF_IOREMAP (1 << 31) -#define UPF_CHANGE_MASK (0x7fff) +#define UPF_CHANGE_MASK (0x17fff) #define UPF_USR_MASK (UPF_SPD_MASK|UPF_LOW_LATENCY) unsigned int mctrl; /* current modem ctrl settings */ @@ -279,12 +281,11 @@ void uart_write_wakeup(struct uart_port *port); * Baud rate helpers. */ void uart_update_timeout(struct uart_port *port, unsigned int cflag, - unsigned int quot); + unsigned int baud); unsigned int uart_get_baud_rate(struct uart_port *port, struct termios *termios, struct termios *old, unsigned int min, unsigned int max); -unsigned int uart_get_divisor(struct uart_port *port, struct termios *termios, - struct termios *old_termios); +unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); /* * Console helpers. diff --git a/include/linux/telephony.h b/include/linux/telephony.h index 3843eeeca41b..0d0cf2a1e7bc 100644 --- a/include/linux/telephony.h +++ b/include/linux/telephony.h @@ -68,7 +68,7 @@ * device installed in your system. The PHONECTL_CAPABILITIES ioctl * returns an integer value indicating the number of capabilities the * device has. The PHONECTL_CAPABILITIES_LIST will fill an array of -* capability structs with all of it's capabilities. The +* capability structs with all of its capabilities. The * PHONECTL_CAPABILITIES_CHECK takes a single capability struct and returns * a TRUE if the device has that capability, otherwise it returns false. * diff --git a/include/linux/time.h b/include/linux/time.h index 542e00330d22..7f5be084e342 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -28,6 +28,12 @@ struct timezone { #include <linux/seqlock.h> /* + * Have the 32 bit jiffies value wrap 5 minutes after boot + * so jiffies wrap bugs show up earlier. + */ +#define INITIAL_JIFFIES ((unsigned int) (-300*HZ)) + +/* * Change timeval to jiffies, trying to avoid the * most obvious overflows.. * diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 77ef0c304849..9e967b58ee2e 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -9,8 +9,7 @@ #ifndef _LINUX_XATTR_H #define _LINUX_XATTR_H -#define XATTR_CREATE 0x1 /* fail if attr already exists */ -#define XATTR_REPLACE 0x2 /* fail if attr does not exist */ -#define XATTR_KERNEL_CONTEXT 0x4 /* called from kernel context */ +#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ +#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ #endif /* _LINUX_XATTR_H */ diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index 49e455fb58e7..ed539e79588d 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h @@ -45,7 +45,7 @@ struct dn_ifaddr { * device will come up. In the dn_dev structure, it is the actual * state. * - * Things have changed here. I've killed timer1 since its a user space + * Things have changed here. I've killed timer1 since it's a user space * issue for a user space routing deamon to sort out. The kernel does * not need to be bothered with it. * diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index f39ca239e722..5b8268d9651b 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h @@ -195,7 +195,7 @@ typedef struct { /* The SIR unwrapper async_unwrap_char() will use a Rx-copy-break mechanism * when using the optional ZeroCopy Rx, where only small frames are memcpy - * to a smaller skb to save memory. This is the thresold under which copy + * to a smaller skb to save memory. This is the threshold under which copy * will happen (and over which it won't happen). * Some FIR drivers may use this #define as well... * This is the same value as various Ethernet drivers. - Jean II */ diff --git a/include/net/irda/vlsi_ir.h b/include/net/irda/vlsi_ir.h index f2c66f9296ed..1d209ac6e02a 100644 --- a/include/net/irda/vlsi_ir.h +++ b/include/net/irda/vlsi_ir.h @@ -382,7 +382,7 @@ enum vlsi_pio_irenable { * PLSWID = (pulsetime * freq / (BAUD+1)) - 1 * where pulsetime is the requested IrPHY pulse width * and freq is 8(16)MHz for 40(48)MHz primary input clock - * PREAMB: dont care for SIR + * PREAMB: don't care for SIR * * The nominal SIR pulse width is 3/16 bit time so we have PLSWID=12 * fixed for all SIR speeds at 40MHz input clock (PLSWID=24 at 48MHz). @@ -401,7 +401,7 @@ enum vlsi_pio_irenable { * PREAMB = 1 * * FIR-mode: BAUD = 0 - * PLSWID: dont care + * PLSWID: don't care * PREAMB = 15 */ diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 1215aa4af55b..4eee5a553ede 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h @@ -92,7 +92,7 @@ * The implementation goals were as follow : * o Obvious : you should not need a PhD to understand what's happening, * the benefit is easier maintainance. - * o Flexible : it should accomodate a wide variety of driver + * o Flexible : it should accommodate a wide variety of driver * implementations and be as flexible as the old API. * o Lean : it should be efficient memory wise to minimise the impact * on kernel footprint. diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h index 3dd6d0b19f6b..acf62b4e3321 100644 --- a/include/net/llc_conn.h +++ b/include/net/llc_conn.h @@ -61,7 +61,7 @@ struct llc_opt { u8 inc_cntr; u8 dec_cntr; u8 connect_step; - u8 last_nr; /* NR of last pdu recieved */ + u8 last_nr; /* NR of last pdu received */ u32 rx_pdu_hdr; /* used for saving header of last pdu received and caused sending FRMR. Used for resending FRMR */ diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 1ebfd5467d8f..2553b06900b8 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -1233,7 +1233,7 @@ struct SCTP_association { /* Pointer to last transport I have sent on. */ struct sctp_transport *last_sent_to; - /* This is the last transport I have recieved DATA on. */ + /* This is the last transport I have received DATA on. */ struct sctp_transport *last_data_from; /* diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index e95ef92ff9b9..ddf50976c37b 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h @@ -177,7 +177,7 @@ struct sctp_sndrcvinfo { */ enum sctp_sinfo_flags { - MSG_UNORDERED = 1, /* Send/recieve message unordered. */ + MSG_UNORDERED = 1, /* Send/receive message unordered. */ MSG_ADDR_OVER = 2, /* Override the primary destination. */ MSG_ABORT=4, /* Send an ABORT message to the peer. */ /* MSG_EOF is already defined per socket.h */ diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h index 14710ff45bda..a6006b75c0e2 100644 --- a/include/sound/cs46xx_dsp_spos.h +++ b/include/sound/cs46xx_dsp_spos.h @@ -36,12 +36,12 @@ #define SEGTYPE_SP_COEFFICIENT 0x00000004 #define DSP_SPOS_UU 0x0deadul /* unused */ -#define DSP_SPOS_DC 0x0badul /* dont care */ -#define DSP_SPOS_DC_DC 0x0bad0badul /* dont care */ +#define DSP_SPOS_DC 0x0badul /* don't care */ +#define DSP_SPOS_DC_DC 0x0bad0badul /* don't care */ #define DSP_SPOS_UUUU 0xdeadc0edul /* unused */ #define DSP_SPOS_UUHI 0xdeadul #define DSP_SPOS_UULO 0xc0edul -#define DSP_SPOS_DCDC 0x0badf1d0ul /* dont care */ +#define DSP_SPOS_DCDC 0x0badf1d0ul /* don't care */ #define DSP_SPOS_DCDCHI 0x0badul #define DSP_SPOS_DCDCLO 0xf1d0ul diff --git a/include/sound/uda1341.h b/include/sound/uda1341.h index ad2765011c04..d5f3cf200e6f 100644 --- a/include/sound/uda1341.h +++ b/include/sound/uda1341.h @@ -160,7 +160,7 @@ const char *ig_small_value[] = { * this was computed as peak_value[i] = pow((63-i)*1.42,1.013) * * UDA1341 datasheet on page 21: Peak value (dB) = (Peak level - 63.5)*5*log2 - * There is an tabel with these values [level]=value: [3]=-90.31, [7]=-84.29 + * There is an table with these values [level]=value: [3]=-90.31, [7]=-84.29 * [61]=-2.78, [62] = -1.48, [63] = 0.0 * I tried to compute it, but using but even using logarithm with base either 10 or 2 * i was'n able to get values in the table from the formula. So I constructed another diff --git a/include/sound/wavefront.h b/include/sound/wavefront.h index 79ff3b4b1da4..c13fd09f0f03 100644 --- a/include/sound/wavefront.h +++ b/include/sound/wavefront.h @@ -687,7 +687,7 @@ typedef struct wf_fx_info { /* Allow direct user-space control over FX memory/coefficient data. In theory this could be used to download the FX microprogram, - but it would be a little slower, and involve some wierd code. + but it would be a little slower, and involve some weird code. */ #define WFFX_MEMSET 69 diff --git a/init/do_mounts.c b/init/do_mounts.c index 2090c0b0e484..3c1cf5c0c6fe 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -297,13 +297,12 @@ retry: * Allow the user to distinguish between failed open * and bad superblock on root device. */ - printk ("VFS: Cannot open root device \"%s\" or %s\n", - root_device_name, kdevname (to_kdev_t(ROOT_DEV))); - printk ("Please append a correct \"root=\" boot option\n"); - panic("VFS: Unable to mount root fs on %s", - kdevname(to_kdev_t(ROOT_DEV))); + printk("VFS: Cannot open root device \"%s\" or %s\n", + root_device_name, __bdevname(ROOT_DEV)); + printk("Please append a correct \"root=\" boot option\n"); + panic("VFS: Unable to mount root fs on %s", __bdevname(ROOT_DEV)); } - panic("VFS: Unable to mount root fs on %s", kdevname(to_kdev_t(ROOT_DEV))); + panic("VFS: Unable to mount root fs on %s", __bdevname(ROOT_DEV)); out: putname(fs_names); sys_chdir("/root"); diff --git a/kernel/cpufreq.c b/kernel/cpufreq.c index 5a1118709aed..17d2845accfd 100644 --- a/kernel/cpufreq.c +++ b/kernel/cpufreq.c @@ -1078,11 +1078,11 @@ int cpufreq_set_policy(struct cpufreq_policy *policy) down(&cpufreq_notifier_sem); - /* adjust if neccessary - all reasons */ + /* adjust if necessary - all reasons */ notifier_call_chain(&cpufreq_policy_notifier_list, CPUFREQ_ADJUST, policy); - /* adjust if neccessary - hardware incompatibility*/ + /* adjust if necessary - hardware incompatibility*/ notifier_call_chain(&cpufreq_policy_notifier_list, CPUFREQ_INCOMPATIBLE, policy); diff --git a/kernel/exit.c b/kernel/exit.c index f01c77dfcee1..ffc0973ab074 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -482,7 +482,7 @@ static inline void choose_new_parent(task_t *p, task_t *reaper, task_t *child_re static inline void reparent_thread(task_t *p, task_t *father, int traced) { - /* We dont want people slaying init. */ + /* We don't want people slaying init. */ if (p->exit_signal != -1) p->exit_signal = SIGCHLD; p->self_exec_id++; diff --git a/kernel/fork.c b/kernel/fork.c index 8a6032c5f7ec..ce4d721d0ced 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -446,7 +446,7 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) tsk->clear_child_tid = NULL; /* - * We dont check the error code - if userspace has + * We don't check the error code - if userspace has * not set up a proper pointer then tough luck. */ put_user(0, tidptr); @@ -901,7 +901,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, /* * Share the timeslice between parent and child, thus the - * total amount of pending timeslices in the system doesnt change, + * total amount of pending timeslices in the system doesn't change, * resulting in more scheduling fairness. */ local_irq_disable(); diff --git a/kernel/futex.c b/kernel/futex.c index 4cade10892db..dfd03a0cdad8 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -39,7 +39,7 @@ /* * We use this hashed waitqueue instead of a normal wait_queue_t, so - * we can wake only the relevent ones (hashed queues may be shared): + * we can wake only the relevant ones (hashed queues may be shared): */ struct futex_q { struct list_head list; @@ -297,7 +297,7 @@ static int futex_wait(unsigned long uaddr, time = schedule_timeout(time); set_current_state(TASK_RUNNING); /* - * NOTE: we dont remove ourselves from the waitqueue because + * NOTE: we don't remove ourselves from the waitqueue because * we are the only user of it. */ if (time == 0) { diff --git a/kernel/module.c b/kernel/module.c index 00d8b07c4fd1..bf6859b3cd73 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -76,6 +76,22 @@ int init_module(void) } EXPORT_SYMBOL(init_module); +/* Find a module section: 0 means not found. */ +static unsigned int find_sec(Elf_Ehdr *hdr, + Elf_Shdr *sechdrs, + const char *secstrings, + const char *name) +{ + unsigned int i; + + for (i = 1; i < hdr->e_shnum; i++) + /* Alloc bit cleared means "ignore it." */ + if ((sechdrs[i].sh_flags & SHF_ALLOC) + && strcmp(secstrings+sechdrs[i].sh_name, name) == 0) + return i; + return 0; +} + /* Find a symbol, return value and the symbol group */ static unsigned long __find_symbol(const char *name, struct kernel_symbol_group **group, @@ -173,16 +189,19 @@ static int use_module(struct module *a, struct module *b) struct module_use *use; if (b == NULL || already_uses(a, b)) return 1; + if (!strong_try_module_get(b)) + return 0; + DEBUGP("Allocating new usage for %s.\n", a->name); use = kmalloc(sizeof(*use), GFP_ATOMIC); if (!use) { printk("%s: out of memory loading\n", a->name); + module_put(b); return 0; } use->module_which_uses = a; list_add(&use->list, &b->modules_which_use_me); - try_module_get(b); /* Can't fail */ return 1; } @@ -875,45 +894,6 @@ void *__symbol_get(const char *symbol) } EXPORT_SYMBOL_GPL(__symbol_get); -/* Deal with the given section */ -static int handle_section(const char *name, - Elf_Shdr *sechdrs, - unsigned int strindex, - unsigned int symindex, - unsigned int i, - struct module *mod) -{ - int ret; - const char *strtab = (char *)sechdrs[strindex].sh_addr; - - switch (sechdrs[i].sh_type) { - case SHT_REL: - ret = apply_relocate(sechdrs, strtab, symindex, i, mod); - break; - case SHT_RELA: - ret = apply_relocate_add(sechdrs, strtab, symindex, i, mod); - break; - default: - DEBUGP("Ignoring section %u: %s\n", i, - sechdrs[i].sh_type==SHT_NULL ? "NULL": - sechdrs[i].sh_type==SHT_PROGBITS ? "PROGBITS": - sechdrs[i].sh_type==SHT_SYMTAB ? "SYMTAB": - sechdrs[i].sh_type==SHT_STRTAB ? "STRTAB": - sechdrs[i].sh_type==SHT_RELA ? "RELA": - sechdrs[i].sh_type==SHT_HASH ? "HASH": - sechdrs[i].sh_type==SHT_DYNAMIC ? "DYNAMIC": - sechdrs[i].sh_type==SHT_NOTE ? "NOTE": - sechdrs[i].sh_type==SHT_NOBITS ? "NOBITS": - sechdrs[i].sh_type==SHT_REL ? "REL": - sechdrs[i].sh_type==SHT_SHLIB ? "SHLIB": - sechdrs[i].sh_type==SHT_DYNSYM ? "DYNSYM": - sechdrs[i].sh_type==SHT_NUM ? "NUM": - "UNKNOWN"); - ret = 0; - } - return ret; -} - /* Change all symbols so that sh_value encodes the pointer directly. */ static int simplify_symbols(Elf_Shdr *sechdrs, unsigned int symindex, @@ -1103,93 +1083,19 @@ static struct module *load_module(void *umod, sechdrs = (void *)hdr + hdr->e_shoff; secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; - /* May not export symbols, or have setup params, so these may - not exist */ - exportindex = setupindex = obsparmindex = gplindex = licenseindex - = crcindex = gplcrcindex = versindex = 0; - /* And these should exist, but gcc whinges if we don't init them */ - symindex = strindex = exindex = modindex = vmagindex = 0; + symindex = strindex = 0; - /* Find where important sections are */ for (i = 1; i < hdr->e_shnum; i++) { /* Mark all sections sh_addr with their address in the temporary image. */ sechdrs[i].sh_addr = (size_t)hdr + sechdrs[i].sh_offset; + /* Internal symbols and strings. */ if (sechdrs[i].sh_type == SHT_SYMTAB) { - /* Internal symbols */ - DEBUGP("Symbol table in section %u\n", i); symindex = i; - /* Strings */ strindex = sechdrs[i].sh_link; - DEBUGP("String table found in section %u\n", strindex); - } else if (strcmp(secstrings+sechdrs[i].sh_name, - ".gnu.linkonce.this_module") == 0) { - /* The module struct */ - DEBUGP("Module in section %u\n", i); - modindex = i; - } else if (strcmp(secstrings+sechdrs[i].sh_name, "__ksymtab") - == 0) { - /* Exported symbols. */ - DEBUGP("EXPORT table in section %u\n", i); - exportindex = i; - } else if (strcmp(secstrings+sechdrs[i].sh_name, - "__ksymtab_gpl") == 0) { - /* Exported symbols. (GPL) */ - DEBUGP("GPL symbols found in section %u\n", i); - gplindex = i; - } else if (strcmp(secstrings+sechdrs[i].sh_name, "__kcrctab") - == 0) { - /* Exported symbols CRCs. */ - DEBUGP("CRC table in section %u\n", i); - crcindex = i; - } else if (strcmp(secstrings+sechdrs[i].sh_name, "__kcrctab_gpl") - == 0) { - /* Exported symbols CRCs. (GPL)*/ - DEBUGP("CRC table in section %u\n", i); - gplcrcindex = i; - } else if (strcmp(secstrings+sechdrs[i].sh_name, "__param") - == 0) { - /* Setup parameter info */ - DEBUGP("Setup table found in section %u\n", i); - setupindex = i; - } else if (strcmp(secstrings+sechdrs[i].sh_name, "__ex_table") - == 0) { - /* Exception table */ - DEBUGP("Exception table found in section %u\n", i); - exindex = i; - } else if (strcmp(secstrings+sechdrs[i].sh_name, "__obsparm") - == 0) { - /* Obsolete MODULE_PARM() table */ - DEBUGP("Obsolete param found in section %u\n", i); - obsparmindex = i; - } else if (strcmp(secstrings+sechdrs[i].sh_name,".init.license") - == 0) { - /* MODULE_LICENSE() */ - DEBUGP("Licence found in section %u\n", i); - licenseindex = i; - sechdrs[i].sh_flags &= ~(unsigned long)SHF_ALLOC; - } else if (strcmp(secstrings+sechdrs[i].sh_name, - "__vermagic") == 0 && - (sechdrs[i].sh_flags & SHF_ALLOC)) { - /* Version magic. */ - DEBUGP("Version magic found in section %u\n", i); - vmagindex = i; - sechdrs[i].sh_flags &= ~(unsigned long)SHF_ALLOC; - } else if (strcmp(secstrings+sechdrs[i].sh_name, - "__versions") == 0 && - (sechdrs[i].sh_flags & SHF_ALLOC)) { - /* Module version info (both exported and needed) */ - DEBUGP("Versions found in section %u\n", i); - versindex = i; - sechdrs[i].sh_flags &= ~(unsigned long)SHF_ALLOC; } -#ifdef CONFIG_KALLSYMS - /* symbol and string tables for decoding later. */ - if (sechdrs[i].sh_type == SHT_SYMTAB || i == strindex) - sechdrs[i].sh_flags |= SHF_ALLOC; -#endif #ifndef CONFIG_MODULE_UNLOAD /* Don't load .exit sections */ if (strstr(secstrings+sechdrs[i].sh_name, ".exit")) @@ -1197,6 +1103,14 @@ static struct module *load_module(void *umod, #endif } +#ifdef CONFIG_KALLSYMS + /* Keep symbol and string tables for decoding later. */ + sechdrs[symindex].sh_flags |= SHF_ALLOC; + sechdrs[strindex].sh_flags |= SHF_ALLOC; +#endif + + modindex = find_sec(hdr, sechdrs, secstrings, + ".gnu.linkonce.this_module"); if (!modindex) { printk(KERN_WARNING "No module found in object\n"); err = -ENOEXEC; @@ -1204,6 +1118,18 @@ static struct module *load_module(void *umod, } mod = (void *)sechdrs[modindex].sh_addr; + /* Optional sections */ + exportindex = find_sec(hdr, sechdrs, secstrings, "__ksymtab"); + gplindex = find_sec(hdr, sechdrs, secstrings, "__ksymtab_gpl"); + crcindex = find_sec(hdr, sechdrs, secstrings, "__kcrctab"); + gplcrcindex = find_sec(hdr, sechdrs, secstrings, "__kcrctab_gpl"); + setupindex = find_sec(hdr, sechdrs, secstrings, "__param"); + exindex = find_sec(hdr, sechdrs, secstrings, "__ex_table"); + obsparmindex = find_sec(hdr, sechdrs, secstrings, "__obsparm"); + licenseindex = find_sec(hdr, sechdrs, secstrings, ".init.license"); + vmagindex = find_sec(hdr, sechdrs, secstrings, "__vermagic"); + versindex = find_sec(hdr, sechdrs, secstrings, "__versions"); + /* Check module struct version now, before we try to use module. */ if (!check_modstruct_version(sechdrs, versindex, mod)) { err = -ENOEXEC; @@ -1336,10 +1262,15 @@ static struct module *load_module(void *umod, mod->extable.entry = (void *)sechdrs[exindex].sh_addr; } - /* Now handle each section. */ + /* Now do relocations. */ for (i = 1; i < hdr->e_shnum; i++) { - err = handle_section(secstrings + sechdrs[i].sh_name, - sechdrs, strindex, symindex, i, mod); + const char *strtab = (char *)sechdrs[strindex].sh_addr; + if (sechdrs[i].sh_type == SHT_REL) + err = apply_relocate(sechdrs, strtab, symindex, i, + mod); + else if (sechdrs[i].sh_type == SHT_RELA) + err = apply_relocate_add(sechdrs, strtab, symindex, i, + mod); if (err < 0) goto cleanup; } @@ -1456,10 +1387,12 @@ sys_init_module(void *umod, } /* Now it's a first class citizen! */ + down(&module_mutex); mod->state = MODULE_STATE_LIVE; module_free(mod, mod->module_init); mod->module_init = NULL; mod->init_size = 0; + up(&module_mutex); return 0; } diff --git a/kernel/pm.c b/kernel/pm.c index a710764606ba..afffd046c2f6 100644 --- a/kernel/pm.c +++ b/kernel/pm.c @@ -141,11 +141,11 @@ void pm_unregister_all(pm_callback callback) * data field must hold the intended next state. No call is made * if the state matches. * - * BUGS: what stops two power management requests occuring in parallel + * BUGS: what stops two power management requests occurring in parallel * and conflicting. * * WARNING: Calling pm_send directly is not generally recommended, in - * paticular there is no locking against the pm_dev going away. The + * particular there is no locking against the pm_dev going away. The * caller must maintain all needed locking or have 'inside knowledge' * on the safety. Also remember that this function is not locked against * pm_unregister. This means that you must handle SMP races on callback @@ -227,7 +227,7 @@ static void pm_undo_all(struct pm_dev *last) * Zero is returned on success. If a suspend fails then the status * from the device that vetoes the suspend is returned. * - * BUGS: what stops two power management requests occuring in parallel + * BUGS: what stops two power management requests occurring in parallel * and conflicting. */ diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 95ada3e0f563..add2e8abd710 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c @@ -1207,7 +1207,7 @@ do_clock_nanosleep(clockid_t which_clock, int flags, struct timespec *tsave) { struct timespec t; struct timer_list new_timer; - struct abs_struct abs_struct = { list:{next:0} }; + struct abs_struct abs_struct = { .list = { .next = 0 } }; int abs; int rtn = 0; int active; diff --git a/kernel/suspend.c b/kernel/suspend.c index 5bcf2e90b48a..5801413eeb62 100644 --- a/kernel/suspend.c +++ b/kernel/suspend.c @@ -961,7 +961,7 @@ static int relocate_pagedir(void) printk("Relocating pagedir"); if(!does_collide_order(old_pagedir, (unsigned long)old_pagedir, pagedir_order)) { - printk("not neccessary\n"); + printk("not necessary\n"); return 0; } diff --git a/kernel/sys.c b/kernel/sys.c index afa6d2fc1372..8e3fb524d641 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -870,7 +870,7 @@ asmlinkage long sys_times(struct tms * tbuf) if (copy_to_user(tbuf, &tmp, sizeof(struct tms))) return -EFAULT; } - return jiffies_to_clock_t(jiffies); + return (long) jiffies_64_to_clock_t(get_jiffies_64()); } /* diff --git a/kernel/timer.c b/kernel/timer.c index cabdff7716e7..6e7e23cb95ba 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -757,7 +757,7 @@ static inline void calc_load(unsigned long ticks) } /* jiffies at the most recent update of wall time */ -unsigned long wall_jiffies; +unsigned long wall_jiffies = INITIAL_JIFFIES; /* * This read-write spinlock protects us from races in SMP while @@ -1104,7 +1104,7 @@ asmlinkage long sys_sysinfo(struct sysinfo *info) do { seq = read_seqbegin(&xtime_lock); - uptime = jiffies_64; + uptime = jiffies_64 - INITIAL_JIFFIES; do_div(uptime, HZ); val.uptime = (unsigned long) uptime; @@ -1180,6 +1180,13 @@ static void __devinit init_timers_cpu(int cpu) } for (j = 0; j < TVR_SIZE; j++) INIT_LIST_HEAD(base->tv1.vec + j); + + base->timer_jiffies = INITIAL_JIFFIES; + base->tv1.index = INITIAL_JIFFIES & TVR_MASK; + base->tv2.index = (INITIAL_JIFFIES >> TVR_BITS) & TVN_MASK; + base->tv3.index = (INITIAL_JIFFIES >> (TVR_BITS+TVN_BITS)) & TVN_MASK; + base->tv4.index = (INITIAL_JIFFIES >> (TVR_BITS+2*TVN_BITS)) & TVN_MASK; + base->tv5.index = (INITIAL_JIFFIES >> (TVR_BITS+3*TVN_BITS)) & TVN_MASK; } static int __devinit timer_cpu_notify(struct notifier_block *self, diff --git a/lib/crc32.c b/lib/crc32.c index 7659a24a6973..86d8670569a7 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -90,19 +90,16 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) const u32 *tab = crc32table_le; # ifdef __LITTLE_ENDIAN -# define DO_CRC crc = (crc>>8) ^ tab[ crc & 255 ] -# define ENDIAN_SHIFT 0 +# define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8) # else -# define DO_CRC crc = (crc<<8) ^ tab[ crc >> 24 ] -# define ENDIAN_SHIFT 24 +# define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8) # endif crc = __cpu_to_le32(crc); /* Align it */ if(unlikely(((long)b)&3 && len)){ do { - crc ^= *((u8 *)b)++ << ENDIAN_SHIFT; - DO_CRC; + DO_CRC(*((u8 *)b)++); } while ((--len) && ((long)b)&3 ); } if(likely(len >= 4)){ @@ -112,10 +109,10 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) --b; /* use pre increment below(*++b) for speed */ do { crc ^= *++b; - DO_CRC; - DO_CRC; - DO_CRC; - DO_CRC; + DO_CRC(0); + DO_CRC(0); + DO_CRC(0); + DO_CRC(0); } while (--len); b++; /* point to next byte(s) */ len = save_len; @@ -123,8 +120,7 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) /* And the last few bytes */ if(len){ do { - crc ^= *((u8 *)b)++ << ENDIAN_SHIFT; - DO_CRC; + DO_CRC(*((u8 *)b)++); } while (--len); } @@ -195,19 +191,16 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len) const u32 *tab = crc32table_be; # ifdef __LITTLE_ENDIAN -# define DO_CRC crc = (crc>>8) ^ tab[ crc & 255 ] -# define ENDIAN_SHIFT 24 +# define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8) # else -# define DO_CRC crc = (crc<<8) ^ tab[ crc >> 24 ] -# define ENDIAN_SHIFT 0 +# define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8) # endif crc = __cpu_to_be32(crc); /* Align it */ if(unlikely(((long)b)&3 && len)){ do { - crc ^= *((u8 *)b)++ << ENDIAN_SHIFT; - DO_CRC; + DO_CRC(*((u8 *)b)++); } while ((--len) && ((long)b)&3 ); } if(likely(len >= 4)){ @@ -217,10 +210,10 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len) --b; /* use pre increment below(*++b) for speed */ do { crc ^= *++b; - DO_CRC; - DO_CRC; - DO_CRC; - DO_CRC; + DO_CRC(0); + DO_CRC(0); + DO_CRC(0); + DO_CRC(0); } while (--len); b++; /* point to next byte(s) */ len = save_len; @@ -228,8 +221,7 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len) /* And the last few bytes */ if(len){ do { - crc ^= *((u8 *)b)++ << ENDIAN_SHIFT; - DO_CRC; + DO_CRC(*((u8 *)b)++); } while (--len); } return __be32_to_cpu(crc); diff --git a/lib/crc32defs.h b/lib/crc32defs.h index bdf55ce42edc..9b6773d73749 100644 --- a/lib/crc32defs.h +++ b/lib/crc32defs.h @@ -8,8 +8,12 @@ /* How many bits at a time to use. Requires a table of 4<<CRC_xx_BITS bytes. */ /* For less performance-sensitive, use 4 */ -#define CRC_LE_BITS 8 -#define CRC_BE_BITS 8 +#ifndef CRC_LE_BITS +# define CRC_LE_BITS 8 +#endif +#ifndef CRC_BE_BITS +# define CRC_BE_BITS 8 +#endif /* * Little-endian CRC computation. Used with serial bit streams sent diff --git a/mm/filemap.c b/mm/filemap.c index f6009bff7467..fb0092191c0c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -559,21 +559,12 @@ void do_generic_mapping_read(struct address_space *mapping, page_cache_readahead(mapping, ra, filp, index); nr = nr - offset; - - /* - * Try to find the data in the page cache.. - */ find_page: - read_lock(&mapping->page_lock); - page = radix_tree_lookup(&mapping->page_tree, index); - if (!page) { - read_unlock(&mapping->page_lock); - handle_ra_miss(mapping,ra); + page = find_get_page(mapping, index); + if (unlikely(page == NULL)) { + handle_ra_miss(mapping, ra); goto no_cached_page; } - page_cache_get(page); - read_unlock(&mapping->page_lock); - if (!PageUptodate(page)) goto page_not_up_to_date; page_ok: diff --git a/mm/memory.c b/mm/memory.c index 1bef6a16f7a4..2b0ab37d7a9f 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -158,9 +158,7 @@ pte_t * pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address) pmd_populate(mm, pmd, new); } out: - if (pmd_present(*pmd)) - return pte_offset_map(pmd, address); - return NULL; + return pte_offset_map(pmd, address); } pte_t * pte_alloc_kernel(struct mm_struct *mm, pmd_t *pmd, unsigned long address) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 073e24ed7709..67bf332df4ae 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -61,6 +61,9 @@ static int badness(struct task_struct *p) if (!p->mm) return 0; + + if (p->flags & PF_MEMDIE) + return 0; /* * The memory size of the process is the basis for the badness. */ diff --git a/mm/slab.c b/mm/slab.c index dca957164326..c199cf890d58 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1643,7 +1643,7 @@ cache_alloc_debugcheck_after(kmem_cache_t *cachep, if (cachep->ctor && cachep->flags & SLAB_POISON) { unsigned long ctor_flags = SLAB_CTOR_CONSTRUCTOR; - if (!flags & __GFP_WAIT) + if (!(flags & __GFP_WAIT)) ctor_flags |= SLAB_CTOR_ATOMIC; cachep->ctor(objp, cachep, ctor_flags); @@ -2064,7 +2064,7 @@ static void enable_cpucache (kmem_cache_t *cachep) else limit = 248; -#ifndef DEBUG +#if DEBUG /* With debugging enabled, large batchcount lead to excessively * long periods with disabled local interrupts. Limit the * batchcount diff --git a/mm/swap.c b/mm/swap.c index 942a8bd5da9d..8b90955fdad4 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -27,7 +27,7 @@ int page_cluster; /* - * Writeback is about to end against a page whic has been marked for immediate + * Writeback is about to end against a page which has been marked for immediate * reclaim. If it still appears to be reclaimable, move it to the tail of the * inactive list. The page still has PageWriteback set, which will pin it. * diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h index bc89e879c379..b81d7f6b9238 100644 --- a/net/8021q/vlan.h +++ b/net/8021q/vlan.h @@ -38,7 +38,7 @@ int vlan_ioctl_handler(unsigned long arg); extern struct vlan_group *vlan_group_hash[VLAN_GRP_HASH_SIZE]; extern spinlock_t vlan_group_lock; -/* Find a VLAN device by the MAC address of it's Ethernet device, and +/* Find a VLAN device by the MAC address of its Ethernet device, and * it's VLAN ID. The default configuration is to have VLAN's scope * to be box-wide, so the MAC will be ignored. The mac will only be * looked at if we are configured to have a separate set of VLANs per diff --git a/net/core/Makefile b/net/core/Makefile index 2f8e73b7bbab..ffbb63e471a4 100644 --- a/net/core/Makefile +++ b/net/core/Makefile @@ -19,5 +19,3 @@ obj-$(CONFIG_NET_DIVERT) += dv.o obj-$(CONFIG_NET_PROFILE) += profile.o obj-$(CONFIG_NET_PKTGEN) += pktgen.o obj-$(CONFIG_NET_RADIO) += wireless.o -# Ugly. I wish all wireless drivers were moved in drivers/net/wireless -obj-$(CONFIG_NET_PCMCIA_RADIO) += wireless.o diff --git a/net/core/dev.c b/net/core/dev.c index 5535abdd4c3a..f7f9cd622e89 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -107,10 +107,10 @@ #include <linux/kmod.h> #include <linux/module.h> #include <linux/kallsyms.h> -#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO) +#ifdef CONFIG_NET_RADIO #include <linux/wireless.h> /* Note : will define WIRELESS_EXT */ #include <net/iw_handler.h> -#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */ +#endif /* CONFIG_NET_RADIO */ #ifdef CONFIG_PLIP extern int plip_init(void); #endif @@ -1215,7 +1215,7 @@ static void get_sample_stats(int cpu) #ifdef OFFLINE_SAMPLE static void sample_queue(unsigned long dummy) { -/* 10 ms 0r 1ms -- i dont care -- JHS */ +/* 10 ms 0r 1ms -- i don't care -- JHS */ int next_tick = 1; int cpu = smp_processor_id(); diff --git a/net/core/netfilter.c b/net/core/netfilter.c index 5cfc8f9be6af..a69f8cea7351 100644 --- a/net/core/netfilter.c +++ b/net/core/netfilter.c @@ -606,7 +606,7 @@ int ip_route_me_harder(struct sk_buff **pskb) struct net_device *dev_src = NULL; int err; - /* accomodate ip_route_output_slow(), which expects the key src to be + /* accommodate ip_route_output_slow(), which expects the key src to be 0 or a local address; however some non-standard hacks like ipt_REJECT.c:send_reset() can cause packets with foreign saddr to be appear on the NF_IP_LOCAL_OUT hook -MB */ diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 3dedfbb5dd87..776eb0afd9da 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c @@ -18,7 +18,7 @@ * Steve Whitehouse : Multiple ifaddr support * Steve Whitehouse : SIOCGIFCONF is now a compile time option * Steve Whitehouse : /proc/sys/net/decnet/conf/<sys>/forwarding - * Steve Whitehouse : Removed timer1 - its a user space issue now + * Steve Whitehouse : Removed timer1 - it's a user space issue now * Patrick Caulfield : Fixed router hello message format */ @@ -807,7 +807,7 @@ out: * This is one of those areas where the initial VMS concepts don't really * map onto the Linux concepts, and since we introduced multiple addresses * per interface we have to cope with slightly odd ways of finding out what - * "our address" really is. Mostly its not a problem; for this we just guess + * "our address" really is. Mostly it's not a problem; for this we just guess * a sensible default. Eventually the routing code will take care of all the * nasties for us I hope. */ diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index 2f357cbd7018..3ca4c96796a0 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c @@ -702,7 +702,7 @@ init_conntrack(const struct ip_conntrack_tuple *tuple, if (!expected) conntrack->helper = ip_ct_find_helper(&repl_tuple); - /* If the expectation is dying, then this is a looser. */ + /* If the expectation is dying, then this is a loser. */ if (expected && expected->expectant->helper->timeout && ! del_timer(&expected->timeout)) diff --git a/net/ipv4/netfilter/ip_conntrack_ftp.c b/net/ipv4/netfilter/ip_conntrack_ftp.c index 9a5ff69d5f7e..4207bc101ed4 100644 --- a/net/ipv4/netfilter/ip_conntrack_ftp.c +++ b/net/ipv4/netfilter/ip_conntrack_ftp.c @@ -321,7 +321,7 @@ static int help(const struct iphdr *iph, size_t len, if (found == -1) { /* We don't usually drop packets. After all, this is connection tracking, not packet filtering. - However, it is neccessary for accurate tracking in + However, it is necessary for accurate tracking in this case. */ if (net_ratelimit()) printk("conntrack_ftp: partial %s %u+%u\n", diff --git a/net/ipv4/netfilter/ip_conntrack_irc.c b/net/ipv4/netfilter/ip_conntrack_irc.c index 98adfbf6eaf9..ab4f6c0d8420 100644 --- a/net/ipv4/netfilter/ip_conntrack_irc.c +++ b/net/ipv4/netfilter/ip_conntrack_irc.c @@ -107,7 +107,7 @@ int parse_dcc(char *data, char *data_end, u_int32_t * ip, u_int16_t * port, static int help(const struct iphdr *iph, size_t len, struct ip_conntrack *ct, enum ip_conntrack_info ctinfo) { - /* tcplen not negative guarenteed by ip_conntrack_tcp.c */ + /* tcplen not negative guaranteed by ip_conntrack_tcp.c */ struct tcphdr *tcph = (void *) iph + iph->ihl * 4; const char *data = (const char *) tcph + tcph->doff * 4; const char *_data = data; @@ -199,7 +199,7 @@ static int help(const struct iphdr *iph, size_t len, LOCK_BH(&ip_irc_lock); /* save position of address in dcc string, - * neccessary for NAT */ + * necessary for NAT */ DEBUGP("tcph->seq = %u\n", tcph->seq); exp->seq = ntohl(tcph->seq) + (addr_beg_p - _data); exp_irc_info->len = (addr_end_p - addr_beg_p); diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c index 377a50121229..9028334c5112 100644 --- a/net/ipv4/netfilter/ip_nat_core.c +++ b/net/ipv4/netfilter/ip_nat_core.c @@ -288,7 +288,7 @@ find_best_ips_proto(struct ip_conntrack_tuple *tuple, saved_ip = tuple->src.ip; other_ipp = &tuple->src.ip; } - /* Don't do do_extra_mangle unless neccessary (overrides + /* Don't do do_extra_mangle unless necessary (overrides explicit socket bindings, for example) */ orig_dstip = tuple->dst.ip; diff --git a/net/ipv4/netfilter/ip_nat_irc.c b/net/ipv4/netfilter/ip_nat_irc.c index 3edc319f56fb..50d0ec8d82f0 100644 --- a/net/ipv4/netfilter/ip_nat_irc.c +++ b/net/ipv4/netfilter/ip_nat_irc.c @@ -188,7 +188,7 @@ static unsigned int help(struct ip_conntrack *ct, datalen = (*pskb)->len - iph->ihl * 4 - tcph->doff * 4; LOCK_BH(&ip_irc_lock); - /* Check wether the whole IP/address pattern is carried in the payload */ + /* Check whether the whole IP/address pattern is carried in the payload */ if (between(exp->seq + ct_irc_info->len, ntohl(tcph->seq), ntohl(tcph->seq) + datalen)) { diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 2351b2faf180..d1e4db1262be 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -172,7 +172,7 @@ * ack if state is TCP_CLOSED. * Alan Cox : Look up device on a retransmit - routes may * change. Doesn't yet cope with MSS shrink right - * but its a start! + * but it's a start! * Marc Tamsky : Closing in closing fixes. * Mike Shaver : RFC1122 verifications. * Alan Cox : rcv_saddr errors. diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index ea9859dc5842..a200a7c9135e 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -208,7 +208,7 @@ struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len, default: /* * Unknown options must be silently ignored, - * to accomodate future extension to the protocol. + * to accommodate future extension to the protocol. */ ND_PRINTK2(KERN_WARNING "ndisc_parse_options(): ignored unsupported option; type=%d, len=%d\n", diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 11f73d24393e..a577de58ff13 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -684,7 +684,7 @@ static int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb, if (ipx->ipx_source.net != intrfc->if_netnum) { /* * Unshare the buffer before modifying the count in - * case its a flood or tcpdump + * case it's a flood or tcpdump */ skb = skb_unshare(skb, GFP_ATOMIC); if (!skb) diff --git a/net/irda/irlmp_event.c b/net/irda/irlmp_event.c index 75320713724a..b09c1d898b0f 100644 --- a/net/irda/irlmp_event.c +++ b/net/irda/irlmp_event.c @@ -423,7 +423,7 @@ static void irlmp_state_active(struct lap_cb *self, IRLMP_EVENT event, /* We don't want to change state just yet, because * we want to reflect accurately the real state of * the LAP, not the state we wish it was in, - * so that we don't loose LM_LAP_CONNECT_REQUEST. + * so that we don't lose LM_LAP_CONNECT_REQUEST. * In some cases, IrLAP won't close the LAP * immediately. For example, it might still be * retrying packets or waiting for the pf bit. diff --git a/net/irda/irsyms.c b/net/irda/irsyms.c index 1cab9b806c89..ec7363528e14 100644 --- a/net/irda/irsyms.c +++ b/net/irda/irsyms.c @@ -254,7 +254,7 @@ void irda_notify_init(notify_t *notify) /* * Function irda_init (void) * - * Protocol stack intialisation entry point. + * Protocol stack initialisation entry point. * Initialise the various components of the IrDA stack */ int __init irda_init(void) diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 749d0fe895f5..91b1b9ef71e4 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c @@ -710,7 +710,7 @@ static void irttp_run_tx_queue(struct tsap_cb *self) * The current skb has a reference to the socket that sent * it (skb->sk). When we pass it to IrLMP, the skb will be * stored in in IrLAP (self->wx_list). When we are within - * IrLAP, we loose the notion of socket, so we should not + * IrLAP, we lose the notion of socket, so we should not * have a reference to a socket. So, we drop it here. * * Why does it matter ? diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 60fa3afa28b8..b52efba8a6f5 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c @@ -301,7 +301,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) llc->daddr.lsap = addr->sllc_dsap; memcpy(llc->daddr.mac, addr->sllc_dmac, IFHWADDRLEN); memcpy(&llc->addr, addr, sizeof(llc->addr)); - /* assign new connection to it's SAP */ + /* assign new connection to its SAP */ llc_sap_assign_sock(sap, sk); rc = sk->zapped = 0; out: diff --git a/net/llc/llc_pdu.c b/net/llc/llc_pdu.c index b5d047e9154f..8da9ddea65be 100644 --- a/net/llc/llc_pdu.c +++ b/net/llc/llc_pdu.c @@ -203,7 +203,7 @@ void llc_pdu_init_as_xid_cmd(struct sk_buff *skb, u8 svcs_supported, xid_info = (struct llc_xid_info *)(((u8 *)&pdu->ctrl_1) + 1); xid_info->fmt_id = LLC_XID_FMT_ID; /* 0x81 */ xid_info->type = svcs_supported; - xid_info->rw = rx_window << 1; /* size of recieve window */ + xid_info->rw = rx_window << 1; /* size of receive window */ skb_put(skb, 3); } diff --git a/net/netsyms.c b/net/netsyms.c index 76c32e9baf93..6a11dd1ad537 100644 --- a/net/netsyms.c +++ b/net/netsyms.c @@ -646,12 +646,12 @@ EXPORT_SYMBOL(register_gifconf); EXPORT_SYMBOL(softnet_data); -#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO) +#ifdef CONFIG_NET_RADIO /* Don't include the whole header mess for a single function */ union iwreq_data; extern void wireless_send_event(struct net_device *dev, unsigned int cmd, union iwreq_data *wrqu, char *extra); EXPORT_SYMBOL(wireless_send_event); -#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */ +#endif /* CONFIG_NET_RADIO */ EXPORT_SYMBOL(linkwatch_fire_event); diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 6f653b5bb65d..d6162b24fe8f 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -416,7 +416,7 @@ static int gred_change(struct Qdisc *sch, struct rtattr *opt) memcpy(q->Stab, RTA_DATA(tb[TCA_GRED_STAB-1]), 256); if ( table->initd && table->grio) { - /* this looks ugly but its not in the fast path */ + /* this looks ugly but it's not in the fast path */ for (i=0;i<table->DPs;i++) { if ((!table->tab[i]) || (i==q->DP) ) continue; diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index a99047e1792d..30f946968ba1 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -623,7 +623,7 @@ htb_change_class_mode(struct htb_sched *q, struct htb_class *cl, long *diff) if (new_mode == cl->cmode) return; - if (cl->prio_activity) { /* not neccessary: speed optimization */ + if (cl->prio_activity) { /* not necessary: speed optimization */ if (cl->cmode != HTB_CANT_SEND) htb_deactivate_prios(q,cl); cl->cmode = new_mode; diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index b1bfe69e61ed..05580a524db7 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c @@ -423,7 +423,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, sctp_packet_t *pkt, *start_timer = 1; /* Stop sending DATA as there is no more room - * at the reciever. + * at the receiver. */ list_add(lchunk, lqueue); lchunk = NULL; diff --git a/net/sctp/primitive.c b/net/sctp/primitive.c index a77be1514941..a652c61a14e3 100644 --- a/net/sctp/primitive.c +++ b/net/sctp/primitive.c @@ -199,7 +199,7 @@ DECLARE_PRIMITIVE(SEND); * o association id - local handle to the SCTP association * * o destination transport address - the transport address of the - * asociation on which a heartbeat should be issued. + * association on which a heartbeat should be issued. */ DECLARE_PRIMITIVE(REQUESTHEARTBEAT); diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 848a48229f17..8ecbc89f6fe4 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -939,7 +939,7 @@ out: return 0; } -/* A restart is occuring, check to make sure no new addresses +/* A restart is occurring, check to make sure no new addresses * are being added as we may be under a takeover attack. */ static int sctp_sf_check_restart_addrs(const sctp_association_t *new_asoc, @@ -1413,7 +1413,7 @@ nomem: * at about the same time but the peer endpoint started its INIT * after responding to the local endpoint's INIT */ -/* This case represents an intialization collision. */ +/* This case represents an initialization collision. */ static sctp_disposition_t sctp_sf_do_dupcook_b(const sctp_endpoint_t *ep, const sctp_association_t *asoc, sctp_chunk_t *chunk, @@ -3734,7 +3734,7 @@ sctp_disposition_t sctp_sf_shutdown_ack_sent_prm_abort( * o association id - local handle to the SCTP association * * o destination transport address - the transport address of the - * asociation on which a heartbeat should be issued. + * association on which a heartbeat should be issued. */ sctp_disposition_t sctp_sf_do_prm_requestheartbeat( const sctp_endpoint_t *ep, diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c index 4a368eb47073..020be17ba7bc 100644 --- a/net/sctp/ulpevent.c +++ b/net/sctp/ulpevent.c @@ -785,7 +785,7 @@ static void sctp_rcvmsg_rfree(struct sk_buff *skb) sctp_association_put(asoc); } -/* Charge receive window for bytes recieved. */ +/* Charge receive window for bytes received. */ static void sctp_ulpevent_set_owner_r(struct sk_buff *skb, sctp_association_t *asoc) { sctp_ulpevent_t *event; diff --git a/net/socket.c b/net/socket.c index 5e7636d1408a..9c65c518f8d7 100644 --- a/net/socket.c +++ b/net/socket.c @@ -83,9 +83,9 @@ #include <linux/kmod.h> #endif -#if defined(CONFIG_NET_RADIO) || defined(CONFIG_NET_PCMCIA_RADIO) +#ifdef CONFIG_NET_RADIO #include <linux/wireless.h> /* Note : will define WIRELESS_EXT */ -#endif /* CONFIG_NET_RADIO || CONFIG_NET_PCMCIA_RADIO */ +#endif /* CONFIG_NET_RADIO */ #include <asm/uaccess.h> diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index a5560fb1fc7f..93f02ef4b31a 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c @@ -163,7 +163,7 @@ unx_marshal(struct rpc_task *task, u32 *p, int ruid) memcpy(p, clnt->cl_nodename, n); p += (n + 3) >> 2; - /* Note: we don't use real uid if it involves raising priviledge */ + /* Note: we don't use real uid if it involves raising privilege */ if (ruid && cred->uc_puid != 0 && cred->uc_pgid != 0) { *p++ = htonl((u32) cred->uc_puid); *p++ = htonl((u32) cred->uc_pgid); diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c index 0ff419cbe595..12f6dc507758 100644 --- a/net/wanrouter/af_wanpipe.c +++ b/net/wanrouter/af_wanpipe.c @@ -388,7 +388,7 @@ static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk) /* Register the lcn on which incoming call came * from. Thus, if we have to clear it, we know - * whic lcn to clear + * which lcn to clear */ newwp->lcn = mbox_ptr->cmd.lcn; @@ -674,7 +674,7 @@ out_unlock: /*============================================================ * wanpipe_delayed_tarnsmit * - * Transmit bottom half handeler. It dequeues packets + * Transmit bottom half handler. It dequeues packets * from sk->write_queue and passes them to the * driver. If the driver is busy, the packet is * re-enqueued. diff --git a/scripts/README.Menuconfig b/scripts/README.Menuconfig index 75add2468d87..89ec0f24e14f 100644 --- a/scripts/README.Menuconfig +++ b/scripts/README.Menuconfig @@ -127,7 +127,7 @@ The windowing utility, lxdialog, will only be rebuilt if your kernel source tree is fresh, or changes are patched into it via a kernel patch or you do 'make mrproper'. If changes to lxdialog are patched in, most likely the rebuild time will be short. You may force a -complete rebuild of lxdialog by changing to it's directory and doing +complete rebuild of lxdialog by changing to its directory and doing 'make clean all' If you use Menuconfig in an XTERM window make sure you have your diff --git a/sound/core/device.c b/sound/core/device.c index 538daeb9e78b..ab57ca6b60aa 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -144,7 +144,7 @@ int snd_device_disconnect(snd_card_t *card, void *device_data) * Registers the device which was already created via * snd_device_new(). Usually this is called from snd_card_register(), * but it can be called later if any new devices are created after - * invokation of snd_card_register(). + * invocation of snd_card_register(). * * Returns zero if successful, or a negative error code on failure or if the * device not found. diff --git a/sound/core/seq/seq_midi_emul.c b/sound/core/seq/seq_midi_emul.c index 724ae8a0ccfc..921cdab10035 100644 --- a/sound/core/seq/seq_midi_emul.c +++ b/sound/core/seq/seq_midi_emul.c @@ -375,7 +375,7 @@ do_control(snd_midi_op_t *ops, void *drv, snd_midi_channel_set_t *chset, /* - * intialize the MIDI status + * initialize the MIDI status */ void snd_midi_channel_set_clear(snd_midi_channel_set_t *chset) diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c index a18c7107c2a9..8d5dccb1746b 100644 --- a/sound/core/seq/seq_timer.c +++ b/sound/core/seq/seq_timer.c @@ -401,7 +401,7 @@ snd_seq_real_time_t snd_seq_timer_get_cur_time(seq_timer_t *tmr) return cur_time; } -/* TODO: use interpolation on tick queue (will only be usefull for very +/* TODO: use interpolation on tick queue (will only be useful for very high PPQ values) */ snd_seq_tick_time_t snd_seq_timer_get_cur_tick(seq_timer_t *tmr) { diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index f8dc6a1a6078..9ba040bbaca5 100644 --- a/sound/drivers/mtpav.c +++ b/sound/drivers/mtpav.c @@ -102,7 +102,7 @@ MODULE_PARM_SYNTAX(hwports, SNDRV_ENABLED ",allows:{{1,8}},dialog:list"); /* * defines */ -//#define USE_FAKE_MTP // dont actually read/write to MTP device (for debugging without an actual unit) (does not work yet) +//#define USE_FAKE_MTP // don't actually read/write to MTP device (for debugging without an actual unit) (does not work yet) // parallel port usage masks #define SIGS_BYTE 0x08 @@ -763,7 +763,7 @@ static int __init alsa_card_mtpav_init(void) if (err < 0) goto __error; - err = snd_card_register(mtp_card->card); // dont snd_card_register until AFTER all cards reources done! + err = snd_card_register(mtp_card->card); // don't snd_card_register until AFTER all cards reources done! //printk("snd_card_register returned %d\n", err); if (err < 0) diff --git a/sound/i2c/l3/uda1341.c b/sound/i2c/l3/uda1341.c index 09342a8b9996..218c2c1d365e 100644 --- a/sound/i2c/l3/uda1341.c +++ b/sound/i2c/l3/uda1341.c @@ -494,7 +494,7 @@ static int snd_uda1341_info_enum(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * DEBUG_NAME(KERN_DEBUG "info_enum where: %d\n", where); - // this register we dont handle this way + // this register we don't handle this way if (!uda1341_enum_items[where]) return -EINVAL; diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c index 1fce6b4f60a8..01d6647c140e 100644 --- a/sound/isa/wavefront/wavefront_fx.c +++ b/sound/isa/wavefront/wavefront_fx.c @@ -227,7 +227,7 @@ snd_wavefront_fx_ioctl (snd_hwdep_t *sdev, struct file *file, This code was developed using DOSEMU. The Turtle Beach SETUPSND utility was run with I/O tracing in DOSEMU enabled, and a reconstruction of the port I/O done, using the Yamaha faxback document as a guide - to add more logic to the code. Its really pretty wierd. + to add more logic to the code. Its really pretty weird. There was an alternative approach of just dumping the whole I/O sequence as a series of port/value pairs and a simple loop @@ -692,7 +692,7 @@ snd_wavefront_fx_start (snd_wavefront_t *dev) return (0); } -/* wierd stuff, derived from port I/O tracing with dosemu */ +/* weird stuff, derived from port I/O tracing with dosemu */ static unsigned char page_zero[] __initdata = { 0x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00, diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index a3b5048e5aa6..9975f2e7619c 100644 --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c @@ -518,7 +518,7 @@ snd_wavefront_cmd (snd_wavefront_t *dev, /*********************************************************************** WaveFront data munging -Things here are wierd. All data written to the board cannot +Things here are weird. All data written to the board cannot have its most significant bit set. Any data item with values potentially > 0x7F (127) must be split across multiple bytes. @@ -527,7 +527,7 @@ the x86 side as 8-32 bit values. Sometimes, we need to munge data that is represented on the x86 side as an array of bytes. The most efficient approach to handling both cases seems to be to use 2 different functions for munging and 2 for de-munging. This avoids -wierd casting and worrying about bit-level offsets. +weird casting and worrying about bit-level offsets. **********************************************************************/ @@ -906,7 +906,7 @@ wavefront_send_sample (snd_wavefront_t *dev, if (header->size) { - /* XXX its a debatable point whether or not RDONLY semantics + /* XXX it's a debatable point whether or not RDONLY semantics on the ROM samples should cover just the sample data or the sample header. For now, it only covers the sample data, so anyone is free at all times to rewrite sample headers. @@ -1034,7 +1034,7 @@ wavefront_send_sample (snd_wavefront_t *dev, shptr = munge_int32 (*((u32 *) &header->hdr.s.sampleEndOffset), shptr, 4); - /* This one is truly wierd. What kind of wierdo decided that in + /* This one is truly weird. What kind of weirdo decided that in a system dominated by 16 and 32 bit integers, they would use a just 12 bits ? */ diff --git a/sound/oss/ad1816.c b/sound/oss/ad1816.c index c5418fd94040..2291a93a4d89 100644 --- a/sound/oss/ad1816.c +++ b/sound/oss/ad1816.c @@ -1227,7 +1227,7 @@ static void __exit unload_card(ad1816_info *devc) sound_free_dma(devc->dma_capture); } - /* card wont get added if resources could not be allocated + /* card won't get added if resources could not be allocated thus we need not ckeck if allocation was successful */ sound_free_dma (devc->dma_playback); free_irq(devc->irq, devc->osp); diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c index 0587a07c77b3..ea90aa0a1c7a 100644 --- a/sound/oss/ad1848.c +++ b/sound/oss/ad1848.c @@ -2987,7 +2987,7 @@ static struct pnp_dev *activate_dev(char *devname, char *resname, struct pnp_dev if (err < 0) return(NULL); - if((err = pnp_activate_dev(dev,NULL)) < 0) { + if((err = pnp_activate_dev(dev)) < 0) { printk(KERN_ERR "ad1848: %s %s config failed (out of resources?)[%d]\n", devname, resname, err); pnp_device_detach(dev); @@ -3024,7 +3024,7 @@ static struct pnp_dev *ad1848_init_generic(struct pnp_card *bus, struct address_ static int __init ad1848_isapnp_init(struct address_info *hw_config, struct pnp_card *bus, int slot) { - char *busname = bus->name[0] ? bus->name : ad1848_isapnp_list[slot].name; + char *busname = bus->dev.name[0] ? bus->dev.name : ad1848_isapnp_list[slot].name; /* Initialize this baby. */ diff --git a/sound/oss/awe_wave.c b/sound/oss/awe_wave.c index c3b11d866524..45a09495232a 100644 --- a/sound/oss/awe_wave.c +++ b/sound/oss/awe_wave.c @@ -562,7 +562,7 @@ static int __init _attach_awe(void) /* clear all samples */ awe_reset_samples(); - /* intialize AWE32 hardware */ + /* initialize AWE32 hardware */ awe_initialize(); sprintf(awe_info.name, "AWE32-%s (RAM%dk)", diff --git a/sound/oss/cs4232.c b/sound/oss/cs4232.c index 7d882eb283e8..6ba7dea7b7b5 100644 --- a/sound/oss/cs4232.c +++ b/sound/oss/cs4232.c @@ -127,7 +127,7 @@ int probe_cs4232(struct address_info *hw_config, int isapnp_configured) * method conflicts with possible PnP support in the OS. For this reason * driver is just a temporary kludge. * - * Also the Cirrus/Crystal method doesnt always work. Try ISA PnP first ;) + * Also the Cirrus/Crystal method doesn't always work. Try ISA PnP first ;) */ /* diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index a573b7f7a13e..161ab18430d1 100644 --- a/sound/oss/cs46xx.c +++ b/sound/oss/cs46xx.c @@ -1016,7 +1016,7 @@ static inline unsigned cs_get_dma_addr(struct cs_state *state) } /* - * ganularity is byte boundry, good part. + * ganularity is byte boundary, good part. */ if(dmabuf->enable & DAC_RUNNING) { diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c index 1a87e3a09720..28a767651b4b 100644 --- a/sound/oss/dmasound/dmasound_awacs.c +++ b/sound/oss/dmasound/dmasound_awacs.c @@ -1354,7 +1354,7 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when) case AWACS_DACA: wait_ms(10); /* Check this !!! */ daca_leave_sleep(); - break ; /* dont know how yet */ + break ; /* don't know how yet */ case AWACS_BURGUNDY: break ; case AWACS_SCREAMER: @@ -2960,7 +2960,7 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev); request_module("i2c-keywest"); #endif /* CONFIG_KMOD */ daca_init(); - break ; /* dont know how yet */ + break ; /* don't know how yet */ case AWACS_BURGUNDY: awacs_burgundy_init(); break ; diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c index fb36d662a8bc..54b795e2918e 100644 --- a/sound/oss/dmasound/dmasound_core.c +++ b/sound/oss/dmasound/dmasound_core.c @@ -1212,7 +1212,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd, return result ; break ; case SNDCTL_DSP_SPEED: - /* changing this on the fly will have wierd effects on the sound. + /* changing this on the fly will have weird effects on the sound. Where there are rate conversions implemented in soft form - it will cause the _ctx_xxx() functions to be substituted. However, there doesn't appear to be any reason to dis-allow it from diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c index d6d86436ea1f..2d85b75ba78e 100644 --- a/sound/oss/es1371.c +++ b/sound/oss/es1371.c @@ -73,7 +73,7 @@ * detect the ES1373 and later parts. * added AC97 #defines for readability * added a /proc file system for dumping hardware state - * updated SRC and CODEC w/r functions to accomodate bugs + * updated SRC and CODEC w/r functions to accommodate bugs * in some versions of the ES137x chips. * 31.08.1999 0.17 add spin_lock_init * replaced current->state = x with set_current_state(x) @@ -2863,7 +2863,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic if ((res=(s->dev_midi = register_sound_midi(&es1371_midi_fops, -1))<0 )) goto err_dev4; #ifdef ES1371_DEBUG - /* intialize the debug proc device */ + /* initialize the debug proc device */ s->ps = create_proc_read_entry("es1371",0,NULL,proc_es1371_dump,NULL); #endif /* ES1371_DEBUG */ diff --git a/sound/oss/ite8172.c b/sound/oss/ite8172.c index 3d9b3ceb17df..333c78fe384c 100644 --- a/sound/oss/ite8172.c +++ b/sound/oss/ite8172.c @@ -1780,7 +1780,7 @@ static int __devinit it8172_probe(struct pci_dev *pcidev, goto err_dev2; #ifdef IT8172_DEBUG - /* intialize the debug proc device */ + /* initialize the debug proc device */ s->ps = create_proc_read_entry(IT8172_MODULE_NAME, 0, NULL, proc_it8172_dump, NULL); #endif /* IT8172_DEBUG */ diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c index ab6a64d1558d..e1241f8b26de 100644 --- a/sound/oss/maestro.c +++ b/sound/oss/maestro.c @@ -252,7 +252,7 @@ static int debug=0; /* we try to setup 2^(dsps_order) /dev/dsp devices */ static int dsps_order=0; -/* wether or not we mess around with power management */ +/* whether or not we mess around with power management */ static int use_pm=2; /* set to 1 for force */ /* clocking for broken hardware - a few laptops seem to use a 50Khz clock ie insmod with clocking=50000 or so */ @@ -292,7 +292,7 @@ MODULE_PARM(clocking, "i"); /* changed so that I could actually find all the - references and fix them up. its a little more readable now. */ + references and fix them up. it's a little more readable now. */ #define ESS_FMT_STEREO 0x01 #define ESS_FMT_16BIT 0x02 #define ESS_FMT_MASK 0x03 @@ -804,7 +804,7 @@ ac97_recmask_io(struct ess_card *card, int read, int mask) if (read) return val; - /* oss can have many inputs, maestro cant. try + /* oss can have many inputs, maestro can't. try to pick the 'new' one */ if (mask != val) mask &= ~val; @@ -1518,7 +1518,7 @@ ess_rec_setup(struct ess_state *ess, int mode, u32 rate, void *buffer, int size) pa = virt_to_bus(buffer); } else { /* right channel records its split half. - *2 accomodates for rampant shifting earlier */ + *2 accommodates for rampant shifting earlier */ pa = virt_to_bus(buffer + size*2); } @@ -3271,7 +3271,7 @@ maestro_config(struct ess_card *card) outb(0x88, iobase+0x1f); /* it appears some maestros (dell 7500) only work if these are set, - regardless of wether we use the assp or not. */ + regardless of whether we use the assp or not. */ outb(0, iobase+0xA4); outb(3, iobase+0xA2); @@ -3507,7 +3507,7 @@ maestro_probe(struct pci_dev *pcidev,const struct pci_device_id *pdid) * or * - we're not a 2e, lesser chipps seem to have problems. * - we're not on our _very_ small whitelist. some implemenetations - * really dont' like the pm code, others require it. + * really don't like the pm code, others require it. * feel free to expand this as required. */ #define SUBSYSTEM_VENDOR(x) (x&0xffff) diff --git a/sound/oss/maestro3.c b/sound/oss/maestro3.c index 4a32c70b8d73..a6d8fea036f7 100644 --- a/sound/oss/maestro3.c +++ b/sound/oss/maestro3.c @@ -1916,8 +1916,8 @@ allocate_dmabuf(struct pci_dev *pci_dev, struct dmabuf *db) * the amazingly complicated prog_dmabuf wants it. * * pci_alloc_sonsistent guarantees that it won't cross a natural - * boundry; the m3 hardware can't have dma cross a 64k bus - * address boundry. + * boundary; the m3 hardware can't have dma cross a 64k bus + * address boundary. */ for (order = 16-PAGE_SHIFT; order >= 1; order--) { db->rawbuf = pci_alloc_consistent(pci_dev, PAGE_SIZE << order, diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c index 49e5ebf253cc..a9e688fd85be 100644 --- a/sound/oss/nec_vrc5477.c +++ b/sound/oss/nec_vrc5477.c @@ -1884,7 +1884,7 @@ static int __devinit vrc5477_ac97_probe(struct pci_dev *pcidev, goto err_dev2; #ifdef VRC5477_AC97_DEBUG - /* intialize the debug proc device */ + /* initialize the debug proc device */ s->ps = create_proc_read_entry(VRC5477_AC97_MODULE_NAME, 0, NULL, proc_vrc5477_ac97_dump, NULL); #endif /* VRC5477_AC97_DEBUG */ diff --git a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c index f749ec1cb9c7..000bf5ba5bf7 100644 --- a/sound/oss/opl3sa2.c +++ b/sound/oss/opl3sa2.c @@ -918,7 +918,7 @@ static int opl3sa2_suspend(struct pm_dev *pdev, unsigned char pm_mode) break; } - /* its supposed to automute before suspending, so we wont bother */ + /* its supposed to automute before suspending, so we won't bother */ opl3sa2_read(p->cfg_port, OPL3SA2_PM, &p->reg); opl3sa2_write(p->cfg_port, OPL3SA2_PM, p->reg | pm_mode); diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c index d71cb4840aff..e8d99ad90efe 100644 --- a/sound/oss/rme96xx.c +++ b/sound/oss/rme96xx.c @@ -1332,7 +1332,7 @@ static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd, file->f_flags |= O_NONBLOCK; return 0; - case SNDCTL_DSP_GETODELAY: /* What shold this exactly do ? , + case SNDCTL_DSP_GETODELAY: /* What should this exactly do ? , ATM it is just abinfo.bytes */ if (!(file->f_mode & FMODE_WRITE)) return -EINVAL; diff --git a/sound/oss/trident.c b/sound/oss/trident.c index 4aafa78438cd..8c4faf5b6a5c 100644 --- a/sound/oss/trident.c +++ b/sound/oss/trident.c @@ -19,6 +19,7 @@ * Ching-Ling Lee <cling-li@ali.com.tw> ALi 5451 Audio Core Support * Matt Wu <mattwu@acersoftech.com.cn> ALi 5451 Audio Core Support * Peter Wächtler <pwaechtler@loewe-komp.de> CyberPro5050 support + * Muli Ben-Yehuda <mulix@mulix.org> * * * This program is free software; you can redistribute it and/or modify @@ -81,7 +82,7 @@ * v0.14.9a * Aug 6 2001 Alan Cox * 0.14.9 crashed on rmmod due to a timer/bh left running. Simplified - * the existing logic (the BH doesnt help as ac97 is lock_irqsave) + * the existing logic (the BH doesn't help as ac97 is lock_irqsave) * and used del_timer_sync to clean up * Fixed a problem where the ALi change broke my generic card * v0.14.9 @@ -201,6 +202,7 @@ #include <linux/interrupt.h> #include <linux/pm.h> #include <linux/gameport.h> +#include <linux/kernel.h> #include <asm/uaccess.h> #include <asm/hardirq.h> #include <asm/io.h> @@ -538,8 +540,8 @@ static int trident_enable_loop_interrupts(struct trident_card * card) outl(global_control, TRID_REG(card, T4D_LFO_GC_CIR)); - TRDBG("trident: Enable Loop Interrupts, globctl = 0x%08X\n", - inl(TRID_REG(card, T4D_LFO_GC_CIR))); + pr_debug("trident: Enable Loop Interrupts, globctl = 0x%08X\n", + inl(TRID_REG(card, T4D_LFO_GC_CIR))); return (TRUE); } @@ -552,8 +554,8 @@ static int trident_disable_loop_interrupts(struct trident_card * card) global_control &= ~(ENDLP_IE | MIDLP_IE); outl(global_control, TRID_REG(card, T4D_LFO_GC_CIR)); - TRDBG("trident: Disabled Loop Interrupts, globctl = 0x%08X\n", - global_control); + pr_debug("trident: Disabled Loop Interrupts, globctl = 0x%08X\n", + global_control); return (TRUE); } @@ -570,8 +572,8 @@ static void trident_enable_voice_irq(struct trident_card * card, unsigned int ch #ifdef DEBUG reg = inl(TRID_REG(card, addr)); - TRDBG("trident: enabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n", - channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr); + pr_debug("trident: enabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n", + channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr); #endif /* DEBUG */ } @@ -590,8 +592,8 @@ static void trident_disable_voice_irq(struct trident_card * card, unsigned int c #ifdef DEBUG reg = inl(TRID_REG(card, addr)); - TRDBG("trident: disabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n", - channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr); + pr_debug("trident: disabled IRQ on channel %d, %s = 0x%08x(addr:%X)\n", + channel, addr==T4D_AINTEN_B? "AINTEN_B":"AINTEN_A",reg,addr); #endif /* DEBUG */ } @@ -609,8 +611,8 @@ static void trident_start_voice(struct trident_card * card, unsigned int channel #ifdef DEBUG reg = inl(TRID_REG(card, addr)); - TRDBG("trident: start voice on channel %d, %s = 0x%08x(addr:%X)\n", - channel, addr==T4D_START_B? "START_B":"START_A",reg,addr); + pr_debug("trident: start voice on channel %d, %s = 0x%08x(addr:%X)\n", + channel, addr==T4D_START_B? "START_B":"START_A",reg,addr); #endif /* DEBUG */ } @@ -628,8 +630,8 @@ static void trident_stop_voice(struct trident_card * card, unsigned int channel) #ifdef DEBUG reg = inl(TRID_REG(card, addr)); - TRDBG("trident: stop voice on channel %d, %s = 0x%08x(addr:%X)\n", - channel, addr==T4D_STOP_B? "STOP_B":"STOP_A",reg,addr); + pr_debug("trident: stop voice on channel %d, %s = 0x%08x(addr:%X)\n", + channel, addr==T4D_STOP_B? "STOP_B":"STOP_A",reg,addr); #endif /* DEBUG */ } @@ -647,8 +649,8 @@ static int trident_check_channel_interrupt(struct trident_card * card, unsigned #ifdef DEBUG if (reg & mask) - TRDBG("trident: channel %d has interrupt, %s = 0x%08x\n", - channel,reg==T4D_AINT_B? "AINT_B":"AINT_A", reg); + pr_debug("trident: channel %d has interrupt, %s = 0x%08x\n", + channel,reg==T4D_AINT_B? "AINT_B":"AINT_A", reg); #endif /* DEBUG */ return (reg & mask) ? TRUE : FALSE; } @@ -665,8 +667,8 @@ static void trident_ack_channel_interrupt(struct trident_card * card, unsigned i #ifdef DEBUG reg = inl(TRID_REG(card, T4D_AINT_B)); - TRDBG("trident: Ack channel %d interrupt, AINT_B = 0x%08x\n", - channel, reg); + pr_debug("trident: Ack channel %d interrupt, AINT_B = 0x%08x\n", + channel, reg); #endif /* DEBUG */ } @@ -914,7 +916,7 @@ static unsigned int trident_set_dac_rate(struct trident_state * state, unsigned trident_write_voice_regs(state); - TRDBG("trident: called trident_set_dac_rate : rate = %d\n", rate); + pr_debug("trident: called trident_set_dac_rate : rate = %d\n", rate); return rate; } @@ -934,7 +936,7 @@ static unsigned int trident_set_adc_rate(struct trident_state * state, unsigned trident_write_voice_regs(state); - TRDBG("trident: called trident_set_adc_rate : rate = %d\n", rate); + pr_debug("trident: called trident_set_adc_rate : rate = %d\n", rate); return rate; } @@ -978,9 +980,9 @@ static void trident_play_setup(struct trident_state *state) /* stereo */ channel->control |= CHANNEL_STEREO; - TRDBG("trident: trident_play_setup, LBA = 0x%08x, " - "Delta = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n", - channel->lba, channel->delta, channel->eso, channel->control); + pr_debug("trident: trident_play_setup, LBA = 0x%08x, " + "Delta = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n", + channel->lba, channel->delta, channel->eso, channel->control); trident_write_voice_regs(state); } @@ -1064,9 +1066,9 @@ static void trident_rec_setup(struct trident_state *state) /* stereo */ channel->control |= CHANNEL_STEREO; - TRDBG("trident: trident_rec_setup, LBA = 0x%08x, " - "Delat = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n", - channel->lba, channel->delta, channel->eso, channel->control); + pr_debug("trident: trident_rec_setup, LBA = 0x%08x, " + "Delta = 0x%08x, ESO = 0x%08x, Control = 0x%08x\n", + channel->lba, channel->delta, channel->eso, channel->control); trident_write_voice_regs(state); } @@ -1101,8 +1103,8 @@ static inline unsigned trident_get_dma_addr(struct trident_state *state) } - TRDBG("trident: trident_get_dma_addr: chip reported channel: %d, " - "cso = 0x%04x\n", dmabuf->channel->num, cso); + pr_debug("trident: trident_get_dma_addr: chip reported channel: %d, " + "cso = 0x%04x\n", dmabuf->channel->num, cso); /* ESO and CSO are in units of Samples, convert to byte offset */ cso <<= sample_shift[dmabuf->fmt]; @@ -1211,8 +1213,8 @@ static int alloc_dmabuf(struct dmabuf* dmabuf, struct pci_dev* pci_dev, int orde &dmabuf->dma_handle))) return -ENOMEM; - TRDBG("trident: allocated %ld (order = %d) bytes at %p\n", - PAGE_SIZE << order, order, rawbuf); + pr_debug("trident: allocated %ld (order = %d) bytes at %p\n", + PAGE_SIZE << order, order, rawbuf); dmabuf->ready = dmabuf->mapped = 0; dmabuf->rawbuf = rawbuf; @@ -1349,10 +1351,11 @@ static int prog_dmabuf(struct trident_state *state, unsigned rec) /* set the ready flag for the dma buffer */ dmabuf->ready = 1; - TRDBG("trident: prog_dmabuf(%d), sample rate = %d, format = %d, numfrag = %d, " - "fragsize = %d dmasize = %d\n", - dmabuf->channel->num, dmabuf->rate, dmabuf->fmt, dmabuf->numfrag, - dmabuf->fragsize, dmabuf->dmasize); + pr_debug("trident: prog_dmabuf(%d), sample rate = %d, " + "format = %d, numfrag = %d, fragsize = %d " + "dmasize = %d\n", dmabuf->channel->num, dmabuf->rate, + dmabuf->fmt, dmabuf->numfrag, dmabuf->fragsize, + dmabuf->dmasize); } unlock_set_fmt(state); return 0; @@ -1704,7 +1707,7 @@ static void cyber_address_interrupt(struct trident_card *card) /* FIXED: read interrupt status only once */ irq_status=inl(TRID_REG(card, T4D_AINT_A) ); - TRDBG("cyber_address_interrupt: irq_status 0x%X\n",irq_status); + pr_debug("cyber_address_interrupt: irq_status 0x%X\n",irq_status); for (i = 0; i < NR_HW_CH; i++) { channel = 31 - i; @@ -1712,7 +1715,7 @@ static void cyber_address_interrupt(struct trident_card *card) /* clear bit by writing a 1, zeroes are ignored */ outl( (1 << channel), TRID_REG(card, T4D_AINT_A)); - TRDBG("cyber_interrupt: channel %d\n", channel); + pr_debug("cyber_interrupt: channel %d\n", channel); if ((state = card->states[i]) != NULL) { trident_update_ptr(state); @@ -1735,7 +1738,7 @@ static void trident_interrupt(int irq, void *dev_id, struct pt_regs *regs) spin_lock(&card->lock); event = inl(TRID_REG(card, T4D_MISCINT)); - TRDBG("trident: trident_interrupt called, MISCINT = 0x%08x\n", event); + pr_debug("trident: trident_interrupt called, MISCINT = 0x%08x\n", event); if (event & ADDRESS_IRQ) { card->address_interrupt(card); @@ -1773,7 +1776,7 @@ static ssize_t trident_read(struct file *file, char *buffer, size_t count, loff_ unsigned swptr; int cnt; - TRDBG("trident: trident_read called, count = %d\n", count); + pr_debug("trident: trident_read called, count = %d\n", count); VALIDATE_STATE(state); if (ppos != &file->f_pos) @@ -1827,7 +1830,7 @@ static ssize_t trident_read(struct file *file, char *buffer, size_t count, loff_ which results in a (potential) buffer overrun. And worse, there is NOTHING we can do to prevent it. */ if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) { - TRDBG(KERN_ERR "trident: recording schedule timeout, " + pr_debug(KERN_ERR "trident: recording schedule timeout, " "dmasz %u fragsz %u count %i hwptr %u swptr %u\n", dmabuf->dmasize, dmabuf->fragsize, dmabuf->count, dmabuf->hwptr, dmabuf->swptr); @@ -1885,7 +1888,7 @@ static ssize_t trident_write(struct file *file, const char *buffer, size_t count unsigned int state_cnt; unsigned int copy_count; - TRDBG("trident: trident_write called, count = %d\n", count); + pr_debug("trident: trident_write called, count = %d\n", count); VALIDATE_STATE(state); if (ppos != &file->f_pos) @@ -1954,7 +1957,7 @@ static ssize_t trident_write(struct file *file, const char *buffer, size_t count which results in a (potential) buffer underrun. And worse, there is NOTHING we can do to prevent it. */ if (!interruptible_sleep_on_timeout(&dmabuf->wait, tmo)) { - TRDBG(KERN_ERR "trident: playback schedule timeout, " + pr_debug(KERN_ERR "trident: playback schedule timeout, " "dmasz %u fragsz %u count %i hwptr %u swptr %u\n", dmabuf->dmasize, dmabuf->fragsize, dmabuf->count, dmabuf->hwptr, dmabuf->swptr); @@ -2137,7 +2140,7 @@ static int trident_ioctl(struct inode *inode, struct file *file, unsigned int cm VALIDATE_STATE(state); mapped = ((file->f_mode & FMODE_WRITE) && dmabuf->mapped) || ((file->f_mode & FMODE_READ) && dmabuf->mapped); - TRDBG("trident: trident_ioctl, command = %2d, arg = 0x%08x\n", + pr_debug("trident: trident_ioctl, command = %2d, arg = 0x%08x\n", _IOC_NR(cmd), arg ? *(int *)arg : 0); switch (cmd) @@ -2702,7 +2705,7 @@ static int trident_open(struct inode *inode, struct file *file) state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE); up(&card->open_sem); - TRDBG("trident: open virtual channel %d, hard channel %d\n", + pr_debug("trident: open virtual channel %d, hard channel %d\n", state->virt, dmabuf->channel->num); return 0; @@ -2724,7 +2727,7 @@ static int trident_release(struct inode *inode, struct file *file) drain_dac(state, file->f_flags & O_NONBLOCK); } - TRDBG("trident: closing virtual channel %d, hard channel %d\n", + pr_debug("trident: closing virtual channel %d, hard channel %d\n", state->virt, dmabuf->channel->num); /* stop DMA state machine and free DMA buffers/channels */ @@ -2923,7 +2926,7 @@ static int acquirecodecaccess(struct trident_card *card) } if(!block) { - TRDBG("accesscodecsemaphore: try unlock\n"); + pr_debug("accesscodecsemaphore: try unlock\n"); block = 1; goto unlock; } @@ -3002,7 +3005,7 @@ static u16 ali_ac97_get(struct trident_card *card, int secondary, u8 reg) if(ncount <=0) break; if(ncount--==1) { - TRDBG("ali_ac97_read :try clear busy flag\n"); + pr_debug("ali_ac97_read :try clear busy flag\n"); aud_reg = inl(TRID_REG(card, ALI_AC97_WRITE)); outl((aud_reg & 0xffff7fff), TRID_REG(card, ALI_AC97_WRITE)); } @@ -3061,7 +3064,7 @@ static void ali_ac97_set(struct trident_card *card, int secondary, u8 reg, u16 v if(ncount <= 0) break; if(ncount-- == 1) { - TRDBG("ali_ac97_set :try clear busy flag!!\n"); + pr_debug("ali_ac97_set :try clear busy flag!!\n"); outw(wcontrol & 0x7fff, TRID_REG(card, ALI_AC97_WRITE)); } udelay(10); @@ -3933,8 +3936,10 @@ static int ali_reset_5451(struct trident_card *card) udelay(5000); } - printk(KERN_ERR "ALi 5451 did not come out of reset.\n"); - return 1; + /* This is non fatal if you have a non PM capable codec.. */ + printk(KERN_ERR "ALi 5451 did not come out of reset " + "- continuing anyway.\n"); + return 0; } /* AC97 codec initialisation. */ diff --git a/sound/oss/trident.h b/sound/oss/trident.h index d9d8572d9c32..308bf979cb8c 100644 --- a/sound/oss/trident.h +++ b/sound/oss/trident.h @@ -360,16 +360,4 @@ static inline unsigned ld2(unsigned int x) return r; } -#ifdef DEBUG - -#define TRDBG(msg, args...) do { \ - printk(KERN_DEBUG msg , ##args ); \ -} while (0) - -#else /* !defined(DEBUG) */ - -#define TRDBG(msg, args...) do { } while (0) - -#endif /* DEBUG */ - #endif /* __TRID4DWAVE_H */ diff --git a/sound/oss/wavfront.c b/sound/oss/wavfront.c index f3d8339bd141..1a49ecfaf76c 100644 --- a/sound/oss/wavfront.c +++ b/sound/oss/wavfront.c @@ -95,7 +95,7 @@ I consider /dev/sequencer to be an anachronism, but given its widespread usage by various Linux MIDI software, it seems worth - offering support to it if its not too painful. Instead of using + offering support to it if it's not too painful. Instead of using /dev/sequencer, I recommend: for synth programming and patch loading: /dev/synthNN @@ -1041,7 +1041,7 @@ wavefront_send_sample (wavefront_patch_info *header, if (header->size) { - /* XXX its a debatable point whether or not RDONLY semantics + /* XXX it's a debatable point whether or not RDONLY semantics on the ROM samples should cover just the sample data or the sample header. For now, it only covers the sample data, so anyone is free at all times to rewrite sample headers. diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 27e762be7217..3a2ad9bdb9f7 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -966,7 +966,7 @@ static void snd_ali_update_ptr(ali_t *codec,int channel) pchregs = &(codec->chregs); - // check if interrupt occured for channel + // check if interrupt occurred for channel old = pchregs->data.aint; mask = ((unsigned int) 1L) << (channel & 0x1f); diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 2eefcdf9606a..9ce304569dc3 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -24,7 +24,7 @@ * * FINALLY: A credit to the developers Tom and Jordan * at Cirrus for have helping me out with the DSP, however we - * still dont have sufficient documentation and technical + * still don't have sufficient documentation and technical * references to be able to implement all fancy feutures * supported by the cs46xx DSP's. * Benny <benny@hostmobility.com> @@ -2401,7 +2401,7 @@ static void snd_cs46xx_sec_codec_reset (ac97_t * ac97) schedule_timeout(HZ/100); } while (time_after_eq(end_time, jiffies)); - snd_printk("CS46xx secondary codec dont respond!\n"); + snd_printk("CS46xx secondary codec don't respond!\n"); } #endif diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 7e8fa173e11f..d87313c4b95a 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c @@ -181,7 +181,7 @@ void cs46xx_dsp_remove_scb (cs46xx_t *chip, dsp_scb_descriptor_t * scb) (ins->scbs + scb->index) == scb), return ); #if 0 - /* cant remove a SCB with childs before + /* can't remove a SCB with childs before removing childs first */ snd_assert ( (scb->sub_list_ptr == ins->the_null_scb && scb->next_scb_ptr == ins->the_null_scb), @@ -1540,7 +1540,7 @@ int cs46xx_dsp_enable_spdif_out (cs46xx_t *chip) cs46xx_dsp_enable_spdif_hw (chip); } - /* dont touch anything if SPDIF is open */ + /* don't touch anything if SPDIF is open */ if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) { /* when cs46xx_iec958_post_close(...) is called it will call this function if necessary depending on @@ -1584,7 +1584,7 @@ int cs46xx_dsp_disable_spdif_out (cs46xx_t *chip) { dsp_spos_instance_t * ins = chip->dsp_spos_instance; - /* dont touch anything if SPDIF is open */ + /* don't touch anything if SPDIF is open */ if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) { ins->spdif_status_out &= ~DSP_SPDIF_STATUS_OUTPUT_ENABLED; return -EBUSY; diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 64777a04ba4c..45ea0d7649ae 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -161,7 +161,7 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); #define ES_1370_CSTAT (1<<10) /* CODEC is busy or register write in progress */ #define ES_1370_CBUSY (1<<9) /* CODEC is busy */ #define ES_1370_CWRIP (1<<8) /* CODEC register write in progress */ -#define ES_1371_SYNC_ERR (1<<8) /* CODEC synchronization error occured */ +#define ES_1371_SYNC_ERR (1<<8) /* CODEC synchronization error occurred */ #define ES_1371_VC(i) (((i)>>6)&0x03) /* voice code from CCB module */ #define ES_1370_VC(i) (((i)>>5)&0x03) /* voice code from CCB module */ #define ES_1371_MPWR (1<<5) /* power level interrupt pending */ @@ -172,8 +172,8 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); #define ES_ADC (1<<0) /* ADC channel interrupt pending */ #define ES_REG_UART_DATA 0x08 /* R/W: UART data register */ #define ES_REG_UART_STATUS 0x09 /* R/O: UART status register */ -#define ES_RXINT (1<<7) /* RX interrupt occured */ -#define ES_TXINT (1<<2) /* TX interrupt occured */ +#define ES_RXINT (1<<7) /* RX interrupt occurred */ +#define ES_TXINT (1<<2) /* TX interrupt occurred */ #define ES_TXRDY (1<<1) /* transmitter ready */ #define ES_RXRDY (1<<0) /* receiver ready */ #define ES_REG_UART_CONTROL 0x09 /* W/O: UART control register */ diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index f3dd6b0082da..37f077453334 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -2329,7 +2329,7 @@ static void snd_es1968_chip_init(es1968_t *chip) outb(0x88, iobase+0x1f); /* it appears some maestros (dell 7500) only work if these are set, - regardless of wether we use the assp or not. */ + regardless of whether we use the assp or not. */ outb(0, iobase + ASSP_CONTROL_B); outb(3, iobase + ASSP_CONTROL_A); /* M: Reserved bits... */ diff --git a/sound/sound_core.c b/sound/sound_core.c index 232ce05e0e44..d958a30a56d4 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c @@ -14,7 +14,7 @@ * -------------------- * * Top level handler for the sound subsystem. Various devices can - * plug into this. The fact they dont all go via OSS doesn't mean + * plug into this. The fact they don't all go via OSS doesn't mean * they don't have to implement the OSS API. There is a lot of logic * to keeping much of the OSS weight out of the code in a compatibility * module, but it's up to the driver to rember to load it... diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 0447deec7bf8..a5f2347394f2 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -1717,7 +1717,7 @@ static void proc_pcm_format_add(snd_usb_stream_t *stream) /* - * intialize the substream instance. + * initialize the substream instance. */ static void init_substream(snd_usb_stream_t *as, int stream, struct audioformat *fp) |
