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] [day] [month] [year] [list]
Date:	Thu, 16 Jun 2011 09:43:52 -0700
From:	Joe Perches <joe@...ches.com>
To:	Manuel Zerpies <manuel.f.zerpies@...stud.uni-erlangen.de>
Cc:	"David S. Miller" <davem@...emloft.net>,
	David Decotigny <decot@...gle.com>,
	"Hans J. Koch" <hjk@...utronix.de>, Jiri Kosina <jkosina@...e.cz>,
	Ben Pfaff <blp@...stanford.edu>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	christian.dietrich@...ormatik.uni-erlangen.de
Subject: Re: [PATCH 06/11] drivers/net: use printk_ratelimited() instead of
 printk_ratelimit()

On Thu, 2011-06-16 at 14:12 +0200, Manuel Zerpies wrote:
> Since printk_ratelimit() shouldn't be used anymore (see comment in
> include/linux/printk.h), replace it with printk_ratelimited()
[]
> diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
[]
> @@ -536,8 +537,7 @@ static bool _sc92031_check_media(struct net_device *dev)
>  
>  		netif_carrier_on(dev);
>  
> -		if (printk_ratelimit())
> -			printk(KERN_INFO "%s: link up, %sMbps, %s-duplex\n",
> +		printk_ratelimited(KERN_INFO "%s: link up, %sMbps, %s-duplex\n",
> 				dev->name,
>  				speed_100 ? "100" : "10",
>  				duplex_full ? "full" : "half");
 
All these might be better using net_ratelimit and netdev_<level>

		if (net_ratelimit())
			netdev_info(dev, "link up, %uMbps, %s-duplex\n",
				    speed_100 ? 100 : 10,
				    duplex_full ? "full" : "half");

> @@ -549,8 +549,7 @@ static bool _sc92031_check_media(struct net_device *dev)
>  
>  		_sc92031_disable_tx_rx(dev);
>  
> -		if (printk_ratelimit())
> -			printk(KERN_INFO "%s: link down\n", dev->name);
> +		printk_ratelimited(KERN_INFO "%s: link down\n", dev->name);

etc...

netdev_<level>_ratelimited (and netdev_<level>_once)
could instead be added and used I suppose.


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