From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Subject: Re: [PATCH 02/18] net: use wrapper functions of net_ratelimit() to simplify code Date: Tue, 15 Oct 2013 09:24:23 -0700 Message-ID: <1381854263.22110.19.camel@joe-AO722> References: <1381837514-50660-1-git-send-email-wangkefeng.wang@huawei.com> <1381837514-50660-3-git-send-email-wangkefeng.wang@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "David S. Miller" , Pablo Neira Ayuso , Stephen Hemminger , Johannes Berg , "John W. Linville" , Stanislaw Gruszka , Johannes Berg , Francois Romieu , Ben Hutchings , Chas Williams , Marc Kleine-Budde , Samuel Ortiz , Paul Mackerras , Oliver Neukum , Konrad Rzeszutek Wilk , Boris Ostrovsky , David Vrabel , Rusty Russell , "Michael S. Tsirkin" , netfilter@vger.kernel To: Kefeng Wang Return-path: In-Reply-To: <1381837514-50660-3-git-send-email-wangkefeng.wang@huawei.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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. [] > diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c [] > @@ -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.