[PATCH 1/3] nvmet: switch check for subsystem type

Hannes Reinecke hare at suse.de
Tue Oct 19 06:50:00 PDT 2021


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 at 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 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