From: Jon Maloy <jmaloy@redhat.com>
To: sbrivio@redhat.com, david@gibson.dropbear.id.au,
jmaloy@redhat.com, passt-dev@passt.top
Subject: [PATCH 3/3] passt-repair: Drop redundant parentheses around stat() calls
Date: Thu, 19 Nov 2026 20:32:48 -0500 [thread overview]
Message-ID: <20261120013248.1472649-4-jmaloy@redhat.com> (raw)
In-Reply-To: <20261120013248.1472649-1-jmaloy@redhat.com>
clang-tidy 23.1.5 reports:
passt-repair.c:122:6: error: redundant parentheses around expression
[readability-redundant-parentheses,-warnings-as-errors]
122 | if ((stat(a->sun_path, sb))) {
and the same for the stat() call in main(). There's no assignment in
those conditions, so the extra parentheses are pointless. Drop them.
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
---
passt-repair.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/passt-repair.c b/passt-repair.c
index 3958c3af..2a147432 100644
--- a/passt-repair.c
+++ b/passt-repair.c
@@ -119,7 +119,7 @@ static int wait_for_socket(struct sockaddr_un *a, const char *dir,
ret = snprintf(a->sun_path, sizeof(a->sun_path), "%s/%s",
dir, ev->name);
- if ((stat(a->sun_path, sb))) {
+ if (stat(a->sun_path, sb)) {
FPRINTF(stderr, "Can't stat() %s: %i\n", a->sun_path, errno);
_exit(1);
}
@@ -186,7 +186,7 @@ int main(int argc, char **argv)
_exit(1);
}
- if ((stat(argv[1], &sb))) {
+ if (stat(argv[1], &sb)) {
FPRINTF(stderr, "Can't stat() %s: %i\n", argv[1], errno);
_exit(1);
}
--
2.56.1
prev parent reply other threads:[~2026-11-20 1:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 1:32 [PATCH 0/3] Fix 'make clang-tidy' with clang-tidy 23 Jon Maloy
2026-11-20 1:32 ` [PATCH 1/3] clang-tidy: Also disable bugprone-signed-bitwise Jon Maloy
2026-11-20 1:32 ` [PATCH 2/3] clang-tidy: Disable checks new in clang-tidy 23 Jon Maloy
2026-11-20 1:32 ` Jon Maloy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261120013248.1472649-4-jmaloy@redhat.com \
--to=jmaloy@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).