From patchwork Wed Feb 6 09:04:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Olivier GRENIE X-Patchwork-Id: 16655 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1U30qk-0004Qv-Jp; Wed, 06 Feb 2013 09:59:26 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1U30qj-000350-Ii; Wed, 06 Feb 2013 09:59:26 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752061Ab3BFI7X (ORCPT + 1 other); Wed, 6 Feb 2013 03:59:23 -0500 Received: from co202.xi-lite.net ([149.6.83.202]:46702 "EHLO co202.xi-lite.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751929Ab3BFI7X convert rfc822-to-8bit (ORCPT ); Wed, 6 Feb 2013 03:59:23 -0500 Received: from ONYX.xi-lite.lan (unknown [193.34.35.244]) by co202.xi-lite.net (Postfix) with ESMTPS id 94F90260359; Wed, 6 Feb 2013 10:15:40 +0100 (CET) Received: from SAPHIR.xi-lite.lan ([193.34.32.63]) by ONYX ([193.34.32.32]) with mapi; Wed, 6 Feb 2013 09:04:39 +0000 From: Olivier GRENIE To: "linux-media@vger.kernel.org" CC: Patrick BOETTCHER , Nickolai Zeldovich Date: Wed, 6 Feb 2013 09:04:39 +0000 Subject: RE: [git:v4l-dvb/for_v3.9] [media] drivers/media/usb/dvb-usb/dib0700_core.c: fix left shift Thread-Topic: [git:v4l-dvb/for_v3.9] [media] drivers/media/usb/dvb-usb/dib0700_core.c: fix left shift Thread-Index: Ac4D5WYuDmoLIWgiQQW0pon80p8hQgAXYiGQ Message-ID: References: In-Reply-To: Accept-Language: en-US, fr-FR Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, fr-FR MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.2.6.84815 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, RCVD_FROM_IP_DATE 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' 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@redhat.com] Envoyé : mardi 5 février 2013 22:04 À : linuxtv-commits@linuxtv.org 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 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 Cc: Olivier Grenie Cc: Patrick Boettcher Signed-off-by: Mauro Carvalho Chehab 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 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);