lkml.org 
[lkml]   [2015]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 1/2] [media] c8sectpfe: Delete unnecessary checks before two function calls
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Thu, 5 Nov 2015 18:55:19 +0100

    The functions i2c_put_adapter() and module_put() test whether their
    argument is NULL and then return immediately.
    Thus the tests around their calls are not needed.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c | 5 ++---
    1 file changed, 2 insertions(+), 3 deletions(-)

    diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c
    index 95223ab..07fd6d9 100644
    --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c
    +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c
    @@ -214,12 +214,11 @@ void c8sectpfe_tuner_unregister_frontend(struct c8sectpfe *c8sectpfe,
    dvb_frontend_detach(tsin->frontend);
    }

    - if (tsin && tsin->i2c_adapter)
    + if (tsin)
    i2c_put_adapter(tsin->i2c_adapter);

    if (tsin && tsin->i2c_client) {
    - if (tsin->i2c_client->dev.driver->owner)
    - module_put(tsin->i2c_client->dev.driver->owner);
    + module_put(tsin->i2c_client->dev.driver->owner);
    i2c_unregister_device(tsin->i2c_client);
    }
    }
    --
    2.6.2


    \
     
     \ /
      Last update: 2015-11-05 20:01    [W:4.097 / U:0.496 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site