mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thiago Galesi <thiagogalesi@gmail.com>
To: dbrownell@users.sourceforge.net
Cc: Linux MTD <linux-mtd@lists.infradead.org>,
	lkml <linux-kernel@vger.kernel.org>,
	DaVinci <davinci-linux-open-source@linux.davincidsp.com>
Subject: Re: [patch/RESEND 2.6.29-rc3-git] NAND: davinci_nand driver
Date: Tue, 24 Feb 2009 22:55:45 -0300	[thread overview]
Message-ID: <82ecf08e0902241755y5a7be725gb84116433b7d3be2@mail.gmail.com> (raw)
In-Reply-To: <200902241509.54649.david-b@pacbell.net>

OK a couple of things
 +
> +
> +#ifdef CONFIG_MTD_PARTITIONS
> +static inline int mtd_has_partitions(void) { return 1; }
> +#else
> +static inline int mtd_has_partitions(void) { return 0; }
> +#endif
> +
> +#ifdef CONFIG_MTD_CMDLINE_PARTS
> +static inline int mtd_has_cmdlinepart(void) { return 1; }
> +#else
> +static inline int mtd_has_cmdlinepart(void) { return 0; }
> +#endif

I'm not sure stylewise this is the best way. Even though #ifdefs stays
outside of functions, this is a case where maybe it's better to put it
inside or rething the need / usage for these functions.

> +static int nand_davinci_calculate_1bit(struct mtd_info *mtd,
> +                                     const u_char *dat, u_char *ecc_code)

(and others)

My beef here is the use of u_char. This is really not a standart C
type or a standart Linux type (u8/u32 etc), so we should aim for those
(yes, I hate typing unsigned blah blah blah) but you can use u8 for
that.

> +static void nand_davinci_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
> +{
> +       struct nand_chip *chip = mtd->priv;
> +
> +       if ((0x03 & ((unsigned)buf)) == 0 && (0x03 & len) == 0)
> +               ioread32_rep(chip->IO_ADDR_R, buf, len >> 2);
> +       else if ((0x01 & ((unsigned)buf)) == 0 && (0x01 & len) == 0)

What are those 0x03 and 0x01 (and other places as well), you'll have
to spell out those, preferably using defines.

-- 
-
Thiago Galesi

  reply	other threads:[~2009-02-25  1:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24 23:09 David Brownell
2009-02-25  1:55 ` Thiago Galesi [this message]
2009-02-25  4:12   ` David Brownell
2009-02-25 13:05     ` Thiago Galesi
2009-02-26 20:33 ` Andrew Morton
2009-02-26 23:15   ` David Brownell
2009-02-27 17:52     ` Felipe Balbi
2009-03-02  8:33       ` Rajashekhara, Sudhakar
2009-02-27 22:29     ` Kevin Hilman
2009-02-26 23:18   ` [patch 2.6.29-rc6-mmotm] MTD: partitioning utility predicates David Brownell

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=82ecf08e0902241755y5a7be725gb84116433b7d3be2@mail.gmail.com \
    --to=thiagogalesi@gmail.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®