From f85ed0ceeba78b6b15a857ce48888fdb52de28d0 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 6 Feb 2013 08:29:39 -0200 Subject: [PATCH] Revert "[media] drivers/media/usb/dvb-usb/dib0700_core.c: fix left shift" On Wed, 6 Feb 2013 09:04:39 +0000 Olivier GRENIE wrote: > 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. Requested-by: Olivier GRENIE Cc: Patrick Boettcher Cc: Nickolai Zeldovich Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/dvb-usb/dib0700_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/dib0700_core.c b/drivers/media/usb/dvb-usb/dib0700_core.c index bd6a43785d5e..bf2a908d74cf 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); -- 2.11.0