From patchwork Tue Jul 26 12:15:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 12929224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB057C43334 for ; Tue, 26 Jul 2022 12:15:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238632AbiGZMP2 (ORCPT ); Tue, 26 Jul 2022 08:15:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233224AbiGZMP2 (ORCPT ); Tue, 26 Jul 2022 08:15:28 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E86D2AC53 for ; Tue, 26 Jul 2022 05:15:27 -0700 (PDT) Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26Q0osRx003807 for ; Tue, 26 Jul 2022 05:15:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=IvHtzsYmeoD7dYs/XROGai/v/J8+kLFHqiY2yDVoe6A=; b=knpD8wyBBrS6ISboCRbQ33seCSxkQj+HsTyFISSD6HkAQLX2i8YziKa3ilAmvAZq4e0s mGgzmTYPA1d5HhJOIdllkXh8yUy+1bohE2HSXg3RCUYVwoO3rJTx5KJi30Q4jS9ayq40 Nrb+lj12vdLsceipF2P8IDiC/d5ZDC1dC4U= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3hj1usm8y9-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 26 Jul 2022 05:15:26 -0700 Received: from twshared33626.07.ash9.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 26 Jul 2022 05:15:24 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id 175F1397A790; Tue, 26 Jul 2022 05:15:08 -0700 (PDT) From: Dylan Yudaken To: , CC: , , Dylan Yudaken Subject: [PATCH liburing 3/5] change io_uring_recvmsg_payload_length return type Date: Tue, 26 Jul 2022 05:15:00 -0700 Message-ID: <20220726121502.1958288-4-dylany@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220726121502.1958288-1-dylany@fb.com> References: <20220726121502.1958288-1-dylany@fb.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: fAhIhW7pVBFrpz4txVGupiTj5RbvK6ul X-Proofpoint-ORIG-GUID: fAhIhW7pVBFrpz4txVGupiTj5RbvK6ul X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-26_04,2022-07-26_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Payloads can not be bigger than UINT_MAX, so no need to force a bigger type on the caller. Signed-off-by: Dylan Yudaken --- 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,