Skip to content

Commit

Permalink
lib: textsearch: fix escapes in example code
Browse files Browse the repository at this point in the history
[ Upstream commit 2105b52e30debe7f19f3218598d8ae777dcc6776 ]

This textsearch code example does not need the '\' escapes and they can
be misleading to someone reading the example. Also, gcc and sparse warn
that the "\%d" is an unknown escape sequence.

Fixes: 5968a70 ("textsearch: fix kernel-doc warnings and add kernel-api section")
Signed-off-by: Randy Dunlap <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
rddunlap authored and gregkh committed Oct 29, 2019
1 parent 50699af commit 0cb5c7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/textsearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
* goto errout;
* }
*
* pos = textsearch_find_continuous(conf, \&state, example, strlen(example));
* pos = textsearch_find_continuous(conf, &state, example, strlen(example));
* if (pos != UINT_MAX)
* panic("Oh my god, dancing chickens at \%d\n", pos);
* panic("Oh my god, dancing chickens at %d\n", pos);
*
* textsearch_destroy(conf);
*/
Expand Down

0 comments on commit 0cb5c7b

Please sign in to comment.