Re: [PATCH] AF9033 read_ber and read_ucblocks implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02.04.2012 00:56, Antti Palosaari wrote:
On 02.04.2012 00:19, Hans-Frieder Vogt wrote:
Implementation of af9033_read_ber and af9033_read_ucblocks functions.
+ sw = ~sw;

I don't see any reason for that?

Now I see, it is some kind of switch to make operation every second call?
As it is defined static:
+	static u8 sw = 0;
[...]
+		if (sw)
+			state->ucb = abort_cnt;
+		else
+			state->ucb = +abort_cnt;
+		sw = ~sw;

Unfortunately I am almost sure it will not work as it should. In my understanding this kind of static variables are shared between driver instances... and if you have device where is two or more af9033 demods it will share it. Also if you have multiple af9033 devices, are are shared. It works only if you have one af9033 demodulator in use.

Instead, this kind of switches should be but to driver private aka state. Also think twice if all that logic is correct and needed.

regards
Antti
--
http://palosaari.fi/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux