From: "Alexander Shiyan" <shc_work@mail.ru>
To: "Sascha Hauer" <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re[2]: [PATCH] devfs-core: introduce devfs_append_partition
Date: Wed, 19 Jun 2013 10:03:13 +0400 [thread overview]
Message-ID: <1371621793.699357681@f89.mail.ru> (raw)
In-Reply-To: <20130619053827.GF32299@pengutronix.de>
> On Tue, Jun 18, 2013 at 02:50:50PM +0200, Jan Luebbe wrote:
> > This simplifies board code for partition setup by keeping track of the
> > offset.
> >
> > Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
>
> Good idea. There seem to be some bugs in this area. I'm fine with the
> patch when some users are converted to this.
But lets make static variable "offset", setup it in devfs_add_partition and
just add "size" in the devfs_append_partition.
Otherwise I do not see any difference between "add" and "append".
> > ---
> > fs/devfs-core.c | 9 +++++++++
> > include/driver.h | 2 ++
> > 2 files changed, 11 insertions(+)
> >
> > diff --git a/fs/devfs-core.c b/fs/devfs-core.c
> > index 262e0a2..f7d79ff 100644
> > --- a/fs/devfs-core.c
> > +++ b/fs/devfs-core.c
> > @@ -267,6 +267,15 @@ int devfs_add_partition(const char *devname, loff_t offset, loff_t size,
> > return 0;
> > }
> >
> > +int devfs_append_partition(const char *devname, loff_t *offset, loff_t size,
> > + int flags, const char *name)
> > +{
> > + int ret;
> > + ret = devfs_add_partition(devname, *offset, size, flags, name);
> > + *offset += size;
> > + return ret;
> > +}
> > +
> > int devfs_del_partition(const char *name)
> > {
> > struct cdev *cdev;
> > diff --git a/include/driver.h b/include/driver.h
> > index 716f792..3f4f7b9 100644
> > --- a/include/driver.h
> > +++ b/include/driver.h
> > @@ -463,6 +463,8 @@ int cdev_erase(struct cdev *cdev, size_t count, loff_t offset);
> >
> > int devfs_add_partition(const char *devname, loff_t offset, loff_t size,
> > int flags, const char *name);
> > +int devfs_append_partition(const char *devname, loff_t *offset, loff_t size,
> > + int flags, const char *name);
> > int devfs_del_partition(const char *name);
> >
> > #define DRV_OF_COMPAT(compat) \
---
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-06-19 6:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 12:50 Jan Luebbe
2013-06-19 5:38 ` Sascha Hauer
2013-06-19 6:03 ` Alexander Shiyan [this message]
2013-06-19 6:32 ` Re[2]: " Jan Lübbe
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=1371621793.699357681@f89.mail.ru \
--to=shc_work@mail.ru \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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