minor emu10k1.c cleanup

Chris Pressey cpressey at catseye.mine.nu
Sun Feb 22 19:28:13 PST 2004


Hi,

Basically I got annoyed at the "trigraphs encountered" warning I was
getting during buildkernel, so I found and eliminated them.  Turns out
they were caused by the sequence "??)" embedded in a comment.  It might
be more elegant to change the compiler to ignore (apparent) trigraphs in
comments, but also a lot more work, so I just added some spaces so they
don't trigger the warning.

While here I made some small style-related changes (test for a null
pointer should be explicit...)

I'll try to figure out what's up with the code I marked XXX, by looking
through CVS logs, but I don't have one of these soundcards to test it
with so I'm not too hopeful.

Thanks,
-Chris
Index: sys/dev/sound/pci/emu10k1.c
===================================================================
RCS file: /home/dcvs/src/sys/dev/sound/pci/emu10k1.c,v
retrieving revision 1.5
diff -u -r1.5 emu10k1.c
--- sys/dev/sound/pci/emu10k1.c	6 Jan 2004 16:31:55 -0000	1.5
+++ sys/dev/sound/pci/emu10k1.c	22 Feb 2004 19:15:40 -0000
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.6.2.9 2002/04/22 15:49:32 cg Exp $
- * $DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.5 2004/01/06 16:31:55 asmodai Exp $
+ * $DragonFly$
  */
 
 #include <dev/sound/pcm/sound.h>
@@ -35,7 +35,7 @@
 #include <bus/pci/pcivar.h>
 #include <sys/queue.h>
 
-SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.5 2004/01/06 16:31:55 asmodai Exp $");
+SND_DECLARE_FILE("$DragonFly$");
 
 /* -------------------------------------------------------------------- */
 
@@ -747,6 +747,7 @@
 	emu_settimer(sc);
 	irqrate = 48000 / sc->timerinterval;
 	snd_mtxunlock(sc->lock);
+	/* XXX this assignment appears to be useless */
 	blksz = (ch->spd * sndbuf_getbps(ch->buffer)) / irqrate;
 	return blocksize;
 }
@@ -907,6 +908,7 @@
 	emu_settimer(sc);
 	irqrate = 48000 / sc->timerinterval;
 	snd_mtxunlock(sc->lock);
+	/* XXX this assignment appears to be useless */
 	blksz = (ch->spd * sndbuf_getbps(ch->buffer)) / irqrate;
 	return blocksize;
 }
@@ -1247,7 +1249,7 @@
 
 	/* Audigy 2 (EMU10K2) DSP Registers:
 	   FX Bus
-		0x000-0x00f : 16 registers (???)
+		0x000-0x00f : 16 registers ( ??? )
 	   Input
 		0x040/0x041 : AC97 Codec (l/r)
 		0x042/0x043 : ADC, S/PDIF (l/r)
@@ -1276,9 +1278,9 @@
 		0x0cb = 0x10000000, 0x0cc = 0x20000000, 0x0cd = 0x40000000
 		0x0ce = 0x80000000, 0x0cf = 0x7fffffff, 0x0d0 = 0xffffffff
 		0x0d1 = 0xfffffffe, 0x0d2 = 0xc0000000, 0x0d3 = 0x41fbbcdc
-		0x0d4 = 0x5a7ef9db, 0x0d5 = 0x00100000, 0x0dc = 0x00000001 (???)
+		0x0d4 = 0x5a7ef9db, 0x0d5 = 0x00100000, 0x0dc = 0x00000001 ( ??? )
 	   Temporary Values
-		0x0d6 : Accumulator (???)
+		0x0d6 : Accumulator ( ??? )
 		0x0d7 : Condition Register
 		0x0d8 : Noise source
 		0x0d9 : Noise source
@@ -1975,8 +1977,11 @@
 		break;
 	}
 
-	if (s) device_set_desc(dev, s);
-	return s? -1000 : ENXIO;
+	if (s == NULL)
+		return ENXIO;
+	
+	device_set_desc(dev, s);
+	return -1000;
 }
 
 static int




More information about the Submit mailing list