From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BSic40kM; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 1E6BD5A0280 for ; Fri, 20 Jun 2025 17:25:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1750433120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dbbgrE5SzEnRwxjMYRpYaWRMrmnKsBEOB1kfXjN1sug=; b=BSic40kM9LVwuNLJaRqSCspg6O0m+lBZAHQFjHr01NkbHTcB36x6eW7liTz+Qb/0wKIhyH 2tqd1ukGpOl7fP/TUEgBUvsU56lVQ/TDVjnT3EJUPMHRw1S4mnXVV78in0KsGljg7ZwCmG XIkz1UMpXiBQzNsMRha9x9AfHymcl2Q= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-lQrOo4QgPgGCZqyTqsXwFA-1; Fri, 20 Jun 2025 11:25:19 -0400 X-MC-Unique: lQrOo4QgPgGCZqyTqsXwFA-1 X-Mimecast-MFC-AGG-ID: lQrOo4QgPgGCZqyTqsXwFA_1750433118 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AF99D180028B for ; Fri, 20 Jun 2025 15:25:18 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.44.33.123]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9C9E230001A1; Fri, 20 Jun 2025 15:25:17 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH] style: Add parentheses to function names in comments Date: Fri, 20 Jun 2025 17:25:15 +0200 Message-ID: <20250620152515.1382560-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: mGU4HfT_v95BJbUQ5-RPVh80YOOmzUoXDAJvs6XpmHQ_1750433118 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: A5PSYO3C4DR6LFW6P3U3NFHDCDXEYPJM X-Message-ID-Hash: A5PSYO3C4DR6LFW6P3U3NFHDCDXEYPJM X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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 0894eca89570..bebcb8aae50e 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 36845e26d826..5969c9e856e7 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 0458a3c5078d..65c7c9641f55 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 91e87a740f0a..d69df61d0d17 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 * * Returns: The total size in bytes. diff --git a/netlink.c b/netlink.c index ee9325a054a2..8f82e73bb2d1 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 a2ca2a9989d5..e760236e8063 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 f2ae2da63b38..e806a9e54e00 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 -- 2.49.0