Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3737ybl; Tue, 7 Jan 2020 12:59:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyF6ND+A8e0wWwK99h/kzUquu9bmtJV5V+xUV4LknRk3xstsM2ph2dycGKdOZPkhZot2IF1 X-Received: by 2002:aca:2112:: with SMTP id 18mr252818oiz.155.1578430772421; Tue, 07 Jan 2020 12:59:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578430772; cv=none; d=google.com; s=arc-20160816; b=Y3BBmuksRCHFH87cEZvTiDh2bEa1FiaojoGn6yNny1tCeZMTiJt0Akx4NmoanInhGl /f71Czp4Cd7NZWDopvMrdQvMHI03k9YYXEh9s+JQmbBQYTN5XXVihdU2YRiiH996QNrc Cd0abamWJ58B7LLvb0K2wKZWWC9Sbv9o1MD46rC/hRXuOfp29d3cIZhV178uO8UUwbgx HAmq7dfE6M2mOaVRFsP08+1TbVTxBgw46XQ6wnM/irDa7fX0W+pL9UwK41TcNTNYtHo+ AZllITG6WXAQgm1CsxrgXr8+n7W84YOKDaoZKufw8RMDrDdsD+lHgw7mCfpQFZV2NZTU D4XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j4UhpaYWVyE4mRn3Ag1RqI7jtcQd5wZlenrSWcS/Mfw=; b=BJQJIbrfl2hpkDiQv+2SaolRtk9FEB4vI56S9BG+ApTJQm4ZlAe6+sn9yM0IFgpk1l ZjAsZETu7tGyDtloIH/iU3aS7J6J79NHKkFlF8ThrOy9VFr3vqVsZDawprgMJd/c6sKP 3Sy01TSHfICLz42NoWh+NU0DHmy+dkqOlVG9Zqb9mzl2yETT0d/zzIQKt2QfP/aFrYnl UgaHdtjDC/yIwWeUCl1vVG9Ib/xd3dbRKCu3XSUEFWteWnAr1ak6iYW73SQ7E9jyXFxw wKE9abxPwc+Wt64U0q9VdNFcMGs+x8WsgsRz9EuMnLNtzEDZlzrnFIzNNoZyjKal92gq tFUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zPtrqoJB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si608232oih.141.2020.01.07.12.59.20; Tue, 07 Jan 2020 12:59:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zPtrqoJB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727745AbgAGU57 (ORCPT + 99 others); Tue, 7 Jan 2020 15:57:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:56138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727199AbgAGU55 (ORCPT ); Tue, 7 Jan 2020 15:57:57 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CF672187F; Tue, 7 Jan 2020 20:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578430676; bh=ETqOKsaKnFh8ubRIRwtRQ7OHO76XvlruOB9IQrzWWYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zPtrqoJBm2ccKK0Quey9JR/FaUgA2q6Ls4YTNcuHnhHzpmmuh93qPGKJ1KB3abE7y S0W3NDXuLifQVqkybVxtUP1M+QDrqb3wWmCRX0EekrDTiKGtoaS79HeuUcX030/bm4 wDXxcy+k3sPwKKI4+o5YM3ZJhe08imTIhywpJ4HU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jens Axboe , Keith Busch , Sasha Levin Subject: [PATCH 5.4 012/191] nvme/pci: Fix write and poll queue types Date: Tue, 7 Jan 2020 21:52:12 +0100 Message-Id: <20200107205333.665301104@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107205332.984228665@linuxfoundation.org> References: <20200107205332.984228665@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 869f462e6b6e..29d7427c2b19 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