[PATCH 1/1] virtio-blk: add num_io_queues module parameter

Christoph Hellwig
Mon, 30 Aug 2021 16:48:29 -0000

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.