[PATCH] 2.5.6 compile warnings in ide-scsi.c

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Sun Mar 10 2002 - 11:45:35 EST


In kernel 2.5.6, compilation of ide-scsi.c generates some rather
unpleasant looking warnings:

ide-scsi.c: In function `idescsi_end_request':
ide-scsi.c:293: warning: comparison of distinct pointer types lacks a cast
ide-scsi.c: In function `get_timeout':
ide-scsi.c:310: warning: comparison of distinct pointer types lacks a cast

They turned out to be caused by type mismatches in uses of the
min() and max() macros. Fix below.

/Mikael

--- linux-2.5.6/drivers/scsi/ide-scsi.c.~1~ Sat Mar 9 12:53:13 2002
+++ linux-2.5.6/drivers/scsi/ide-scsi.c Sun Mar 10 17:14:12 2002
@@ -290,7 +290,7 @@
                         if (!test_bit(PC_WRITING, &pc->flags) && pc->actually_transferred && pc->actually_transferred <= 1024 && pc->buffer) {
                                 printk(", rst = ");
                                 scsi_buf = pc->scsi_cmd->request_buffer;
- hexdump(scsi_buf, min(16, pc->scsi_cmd->request_bufflen));
+ hexdump(scsi_buf, min(16U, pc->scsi_cmd->request_bufflen));
                         } else printk("\n");
                 }
         }
@@ -307,7 +307,7 @@
 
 static inline unsigned long get_timeout(idescsi_pc_t *pc)
 {
- return max(WAIT_CMD, pc->timeout - jiffies);
+ return max((unsigned long)WAIT_CMD, pc->timeout - jiffies);
 }
 
 /*
-
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 : Fri Mar 15 2002 - 22:00:13 EST