All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] staging: ks7010: Fix warnings on printk() usage
@ 2016-09-03 17:21 Sabitha George
  2016-09-12  8:58 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Sabitha George @ 2016-09-03 17:21 UTC (permalink / raw)
  To: gregkh, wsa, devel, linux-kernel; +Cc: Sabitha George

This patch fixes the following warnings on ks7010_sdio.c
1. printk() should include KERN_ facility level
2. Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...

Signed-off-by: Sabitha George <sabitha.george@gmail.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 67b01a6..d45bacd 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -499,8 +499,8 @@ static void ks7010_rw_function(struct work_struct *work)
 		DPRINTK(4, "wait after WAKEUP \n");
 /*		queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq,
 		(priv->last_wakeup + ((30*HZ)/1000) - jiffies));*/
-		printk("wake: %lu %lu\n", priv->last_wakeup + (30 * HZ) / 1000,
-		       jiffies);
+		pr_info("wake: %lu %lu\n", priv->last_wakeup + (30 * HZ) / 1000,
+			jiffies);
 		msleep(30);
 	}
 
@@ -1010,11 +1010,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	/* private memory allocate */
 	netdev = alloc_etherdev(sizeof(*priv));
 	if (netdev == NULL) {
-		printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
+		pr_err("ks7010 : Unable to alloc new net device\n");
 		goto error_release_irq;
 	}
 	if (dev_alloc_name(netdev, "wlan%d") < 0) {
-		printk(KERN_ERR "ks7010 :  Couldn't get name!\n");
+		pr_err("ks7010 :  Couldn't get name!\n");
 		goto error_free_netdev;
 	}
 
@@ -1054,8 +1054,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	/* Upload firmware */
 	ret = ks7010_upload_firmware(priv, card);	/* firmware load */
 	if (ret) {
-		printk(KERN_ERR
-		       "ks7010: firmware load failed !! retern code = %d\n",
+		pr_err("ks7010: firmware load failed !! retern code = %d\n",
 		       ret);
 		goto error_free_read_buf;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/5] staging: ks7010: Fix warnings on printk() usage
  2016-09-03 17:21 [PATCH 4/5] staging: ks7010: Fix warnings on printk() usage Sabitha George
@ 2016-09-12  8:58 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-09-12  8:58 UTC (permalink / raw)
  To: Sabitha George; +Cc: wsa, devel, linux-kernel

On Sat, Sep 03, 2016 at 10:51:49PM +0530, Sabitha George wrote:
> This patch fixes the following warnings on ks7010_sdio.c
> 1. printk() should include KERN_ facility level
> 2. Prefer [subsystem eg: netdev]_err([subsystem]dev, ...
> then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
> 
> Signed-off-by: Sabitha George <sabitha.george@gmail.com>
> ---
>  drivers/staging/ks7010/ks7010_sdio.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> index 67b01a6..d45bacd 100644
> --- a/drivers/staging/ks7010/ks7010_sdio.c
> +++ b/drivers/staging/ks7010/ks7010_sdio.c
> @@ -499,8 +499,8 @@ static void ks7010_rw_function(struct work_struct *work)
>  		DPRINTK(4, "wait after WAKEUP \n");
>  /*		queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,&priv->ks_wlan_hw.rw_wq,
>  		(priv->last_wakeup + ((30*HZ)/1000) - jiffies));*/
> -		printk("wake: %lu %lu\n", priv->last_wakeup + (30 * HZ) / 1000,
> -		       jiffies);
> +		pr_info("wake: %lu %lu\n", priv->last_wakeup + (30 * HZ) / 1000,
> +			jiffies);
>  		msleep(30);
>  	}
>  
> @@ -1010,11 +1010,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
>  	/* private memory allocate */
>  	netdev = alloc_etherdev(sizeof(*priv));
>  	if (netdev == NULL) {
> -		printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
> +		pr_err("ks7010 : Unable to alloc new net device\n");
>  		goto error_release_irq;
>  	}
>  	if (dev_alloc_name(netdev, "wlan%d") < 0) {
> -		printk(KERN_ERR "ks7010 :  Couldn't get name!\n");
> +		pr_err("ks7010 :  Couldn't get name!\n");
>  		goto error_free_netdev;
>  	}
>  
> @@ -1054,8 +1054,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
>  	/* Upload firmware */
>  	ret = ks7010_upload_firmware(priv, card);	/* firmware load */
>  	if (ret) {
> -		printk(KERN_ERR
> -		       "ks7010: firmware load failed !! retern code = %d\n",
> +		pr_err("ks7010: firmware load failed !! retern code = %d\n",
>  		       ret);

This is a driver, so please use dev_err() where ever possible (I think
it can be used in two of the above places, maybe all three.)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-12  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-03 17:21 [PATCH 4/5] staging: ks7010: Fix warnings on printk() usage Sabitha George
2016-09-12  8:58 ` Greg KH

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.