public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>,
	Matthieu Castet <matthieu.castet@parrot.com>,
	Jim Quinlan <jim2101024@gmail.com>,
	linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Matthew Creech <mlcreech@gmail.com>
Subject: Re: [PATCH 03/14] mtd: define `is_ecc_error()' macros
Date: Sun, 11 Sep 2011 16:57:15 +0300	[thread overview]
Message-ID: <1315749440.18731.65.camel@sauron> (raw)
In-Reply-To: <1315426421-16243-4-git-send-email-computersforpeace@gmail.com>

On Wed, 2011-09-07 at 13:13 -0700, Brian Norris wrote:
> These macros can be used instead of including -EUCLEAN and -EBADMSG all
> over the place. They should help make code a little bit more readable.
> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> ---
>  include/linux/mtd/mtd.h |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
> index ead70ed..1dd74f4 100644
> --- a/include/linux/mtd/mtd.h
> +++ b/include/linux/mtd/mtd.h
> @@ -348,4 +348,9 @@ void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size);
>  
>  void mtd_erase_callback(struct erase_info *instr);
>  
> +#define is_corrected_ecc_error(error) (error == -EUCLEAN)

This is not really an error...

> +#define is_uncorrected_ecc_error(error) (error == -EBADMSG)
> +#define is_ecc_error(error) ((is_corrected_ecc_error(error) || \
> +			      is_uncorrected_ecc_error(error)))

Could we please have static inline functions instead of macros?

I think it is nicer to have mtd_ prefixes, how about these names
instead:

mtd_is_bitflip()
mtd_is_eccerr()
mtd_is_bitflip_or_eccerr()

-- 
Best Regards,
Artem Bityutskiy

  reply	other threads:[~2011-09-11 13:54 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07 20:13 [PATCH 00/14] mtd: nand: improve flash-based BBT robustness Brian Norris
2011-09-07 20:13 ` [PATCH 01/14] mtd: nand: refactor scanning code Brian Norris
2011-09-11 13:58   ` Artem Bityutskiy
2011-09-07 20:13 ` [PATCH 02/14] mtd: nand: do not ignore all ECC errors Brian Norris
2011-09-11 13:58   ` Artem Bityutskiy
2011-09-07 20:13 ` [PATCH 03/14] mtd: define `is_ecc_error()' macros Brian Norris
2011-09-11 13:57   ` Artem Bityutskiy [this message]
2011-09-19  4:14     ` Artem Bityutskiy
2011-09-19 18:43       ` Brian Norris
2011-09-20  7:19         ` Artem Bityutskiy
2011-09-21  1:30           ` [PATCH v2 03/14] mtd: define `mtd_is_*()' functions Brian Norris
2011-09-21  1:40           ` [PATCH 03/14] mtd: define `is_ecc_error()' macros Brian Norris
2011-09-21  6:24             ` Artem Bityutskiy
2011-09-07 20:13 ` [PATCH 04/14] mtd: utilize " Brian Norris
2011-09-21  1:34   ` [PATCH v2 04/14] mtd: utilize `mtd_is_*()' functions Brian Norris
2011-09-07 20:13 ` [PATCH 05/14] mtd: nand: remove unnecessary variable Brian Norris
2011-09-11 13:58   ` Artem Bityutskiy
2011-09-07 20:13 ` [PATCH 06/14] mtd: nand: fix style Brian Norris
2011-09-11 14:00   ` Artem Bityutskiy
2011-09-07 20:13 ` [PATCH 07/14] mtd: nand: begin restructuring check_create Brian Norris
2011-09-07 20:13 ` [PATCH 08/14] mtd: nand: remove gotos in `check_create()' Brian Norris
2011-09-07 20:13 ` [PATCH 09/14] mtd: nand: report ECC errors properly when reading BBT Brian Norris
2011-09-21  1:35   ` [PATCH v2 " Brian Norris
2011-09-07 20:13 ` [PATCH 10/14] mtd: nand: scrub BBT on ECC errors Brian Norris
2011-09-21  1:35   ` [PATCH v2 " Brian Norris
2011-09-07 20:13 ` [PATCH 11/14] mtd: nand: wait to set BBT version Brian Norris
2011-09-21  1:35   ` [PATCH v2 " Brian Norris
2011-09-07 20:13 ` [PATCH 12/14] mtd: nand: do not scan bad blocks with NAND_BBT_NO_OOB set Brian Norris
2011-09-21  1:36   ` [PATCH v2 " Brian Norris
2011-09-07 20:13 ` [PATCH 13/14] mtd: nand: invalidate cache on unaligned reads Brian Norris
2011-09-07 20:13 ` [PATCH 14/14] mtd: nand: switch `check_pattern()' to standard `memcmp()' 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=1315749440.18731.65.camel@sauron \
    --to=dedekind1@gmail.com \
    --cc=cernekee@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=jim2101024@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=matthieu.castet@parrot.com \
    --cc=mlcreech@gmail.com \
    /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