lkml.org 
[lkml]   [2015]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[media] staging: bcm2048: Delete an unnecessary check before the function call "video_unregister_device"
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Mon, 2 Feb 2015 13:20:23 +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/staging/media/bcm2048/radio-bcm2048.c | 4 +---
    1 file changed, 1 insertion(+), 3 deletions(-)

    diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
    index 60a57b2..f308078 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);
    --
    2.2.2


    \
     
     \ /
      Last update: 2015-02-02 14:01    [W:4.034 / U:0.112 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site