From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH] cppcheck: Fix scope of the variable 'type_or_state'
Date: Thu, 19 Nov 2026 13:49:16 +0100 [thread overview]
Message-ID: <20261119124916.3150605-1-lvivier@redhat.com> (raw)
Fix following cppcheck 2.22.0 error:
flow.c:289:14: style: The scope of the variable 'type_or_state' can be reduced. [variableScope]
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
flow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/flow.c b/flow.c
index 27a24a4c253d..f9fbaefe761a 100644
--- a/flow.c
+++ b/flow.c
@@ -286,7 +286,6 @@ int flowside_connect(const struct ctx *c, int s,
void flow_log__(const struct flow_common *f, int pri, bool perror, bool details,
enum flow_state state, const char *fmt, ...)
{
- const char *type_or_state;
int errno_ = errno;
char msg[BUFSIZ];
va_list args;
@@ -299,6 +298,8 @@ void flow_log__(const struct flow_common *f, int pri, bool perror, bool details,
logmsg(!perror, false, pri, "Flow: not found, error: %s", msg);
details = false;
} else {
+ const char *type_or_state;
+
/* Show type if it's set, otherwise the state */
if (f->state < FLOW_STATE_TYPED)
type_or_state = FLOW_STATE(f);
--
2.56.0
reply other threads:[~2026-11-19 12:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261119124916.3150605-1-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/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).