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

media: usb: dib0700_devices.c: remove useless if/else

Fix the following coccinelle report:

drivers/media/usb/dvb-usb/dib0700_devices.c:1741:1-3:
WARNING: possible condition with no effect (if == else)

Both branches are the same, so remove the if/else altogether.

Found using - Coccinelle (http://coccinelle.lip6.fr)

[hverkuil: fix checkpatch warnings]

Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Daniel W. S. Almeida and committed by
Mauro Carvalho Chehab
e1f8807a 56149c8c

+3 -8
+3 -8
drivers/media/usb/dvb-usb/dib0700_devices.c
··· 1738 1738 struct dib0700_adapter_state *st = adap->priv; 1739 1739 struct i2c_adapter *tun_i2c = st->dib8000_ops.get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_TUNER, 1); 1740 1740 1741 - if (adap->id == 0) { 1742 - if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) 1743 - return -ENODEV; 1744 - } else { 1745 - /* FIXME: check if it is fe_adap[1] */ 1746 - if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) 1747 - return -ENODEV; 1748 - } 1741 + /* FIXME: if adap->id != 0, check if it is fe_adap[1] */ 1742 + if (!dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config)) 1743 + return -ENODEV; 1749 1744 1750 1745 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; 1751 1746 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib8096_set_param_override;