[PATCH rfc] nvme-fabrics: request transport module

Christoph Hellwig hch at infradead.org
Sun Sep 24 05:55:08 PDT 2017


> +
> +	if (!strcmp(opts->transport, "rdma"))
> +		mod_name = "nvme-rdma";
> +	else if (!strcmp(opts->transport, "fc"))
> +		mod_name = "nvme-fc";
> +	else if (!strcmp(opts->transport, "loop"))
> +		mod_name = "nvme-loop";
> +	else
> +		return -EINVAL;
> +
> +	ret = request_module(mod_name) < 0;

You can replace this whole function with:

	request_module("nvme-%d", opts->transport);

Also if I remember correctly request_module returns an error if the
driver is built-in, thus most callers either don't check the return
value or just print a warning (I personally hate the warning, so I think
we should just do the simple request_module call).



More information about the Linux-nvme mailing list