public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] common: fix behavior of ROUND macro when input is already rounded
Date: Wed, 07 Sep 2011 23:39:45 +0200	[thread overview]
Message-ID: <20110907213945.450D7140875D@gemini.denx.de> (raw)
In-Reply-To: <1315007128-10710-1-git-send-email-robotboy@chromium.org>

Dear Anton Staaf,

In message <1315007128-10710-1-git-send-email-robotboy@chromium.org> you wrote:
> Currently when you call ROUND with a value that is already a
> multiple of the second parameter it will return a value that is
> one multiple larger, instead of returning the value passed in.
> 
> There are only two types of usage of ROUND currently, one in
> various config files to round CONFIG_SYS_MALLOC_LEN to a multiple
> of 4096 bytes.  The other in cmd_sf.c where the incorrect behavior
> of ROUND is worked around be subtracting one from the length argument
> before passing it to ROUND.
> 
> This patch fixes ROUND and removes the workaround from cmd_sf.  It
> also results in all of the malloc pools that use ROUND to compute
> their size shrinking by 4KB.
> 
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Mike Frysinger <vapier@gentoo.org>
> ---
> 
> I'm not sure if it makes sense to go and add 4KB to each malloc pool effected.  What do other people think?  I'd be happy to make a v2 that does that.  This just seemed like a cleaner v1 to start with.
> 
>  common/cmd_sf.c  |    2 +-
>  include/common.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There are three principal ways to lose money: wine, women, and engi-
neers. While the first two are more pleasant, the third is by far the
more certain."                           - Baron Rothschild, ca. 1800

      reply	other threads:[~2011-09-07 21:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 23:45 [U-Boot] [PATCH] common: fix behavior of ROUND macro when input is already rounded Anton Staaf
2011-09-07 21:39 ` Wolfgang Denk [this message]

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=20110907213945.450D7140875D@gemini.denx.de \
    --to=wd@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