From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org, Rob Herring <rob.herring@calxeda.com>
Subject: Re: [PATCH 3/5] partitons: add framework
Date: Thu, 14 Feb 2013 21:37:03 +0100 [thread overview]
Message-ID: <20130214203703.GD1906@pengutronix.de> (raw)
In-Reply-To: <1360857147-489-3-git-send-email-plagnioj@jcrosoft.com>
On Thu, Feb 14, 2013 at 04:52:25PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> so we can support multiple format
>
> use filetpye to detect the parser to use
>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
> common/Kconfig | 14 +----
> common/Makefile | 2 +-
> common/partitions.c | 132 +++++++++++++++-----------------------------
> common/partitions/Makefile | 1 +
> common/partitions/dos.c | 87 +++++++++++++++++++++++++++++
> common/partitions/parser.h | 35 ++++++++++++
common/partitions/Kconfig is missing in this patch.
> +int partition_parser_register(struct partition_parser *p)
> +{
> + if (!p || !p->parse)
> + return -EINVAL;
Please drop these stupid checks. Everyone calling this with a NULL
pointer really deserves a stack dump.
> +
> +#ifndef __PARTITIONS_PARSER_H__
> +#define __PARTITIONS_PARSER_H__
> +
> +#include <block.h>
> +#include <filetype.h>
> +#include <linux/list.h>
> +
> +#define MAX_PARTITION 8
> +
> +struct partition {
> + uint64_t first_sec;
> + uint64_t size;
> +};
> +
> +struct partition_desc {
> + int used_entries;
> + struct partition parts[MAX_PARTITION];
> +};
> +
> +struct partition_parser {
> + void (*parse)(uint8_t *buf, struct block_device *blk, struct partition_desc *pd);
use void * for passing buffers please.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-02-14 20:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 15:47 [PATCH 0/5] add EFI GUID Partition Table support Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 15:52 ` [PATCH 1/5] linux/types: import __aligned_x64 from the kernel Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 15:52 ` [PATCH 2/5] filetype: add GPT support Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 16:36 ` Sascha Hauer
2013-02-14 16:53 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 17:05 ` Johannes Stezenbach
2013-02-14 19:17 ` Sascha Hauer
2013-02-14 22:08 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 7:43 ` Johannes Stezenbach
2013-02-15 10:47 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 15:52 ` [PATCH 3/5] partitons: add framework Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 20:37 ` Sascha Hauer [this message]
2013-02-14 15:52 ` [PATCH 4/5] disk: introduce partition name Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 20:51 ` Sascha Hauer
2013-02-14 21:30 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 21:42 ` Sascha Hauer
2013-02-14 15:52 ` [PATCH 5/5] disk: partitions: add EFI GUID Partition Table Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 22:42 [PATCH 0/5] add EFI GUID Partition Table support Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 22:44 ` [PATCH 1/5] linux/types: import __aligned_x64 from the kernel Jean-Christophe PLAGNIOL-VILLARD
2013-02-14 22:44 ` [PATCH 3/5] partitons: add framework Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 12:59 [PATCH 0/5 v3] add EFI GUID Partition Table support Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 13:35 ` [PATCH 1/5] linux/types: import __aligned_x64 from the kernel Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 13:35 ` [PATCH 3/5] partitons: add framework Jean-Christophe PLAGNIOL-VILLARD
2013-02-15 17:37 ` Sascha Hauer
2013-02-16 11:38 [PATCH 0/5 v4] add EFI GUID Partition Table support Jean-Christophe PLAGNIOL-VILLARD
2013-02-16 13:47 ` [PATCH 1/5] linux/types: import __aligned_x64 from the kernel Jean-Christophe PLAGNIOL-VILLARD
2013-02-16 13:47 ` [PATCH 3/5] partitons: add framework Jean-Christophe PLAGNIOL-VILLARD
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=20130214203703.GD1906@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=plagnioj@jcrosoft.com \
--cc=rob.herring@calxeda.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox