lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1381837514-50660-14-git-send-email-wangkefeng.wang@huawei.com>
Date:	Tue, 15 Oct 2013 19:45:09 +0800
From:	Kefeng Wang <wangkefeng.wang@...wei.com>
To:	<linux-kernel@...r.kernel.org>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"David S. Miller" <davem@...emloft.net>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	"Stephen Hemminger" <stephen@...workplumber.org>,
	Johannes Berg <johannes@...solutions.net>,
	"John W. Linville" <linville@...driver.com>,
	Stanislaw Gruszka <sgruszka@...hat.com>,
	Johannes Berg <johannes.berg@...el.com>,
	Francois Romieu <romieu@...zoreil.com>,
	"Ben Hutchings" <bhutchings@...arflare.com>,
	Chas Williams <chas@....nrl.navy.mil>,
	Marc Kleine-Budde <mkl@...gutronix.de>,
	Samuel Ortiz <samuel@...tiz.org>,
	Paul Mackerras <paulus@...ba.org>,
	Oliver Neukum <oneukum@...e.de>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	"Boris Ostrovsky" <boris.ostrovsky@...cle.com>,
	David Vrabel <david.vrabel@...rix.com>,
	Rusty Russell <rusty@...tcorp.com.au>,
	"Michael S. Tsirkin" <mst@...hat.com>, <netfilter@...r.kernel.org>,
	<netdev@...r.kernel.org>, <linux-wireless@...r.kernel.org>,
	<guohanjun@...wei.com>
Subject: [PATCH 13/18] net: ppp: use wrapper functions of net_ratelimit() to simplify code

net_ratelimited_function() is called to simplify code.

Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
 drivers/net/ppp/ppp_generic.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 72ff14b..53900cd 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1125,8 +1125,8 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb)
 		ppp->xcomp->comp_extra + PPP_HDRLEN;
 	new_skb = alloc_skb(new_skb_size, GFP_ATOMIC);
 	if (!new_skb) {
-		if (net_ratelimit())
-			netdev_err(ppp->dev, "PPP: no memory (comp pkt)\n");
+		net_ratelimited_function(netdev_err, ppp->dev,
+			"PPP: no memory (comp pkt)\n");
 		return NULL;
 	}
 	if (ppp->dev->hard_header_len > PPP_HDRLEN)
@@ -1155,8 +1155,8 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb)
 		 * the compress_proto because MPPE and MPPC share
 		 * the same number.
 		 */
-		if (net_ratelimit())
-			netdev_err(ppp->dev, "ppp: compressor dropped pkt\n");
+		net_ratelimited_function(netdev_err, ppp->dev,
+			"ppp: compressor dropped pkt\n");
 		kfree_skb(skb);
 		consume_skb(new_skb);
 		new_skb = NULL;
@@ -1251,8 +1251,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
 	if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state &&
 	    proto != PPP_LCP && proto != PPP_CCP) {
 		if (!(ppp->flags & SC_CCP_UP) && (ppp->flags & SC_MUST_COMP)) {
-			if (net_ratelimit())
-				netdev_err(ppp->dev,
+			net_ratelimited_function(netdev_err, ppp->dev,
 					   "ppp: compression required but "
 					   "down - pkt dropped.\n");
 			goto drop;
-- 
1.8.2.1


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

Powered by Openwall GNU/*/Linux Powered by OpenVZ