[PATCH/RFC] reserved pool

Jörn Engel joern at wohnheim.fh-wedel.de
Wed May 10 09:35:10 EDT 2006


On Wed, 10 May 2006 12:29:02 +0400, Artem B. Bityutskiy wrote:
> +
> +int jffs2_parse_options(struct super_block *sb, char *opts)
> +{
> +	unsigned int opt;
> +	char *p;
> +	substring_t args[JFFS2_MAX_ARGS];
> +	struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
> +
> +	if (!opts)
> +		return 0;
> +
> +	while ((p = strsep(&opts, ",")) != NULL) {

" != NULL" is superfluous.

> +		int token;
> +
> +		if (!*p)
> +			continue;
> +		
> +		token = match_token(p, tokens, args);
> +
> +		switch (token) {
> +			case JFFS2_OPT_RP_SIZE:

One level of indentation can be save here.  Unlike dwmw2, I don't
participate in the terminal size arms race and still care about 80
columns. ;)

> +				if (match_int(&args[0], &opt))
> +					return -EINVAL;
> +				c->rp_size = opt * 1024;
> +				if (c->rp_size > c->mtd->size) {
> +					JFFS2_WARNING("too large reserved pool size, max is %u KB\n",
> +						      c->mtd->size/1024);
> +					return -EINVAL;
> +				}
> +				break;
> +			default:
> +				return -EINVAL;
> +		}
> +	}
> +
> +	return 0;
> +}

Rest looks fine to me.

Jörn

-- 
With a PC, I always felt limited by the software available. On Unix, 
I am limited only by my knowledge.
-- Peter J. Schoenster




More information about the linux-mtd mailing list