From 3757ea36d8aa4f40119d66646a3ccaafc670d6b4 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Fri, 20 Jun 2025 17:25:15 +0200 Subject: style: Add parentheses to function names in comments The commit updates the style of function comments by adding parentheses to function names in the descriptions where they are missing. Done with: ---------8<------ fix_function_name.awk ---------8<------ /^\/\*\*/ { check_next = 1; print $0 next } check_next == 1 && / \* struct/ { check_next = 0 print $0 next } check_next == 1 && / \* enum/ { check_next = 0 print $0 next } check_next == 1 && /^ \* [^ (]* -/ { modified_line = gensub(/^ \* ([^ ]*) -(.*)$/, " * \\1() -\\2", "g", $0) print modified_line check_next = 0; next } { print $0 check_next = 0 } ---------8<------ fix_function_name.awk ---------8<------ Then for file in *.[ch]; do cp ${file} ${file}.tmp && \ awk -f fix_function_name.awk ${file}.tmp > ${file} done Signed-off-by: Laurent Vivier Signed-off-by: Stefano Brivio --- checksum.c | 4 ++-- conf.c | 4 ++-- fwd.h | 2 +- iov.c | 2 +- netlink.c | 2 +- siphash.h | 2 +- vhost_user.h | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/checksum.c b/checksum.c index 13c8e33..0c3837c 100644 --- a/checksum.c +++ b/checksum.c @@ -452,7 +452,7 @@ less_than_128_bytes: } /** - * csum_unfolded - Calculate the unfolded checksum of a data buffer. + * csum_unfolded() - Calculate the unfolded checksum of a data buffer. * * @buf: Input buffer * @len: Input length @@ -481,7 +481,7 @@ uint32_t csum_unfolded(const void *buf, size_t len, uint32_t init) } #else /* __AVX2__ */ /** - * csum_unfolded - Calculate the unfolded checksum of a data buffer. + * csum_unfolded() - Calculate the unfolded checksum of a data buffer. * * @buf: Input buffer * @len: Input length diff --git a/conf.c b/conf.c index a80a053..6c747aa 100644 --- a/conf.c +++ b/conf.c @@ -65,7 +65,7 @@ const char *pasta_default_ifn = "tap0"; /** - * next_chunk - Return the next piece of a string delimited by a character + * next_chunk() - Return the next piece of a string delimited by a character * @s: String to search * @c: Delimiter character * @@ -80,7 +80,7 @@ static char *next_chunk(const char *s, char c) } /** - * port_range - Represents a non-empty range of ports + * port_range() - Represents a non-empty range of ports * @first: First port number in the range * @last: Last port number in the range (inclusive) * diff --git a/fwd.h b/fwd.h index 0458a3c..65c7c96 100644 --- a/fwd.h +++ b/fwd.h @@ -27,7 +27,7 @@ enum fwd_ports_mode { #define PORT_BITMAP_SIZE DIV_ROUND_UP(NUM_PORTS, 8) /** - * fwd_ports - Describes port forwarding for one protocol and direction + * fwd_ports() - Describes port forwarding for one protocol and direction * @mode: Overall forwarding mode (all, none, auto, specific ports) * @scan4: /proc/net fd to scan for IPv4 ports when in AUTO mode * @scan6: /proc/net fd to scan for IPv6 ports when in AUTO mode diff --git a/iov.c b/iov.c index f72145b..edf0444 100644 --- a/iov.c +++ b/iov.c @@ -181,7 +181,7 @@ bool iov_tail_prune(struct iov_tail *tail) } /** - * iov_tail_size - Calculate the total size of an IO vector tail + * iov_tail_size() - Calculate the total size of an IO vector tail * @tail: IO vector tail * * Return: the total size in bytes. diff --git a/netlink.c b/netlink.c index ee9325a..8f82e73 100644 --- a/netlink.c +++ b/netlink.c @@ -199,7 +199,7 @@ static struct nlmsghdr *nl_next(int s, char *buf, struct nlmsghdr *nh, ssize_t * } /** - * nl_foreach - 'for' type macro to step through netlink response messages + * nl_foreach() - 'for' type macro to step through netlink response messages * nl_foreach_oftype - as above, but only messages of expected type * @nh: Steps through each response header (struct nlmsghdr *) * @status: When loop exits indicates if there was an error (ssize_t) diff --git a/siphash.h b/siphash.h index a2ca2a9..e760236 100644 --- a/siphash.h +++ b/siphash.h @@ -99,7 +99,7 @@ static inline void siphash_feed(struct siphash_state *state, uint64_t in) } /** - * siphash_final - Finalize SipHash calculations + * siphash_final() - Finalize SipHash calculations * @v: siphash state (4 x 64-bit integers) * @len: Total length of input data * @tail: Final data for the hash (<= 7 bytes) diff --git a/vhost_user.h b/vhost_user.h index f2ae2da..e806a9e 100644 --- a/vhost_user.h +++ b/vhost_user.h @@ -217,7 +217,7 @@ struct vhost_user_msg { }) /** - * vu_queue_enabled - Return state of a virtqueue + * vu_queue_enabled() - Return state of a virtqueue * @vq: virtqueue to check * * Return: true if the virqueue is enabled, false otherwise @@ -228,7 +228,7 @@ static inline bool vu_queue_enabled(const struct vu_virtq *vq) } /** - * vu_queue_started - Return state of a virtqueue + * vu_queue_started() - Return state of a virtqueue * @vq: virtqueue to check * * Return: true if the virqueue is started, false otherwise -- cgit v1.2.3