Re: [PATCH] lib/cmdline.c: add to the get_options() documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 21, 2017 at 02:42:52PM +0400, Ilya Matveychikov wrote:
> 
> > On Aug 21, 2017, at 1:46 PM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> > 
> > I wasn't sure how get_options() worked, so I looked at examples.  And by
> > sheer chance the first example I picked the only example which uses it
> > incorrectly...  I've added some comments that hopefully help.
> > 
> 
> See also comments on my patch from Ben Hutchings:
> https://patchwork.kernel.org/patch/9811617/

Ugh...  The implementation of get_options() looks gnarly, yes.  That
affects the part of my comment which says:

+ *     string.  It stores the number of numbers as the first element in the
+ *     array.

If we are going to keep the current behavior then we should specify that
ints[0] can be higher than "nints - 1".  But I feel like the current
behavior is wrong and that get_range() should never return more than n.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux