lkml.org 
[lkml]   [2002]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectLinux 2.4.20-rc2 screwy ac97_codec.c:codec_id()
	Hi;

Im pretty sure this is broken, but I dont know exactly
what it is trying to do.
The first snprintf is overwritten regardless-- missing
else block? And its format string should probably be "%4X:%4X",
because whats there wont fit in the buffer.
Then the first 3 chars in the string are filled in
with raw numbers (For my card, non-ascii) and then a single
decimal digit?? (This string is printed out during boot time--
which is how I noticed it because of the 'garbage' chars.)
I dont know what a PnP string is supposed to look like...

Paul
set@pobox.com

--- linux-2.4.19/drivers/sound/ac97_codec.c 2002-08-03 00:39:44.000000000 +0 000
+++ linux-2.4.20/drivers/sound/ac97_codec.c 2002-11-15 14:56:52.000000000 +0 000
@@ -654,6 +654,27 @@
}

/**
+ * codec_id - Turn id1/id2 into a PnP string
+ * @id1: Vendor ID1
+ * @id2: Vendor ID2
+ * @buf: 10 byte buffer
+ *
+ * Fills buf with a zero terminated PnP ident string for the id1/id2
+ * pair. For convenience the return is the passed in buffer pointer.
+ */
+
+static char *codec_id(u16 id1, u16 id2, char *buf)
+{
+ if(id1&0x8080)
+ snprintf(buf, 10, "%0x4X:%0x4X", id1, id2);
+ buf[0] = (id1 >> 8);
+ buf[1] = (id1 & 0xFF);
+ buf[2] = (id2 >> 8);
+ snprintf(buf+3, 7, "%d", id2&0xFF);
+ return buf;
+}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:31    [W:0.086 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site