From patchwork Wed Feb 4 13:03:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 28159 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1YIzgy-0003hD-EW; Wed, 04 Feb 2015 14:08:28 +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.72/mailfrontend-5) with esmtp id 1YIzgw-0002mG-6h; Wed, 04 Feb 2015 14:08:27 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966098AbbBDNIR (ORCPT + 1 other); Wed, 4 Feb 2015 08:08:17 -0500 Received: from www.osadl.org ([62.245.132.105]:44502 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965309AbbBDNIO (ORCPT ); Wed, 4 Feb 2015 08:08:14 -0500 Received: from debian.hofrr.at (92-243-35-153.adsl.nanet.at [92.243.35.153] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id t14D7G7w027989; Wed, 4 Feb 2015 14:07:17 +0100 From: Nicholas Mc Guire To: Mauro Carvalho Chehab Cc: Matthias Schwarzott , Antti Palosaari , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] [media] cx231xx: drop condition with no effect Date: Wed, 4 Feb 2015 08:03:11 -0500 Message-Id: <1423054991-1414-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KHOP_SC_TOP_CIDR8, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.2.4.125719 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1800_1899 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, FROM_NAME_PHRASE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' The if and the else code are identical - so the condition has no effect on the effective code. This patch removes the condition and the duplicated code. Signed-off-by: Nicholas Mc Guire --- The if and the else code are identical - so the condition has no effect. The value of the assignment was placed into () for readability as other long bit-wise constructs in this file also do so. Patch was only compile tested with imx_v6_v7_defconfig CONFIG_MEDIA_ANALOG_TV_SUPPORT=y, CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y, CONFIG_VIDEO_CX231XX=m Patch is against 3.19.0-rc7 (localversion-next is -next-20150204) drivers/media/usb/cx231xx/cx231xx-core.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c index 4a3f28c..832ba99 100644 --- a/drivers/media/usb/cx231xx/cx231xx-core.c +++ b/drivers/media/usb/cx231xx/cx231xx-core.c @@ -176,16 +176,9 @@ int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus, saddr_len = req_data->saddr_len; /* Set wValue */ - if (saddr_len == 1) /* need check saddr_len == 0 */ - ven_req.wValue = - req_data-> - dev_addr << 9 | _i2c_period << 4 | saddr_len << 2 | - _i2c_nostop << 1 | I2C_SYNC | _i2c_reserve << 6; - else - ven_req.wValue = - req_data-> - dev_addr << 9 | _i2c_period << 4 | saddr_len << 2 | - _i2c_nostop << 1 | I2C_SYNC | _i2c_reserve << 6; + ven_req.wValue = (req_data->dev_addr << 9 | _i2c_period << 4 | + saddr_len << 2 | _i2c_nostop << 1 | I2C_SYNC | + _i2c_reserve << 6); /* set channel number */ if (req_data->direction & I2C_M_RD) {