From: Markus Elfring Date: Mon, 2 Feb 2015 12:20:23 +0000 (-0300) Subject: [media] staging: bcm2048: Delete an unnecessary check before the function call "video... X-Git-Tag: v5.15~14799^2~1496 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1408379ba9d87d66691835c7cdc2645793e311a;p=platform%2Fkernel%2Flinux-starfive.git [media] staging: bcm2048: Delete an unnecessary check before the function call "video_unregister_device" The video_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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index 4d5e2f4..5382506 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -2684,9 +2684,7 @@ static int __exit bcm2048_i2c_driver_remove(struct i2c_client *client) vd = bdev->videodev; bcm2048_sysfs_unregister_properties(bdev, ARRAY_SIZE(attrs)); - - if (vd) - video_unregister_device(vd); + video_unregister_device(vd); if (bdev->power_state) bcm2048_set_power_state(bdev, BCM2048_POWER_OFF);