RE: [git:v4l-dvb/for_v3.9] [media] drivers/media/usb/dvb-usb/dib0700_core.c: fix left shift

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

 



Hello Mauro,
I do not agree with the patch. Let's take an example: adap->id = 0. Then:
	* 1 << ~(adap->id) = 1 << ~(0) = 0
	* ~(1 << adap->id) = ~(1 << 0) = 0xFE

The correct change should be: st->channel_state |= 1 << (1 - adap->id); Indeed, the original source code was not correct.

Regards,
Olivier

-----Message d'origine-----
De : Mauro Carvalho Chehab [mailto:mchehab@xxxxxxxxxx] 
Envoyé : mardi 5 février 2013 22:04
À : linuxtv-commits@xxxxxxxxxxx
Cc : Patrick BOETTCHER; Olivier GRENIE; Nickolai Zeldovich
Objet : [git:v4l-dvb/for_v3.9] [media] drivers/media/usb/dvb-usb/dib0700_core.c: fix left shift

This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/media_tree.git tree:

Subject: [media] drivers/media/usb/dvb-usb/dib0700_core.c: fix left shift
Author:  Nickolai Zeldovich <nickolai@xxxxxxxxxxxxx>
Date:    Sat Jan 5 15:13:05 2013 -0300

Fix bug introduced in 7757ddda6f4febbc52342d82440dd4f7a7d4f14f, where instead of bit-negating the bitmask, the bit position was bit-negated instead.

Signed-off-by: Nickolai Zeldovich <nickolai@xxxxxxxxxxxxx>
Cc: Olivier Grenie <olivier.grenie@xxxxxxxxx>
Cc: Patrick Boettcher <patrick.boettcher@xxxxxxxxx>
Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>

 drivers/media/usb/dvb-usb/dib0700_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=7e20f6bfc47992d93b36f4ed068782f8726b75a3

diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c
index bf2a908..bd6a437 100644
--- a/drivers/media/usb/dvb-usb/dib0700_core.c
+++ b/drivers/media/usb/dvb-usb/dib0700_core.c
@@ -584,7 +584,7 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
 		if (onoff)
 			st->channel_state |=	1 << (adap->id);
 		else
-			st->channel_state |=	1 << ~(adap->id);
+			st->channel_state &=  ~(1 << (adap->id));
 	} else {
 		if (onoff)
 			st->channel_state |=	1 << (adap->fe_adap[0].stream.props.endpoint-2);
--
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