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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 95ED7C432BE for ; Mon, 30 Aug 2021 16:49:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AFEB60F5E for ; Mon, 30 Aug 2021 16:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237866AbhH3QuU (ORCPT ); Mon, 30 Aug 2021 12:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231234AbhH3QuU (ORCPT ); Mon, 30 Aug 2021 12:50:20 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03C7EC061575; Mon, 30 Aug 2021 09:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6rHApL/Np9+9ugLAs48I8ACfdCP2s/Ndc6zPCQ0cfq0=; b=f/rDqmUDQgkWbrA8o/5V0HBaL4 nvG1ecXU08POhUXxJ0fFrvCemil25t6qZB9NY51MaQdPngfABasVxRDYEWat0fDdDMn5M+POL0DUm /o4gK5VwrFvqdh+McNmadh4EJpTbEbRtWHaNlPYjf4YW3oLqfRIEh5caabE2guzyHerkzNEIKj9xO S7egjaEm2UrVqVS98UCrS4g64L7N5nmEqRz2873j8dmhQde8Gx18kWRQK9LHI7G2WNJf4rPg9U2oJ ACi+HZ3ehMxleZOJhi5Yrdjd01ojYLPFPe/9e8BZm4muVHEEQLy5SgmVXk1Fwm8xw+mw4jNwXwqM9 cvT3pCcQ==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKkST-000L1o-4j; Mon, 30 Aug 2021 16:48:46 +0000 Date: Mon, 30 Aug 2021 17:48:29 +0100 From: Christoph Hellwig To: Max Gurtovoy Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, stefanha@redhat.com, oren@nvidia.com, linux-block@vger.kernel.org, axboe@kernel.dk Subject: Re: [PATCH 1/1] virtio-blk: add num_io_queues module parameter Message-ID: References: <20210830120023.22202-1-mgurtovoy@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210830120023.22202-1-mgurtovoy@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Aug 30, 2021 at 03:00:23PM +0300, Max Gurtovoy wrote: > +static int virtblk_queue_count_set(const char *val, > + const struct kernel_param *kp) > +{ > + unsigned int n; > + int ret; > + > + ret = kstrtouint(val, 10, &n); > + if (ret != 0 || n > nr_cpu_ids) > + return -EINVAL; > + return param_set_uint(val, kp); > +} Thi can use param_set_uint_minmax. 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=-0.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED autolearn=no 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 AAB8FC432BE for ; Mon, 30 Aug 2021 16:49:35 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D4E9360F92 for ; Mon, 30 Aug 2021 16:49:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D4E9360F92 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 96BEC40286; Mon, 30 Aug 2021 16:49:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ciDNPEzsrflJ; Mon, 30 Aug 2021 16:49:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 1D0ED40400; Mon, 30 Aug 2021 16:49:30 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 00E15C001A; Mon, 30 Aug 2021 16:49:30 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6D60FC000E for ; Mon, 30 Aug 2021 16:49:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4E789606E9 for ; Mon, 30 Aug 2021 16:49:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=infradead.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GQWmWyW2Lqps for ; Mon, 30 Aug 2021 16:49:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4B68260593 for ; Mon, 30 Aug 2021 16:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6rHApL/Np9+9ugLAs48I8ACfdCP2s/Ndc6zPCQ0cfq0=; b=f/rDqmUDQgkWbrA8o/5V0HBaL4 nvG1ecXU08POhUXxJ0fFrvCemil25t6qZB9NY51MaQdPngfABasVxRDYEWat0fDdDMn5M+POL0DUm /o4gK5VwrFvqdh+McNmadh4EJpTbEbRtWHaNlPYjf4YW3oLqfRIEh5caabE2guzyHerkzNEIKj9xO S7egjaEm2UrVqVS98UCrS4g64L7N5nmEqRz2873j8dmhQde8Gx18kWRQK9LHI7G2WNJf4rPg9U2oJ ACi+HZ3ehMxleZOJhi5Yrdjd01ojYLPFPe/9e8BZm4muVHEEQLy5SgmVXk1Fwm8xw+mw4jNwXwqM9 cvT3pCcQ==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKkST-000L1o-4j; Mon, 30 Aug 2021 16:48:46 +0000 Date: Mon, 30 Aug 2021 17:48:29 +0100 From: Christoph Hellwig To: Max Gurtovoy Subject: Re: [PATCH 1/1] virtio-blk: add num_io_queues module parameter Message-ID: References: <20210830120023.22202-1-mgurtovoy@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210830120023.22202-1-mgurtovoy@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Cc: axboe@kernel.dk, kvm@vger.kernel.org, mst@redhat.com, virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, stefanha@redhat.com, oren@nvidia.com X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Mon, Aug 30, 2021 at 03:00:23PM +0300, Max Gurtovoy wrote: > +static int virtblk_queue_count_set(const char *val, > + const struct kernel_param *kp) > +{ > + unsigned int n; > + int ret; > + > + ret = kstrtouint(val, 10, &n); > + if (ret != 0 || n > nr_cpu_ids) > + return -EINVAL; > + return param_set_uint(val, kp); > +} Thi can use param_set_uint_minmax. _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization