Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4309470rdh; Tue, 28 Nov 2023 19:04:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtynd3P8YMY1SRgUx5wu1HhF/2spZoYigSsgdnw7GTn2zfmHpmnq4LDq7Vor9hg4AR+99K X-Received: by 2002:a05:6870:ac8f:b0:1f9:5c55:edbe with SMTP id ns15-20020a056870ac8f00b001f95c55edbemr24049733oab.5.1701227049024; Tue, 28 Nov 2023 19:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701227048; cv=none; d=google.com; s=arc-20160816; b=bMsDWuGsJl1h6m1k0ELRBjVjkQJgIrtxrIwtt32JMrwRGARv9D2Q/9bw97CgUUtldr nmomTP4cQOZgIb0gvvAsheTqVMuNkm0nuoB9IwTGBQ1YYXiOhAosZpeOeRdkkHLyeuhV qkGIQPSno1CF5yKvE+UYUhm2voDzb4YLWQvKoobxdyQIdYXr5RTs+GJV9pQk6iCGK+tO dr9MyMauRnZs6kqVvAd5xuuyIblLs3O4uFiGLFYebfIGmXnDVrcza41D0LGomrhGV3Rj 2aFPjsEn3PEmIIe3JUX3CxZQZiWOYJQf77USQUZCdfYZWbWQHhZzxpS+LFLTFgc89aRD +dFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:dkim-filter; bh=PDEk9kY3nrmL8GjXi/hdUYFbHIowAUw4NK0dmP325t4=; fh=eqB4vt6MWNHj4rshyZATJPfI6+c/hdITvrIvZ22YvBM=; b=DxksawvtA7JGQ+REIVqEa9Tdw8xXgImWWDs8E+fYF3sxR5ke3+iHWwgBc+2I7aoO1V 5vr+61Db+IMzjFFlYip+EBFl6XPfR/sLTraa53XfFzZM9eKTGq3csWNdcJSgWt5FAQnv 6o92e98+tx883+fJfhp2tTm4lMULxr8B7Y4qiybLDQ7YUmXD/mf14cF0URKVFj6Jhm7h 4wPBTXlhu2OqV8sXcIYLO1I+0ejLaIWQVG1clHvyEu/BUiXPbqfIt7pSmjdxbtYWVyRh ybFeLlfly+CIlGXtJ528+39kkcgB3hxXEDjyjC96slbRKL7KpDOTfefOtuUVCaGeSbQg rzKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=f4U9WICS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id q5-20020a056a00150500b006cda3296fd1si3183812pfu.374.2023.11.28.19.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 19:04:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=f4U9WICS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4C66B80A5F03; Tue, 28 Nov 2023 19:03:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376837AbjK2DDf (ORCPT + 99 others); Tue, 28 Nov 2023 22:03:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376791AbjK2DDe (ORCPT ); Tue, 28 Nov 2023 22:03:34 -0500 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03AEE19A4 for ; Tue, 28 Nov 2023 19:03:38 -0800 (PST) Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231129030335epoutp042dbf4665807f51eda3abe6dea2c9404d~b_PUVRqHN2826628266epoutp04F for ; Wed, 29 Nov 2023 03:03:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231129030335epoutp042dbf4665807f51eda3abe6dea2c9404d~b_PUVRqHN2826628266epoutp04F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1701227015; bh=PDEk9kY3nrmL8GjXi/hdUYFbHIowAUw4NK0dmP325t4=; h=From:To:Cc:Subject:Date:References:From; b=f4U9WICSyY1uFy92+OLvw/SKGUyfAE1/+PpFTYGpB9cvyreE1r9/u53XqbC8l49Zy xg0rdigKUBi8yE86aTPRv3Du3M9nG9dQfp92e4NMAuMcsFa/i+wiwXX+eljS9ivuYX CYmkr7Kv8L+bwQ7tjKNRlwBXTIH7vs95lowDYUl8= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20231129030335epcas5p4a4d1fe85dbbe937c8f36546094ffba78~b_PTu1kpj0805908059epcas5p4Y; Wed, 29 Nov 2023 03:03:35 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.182]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Sg4055tFTz4x9Pv; Wed, 29 Nov 2023 03:03:33 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 4E.C2.10009.50AA6656; Wed, 29 Nov 2023 12:03:33 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20231128123622epcas5p4940679fbbafdf0da802deea3e531f850~byaI4M4UY1906519065epcas5p4P; Tue, 28 Nov 2023 12:36:22 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231128123622epsmtrp11d28128d4f35c3ff4c3aa4592c5ac963~byaI3cksl0249402494epsmtrp1t; Tue, 28 Nov 2023 12:36:22 +0000 (GMT) X-AuditID: b6c32a4a-ff1ff70000002719-c3-6566aa056cc9 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 30.E7.18939.6CED5656; Tue, 28 Nov 2023 21:36:22 +0900 (KST) Received: from green245.sa.corp.samsungelectronics.net (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20231128123621epsmtip1f39a9cdfbd0f70a2893b5e390ab4c438~byaHL45kA0175001750epsmtip1V; Tue, 28 Nov 2023 12:36:20 +0000 (GMT) From: Nitesh Shetty To: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , James Smart , Chaitanya Kulkarni Cc: error27@gmail.com, gost.dev@samsung.com, nitheshshetty@gmail.com, Nitesh Shetty , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] nvme: Update type from size_t to u16 for opts->queue_size Date: Tue, 28 Nov 2023 17:59:56 +0530 Message-Id: <20231128122958.2235-1-nj.shetty@samsung.com> X-Mailer: git-send-email 2.35.1.500.gb896f729e2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMJsWRmVeSWpSXmKPExsWy7bCmui7rqrRUg+N/FC1W3+1ns3i0zM/i 5oGdTBYrVx9lsti98COTxaRD1x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115/epY37+/b882 ENv0cOIT+btnKvbJmbR9U2Ipzkg01GIuKk4EAN1hxXbrAgAA X-CMS-MailID: 20231128123622epcas5p4940679fbbafdf0da802deea3e531f850 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231128123622epcas5p4940679fbbafdf0da802deea3e531f850 References: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 19:03:55 -0800 (PST) This fixes the smatch warning, "nvme_loop_create_ctrl() warn: 'opts->queue_size - 1' 18446744073709551615 can't fit into 65535 'ctrl->ctrl.sqsize'" We don't need size_t for queue_size, u16 should serve the purpose, as max size is limited to NVMF_DEF_QUEUE_SIZE(1024). Signed-off-by: Nitesh Shetty --- drivers/nvme/host/fabrics.h | 2 +- drivers/nvme/host/fc.c | 2 +- drivers/nvme/host/rdma.c | 2 +- drivers/nvme/host/tcp.c | 2 +- drivers/nvme/target/loop.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h index fbaee5a7be19..0b2e45faa3b9 100644 --- a/drivers/nvme/host/fabrics.h +++ b/drivers/nvme/host/fabrics.h @@ -125,7 +125,7 @@ struct nvmf_ctrl_options { char *trsvcid; char *host_traddr; char *host_iface; - size_t queue_size; + u16 queue_size; unsigned int nr_io_queues; unsigned int reconnect_delay; bool discovery_nqn; diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 9f9a3b35dc64..7f680443b3cf 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -3159,7 +3159,7 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) if (opts->queue_size > ctrl->ctrl.maxcmd) { /* warn if maxcmd is lower than queue_size */ dev_warn(ctrl->ctrl.device, - "queue_size %zu > ctrl maxcmd %u, reducing " + "queue_size %u > ctrl maxcmd %u, reducing " "to maxcmd\n", opts->queue_size, ctrl->ctrl.maxcmd); opts->queue_size = ctrl->ctrl.maxcmd; diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 6d178d555920..d0b7543f753e 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -1025,7 +1025,7 @@ static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctrl *ctrl, bool new) if (ctrl->ctrl.opts->queue_size > ctrl->ctrl.sqsize + 1) { dev_warn(ctrl->ctrl.device, - "queue_size %zu > ctrl sqsize %u, clamping down\n", + "queue_size %u > ctrl sqsize %u, clamping down\n", ctrl->ctrl.opts->queue_size, ctrl->ctrl.sqsize + 1); } diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index d79811cfa0ce..d03f5921d344 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -2193,7 +2193,7 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new) if (opts->queue_size > ctrl->sqsize + 1) dev_warn(ctrl->device, - "queue_size %zu > ctrl sqsize %u, clamping down\n", + "queue_size %u > ctrl sqsize %u, clamping down\n", opts->queue_size, ctrl->sqsize + 1); if (ctrl->sqsize + 1 > ctrl->maxcmd) { diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 9cb434c58075..0416f41fad19 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -573,7 +573,7 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev, if (opts->queue_size > ctrl->ctrl.maxcmd) { /* warn if maxcmd is lower than queue_size */ dev_warn(ctrl->ctrl.device, - "queue_size %zu > ctrl maxcmd %u, clamping down\n", + "queue_size %u > ctrl maxcmd %u, clamping down\n", opts->queue_size, ctrl->ctrl.maxcmd); opts->queue_size = ctrl->ctrl.maxcmd; } base-commit: da59b416ba80e43afb2b642e0cee73739f4c6079 -- 2.35.1.500.gb896f729e2