All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Veeck <michael.veeck@gmx.net>
To: kernel-janitors@vger.kernel.org
Subject: [Kernel-janitors] [PATCH] sound/oss MIN/MAX removal
Date: Thu, 26 Feb 2004 21:17:30 +0000	[thread overview]
Message-ID: <403E626A.5030803@gmx.net> (raw)

[-- 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

                 reply	other threads:[~2004-02-26 21:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=403E626A.5030803@gmx.net \
    --to=michael.veeck@gmx.net \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.