Re: Patch for ymfpci in 2.5.x

Pete Zaitcev
2002-01-22T05:11:43Z

> Date: Fri, 11 Jan 2002 10:36:30 -0800 (PST)
> From: Linus Torvalds <torvalds@transmeta.com>

> It would have been even saner to give that bit some sane name, and have
> something like
>
> #define YMFPCI_XXXBIT (__constant_cpu_to_le32(0x40000000))
>
> instead of creating a totally nonsensical random number.

I think something like this would be better than one more
totally nonsesical random #define:

--- linux-2.5.2/drivers/sound/ymfpci.c Fri Jan 11 10:34:43 2002
+++ linux-2.5.2-p3/drivers/sound/ymfpci.c Mon Jan 21 21:06:48 2002
@@ -832,6 +832,13 @@
u32 lpfK = ymfpci_calc_lpfK(rate);
ymfpci_playback_bank_t *bank;
int nbank;
+
+ /*
+ * The gain is a floating point number. According to the manual,
+ * bit 31 indicates a sign bit, bit 30 indicates an integer part,
+ * and bits [29:15] indicate a decimal fraction part. Thus,
+ * for a gain of 1.0 the constant of 0x40000000 is loaded.
+ */
unsigned le_0x40000000 = cpu_to_le32(0x40000000);