All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: "Keith Busch" <kbusch@kernel.org>,
	linux-nvme@lists.infradead.org, hch@lst.de,
	linux-block@vger.kernel.org, axboe@kernel.dk,
	"Niklas Cassel" <niklas.cassel@wdc.com>,
	"Javier González" <javier.gonz@samsung.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	"Johannes Thumshirn" <johannes.thumshirn@wdc.com>,
	"Matias Bjørling" <matias.bjorling@wdc.com>,
	"Daniel Wagner" <dwagner@suse.de>
Subject: Re: [PATCHv3 3/5] nvme: implement I/O Command Sets Command Set support
Date: Fri, 26 Jun 2020 10:54:45 +0200	[thread overview]
Message-ID: <20200626085445.GB25535@lst.de> (raw)
In-Reply-To: <69e8e88c-097b-368d-58f4-85d11110386d@grimberg.me>

On Tue, Jun 23, 2020 at 01:53:47AM -0700, Sagi Grimberg wrote:
>>   	if (ns->lba_shift == 0)
>>   		ns->lba_shift = 9;
>>   +	switch (ns->head->ids.csi) {
>> +	case NVME_CSI_NVM:
>> +		break;
>> +	default:
>> +		dev_warn(ctrl->device, "unknown csi:%d ns:%d\n",
>> +			ns->head->ids.csi, ns->head->ns_id);
>> +		return -ENODEV;
>> +	}
>
> Not sure we need a switch-case statement for a single case target...

I think a switch makes inherent sense when there is an identifier that
can have multiple values, even if there only is one for now.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: axboe@kernel.dk, "Niklas Cassel" <niklas.cassel@wdc.com>,
	"Daniel Wagner" <dwagner@suse.de>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	"Johannes Thumshirn" <johannes.thumshirn@wdc.com>,
	linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
	"Keith Busch" <kbusch@kernel.org>,
	"Javier González" <javier.gonz@samsung.com>,
	hch@lst.de, "Matias Bjørling" <matias.bjorling@wdc.com>
Subject: Re: [PATCHv3 3/5] nvme: implement I/O Command Sets Command Set support
Date: Fri, 26 Jun 2020 10:54:45 +0200	[thread overview]
Message-ID: <20200626085445.GB25535@lst.de> (raw)
In-Reply-To: <69e8e88c-097b-368d-58f4-85d11110386d@grimberg.me>

On Tue, Jun 23, 2020 at 01:53:47AM -0700, Sagi Grimberg wrote:
>>   	if (ns->lba_shift == 0)
>>   		ns->lba_shift = 9;
>>   +	switch (ns->head->ids.csi) {
>> +	case NVME_CSI_NVM:
>> +		break;
>> +	default:
>> +		dev_warn(ctrl->device, "unknown csi:%d ns:%d\n",
>> +			ns->head->ids.csi, ns->head->ns_id);
>> +		return -ENODEV;
>> +	}
>
> Not sure we need a switch-case statement for a single case target...

I think a switch makes inherent sense when there is an identifier that
can have multiple values, even if there only is one for now.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2020-06-26  8:54 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 16:25 [PATCHv3 0/5] nvme support for zoned namespace command set Keith Busch
2020-06-22 16:25 ` [PATCHv3 1/5] block: add capacity field to zone descriptors Keith Busch
2020-06-23  6:15   ` Hannes Reinecke
2020-06-23  8:44   ` Sagi Grimberg
2020-06-26 12:17   ` Jens Axboe
2020-06-26 12:17     ` Jens Axboe
2020-06-22 16:25 ` [PATCHv3 2/5] null_blk: introduce zone capacity for zoned device Keith Busch
2020-06-23  6:16   ` Hannes Reinecke
2020-06-23  8:45   ` Sagi Grimberg
2020-06-22 16:25 ` [PATCHv3 3/5] nvme: implement I/O Command Sets Command Set support Keith Busch
2020-06-23  6:20   ` Hannes Reinecke
2020-06-23  9:20     ` Niklas Cassel
2020-06-23 14:25       ` Keith Busch
2020-06-23  8:53   ` Sagi Grimberg
2020-06-23 11:25     ` Niklas Cassel
2020-06-23 14:59       ` Keith Busch
2020-06-23 14:59         ` Keith Busch
2020-06-23 22:10       ` Keith Busch
2020-06-23 22:10         ` Keith Busch
2020-06-23 23:17         ` Sagi Grimberg
2020-06-23 23:17           ` Sagi Grimberg
2020-06-24 17:25           ` Keith Busch
2020-06-24 17:25             ` Keith Busch
2020-06-24 17:46             ` Sagi Grimberg
2020-06-24 17:46               ` Sagi Grimberg
2020-06-24 18:03               ` Keith Busch
2020-06-24 18:03                 ` Keith Busch
2020-06-24 18:28                 ` Sagi Grimberg
2020-06-24 18:28                   ` Sagi Grimberg
2020-06-24 18:33                   ` Sagi Grimberg
2020-06-24 18:33                     ` Sagi Grimberg
2020-06-24 18:40                     ` Keith Busch
2020-06-24 18:40                       ` Keith Busch
2020-06-24 19:03                       ` Sagi Grimberg
2020-06-24 19:03                         ` Sagi Grimberg
2020-06-24 21:49                         ` Keith Busch
2020-06-24 21:49                           ` Keith Busch
2020-06-24 22:54                           ` Sagi Grimberg
2020-06-24 22:54                             ` Sagi Grimberg
2020-06-24 23:54                             ` Keith Busch
2020-06-24 23:54                               ` Keith Busch
2020-06-23 23:20       ` Sagi Grimberg
2020-06-23 23:20         ` Sagi Grimberg
2020-06-26  8:54     ` Christoph Hellwig [this message]
2020-06-26  8:54       ` Christoph Hellwig
2020-06-22 16:25 ` [PATCHv3 4/5] nvme: support for multi-command set effects Keith Busch
2020-06-23  6:21   ` Hannes Reinecke
2020-06-23 17:43   ` Sagi Grimberg
2020-06-23 17:43     ` Sagi Grimberg
2020-06-22 16:25 ` [PATCHv3 5/5] nvme: support for zoned namespaces Keith Busch
2020-06-22 16:48   ` Johannes Thumshirn
2020-06-23  6:23   ` Hannes Reinecke
2020-06-23 17:45   ` Sagi Grimberg
2020-06-23 17:45     ` Sagi Grimberg
2020-06-24  9:11   ` Javier González
2020-06-24  9:11     ` Javier González
2020-06-29 13:53   ` Johannes Thumshirn
2020-06-29 13:53     ` Johannes Thumshirn

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=20200626085445.GB25535@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=dwagner@suse.de \
    --cc=javier.gonz@samsung.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=martin.petersen@oracle.com \
    --cc=matias.bjorling@wdc.com \
    --cc=niklas.cassel@wdc.com \
    --cc=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.