* drivers/connector/cn_queue.c:130: warning: value computed is not used
@ 2006-05-30 11:34 Andreas Schwab
2006-05-30 11:48 ` Evgeniy Polyakov
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2006-05-30 11:34 UTC (permalink / raw)
To: netdev
There is no point in testing the atomic value if the result is thrown
away.
Signed-off-by: Andreas Schwab <schwab@suse.de>
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
index 9f2f00d..05f8ce2 100644
--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -127,7 +127,7 @@ void cn_queue_del_callback(struct cn_que
if (found) {
cn_queue_free_callback(cbq);
- atomic_dec_and_test(&dev->refcnt);
+ atomic_dec(&dev->refcnt);
}
}
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: drivers/connector/cn_queue.c:130: warning: value computed is not used
2006-05-30 11:34 drivers/connector/cn_queue.c:130: warning: value computed is not used Andreas Schwab
@ 2006-05-30 11:48 ` Evgeniy Polyakov
2006-05-30 20:11 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Evgeniy Polyakov @ 2006-05-30 11:48 UTC (permalink / raw)
To: Andreas Schwab; +Cc: netdev
On Tue, May 30, 2006 at 01:34:02PM +0200, Andreas Schwab (schwab@suse.de) wrote:
> There is no point in testing the atomic value if the result is thrown
> away.
It was created to put implicit smp barrier, but it is not needed there.
Your patch is correct, thank you.
> Signed-off-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
> diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
> index 9f2f00d..05f8ce2 100644
> --- a/drivers/connector/cn_queue.c
> +++ b/drivers/connector/cn_queue.c
> @@ -127,7 +127,7 @@ void cn_queue_del_callback(struct cn_que
>
> if (found) {
> cn_queue_free_callback(cbq);
> - atomic_dec_and_test(&dev->refcnt);
> + atomic_dec(&dev->refcnt);
> }
> }
>
>
> Andreas.
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: drivers/connector/cn_queue.c:130: warning: value computed is not used
2006-05-30 11:48 ` Evgeniy Polyakov
@ 2006-05-30 20:11 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2006-05-30 20:11 UTC (permalink / raw)
To: johnpol; +Cc: schwab, netdev
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Date: Tue, 30 May 2006 15:48:38 +0400
> On Tue, May 30, 2006 at 01:34:02PM +0200, Andreas Schwab (schwab@suse.de) wrote:
> > There is no point in testing the atomic value if the result is thrown
> > away.
>
> It was created to put implicit smp barrier, but it is not needed there.
> Your patch is correct, thank you.
Right, the *_and_test() variants have SMP barriers which the normal
ones do not. So it is not just a matter of giving a return value
or not, there are real side effect differences.
> > Signed-off-by: Andreas Schwab <schwab@suse.de>
>
> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
But since you say it doesn't matter I'll apply this.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-05-30 20:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-30 11:34 drivers/connector/cn_queue.c:130: warning: value computed is not used Andreas Schwab
2006-05-30 11:48 ` Evgeniy Polyakov
2006-05-30 20:11 ` David Miller
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).