mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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: Breno Leitao <leitao@debian.org> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20250408-tcpsendmsg-v3-1-208b87064c28@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
82e401319b
commit
b1e9049995
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue