All of lore.kernel.org
 help / color / mirror / Atom feed
* [Kernel-janitors] [PATCH] sound/oss MIN/MAX removal
@ 2004-02-26 21:17 Michael Veeck
  0 siblings, 0 replies; only message in thread
From: Michael Veeck @ 2004-02-26 21:17 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 131 bytes --]

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

Best Regards
Michael



[-- Attachment #2: minmax_sound_oss.patch --]
[-- Type: text/plain, Size: 2069 bytes --]

diff -Nau linux-2.6.3.org/sound/oss/nm256_audio.c linux-2.6.3.test/sound/oss/nm256_audio.c
--- linux-2.6.3.org/sound/oss/nm256_audio.c	2004-02-18 04:57:45.000000000 +0100
+++ linux-2.6.3.test/sound/oss/nm256_audio.c	2004-02-26 20:50:58.645851864 +0100
@@ -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
diff -Nau linux-2.6.3.org/sound/oss/soundcard.c linux-2.6.3.test/sound/oss/soundcard.c
--- linux-2.6.3.org/sound/oss/soundcard.c	2004-02-18 04:57:56.000000000 +0100
+++ linux-2.6.3.test/sound/oss/soundcard.c	2004-02-26 20:51:45.294760152 +0100
@@ -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)

[-- Attachment #3: Type: text/plain, Size: 163 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-26 21:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-26 21:17 [Kernel-janitors] [PATCH] sound/oss MIN/MAX removal Michael Veeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.