liburing.h: style and size_t vs int cleanup
Mostly just style, but also use the same type when comparing size in
io_uring_recvmsg_validate().
@@ -692,10 +692,11 @@ static inline void io_uring_prep_recv_multishot(struct io_uring_sqe *sqe,
sqe->ioprio |= IORING_RECV_MULTISHOT;
}
-static inline struct io_uring_recvmsg_out *io_uring_recvmsg_validate(
- void *buf, int buf_len, struct msghdr *m)
+static inline struct io_uring_recvmsg_out *
+io_uring_recvmsg_validate(void *buf, int buf_len, struct msghdr *m)
{
- size_t header = m->msg_controllen + m->msg_namelen + sizeof(struct io_uring_recvmsg_out);
+ int header = m->msg_controllen + m->msg_namelen +
+ sizeof(struct io_uring_recvmsg_out);
if (buf_len < header)
return NULL;
@@ -707,12 +708,15 @@ static inline void *io_uring_recvmsg_name(struct io_uring_recvmsg_out *o)
return (void *) &o[1];
}
-static inline struct cmsghdr *io_uring_recvmsg_cmsg_firsthdr(struct io_uring_recvmsg_out *o,
+static inline struct cmsghdr *
+io_uring_recvmsg_cmsg_firsthdr(struct io_uring_recvmsg_out *o,
struct msghdr *m)
{
if (o->controllen < sizeof(struct cmsghdr))
return NULL;
- return (struct cmsghdr *)((unsigned char *)io_uring_recvmsg_name(o) + m->msg_namelen);
+
+ return (struct cmsghdr *)((unsigned char *) io_uring_recvmsg_name(o) +
+ m->msg_namelen);
}
static inline void *io_uring_recvmsg_payload(struct io_uring_recvmsg_out *o,
@@ -722,18 +726,19 @@ static inline void *io_uring_recvmsg_payload(struct io_uring_recvmsg_out *o,
m->msg_namelen + m->msg_controllen);
}
-static inline size_t io_uring_recvmsg_payload_length(struct io_uring_recvmsg_out *o,
- int buf_length,
- struct msghdr *m)
+static inline size_t
+io_uring_recvmsg_payload_length(struct io_uring_recvmsg_out *o,
+ int buf_length, struct msghdr *m)
{
- unsigned long payload_start = (unsigned long)io_uring_recvmsg_payload(o, m);
- unsigned long payload_end = (unsigned long)o + buf_length;
+ unsigned long payload_start, payload_end;
+ payload_start = (unsigned long) io_uring_recvmsg_payload(o, m);
+ payload_end = (unsigned long) o + buf_length;
return payload_end - payload_start;
}
-static inline struct cmsghdr *io_uring_recvmsg_cmsg_nexthdr(struct io_uring_recvmsg_out *o,
- struct msghdr *m,
+static inline struct cmsghdr *
+io_uring_recvmsg_cmsg_nexthdr(struct io_uring_recvmsg_out *o, struct msghdr *m,
struct cmsghdr *cmsg)
{
unsigned char *end;
@@ -741,7 +746,8 @@ static inline struct cmsghdr *io_uring_recvmsg_cmsg_nexthdr(struct io_uring_recv
if (cmsg->cmsg_len < sizeof(struct cmsghdr))
return NULL;
end = (unsigned char *) io_uring_recvmsg_payload(o, m);
- cmsg = (struct cmsghdr *)((unsigned char *)cmsg + CMSG_ALIGN(cmsg->cmsg_len));
+ cmsg = (struct cmsghdr *)((unsigned char *) cmsg +
+ CMSG_ALIGN(cmsg->cmsg_len));
if ((unsigned char *) (cmsg + 1) > end)
return NULL;
