Skip to contentSkip to conversation

sound/oss MIN/MAX removal

PATCH New Michael Veeck 1 participant 1 message Feb 26, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/oss MIN/MAX removal

Patch (against 2.6.3) removes unnecessary min/max macros and changes calls to use kernel.h macros instead.

Best Regards
Michael

sound/oss/nm256_audio.c +4 -7
diff -Nau linux-2.6.3.org/sound/oss/nm256_audio.c linux-2.6.3.test/sound/oss/nm256_audio.c
@@ -22,6 +22,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pm.h>
 #include <linux/delay.h>
@@ -450,9 +451,6 @@
     }
 }
 
-/* Ultra cheez-whiz.  But I'm too lazy to grep headers. */
-#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
-
 /* 
  * Read the last-recorded block from the ring buffer, copy it into the
  * saved buffer pointer, and invoke DMAuf_inputintr() with the recording
@@ -480,7 +478,7 @@
 	/* If we wrapped around, copy everything from the start of our
 	   recording buffer to the end of the buffer. */
 	if (currptr < card->curRecPos) {
-	    u32 amt = MIN (ringsize - card->curRecPos, amtToRead);
+	    u32 amt = min (ringsize - card->curRecPos, amtToRead);
 
 	    nm256_readBuffer8 (card, card->recBuf, 1,
 				 card->abuf2 + card->curRecPos,
@@ -493,7 +491,7 @@
 	}
 
 	if ((card->curRecPos < currptr) && (amtToRead > 0)) {
-	    u32 amt = MIN (currptr - card->curRecPos, amtToRead);
+	    u32 amt = min (currptr - card->curRecPos, amtToRead);
 	    nm256_readBuffer8 (card, card->recBuf, 1,
 				 card->abuf2 + card->curRecPos, amt);
 	    card->curRecPos = ((card->curRecPos + amt) % ringsize);
@@ -503,9 +501,8 @@
 	DMAbuf_inputintr (card->dev_for_record);
     }
 }
-#undef MIN
 
-/*
+/*
  * Initialize the hardware.
  */
 static void
sound/oss/soundcard.c +0 -4
diff -Nau linux-2.6.3.org/sound/oss/soundcard.c linux-2.6.3.test/sound/oss/soundcard.c
@@ -136,10 +136,6 @@
 	return 0;
 }
 
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
 /* 4K page size but our output routines use some slack for overruns */
 #define PROC_BLOCK_SIZE (3*1024)

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors