mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ilya Matveychikov <matvejchikov@gmail.com>
Cc: Baoquan He <bhe@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] lib/cmdline.c: add to the get_options() documentation
Date: Mon, 21 Aug 2017 12:46:02 +0300	[thread overview]
Message-ID: <20170821094602.baz6tv2v23sem3kw@mwanda> (raw)

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/lib/cmdline.c b/lib/cmdline.c
index 4c0888c4a68d..0eb8d0ab60db 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -73,14 +73,15 @@ EXPORT_SYMBOL(get_option);
 /**
  *	get_options - Parse a string into a list of integers
  *	@str: String to be parsed
- *	@nints: size of integer array
+ *	@nints: size of integer array (including the extra int at the start)
  *	@ints: integer array
  *
  *	This function parses a string containing a comma-separated
  *	list of integers, a hyphen-separated range of _positive_ integers,
  *	or a combination of both.  The parse halts when the array is
  *	full, or when no more numbers can be retrieved from the
- *	string.
+ *	string.  It stores the number of numbers as the first element in the
+ *	array.
  *
  *	Return value is the character in the string which caused
  *	the parse to end (typically a null terminator, if @str is

             reply	other threads:[~2017-08-21  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21  9:46 Dan Carpenter [this message]
2017-08-21 10:42 ` Ilya Matveychikov
2017-08-21 11:50   ` Dan Carpenter

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=20170821094602.baz6tv2v23sem3kw@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matvejchikov@gmail.com \
    --cc=mingo@kernel.org \
    /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

all inboxes | Powered by JetHome®