## Automatically generated incremental diff
## From:   linux-2.2.22-rc2
## To:     linux-2.2.22-rc3
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.2.22-rc2/Makefile linux-2.2.22-rc3/Makefile
--- linux-2.2.22-rc2/Makefile	Sat Sep 14 07:48:20 2002
+++ linux-2.2.22-rc3/Makefile	Sat Sep 14 07:48:22 2002
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 22
-EXTRAVERSION = rc2
+EXTRAVERSION = rc3
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
diff -urN linux-2.2.22-rc2/drivers/block/loop.c linux-2.2.22-rc3/drivers/block/loop.c
--- linux-2.2.22-rc2/drivers/block/loop.c	Sun Mar 25 08:31:24 2001
+++ linux-2.2.22-rc3/drivers/block/loop.c	Sat Sep 14 07:48:22 2002
@@ -334,8 +334,9 @@
 	set_fs(old_fs);
 
 	if (retval < 0) {
-		printk(KERN_WARNING "loop: cannot create block - FS write failed: code %d\n", 
-									retval);
+		printk(KERN_WARNING
+		    "loop: cannot create block - FS write failed: code %d\n",
+		    (int)retval);
 		return FALSE;
 	} else {
 		return TRUE;
diff -urN linux-2.2.22-rc2/drivers/isdn/isdn_common.c linux-2.2.22-rc3/drivers/isdn/isdn_common.c
--- linux-2.2.22-rc2/drivers/isdn/isdn_common.c	Sat Sep 14 07:48:20 2002
+++ linux-2.2.22-rc3/drivers/isdn/isdn_common.c	Sat Sep 14 07:48:22 2002
@@ -1008,6 +1008,10 @@
 			goto out;
 		}
 		chidx = isdn_minor2chan(minor);
+		if (count > 131072) {
+			retval = -EINVAL;
+			goto out;
+		}
 		if (!(p = kmalloc(count, GFP_KERNEL))) {
 			retval = -ENOMEM;
 			goto out;
diff -urN linux-2.2.22-rc2/drivers/sbus/char/openprom.c linux-2.2.22-rc3/drivers/sbus/char/openprom.c
--- linux-2.2.22-rc2/drivers/sbus/char/openprom.c	Sat Sep 14 07:48:20 2002
+++ linux-2.2.22-rc3/drivers/sbus/char/openprom.c	Sat Sep 14 07:48:22 2002
@@ -75,7 +75,7 @@
 
 	get_user_ret(bufsize, &info->oprom_size, -EFAULT);
 
-	if (bufsize <= 0 || bufsize > OPROMMAXPARAM)
+	if (bufsize == 0 || bufsize > OPROMMAXPARAM)
 		return -EINVAL;
 
 	if (!(*opp_p = kmalloc(sizeof(int) + bufsize + 1, GFP_KERNEL)))
diff -urN linux-2.2.22-rc2/drivers/scsi/3w-xxxx.c linux-2.2.22-rc3/drivers/scsi/3w-xxxx.c
--- linux-2.2.22-rc2/drivers/scsi/3w-xxxx.c	Sat Sep 14 07:48:20 2002
+++ linux-2.2.22-rc3/drivers/scsi/3w-xxxx.c	Sat Sep 14 07:48:22 2002
@@ -139,6 +139,11 @@
    1.02.00.024 - Fix bug in raw command post with data ioctl method.
                  Fix bug where rollcall sometimes failed with cable errors.
    1.02.00.025 - Print unit # on all command timeouts.
+   1.02.00.026 - Fix possible infinite retry bug with power glitch induced
+                 drive timeouts.
+                 Cleanup some AEN severity levels.
+   1.02.00.027 - Add drive not supported AEN code for SATA controllers.
+                 Remove spurious unknown ioctl error message.
 */
 
 #include <linux/module.h>
@@ -194,7 +199,7 @@
 };
 
 /* Globals */
-char *tw_driver_version="1.02.00.025";
+char *tw_driver_version="1.02.00.027";
 TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT];
 int tw_device_extension_count = 0;
 
@@ -205,7 +210,7 @@
 {
 	TW_Param *param;
 	unsigned short aen;
-	int error = 0;
+	int error = 0, table_max = 0;
 
 	if (tw_dev->alignment_virtual_address[request_id] == NULL) {
 		printk(KERN_WARNING "3w-xxxx: tw_aen_complete(): Bad alignment virtual address.\n");
@@ -219,7 +224,8 @@
 	if (aen == 0x0ff) {
 		printk(KERN_WARNING "3w-xxxx: scsi%d: AEN: INFO: AEN queue overflow.\n", tw_dev->host->host_no);
 	} else {
-		if ((aen & 0x0ff) < TW_AEN_STRING_MAX) {
+		table_max = sizeof(tw_aen_string)/sizeof(char *);
+		if ((aen & 0x0ff) < table_max) {
 			if ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') {
 				printk(KERN_WARNING "3w-xxxx: scsi%d: AEN: %s%d.\n", tw_dev->host->host_no, tw_aen_string[aen & 0xff], aen >> 8);
 			} else {
@@ -281,7 +287,7 @@
 	int first_reset = 0;
 	int queue = 0;
 	int imax, i;
-	int found = 0;
+	int found = 0, table_max = 0;
 
 	dprintk(KERN_NOTICE "3w-xxxx: tw_aen_drain_queue()\n");
 
@@ -401,7 +407,8 @@
 						if (aen == 0x0ff) {
 							printk(KERN_WARNING "3w-xxxx: AEN: INFO: AEN queue overflow.\n");
 						} else {
-							if ((aen & 0x0ff) < TW_AEN_STRING_MAX) {
+							table_max = sizeof(tw_aen_string)/sizeof(char *);
+							if ((aen & 0x0ff) < table_max) {
 								if ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') {
 									printk(KERN_WARNING "3w-xxxx: AEN: %s%d.\n", tw_aen_string[aen & 0xff], aen >> 8);
 								} else {
@@ -1527,7 +1534,8 @@
 
 					/* If error, command failed */
 					if (error == 1) {
-						tw_dev->srb[request_id]->result = (DID_RESET << 16);
+						/* Ask for a host reset */
+						tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
 					}
 					
 					/* Now complete the io */
@@ -1866,7 +1874,7 @@
 				return 1;
 			}
 		default:
-			printk(KERN_WARNING "3w-xxxx: Unknown ioctl 0x%x.\n", opcode);
+			dprintk(KERN_WARNING "3w-xxxx: Unknown ioctl 0x%x.\n", opcode);
 			tw_dev->state[request_id] = TW_S_COMPLETED;
 			tw_state_request_finish(tw_dev, request_id);
 			tw_dev->srb[request_id]->result = (DID_OK << 16);
diff -urN linux-2.2.22-rc2/drivers/scsi/3w-xxxx.h linux-2.2.22-rc3/drivers/scsi/3w-xxxx.h
--- linux-2.2.22-rc2/drivers/scsi/3w-xxxx.h	Sat Sep 14 07:48:20 2002
+++ linux-2.2.22-rc3/drivers/scsi/3w-xxxx.h	Sat Sep 14 07:48:22 2002
@@ -91,14 +91,13 @@
 	"INFO: Verify started: Unit #",                // 0x029
 	"ERROR: Verify failed: Port #",                // 0x02A
 	"INFO: Verify complete: Unit #",               // 0x02B
-	"ERROR: Overwrote bad sector during rebuild: Port #",   //0x02C
-	"ERROR: Encountered bad sector during rebuild: Port #", //0x02D
-	"INFO: Replacement drive is too small: Port #",         //0x02E
-	"WARNING: Verify error: Unit not previously initialized: Unit #" //0x02F
+	"WARNING: Overwrote bad sector during rebuild: Port #",  //0x02C
+	"ERROR: Encountered bad sector during rebuild: Port #",  //0x02D
+	"ERROR: Replacement drive is too small: Port #",         //0x02E
+	"WARNING: Verify error: Unit not previously initialized: Unit #", //0x02F
+	"ERROR: Drive not supported: Port #"           // 0x030
 };
 
-#define TW_AEN_STRING_MAX                      0x030
-
 /*
    Sense key lookup table
    Format: ESDC/flags,SenseKey,AdditionalSenseCode,AdditionalSenseCodeQualifier
diff -urN linux-2.2.22-rc2/drivers/usb/mdc800.c linux-2.2.22-rc3/drivers/usb/mdc800.c
--- linux-2.2.22-rc2/drivers/usb/mdc800.c	Fri Nov  2 08:39:08 2001
+++ linux-2.2.22-rc3/drivers/usb/mdc800.c	Sat Sep 14 07:48:22 2002
@@ -634,7 +634,7 @@
  */
 static ssize_t mdc800_device_read (struct file *file, char *buf, size_t len, loff_t *pos)
 {
-	int   left=len, sts=len; /* single transfer size */
+	size_t left=len, sts=len; /* single transfer size */
 	char* ptr=buf;
 
 	spin_lock (&mdc800->io_lock);
@@ -719,7 +719,7 @@
  */
 static ssize_t mdc800_device_write (struct file *file, const char *buf, size_t len, loff_t *pos)
 {
-	int i=0;
+	size_t i=0;
 
 	spin_lock (&mdc800->io_lock);
 	if (mdc800->state != READY)
diff -urN linux-2.2.22-rc2/drivers/usb/printer.c linux-2.2.22-rc3/drivers/usb/printer.c
--- linux-2.2.22-rc2/drivers/usb/printer.c	Sat Sep 14 07:48:20 2002
+++ linux-2.2.22-rc3/drivers/usb/printer.c	Sat Sep 14 07:48:22 2002
@@ -324,7 +324,8 @@
 static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
 {
 	struct usblp *usblp = file->private_data;
-	int timeout, err = 0, writecount = 0;
+	int timeout, err = 0;
+	size_t writecount = 0;
 
 	while (writecount < count) {
 
diff -urN linux-2.2.22-rc2/fs/nfs/read.c linux-2.2.22-rc3/fs/nfs/read.c
--- linux-2.2.22-rc2/fs/nfs/read.c	Mon May 20 16:32:35 2002
+++ linux-2.2.22-rc3/fs/nfs/read.c	Sat Sep 14 07:48:22 2002
@@ -432,7 +432,7 @@
 		nfs_list_remove_request(req);
 
 		if (task->tk_status >= 0) {
-			char *p = page_address(page);
+			char *p = (char *)page_address(page);
 			if (count < PAGE_CACHE_SIZE) {
 				memset(p + count, 0, PAGE_CACHE_SIZE - count);
 				count = 0;
diff -urN linux-2.2.22-rc2/mm/vmalloc.c linux-2.2.22-rc3/mm/vmalloc.c
--- linux-2.2.22-rc2/mm/vmalloc.c	Mon May 20 16:32:35 2002
+++ linux-2.2.22-rc3/mm/vmalloc.c	Sat Sep 14 07:48:22 2002
@@ -160,6 +160,10 @@
 	if (!area)
 		return NULL;
 	size += PAGE_SIZE;
+	if (!size) {
+		kfree(area);
+		return NULL;
+	}
 	addr = VMALLOC_START;
 	for (p = &vmlist; (tmp = *p) ; p = &tmp->next) {
 		if ((size + addr) < addr) {
diff -urN linux-2.2.22-rc2/net/sunrpc/svcsock.c linux-2.2.22-rc3/net/sunrpc/svcsock.c
--- linux-2.2.22-rc2/net/sunrpc/svcsock.c	Sun Mar 25 08:37:42 2001
+++ linux-2.2.22-rc3/net/sunrpc/svcsock.c	Sat Sep 14 07:48:22 2002
@@ -266,10 +266,10 @@
 	set_fs(oldfs);
 #endif
 
-	dprintk("svc: socket %p sendto([%p %d... ], %d, %d) = %d\n",
-			rqstp->rq_sock,
-			iov[0].iov_base, iov[0].iov_len, nr,
-			buflen, len);
+	dprintk("svc: socket %p sendto([%p %lu... ], %d, %d) = %d\n",
+		rqstp->rq_sock,
+		iov[0].iov_base, (unsigned long)iov[0].iov_len, nr,
+		buflen, len);
 
 	return len;
 }
@@ -326,8 +326,9 @@
 	set_fs(oldfs);
 #endif
 
-	dprintk("svc: socket %p recvfrom(%p, %d) = %d\n", rqstp->rq_sock,
-				iov[0].iov_base, iov[0].iov_len, len);
+	dprintk("svc: socket %p recvfrom(%p, %lu) = %d\n", rqstp->rq_sock,
+		iov[0].iov_base, (unsigned long)iov[0].iov_len,
+		len);
 
 	return len;
 }
