From: Andrew Morton <akpm@osdl.org>
To: Miles Bader <miles@gnu.org>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] v850: Round up length passed to slram driver to a multiple of SLRAM_BLK_SZ
Date: Thu, 1 Sep 2005 23:50:40 -0700 [thread overview]
Message-ID: <20050901235040.4ecc8bbf.akpm@osdl.org> (raw)
In-Reply-To: <20050902061330.BEF2B4DC@dhapc248.dev.necel.com>
Miles Bader <miles@gnu.org> wrote:
>
> +
> +/* From drivers/mtd/devices/slram.c */
> +#define SLRAM_BLK_SZ 0x4000
> +
> /* Set the root filesystem to be the given memory region.
> Some parameter may be appended to CMD_LINE. */
> void set_mem_root (void *addr, size_t len, char *cmd_line)
> {
> + /* Some sort of idiocy in MTD means we must supply a length that's
> + a multiple of SLRAM_BLK_SZ. We just round up the real length,
> + as the file system shouldn't attempt to access anything beyond
> + the end of the image anyway. */
> + len = (((len - 1) + SLRAM_BLK_SZ) / SLRAM_BLK_SZ) * SLRAM_BLK_SZ;
If SLRAM_BLK_SZ will always be a power of two, there's kernel.h:ALIGN()..
prev parent reply other threads:[~2005-09-02 6:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-02 6:13 [PATCH] v850: Round up length passed to slram driver to a multiple of SLRAM_BLK_SZ Miles Bader
2005-09-02 6:50 ` Andrew Morton [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=20050901235040.4ecc8bbf.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miles@gnu.org \
--cc=torvalds@osdl.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