From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
linux-mtd@lists.infradead.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] mtd: implement proper partition handling
Date: Mon, 17 Dec 2018 11:24:18 +0100 [thread overview]
Message-ID: <20181217112418.754d37ee@bbrezillon> (raw)
In-Reply-To: <20181211174302.9913-1-miquel.raynal@bootlin.com>
On Tue, 11 Dec 2018 18:43:02 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> /* Returns the size of the entire flash chip */
> uint64_t mtd_get_device_size(const struct mtd_info *mtd)
> {
> if (!mtd_is_partition(mtd))
> return mtd->size;
>
> - return mtd_get_device_size(mtd_to_part(mtd)->parent);
> + return mtd_get_device_size(mtd->parent);
Not really related to the patch, but this function only works if you
have a single level of partitioning. If we want it to work for
recursive partitioning we should have something like this:
u64 mtd_get_device_size(const struct mtd_info *mtd)
{
while (mtd->parent)
mtd = mtd->parent;
return mtd->size;
}
next prev parent reply other threads:[~2018-12-17 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 17:43 [PATCH] mtd: implement proper partition handling Miquel Raynal
2018-12-17 10:24 ` Boris Brezillon [this message]
2018-12-17 11:50 ` Boris Brezillon
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=20181217112418.754d37ee@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=thomas.petazzoni@bootlin.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.