From patchwork Mon Oct 10 09:41:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Boettcher X-Patchwork-Id: 37384 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btX6L-0005gm-8j; Mon, 10 Oct 2016 09:42:29 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-8) with esmtp id 1btX6I-00023z-ko; Mon, 10 Oct 2016 11:42:29 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751710AbcJJJll (ORCPT + 1 other); Mon, 10 Oct 2016 05:41:41 -0400 Received: from mout02.posteo.de ([185.67.36.66]:51094 "EHLO mout02.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbcJJJlj (ORCPT ); Mon, 10 Oct 2016 05:41:39 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id DA4D820A2D for ; Mon, 10 Oct 2016 11:41:08 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3ssw9Z583Pz105v; Mon, 10 Oct 2016 11:41:06 +0200 (CEST) Date: Mon, 10 Oct 2016 11:41:03 +0200 From: Patrick Boettcher To: Mauro Carvalho Chehab Cc: Nicholas Mc Guire , Mauro Carvalho Chehab , Alejandro Torrado , Nicolas Sugino , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] [media] dib0700: remove redundant else Message-ID: <20161010114103.03caeef3@posteo.de> In-Reply-To: <20161010063035.7b766b79@vento.lan> References: <1475928199-20315-1-git-send-email-hofrat@osadl.org> <20161010063035.7b766b79@vento.lan> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) 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: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.10.10.93618 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MSGID_ADDED_BY_MTA 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, ECARD_WORD 0, IN_REP_TO 0, LEGITIMATE_NEGATE 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, NO_URI_HTTPS 0, REFERENCES 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __REFERENCES 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __TO_NAME 0, __TO_NAME_DIFF_FROM_ACC 0, __TO_REAL_NAMES 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0' On Mon, 10 Oct 2016 06:30:35 -0300 Mauro Carvalho Chehab wrote: > > drivers/media/usb/dvb-usb/dib0700_devices.c | 10 +++------- > > 1 file changed, 3 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c > > b/drivers/media/usb/dvb-usb/dib0700_devices.c index > > 0857b56..3cd8566 100644 --- > > a/drivers/media/usb/dvb-usb/dib0700_devices.c +++ > > b/drivers/media/usb/dvb-usb/dib0700_devices.c @@ -1736,13 +1736,9 > > @@ static int dib809x_tuner_attach(struct dvb_usb_adapter *adap) > > struct dib0700_adapter_state *st = adap->priv; struct i2c_adapter > > *tun_i2c = st->dib8000_ops.get_i2c_master(adap->fe_adap[0].fe, > > DIBX000_I2C_INTERFACE_TUNER, 1); > > - if (adap->id == 0) { > > - if (dvb_attach(dib0090_register, > > adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) > > - return -ENODEV; > > - } else { > > - if (dvb_attach(dib0090_register, > > adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) > > - return -ENODEV; > > - } > > + if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, > > + tun_i2c, &dib809x_dib0090_config) == NULL) > > + return -ENODEV; > > > I suspect that this patch is wrong. It should be, instead, using > fe_adap[1] on the else. > > Patrick, > > Could you please take a look? I think you're right, it should be fe_adap[1], but I have lost track of these devices and don't know the correct answer. However, this code was introduced by commit 91be260faaf8561dc51e72033c346f6ab28d40d8 Author: Nicolas Sugino Date: Thu Nov 26 19:00:28 2015 -0200 [media] dib8000: Add support for Mygica/Geniatech S2870 MyGica/Geniatech S2870 is very similar to the S870 but with dual tuner. The card is recognised as Geniatech STK8096-PVR. [mchehab@osg.samsung.com: Fix some checkpatch.pl issues] Signed-off-by: Nicolas Sugino Signed-off-by: Mauro Carvalho Chehab [..] Maybe Nicolas can help (and test). --- Patrick. -- 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_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c index 7ed4964..ea0391e 100644 --- a/drivers/media/usb/dvb-usb/dib0700_devices.c +++ b/drivers/media/usb/dvb-usb/dib0700_devices.c @@ -1736,8 +1736,13 @@ static int dib809x_tuner_attach(struct dvb_usb_adapter *adap) struct dib0700_adapter_state *st = adap->priv; struct i2c_adapter *tun_i2c = st->dib8000_ops.get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_TUNER, 1); - if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) - return -ENODEV; + if (adap->id == 0) { + if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) + return -ENODEV; + } else { + if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) + return -ENODEV; + } st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib8096_set_param_override;