Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "[media] drivers/media/usb/dvb-usb/dib0700_core.c: fix left shift"

On Wed, 6 Feb 2013 09:04:39 +0000
Olivier GRENIE <olivier.grenie@parrot.com> 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 <olivier.grenie@parrot.com>
Cc: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Cc: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

+1 -1
+1 -1
drivers/media/usb/dvb-usb/dib0700_core.c
··· 584 584 if (onoff) 585 585 st->channel_state |= 1 << (adap->id); 586 586 else 587 - st->channel_state &= ~(1 << (adap->id)); 587 + st->channel_state |= 1 << ~(adap->id); 588 588 } else { 589 589 if (onoff) 590 590 st->channel_state |= 1 << (adap->fe_adap[0].stream.props.endpoint-2);