From nobody Mon Apr 29 05:58:58 2024 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 A9C57C433FE for ; Fri, 30 Sep 2022 11:56:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbiI3L4O (ORCPT ); Fri, 30 Sep 2022 07:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbiI3Lz7 (ORCPT ); Fri, 30 Sep 2022 07:55:59 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BF5F125DB7; Fri, 30 Sep 2022 04:55:57 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Mf7sr46RSzHqJq; Fri, 30 Sep 2022 19:53:36 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 19:55:55 +0800 Received: from huawei.com (10.67.174.245) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 19:55:55 +0800 From: Chen Zhongjin To: , , , CC: , , , , , Subject: [PATCH -next 1/2] net/rds: Remove unused variable 'total_copied' Date: Mon, 10 Oct 2022 11:09:03 +0800 Message-ID: <20221010030904.2883557-2-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221010030904.2883557-1-chenzhongjin@huawei.com> References: <20221010030904.2883557-1-chenzhongjin@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.174.245] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Reported by Clang [-Wunused-but-set-variable] 'commit 0cebaccef3ac ("rds: zerocopy Tx support.")' This commit introduced the variable 'dest_frames'. However this variable is never used by other code except iterates itself, so remove it. Signed-off-by: Chen Zhongjin --- net/rds/message.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/rds/message.c b/net/rds/message.c index d74be4e3f3fa..eee2e674d5c0 100644 --- a/net/rds/message.c +++ b/net/rds/message.c @@ -366,7 +366,6 @@ static int rds_message_zcopy_from_user(struct rds_messa= ge *rm, struct iov_iter * struct scatterlist *sg; int ret =3D 0; int length =3D iov_iter_count(from); - int total_copied =3D 0; struct rds_msg_zcopy_info *info; =20 rm->m_inc.i_hdr.h_len =3D cpu_to_be32(iov_iter_count(from)); @@ -404,7 +403,6 @@ static int rds_message_zcopy_from_user(struct rds_messa= ge *rm, struct iov_iter * ret =3D -EFAULT; goto err; } - total_copied +=3D copied; length -=3D copied; sg_set_page(sg, pages, copied, start); rm->data.op_nents++; --=20 2.33.0 From nobody Mon Apr 29 05:58:58 2024 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 623DDC43217 for ; Fri, 30 Sep 2022 11:56:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231135AbiI3L4A (ORCPT ); Fri, 30 Sep 2022 07:56:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbiI3Lz7 (ORCPT ); Fri, 30 Sep 2022 07:55:59 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C160128705; Fri, 30 Sep 2022 04:55:57 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Mf7s53l0zzpTgj; Fri, 30 Sep 2022 19:52:57 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 19:55:55 +0800 Received: from huawei.com (10.67.174.245) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 19:55:55 +0800 From: Chen Zhongjin To: , , , CC: , , , , , Subject: [PATCH -next 2/2] net/rds: Remove unused variable 'total_payload_len' Date: Mon, 10 Oct 2022 11:09:04 +0800 Message-ID: <20221010030904.2883557-3-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221010030904.2883557-1-chenzhongjin@huawei.com> References: <20221010030904.2883557-1-chenzhongjin@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.174.245] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Reported by Clang [-Wunused-but-set-variable] 'commit f9fb69adb6c7 ("RDS: make message size limit compliant with spec")' This commit introduced the variable 'total_copied'. However this variable is never used by other code except iterates itself, so remove it. Signed-off-by: Chen Zhongjin --- net/rds/send.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/rds/send.c b/net/rds/send.c index 0c5504068e3c..5e57a1581dc6 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1114,7 +1114,7 @@ int rds_sendmsg(struct socket *sock, struct msghdr *m= sg, size_t payload_len) struct rds_conn_path *cpath; struct in6_addr daddr; __u32 scope_id =3D 0; - size_t total_payload_len =3D payload_len, rdma_payload_len =3D 0; + size_t rdma_payload_len =3D 0; bool zcopy =3D ((msg->msg_flags & MSG_ZEROCOPY) && sock_flag(rds_rs_to_sk(rs), SOCK_ZEROCOPY)); int num_sgs =3D DIV_ROUND_UP(payload_len, PAGE_SIZE); @@ -1243,7 +1243,6 @@ int rds_sendmsg(struct socket *sock, struct msghdr *m= sg, size_t payload_len) if (ret) goto out; =20 - total_payload_len +=3D rdma_payload_len; if (max_t(size_t, payload_len, rdma_payload_len) > RDS_MAX_MSG_SIZE) { ret =3D -EMSGSIZE; goto out; --=20 2.33.0