public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] [OneNAND] Flex-OneNAND driver support
Date: Mon, 28 Sep 2009 15:02:41 -0500	[thread overview]
Message-ID: <20090928200241.GC9683@b07421-ec1.am.freescale.net> (raw)
In-Reply-To: <7DE487869875475FBEDEBE71222EE486@sisodomain.com>

On Thu, Sep 24, 2009 at 11:43:47AM +0530, Amul Kumar Saha wrote:
> +static loff_t flexonenand_addr(struct onenand_chip *this, int block)
> +{
> +	loff_t ofs = 0;
> +	int die = 0, boundary;
> +
> +	if (ONENAND_IS_DDP(this) && block >= this->density_mask) {
> +		block -= this->density_mask;
> +		die = 1;
> +		ofs = this->diesize[0];
> +	}
> +
> +	boundary = this->boundary[die];
> +	ofs += block << (this->erase_shift - 1);
> +	if (block > (boundary + 1))
> +		ofs += (block - boundary - 1) << (this->erase_shift - 1);
> +	return ofs;

You're missing some (loff_t) casts that are in Linux, here and elsewhere.

> +inline loff_t onenand_addr(struct onenand_chip *this, int block)

This is not a header file; let GCC decide when to inline.  Note that this
function is not specified as inline in Linux.

There are some other fairly significant differences with Linux later in
the patch -- is this due to missing functionality that u-boot doesn't
need, or something else?

-Scott

  reply	other threads:[~2009-09-28 20:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24  6:13 [U-Boot] [PATCH 1/3] [OneNAND] Flex-OneNAND driver support Amul Kumar Saha
2009-09-28 20:02 ` Scott Wood [this message]
2009-11-04  5:00   ` Amul Kumar Saha
2009-11-04 12:54     ` Kyungmin Park
2009-11-04  5:07   ` Amul Kumar Saha
2009-11-05 22:59     ` Scott Wood
2009-11-06 11:42       ` Amul Kumar Saha
2009-11-06 11:45         ` Amul Kumar Saha
2009-11-09 20:05           ` Scott Wood

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=20090928200241.GC9683@b07421-ec1.am.freescale.net \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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