linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	linux-mtd@lists.infradead.org,
	Igor Grinberg <grinberg@compulab.co.il>
Subject: Re: [PATCH 1/2] mtd: nand: generalized error messages with __func__
Date: Wed, 01 Jun 2011 13:30:35 +0300	[thread overview]
Message-ID: <1306924235.4405.102.camel@localhost> (raw)
In-Reply-To: <BANLkTimsTWAcR4HgOoHguDMv9P-Eox=kbg@mail.gmail.com>

Hi,

On Tue, 2011-05-31 at 11:52 -0700, Brian Norris wrote:
> > Brian, would you please instead just zap the prints?
> 
> Sure, can do. In general, then, is it best practice to simply 'return
> -ENOMEM' or similar (without any printing) in all MTD code?

Yes.

> > On Thu, 2011-05-26 at 08:14 +0300, Igor Grinberg wrote:
> >> On 05/26/11 00:59, Brian Norris wrote:
> >> pr_err() will save you from the need to define the log level each time.
> >> pr_fmt will save you the need to add %s: and __func__.
> 
> Also, it seems that the second statement is not necessarily true. In
> fact, in include/linux/printk.h, we default to the following
> declaration:
>      #define pr_fmt(fmt) fmt

To be more precise:

#ifndef pr_fmt
#define pr_fmt(fmt) fmt
#endif

> So it seems that, when we desire to print out the relevant function
> name, we should manually use __func__ instead of relying on
> pr_fmt...or should we define our own pr_fmt in include/linux/mtd.h?

Yes, before you include files.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  parent reply	other threads:[~2011-06-01 10:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 21:59 [PATCH 1/2] mtd: nand: generalized error messages with __func__ Brian Norris
2011-05-25 21:59 ` [PATCH 2/2] mtd: nand: multi-line comment style fixups Brian Norris
2011-06-06 14:26   ` Artem Bityutskiy
2011-06-06 15:21     ` Brian Norris
2011-05-26  5:14 ` [PATCH 1/2] mtd: nand: generalized error messages with __func__ Igor Grinberg
2011-05-26  5:16   ` Artem Bityutskiy
2011-05-31 18:52     ` Brian Norris
2011-05-31 20:19       ` Mike Frysinger
2011-06-01 10:30       ` Artem Bityutskiy [this message]
2011-06-01 18:37         ` Brian Norris
2011-06-03 15:35           ` Artem Bityutskiy
2011-06-07  7:26           ` Igor Grinberg
2011-06-07 22:57             ` Brian Norris

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=1306924235.4405.102.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=grinberg@compulab.co.il \
    --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;
as well as URLs for NNTP newsgroup(s).