[PATCH] nvme: print out valid arguments when reading from /dev/nvme-fabrics
Hannes Reinecke
hare at suse.de
Tue Nov 23 08:38:22 PST 2021
On 11/23/21 5:22 PM, Christoph Hellwig wrote:
> The subject should use a nvme-fabrics prefix.
>
>> + const struct match_token *tok;
>> + int idx;
>> +
>> + for (idx = 0; idx < ARRAY_SIZE(opt_tokens); idx++) {
>> + tok = &opt_tokens[idx];
>> + if (tok->token == NVMF_OPT_ERR)
>> + continue;
>> + if (idx)
>> + seq_puts(seq_file, ",");
>> + seq_puts(seq_file, tok->pattern);
>> + }
>> + seq_puts(seq_file, "\n");
>
> A helper for this logic would be nice. Also shouldn't be there
> some kind of token to distinguish from the case where a controller
> has already been created?
>
Helper: sure.
But we don't need to distinguish the case where the controller has
already been created as this is handled by the if condition further up.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
More information about the Linux-nvme
mailing list