mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01: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 <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
This commit is contained in:
1 parent
82e401319b
commit
b1e9049995
1 file changed
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user