From patchwork Wed Jan 11 18:42:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 13097095 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 C649FC46467 for ; Wed, 11 Jan 2023 18:43:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229578AbjAKSnC (ORCPT ); Wed, 11 Jan 2023 13:43:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235350AbjAKSnA (ORCPT ); Wed, 11 Jan 2023 13:43:00 -0500 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD911AA1C for ; Wed, 11 Jan 2023 10:42:59 -0800 (PST) Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30BGIknL032656 for ; Wed, 11 Jan 2023 10:42:59 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=s2048-2021-q4; bh=7p+BnnT0sLmST7e3EtxXjdtABFJPi38m9osctzdzx6Y=; b=E/jA8tZ/GwlYC0kDZeKfYaJIjXgL8ah8PiXYCsiHJSsTYsnRoeFwyXJDJ9A5tkl2Jl8p bVwvxoInuG5eFQIvfOsnEoFyQZAowekYsWVZt+knoMpi1wZsB59OicpDrG4nbdw+r9gp 2nTmmqEjI54GAYDsefz4hkJoSRHcUX4Ch4lpdzpe/WV6y+vJ4hJ0rvbqPtT55ioCfhRx 1OT/Ul9ZMLRAjE1iMxjzaNGrZEWXlaCtvM4ue2QwZywKVdJa9X8akrlbBqV0cVNtgYJy 4q3GdoZYvxAXcAxloo7gKHfW0FeFcG5CrqeClzQmXg6Lgdcz3ouAVE7ak8M20ubTIhaE qg== Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3n1k51wb2g-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 11 Jan 2023 10:42:58 -0800 Received: from twshared25383.14.frc2.facebook.com (2620:10d:c085:108::4) by mail.thefacebook.com (2620:10d:c085:21d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 11 Jan 2023 10:42:54 -0800 Received: by devbig007.nao1.facebook.com (Postfix, from userid 544533) id 1F7C4EBD9505; Wed, 11 Jan 2023 10:42:46 -0800 (PST) From: Keith Busch To: CC: , , , , , , , Keith Busch Subject: [PATCH] caif: don't assume iov_iter type Date: Wed, 11 Jan 2023 10:42:45 -0800 Message-ID: <20230111184245.3784393-1-kbusch@meta.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: XlQbCDVdsYRgIKElfeISLrAPU9vFsOEQ X-Proofpoint-GUID: XlQbCDVdsYRgIKElfeISLrAPU9vFsOEQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-11_08,2023-01-11_02,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Keith Busch The details of the iov_iter types are appropriately abstracted, so there's no need to check for specific type fields. Just let the abstractions handle it. This is preparing for io_uring/net's io_send to utilize the more efficient ITER_UBUF. Signed-off-by: Keith Busch Reviewed-by: Jens Axboe --- net/caif/caif_socket.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index 748be72532485..1f2c1d7b90e23 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c @@ -533,10 +533,6 @@ static int caif_seqpkt_sendmsg(struct socket *sock, struct msghdr *msg, if (msg->msg_namelen) goto err; - ret = -EINVAL; - if (unlikely(msg->msg_iter.nr_segs == 0) || - unlikely(msg->msg_iter.iov->iov_base == NULL)) - goto err; noblock = msg->msg_flags & MSG_DONTWAIT; timeo = sock_sndtimeo(sk, noblock);