public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Huang Shijie <b32955@freescale.com>
Cc: linux-mtd@lists.infradead.org, computersforpeace@gmail.com,
	dwmw2@infradead.org, dedekind1@gmail.com
Subject: Re: [PATCH v2 2/3] mtd: gpmi: change pr_err to dev_err
Date: Tue, 19 Nov 2013 11:56:02 -0300	[thread overview]
Message-ID: <20131119145601.GA19739@localhost> (raw)
In-Reply-To: <1384829872-8714-3-git-send-email-b32955@freescale.com>

Hi Huang,

On Tue, Nov 19, 2013 at 10:57:51AM +0800, Huang Shijie wrote:
>  
>  	this = devm_kzalloc(&pdev->dev, sizeof(*this), GFP_KERNEL);
>  	if (!this) {
> -		pr_err("Failed to allocate per-device memory\n");
> +		dev_err(&pdev->dev, "Failed to allocate per-device memory\n");
>  		return -ENOMEM;
>  	}
>  

For all the kmalloc variants you should *never* print *any* OOM messages.

If the kernel has ran out of memory to satisfy an allocation you'll get
far more descriptive errors from the mm subsystem, with a backtrace and
some more goodies ;-)

So, the patch should actually remove this entire print.

Joe Perches has been removing this messages all kernel wide:
http://archive.linuxvirtualserver.org/html/lvs-devel/2011-08/msg00001.html
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

  reply	other threads:[~2013-11-19 14:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19  2:57 [PATCH v2 0/3] the clean-up for gpmi Huang Shijie
2013-11-19  2:57 ` [PATCH v2 1/3] mtd: gpmi: remove the unnecessary pr_err() Huang Shijie
2013-11-20  2:11   ` Brian Norris
2013-11-19  2:57 ` [PATCH v2 2/3] mtd: gpmi: change pr_err to dev_err Huang Shijie
2013-11-19 14:56   ` Ezequiel Garcia [this message]
2013-11-20  2:18     ` Huang Shijie
2013-11-19  2:57 ` [PATCH v2 3/3] mtd: gpmi: change pr_debug to dev_dbg Huang Shijie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131119145601.GA19739@localhost \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox