diff mbox

[OPW,kernel] staging:sb105x:Replace printk with pr_err

Message ID 20140309022517.GA29487@himangi-Inspiron-N5110gmail.com
State New, archived
Headers show

Commit Message

HIMANGI SARAOGI March 9, 2014, 2:25 a.m. UTC
This patch replaces printk with pr_err as the printk calls are used to
display error messages to remove the checkpatch.pl warnings:
WARNING: printk() should include KERN_ facility level
and then WARNING: Prefer netdev_err(netdev, ... then dev_err(dev,
... then pr_err(...  to printk(KERN_NOTICE ... on adding KERN_ERR
message designation.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
 drivers/staging/sb105x/sb_pci_mp.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Greg Kroah-Hartman March 9, 2014, 4:36 a.m. UTC | #1
On Sun, Mar 09, 2014 at 07:55:17AM +0530, Himangi Saraogi wrote:
> This patch replaces printk with pr_err as the printk calls are used to
> display error messages to remove the checkpatch.pl warnings:
> WARNING: printk() should include KERN_ facility level
> and then WARNING: Prefer netdev_err(netdev, ... then dev_err(dev,
> ... then pr_err(...  to printk(KERN_NOTICE ... on adding KERN_ERR
> message designation.
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> ---
>  drivers/staging/sb105x/sb_pci_mp.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

This file isn't even in my tree anymore :(
Julia Lawall March 9, 2014, 7:03 a.m. UTC | #2
On Sun, 9 Mar 2014, Himangi Saraogi wrote:

> This patch replaces printk with pr_err as the printk calls are used to
> display error messages to remove the checkpatch.pl warnings:
> WARNING: printk() should include KERN_ facility level
> and then WARNING: Prefer netdev_err(netdev, ... then dev_err(dev,
> ... then pr_err(...  to printk(KERN_NOTICE ... on adding KERN_ERR
> message designation.
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> ---
>  drivers/staging/sb105x/sb_pci_mp.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/sb105x/sb_pci_mp.c b/drivers/staging/sb105x/sb_pci_mp.c
> index c9d6ee3..4abc4ae 100644
> --- a/drivers/staging/sb105x/sb_pci_mp.c
> +++ b/drivers/staging/sb105x/sb_pci_mp.c
> @@ -182,7 +182,7 @@ static int sb1054_get_register(struct sb_uart_port *port, int page, int reg)
>  
>  	if( page <= 0)
>  	{
> -		printk(" page 0 can not use this function\n");
> +		pr_err(" page 0 can not use this function\n");

There is a device pointer in the port parameter of this function (/* 
parent device */).  Perhaps dev_err would be better.

It should be possible to use Coccinelle to choose the right function in 
many cases.

julia


>  		return -1;
>  	}
>  
> @@ -228,7 +228,7 @@ static int sb1054_get_register(struct sb_uart_port *port, int page, int reg)
>  			SB105X_PUT_LCR(port,lcr);
>  			break;
>  		default:
> -			printk(" error invalid page number \n");
> +			pr_err(" error invalid page number\n");
>  			return -1;
>  	}
>  
> @@ -243,7 +243,7 @@ static int sb1054_set_register(struct sb_uart_port *port, int page, int reg, int
>  
>  	if( page <= 0)
>  	{
> -		printk(" page 0 can not use this function\n");
> +		pr_err(" page 0 can not use this function\n");
>  		return -1;
>  	}
>  	switch(page)
> @@ -287,7 +287,7 @@ static int sb1054_set_register(struct sb_uart_port *port, int page, int reg, int
>  			ret = 1;
>  			break;
>  		default:
> -			printk(" error invalid page number \n");
> +			pr_err("error invalid page number\n");
>  			return -1;
>  	}
>  
> -- 
> 1.7.9.5
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
diff mbox

Patch

diff --git a/drivers/staging/sb105x/sb_pci_mp.c b/drivers/staging/sb105x/sb_pci_mp.c
index c9d6ee3..4abc4ae 100644
--- a/drivers/staging/sb105x/sb_pci_mp.c
+++ b/drivers/staging/sb105x/sb_pci_mp.c
@@ -182,7 +182,7 @@  static int sb1054_get_register(struct sb_uart_port *port, int page, int reg)
 
 	if( page <= 0)
 	{
-		printk(" page 0 can not use this function\n");
+		pr_err(" page 0 can not use this function\n");
 		return -1;
 	}
 
@@ -228,7 +228,7 @@  static int sb1054_get_register(struct sb_uart_port *port, int page, int reg)
 			SB105X_PUT_LCR(port,lcr);
 			break;
 		default:
-			printk(" error invalid page number \n");
+			pr_err(" error invalid page number\n");
 			return -1;
 	}
 
@@ -243,7 +243,7 @@  static int sb1054_set_register(struct sb_uart_port *port, int page, int reg, int
 
 	if( page <= 0)
 	{
-		printk(" page 0 can not use this function\n");
+		pr_err(" page 0 can not use this function\n");
 		return -1;
 	}
 	switch(page)
@@ -287,7 +287,7 @@  static int sb1054_set_register(struct sb_uart_port *port, int page, int reg, int
 			ret = 1;
 			break;
 		default:
-			printk(" error invalid page number \n");
+			pr_err("error invalid page number\n");
 			return -1;
 	}