Skip to content

Commit 2888491

Browse files
rddunlapJonathan Corbet
authored andcommitted
Documentation: core-api: add generic parser docbook
Add the simple generic parser to the core-api docbook. It can be used for parsing all sorts of options throughout the kernel. Signed-off-by: Randy Dunlap <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Eric Biggers <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bc75094 commit 2888491

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

Documentation/core-api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Library functionality that is used throughout the kernel.
5353
floating-point
5454
union_find
5555
min_heap
56+
parser
5657

5758
Low level entry and exit
5859
========================

Documentation/core-api/parser.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
3+
==============
4+
Generic parser
5+
==============
6+
7+
Overview
8+
========
9+
10+
The generic parser is a simple parser for parsing mount options,
11+
filesystem options, driver options, subsystem options, etc.
12+
13+
Parser API
14+
==========
15+
16+
.. kernel-doc:: lib/parser.c
17+
:export:

lib/parser.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ EXPORT_SYMBOL(match_hex);
275275
*
276276
* Description: Parse the string @str to check if matches wildcard
277277
* pattern @pattern. The pattern may contain two types of wildcards:
278-
* '*' - matches zero or more characters
279-
* '?' - matches one character
278+
*
279+
* * '*' - matches zero or more characters
280+
* * '?' - matches one character
280281
*
281282
* Return: If the @str matches the @pattern, return true, else return false.
282283
*/

0 commit comments

Comments
 (0)