Skip to contentSkip to conversation

(2/5) aic7xyz_old: use kernel.h min/max/ARRAY_SIZE

janitor Randy.Dunlap 1 participant 1 message Apr 27, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

From: Michael Veeck <[email protected]>
Subject: [Kernel-janitors] [PATCH] drivers/scsi/aic7xxx_old MIN/MAX/NUMBER
removal

Patch (against 2.6.6-rc1) removes unnecessary min/max/number macros and changes calls to use kernel.h macros instead.

 drivers/scsi/aic7xxx_old.c              |   43 ++++++++++++++------------------
 drivers/scsi/aic7xxx_old/aic7xxx_proc.c |    6 ++--
 2 files changed, 23 insertions(+), 26 deletions(-)
drivers/scsi/aic7xxx_old/aic7xxx_proc.c +3 -3
Index: linux-266-rc2-kj1/drivers/scsi/aic7xxx_old/aic7xxx_proc.c
===================================================================
@@ -319,13 +319,13 @@ aic7xxx_proc_info ( struct Scsi_Host *HB
         aic_dev->r_total+aic_dev->w_total, aic_dev->r_total, aic_dev->w_total);
     size += sprintf(BLS, "%s\n", HDRB);
     size += sprintf(BLS, "   Reads:");
-    for (i = 0; i < NUMBER(aic_dev->r_bins); i++)
+    for (i = 0; i < ARRAY_SIZE(aic_dev->r_bins); i++)
     {
       size += sprintf(BLS, " %10ld", aic_dev->r_bins[i]);
     }
     size += sprintf(BLS, "\n");
     size += sprintf(BLS, "  Writes:");
-    for (i = 0; i < NUMBER(aic_dev->w_bins); i++)
+    for (i = 0; i < ARRAY_SIZE(aic_dev->w_bins); i++)
     {
       size += sprintf(BLS, " %10ld", aic_dev->w_bins[i]);
     }
@@ -347,7 +347,7 @@ aic7xxx_proc_info ( struct Scsi_Host *HB
   else
   {
     *start = buffer;
-    length = MIN(length, size - offset);
+    length = min_t(int, length, size - offset);
     memcpy(buffer, &aic7xxx_buffer[offset], length);
   }
 
drivers/scsi/aic7xxx_old.c +20 -23

163 lines not on this page · raw message

--