Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461614

Re: staging: ks7010: Replace three printk() calls by pr_err()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject Re: staging: ks7010: Replace three printk() calls by pr_err()
Date 2016-08-13 13:20 +0200
Message-ID <s5F8R-8N-3@gated-at.bofh.it> (permalink)
References (15 earlier) <mSsDN-4wa-33@gated-at.bofh.it> <rVYFQ-430-11@gated-at.bofh.it> <s4Qzn-70w-1@gated-at.bofh.it> <s4R2p-7bt-17@gated-at.bofh.it> <s5qCR-632-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> Prefer usage of the macro "pr_err" over the interface "printk".
> Not correct

A checkpatch warning like "PREFER_PR_LEVEL" can point additional possibilities out
for this use case.
Would you like to introduce any of the higher level logging functions instead?


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

Thanks for your reminder.

Would you accept that another update will be appended to the discussed patch series?


> alloc_etherdev already does a dump_stack so the OOM isn't useful.

Does this information indicate that this printk() (or pr_err()) call
should be deleted?

Regards,
Markus

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:20 +0200
  [PATCH v2 02/10] staging: ks7010: Delete unnecessary assignments for  buffer variables SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:30 +0200
  [PATCH v2 01/10] staging: ks7010: Delete unnecessary checks before  the function call "kfree" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:30 +0200
  [PATCH v2 04/10] staging: ks7010: Rename jump labels SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:40 +0200
  [PATCH v2 03/10] staging: ks7010: Return directly after a failed  kmalloc() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:40 +0200
  [PATCH v2 05/10] staging: ks7010: Delete unnecessary uses of the  variable "retval" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:40 +0200
  [PATCH v2 06/10] staging: ks7010: Delete unnecessary braces SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:50 +0200
  [PATCH v2 07/10] staging: ks7010: Add the macro "pr_fmt" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:50 +0200
  [PATCH v2 08/10] staging: ks7010: Replace three printk() calls by  pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:50 +0200
    Re: [PATCH v2 08/10] staging: ks7010: Replace three printk() calls  by pr_err() Joe Perches <joe@perches.com> - 2016-08-12 21:50 +0200
      Re: staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-13 13:20 +0200
        Re: staging: ks7010: Replace three printk() calls by pr_err() Joe Perches <joe@perches.com> - 2016-08-13 19:40 +0200
          Re: staging: ks7010: Replace three printk() calls by pr_err() Joe Perches <joe@perches.com> - 2016-08-14 11:00 +0200
            Re: staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-14 12:10 +0200
              Re: staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-14 13:10 +0200
          Re: staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-14 11:30 +0200
  [PATCH v2 09/10] staging: ks7010: Delete a variable in  write_to_device() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 08:00 +0200
  [PATCH v2 10/10] staging: ks7010: Delete three unnecessary variable  initialisations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 08:10 +0200
  Re: [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card  driver SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-14 12:20 +0200
  Re: [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card  driver Wolfram Sang <wsa@the-dreams.de> - 2016-08-14 14:10 +0200

csiph-web