lkml.org 
[lkml]   [2016]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 08/10] staging: ks7010: Replace three printk() calls by pr_err()
From
Date
On Thu, 2016-08-11 at 07:48 +0200, SF Markus Elfring wrote:
> Prefer usage of the macro "pr_err" over the interface "printk".
Not correct

> diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
[]
> @@ -998,11 +998,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(pr_fmt("Unable to alloc new net device\n"));

All of these pr_fmt uses are redundant as pr_err already does pr_fmt
alloc_etherdev already does a dump_stack so the OOM isn't useful.

>   goto release_irq;
>   }
>   if (dev_alloc_name(netdev, "wlan%d") < 0) {
> - printk(KERN_ERR "ks7010 :  Couldn't get name!\n");
> + pr_err(pr_fmt("Couldn't get name!\n"));
>   goto free_dev;
>   }
>  
> @@ -1042,8 +1042,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(pr_fmt("firmware load failed! return code = %d\n"),
>          ret);
>   goto free_buf;
>   }

\
 
 \ /
  Last update: 2016-09-17 09:56    [W:1.463 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site