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

[media] i2c: Deletion of an unnecessary check before the function call "rc_unregister_device"

The rc_unregister_device() function tests whether its argument is NULL
and then returns 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
8f1aeedf d3fe22fa

+1 -2
+1 -2
drivers/media/i2c/ir-kbd-i2c.c
··· 464 464 cancel_delayed_work_sync(&ir->work); 465 465 466 466 /* unregister device */ 467 - if (ir->rc) 468 - rc_unregister_device(ir->rc); 467 + rc_unregister_device(ir->rc); 469 468 470 469 /* free memory */ 471 470 return 0;