From patchwork Tue Nov 28 12:29:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitesh Shetty X-Patchwork-Id: 171041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp87088vqn; Tue, 28 Nov 2023 19:03:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHvqLUUpmyuuhR+yD5S6ymZex1er/P8nZ9HKC72ZPVAmvpVVZXjoR35V6iBt0B1tBBnwHO X-Received: by 2002:a05:6830:b8e:b0:6d8:1239:3cb8 with SMTP id a14-20020a0568300b8e00b006d812393cb8mr13461421otv.30.1701227033565; Tue, 28 Nov 2023 19:03:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701227033; cv=none; d=google.com; s=arc-20160816; b=XUs4A/P6sgqomfBdLkL+u1/BiL9kvADp9Pk/YvhnAN+ssLeaHR9H/E2uFsDT30MDqB rGW2u0WpsNA7F1+fzG8gppKZgThJl+vT+vup4qDaHEQykTai7h6Jkz0zq7m0mQo059W/ GyXaJfHHoqnd65X3t9gRh+38lMIdvzolczcBUPFSd/di+4NPOkyJU276qaHh0dwrSYbt gpUe8wPdOzBDSJrfphSbPukxrxZJp9xlXzWjk0+fmjNjv3QDA7KbgihjBmvbwtl1VT03 UXueRjIEEKY2i+gMWVZUuxnMFUT7SRojlJo5ag7fRSB4XDYuoqPnFgkj3eCDUYjlYWuw 1hwA== 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 Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id e17-20020a656891000000b005bdbcf7c446si13980023pgt.171.2023.11.28.19.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 19:03:53 -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 9E9B780557E0; Tue, 28 Nov 2023 19:03:50 -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 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0pC97/fL39asbeepMmvuV+PxZuezijfxvft/y3PQ7OW37dv1Amk8P1R8h3 14Q/k1ew84UnVHUbdKoUvzLY+lRXPuvHhs83TplJf7A1y1FTc1rKfGgdQ115/epY37+/b882 ENv0cOIT+btnKvbJmbR9U2Ipzkg01GIuKk4EAN1hxXbrAgAA X-CMS-MailID: 20231128123622epcas5p4940679fbbafdf0da802deea3e531f850 X-Msg-Generator: CA 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:50 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783865837961901454 X-GMAIL-MSGID: 1783865837961901454 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 Reviewed-by: Sagi Grimberg --- 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(-) base-commit: da59b416ba80e43afb2b642e0cee73739f4c6079 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; }