Skip to content

Commit f1f405c

Browse files
andy-shevbrgl
authored andcommitted
lib/cmdline: Update documentation to reflect behaviour
get_options() API has some tricks to optimize that may be not so obvious to the caller. Update documentation to reflect current behaviour. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent d3c7cfc commit f1f405c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/cmdline.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,19 @@ EXPORT_SYMBOL(get_option);
8383
* get_options - Parse a string into a list of integers
8484
* @str: String to be parsed
8585
* @nints: size of integer array
86-
* @ints: integer array
86+
* @ints: integer array (must have room for at least one element)
8787
*
8888
* This function parses a string containing a comma-separated
8989
* list of integers, a hyphen-separated range of _positive_ integers,
9090
* or a combination of both. The parse halts when the array is
9191
* full, or when no more numbers can be retrieved from the
9292
* string.
9393
*
94+
* Returns:
95+
*
96+
* The first element is filled by the number of collected integers
97+
* in the range. The rest is what was parsed from the @str.
98+
*
9499
* Return value is the character in the string which caused
95100
* the parse to end (typically a null terminator, if @str is
96101
* completely parseable).

0 commit comments

Comments
 (0)