From: Dan Carpenter <dan.carpenter@oracle.com>
To: Bastien Nocera <hadess@hadess.net>
Cc: linux-sparse@vger.kernel.org
Subject: Re: False positives unlock warning
Date: Wed, 14 Jan 2015 19:41:27 +0300 [thread overview]
Message-ID: <20150114164127.GD5520@mwanda> (raw)
In-Reply-To: <1421245172.2542.50.camel@hadess.net>
Sparse gets confused because of the unused "_success_exit:" label. If
you delete that it should go away. In "real" kernel code GCC will warn
about unused labels.
I created a more minimal test case while I was looking at this, if
anyone is interested.
static int foo;
int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
{
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl;
_queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
spin_lock(&ppending_recvframe_queue->lock);
if (foo)
goto err;
spin_unlock(&ppending_recvframe_queue->lock);
unused_label:
return 0;
err:
spin_unlock(&ppending_recvframe_queue->lock);
return -1;
}
regards,
dan carpenter
next prev parent reply other threads:[~2015-01-14 16:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 13:46 False positives unlock warning Bastien Nocera
2015-01-14 14:11 ` Dan Carpenter
2015-01-14 14:19 ` Bastien Nocera
2015-01-14 16:41 ` Dan Carpenter [this message]
2015-01-14 17:42 ` Bastien Nocera
2015-01-14 20:54 ` Dan Carpenter
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=20150114164127.GD5520@mwanda \
--to=dan.carpenter@oracle.com \
--cc=hadess@hadess.net \
--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.