Messages in this thread Patch in this message | | | Date | Tue, 03 Feb 2015 19:03:37 +0100 | From | SF Markus Elfring <> | Subject | [PATCH] [media] au0828: Delete unnecessary checks before the function call "video_unregister_device" |
| |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 3 Feb 2015 19:00:25 +0100
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 <elfring@users.sourceforge.net> --- drivers/media/usb/au0828/au0828-video.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 5f337b1..e593fb5 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -870,12 +870,8 @@ void au0828_analog_unregister(struct au0828_dev *dev) { dprintk(1, "au0828_release_resources called\n"); mutex_lock(&au0828_sysfs_lock); - - if (dev->vdev) - video_unregister_device(dev->vdev); - if (dev->vbi_dev) - video_unregister_device(dev->vbi_dev); - + video_unregister_device(dev->vdev); + video_unregister_device(dev->vbi_dev); mutex_unlock(&au0828_sysfs_lock); } -- 2.2.2
| |