* [patch] brcm80211: remove an unneeded NULL check
@ 2012-05-14 20:57 Dan Carpenter
2012-05-15 14:24 ` Arend van Spriel
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-05-14 20:57 UTC (permalink / raw)
To: Brett Rudley
Cc: Roland Vossen, Arend van Spriel, Franky (Zhenhui) Lin, Kan Yan,
John W. Linville, Pieter-Paul Giesberts, linux-wireless,
kernel-janitors
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>
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
index 812b6e3..d6380f3 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
@@ -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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] brcm80211: remove an unneeded NULL check
2012-05-14 20:57 [patch] brcm80211: remove an unneeded NULL check Dan Carpenter
@ 2012-05-15 14:24 ` Arend van Spriel
0 siblings, 0 replies; 2+ messages in thread
From: Arend van Spriel @ 2012-05-15 14:24 UTC (permalink / raw)
To: Dan Carpenter
Cc: Brett Rudley, Roland Vossen, Franky (Zhenhui) Lin, Kan Yan,
John W. Linville, Pieter-Paul Giesberts, linux-wireless,
kernel-janitors
On 05/14/2012 10:57 PM, Dan Carpenter wrote:
> 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.
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
> index 812b6e3..d6380f3 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
> @@ -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;
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-15 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 20:57 [patch] brcm80211: remove an unneeded NULL check Dan Carpenter
2012-05-15 14:24 ` Arend van Spriel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).