[PATCH v2 3/7] UBI: accept empty string for vid_hdr_offs parameter

Artem Bityutskiy dedekind1 at gmail.com
Mon Aug 20 09:04:58 EDT 2012


On Mon, 2012-08-20 at 15:52 +0300, Shmulik Ladkani wrote:
> Hi Richard,
> 
> On Mon, 20 Aug 2012 14:09:17 +0200 Richard Genoud <richard.genoud at gmail.com> wrote:
> > @@ -1292,7 +1292,11 @@ static int __init bytes_str_to_int(const char *str)
> >  	unsigned long result;
> >  
> >  	result = simple_strtoul(str, &endp, 0);
> > -	if (str == endp || result >= INT_MAX) {
> > +	if (str == endp)
> > +		/* empty string, assume it's 0 */
> > +		return 0;

Please, let's not over-engineer this, do not bother with ",,", use ",0,"
instead. Just do amend the documentation properly.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120820/71c601ae/attachment.sig>


More information about the linux-mtd mailing list