]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/aic7xxx/aic7xxx_core.c
[SCSI] drivers/scsi: Handcrafted MIN/MAX macro removal
[linux-2.6-omap-h63xx.git] / drivers / scsi / aic7xxx / aic7xxx_core.c
index 93e4e40944b6d42b1a36398500e1c03dfe529719..46bd7bc2fa4dbfab2f5c8040b984a64a85939dbf 100644 (file)
@@ -1671,7 +1671,7 @@ ahc_devlimited_syncrate(struct ahc_softc *ahc,
                transinfo = &tinfo->goal;
        *ppr_options &= transinfo->ppr_options;
        if (transinfo->width == MSG_EXT_WDTR_BUS_8_BIT) {
-               maxsync = MAX(maxsync, AHC_SYNCRATE_ULTRA2);
+               maxsync = max(maxsync, (u_int)AHC_SYNCRATE_ULTRA2);
                *ppr_options &= ~MSG_EXT_PPR_DT_REQ;
        }
        if (transinfo->period == 0) {
@@ -1679,7 +1679,7 @@ ahc_devlimited_syncrate(struct ahc_softc *ahc,
                *ppr_options = 0;
                return (NULL);
        }
-       *period = MAX(*period, transinfo->period);
+       *period = max(*period, (u_int)transinfo->period);
        return (ahc_find_syncrate(ahc, period, ppr_options, maxsync));
 }
 
@@ -1804,12 +1804,12 @@ ahc_validate_offset(struct ahc_softc *ahc,
                else
                        maxoffset = MAX_OFFSET_8BIT;
        }
-       *offset = MIN(*offset, maxoffset);
+       *offset = min(*offset, maxoffset);
        if (tinfo != NULL) {
                if (role == ROLE_TARGET)
-                       *offset = MIN(*offset, tinfo->user.offset);
+                       *offset = min(*offset, (u_int)tinfo->user.offset);
                else
-                       *offset = MIN(*offset, tinfo->goal.offset);
+                       *offset = min(*offset, (u_int)tinfo->goal.offset);
        }
 }
 
@@ -1835,9 +1835,9 @@ ahc_validate_width(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo,
        }
        if (tinfo != NULL) {
                if (role == ROLE_TARGET)
-                       *bus_width = MIN(tinfo->user.width, *bus_width);
+                       *bus_width = min((u_int)tinfo->user.width, *bus_width);
                else
-                       *bus_width = MIN(tinfo->goal.width, *bus_width);
+                       *bus_width = min((u_int)tinfo->goal.width, *bus_width);
        }
 }
 
@@ -4406,7 +4406,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
        physaddr = sg_map->sg_physaddr;
 
        newcount = (PAGE_SIZE / (AHC_NSEG * sizeof(struct ahc_dma_seg)));
-       newcount = MIN(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs));
+       newcount = min(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs));
        for (i = 0; i < newcount; i++) {
                struct scb_platform_data *pdata;
 #ifndef __linux__
@@ -6442,7 +6442,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
                        if (skip_addr > i) {
                                int end_addr;
 
-                               end_addr = MIN(address, skip_addr);
+                               end_addr = min(address, skip_addr);
                                address_offset += end_addr - i;
                                i = skip_addr;
                        } else {