From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B216C2D0D2 for ; Fri, 20 Dec 2019 14:37:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC11224682 for ; Fri, 20 Dec 2019 14:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576852658; bh=hPhn3y/ZGrQy+jZyE8ezDpT4Ehkv8ucuJyt+ZkmrOb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yn1EUx45TBypX5Res6Kam43kE3ov9v6haBoQv+SwSfnNU4Lafei6jSCgb3Yh3RVhk X0xNLY6YIeMFsALiT+YS3YOpR7PljQiqJWyx3X5/PNEubL1FF2ZRVFKOyTj/bnDaQG +n6RrpNS1CdC6/Ed0MO49Fl9nGKD6ZC147RMkFEg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727594AbfLTOaQ (ORCPT ); Fri, 20 Dec 2019 09:30:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:33548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727536AbfLTOaM (ORCPT ); Fri, 20 Dec 2019 09:30:12 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1663B206CB; Fri, 20 Dec 2019 14:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576852211; bh=hPhn3y/ZGrQy+jZyE8ezDpT4Ehkv8ucuJyt+ZkmrOb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bvEacYvZODiiBR2yYsG06kEnaoslWwXhmWHC0Nx3Y9hnpml5hOy+LyN1Yz1d26DSn jdh5l/o4GgSC4+pRP0CI/xkGc+jEjdDVJmXMYmqPYuEUjFuZSEWszSjbaxCOVMxf96 VILhVWtMacg4ANcjoscM/BvXKFJwl3UXTRguWGzY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Keith Busch , Jens Axboe , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.4 12/52] nvme/pci: Fix write and poll queue types Date: Fri, 20 Dec 2019 09:29:14 -0500 Message-Id: <20191220142954.9500-12-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191220142954.9500-1-sashal@kernel.org> References: <20191220142954.9500-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Keith Busch [ Upstream commit 3f68baf706ec68c4120867c25bc439c845fe3e17 ] The number of poll or write queues should never be negative. Use unsigned types so that it's not possible to break have the driver not allocate any queues. Reviewed-by: Jens Axboe Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 869f462e6b6ea..29d7427c2b19b 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -68,14 +68,14 @@ static int io_queue_depth = 1024; module_param_cb(io_queue_depth, &io_queue_depth_ops, &io_queue_depth, 0644); MODULE_PARM_DESC(io_queue_depth, "set io queue depth, should >= 2"); -static int write_queues; -module_param(write_queues, int, 0644); +static unsigned int write_queues; +module_param(write_queues, uint, 0644); MODULE_PARM_DESC(write_queues, "Number of queues to use for writes. If not set, reads and writes " "will share a queue set."); -static int poll_queues; -module_param(poll_queues, int, 0644); +static unsigned int poll_queues; +module_param(poll_queues, uint, 0644); MODULE_PARM_DESC(poll_queues, "Number of queues to use for polled IO."); struct nvme_dev; -- 2.20.1