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

[media] c8sectpfe: Delete unnecessary checks before two function calls

The functions i2c_put_adapter() and module_put() test whether their
argument is NULL and then return immediately.
Thus the tests around their calls are not needed.

This issue was detected by using the Coccinelle software.

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
06b6fea8 4dc0e908

+2 -3
+2 -3
drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c
··· 214 214 dvb_frontend_detach(tsin->frontend); 215 215 } 216 216 217 - if (tsin && tsin->i2c_adapter) 217 + if (tsin) 218 218 i2c_put_adapter(tsin->i2c_adapter); 219 219 220 220 if (tsin && tsin->i2c_client) { 221 - if (tsin->i2c_client->dev.driver->owner) 222 - module_put(tsin->i2c_client->dev.driver->owner); 221 + module_put(tsin->i2c_client->dev.driver->owner); 223 222 i2c_unregister_device(tsin->i2c_client); 224 223 } 225 224 }