From: Roby <robylit@inwind.it>
To: linux-kernel@vger.kernel.org
Subject: little bug in ac97_codec.c
Date: Tue, 3 Dec 2002 20:53:53 +0100 [thread overview]
Message-ID: <200212032053.53526.robylit@inwind.it> (raw)
[-- Attachment #1: Type: text/plain, Size: 511 bytes --]
I discovered a little bug into the file drivers/sound/ac97_codec.c
It only affects the display of the PnP hexadecimal string of the codec, during
the boot.
The function codec_id(...) has simply a nonsense code. I think someone
forgotten to complete it.
Anyhow, here is my patch.
If it is ok for the developers, good, otherwise I will use it onluy on my
system.
--
Roby
email
robylit@inwind.it
robylit@tiscali.it
WEB Page
http://robylit.risorse.com
http://web.tiscalinet.it/robylit
[-- Attachment #2: ac97_codec.diff --]
[-- Type: text/x-diff, Size: 1000 bytes --]
--- drivers/sound/ac97_codec.orig 2002-11-29 00:53:14.000000000 +0100
+++ drivers/sound/ac97_codec.c 2002-12-03 20:33:13.000000000 +0100
@@ -657,7 +657,7 @@
* codec_id - Turn id1/id2 into a PnP string
* @id1: Vendor ID1
* @id2: Vendor ID2
- * @buf: 10 byte buffer
+ * @buf: 14 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.
@@ -665,13 +665,9 @@
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;
+ snprintf(buf, 14, "0x%04X:0x%04X", id1, id2);
+
+ return buf;
}
/**
@@ -702,7 +698,7 @@
u16 id1, id2;
u16 audio, modem;
int i;
- char cidbuf[10];
+ char cidbuf[14];
/* probing AC97 codec, AC97 2.0 says that bit 15 of register 0x00 (reset) should
* be read zero.
next reply other threads:[~2002-12-03 20:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-03 19:53 Roby [this message]
2002-12-03 21:54 ` little bug in ac97_codec.c Alan Cox
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=200212032053.53526.robylit@inwind.it \
--to=robylit@inwind.it \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox