public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] ext2: Simplify partial sector access logic
Date: Wed, 29 Jun 2011 15:04:29 +0200	[thread overview]
Message-ID: <m2hb78ss9u.fsf@ohwell.denx.de> (raw)
In-Reply-To: <1308001240-9545-3-git-send-email-robotboy@chromium.org> (Anton Staaf's message of "Mon, 13 Jun 2011 14:40:40 -0700")

Hi Anton,

> Previously reading or writing zero full sectors (reading the end of
> one sector and the beginning of the next for example) was special
> cased and involved stack allocating a second sector buffer.  This
> change uses the same code path for this case as well as when there
> are a non-zero number of full sectors to access.  The result is
> easier to read and reduces the maximum stack used.

It's non-trivial to prove that your change is equivalent and
unfortunately I do not have enough time to do this.  If your tests work,
than this is certainly a good indication ;) The one thing I'd like to be
sure is that the previous code looks like it used the stack for whole
sectors but copied only parts of this to the provided address pointer.
Your new code looks like it always writes whole sectors to the provided
pointer.  Is this safe even if the caller allocated space without
overhead for whole sectors?

Cheers
  Detlev

-- 
In God we trust.  All others we monitor
                       -- NSA motto
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

  reply	other threads:[~2011-06-29 13:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13 21:40 [U-Boot] [PATCH 0/2] ext2: Cleanup and simplify sector access code Anton Staaf
2011-06-13 21:40 ` [U-Boot] [PATCH 1/2] ext2: Fix checkpatch violations Anton Staaf
2011-06-29 12:13   ` Detlev Zundel
2011-06-29 18:24     ` Anton Staaf
2011-06-30 14:25       ` Detlev Zundel
2011-06-13 21:40 ` [U-Boot] [PATCH 2/2] ext2: Simplify partial sector access logic Anton Staaf
2011-06-29 13:04   ` Detlev Zundel [this message]
2011-06-29 19:23     ` Anton Staaf
2011-06-30 14:34       ` Detlev Zundel
2011-07-18 17:21         ` Anton Staaf
2011-07-25 22:03           ` Wolfgang Denk
2011-07-25 22:26             ` Anton Staaf
2011-06-28 18:39 ` [U-Boot] [PATCH 0/2] ext2: Cleanup and simplify sector access code Anton Staaf

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=m2hb78ss9u.fsf@ohwell.denx.de \
    --to=dzu@denx.de \
    --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