Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752851AbdHUJqz (ORCPT ); Mon, 21 Aug 2017 05:46:55 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:33237 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750AbdHUJqy (ORCPT ); Mon, 21 Aug 2017 05:46:54 -0400 Date: Mon, 21 Aug 2017 12:46:02 +0300 From: Dan Carpenter To: Ilya Matveychikov Cc: Baoquan He , Andrew Morton , Ingo Molnar , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] lib/cmdline.c: add to the get_options() documentation Message-ID: <20170821094602.baz6tv2v23sem3kw@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170609 (1.8.3) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1144 Lines: 28 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 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