[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B1D4573.9040605@gmail.com>
Date: Mon, 07 Dec 2009 19:12:03 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Stephen Hemminger <shemminger@...tta.com>
CC: "David S. Miller" <davem@...emloft.net>,
Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH] net: dst_release() cleanup
Stephen Hemminger a écrit :
> I don't like to put actual necessary code in WARN or BUG macro
> args because some embedded type developer is likely to build
> with
>
> #define WARN_ON(x)
>
> to get rid of all warnings.
Oops, I thought WARN_ON(X) must evaluate X once, my bad, since its not documented.
Thanks
[PATCH] net: dst_release() cleanup
atomic_dec_return() is a full memory barrier, we can omit
the smp_mb__before_atomic_dec() call.
Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
---
diff --git a/net/core/dst.c b/net/core/dst.c
index 57bc4d5..c3d0cfa 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -263,11 +263,9 @@ again:
void dst_release(struct dst_entry *dst)
{
if (dst) {
- int newrefcnt;
+ int newrefcnt = atomic_dec_return(&dst->__refcnt);
- smp_mb__before_atomic_dec();
- newrefcnt = atomic_dec_return(&dst->__refcnt);
- WARN_ON(newrefcnt < 0);
+ WARN_ON(newrefcnt < 0);
}
}
EXPORT_SYMBOL(dst_release);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists