All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Pablo Neira Ayuso <pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org>,
	Stephen Hemminger
	<stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>,
	Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>,
	"John W. Linville"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>,
	Stanislaw Gruszka
	<sgruszka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Johannes Berg
	<johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Francois Romieu <romieu-W8zweXLXuWQS+FvcfC7Uqw@public.gmane.org>,
	Ben Hutchings
	<bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>,
	Chas Williams <chas-vT06rRrALxcmhCb6mdbn6A@public.gmane.org>,
	Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Samuel Ortiz <samuel-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>,
	Paul Mackerras <paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
	Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>,
	Konrad Rzeszutek Wilk
	<konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	Boris Ostrovsky
	<boris.ostrovsky-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	David Vrabel
	<david.vrabel-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>,
	Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>,
	"Michael S. Tsirkin"
	<mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	netfilter@vger.k
Subject: Re: [PATCH 02/18] net: use wrapper functions of net_ratelimit() to simplify code
Date: Wed, 16 Oct 2013 11:24:22 +0800	[thread overview]
Message-ID: <525E06E6.2080502@huawei.com> (raw)
In-Reply-To: <1381854263.22110.19.camel@joe-AO722>

Thanks for your reply.

On 10/16 0:24, Joe Perches wrote:
> 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.

Got it, I will coalesce them, but 80 columns limits will be
broken.

> 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.

yes, I found dev_emerg_ratelimited already exists. I should
use them and will add some similar mcaros.

> This comment applies to the whole series.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> .
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Joe Perches <joe@perches.com>
Cc: <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	"John W. Linville" <linville@tuxdriver.com>,
	Stanislaw Gruszka <sgruszka@redhat.com>,
	Johannes Berg <johannes.berg@intel.com>,
	"Francois Romieu" <romieu@fr.zoreil.com>,
	Ben Hutchings <bhutchings@solarflare.com>,
	Chas Williams <chas@cmf.nrl.navy.mil>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Samuel Ortiz <samuel@sortiz.org>,
	Paul Mackerras <paulus@samba.org>,
	Oliver Neukum <oneukum@suse.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	<netfilter@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-wireless@vger.kernel.org>, <guohanjun@huawei.com>
Subject: Re: [PATCH 02/18] net: use wrapper functions of net_ratelimit() to simplify code
Date: Wed, 16 Oct 2013 11:24:22 +0800	[thread overview]
Message-ID: <525E06E6.2080502@huawei.com> (raw)
In-Reply-To: <1381854263.22110.19.camel@joe-AO722>

Thanks for your reply.

On 10/16 0:24, Joe Perches wrote:
> 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.

Got it, I will coalesce them, but 80 columns limits will be
broken.

> 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.

yes, I found dev_emerg_ratelimited already exists. I should
use them and will add some similar mcaros.

> This comment applies to the whole series.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> .
> 



WARNING: multiple messages have this Message-ID (diff)
From: Kefeng Wang <wangkefeng.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Cc: <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Pablo Neira Ayuso <pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org>,
	Stephen Hemminger
	<stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>,
	Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>,
	"John W. Linville"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>,
	Stanislaw Gruszka
	<sgruszka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Johannes Berg
	<johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Francois Romieu"
	<romieu-W8zweXLXuWQS+FvcfC7Uqw@public.gmane.org>,
	Ben Hutchings
	<bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>,
	Chas Williams <chas-vT06rRrALxcmhCb6mdbn6A@public.gmane.org>,
	Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Samuel Ortiz <samuel-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>,
	Paul Mackerras <paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
	Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>,
	Konrad Rzeszutek Wilk
	<konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	Boris Ostrovsky
	<boris.ostrovsky-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	David Vrabel
	<david.vrabel-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>,
	Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>,
	"Michael S. Tsirkin"
	<mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	<netfilter@vger.k
Subject: Re: [PATCH 02/18] net: use wrapper functions of net_ratelimit() to simplify code
Date: Wed, 16 Oct 2013 11:24:22 +0800	[thread overview]
Message-ID: <525E06E6.2080502@huawei.com> (raw)
In-Reply-To: <1381854263.22110.19.camel@joe-AO722>

Thanks for your reply.

On 10/16 0:24, Joe Perches wrote:
> 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.

Got it, I will coalesce them, but 80 columns limits will be
broken.

> 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.

yes, I found dev_emerg_ratelimited already exists. I should
use them and will add some similar mcaros.

> This comment applies to the whole series.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> .
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-10-16  3:24 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15 11:44 [PATCH 00/18] cleanup: wrapper functions of net_ratelimit() called to simplify code Kefeng Wang
2013-10-15 11:44 ` Kefeng Wang
2013-10-15 11:44 ` Kefeng Wang
2013-10-15 11:44 ` [PATCH 01/18] netfilter: cleanup: delete Macro PRINTR Kefeng Wang
2013-10-15 11:44   ` Kefeng Wang
2013-10-15 11:44   ` Kefeng Wang
2013-10-15 11:44 ` [PATCH 02/18] net: use wrapper functions of net_ratelimit() to simplify code Kefeng Wang
2013-10-15 11:44   ` Kefeng Wang
2013-10-15 11:44   ` Kefeng Wang
2013-10-15 16:24   ` Joe Perches
2013-10-15 16:24     ` Joe Perches
2013-10-16  3:24     ` Kefeng Wang [this message]
2013-10-16  3:24       ` Kefeng Wang
2013-10-16  3:24       ` Kefeng Wang
2013-10-15 11:44 ` [PATCH 03/18] rt18187se: " Kefeng Wang
2013-10-15 11:44   ` Kefeng Wang
2013-10-15 11:44   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 04/18] rt18192e: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 05/18] rt18192u: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 06/18] net: wireless: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 07/18] net: ethernet: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 08/18] atm: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 09/18] block: aoe: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 10/18] net: peak_usb: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 11/18] net: hamradio: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 12/18] net: irda: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 13/18] net: ppp: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 14/18] net: usb: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 19:06   ` Sergei Shtylyov
2013-10-15 19:06     ` Sergei Shtylyov
2013-10-16  3:27     ` Kefeng Wang
2013-10-16  3:27       ` Kefeng Wang
2013-10-16  3:27       ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 15/18] net: xen: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 16/18] net: virtio: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 17/18] net: vxlan: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45 ` [PATCH 18/18] net: wimax: " Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang
2013-10-15 11:45   ` Kefeng Wang

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=525E06E6.2080502@huawei.com \
    --to=wangkefeng.wang-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org \
    --cc=boris.ostrovsky-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=chas-vT06rRrALxcmhCb6mdbn6A@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=david.vrabel-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
    --cc=johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
    --cc=mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=netfilter@vger.k \
    --cc=oneukum-l3A5Bk7waGM@public.gmane.org \
    --cc=pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org \
    --cc=paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    --cc=romieu-W8zweXLXuWQS+FvcfC7Uqw@public.gmane.org \
    --cc=rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org \
    --cc=samuel-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org \
    --cc=sgruszka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.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.