summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2002-11-25 03:18:45 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-11-25 03:18:45 -0800
commitde5b180bb8020e230209dbc1e47c7750e780e00a (patch)
treee5b4d43ab675476c953d825d605d25703f84596c
parent9eb7fd948c161b9002628177cf19da39c66637ea (diff)
parentdb891a76c76048fd29c758984fb78387d1e72fc8 (diff)
Merge
-rw-r--r--CREDITS9
-rwxr-xr-xDocumentation/BK-usage/unbz64wrap2
-rw-r--r--Makefile5
-rw-r--r--arch/i386/Kconfig14
-rw-r--r--arch/i386/kernel/semaphore.c24
-rw-r--r--arch/sh/kernel/hd64465_gpio.c17
-rw-r--r--drivers/char/cyclades.c4
-rw-r--r--drivers/char/rio/riocmd.c4
-rw-r--r--drivers/char/rocket.c12
-rw-r--r--drivers/char/sx.c35
-rw-r--r--drivers/char/sx.h2
-rw-r--r--drivers/char/sxboards.h24
-rw-r--r--drivers/char/synclink.c8
-rw-r--r--drivers/char/watchdog/sbc60xxwdt.c7
-rw-r--r--drivers/i2c/i2c-dev.c6
-rw-r--r--drivers/isdn/pcbit/capi.h3
-rw-r--r--drivers/macintosh/via-pmu.c2
-rw-r--r--drivers/media/radio/radio-sf16fmi.c17
-rw-r--r--drivers/media/video/bw-qcam.c12
-rw-r--r--drivers/media/video/pms.c4
-rw-r--r--drivers/media/video/stradis.c3
-rw-r--r--drivers/media/video/w9966.c2
-rw-r--r--drivers/media/video/zr36067.c4
-rw-r--r--drivers/message/i2o/i2o_scsi.c13
-rw-r--r--drivers/net/appletalk/ltpc.c29
-rw-r--r--drivers/net/de600.c5
-rw-r--r--drivers/net/fc/iph5526.c4
-rw-r--r--drivers/net/irda/ali-ircc.c4
-rw-r--r--drivers/net/macsonic.c1
-rw-r--r--drivers/net/myri_sbus.c2
-rw-r--r--drivers/net/pppoe.c6
-rw-r--r--drivers/net/sunbmac.c1
-rw-r--r--drivers/net/tokenring/madgemc.c6
-rw-r--r--drivers/net/wan/cosa.c15
-rw-r--r--drivers/net/wan/sbni.c9
-rw-r--r--drivers/net/wan/sdla_fr.c11
-rw-r--r--drivers/net/wireless/airo_cs.c5
-rw-r--r--drivers/parport/ChangeLog39
-rw-r--r--drivers/parport/parport_pc.c3
-rw-r--r--drivers/parport/parport_serial.c56
-rw-r--r--drivers/pci/setup-bus.c8
-rw-r--r--drivers/pcmcia/cardbus.c3
-rw-r--r--drivers/pcmcia/tcic.c13
-rw-r--r--drivers/scsi/aic7xxx/aic7770.c8
-rw-r--r--drivers/scsi/inia100.c6
-rw-r--r--drivers/scsi/ips.c4
-rw-r--r--drivers/scsi/scsi_scan.c7
-rw-r--r--drivers/scsi/sg.c4
-rw-r--r--drivers/video/fbcon.c5
-rw-r--r--fs/file_table.c4
-rw-r--r--fs/hpfs/hpfs_fn.h36
-rw-r--r--fs/qnx4/inode.c4
-rw-r--r--include/asm-alpha/processor.h1
-rw-r--r--include/asm-i386/string-486.h617
-rw-r--r--include/asm-i386/string.h7
-rw-r--r--include/asm-i386/system.h7
-rw-r--r--include/asm-ia64/processor.h1
-rw-r--r--include/asm-sh/processor.h1
-rw-r--r--include/asm-sparc/processor.h1
-rw-r--r--include/asm-sparc64/processor.h1
-rw-r--r--include/linux/kernel.h2
-rw-r--r--kernel/exit.c6
-rw-r--r--kernel/ksyms.c2
-rw-r--r--kernel/sched.c2
-rw-r--r--kernel/sys.c2
-rw-r--r--net/atm/proc.c7
-rw-r--r--sound/oss/Makefile2
-rw-r--r--sound/oss/cmpci.c4
-rw-r--r--sound/oss/cs4232.c3
-rw-r--r--sound/oss/es1370.c6
-rw-r--r--sound/oss/es1371.c7
-rw-r--r--sound/oss/esssolo1.c4
-rw-r--r--sound/oss/i810_audio.c30
-rw-r--r--sound/oss/maestro.c4
-rw-r--r--sound/oss/maestro3.c4
-rw-r--r--sound/oss/mpu401.c70
-rw-r--r--sound/oss/nm256_audio.c2
-rw-r--r--sound/oss/pss.c2
-rw-r--r--sound/oss/sb_audio.c4
-rw-r--r--sound/oss/sb_card.c2
-rw-r--r--sound/oss/sonicvibes.c2
-rw-r--r--sound/oss/ymfpci.c2
82 files changed, 500 insertions, 836 deletions
diff --git a/CREDITS b/CREDITS
index 398cc2967eeb..ce9e8a35768c 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1507,16 +1507,17 @@ S: Chapel Hill, North Carolina 27514-4818
S: USA
N: Dave Jones
+E: davej@codemonkey.org.uk
E: davej@suse.de
W: http://www.codemonkey.org.uk
D: x86 errata/setup maintenance.
D: Backport/Forwardport merge monkey.
D: Various Janitor work.
S: c/o SuSE Linux UK Ltd
-S: The Kinetic Centre
-S: Theobald Street
-S: Borehamwood
-S: Herts, WD6 4PJ
+S: Appleton House
+S: 139 King Street
+S: Hammersmith
+S: W6 9JG
S: United Kingdom
N: Ani Joshi
diff --git a/Documentation/BK-usage/unbz64wrap b/Documentation/BK-usage/unbz64wrap
index ccef3dd267c7..4fc3e73e9a81 100755
--- a/Documentation/BK-usage/unbz64wrap
+++ b/Documentation/BK-usage/unbz64wrap
@@ -15,7 +15,7 @@ if mimencode -u < /dev/null > /dev/null 2>&1 ; then
case $LINE in
begin-base64*) SHOW=YES ;;
====) SHOW= ;;
- *) [ "$SHOW" ] && echo $LINE ;;
+ *) [ "$SHOW" ] && echo "$LINE" ;;
esac
done | mimencode -u | bunzip2
exit $?
diff --git a/Makefile b/Makefile
index e9d34e1f81e7..7708c84f2a3b 100644
--- a/Makefile
+++ b/Makefile
@@ -168,7 +168,10 @@ NOSTDINC_FLAGS = -nostdinc -iwithprefix include
CPPFLAGS := -D__KERNEL__ -Iinclude
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
- -fomit-frame-pointer -fno-strict-aliasing -fno-common
+ -fno-strict-aliasing -fno-common
+ifndef CONFIG_FRAME_POINTER
+CFLAGS += -fomit-frame-pointer
+endif
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 68b6c67d7044..cf8b7fb50fad 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -1612,6 +1612,20 @@ config KALLSYMS
symbolic stack backtraces. This increases the size of the kernel
somewhat, as all symbols have to be loaded into the kernel image.
+config DEBUG_SPINLOCK_SLEEP
+ bool "Sleep-inside-spinlock checking"
+ help
+ If you say Y here, various routines which may sleep will become very
+ noisy if they are called with a spinlock held.
+
+config FRAME_POINTER
+ bool "Compile the kernel with frame pointers"
+ help
+ If you say Y here the resulting kernel image will be slightly larger
+ and slower, but it will give very useful debugging information.
+ If you don't debug the kernel, you can say N, but we may not be able
+ to solve problems without frame pointers.
+
config X86_EXTRA_IRQS
bool
depends on X86_LOCAL_APIC
diff --git a/arch/i386/kernel/semaphore.c b/arch/i386/kernel/semaphore.c
index e015553534fc..dcdb19179640 100644
--- a/arch/i386/kernel/semaphore.c
+++ b/arch/i386/kernel/semaphore.c
@@ -191,6 +191,10 @@ asm(
".align 4\n"
".globl __down_failed\n"
"__down_failed:\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "pushl %ebp\n\t"
+ "movl %esp,%ebp\n\t"
+#endif
"pushl %eax\n\t"
"pushl %edx\n\t"
"pushl %ecx\n\t"
@@ -198,6 +202,10 @@ asm(
"popl %ecx\n\t"
"popl %edx\n\t"
"popl %eax\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "movl %ebp,%esp\n\t"
+ "popl %ebp\n\t"
+#endif
"ret"
);
@@ -206,11 +214,19 @@ asm(
".align 4\n"
".globl __down_failed_interruptible\n"
"__down_failed_interruptible:\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "pushl %ebp\n\t"
+ "movl %esp,%ebp\n\t"
+#endif
"pushl %edx\n\t"
"pushl %ecx\n\t"
"call __down_interruptible\n\t"
"popl %ecx\n\t"
"popl %edx\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "movl %ebp,%esp\n\t"
+ "popl %ebp\n\t"
+#endif
"ret"
);
@@ -219,11 +235,19 @@ asm(
".align 4\n"
".globl __down_failed_trylock\n"
"__down_failed_trylock:\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "pushl %ebp\n\t"
+ "movl %esp,%ebp\n\t"
+#endif
"pushl %edx\n\t"
"pushl %ecx\n\t"
"call __down_trylock\n\t"
"popl %ecx\n\t"
"popl %edx\n\t"
+#if defined(CONFIG_FRAME_POINTER)
+ "movl %ebp,%esp\n\t"
+ "popl %ebp\n\t"
+#endif
"ret"
);
diff --git a/arch/sh/kernel/hd64465_gpio.c b/arch/sh/kernel/hd64465_gpio.c
index 6b9e511dd143..594c73b4bf4f 100644
--- a/arch/sh/kernel/hd64465_gpio.c
+++ b/arch/sh/kernel/hd64465_gpio.c
@@ -165,12 +165,19 @@ void hd64465_gpio_unregister_irq(int portpin)
static int __init hd64465_gpio_init(void)
{
- /* TODO: check return values */
- request_region(HD64465_REG_GPACR, 0x1000, MODNAME);
- request_irq(HD64465_IRQ_GPIO, hd64465_gpio_interrupt,
- SA_INTERRUPT, MODNAME, 0);
+ int err;
+
+ if (!request_region(HD64465_REG_GPACR, 0x1000, MODNAME))
+ return -EIO;
+ err = request_irq (HD64465_IRQ_GPIO, hd64465_gpio_interrupt,
+ SA_INTERRUPT, MODNAME, 0);
+ if (err) {
+ printk(KERN_ERR"HD64465: Unable to get irq %d.\n", HD64465_IRQ_GPIO);
+ release_region(HD64465_REG_GPACR, 0x1000);
+ return err;
+ }
- printk("HD64465 GPIO layer on irq %d\n", HD64465_IRQ_GPIO);
+ printk("HD64465 GPIO layer on irq %d\n", HD64465_IRQ_GPIO);
return 0;
}
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 13c818bce78f..46e69b2b9636 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -3434,8 +3434,8 @@ set_line_char(struct cyclades_port * info)
}
#ifdef CY_DEBUG_DTR
printk("cyc:set_line_char dropping DTR\n");
- printk(" status: 0x%x,
- 0x%x\n", cy_readb(base_addr+(CyMSVR1<<index)),
+ printk(" status: 0x%x, 0x%x\n",
+ cy_readb(base_addr+(CyMSVR1<<index)),
cy_readb(base_addr+(CyMSVR2<<index)));
#endif
}else{
diff --git a/drivers/char/rio/riocmd.c b/drivers/char/rio/riocmd.c
index 5e5e95adf182..801c57259644 100644
--- a/drivers/char/rio/riocmd.c
+++ b/drivers/char/rio/riocmd.c
@@ -462,8 +462,8 @@ PKT *PacketP;
rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Length 0x%x (%d)\n", PacketP->len,PacketP->len );
rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", PacketP->control, PacketP->control);
rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Check 0x%x (%d)\n", PacketP->csum, PacketP->csum );
- rio_dprintk (RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x,
- Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command );
+ rio_dprintk (RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, "
+ "Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command );
return TRUE;
}
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 979457616c0b..5c3b4b600761 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -1330,7 +1330,7 @@ static char *rp_tty_name(struct tty_struct *tty, char *buf)
{
if (tty)
sprintf(buf, "%s%d", tty->driver.name,
- MINOR(tty->device) - tty->driver.minor_start +
+ minor(tty->device) - tty->driver.minor_start +
tty->driver.name_base);
else
strcpy(buf, "NULL tty");
@@ -1794,6 +1794,10 @@ int __init register_PCI(int i, unsigned int bus, unsigned int device_fn)
str = "8-port Modem";
max_num_aiops = 1;
break;
+ case 0x8:
+ str = "mysterious 8 port";
+ max_num_aiops = 1;
+ break;
default:
str = "(unknown/unsupported)";
max_num_aiops = 0;
@@ -1872,6 +1876,10 @@ static int __init init_PCI(int boards_found)
PCI_DEVICE_ID_RP8M, i, &bus, &device_fn))
if(register_PCI(count+boards_found, bus, device_fn))
count++;
+ if(!pcibios_find_device(PCI_VENDOR_ID_RP,
+ 0x8, i, &bus, &device_fn))
+ if(register_PCI(count+boards_found, bus, device_fn))
+ count++;
}
return(count);
}
@@ -2072,6 +2080,7 @@ int __init rp_init(void)
if (retval < 0) {
printk("Couldn't install Rocketport callout driver "
"(error %d)\n", -retval);
+ release_region(controller, 4);
return -1;
}
@@ -2079,6 +2088,7 @@ int __init rp_init(void)
if (retval < 0) {
printk("Couldn't install tty Rocketport driver "
"(error %d)\n", -retval);
+ release_region(controller, 4);
return -1;
}
#ifdef ROCKET_DEBUG_OPEN
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index f67a1f8659c1..6698a20041b0 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -353,9 +353,11 @@ static int sx_probe_addrs[]= {0xc0000, 0xd0000, 0xe0000,
0xc8000, 0xd8000, 0xe8000};
static int si_probe_addrs[]= {0xc0000, 0xd0000, 0xe0000,
0xc8000, 0xd8000, 0xe8000, 0xa0000};
+static int si1_probe_addrs[]= { 0xd0000};
#define NR_SX_ADDRS (sizeof(sx_probe_addrs)/sizeof (int))
#define NR_SI_ADDRS (sizeof(si_probe_addrs)/sizeof (int))
+#define NR_SI1_ADDRS (sizeof(si1_probe_addrs)/sizeof (int))
/* Set the mask to all-ones. This alas, only supports 32 interrupts.
@@ -582,6 +584,8 @@ static int sx_reset (struct sx_board *board)
}
} else if (IS_EISA_BOARD(board)) {
outb(board->irq<<4, board->eisa_base+0xc02);
+ } else if (IS_SI1_BOARD(board)) {
+ write_sx_byte (board, SI1_ISA_RESET, 0); // value does not matter
} else {
/* Gory details of the SI/ISA board */
write_sx_byte (board, SI2_ISA_RESET, SI2_ISA_RESET_SET);
@@ -656,6 +660,9 @@ static int sx_start_board (struct sx_board *board)
} else if (IS_EISA_BOARD(board)) {
write_sx_byte(board, SI2_EISA_OFF, SI2_EISA_VAL);
outb((board->irq<<4)|4, board->eisa_base+0xc02);
+ } else if (IS_SI1_BOARD(board)) {
+ write_sx_byte (board, SI1_ISA_RESET_CLEAR, 0);
+ write_sx_byte (board, SI1_ISA_INTCL, 0);
} else {
/* Don't bug me about the clear_set.
I haven't the foggiest idea what it's about -- REW */
@@ -681,6 +688,9 @@ static int sx_start_interrupts (struct sx_board *board)
SX_CONF_HOSTIRQ);
} else if (IS_EISA_BOARD(board)) {
inb(board->eisa_base+0xc03);
+ } else if (IS_SI1_BOARD(board)) {
+ write_sx_byte (board, SI1_ISA_INTCL,0);
+ write_sx_byte (board, SI1_ISA_INTCL_CLEAR,0);
} else {
switch (board->irq) {
case 11:write_sx_byte (board, SI2_ISA_IRQ11, SI2_ISA_IRQ11_SET);break;
@@ -1690,6 +1700,7 @@ static int sx_fw_ioctl (struct inode *inode, struct file *filp,
if (IS_SX_BOARD (board)) rc = SX_TYPE_SX;
if (IS_CF_BOARD (board)) rc = SX_TYPE_CF;
if (IS_SI_BOARD (board)) rc = SX_TYPE_SI;
+ if (IS_SI1_BOARD (board)) rc = SX_TYPE_SI;
if (IS_EISA_BOARD (board)) rc = SX_TYPE_SI;
sx_dprintk (SX_DEBUG_FIRMWARE, "returning type= %d\n", rc);
break;
@@ -2184,13 +2195,20 @@ static int probe_si (struct sx_board *board)
int i;
func_enter();
- sx_dprintk (SX_DEBUG_PROBE, "Going to verify SI signature %lx.\n",
+ sx_dprintk (SX_DEBUG_PROBE, "Going to verify SI signature hw %lx at %lx.\n", board->hw_base,
board->base + SI2_ISA_ID_BASE);
if (sx_debug & SX_DEBUG_PROBE)
my_hd ((char *)(board->base + SI2_ISA_ID_BASE), 0x8);
if (!IS_EISA_BOARD(board)) {
+ if( IS_SI1_BOARD(board) )
+ {
+ for (i=0;i<8;i++) {
+ write_sx_byte (board, SI2_ISA_ID_BASE+7-i,i);
+
+ }
+ }
for (i=0;i<8;i++) {
if ((read_sx_byte (board, SI2_ISA_ID_BASE+7-i) & 7) != i) {
return 0;
@@ -2579,6 +2597,21 @@ static int __init sx_init(void)
my_iounmap (board->hw_base, board->base);
}
}
+ for (i=0;i<NR_SI1_ADDRS;i++) {
+ board = &boards[found];
+ board->hw_base = si1_probe_addrs[i];
+ board->base2 =
+ board->base = (ulong) ioremap(board->hw_base, SI1_ISA_WINDOW_LEN);
+ board->flags &= ~SX_BOARD_TYPE;
+ board->flags |= SI1_ISA_BOARD;
+ board->irq = sx_irqmask ?-1:0;
+
+ if (probe_si (board)) {
+ found++;
+ } else {
+ my_iounmap (board->hw_base, board->base);
+ }
+ }
sx_dprintk(SX_DEBUG_PROBE, "Probing for EISA cards\n");
for(eisa_slot=0x1000; eisa_slot<0x10000; eisa_slot+=0x1000)
diff --git a/drivers/char/sx.h b/drivers/char/sx.h
index 17e06f49f027..3191021d0a22 100644
--- a/drivers/char/sx.h
+++ b/drivers/char/sx.h
@@ -69,6 +69,7 @@ struct vpd_prom {
#define SX_CFPCI_BOARD 0x00000008
#define SX_CFISA_BOARD 0x00000010
#define SI_EISA_BOARD 0x00000020
+#define SI1_ISA_BOARD 0x00000040
#define SX_BOARD_PRESENT 0x00001000
#define SX_BOARD_INITIALIZED 0x00002000
@@ -80,6 +81,7 @@ struct vpd_prom {
SX_ISA_BOARD | SX_CFISA_BOARD))
#define IS_SI_BOARD(board) (board->flags & SI_ISA_BOARD)
+#define IS_SI1_BOARD(board) (board->flags & SI1_ISA_BOARD)
#define IS_EISA_BOARD(board) (board->flags & SI_EISA_BOARD)
diff --git a/drivers/char/sxboards.h b/drivers/char/sxboards.h
index 2f0f5428e680..427927dc7dbf 100644
--- a/drivers/char/sxboards.h
+++ b/drivers/char/sxboards.h
@@ -46,12 +46,36 @@
#define CARD_BUS(type) ((type>>4)&0xF)
#define CARD_PHASE(type) (type&0xF)
+#define TYPE_SI1_ISA CARD_TYPE(BUS_ISA,SI1_Z280)
#define TYPE_SI2_ISA CARD_TYPE(BUS_ISA,SI2_Z280)
#define TYPE_SI2_EISA CARD_TYPE(BUS_EISA,SI2_Z280)
#define TYPE_SI2_PCI CARD_TYPE(BUS_PCI,SI2_Z280)
#define TYPE_SX_ISA CARD_TYPE(BUS_ISA,SI3_T225)
#define TYPE_SX_PCI CARD_TYPE(BUS_PCI,SI3_T225)
+/*****************************************************************************
+****************************** ******************************
+****************************** Phase 1 Z280 ******************************
+****************************** ******************************
+*****************************************************************************/
+
+/* ISA board details... */
+#define SI1_ISA_WINDOW_LEN 0x10000 /* 64 Kbyte shared memory window */
+//#define SI1_ISA_MEMORY_LEN 0x8000 /* Usable memory - unused define*/
+//#define SI1_ISA_ADDR_LOW 0x0A0000 /* Lowest address = 640 Kbyte */
+//#define SI1_ISA_ADDR_HIGH 0xFF8000 /* Highest address = 16Mbyte - 32Kbyte */
+//#define SI2_ISA_ADDR_STEP SI2_ISA_WINDOW_LEN/* ISA board address step */
+//#define SI2_ISA_IRQ_MASK 0x9800 /* IRQs 15,12,11 */
+
+/* ISA board, register definitions... */
+//#define SI2_ISA_ID_BASE 0x7FF8 /* READ: Board ID string */
+#define SI1_ISA_RESET 0x8000 /* WRITE: Host Reset */
+#define SI1_ISA_RESET_CLEAR 0xc000 /* WRITE: Host Reset clear*/
+#define SI1_ISA_WAIT 0x9000 /* WRITE: Host wait */
+#define SI1_ISA_WAIT_CLEAR 0xd000 /* WRITE: Host wait clear */
+#define SI1_ISA_INTCL 0xa000 /* WRITE: Host Reset */
+#define SI1_ISA_INTCL_CLEAR 0xe000 /* WRITE: Host Reset */
+
/*****************************************************************************
****************************** ******************************
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index 7425fc136b7f..2d8b6e20cb04 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -875,22 +875,22 @@ static int mgsl_loopmode_send_done( struct mgsl_struct * info );
* Global linked list of SyncLink devices
*/
struct mgsl_struct *mgsl_device_list;
-int mgsl_device_count;
+static int mgsl_device_count;
/*
* Set this param to non-zero to load eax with the
* .text section address and breakpoint on module load.
* This is useful for use with gdb and add-symbol-file command.
*/
-int break_on_load;
+static int break_on_load;
/*
* Driver major number, defaults to zero to get auto
* assigned major number. May be forced as module parameter.
*/
-int ttymajor;
+static int ttymajor;
-int cuamajor;
+static int cuamajor;
/*
* Array of user specified options for ISA adapters.
diff --git a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c
index d34380c899fb..786428c06b81 100644
--- a/drivers/char/watchdog/sbc60xxwdt.c
+++ b/drivers/char/watchdog/sbc60xxwdt.c
@@ -310,15 +310,16 @@ static void __exit sbc60xxwdt_unload(void)
unregister_reboot_notifier(&wdt_notifier);
release_region(WDT_START,1);
- release_region(WDT_STOP,1);
+// release_region(WDT_STOP,1);
}
static int __init sbc60xxwdt_init(void)
{
int rc = -EBUSY;
- if (!request_region(WDT_STOP, 1, "SBC 60XX WDT"))
- goto err_out;
+// We cannot reserve 0x45 - the kernel already has!
+// if (!request_region(WDT_STOP, 1, "SBC 60XX WDT"))
+// goto err_out;
if (!request_region(WDT_START, 1, "SBC 60XX WDT"))
goto err_out_region1;
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 461f82331691..5b64c887a9e5 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -115,6 +115,9 @@ static ssize_t i2cdev_read (struct file *file, char *buf, size_t count,
struct i2c_client *client = (struct i2c_client *)file->private_data;
+ if(count > 8192)
+ count = 8192;
+
/* copy user space data to kernel space. */
tmp = kmalloc(count,GFP_KERNEL);
if (tmp==NULL)
@@ -143,6 +146,9 @@ static ssize_t i2cdev_write (struct file *file, const char *buf, size_t count,
struct inode *inode = file->f_dentry->d_inode;
#endif /* DEBUG */
+ if(count > 8192)
+ count = 8192;
+
/* copy user space data to kernel space. */
tmp = kmalloc(count,GFP_KERNEL);
if (tmp==NULL)
diff --git a/drivers/isdn/pcbit/capi.h b/drivers/isdn/pcbit/capi.h
index a71cabad9727..18e6aa360a8f 100644
--- a/drivers/isdn/pcbit/capi.h
+++ b/drivers/isdn/pcbit/capi.h
@@ -63,8 +63,7 @@ extern int capi_disc_resp(struct pcbit_chan *chan, struct sk_buff **skb);
extern int capi_decode_debug_188(u_char *hdr, ushort hdrlen);
#endif
-extern __inline__
-struct pcbit_chan *
+static inline struct pcbit_chan *
capi_channel(struct pcbit_dev *dev, struct sk_buff *skb)
{
ushort callref;
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 4c6f207920f7..7bc47778135d 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2605,7 +2605,7 @@ static int pmu_release(struct inode *inode, struct file *file)
disable_kernel_backlight--;
spin_unlock_irqrestore(&pmu_lock, flags);
}
-#endif defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
+#endif /* defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) */
kfree(pp);
}
unlock_kernel();
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index b7982a32852f..c227a24c2b1c 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -82,24 +82,15 @@ static inline void fmi_unmute(int port)
static inline int fmi_setfreq(struct fmi_device *dev)
{
- int myport = dev->port;
+ int myport = dev->port;
unsigned long freq = dev->curfreq;
- int i;
-
+
down(&lock);
-
+
outbits(16, RSF16_ENCODE(freq), myport);
outbits(8, 0xC0, myport);
- for(i=0; i< 100; i++)
- {
- udelay(1400);
- cond_resched();
- }
-/* If this becomes allowed use it ...
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ/7);
-*/
-
up(&lock);
if (dev->curvol) fmi_unmute(myport);
return 0;
@@ -110,7 +101,7 @@ static inline int fmi_getsigstr(struct fmi_device *dev)
int val;
int res;
int myport = dev->port;
- int i;
+
down(&lock);
val = dev->curvol ? 0x08 : 0x00; /* unmute/mute */
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index 669521dcbc8a..fe6c48a9cd87 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -89,27 +89,27 @@ MODULE_PARM(yieldlines,"i");
MODULE_PARM(video_nr,"i");
#endif
-extern __inline__ int read_lpstatus(struct qcam_device *q)
+static inline int read_lpstatus(struct qcam_device *q)
{
return parport_read_status(q->pport);
}
-extern __inline__ int read_lpcontrol(struct qcam_device *q)
+static inline int read_lpcontrol(struct qcam_device *q)
{
return parport_read_control(q->pport);
}
-extern __inline__ int read_lpdata(struct qcam_device *q)
+static inline int read_lpdata(struct qcam_device *q)
{
return parport_read_data(q->pport);
}
-extern __inline__ void write_lpdata(struct qcam_device *q, int d)
+static inline void write_lpdata(struct qcam_device *q, int d)
{
parport_write_data(q->pport, d);
}
-extern __inline__ void write_lpcontrol(struct qcam_device *q, int d)
+static inline void write_lpcontrol(struct qcam_device *q, int d)
{
parport_write_control(q->pport, d);
}
@@ -506,7 +506,7 @@ void qc_set(struct qcam_device *q)
the supplied buffer. It returns the number of bytes read,
or -1 on error. */
-extern __inline__ int qc_readbytes(struct qcam_device *q, char buffer[])
+static inline int qc_readbytes(struct qcam_device *q, char buffer[])
{
int ret=1;
unsigned int hi, lo;
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c
index e58e445c5144..903d73fab67f 100644
--- a/drivers/media/video/pms.c
+++ b/drivers/media/video/pms.c
@@ -69,12 +69,12 @@ static int video_nr = -1;
-extern __inline__ void mvv_write(u8 index, u8 value)
+static inline void mvv_write(u8 index, u8 value)
{
outw(index|(value<<8), io_port);
}
-extern __inline__ u8 mvv_read(u8 index)
+static inline u8 mvv_read(u8 index)
{
outb(index, io_port);
return inb(data_port);
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index 977ac085198f..f72e30e8ca27 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -1428,6 +1428,9 @@ static int saa_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
if (copy_from_user(saa->dmavid2, vw.clips,
VIDEO_CLIPMAP_SIZE))
return -EFAULT;
+ }
+ else if (vw.clipcount > 16384) {
+ return -EINVAL;
} else if (vw.clipcount > 0) {
if ((vcp = vmalloc(sizeof(struct video_clip) *
(vw.clipcount))) == NULL)
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index c98970e20504..b7fb6f24ee5f 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -568,7 +568,7 @@ static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state)
if (state) {
timeout = jiffies + 100;
while (!w9966_i2c_getscl(cam)) {
- if (jiffies > timeout)
+ if (time_after(jiffies, timeout))
return -1;
}
}
diff --git a/drivers/media/video/zr36067.c b/drivers/media/video/zr36067.c
index 9e27df6636d2..7c7c4aab1d92 100644
--- a/drivers/media/video/zr36067.c
+++ b/drivers/media/video/zr36067.c
@@ -1416,7 +1416,7 @@ static int zr36060_reset(struct zoran *zr)
zr36060_sleep(zr, 0);
post_office_write(zr, 3, 0, 0);
udelay(2);
- default:
+ default:;
}
return 0;
}
@@ -3758,7 +3758,7 @@ static int do_zoran_ioctl(struct zoran *zr, unsigned int cmd,
* Write the overlay mask if clips are wanted.
*/
- if (vw.clipcount > 2048)
+ if (vw.clipcount < 0 || vw.clipcount > 2048)
return -EINVAL;
if (vw.clipcount) {
vcp =
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c
index a76576c42d91..3587eced11c1 100644
--- a/drivers/message/i2o/i2o_scsi.c
+++ b/drivers/message/i2o/i2o_scsi.c
@@ -335,15 +335,10 @@ static void i2o_scsi_reply(struct i2o_handler *h, struct i2o_controller *c, stru
return;
}
-struct i2o_handler i2o_scsi_handler=
-{
- i2o_scsi_reply,
- NULL,
- NULL,
- NULL,
- "I2O SCSI OSM",
- 0,
- I2O_CLASS_SCSI_PERIPHERAL
+struct i2o_handler i2o_scsi_handler = {
+ .reply = i2o_scsi_reply,
+ .name = "I2O SCSI OSM",
+ .class = I2O_CLASS_SCSI_PERIPHERAL,
};
/**
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index bf566d8e911d..32d190e3b58c 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -1059,26 +1059,39 @@ int __init ltpc_probe(struct net_device *dev)
int autoirq;
unsigned long flags;
unsigned long f;
+ int portfound=0;
SET_MODULE_OWNER(dev);
save_flags(flags);
/* probe for the I/O port address */
- if (io != 0x240 && !check_region(0x220,8)) {
+ if (io != 0x240 && request_region(0x220,8,"ltpc")) {
x = inb_p(0x220+6);
- if ( (x!=0xff) && (x>=0xf0) ) io = 0x220;
+ if ( (x!=0xff) && (x>=0xf0) ) {
+ io = 0x220;
+ portfound=1;
+ }
+ else {
+ release_region(0x220,8);
+ }
}
- if (io != 0x220 && !check_region(0x240,8)) {
+ if (io != 0x220 && request_region(0x240,8,"ltpc")) {
y = inb_p(0x240+6);
- if ( (y!=0xff) && (y>=0xf0) ) io = 0x240;
+ if ( (y!=0xff) && (y>=0xf0) ){
+ io = 0x240;
+ portfound=1;
+ }
+ else {
+ release_region(0x240,8);
+ }
}
- if(io) {
- /* found it, now grab it */
- request_region(io,8,"ltpc");
- } else {
+ if(io && !portfound && request_region(io,8,"ltpc")){
+ portfound = 1;
+ }
+ if(!portfound) {
/* give up in despair */
printk ("LocalTalk card not found; 220 = %02x, 240 = %02x.\n",
x,y);
diff --git a/drivers/net/de600.c b/drivers/net/de600.c
index f0236fac3520..a626ca95cc22 100644
--- a/drivers/net/de600.c
+++ b/drivers/net/de600.c
@@ -444,7 +444,10 @@ int __init de600_probe(struct net_device *dev)
return -ENODEV;
}
- request_region(DE600_IO, 3, "de600");
+ if (!request_region(DE600_IO, 3, "de600")) {
+ printk(KERN_WARNING "DE600: port 0x%x busy\n", DE600_IO);
+ return -EBUSY;
+ }
printk(", Ethernet Address: %02X", dev->dev_addr[0]);
for (i = 1; i < ETH_ALEN; i++)
diff --git a/drivers/net/fc/iph5526.c b/drivers/net/fc/iph5526.c
index 59b7e5debf58..769c972de1bf 100644
--- a/drivers/net/fc/iph5526.c
+++ b/drivers/net/fc/iph5526.c
@@ -3791,8 +3791,10 @@ struct pci_dev *pdev = NULL;
sprintf(fi->name, "fc%d", count);
host = scsi_register(tmpt, sizeof(struct iph5526_hostdata));
- if(host==NULL)
+ if(host==NULL) {
+ kfree(fc[count]);
return no_of_hosts;
+ }
hostdata = (struct iph5526_hostdata *)host->hostdata;
memset(hostdata, 0 , sizeof(struct iph5526_hostdata));
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index f68c07bef92b..afbe50ffbd33 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -281,15 +281,13 @@ static int ali_ircc_open(int i, chipio_t *info)
self->io.fifo_size = 16; /* SIR: 16, FIR: 32 Benjamin 2000/11/1 */
/* Reserve the ioports that we need */
- ret = check_region(self->io.fir_base, self->io.fir_ext);
- if (ret < 0) {
+ if (!request_region(self->io.fir_base, self->io.fir_ext, driver_name)) {
WARNING("%s(), can't get iobase of 0x%03x\n", __FUNCTION__,
self->io.fir_base);
dev_self[i] = NULL;
kfree(self);
return -ENODEV;
}
- request_region(self->io.fir_base, self->io.fir_ext, driver_name);
/* Initialize QoS for this device */
irda_init_max_qos_capabilies(&self->qos);
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 937b5d086c93..e87f5aad0542 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -195,6 +195,7 @@ int __init macsonic_init(struct net_device* dev)
if ((lp->rba = (char *)
kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL | GFP_DMA)) == NULL) {
printk(KERN_ERR "%s: couldn't allocate receive buffers\n", dev->name);
+ kfree(lp);
return -ENOMEM;
}
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index 88f3f6a63e1f..4e9452ce9f36 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -1085,6 +1085,7 @@ static int __init myri_ether_init(struct net_device *dev, struct sbus_dev *sdev,
#endif
return 0;
err: unregister_netdev(dev);
+ kfree(dev->priv);
kfree(dev);
return -ENODEV;
}
@@ -1142,6 +1143,7 @@ static void __exit myri_sbus_cleanup(void)
unregister_netdev(root_myri_dev->dev);
kfree(root_myri_dev->dev);
+ kfree(root_myri_dev);
root_myri_dev = next;
}
#endif /* MODULE */
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 266212207d2f..860990085fce 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -644,8 +644,10 @@ int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr,
release_sock(sk);
return error;
err_put:
- dev_put(po->pppoe_dev);
- po->pppoe_dev = NULL;
+ if (po->pppoe_dev) {
+ dev_put(po->pppoe_dev);
+ po->pppoe_dev = NULL;
+ }
goto end;
}
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 6f037c40bc7d..32a996d3f4a5 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -1209,6 +1209,7 @@ fail_and_cleanup:
bp->bblock_dvma);
unregister_netdev(dev);
+ kfree(dev->priv);
kfree(dev);
return -ENODEV;
}
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
index 453aaa0f5002..0390d01340cf 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -226,16 +226,12 @@ int __init madgemc_probe(void)
goto getout;
}
- request_region(dev->base_addr, MADGEMC_IO_EXTENT, "madgemc");
-#if 0
- /* why is this not working? */
- if (request_region(dev->base_addr, MADGEMC_IO_EXTENT,
+ if (!request_region(dev->base_addr, MADGEMC_IO_EXTENT,
"madgemc")) {
printk(KERN_INFO "madgemc: unable to setup Smart MC in slot %d because of I/O base conflict at 0x%04lx\n", slot, dev->base_addr);
dev->base_addr += MADGEMC_SIF_OFFSET;
goto getout;
}
-#endif
dev->base_addr += MADGEMC_SIF_OFFSET;
/*
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 6b246ca0ab95..c71d0532b6f1 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -610,7 +610,8 @@ static void sppp_channel_delete(struct channel_data *chan)
static int cosa_sppp_open(struct net_device *d)
{
struct channel_data *chan = d->priv;
- int err, flags;
+ int err;
+ unsigned long flags;
if (!(chan->cosa->firmware_status & COSA_FW_START)) {
printk(KERN_NOTICE "%s: start the firmware first (status %d)\n",
@@ -681,7 +682,7 @@ static void cosa_sppp_timeout(struct net_device *dev)
static int cosa_sppp_close(struct net_device *d)
{
struct channel_data *chan = d->priv;
- int flags;
+ unsigned long flags;
netif_stop_queue(d);
sppp_close(d);
@@ -778,7 +779,7 @@ static ssize_t cosa_read(struct file *file,
char *buf, size_t count, loff_t *ppos)
{
DECLARE_WAITQUEUE(wait, current);
- int flags;
+ unsigned long flags;
struct channel_data *chan = (struct channel_data *)file->private_data;
struct cosa_data *cosa = chan->cosa;
char *kbuf;
@@ -855,7 +856,7 @@ static ssize_t cosa_write(struct file *file,
DECLARE_WAITQUEUE(wait, current);
struct channel_data *chan = (struct channel_data *)file->private_data;
struct cosa_data *cosa = chan->cosa;
- unsigned int flags;
+ unsigned long flags;
char *kbuf;
if (!(cosa->firmware_status & COSA_FW_START)) {
@@ -1242,7 +1243,7 @@ static void cosa_disable_rx(struct channel_data *chan)
static int cosa_start_tx(struct channel_data *chan, char *buf, int len)
{
struct cosa_data *cosa = chan->cosa;
- int flags;
+ unsigned long flags;
#ifdef DEBUG_DATA
int i;
@@ -1268,7 +1269,7 @@ static int cosa_start_tx(struct channel_data *chan, char *buf, int len)
static void put_driver_status(struct cosa_data *cosa)
{
- unsigned flags=0;
+ unsigned long flags;
int status;
spin_lock_irqsave(&cosa->lock, flags);
@@ -1336,7 +1337,7 @@ static void put_driver_status_nolock(struct cosa_data *cosa)
*/
static void cosa_kick(struct cosa_data *cosa)
{
- unsigned flags, flags1;
+ unsigned long flags, flags1;
char *s = "(probably) IRQ";
if (test_bit(RXBIT, &cosa->rxtx))
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 5d8b29111988..82b9679e571f 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -194,7 +194,7 @@ static inline int __init
sbni_isa_probe( struct net_device *dev )
{
if( dev->base_addr > 0x1ff
- && !check_region( dev->base_addr, SBNI_IO_EXTENT )
+ && request_region( dev->base_addr, SBNI_IO_EXTENT, dev->name )
&& sbni_probe1( dev, dev->base_addr, dev->irq ) )
return 0;
@@ -249,7 +249,7 @@ sbni_probe( struct net_device *dev )
for( i = 0; netcard_portlist[ i ]; ++i ) {
int ioaddr = netcard_portlist[ i ];
- if( !check_region( ioaddr, SBNI_IO_EXTENT )
+ if( request_region( ioaddr, SBNI_IO_EXTENT, dev->name )
&& sbni_probe1( dev, ioaddr, 0 ))
return 0;
}
@@ -280,7 +280,7 @@ sbni_pci_probe( struct net_device *dev )
pci_irq_line = pdev->irq;
/* Avoid already found cards from previous calls */
- if( check_region( pci_ioaddr, SBNI_IO_EXTENT ) ) {
+ if( !pci_request_region( pci_ioaddr, SBNI_IO_EXTENT, dev->name ) ) {
pci_read_config_word( pdev, PCI_SUBSYSTEM_ID, &subsys );
if( subsys != 2 || /* Dual adapter is present */
check_region( pci_ioaddr += 4, SBNI_IO_EXTENT ) )
@@ -310,9 +310,6 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
{
struct net_local *nl;
- if( !request_region( ioaddr, SBNI_IO_EXTENT, dev->name ) )
- return 0;
-
if( sbni_card_probe( ioaddr ) ) {
release_region( ioaddr, SBNI_IO_EXTENT );
return 0;
diff --git a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c
index 0f605cb65dfd..9c1611abab8e 100644
--- a/drivers/net/wan/sdla_fr.c
+++ b/drivers/net/wan/sdla_fr.c
@@ -162,14 +162,9 @@
#include <linux/sdla_fr.h> /* frame relay firmware API definitions */
-#if defined(LINUX_2_1) || defined(LINUX_2_4)
- #include <asm/uaccess.h>
- #include <linux/inetdevice.h>
- #include <linux/netdevice.h>
-
-#else
- #include <asm/segment.h>
-#endif
+#include <asm/uaccess.h>
+#include <linux/inetdevice.h>
+#include <linux/netdevice.h>
#include <net/route.h> /* Dynamic Route Creation */
#include <linux/etherdevice.h> /* eth_type_trans() used for bridging */
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index 06dafe83d5fa..e950377d8cd1 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -242,6 +242,11 @@ static dev_link_t *airo_attach(void)
/* Allocate space for private device-specific data */
local = kmalloc(sizeof(local_info_t), GFP_KERNEL);
+ if (!local) {
+ printk(KERN_ERR "airo_cs: no memory for new device\n");
+ kfree (link);
+ return NULL;
+ }
memset(local, 0, sizeof(local_info_t));
link->priv = local;
diff --git a/drivers/parport/ChangeLog b/drivers/parport/ChangeLog
index 5f641fdb808c..692415edb153 100644
--- a/drivers/parport/ChangeLog
+++ b/drivers/parport/ChangeLog
@@ -1,8 +1,7 @@
-2001-11-14 Tim Waugh <twaugh@redhat.com>
+2002-04-25 Tim Waugh <twaugh@redhat.com>
- * parport_pc.c (parport_pc_pci_probe): Hooks for PCI cards before
- and after probing for ports.
- * parport_serial.c (parport_register): Likewise.
+ * parport_serial.c, parport_pc.c: Move some SIIG cards around.
+ Patch from Andrey Panin.
2002-01-20 Tim Waugh <twaugh@redhat.com>
@@ -21,17 +20,17 @@
* daisy.c: Apply patch from Max Vorobiev to make parport_daisy_select
work for ECP/EPP modes.
-2002-01-04 Tim Waugh <twaugh@redhat.com>
-
- * share.c (parport_claim_or_block): Sleep interruptibly to prevent
- a possible deadlock.
-
2002-01-13 Niels Kristian Bech Jensen <nkbj@image.dk>
* parport_pc.c: Change some occurrences of frob_set_mode to
ECR_WRITE. This fixes PLIP.
-2001-10-25 Damian Gruszka <damian.gruszka@VisionSystems.de>
+2002-01-04 Tim Waugh <twaugh@redhat.com>
+
+ * share.c (parport_claim_or_block): Sleep interruptibly to prevent
+ a possible deadlock.
+
+2001-12-07 Damian Gruszka <damian.gruszka@VisionSystems.de>
* parport_pc.c (ECR_WRITE): Define. If there are forbidden bits
in the ECR register for some chips, this will be a useful place to
@@ -68,7 +67,7 @@
(parport_irq_probe): If no IRQ is found, take ackIntEn out of the
writable bit set.
-2001-10-25 Tim Waugh <twaugh@redhat.com>
+2001-12-07 Tim Waugh <twaugh@redhat.com>
* parport_pc.c (parport_pc_fifo_write_block_pio): Correct typo.
(parport_pc_init_state): Only set ackIntEn if we know which IRQ
@@ -85,6 +84,16 @@
too buggy at the moment. Use 'dma=auto' to restore the previous
behaviour.
+2001-12-07 Tim Waugh <twaugh@redhat.com>
+
+ * daisy.c (DEBUG): Undefine.
+
+2001-12-06 Tim Waugh <twaugh@redhat.com>
+
+ * ieee1284_ops.c (parport_ieee1284_ecp_read_data): Mask off
+ PARPORT_CONTROL_AUTOFD as well. Bug spotted by Joe
+ <joeja@mindspring.com>.
+
2001-12-03 Rich Liu <Rich.Liu@ite.com.tw>
* parport_pc.c (sio_ite_8872_probe): ITE8873 is a single-port
@@ -94,11 +103,11 @@
* parport_pc.c: Fix compiler warning.
-2001-12-06 Tim Waugh <twaugh@redhat.com>
+2001-11-14 Tim Waugh <twaugh@redhat.com>
- * ieee1284_ops.c (parport_ieee1284_ecp_read_data): Mask off
- PARPORT_CONTROL_AUTOFD as well. Bug spotted by Joe
- <joeja@mindspring.com>.
+ * parport_pc.c (parport_pc_pci_probe): Hooks for PCI cards before
+ and after probing for ports.
+ * parport_serial.c (parport_register): Likewise.
2001-11-12 Tim Waugh <twaugh@redhat.com>
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 214d74ac6a51..420aee0ae2e5 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2709,6 +2709,7 @@ enum parport_pc_pci_cards {
oxsemi_954,
oxsemi_840,
aks_0100,
+ mobility_pp,
};
@@ -2792,6 +2793,7 @@ static struct parport_pc_pci {
/* oxsemi_954 */ { 1, { { 0, -1 }, } },
/* oxsemi_840 */ { 1, { { 0, -1 }, } },
/* aks_0100 */ { 1, { { 0, 1 }, } },
+ /* mobility_pp */ { 1, { { 0, 1 }, } },
};
static struct pci_device_id parport_pc_pci_tbl[] __devinitdata = {
@@ -2873,6 +2875,7 @@ static struct pci_device_id parport_pc_pci_tbl[] __devinitdata = {
{ 0x1409, 0x7268, 0x1409, 0x0103, 0, 0, timedia_4008a },
{ 0x1409, 0x7268, 0x1409, 0x0104, 0, 0, timedia_4018 },
{ 0x1409, 0x7268, 0x1409, 0x9018, 0, 0, timedia_9018a },
+ { 0x14f2, 0x0121, PCI_ANY_ID, PCI_ANY_ID, 0, 0, mobility_pp },
{ PCI_VENDOR_ID_SYBA, PCI_DEVICE_ID_SYBA_2P_EPP,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_2p_epp },
{ PCI_VENDOR_ID_SYBA, PCI_DEVICE_ID_SYBA_1P_ECP,
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index 39a78affab4b..f80f9301314d 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -41,6 +41,11 @@ enum parport_pc_pci_cards {
avlab_2s1p,
avlab_2s1p_650,
avlab_2s1p_850,
+ siig_1s1p_10x,
+ siig_2s1p_10x,
+ siig_2p1s_20x,
+ siig_1s1p_20x,
+ siig_2s1p_20x,
};
@@ -74,6 +79,11 @@ static struct parport_pc_pci {
/* avlab_2s1p */ { 1, { { 2, 3}, } },
/* avlab_2s1p_650 */ { 1, { { 2, 3}, } },
/* avlab_2s1p_850 */ { 1, { { 2, 3}, } },
+ /* siig_1s1p_10x */ { 1, { { 3, 4 }, } },
+ /* siig_2s1p_10x */ { 1, { { 4, 5 }, } },
+ /* siig_2p1s_20x */ { 2, { { 1, 2 }, { 3, 4 }, } },
+ /* siig_1s1p_20x */ { 1, { { 1, 2 }, } },
+ /* siig_2s1p_20x */ { 1, { { 2, 3 }, } },
};
static struct pci_device_id parport_serial_pci_tbl[] __devinitdata = {
@@ -92,6 +102,37 @@ static struct pci_device_id parport_serial_pci_tbl[] __devinitdata = {
{ 0x14db, 0x2160, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_2s1p},
{ 0x14db, 0x2161, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_2s1p_650},
{ 0x14db, 0x2162, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_2s1p_850},
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_550,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_10x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_650,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_10x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_10x_850,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_10x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_550,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_10x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_650,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_10x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_10x_850,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_10x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_550,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2p1s_20x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_650,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2p1s_20x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2P1S_20x_850,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2p1s_20x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_550,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_650,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_20x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S1P_20x_850,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_1s1p_20x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_550,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_650,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x },
+ { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_850,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x },
+
{ 0, } /* terminate list */
};
MODULE_DEVICE_TABLE(pci,parport_serial_pci_tbl);
@@ -107,6 +148,16 @@ struct pci_board_no_ids {
int first_uart_offset;
};
+static int __devinit siig10x_init_fn(struct pci_dev *dev, struct pci_board_no_ids *board, int enable)
+{
+ return pci_siig10x_fn(dev, NULL, enable);
+}
+
+static int __devinit siig20x_init_fn(struct pci_dev *dev, struct pci_board_no_ids *board, int enable)
+{
+ return pci_siig20x_fn(dev, NULL, enable);
+}
+
static struct pci_board_no_ids pci_boards[] __devinitdata = {
/*
* PCI Flags, Number of Ports, Base (Maximum) Baud Rate,
@@ -129,6 +180,11 @@ static struct pci_board_no_ids pci_boards[] __devinitdata = {
/* avlab_2s1p (n/t) */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 },
/* avlab_2s1p_650 (nt)*/{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 },
/* avlab_2s1p_850 (nt)*/{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 },
+/* siig_1s1p_10x */ { SPCI_FL_BASE2, 1, 460800, 0, 0, siig10x_init_fn },
+/* siig_2s1p_10x */ { SPCI_FL_BASE2, 1, 921600, 0, 0, siig10x_init_fn },
+/* siig_2p1s_20x */ { SPCI_FL_BASE0, 1, 921600, 0, 0, siig20x_init_fn },
+/* siig_1s1p_20x */ { SPCI_FL_BASE0, 1, 921600, 0, 0, siig20x_init_fn },
+/* siig_2s1p_20x */ { SPCI_FL_BASE0, 1, 921600, 0, 0, siig20x_init_fn },
};
struct parport_serial_private {
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 5be491ff1a35..545f18b055e4 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -107,6 +107,14 @@ pci_setup_bridge(struct pci_bus *bus)
DBGC((KERN_INFO "PCI: Bus %d, bridge: %s\n",
bus->number, bridge->dev.name));
+ /* Add bridge resources to the resource tree. */
+ if (bus->resource[0]->end > bus->resource[0]->start &&
+ request_resource(bus->resource[0], bus->resource[0]) < 0)
+ printk(KERN_ERR "PCI: failed to reserve IO for bus %d\n", bus->number);
+ if (bus->resource[1]->end > bus->resource[1]->start &&
+ request_resource(bus->resource[1], bus->resource[1]) < 0)
+ printk(KERN_ERR "PCI: failed to reserve MEM for bus %d\n", bus->number);
+
/* Set up the top and bottom of the PCI I/O segment for this bus. */
if (bus->resource[0]->flags & IORESOURCE_IO) {
pci_read_config_dword(bridge, PCI_IO_BASE, &l);
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index bb5073f903b0..402f4ec86aff 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -283,6 +283,8 @@ int cb_alloc(socket_info_t * s)
dev->hdr_type = hdr & 0x7f;
pci_setup_device(dev);
+ if (pci_enable_device(dev))
+ continue;
strcpy(dev->dev.bus_id, dev->slot_name);
@@ -300,7 +302,6 @@ int cb_alloc(socket_info_t * s)
pci_writeb(dev, PCI_INTERRUPT_LINE, irq);
}
- pci_enable_device(dev); /* XXX check return */
device_register(&dev->dev);
pci_insert_device(dev, bus);
}
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 6e3b2f654179..0262afbfd3f0 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -392,7 +392,11 @@ static int __init init_tcic(void)
printk(KERN_INFO "Databook TCIC-2 PCMCIA probe: ");
sock = 0;
- if (check_region(tcic_base, 16) == 0) {
+ if (!request_region(tcic_base, 16, "tcic-2")) {
+ printk("could not allocate ports,\n ");
+ return -ENODEV;
+ }
+ else {
tcic_setw(TCIC_ADDR, 0);
if (tcic_getw(TCIC_ADDR) == 0) {
tcic_setw(TCIC_ADDR, 0xc3a5);
@@ -408,16 +412,13 @@ static int __init init_tcic(void)
if (tcic_getw(TCIC_ADDR) == 0xc3a5) sock = 2;
}
}
- } else
- printk("could not allocate ports, ");
-
+ }
if (sock == 0) {
printk("not found.\n");
+ release_region(tcic_base, 16);
return -ENODEV;
}
- request_region(tcic_base, 16, "tcic-2");
-
sockets = 0;
for (i = 0; i < sock; i++) {
if ((i == ignore) || is_active(i)) continue;
diff --git a/drivers/scsi/aic7xxx/aic7770.c b/drivers/scsi/aic7xxx/aic7770.c
index 2d11965a7f81..f32adfd9badb 100644
--- a/drivers/scsi/aic7xxx/aic7770.c
+++ b/drivers/scsi/aic7xxx/aic7770.c
@@ -50,6 +50,7 @@
#define ID_AHA_274x 0x04907771
#define ID_AHA_284xB 0x04907756 /* BIOS enabled */
#define ID_AHA_284x 0x04907757 /* BIOS disabled*/
+#define ID_AIC_7782 0x04907782
static void aha2840_load_seeprom(struct ahc_softc *ahc);
static ahc_device_setup_t ahc_aic7770_VL_setup;
@@ -77,6 +78,13 @@ struct aic7770_identity aic7770_ident_table [] =
0xFFFFFFFF,
"Adaptec aic7770 SCSI adapter",
ahc_aic7770_EISA_setup
+ },
+ {
+ /* (Olivetti 2 channel EISA) */
+ ID_AIC_7782,
+ 0xFFFFFFFF,
+ "Adaptec aic7782 SCSI adapter",
+ ahc_aic7770_EISA_setup
}
};
const int ahc_num_aic7770_devs = NUM_ELEMENTS(aic7770_ident_table);
diff --git a/drivers/scsi/inia100.c b/drivers/scsi/inia100.c
index 80039be482dc..da8f9484cea6 100644
--- a/drivers/scsi/inia100.c
+++ b/drivers/scsi/inia100.c
@@ -366,7 +366,11 @@ int inia100_detect(Scsi_Host_Template * tpnt)
printk("inia100: initial orchid fail!!\n");
goto out_unalloc;
}
- request_region(pHCB->HCS_Base, 256, "inia100"); /* Register */
+ if (!request_region(pHCB->HCS_Base, 256, "inia100")) {
+ printk(KERN_WARNING "inia100: io port 0x%x, is busy.\n",
+ pHCB->HCS_Base);
+ return (0);
+ }
hreg->io_port = pHCB->HCS_Base;
hreg->n_io_port = 0xff;
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 8bafa2164c6c..b3f6089b6c2c 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -83,7 +83,7 @@
/* 2.3.18 and later */
/* - Sync with other changes from the 2.3 kernels */
/* 4.00.06 - Fix timeout with initial FFDC command */
-/* 4.00.06a - Port to 2.4 (trivial) -- Christoph Hellwig <hch@caldera.de> */
+/* 4.00.06a - Port to 2.4 (trivial) -- Christoph Hellwig <hch@infradead.org> */
/* 4.10.00 - Add support for ServeRAID 4M/4L */
/* 4.10.13 - Fix for dynamic unload and proc file system */
/* 4.20.03 - Rename version to coincide with new release schedules */
@@ -190,6 +190,7 @@
#ifdef MODULE
static char *ips = NULL;
MODULE_PARM(ips, "s");
+ MODULE_LICENSE("GPL");
#endif
/*
@@ -892,7 +893,6 @@ ips_detect(Scsi_Host_Template *SHT) {
continue;
}
-
}
/* get planer status */
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 102e96c6398f..4a3d1c3d1ef3 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -168,6 +168,7 @@ struct dev_info scsi_static_device_list[] __initdata = {
{"DELL", "PV530F", NULL, BLIST_SPARSELUN},
{"EMC", "SYMMETRIX", NULL, BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_FORCELUN},
{"HP", "A6189A", NULL, BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP VA7400 */
+ {"HP", "OPEN-", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP XP Arrays */
{"CMD", "CRA-7280", NULL, BLIST_SPARSELUN}, /* CMD RAID Controller */
{"CNSI", "G7324", NULL, BLIST_SPARSELUN}, /* Chaparral G7324 RAID */
{"CNSi", "G8324", NULL, BLIST_SPARSELUN}, /* Chaparral G8324 RAID */
@@ -181,6 +182,12 @@ struct dev_info scsi_static_device_list[] __initdata = {
{"COMPAQ", "MSA1000", NULL, BLIST_FORCELUN},
{"HP", "C1557A", NULL, BLIST_FORCELUN},
{"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN},
+ {"FSC", "CentricStor", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+ {"DDN", "SAN DataDirector", "*", BLIST_SPARSELUN},
+ {"HITACHI", "DF400", "*", BLIST_SPARSELUN},
+ {"HITACHI", "DF500", "*", BLIST_SPARSELUN},
+ {"HITACHI", "DF600", "*", BLIST_SPARSELUN},
+ {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
{ NULL, NULL, NULL, 0 },
};
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 25ee745abff7..0a0a6e9ade97 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -474,9 +474,7 @@ sg_new_read(Sg_fd * sfp, char *buf, size_t count, Sg_request * srp)
sb_len = (hp->mx_sb_len > sb_len) ? sb_len : hp->mx_sb_len;
len = 8 + (int) srp->sense_b[7]; /* Additional sense length field */
len = (len > sb_len) ? sb_len : len;
- if ((err = verify_area(VERIFY_WRITE, hp->sbp, len)))
- goto err_out;
- if (__copy_to_user(hp->sbp, srp->sense_b, len)) {
+ if (copy_to_user(hp->sbp, srp->sense_b, len)) {
err = -EFAULT;
goto err_out;
}
diff --git a/drivers/video/fbcon.c b/drivers/video/fbcon.c
index 69374876d64f..0b0db4edcfa0 100644
--- a/drivers/video/fbcon.c
+++ b/drivers/video/fbcon.c
@@ -230,8 +230,9 @@ static void fbcon_vbl_detect(int irq, void *dummy, struct pt_regs *fp)
static void cursor_timer_handler(unsigned long dev_addr);
-static struct timer_list cursor_timer =
- TIMER_INITIALIZER(cursor_timer_handler, 0, 0);
+static struct timer_list cursor_timer = {
+ function: cursor_timer_handler
+};
static void cursor_timer_handler(unsigned long dev_addr)
{
diff --git a/fs/file_table.c b/fs/file_table.c
index 65e00ff7708a..ca55e9de1029 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -18,7 +18,9 @@
/* sysctl tunables... */
-struct files_stat_struct files_stat = {0, 0, NR_FILE};
+struct files_stat_struct files_stat = {
+ .max_files = NR_FILE
+};
/* Here the new files go */
static LIST_HEAD(anon_list);
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h
index 34a2c5039cc3..230b622915a6 100644
--- a/fs/hpfs/hpfs_fn.h
+++ b/fs/hpfs/hpfs_fn.h
@@ -75,7 +75,7 @@ struct quad_buffer_head {
/* The b-tree down pointer from a dir entry */
-extern inline dnode_secno de_down_pointer (struct hpfs_dirent *de)
+static inline dnode_secno de_down_pointer (struct hpfs_dirent *de)
{
CHKCOND(de->down,("HPFS: de_down_pointer: !de->down\n"));
return *(dnode_secno *) ((void *) de + de->length - 4);
@@ -83,14 +83,14 @@ extern inline dnode_secno de_down_pointer (struct hpfs_dirent *de)
/* The first dir entry in a dnode */
-extern inline struct hpfs_dirent *dnode_first_de (struct dnode *dnode)
+static inline struct hpfs_dirent *dnode_first_de (struct dnode *dnode)
{
return (void *) dnode->dirent;
}
/* The end+1 of the dir entries */
-extern inline struct hpfs_dirent *dnode_end_de (struct dnode *dnode)
+static inline struct hpfs_dirent *dnode_end_de (struct dnode *dnode)
{
CHKCOND(dnode->first_free>=0x14 && dnode->first_free<=0xa00,("HPFS: dnode_end_de: dnode->first_free = %d\n",(int)dnode->first_free));
return (void *) dnode + dnode->first_free;
@@ -98,58 +98,60 @@ extern inline struct hpfs_dirent *dnode_end_de (struct dnode *dnode)
/* The dir entry after dir entry de */
-extern inline struct hpfs_dirent *de_next_de (struct hpfs_dirent *de)
+static inline struct hpfs_dirent *de_next_de (struct hpfs_dirent *de)
{
CHKCOND(de->length>=0x20 && de->length<0x800,("HPFS: de_next_de: de->length = %d\n",(int)de->length));
return (void *) de + de->length;
}
-extern inline struct extended_attribute *fnode_ea(struct fnode *fnode)
+static inline struct extended_attribute *fnode_ea(struct fnode *fnode)
{
return (struct extended_attribute *)((char *)fnode + fnode->ea_offs);
}
-extern inline struct extended_attribute *fnode_end_ea(struct fnode *fnode)
+static inline struct extended_attribute *fnode_end_ea(struct fnode *fnode)
{
return (struct extended_attribute *)((char *)fnode + fnode->ea_offs + fnode->ea_size_s);
}
-extern inline struct extended_attribute *next_ea(struct extended_attribute *ea)
+static inline struct extended_attribute *next_ea(struct extended_attribute *ea)
{
return (struct extended_attribute *)((char *)ea + 5 + ea->namelen + ea->valuelen);
}
-extern inline secno ea_sec(struct extended_attribute *ea)
+static inline secno ea_sec(struct extended_attribute *ea)
{
return *(secno *)((char *)ea + 9 + ea->namelen);
}
-extern inline secno ea_len(struct extended_attribute *ea)
+static inline secno ea_len(struct extended_attribute *ea)
{
return *(secno *)((char *)ea + 5 + ea->namelen);
}
-extern inline char *ea_data(struct extended_attribute *ea)
+static inline char *ea_data(struct extended_attribute *ea)
{
return (char *)((char *)ea + 5 + ea->namelen);
}
-extern inline unsigned de_size(int namelen, secno down_ptr)
+static inline unsigned de_size(int namelen, secno down_ptr)
{
return ((0x1f + namelen + 3) & ~3) + (down_ptr ? 4 : 0);
}
-extern inline void copy_de(struct hpfs_dirent *dst, struct hpfs_dirent *src)
+static inline void copy_de(struct hpfs_dirent *dst, struct hpfs_dirent *src)
{
- int a = dst->down;
- int n = dst->not_8x3;
+ int a;
+ int n;
if (!dst || !src) return;
+ a = dst->down;
+ n = dst->not_8x3;
memcpy((char *)dst + 2, (char *)src + 2, 28);
dst->down = a;
dst->not_8x3 = n;
}
-extern inline unsigned tstbits(unsigned *bmp, unsigned b, unsigned n)
+static inline unsigned tstbits(unsigned *bmp, unsigned b, unsigned n)
{
int i;
if ((b >= 0x4000) || (b + n - 1 >= 0x4000)) return n;
@@ -314,13 +316,13 @@ extern struct address_space_operations hpfs_aops;
* local time (HPFS) to GMT (Unix)
*/
-extern inline time_t local_to_gmt(struct super_block *s, time_t t)
+static inline time_t local_to_gmt(struct super_block *s, time_t t)
{
extern struct timezone sys_tz;
return t + sys_tz.tz_minuteswest * 60 + hpfs_sb(s)->sb_timeshift;
}
-extern inline time_t gmt_to_local(struct super_block *s, time_t t)
+static inline time_t gmt_to_local(struct super_block *s, time_t t)
{
extern struct timezone sys_tz;
return t - sys_tz.tz_minuteswest * 60 - hpfs_sb(s)->sb_timeshift;
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index a1d8fc6be145..37ae3c466e7a 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -324,6 +324,10 @@ static const char *qnx4_checkroot(struct super_block *sb)
if (!strncmp(rootdir->di_fname, QNX4_BMNAME, sizeof QNX4_BMNAME)) {
found = 1;
qnx4_sb(sb)->BitMap = kmalloc( sizeof( struct qnx4_inode_entry ), GFP_KERNEL );
+ if (!qnx4_sb(sb)->BitMap) {
+ brelse (bh);
+ return "not enough memory for bitmap inode";
+ }
memcpy( qnx4_sb(sb)->BitMap, rootdir, sizeof( struct qnx4_inode_entry ) ); /* keep bitmap inode known */
break;
}
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
index ff14c8f4ed13..0ba43172df9c 100644
--- a/include/asm-alpha/processor.h
+++ b/include/asm-alpha/processor.h
@@ -30,7 +30,6 @@
* Bus types
*/
#define EISA_bus 1
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-i386/string-486.h b/include/asm-i386/string-486.h
deleted file mode 100644
index 4104ab9bc9f9..000000000000
--- a/include/asm-i386/string-486.h
+++ /dev/null
@@ -1,617 +0,0 @@
-#ifndef _I386_STRING_I486_H_
-#define _I386_STRING_I486_H_
-
-/*
- * This string-include defines all string functions as inline
- * functions. Use gcc. It also assumes ds=es=data space, this should be
- * normal. Most of the string-functions are rather heavily hand-optimized,
- * see especially strsep,strstr,str[c]spn. They should work, but are not
- * very easy to understand. Everything is done entirely within the register
- * set, making the functions fast and clean.
- *
- * Copyright (C) 1991, 1992 Linus Torvalds
- * Revised and optimized for i486/pentium
- * 1994/03/15 by Alberto Vignani/Davide Parodi @crf.it
- *
- * Split into 2 CPU specific files by Alan Cox to keep #ifdef noise down.
- *
- * 1999/10/5 Proper register args for newer GCCs and minor bugs
- * fixed - Petko Manolov (petkan@spct.net)
- * 1999/10/14 3DNow memscpy() added - Petkan
- * 2000/05/09 extern changed to static in function definitions
- * and a few cleanups - Petkan
- */
-
-#define __HAVE_ARCH_STRCPY
-static inline char * strcpy(char * dest,const char *src)
-{
-register char *tmp= (char *)dest;
-register char dummy;
-__asm__ __volatile__(
- "\n1:\t"
- "movb (%0),%2\n\t"
- "incl %0\n\t"
- "movb %2,(%1)\n\t"
- "incl %1\n\t"
- "testb %2,%2\n\t"
- "jne 1b"
- :"=r" (src), "=r" (tmp), "=q" (dummy)
- :"0" (src), "1" (tmp)
- :"memory");
-return dest;
-}
-
-#define __HAVE_ARCH_STRNCPY
-static inline char * strncpy(char * dest,const char *src,size_t count)
-{
-register char *tmp= (char *)dest;
-register char dummy;
-if (count) {
-__asm__ __volatile__(
- "\n1:\t"
- "movb (%0),%2\n\t"
- "incl %0\n\t"
- "movb %2,(%1)\n\t"
- "incl %1\n\t"
- "decl %3\n\t"
- "je 3f\n\t"
- "testb %2,%2\n\t"
- "jne 1b\n\t"
- "2:\tmovb %2,(%1)\n\t"
- "incl %1\n\t"
- "decl %3\n\t"
- "jne 2b\n\t"
- "3:"
- :"=r" (src), "=r" (tmp), "=q" (dummy), "=r" (count)
- :"0" (src), "1" (tmp), "3" (count)
- :"memory");
- } /* if (count) */
-return dest;
-}
-
-#define __HAVE_ARCH_STRCAT
-static inline char * strcat(char * dest,const char * src)
-{
-register char *tmp = (char *)(dest-1);
-register char dummy;
-__asm__ __volatile__(
- "\n1:\tincl %1\n\t"
- "cmpb $0,(%1)\n\t"
- "jne 1b\n"
- "2:\tmovb (%2),%b0\n\t"
- "incl %2\n\t"
- "movb %b0,(%1)\n\t"
- "incl %1\n\t"
- "testb %b0,%b0\n\t"
- "jne 2b\n"
- :"=q" (dummy), "=r" (tmp), "=r" (src)
- :"1" (tmp), "2" (src)
- :"memory");
-return dest;
-}
-
-#define __HAVE_ARCH_STRNCAT
-static inline char * strncat(char * dest,const char * src,size_t count)
-{
-register char *tmp = (char *)(dest-1);
-register char dummy;
-__asm__ __volatile__(
- "\n1:\tincl %1\n\t"
- "cmpb $0,(%1)\n\t"
- "jne 1b\n"
- "2:\tdecl %3\n\t"
- "js 3f\n\t"
- "movb (%2),%b0\n\t"
- "incl %2\n\t"
- "movb %b0,(%1)\n\t"
- "incl %1\n\t"
- "testb %b0,%b0\n\t"
- "jne 2b\n"
- "3:\txorb %0,%0\n\t"
- "movb %b0,(%1)\n\t"
- :"=q" (dummy), "=r" (tmp), "=r" (src), "=r" (count)
- :"1" (tmp), "2" (src), "3" (count)
- :"memory");
-return dest;
-}
-
-#define __HAVE_ARCH_STRCMP
-static inline int strcmp(const char * cs,const char * ct)
-{
-register int __res;
-__asm__ __volatile__(
- "\n1:\tmovb (%1),%b0\n\t"
- "incl %1\n\t"
- "cmpb %b0,(%2)\n\t"
- "jne 2f\n\t"
- "incl %2\n\t"
- "testb %b0,%b0\n\t"
- "jne 1b\n\t"
- "xorl %0,%0\n\t"
- "jmp 3f\n"
- "2:\tmovl $1,%0\n\t"
- "jb 3f\n\t"
- "negl %0\n"
- "3:"
- :"=q" (__res), "=r" (cs), "=r" (ct)
- :"1" (cs), "2" (ct)
- : "memory" );
-return __res;
-}
-
-#define __HAVE_ARCH_STRNCMP
-static inline int strncmp(const char * cs,const char * ct,size_t count)
-{
-register int __res;
-__asm__ __volatile__(
- "\n1:\tdecl %3\n\t"
- "js 2f\n\t"
- "movb (%1),%b0\n\t"
- "incl %1\n\t"
- "cmpb %b0,(%2)\n\t"
- "jne 3f\n\t"
- "incl %2\n\t"
- "testb %b0,%b0\n\t"
- "jne 1b\n"
- "2:\txorl %0,%0\n\t"
- "jmp 4f\n"
- "3:\tmovl $1,%0\n\t"
- "jb 4f\n\t"
- "negl %0\n"
- "4:"
- :"=q" (__res), "=r" (cs), "=r" (ct), "=r" (count)
- :"1" (cs), "2" (ct), "3" (count));
-return __res;
-}
-
-#define __HAVE_ARCH_STRCHR
-static inline char * strchr(const char * s, int c)
-{
-register char * __res;
-__asm__ __volatile__(
- "movb %%al,%%ah\n"
- "1:\tmovb (%1),%%al\n\t"
- "cmpb %%ah,%%al\n\t"
- "je 2f\n\t"
- "incl %1\n\t"
- "testb %%al,%%al\n\t"
- "jne 1b\n\t"
- "xorl %1,%1\n"
- "2:\tmovl %1,%0\n\t"
- :"=a" (__res), "=r" (s)
- :"0" (c), "1" (s));
-return __res;
-}
-
-#define __HAVE_ARCH_STRRCHR
-static inline char * strrchr(const char * s, int c)
-{
-int d0, d1;
-register char * __res;
-__asm__ __volatile__(
- "movb %%al,%%ah\n"
- "1:\tlodsb\n\t"
- "cmpb %%ah,%%al\n\t"
- "jne 2f\n\t"
- "leal -1(%%esi),%0\n"
- "2:\ttestb %%al,%%al\n\t"
- "jne 1b"
- :"=d" (__res), "=&S" (d0), "=&a" (d1)
- :"0" (0), "1" (s), "2" (c));
-return __res;
-}
-
-
-#define __HAVE_ARCH_STRCSPN
-static inline size_t strcspn(const char * cs, const char * ct)
-{
-int d0, d1;
-register char * __res;
-__asm__ __volatile__(
- "movl %6,%%edi\n\t"
- "repne\n\t"
- "scasb\n\t"
- "notl %%ecx\n\t"
- "decl %%ecx\n\t"
- "movl %%ecx,%%edx\n"
- "1:\tlodsb\n\t"
- "testb %%al,%%al\n\t"
- "je 2f\n\t"
- "movl %6,%%edi\n\t"
- "movl %%edx,%%ecx\n\t"
- "repne\n\t"
- "scasb\n\t"
- "jne 1b\n"
- "2:\tdecl %0"
- :"=S" (__res), "=&a" (d0), "=&c" (d1)
- :"0" (cs), "1" (0), "2" (0xffffffff), "g" (ct)
- :"dx", "di");
-return __res-cs;
-}
-
-
-#define __HAVE_ARCH_STRLEN
-static inline size_t strlen(const char * s)
-{
-/*
- * slightly slower on a 486, but with better chances of
- * register allocation
- */
-register char dummy, *tmp= (char *)s;
-__asm__ __volatile__(
- "\n1:\t"
- "movb\t(%0),%1\n\t"
- "incl\t%0\n\t"
- "testb\t%1,%1\n\t"
- "jne\t1b"
- :"=r" (tmp),"=q" (dummy)
- :"0" (s)
- : "memory" );
-return (tmp-s-1);
-}
-
-/* Added by Gertjan van Wingerde to make minix and sysv module work */
-#define __HAVE_ARCH_STRNLEN
-static inline size_t strnlen(const char * s, size_t count)
-{
-int d0;
-register int __res;
-__asm__ __volatile__(
- "movl %3,%0\n\t"
- "jmp 2f\n"
- "1:\tcmpb $0,(%0)\n\t"
- "je 3f\n\t"
- "incl %0\n"
- "2:\tdecl %2\n\t"
- "cmpl $-1,%2\n\t"
- "jne 1b\n"
- "3:\tsubl %3,%0"
- :"=a" (__res), "=&d" (d0)
- :"1" (count), "c" (s));
-return __res;
-}
-/* end of additional stuff */
-
-
-/*
- * These ought to get tweaked to do some cache priming.
- */
-
-static inline void * __memcpy_by4(void * to, const void * from, size_t n)
-{
-register void *tmp = (void *)to;
-register int dummy1,dummy2;
-__asm__ __volatile__ (
- "\n1:\tmovl (%2),%0\n\t"
- "addl $4,%2\n\t"
- "movl %0,(%1)\n\t"
- "addl $4,%1\n\t"
- "decl %3\n\t"
- "jnz 1b"
- :"=r" (dummy1), "=r" (tmp), "=r" (from), "=r" (dummy2)
- :"1" (tmp), "2" (from), "3" (n/4)
- :"memory");
-return (to);
-}
-
-static inline void * __memcpy_by2(void * to, const void * from, size_t n)
-{
-register void *tmp = (void *)to;
-register int dummy1,dummy2;
-__asm__ __volatile__ (
- "shrl $1,%3\n\t"
- "jz 2f\n" /* only a word */
- "1:\tmovl (%2),%0\n\t"
- "addl $4,%2\n\t"
- "movl %0,(%1)\n\t"
- "addl $4,%1\n\t"
- "decl %3\n\t"
- "jnz 1b\n"
- "2:\tmovw (%2),%w0\n\t"
- "movw %w0,(%1)"
- :"=r" (dummy1), "=r" (tmp), "=r" (from), "=r" (dummy2)
- :"1" (tmp), "2" (from), "3" (n/2)
- :"memory");
-return (to);
-}
-
-static inline void * __memcpy_g(void * to, const void * from, size_t n)
-{
-int d0, d1, d2;
-register void *tmp = (void *)to;
-__asm__ __volatile__ (
- "shrl $1,%%ecx\n\t"
- "jnc 1f\n\t"
- "movsb\n"
- "1:\tshrl $1,%%ecx\n\t"
- "jnc 2f\n\t"
- "movsw\n"
- "2:\trep\n\t"
- "movsl"
- :"=&c" (d0), "=&D" (d1), "=&S" (d2)
- :"0" (n), "1" ((long) tmp), "2" ((long) from)
- :"memory");
-return (to);
-}
-
-#define __memcpy_c(d,s,count) \
-((count%4==0) ? \
- __memcpy_by4((d),(s),(count)) : \
- ((count%2==0) ? \
- __memcpy_by2((d),(s),(count)) : \
- __memcpy_g((d),(s),(count))))
-
-#define __memcpy(d,s,count) \
-(__builtin_constant_p(count) ? \
- __memcpy_c((d),(s),(count)) : \
- __memcpy_g((d),(s),(count)))
-
-#define __HAVE_ARCH_MEMCPY
-
-#include <linux/config.h>
-
-#ifdef CONFIG_X86_USE_3DNOW
-
-#include <asm/mmx.h>
-
-/*
-** This CPU favours 3DNow strongly (eg AMD K6-II, K6-III, Athlon)
-*/
-
-static inline void * __constant_memcpy3d(void * to, const void * from, size_t len)
-{
- if (len < 512)
- return __memcpy_c(to, from, len);
- return _mmx_memcpy(to, from, len);
-}
-
-static inline void *__memcpy3d(void *to, const void *from, size_t len)
-{
- if(len < 512)
- return __memcpy_g(to, from, len);
- return _mmx_memcpy(to, from, len);
-}
-
-#define memcpy(d, s, count) \
-(__builtin_constant_p(count) ? \
- __constant_memcpy3d((d),(s),(count)) : \
- __memcpy3d((d),(s),(count)))
-
-#else /* CONFIG_X86_USE_3DNOW */
-
-/*
-** Generic routines
-*/
-
-
-#define memcpy(d, s, count) __memcpy(d, s, count)
-
-#endif /* CONFIG_X86_USE_3DNOW */
-
-
-extern void __struct_cpy_bug( void );
-
-#define struct_cpy(x,y) \
-({ \
- if (sizeof(*(x)) != sizeof(*(y))) \
- __struct_cpy_bug; \
- memcpy(x, y, sizeof(*(x))); \
-})
-
-
-#define __HAVE_ARCH_MEMMOVE
-static inline void * memmove(void * dest,const void * src, size_t n)
-{
-int d0, d1, d2;
-register void *tmp = (void *)dest;
-if (dest<src)
-__asm__ __volatile__ (
- "rep\n\t"
- "movsb"
- :"=&c" (d0), "=&S" (d1), "=&D" (d2)
- :"0" (n), "1" (src), "2" (tmp)
- :"memory");
-else
-__asm__ __volatile__ (
- "std\n\t"
- "rep\n\t"
- "movsb\n\t"
- "cld"
- :"=&c" (d0), "=&S" (d1), "=&D" (d2)
- :"0" (n), "1" (n-1+(const char *)src), "2" (n-1+(char *)tmp)
- :"memory");
-return dest;
-}
-
-
-#define __HAVE_ARCH_MEMCMP
-static inline int memcmp(const void * cs,const void * ct,size_t count)
-{
-int d0, d1, d2;
-register int __res;
-__asm__ __volatile__(
- "repe\n\t"
- "cmpsb\n\t"
- "je 1f\n\t"
- "sbbl %0,%0\n\t"
- "orb $1,%b0\n"
- "1:"
- :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
- :"0" (0), "1" (cs), "2" (ct), "3" (count));
-return __res;
-}
-
-
-#define __HAVE_ARCH_MEMCHR
-static inline void * memchr(const void * cs,int c,size_t count)
-{
-int d0;
-register void * __res;
-if (!count)
- return NULL;
-__asm__ __volatile__(
- "repne\n\t"
- "scasb\n\t"
- "je 1f\n\t"
- "movl $1,%0\n"
- "1:\tdecl %0"
- :"=D" (__res), "=&c" (d0)
- :"a" (c), "0" (cs), "1" (count));
-return __res;
-}
-
-#define __memset_cc(s,c,count) \
-((count%4==0) ? \
- __memset_cc_by4((s),(c),(count)) : \
- ((count%2==0) ? \
- __memset_cc_by2((s),(c),(count)) : \
- __memset_cg((s),(c),(count))))
-
-#define __memset_gc(s,c,count) \
-((count%4==0) ? \
- __memset_gc_by4((s),(c),(count)) : \
- ((count%2==0) ? \
- __memset_gc_by2((s),(c),(count)) : \
- __memset_gg((s),(c),(count))))
-
-#define __HAVE_ARCH_MEMSET
-#define memset(s,c,count) \
-(__builtin_constant_p(c) ? \
- (__builtin_constant_p(count) ? \
- __memset_cc((s),(c),(count)) : \
- __memset_cg((s),(c),(count))) : \
- (__builtin_constant_p(count) ? \
- __memset_gc((s),(c),(count)) : \
- __memset_gg((s),(c),(count))))
-
-static inline void * __memset_cc_by4(void * s, char c, size_t count)
-{
-/*
- * register char *tmp = s;
- */
-register char *tmp = (char *)s;
-register int dummy;
-__asm__ __volatile__ (
- "\n1:\tmovl %2,(%0)\n\t"
- "addl $4,%0\n\t"
- "decl %1\n\t"
- "jnz 1b"
- :"=r" (tmp), "=r" (dummy)
- :"q" (0x01010101UL * (unsigned char) c), "0" (tmp), "1" (count/4)
- :"memory");
-return s;
-}
-
-static inline void * __memset_cc_by2(void * s, char c, size_t count)
-{
-register void *tmp = (void *)s;
-register int dummy;
-__asm__ __volatile__ (
- "shrl $1,%1\n\t" /* may be divisible also by 4 */
- "jz 2f\n"
- "\n1:\tmovl %2,(%0)\n\t"
- "addl $4,%0\n\t"
- "decl %1\n\t"
- "jnz 1b\n"
- "2:\tmovw %w2,(%0)"
- :"=r" (tmp), "=r" (dummy)
- :"q" (0x01010101UL * (unsigned char) c), "0" (tmp), "1" (count/2)
- :"memory");
-return s;
-}
-
-static inline void * __memset_gc_by4(void * s, char c, size_t count)
-{
-register void *tmp = (void *)s;
-register int dummy;
-__asm__ __volatile__ (
- "movb %b0,%h0\n"
- "pushw %w0\n\t"
- "shll $16,%0\n\t"
- "popw %w0\n"
- "1:\tmovl %0,(%1)\n\t"
- "addl $4,%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- :"=q" (c), "=r" (tmp), "=r" (dummy)
- :"0" ((unsigned) c), "1" (tmp), "2" (count/4)
- :"memory");
-return s;
-}
-
-static inline void * __memset_gc_by2(void * s, char c, size_t count)
-{
-register void *tmp = (void *)s;
-register int dummy1,dummy2;
-__asm__ __volatile__ (
- "movb %b0,%h0\n\t"
- "shrl $1,%2\n\t" /* may be divisible also by 4 */
- "jz 2f\n\t"
- "pushw %w0\n\t"
- "shll $16,%0\n\t"
- "popw %w0\n"
- "1:\tmovl %0,(%1)\n\t"
- "addl $4,%1\n\t"
- "decl %2\n\t"
- "jnz 1b\n"
- "2:\tmovw %w0,(%1)"
- :"=q" (dummy1), "=r" (tmp), "=r" (dummy2)
- :"0" ((unsigned) c), "1" (tmp), "2" (count/2)
- :"memory");
-return s;
-}
-
-static inline void * __memset_cg(void * s, char c, size_t count)
-{
-int d0, d1;
-register void *tmp = (void *)s;
-__asm__ __volatile__ (
- "shrl $1,%%ecx\n\t"
- "rep\n\t"
- "stosw\n\t"
- "jnc 1f\n\t"
- "movb %%al,(%%edi)\n"
- "1:"
- :"=&c" (d0), "=&D" (d1)
- :"a" (0x0101U * (unsigned char) c), "0" (count), "1" (tmp)
- :"memory");
-return s;
-}
-
-static inline void * __memset_gg(void * s,char c,size_t count)
-{
-int d0, d1, d2;
-register void *tmp = (void *)s;
-__asm__ __volatile__ (
- "movb %%al,%%ah\n\t"
- "shrl $1,%%ecx\n\t"
- "rep\n\t"
- "stosw\n\t"
- "jnc 1f\n\t"
- "movb %%al,(%%edi)\n"
- "1:"
- :"=&c" (d0), "=&D" (d1), "=&D" (d2)
- :"0" (count), "1" (tmp), "2" (c)
- :"memory");
-return s;
-}
-
-
-/*
- * find the first occurrence of byte 'c', or 1 past the area if none
- */
-#define __HAVE_ARCH_MEMSCAN
-static inline void * memscan(void * addr, int c, size_t size)
-{
- if (!size)
- return addr;
- __asm__("repnz; scasb
- jnz 1f
- dec %%edi
-1: "
- : "=D" (addr), "=c" (size)
- : "0" (addr), "1" (size), "a" (c));
- return addr;
-}
-
-#endif
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 96f4e52fc7f7..74122e641a17 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -8,13 +8,7 @@
* byte string operations. But on a 386 or a PPro the
* byte string ops are faster than doing it by hand
* (MUCH faster on a Pentium).
- *
- * Also, the byte strings actually work correctly. Forget
- * the i486 routines for now as they may be broken..
*/
-#if FIXED_486_STRING && defined(CONFIG_X86_USE_STRING_486)
-#include <asm/string-486.h>
-#else
/*
* This string-include defines all string functions as inline
@@ -525,7 +519,6 @@ static inline void * memscan(void * addr, int c, size_t size)
return addr;
}
-#endif /* CONFIG_X86_USE_STRING_486 */
#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 5d5588788fe5..fc8f116430bc 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -150,6 +150,11 @@ struct __xchg_dummy { unsigned long a[100]; };
* to do an SIMD/3DNOW!/MMX/FPU 64-bit store here, but that
* might have an implicit FPU-save as a cost, so it's not
* clear which path to go.)
+ *
+ * cmpxchg8b must be used with the lock prefix here to allow
+ * the instruction to be executed atomically, see page 3-102
+ * of the instruction set reference 24319102.pdf. We need
+ * the reader side to see the coherent 64bit value.
*/
static inline void __set_64bit (unsigned long long * ptr,
unsigned int low, unsigned int high)
@@ -158,7 +163,7 @@ static inline void __set_64bit (unsigned long long * ptr,
"\n1:\t"
"movl (%0), %%eax\n\t"
"movl 4(%0), %%edx\n\t"
- "cmpxchg8b (%0)\n\t"
+ "lock cmpxchg8b (%0)\n\t"
"jnz 1b"
: /* no outputs */
: "D"(ptr),
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index a8c1e65a053b..37011ca30459 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -49,7 +49,6 @@
* Bus types
*/
#define EISA_bus 0
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 941197b42632..b3fd05c8cfd8 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -143,7 +143,6 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
* Bus types
*/
#define EISA_bus 0
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index a04a5e7f4cb1..91a7410dc21f 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -28,7 +28,6 @@
* Bus types
*/
#define EISA_bus 0
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h
index 0fee763d3012..587972a02d2f 100644
--- a/include/asm-sparc64/processor.h
+++ b/include/asm-sparc64/processor.h
@@ -25,7 +25,6 @@
/* Bus types */
#define EISA_bus 0
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index b26057b85ea0..80a3e97ab59b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -40,7 +40,7 @@
struct completion;
-#ifdef CONFIG_DEBUG_KERNEL
+#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
void __might_sleep(char *file, int line);
#define might_sleep() __might_sleep(__FILE__, __LINE__)
#else
diff --git a/kernel/exit.c b/kernel/exit.c
index b923fd64591b..f7f57b1b8ab7 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -636,11 +636,11 @@ NORET_TYPE void do_exit(long code)
{
struct task_struct *tsk = current;
- if (in_interrupt())
+ if (unlikely(in_interrupt()))
panic("Aiee, killing interrupt handler!");
- if (!tsk->pid)
+ if (unlikely(!tsk->pid))
panic("Attempted to kill the idle task!");
- if (tsk->pid == 1)
+ if (unlikely(tsk->pid == 1))
panic("Attempted to kill init!");
tsk->flags |= PF_EXITING;
del_timer_sync(&tsk->real_timer);
diff --git a/kernel/ksyms.c b/kernel/ksyms.c
index c2f7e5bc4dde..092018c75a66 100644
--- a/kernel/ksyms.c
+++ b/kernel/ksyms.c
@@ -481,7 +481,7 @@ EXPORT_SYMBOL(jiffies_64);
EXPORT_SYMBOL(xtime);
EXPORT_SYMBOL(do_gettimeofday);
EXPORT_SYMBOL(do_settimeofday);
-#ifdef CONFIG_DEBUG_KERNEL
+#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
EXPORT_SYMBOL(__might_sleep);
#endif
#if !defined(__ia64__)
diff --git a/kernel/sched.c b/kernel/sched.c
index 63efff4f8d68..6a150715da37 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2253,7 +2253,7 @@ void __init sched_init(void)
enter_lazy_tlb(&init_mm, current, smp_processor_id());
}
-#ifdef CONFIG_DEBUG_KERNEL
+#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
void __might_sleep(char *file, int line)
{
#if defined(in_atomic)
diff --git a/kernel/sys.c b/kernel/sys.c
index 5997c8b85e6e..5fe28f2ef32d 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -390,6 +390,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg)
device_shutdown();
printk(KERN_EMERG "System halted.\n");
machine_halt();
+ unlock_kernel();
do_exit(0);
break;
@@ -399,6 +400,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg)
device_shutdown();
printk(KERN_EMERG "Power down.\n");
machine_power_off();
+ unlock_kernel();
do_exit(0);
break;
diff --git a/net/atm/proc.c b/net/atm/proc.c
index e0c1bbf57148..791f14b30a53 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -549,9 +549,12 @@ int atm_proc_dev_register(struct atm_dev *dev)
digits = 0;
for (num = dev->number; num; num /= 10) digits++;
if (!digits) digits++;
- dev->proc_name = kmalloc(strlen(dev->type)+digits+2,GFP_KERNEL);
- if (!dev->proc_name) goto fail1;
+
+ dev->proc_name = kmalloc(strlen(dev->type) + digits + 2, GFP_KERNEL);
+ if (!dev->proc_name)
+ goto fail1;
sprintf(dev->proc_name,"%s:%d",dev->type, dev->number);
+
dev->proc_entry = create_proc_entry(dev->proc_name, 0, atm_proc_root);
if (!dev->proc_entry)
goto fail0;
diff --git a/sound/oss/Makefile b/sound/oss/Makefile
index de9f457b82cc..1f319d83c477 100644
--- a/sound/oss/Makefile
+++ b/sound/oss/Makefile
@@ -69,7 +69,7 @@ obj-$(CONFIG_SOUND_TRIDENT) += trident.o ac97_codec.o
obj-$(CONFIG_SOUND_EMU10K1) += ac97_codec.o
obj-$(CONFIG_SOUND_RME96XX) += rme96xx.o
obj-$(CONFIG_SOUND_BT878) += btaudio.o
-obj-$(CONFIG_SOUND_EMU10K1) += ac97_codec.o
+obj-$(CONFIG_SOUND_IT8172) += ite8172.o ac97_codec.o
ifeq ($(CONFIG_MIDI_EMU10K1),y)
obj-$(CONFIG_SOUND_EMU10K1) += sound.o
diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c
index 6899454d7c28..22a7f0ea6481 100644
--- a/sound/oss/cmpci.c
+++ b/sound/oss/cmpci.c
@@ -2034,7 +2034,7 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
if (s->dma_adc.mapped)
s->dma_adc.count &= s->dma_adc.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
@@ -2053,7 +2053,7 @@ static int cm_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
s->dma_adc.count &= s->dma_adc.fragsize-1;
}
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
diff --git a/sound/oss/cs4232.c b/sound/oss/cs4232.c
index 75888189c74e..31ec3553bbc3 100644
--- a/sound/oss/cs4232.c
+++ b/sound/oss/cs4232.c
@@ -382,10 +382,11 @@ static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_id *card_id, c
isapnpcfg->io_base = dev->resource[0].start;
if (probe_cs4232(isapnpcfg,TRUE) == 0) {
printk(KERN_ERR "cs4232: ISA PnP card found, but not detected?\n");
+ kfree(isapnpcfg);
return -ENODEV;
}
attach_cs4232(isapnpcfg);
- dev->driver_data = isapnpcfg;
+ pci_set_drvdata(dev,isapnpcfg);
return 0;
}
diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c
index fe7e971804ca..3f0a251bff97 100644
--- a/sound/oss/es1370.c
+++ b/sound/oss/es1370.c
@@ -1632,7 +1632,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
if (s->dma_adc.mapped)
s->dma_adc.count &= s->dma_adc.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
@@ -1652,7 +1652,7 @@ static int es1370_ioctl(struct inode *inode, struct file *file, unsigned int cmd
if (s->dma_dac2.mapped)
s->dma_dac2.count &= s->dma_dac2.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
@@ -2113,7 +2113,7 @@ static int es1370_ioctl_dac(struct inode *inode, struct file *file, unsigned int
if (s->dma_dac1.mapped)
s->dma_dac1.count &= s->dma_dac1.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
index 0c4baff6b170..60331859f645 100644
--- a/sound/oss/es1371.c
+++ b/sound/oss/es1371.c
@@ -1820,7 +1820,7 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
if (s->dma_adc.mapped)
s->dma_adc.count &= s->dma_adc.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
@@ -1840,9 +1840,10 @@ static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd
if (s->dma_dac2.mapped)
s->dma_dac2.count &= s->dma_dac2.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
+
case SNDCTL_DSP_GETBLKSIZE:
if (file->f_mode & FMODE_WRITE) {
if ((val = prog_dmabuf_dac2(s)))
@@ -2291,7 +2292,7 @@ static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int
if (s->dma_dac1.mapped)
s->dma_dac1.count &= s->dma_dac1.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
index e1a1408bee54..c3ac13446810 100644
--- a/sound/oss/esssolo1.c
+++ b/sound/oss/esssolo1.c
@@ -1469,7 +1469,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if (s->dma_adc.mapped)
s->dma_adc.count &= s->dma_adc.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
@@ -1495,7 +1495,7 @@ static int solo1_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
cinfo.bytes, cinfo.blocks, cinfo.ptr, s->dma_dac.buforder, s->dma_dac.numfrag, s->dma_dac.fragshift,
s->dma_dac.swptr, s->dma_dac.count, s->dma_dac.fragsize, s->dma_dac.dmasize, s->dma_dac.fragsamples);
#endif
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index 7a5995c090f0..06686f1faeef 100644
--- a/sound/oss/i810_audio.c
+++ b/sound/oss/i810_audio.c
@@ -101,6 +101,9 @@
#ifndef PCI_DEVICE_ID_INTEL_ICH3
#define PCI_DEVICE_ID_INTEL_ICH3 0x2485
#endif
+#ifndef PCI_DEVICE_ID_INTEL_ICH4
+#define PCI_DEVICE_ID_INTEL_ICH4 0x24c5
+#endif
#ifndef PCI_DEVICE_ID_INTEL_440MX
#define PCI_DEVICE_ID_INTEL_440MX 0x7195
#endif
@@ -110,6 +113,9 @@
#ifndef PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO
#define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO 0x01b1
#endif
+#ifndef PCI_DEVICE_ID_AMD_768_AUDIO
+#define PCI_DEVICE_ID_AMD_768_AUDIO 0x7445
+#endif
static int ftsodell=0;
static int strict_clocking=0;
@@ -230,8 +236,11 @@ enum {
INTEL440MX,
INTELICH2,
INTELICH3,
+ INTELICH4,
SI7012,
- NVIDIA_NFORCE
+ NVIDIA_NFORCE,
+ AMD768,
+ AMD8111
};
static char * card_names[] = {
@@ -240,8 +249,11 @@ static char * card_names[] = {
"Intel 440MX",
"Intel ICH2",
"Intel ICH3",
+ "Intel ICH4",
"SiS 7012",
- "NVIDIA nForce Audio"
+ "NVIDIA nForce Audio",
+ "AMD 768",
+ "AMD-8111 IOHub"
};
static struct pci_device_id i810_pci_tbl [] __initdata = {
@@ -255,10 +267,16 @@ static struct pci_device_id i810_pci_tbl [] __initdata = {
PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH2},
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH3,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH3},
+ {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH4,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, INTELICH4},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7012,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, SI7012},
{PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, NVIDIA_NFORCE},
+ {PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_768_AUDIO,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD768},
+ {PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_AUDIO,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD8111},
{0,}
};
@@ -2686,6 +2704,14 @@ static int __init i810_ac97_init(struct i810_card *card)
break;
}
+ codec->codec_write(codec, AC97_EXTENDED_MODEM_ID, 0L);
+ if(codec->codec_read(codec, AC97_EXTENDED_MODEM_ID))
+ {
+ printk(KERN_WARNING "i810_audio: codec %d is a softmodem - skipping.\n", num_ac97);
+ kfree(codec);
+ continue;
+ }
+
card->ac97_features = eid;
/* Now check the codec for useful features to make up for
diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c
index c29b7f657f59..132d312a0be4 100644
--- a/sound/oss/maestro.c
+++ b/sound/oss/maestro.c
@@ -2760,7 +2760,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
if (s->dma_adc.mapped)
s->dma_adc.count &= s->dma_adc.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
@@ -2777,7 +2777,7 @@ static int ess_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
if (s->dma_dac.mapped)
s->dma_dac.count &= s->dma_dac.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
diff --git a/sound/oss/maestro3.c b/sound/oss/maestro3.c
index f0bd7d7ec7fa..4a32c70b8d73 100644
--- a/sound/oss/maestro3.c
+++ b/sound/oss/maestro3.c
@@ -1815,7 +1815,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
if (s->dma_adc.mapped)
s->dma_adc.count &= s->dma_adc.fragsize-1;
spin_unlock_irqrestore(&card->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
@@ -1830,7 +1830,7 @@ static int m3_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
if (s->dma_dac.mapped)
s->dma_dac.count &= s->dma_dac.fragsize-1;
spin_unlock_irqrestore(&card->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c
index a25f30980f86..a8817a2d8d02 100644
--- a/sound/oss/mpu401.c
+++ b/sound/oss/mpu401.c
@@ -15,6 +15,7 @@
* Alan Cox modularisation, use normal request_irq, use dev_id
* Bartlomiej Zolnierkiewicz removed some __init to allow using many drivers
* Chris Rankin Update the module-usage counter for the coprocessor
+ * Zwane Mwaikambo Changed attach/unload resource freeing
*/
#include <linux/module.h>
@@ -79,7 +80,7 @@ struct mpu_config
static void mpu401_close(int dev);
-static int mpu401_status(struct mpu_config *devc)
+static inline int mpu401_status(struct mpu_config *devc)
{
return inb(STATPORT(devc->base));
}
@@ -87,17 +88,17 @@ static int mpu401_status(struct mpu_config *devc)
#define input_avail(devc) (!(mpu401_status(devc)&INPUT_AVAIL))
#define output_ready(devc) (!(mpu401_status(devc)&OUTPUT_READY))
-static void write_command(struct mpu_config *devc, unsigned char cmd)
+static inline void write_command(struct mpu_config *devc, unsigned char cmd)
{
outb(cmd, COMDPORT(devc->base));
}
-static int read_data(struct mpu_config *devc)
+static inline int read_data(struct mpu_config *devc)
{
return inb(DATAPORT(devc->base));
}
-static void write_data(struct mpu_config *devc, unsigned char byte)
+static inline void write_data(struct mpu_config *devc, unsigned char byte)
{
outb(byte, DATAPORT(devc->base));
}
@@ -962,12 +963,12 @@ static void mpu401_chk_version(int n, struct mpu_config *devc)
spin_unlock_irqrestore(&devc->lock,flags);
}
-void attach_mpu401(struct address_info *hw_config, struct module *owner)
+int attach_mpu401(struct address_info *hw_config, struct module *owner)
{
unsigned long flags;
char revision_char;
- int m;
+ int m, ret;
struct mpu_config *devc;
hw_config->slots[1] = -1;
@@ -975,7 +976,8 @@ void attach_mpu401(struct address_info *hw_config, struct module *owner)
if (m == -1)
{
printk(KERN_WARNING "MPU-401: Too many midi devices detected\n");
- return;
+ ret = -ENOMEM;
+ goto out_err;
}
devc = &dev_conf[m];
devc->base = hw_config->io_base;
@@ -1006,16 +1008,16 @@ void attach_mpu401(struct address_info *hw_config, struct module *owner)
if (!reset_mpu401(devc))
{
printk(KERN_WARNING "mpu401: Device didn't respond\n");
- sound_unload_mididev(m);
- return;
+ ret = -ENODEV;
+ goto out_mididev;
}
if (!devc->shared_irq)
{
if (request_irq(devc->irq, mpuintr, 0, "mpu401", (void *)m) < 0)
{
printk(KERN_WARNING "mpu401: Failed to allocate IRQ%d\n", devc->irq);
- sound_unload_mididev(m);
- return;
+ ret = -ENOMEM;
+ goto out_mididev;
}
}
spin_lock_irqsave(&devc->lock,flags);
@@ -1024,7 +1026,12 @@ void attach_mpu401(struct address_info *hw_config, struct module *owner)
mpu401_chk_version(m, devc);
spin_unlock_irqrestore(&devc->lock,flags);
}
- request_region(hw_config->io_base, 2, "mpu401");
+
+ if (!request_region(hw_config->io_base, 2, "mpu401"))
+ {
+ ret = -ENOMEM;
+ goto out_irq;
+ }
if (devc->version != 0)
if (mpu_cmd(m, 0xC5, 0) >= 0) /* Set timebase OK */
@@ -1036,9 +1043,9 @@ void attach_mpu401(struct address_info *hw_config, struct module *owner)
if (mpu401_synth_operations[m] == NULL)
{
- sound_unload_mididev(m);
printk(KERN_ERR "mpu401: Can't allocate memory\n");
- return;
+ ret = -ENOMEM;
+ goto out_resource;
}
if (!(devc->capabilities & MPU_CAP_INTLG)) /* No intelligent mode */
{
@@ -1117,6 +1124,17 @@ void attach_mpu401(struct address_info *hw_config, struct module *owner)
hw_config->slots[1] = m;
sequencer_init();
+
+ return 0;
+
+out_resource:
+ release_region(hw_config->io_base, 2);
+out_irq:
+ free_irq(devc->irq, (void *)m);
+out_mididev:
+ sound_unload_mididev(m);
+out_err:
+ return ret;
}
static int reset_mpu401(struct mpu_config *devc)
@@ -1227,15 +1245,17 @@ void unload_mpu401(struct address_info *hw_config)
{
void *p;
int n=hw_config->slots[1];
-
- release_region(hw_config->io_base, 2);
- if (hw_config->always_detect == 0 && hw_config->irq > 0)
- free_irq(hw_config->irq, (void *)n);
- p=mpu401_synth_operations[n];
- sound_unload_mididev(n);
- sound_unload_timerdev(hw_config->slots[2]);
- if(p)
- kfree(p);
+
+ if (n != -1) {
+ release_region(hw_config->io_base, 2);
+ if (hw_config->always_detect == 0 && hw_config->irq > 0)
+ free_irq(hw_config->irq, (void *)n);
+ p=mpu401_synth_operations[n];
+ sound_unload_mididev(n);
+ sound_unload_timerdev(hw_config->slots[2]);
+ if(p)
+ kfree(p);
+ }
}
/*****************************************************
@@ -1752,6 +1772,7 @@ MODULE_PARM(io, "i");
int __init init_mpu401(void)
{
+ int ret;
/* Can be loaded either for module use or to provide functions
to others */
if (io != -1 && irq != -1) {
@@ -1759,7 +1780,8 @@ int __init init_mpu401(void)
cfg.io_base = io;
if (probe_mpu401(&cfg) == 0)
return -ENODEV;
- attach_mpu401(&cfg, THIS_MODULE);
+ if ((ret = attach_mpu401(&cfg, THIS_MODULE)))
+ return ret;
}
return 0;
diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c
index 53faa51a9ed2..dc22676e8e07 100644
--- a/sound/oss/nm256_audio.c
+++ b/sound/oss/nm256_audio.c
@@ -895,7 +895,7 @@ nm256_resetAC97 (struct ac97_hwint *dev)
/* Reset the mixer. 'Tis magic! */
nm256_writePort8 (card, 2, 0x6c0, 1);
- nm256_writePort8 (card, 2, 0x6cc, 0x87);
+// nm256_writePort8 (card, 2, 0x6cc, 0x87); /* This crashes Dell latitudes */
nm256_writePort8 (card, 2, 0x6cc, 0x80);
nm256_writePort8 (card, 2, 0x6cc, 0x0);
diff --git a/sound/oss/pss.c b/sound/oss/pss.c
index 5619cbfd3081..3f33ca7bd18a 100644
--- a/sound/oss/pss.c
+++ b/sound/oss/pss.c
@@ -1127,7 +1127,7 @@ MODULE_PARM_DESC(pss_firmware, "Location of the firmware file (default - /etc/so
MODULE_PARM(pss_mixer, "b");
MODULE_PARM_DESC(pss_mixer, "Enable (1) or disable (0) PSS mixer (controlling of output volume, bass, treble, synth volume). The mixer is not available on all PSS cards.");
MODULE_AUTHOR("Hannu Savolainen, Vladimir Michl");
-MODULE_DESCRIPTION("Module for PSS sound cards (based on AD1848, ADSP-2115 and ESC614). This module includes control of output amplifier and synth volume of the Beethoven ADSP-16 card (this may work with other PSS cards).\n");
+MODULE_DESCRIPTION("Module for PSS sound cards (based on AD1848, ADSP-2115 and ESC614). This module includes control of output amplifier and synth volume of the Beethoven ADSP-16 card (this may work with other PSS cards).");
MODULE_LICENSE("GPL");
diff --git a/sound/oss/sb_audio.c b/sound/oss/sb_audio.c
index dda11e473696..ff2d506fceb0 100644
--- a/sound/oss/sb_audio.c
+++ b/sound/oss/sb_audio.c
@@ -602,8 +602,8 @@ static int sb16_audio_set_speed(int dev, int speed)
if (speed > 0)
{
- if (speed < 5000) /* which of these */
- speed = 4000; /* is correct ??? */
+ if (speed < 5000)
+ speed = 5000;
if (speed > max_speed)
speed = max_speed;
diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c
index c9602e484394..2689d6277418 100644
--- a/sound/oss/sb_card.c
+++ b/sound/oss/sb_card.c
@@ -373,7 +373,7 @@ static struct {
0,0,0,0,
0,1,1,-1},
{"Sound Blaster AWE 32",
- ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0047),
+ ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0046),
ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0031),
0,0,0,0,
0,1,1,-1},
diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
index 79c35a9c53a9..387c2f76f317 100644
--- a/sound/oss/sonicvibes.c
+++ b/sound/oss/sonicvibes.c
@@ -1803,7 +1803,7 @@ static int sv_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
if (s->dma_adc.mapped)
s->dma_adc.count &= s->dma_adc.fragsize-1;
spin_unlock_irqrestore(&s->lock, flags);
- if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
+ if (copy_to_user((void *)arg, &cinfo, sizeof(cinfo)))
return -EFAULT;
return 0;
diff --git a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c
index 7b02ce17d477..a0012f93091b 100644
--- a/sound/oss/ymfpci.c
+++ b/sound/oss/ymfpci.c
@@ -2653,7 +2653,7 @@ static struct pci_driver ymfpci_driver = {
name: "ymfpci",
id_table: ymf_id_tbl,
probe: ymf_probe_one,
- remove: __devexit_p(ymf_remove_one),
+ remove: __devexit_p(ymf_remove_one),
suspend: ymf_suspend,
resume: ymf_resume
};