]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath10k: delete unnecessary checks before the function call "release_firmware"
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 4 Feb 2015 18:30:23 +0000 (19:30 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 4 Mar 2015 12:05:40 +0000 (14:05 +0200)
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>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c

index 310e12bc078a6e47dd9f52637db92c1efed6d227..c0e454bb6a8df646b9266afbffa76ed179dff0fc 100644 (file)
@@ -436,16 +436,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;