From: Larry Finger <Larry.Finger@lwfinger.net>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: False warning from Sparse
Date: Sat, 21 Jul 2012 22:52:54 -0500 [thread overview]
Message-ID: <500B7916.6060804@lwfinger.net> (raw)
Hi,
I am getting the following false warning from sparse:
CHECK drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:1158:13: warning: context
imbalance in 'rtl92c_dm_refresh_rate_adaptive_mask' - different lock contexts
for basic block
The only code in that routine that does any locking is the following:
/* Only the PCI card uses sta in the update rate table
* callback routine */
if (rtlhal->interface == INTF_PCI) {
rcu_read_lock();
sta = ieee80211_find_sta(mac->vif, mac->bssid);
}
rtlpriv->cfg->ops->update_rate_tbl(hw, sta,
p_ra->ratr_state);
p_ra->pre_ratr_state = p_ra->ratr_state;
if (rtlhal->interface == INTF_PCI)
rcu_read_unlock();
Does the warning get output because the code cannot assume that
rtlhal->interface is the same in both if statements? If that is the case, are
there any compiler directives that would tell sparse of the situation?
Thanks,
Larry
next reply other threads:[~2012-07-22 3:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-22 3:52 Larry Finger [this message]
2012-07-22 4:44 ` False warning from Sparse Josh Triplett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=500B7916.6060804@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox