2.5.6 compile warnings in ide-scsi.c
PATCH 1/1 2.5.6 compile warnings in ide-scsi.c
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
drivers/scsi/ide-scsi.c renamed from drivers/scsi/ide-scsi.c.~1~ +2 -2
@@ -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); }/*