lkml.org 
[lkml]   [2015]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] ath10k: Delete unnecessary checks before the function call "release_firmware"
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Wed, 4 Feb 2015 19:30:23 +0100

    The release_firmware() 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/net/wireless/ath/ath10k/core.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
    index 2d0671e..45171ad 100644
    --- a/drivers/net/wireless/ath/ath10k/core.c
    +++ b/drivers/net/wireless/ath/ath10k/core.c
    @@ -393,16 +393,16 @@ static int ath10k_download_fw(struct ath10k *ar, enum ath10k_firmware_mode mode)

    static void ath10k_core_free_firmware_files(struct ath10k *ar)
    {
    - if (ar->board && !IS_ERR(ar->board))
    + if (!IS_ERR(ar->board))
    release_firmware(ar->board);

    - if (ar->otp && !IS_ERR(ar->otp))
    + if (!IS_ERR(ar->otp))
    release_firmware(ar->otp);

    - if (ar->firmware && !IS_ERR(ar->firmware))
    + if (!IS_ERR(ar->firmware))
    release_firmware(ar->firmware);

    - if (ar->cal_file && !IS_ERR(ar->cal_file))
    + if (!IS_ERR(ar->cal_file))
    release_firmware(ar->cal_file);

    ar->board = NULL;
    --
    2.2.2


    \
     
     \ /
      Last update: 2015-02-04 19:41    [W:4.018 / U:1.228 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site