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

[media] rc: Deletion of unnecessary checks before two function calls

The functions input_free_device() and rc_close() test whether their argument
is NULL and then return immediately. Thus the test around the call
is 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
3dd94f00 8f1aeedf

+2 -4
+1 -2
drivers/media/rc/lirc_dev.c
··· 518 518 519 519 WARN_ON(mutex_lock_killable(&lirc_dev_lock)); 520 520 521 - if (ir->d.rdev) 522 - rc_close(ir->d.rdev); 521 + rc_close(ir->d.rdev); 523 522 524 523 ir->open--; 525 524 if (ir->attached) {
+1 -2
drivers/media/rc/rc-main.c
··· 1298 1298 if (!dev) 1299 1299 return; 1300 1300 1301 - if (dev->input_dev) 1302 - input_free_device(dev->input_dev); 1301 + input_free_device(dev->input_dev); 1303 1302 1304 1303 put_device(&dev->dev); 1305 1304