linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH 1/3] nvmet: switch check for subsystem type
Date: Tue, 19 Oct 2021 15:50:00 +0200	[thread overview]
Message-ID: <744dd4ce-34e5-1860-3f1d-b12f2ad00820@suse.de> (raw)
In-Reply-To: <78859610-656a-ef43-6a20-d3fc71dab4a2@nvidia.com>

On 10/19/21 8:37 AM, Chaitanya Kulkarni wrote:
> On 10/18/2021 8:21 AM, Hannes Reinecke wrote:
>> Invert the check for discovery subsystem type to allow for additional
>> discovery subsystem types.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> ---
>>    drivers/nvme/target/nvmet.h | 2 +-
>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
>> index f31dcc4fb1a2..af193423c10b 100644
>> --- a/drivers/nvme/target/nvmet.h
>> +++ b/drivers/nvme/target/nvmet.h
>> @@ -579,7 +579,7 @@ static inline struct nvmet_subsys *nvmet_req_subsys(struct nvmet_req *req)
>>    
>>    static inline bool nvmet_is_disc_subsys(struct nvmet_subsys *subsys)
>>    {
>> -    return subsys->type == NVME_NQN_DISC;
>> +    return subsys->type != NVME_NQN_NVME;
> 
> shouldn't we use switch and make code more readable for allowed
> subsys->type values ? unless there is a reason ..
> 

Well, with this patch we still have only two values; introducing a 
switch for this feels a bit silly.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@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


  reply	other threads:[~2021-10-19 13:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 15:21 [PATCHv2 0/3] nvmet: discovery controller discovery support Hannes Reinecke
2021-10-18 15:21 ` [PATCH 1/3] nvmet: switch check for subsystem type Hannes Reinecke
2021-10-19  6:37   ` Chaitanya Kulkarni
2021-10-19 13:50     ` Hannes Reinecke [this message]
2021-10-18 15:21 ` [PATCH 2/3] nvme: add new discovery log page entry definitions Hannes Reinecke
2021-10-18 15:21 ` [PATCH 3/3] nvmet: register discovery subsystem as 'current' Hannes Reinecke
2021-10-27  6:07 ` [PATCHv2 0/3] nvmet: discovery controller discovery support Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2021-09-21 17:42 [PATCH 0/3] nvme: " Hannes Reinecke
2021-09-21 17:42 ` [PATCH 1/3] nvmet: switch check for subsystem type Hannes Reinecke

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=744dd4ce-34e5-1860-3f1d-b12f2ad00820@suse.de \
    --to=hare@suse.de \
    --cc=chaitanyak@nvidia.com \
    --cc=linux-nvme@lists.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;
as well as URLs for NNTP newsgroup(s).