Messages in this thread | | | Subject | Re: Linux 2.4.20-rc2 screwy ac97_codec.c:codec_id() | From | Alan Cox <> | Date | 22 Nov 2002 01:57:06 +0000 |
| |
On Fri, 2002-11-22 at 01:14, Paul wrote: > 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...
There is an else missing you are correct
> + if(id1&0x8080) > + snprintf(buf, 10, "%0x4X:%0x4X", id1, id2);
else {
> + 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/
- 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/
| |