Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: "Nam T. Nguyen" <namnguyen@chromium.org>
Cc: vapier@chromium.org, linux-mtd@lists.infradead.org,
	dehrenberg@chromium.org
Subject: Re: [PATCH v3] mtd-utils: Add mtdpart to add/delete partition
Date: Thu, 2 Apr 2015 14:15:50 -0700	[thread overview]
Message-ID: <20150402211550.GJ32500@ld-irv-0074> (raw)
In-Reply-To: <1425498091-3505-1-git-send-email-namnguyen@chromium.org>

This doesn't even compile...

On Wed, Mar 04, 2015 at 11:41:31AM -0800, Nam T. Nguyen wrote:
> Add a simple utility to exercise BLKPG ioctl.
> 
> Signed-off-by: Nam T. Nguyen <namnguyen@chromium.org>
> ---
> Changes from v2:
> 
>   o Fix coding style
>   o Remove cleanup code since we exit()ing anyway.
> 
>  Makefile  |   2 +-
>  mtdpart.c | 187 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 188 insertions(+), 1 deletion(-)
>  create mode 100644 mtdpart.c
> 
...
> diff --git a/mtdpart.c b/mtdpart.c
> new file mode 100644
> index 0000000..b944f49
> --- /dev/null
> +++ b/mtdpart.c
> @@ -0,0 +1,187 @@
[...]
> +		command = COMMAND_DEL;
> +	} else if (strcmp(s_command, "add") == 0 && (argc - optind) == 3) {
> +		part_name = argv[optind++];
> +		const char *s_start = argv[optind++];
> +		const char *s_length = argv[optind++];

The preferred style is to keep variable definitions before statements.

> +
> +		if (strlen(part_name) >= BLKPG_DEVNAMELTH)
> +			errmsg_die("Partition name (%s) should be less than %d characters"

^^ you're missing a comma on this line. I think that's the only compile
issue? But I'd expect you to compile and test what you're sending
first...

> +				   part_name, BLKPG_DEVNAMELTH);
> +
> +		start_addr = simple_strtoll(s_start, &error);
> +		if (start_addr < 0)
> +		       errmsg_die("Can't specify negative start offset: %lld",
> +				  start_addr);
> +
> +		length = simple_strtoll(s_length, &error);
> +		if (length < 0)
[snip]

Brian

  parent reply	other threads:[~2015-04-02 21:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 19:41 [PATCH v3] mtd-utils: Add mtdpart to add/delete partition Nam T. Nguyen
2015-04-01 23:21 ` Nam Nguyen
2015-04-02 21:15 ` Brian Norris [this message]
2015-04-14 18:24   ` Nam Nguyen

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=20150402211550.GJ32500@ld-irv-0074 \
    --to=computersforpeace@gmail.com \
    --cc=dehrenberg@chromium.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=namnguyen@chromium.org \
    --cc=vapier@chromium.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