PATCH: fix aec proc handling

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Fri Mar 21 2003 - 15:48:30 EST


diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.65/drivers/ide/pci/aec62xx.c linux-2.5.65-ac2/drivers/ide/pci/aec62xx.c
--- linux-2.5.65/drivers/ide/pci/aec62xx.c 2003-03-03 19:20:09.000000000 +0000
+++ linux-2.5.65-ac2/drivers/ide/pci/aec62xx.c 2003-03-07 17:35:41.000000000 +0000
@@ -38,6 +38,7 @@
         char *chipset_nums[] = {"error", "error", "error", "error",
                                 "error", "error", "850UF", "860",
                                  "860R", "865", "865R", "error" };
+ int len;
         int i;
 
         for (i = 0; i < n_aec_devs; i++) {
@@ -170,7 +171,11 @@
 #endif /* DEBUG_AEC_REGS */
                 }
         }
- return p-buffer;/* => must be less than 4k! */
+ /* p - buffer must be less than 4k! */
+ len = (p - buffer) - offset;
+ *addr = buffer + offset;
+
+ return len > count ? count : len;
 }
 #endif /* defined(DISPLAY_AEC62xx_TIMINGS) && defined(CONFIG_PROC_FS) */
 
@@ -324,7 +329,7 @@
         ide_hwif_t *hwif = HWIF(drive);
         struct hd_driveid *id = drive->id;
 
- if (id && (id->capability & 1) && drive->autodma) {
+ if ((id->capability & 1) && drive->autodma) {
                 /* Consult the list of known "bad" drives */
                 if (hwif->ide_dma_bad_drive(drive))
                         goto fast_ata_pio;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:37 EST