Skip to contentSkip to conversation

hv: Remove unnecessary (void*) conversions

PATCH In review Li zeming 2 participants 2 messages Oct 8, 2022 – Oct 26, 2022

Subsystems (2)
lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 hv: Remove unnecessary (void*) conversions

addrp is a void pointer and does not require a cast type.

---
 tools/hv/hv_kvp_daemon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/hv/hv_kvp_daemon.c +2 -2
index 1e6fd6ca513b..445abb53bf0d 100644
@@ -772,11 +772,11 @@ static int kvp_process_ip_address(void *addrp,
 	const char *str;
 
 	if (family == AF_INET) {
-		addr = (struct sockaddr_in *)addrp;
+		addr = addrp;
 		str = inet_ntop(family, &addr->sin_addr, tmp, 50);
 		addr_length = INET_ADDRSTRLEN;
 	} else {
-		addr6 = (struct sockaddr_in6 *)addrp;
+		addr6 = addrp;
 		str = inet_ntop(family, &addr6->sin6_addr.s6_addr, tmp, 50);
 		addr_length = INET6_ADDRSTRLEN;
 	}
Signature · 1 line
2.18.2
maintainer
#1 lore raw
Quoted 3 lines · Li zeming

addrp is a void pointer and does not require a cast type.

This has already been changed. Thanks for the patch anyway.