Commit b1e90499 authored by Breno Leitao's avatar Breno Leitao Committed by Jakub Kicinski
Browse files

net: pass const to msg_data_left()



The msg_data_left() function doesn't modify the struct msghdr parameter,
so mark it as const. This allows the function to be used with const
references, improving type safety and making the API more flexible.

Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250408-tcpsendmsg-v3-1-208b87064c28@debian.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 82e40131
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ static inline struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr
	return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
}

static inline size_t msg_data_left(struct msghdr *msg)
static inline size_t msg_data_left(const struct msghdr *msg)
{
	return iov_iter_count(&msg->msg_iter);
}