]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sound: use kernel min/max
authorAndrew Morton <akpm@osdl.org>
Thu, 18 Mar 2004 23:01:55 +0000 (15:01 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 18 Mar 2004 23:01:55 +0000 (15:01 -0800)
From: "Randy.Dunlap" <rddunlap@osdl.org>

From: Michael Veeck <michael.veeck@gmx.net>

Remove unnecessary min/max macros and changes calls to use kernel.h macros
instead.

sound/oss/nm256_audio.c
sound/oss/soundcard.c

index bdb8c06528e8cb6957127c1ad8f17618902f0221..777492c35dc47490cf5b165d75ebf61d31d4e717 100644 (file)
@@ -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 @@ nm256_get_new_block (struct nm256_info *card)
     }
 }
 
-/* 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 @@ nm256_read_block (struct nm256_info *card)
        /* 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 @@ nm256_read_block (struct nm256_info *card)
        }
 
        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 @@ nm256_read_block (struct nm256_info *card)
        DMAbuf_inputintr (card->dev_for_record);
     }
 }
-#undef MIN
 
-/* 
+/*
  * Initialize the hardware. 
  */
 static void
index a1170a7487c0c678e7cb782625d057d4fa5f0931..ddc9e4448c33def5e18599cbf2bafdb07d3203c7 100644 (file)
@@ -136,10 +136,6 @@ static int get_mixer_levels(caddr_t arg)
        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)