[PATCH liburing 3/5] change io_uring_recvmsg_payload_length return type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Payloads can not be bigger than UINT_MAX, so no need to force a bigger
type on the caller.

Signed-off-by: Dylan Yudaken <dylany@xxxxxx>
---
 src/include/liburing.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/include/liburing.h b/src/include/liburing.h
index 9e7f06f390be..06f4a50bacb1 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -788,7 +788,7 @@ static inline void *io_uring_recvmsg_payload(struct io_uring_recvmsg_out *o,
 			msgh->msg_namelen + msgh->msg_controllen);
 }
 
-static inline size_t
+static inline unsigned int
 io_uring_recvmsg_payload_length(struct io_uring_recvmsg_out *o,
 				int buf_len, struct msghdr *msgh)
 {
@@ -796,7 +796,7 @@ io_uring_recvmsg_payload_length(struct io_uring_recvmsg_out *o,
 
 	payload_start = (unsigned long) io_uring_recvmsg_payload(o, msgh);
 	payload_end = (unsigned long) o + buf_len;
-	return payload_end - payload_start;
+	return (unsigned int) (payload_end - payload_start);
 }
 
 static inline void io_uring_prep_openat2(struct io_uring_sqe *sqe, int dfd,
-- 
2.30.2





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux