Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: scripts: kernel-doc: accept bitwise negation like ~@var

In some cases we'd like to indicate the bitwise negation of a parameter,
e.g.

~@var

This will be helpful for describing the atomic andnot operations, where
we'd like to write comments of the form:

Atomically updates @v to (@v & ~@i)

Which kernel-doc currently transforms to:

Atomically updates **v** to (**v** & ~**i**)

Rather than the preferable form:

Atomically updates **v** to (**v** & **~i**)

This is similar to what we did for '!@var' in commit:

ee2aa7590398 ("scripts: kernel-doc: accept negation like !@var")

This patch follows the same pattern that commit used to permit a '!'
prefix on a param ref, allowing a '~' prefix on a param ref, cuasing
kernel-doc to generate the preferred form above.

Suggested-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230605070124.3741859-25-mark.rutland@arm.com

authored by

Mark Rutland and committed by
Peter Zijlstra
8aaf297a 1d78814d

+1 -1
+1 -1
scripts/kernel-doc
··· 64 64 my $type_constant2 = '\%([-_\w]+)'; 65 65 my $type_func = '(\w+)\(\)'; 66 66 my $type_param = '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; 67 - my $type_param_ref = '([\!]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; 67 + my $type_param_ref = '([\!~]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; 68 68 my $type_fp_param = '\@(\w+)\(\)'; # Special RST handling for func ptr params 69 69 my $type_fp_param2 = '\@(\w+->\S+)\(\)'; # Special RST handling for structs with func ptr params 70 70 my $type_env = '(\$\w+)';