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

[media] c8sectpfe: Combine three checks into a single if block

The variable "tsin" was checked three times in a loop iteration of the
c8sectpfe_tuner_unregister_frontend() function.
This implementation detail could be improved by the combination of the
involved statements into a single if block so that this variable will be
checked only once there.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Markus Elfring and committed by
Mauro Carvalho Chehab
1ea7252d 06b6fea8

+9 -8
+9 -8
drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c
··· 209 209 210 210 tsin = fei->channel_data[n]; 211 211 212 - if (tsin && tsin->frontend) { 213 - dvb_unregister_frontend(tsin->frontend); 214 - dvb_frontend_detach(tsin->frontend); 215 - } 212 + if (tsin) { 213 + if (tsin->frontend) { 214 + dvb_unregister_frontend(tsin->frontend); 215 + dvb_frontend_detach(tsin->frontend); 216 + } 216 217 217 - if (tsin) 218 218 i2c_put_adapter(tsin->i2c_adapter); 219 219 220 - if (tsin && tsin->i2c_client) { 221 - module_put(tsin->i2c_client->dev.driver->owner); 222 - i2c_unregister_device(tsin->i2c_client); 220 + if (tsin->i2c_client) { 221 + module_put(tsin->i2c_client->dev.driver->owner); 222 + i2c_unregister_device(tsin->i2c_client); 223 + } 223 224 } 224 225 } 225 226