From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH rfc] nvme-fabrics: request transport module
Date: Sun, 24 Sep 2017 16:03:55 +0300 [thread overview]
Message-ID: <74246ccf-53e3-7956-3117-16e44f2f8793@grimberg.me> (raw)
In-Reply-To: <20170924125507.GA11632@infradead.org>
>> +
>> + 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);
Hahaha, how could I miss that?!
> 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).
So skip the return value altogether? I don't mind that...
next prev parent reply other threads:[~2017-09-24 13:03 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
2017-09-24 13:03 ` Sagi Grimberg [this message]
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=74246ccf-53e3-7956-3117-16e44f2f8793@grimberg.me \
--to=sagi@grimberg.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.