mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3 1/3] fs: add parseopt_b for loop mount option
Date: Thu, 1 Jun 2017 14:20:06 +0200	[thread overview]
Message-ID: <20170601122006.akyvhivh4tsxng7v@pengutronix.de> (raw)
In-Reply-To: <1496313450-14507-1-git-send-email-p.zabel@pengutronix.de>

On Thu, Jun 01, 2017 at 12:37:28PM +0200, Philipp Zabel wrote:
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> No changes since v2.
> ---
>  fs/parseopt.c | 26 ++++++++++++++++++++++++++
>  fs/parseopt.h |  1 +
>  2 files changed, 27 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/fs/parseopt.c b/fs/parseopt.c
> index 12dbe1813c..8ff83019a7 100644
> --- a/fs/parseopt.c
> +++ b/fs/parseopt.c
> @@ -2,6 +2,32 @@
>  
>  #include "parseopt.h"
>  
> +void parseopt_b(const char *options, const char *opt, bool *val)
> +{
> +	const char *start;
> +	size_t optlen = strlen(opt);
> +
> +again:
> +	start = strstr(options, opt);
> +
> +	if (!start) {
> +		*val = false;
> +		return;
> +	}
> +
> +	if (start > options && start[-1] != ',') {
> +		options = start;
> +		goto again;
> +	}
> +
> +	if (start[optlen] != ',' && start[optlen] != '\0') {
> +		options = start;
> +		goto again;
> +	}
> +
> +	*val = true;
> +}
> +
>  void parseopt_hu(const char *options, const char *opt, unsigned short *val)
>  {
>  	const char *start;
> diff --git a/fs/parseopt.h b/fs/parseopt.h
> index a8523b6a10..abf3be3f35 100644
> --- a/fs/parseopt.h
> +++ b/fs/parseopt.h
> @@ -1 +1,2 @@
> +void parseopt_b(const char *options, const char *opt, bool *val);
>  void parseopt_hu(const char *options, const char *opt, unsigned short *val);
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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

      parent reply	other threads:[~2017-06-01 12:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 10:37 Philipp Zabel
2017-06-01 10:37 ` [PATCH v3 2/3] fs: add cdev_create_loop and cdev_remove_loop " Philipp Zabel
2017-06-01 10:37 ` [PATCH v3 3/3] commands: mount: mention file loop mounts in the help text Philipp Zabel
2017-06-01 12:20 ` Sascha Hauer [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=20170601122006.akyvhivh4tsxng7v@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=p.zabel@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