From: John Hubbard <jhubbard@nvidia.com>
To: Shuah Khan <shuah@kernel.org>
Cc: Phil Sutter <phil@nwl.cc>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Florian Westphal <fw@strlen.de>,
Felix Huettner <felix.huettner@mail.schwarz>,
Max Lamprecht <max.lamprecht@mail.schwarz>,
Luca Czesla <luca.czesla@mail.schwarz>,
Xin Long <lucien.xin@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Paul Moore <paul@paul-moore.com>,
Richard Guy Briggs <rgb@redhat.com>,
Boris Sukholitko <boris.sukholitko@broadcom.com>,
Valentin Obst <kernel@valentinobst.de>,
linux-kselftest@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
llvm@lists.linux.dev, John Hubbard <jhubbard@nvidia.com>
Subject: [PATCH 1/2] selftests/netfilter: use socklen_t, not a signed int, for len
Date: Sun, 5 May 2024 14:47:15 -0700 [thread overview]
Message-ID: <20240505214716.62304-1-jhubbard@nvidia.com> (raw)
When building with clang, via:
make LLVM=1 -C tools/testing/selftest
...clang warns about using "int *" interchangeably with "socklen_t *".
clang is correct, so fix this by declaring len as a socklen_t, instead
of as an int.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
tools/testing/selftests/netfilter/sctp_collision.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/netfilter/sctp_collision.c b/tools/testing/selftests/netfilter/sctp_collision.c
index 21bb1cfd8a85..91df996367e9 100644
--- a/tools/testing/selftests/netfilter/sctp_collision.c
+++ b/tools/testing/selftests/netfilter/sctp_collision.c
@@ -9,7 +9,8 @@
int main(int argc, char *argv[])
{
struct sockaddr_in saddr = {}, daddr = {};
- int sd, ret, len = sizeof(daddr);
+ int sd, ret;
+ socklen_t len = sizeof(daddr);
struct timeval tv = {25, 0};
char buf[] = "hello";
base-commit: f462ae0edd3703edd6f22fe41d336369c38b884b
prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27
--
2.45.0
next reply other threads:[~2024-05-05 21:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-05 21:47 John Hubbard [this message]
2024-05-05 21:47 ` [PATCH 2/2] selftests/netfilter: return a value for several "int" functions John Hubbard
[not found] ` <ZjjsGW314qCgpTKs@felix.runs.onstackit.cloud>
2024-05-06 18:29 ` John Hubbard
[not found] ` <ZjnoFfkyREHWUPtq@felix.runs.onstackit.cloud>
2024-05-07 17:05 ` John Hubbard
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=20240505214716.62304-1-jhubbard@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=boris.sukholitko@broadcom.com \
--cc=davem@davemloft.net \
--cc=felix.huettner@mail.schwarz \
--cc=fw@strlen.de \
--cc=kernel@valentinobst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=luca.czesla@mail.schwarz \
--cc=lucien.xin@gmail.com \
--cc=max.lamprecht@mail.schwarz \
--cc=pablo@netfilter.org \
--cc=paul@paul-moore.com \
--cc=phil@nwl.cc \
--cc=rgb@redhat.com \
--cc=shuah@kernel.org \
/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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).