brcm80211: remove an unneeded NULL check
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 14 May 2012 20:57:29 +0000 (23:57 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 5 Jun 2012 19:23:20 +0000 (15:23 -0400)
This code causes a static checker warning because "pi" gets dereferenced
before it is checked.  The dereference is inside the write_phy_reg()
function which is called from wlc_phy_write_txmacreg_nphy().

This code is only called from wlc_phy_init_nphy() and "pi" is a
valid pointer so we can remove the check for NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c

index 13b261517cce53d130235b43ce62bbfbe01e00ee..3667181464184bc3293f9241f8ccc10d3d9323ab 100644 (file)
@@ -14358,7 +14358,7 @@ void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs)
 
        wlc_phy_write_txmacreg_nphy(pi, holdoff, delay);
 
-       if (pi && pi->sh && (pi->sh->_rifs_phy != rifs))
+       if (pi->sh && (pi->sh->_rifs_phy != rifs))
                pi->sh->_rifs_phy = rifs;
 }