Re: [PATCH 02/18] net: use wrapper functions of net_ratelimit() to simplify code

From
Joe Perches <joe@perches.com>
Date
2013-10-15 16:24:36
Also in
lkml, netdev
Reply to
Kefeng Wang, 2013-10-15
On Tue, 2013-10-15 at 19:44 +0800, Kefeng Wang wrote:
Wrapper functions net_ratelimited_function() and net_XXX_ratelimited()
are called to simplify code.
[]
quoted hunk ↗ jump to hunk
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
[]
quoted hunk ↗ jump to hunk
@@ -465,10 +465,8 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
 	if (likely(fdb)) {
 		/* attempt to update an entry for a local interface */
 		if (unlikely(fdb->is_local)) {
-			if (net_ratelimit())
-				br_warn(br, "received packet on %s with "
-					"own address as source address\n",
-					source->dev->name);
+			net_ratelimited_function(br_warn, br, "received packet on %s "
+				"with own address as source address\n", source->dev->name);
Hello Kefeng.

When these types of lines are changed, please coalesce the
fragmented format pieces into a single string.

It makes grep a bit easier and 80 columns limits don't
apply to formats.

I think using net_ratelimited_function is not particularly
clarifying here.

Maybe net_ratelimited_function should be removed instead
of its use sites expanded.

Perhaps adding macros like #define br_warn_ratelimited()
would be better.

This comment applies to the whole series.
Thread (23 messages) 23 messages, 3 authors, last reply 2013-10-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help