public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/2] selftests/netfilter: use socklen_t, not a signed int, for len
@ 2024-05-05 21:47 John Hubbard
  2024-05-05 21:47 ` [PATCH 2/2] selftests/netfilter: return a value for several "int" functions John Hubbard
  0 siblings, 1 reply; 4+ messages in thread
From: John Hubbard @ 2024-05-05 21:47 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Phil Sutter, Pablo Neira Ayuso, Florian Westphal, Felix Huettner,
	Max Lamprecht, Luca Czesla, Xin Long, David S . Miller,
	Paul Moore, Richard Guy Briggs, Boris Sukholitko, Valentin Obst,
	linux-kselftest, LKML, llvm, John Hubbard

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-07 17:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-05 21:47 [PATCH 1/2] selftests/netfilter: use socklen_t, not a signed int, for len John Hubbard
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox