net: brcm80211: Deletion of unnecessary checks before two function calls
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 20 Nov 2014 15:42:51 +0000 (16:42 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Nov 2014 21:14:39 +0000 (16:14 -0500)
The functions brcmu_pkt_buf_free_skb() and release_firmware() test whether
their argument is NULL and then return 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>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/firmware.c
drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
drivers/net/wireless/brcm80211/brcmsmac/main.c

index 0f157f151282ebe4446bd0aab04453d212ff6a77..1ff787d1a36be97848b412cdbc1246b5b3d8afe9 100644 (file)
@@ -262,8 +262,7 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
 
 fail:
        brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
-       if (fwctx->code)
-               release_firmware(fwctx->code);
+       release_firmware(fwctx->code);
        device_release_driver(fwctx->dev);
        kfree(fwctx);
 }
index 02d39ce8dbcafc9484927ccc19ed11c6319dae69..9f783db34ae5f87b76df083d9e805d3d13f83deb 100644 (file)
@@ -518,8 +518,7 @@ static int brcmf_msgbuf_query_dcmd(struct brcmf_pub *drvr, int ifidx,
                memcpy(buf, skb->data, (len < msgbuf->ioctl_resp_ret_len) ?
                                       len : msgbuf->ioctl_resp_ret_len);
        }
-       if (skb)
-               brcmu_pkt_buf_free_skb(skb);
+       brcmu_pkt_buf_free_skb(skb);
 
        return msgbuf->ioctl_resp_status;
 }
index bc9be78faafa6679b0193be9b0f875fb31f6f0bb..738cfaca1e0f525a06cc0fd8f1f047f44f24dbce 100644 (file)
@@ -1009,8 +1009,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
                if (txh)
                        trace_brcms_txdesc(&wlc->hw->d11core->dev, txh,
                                           sizeof(*txh));
-               if (p)
-                       brcmu_pkt_buf_free_skb(p);
+               brcmu_pkt_buf_free_skb(p);
        }
 
        if (dma && queue < NFIFO) {