From: Roland Dreier <rdreier@cisco.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org,
David Brownell <david-b@pacbell.net>
Subject: Re: Sparse annotation for "context imbalance" false positives?
Date: Thu, 15 May 2008 08:05:23 -0700 [thread overview]
Message-ID: <ada7idvfw0c.fsf@cisco.com> (raw)
In-Reply-To: <1210841663.4282.9.camel@johannes.berg> (Johannes Berg's message of "Thu, 15 May 2008 10:54:23 +0200")
> You could, for example, insert this:
>
> > static void mlx4_ib_lock_cqs(struct mlx4_ib_cq *send_cq, struct mlx4_ib_cq *recv_cq)
> > {
> > if (send_cq == recv_cq)
> {
> > spin_lock_irq(&send_cq->lock);
> /* pretend to have acquired both for sparse */
> __acquire(&recv_cq->lock);
> }
but the problem sparse sees is not that some paths take only one lock
and some take two -- sparse is complaining that this function is
returning without unlocking the locks that it takes. Even if I change
the function to something as simple as:
static void mlx4_ib_lock_cqs(struct mlx4_ib_cq *send_cq, struct mlx4_ib_cq *recv_cq)
{
spin_lock_irq(&recv_cq->lock);
}
I still get
drivers/infiniband/hw/mlx4/qp.c:603:13: warning: context imbalance in 'mlx4_ib_lock_cqs' - wrong count at exitn
thanks,
Roland
next prev parent reply other threads:[~2008-05-15 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-15 3:16 Sparse annotation for "context imbalance" false positives? Roland Dreier
2008-05-15 8:54 ` Johannes Berg
2008-05-15 15:05 ` Roland Dreier [this message]
2008-05-15 15:20 ` Johannes Berg
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=ada7idvfw0c.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=david-b@pacbell.net \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.