Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH rfc] nvme-fabrics: request transport module
Date: Sun, 24 Sep 2017 05:55:08 -0700	[thread overview]
Message-ID: <20170924125507.GA11632@infradead.org> (raw)
In-Reply-To: <1506257125-15257-1-git-send-email-sagi@grimberg.me>

> +
> +	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).

  reply	other threads:[~2017-09-24 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-24 12:45 [PATCH rfc] nvme-fabrics: request transport module Sagi Grimberg
2017-09-24 12:55 ` Christoph Hellwig [this message]
2017-09-24 13:03   ` Sagi Grimberg
2017-09-24 13:04     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170924125507.GA11632@infradead.org \
    --to=hch@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox