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]
Date:	Fri, 28 Jun 2013 09:02:50 +0100
From:	Wei Liu <wei.liu2@...rix.com>
To:	Joe Perches <joe@...ches.com>
CC:	Ian Campbell <ian.campbell@...rix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	<xen-devel@...ts.xensource.com>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>,
	"virtualization@...ts.osdl.org" 
	<virtualization@...ts.linux-foundation.org>, <wei.liu2@...rix.com>
Subject: Re: [PATCH next] xen: Use more current logging styles

On Thu, Jun 27, 2013 at 09:57:49PM -0700, Joe Perches wrote:
> Instead of mixing printk and pr_<level> forms,
> just use pr_<level>
> 
> Miscellaneous changes around these conversions:
> 
> Add a missing newline to avoid message interleaving,
> coalesce formats, reflow modified lines to 80 columns.
> 

Do you also need to replace other printk occurences in xen-netback
directory, say, interface.c and xenbus.c?


Wei.

> Signed-off-by: Joe Perches <joe@...ches.com>
> ---
>  drivers/net/xen-netback/netback.c |  7 +++----
>  drivers/net/xen-netfront.c        | 28 +++++++++++++---------------
>  2 files changed, 16 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 130bcb2..64828de 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -1890,9 +1890,8 @@ static int __init netback_init(void)
>  		return -ENODEV;
>  
>  	if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) {
> -		printk(KERN_INFO
> -		       "xen-netback: fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n",
> -		       fatal_skb_slots, XEN_NETBK_LEGACY_SLOTS_MAX);
> +		pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n",
> +			fatal_skb_slots, XEN_NETBK_LEGACY_SLOTS_MAX);
>  		fatal_skb_slots = XEN_NETBK_LEGACY_SLOTS_MAX;
>  	}
>  
> @@ -1921,7 +1920,7 @@ static int __init netback_init(void)
>  					     "netback/%u", group);
>  
>  		if (IS_ERR(netbk->task)) {
> -			printk(KERN_ALERT "kthread_create() fails at netback\n");
> +			pr_alert("kthread_create() fails at netback\n");
>  			del_timer(&netbk->net_timer);
>  			rc = PTR_ERR(netbk->task);
>  			goto failed_init;
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 76a2236..ff7f111 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -29,6 +29,8 @@
>   * IN THE SOFTWARE.
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/module.h>
>  #include <linux/kernel.h>
>  #include <linux/netdevice.h>
> @@ -385,9 +387,8 @@ static void xennet_tx_buf_gc(struct net_device *dev)
>  			skb = np->tx_skbs[id].skb;
>  			if (unlikely(gnttab_query_foreign_access(
>  				np->grant_tx_ref[id]) != 0)) {
> -				printk(KERN_ALERT "xennet_tx_buf_gc: warning "
> -				       "-- grant still in use by backend "
> -				       "domain.\n");
> +				pr_alert("%s: warning -- grant still in use by backend domain\n",
> +					 __func__);
>  				BUG();
>  			}
>  			gnttab_end_foreign_access_ref(
> @@ -804,14 +805,14 @@ static int xennet_set_skb_gso(struct sk_buff *skb,
>  {
>  	if (!gso->u.gso.size) {
>  		if (net_ratelimit())
> -			printk(KERN_WARNING "GSO size must not be zero.\n");
> +			pr_warn("GSO size must not be zero\n");
>  		return -EINVAL;
>  	}
>  
>  	/* Currently only TCPv4 S.O. is supported. */
>  	if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) {
>  		if (net_ratelimit())
> -			printk(KERN_WARNING "Bad GSO type %d.\n", gso->u.gso.type);
> +			pr_warn("Bad GSO type %d\n", gso->u.gso.type);
>  		return -EINVAL;
>  	}
>  
> @@ -910,9 +911,8 @@ static int checksum_setup(struct net_device *dev, struct sk_buff *skb)
>  		break;
>  	default:
>  		if (net_ratelimit())
> -			printk(KERN_ERR "Attempting to checksum a non-"
> -			       "TCP/UDP packet, dropping a protocol"
> -			       " %d packet", iph->protocol);
> +			pr_err("Attempting to checksum a non-TCP/UDP packet, dropping a protocol %d packet\n",
> +			       iph->protocol);
>  		goto out;
>  	}
>  
> @@ -1359,14 +1359,14 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
>  	/* A grant for every tx ring slot */
>  	if (gnttab_alloc_grant_references(TX_MAX_TARGET,
>  					  &np->gref_tx_head) < 0) {
> -		printk(KERN_ALERT "#### netfront can't alloc tx grant refs\n");
> +		pr_alert("can't alloc tx grant refs\n");
>  		err = -ENOMEM;
>  		goto exit_free_stats;
>  	}
>  	/* A grant for every rx ring slot */
>  	if (gnttab_alloc_grant_references(RX_MAX_TARGET,
>  					  &np->gref_rx_head) < 0) {
> -		printk(KERN_ALERT "#### netfront can't alloc rx grant refs\n");
> +		pr_alert("can't alloc rx grant refs\n");
>  		err = -ENOMEM;
>  		goto exit_free_tx;
>  	}
> @@ -1430,16 +1430,14 @@ static int netfront_probe(struct xenbus_device *dev,
>  
>  	err = register_netdev(info->netdev);
>  	if (err) {
> -		printk(KERN_WARNING "%s: register_netdev err=%d\n",
> -		       __func__, err);
> +		pr_warn("%s: register_netdev err=%d\n", __func__, err);
>  		goto fail;
>  	}
>  
>  	err = xennet_sysfs_addif(info->netdev);
>  	if (err) {
>  		unregister_netdev(info->netdev);
> -		printk(KERN_WARNING "%s: add sysfs failed err=%d\n",
> -		       __func__, err);
> +		pr_warn("%s: add sysfs failed err=%d\n", __func__, err);
>  		goto fail;
>  	}
>  
> @@ -2116,7 +2114,7 @@ static int __init netif_init(void)
>  	if (xen_hvm_domain() && !xen_platform_pci_unplug)
>  		return -ENODEV;
>  
> -	printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n");
> +	pr_info("Initialising Xen virtual ethernet driver\n");
>  
>  	return xenbus_register_frontend(&netfront_driver);
>  }
> 
> 
> --
> 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
--
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