All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error()
@ 2021-05-21 22:41 Chaitanya Kulkarni
  2021-05-21 22:41 ` [PATCH 1/4] nvme-fabrics: fix comment nvmf_log_connect_error() Chaitanya Kulkarni
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2021-05-21 22:41 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, kbusch, sagi, Chaitanya Kulkarni

Hi,

Small cleanup around nvmf_log_connect_error() to fix style issues.

-ck.

Chaitanya Kulkarni (4):
  nvme-fabrics: fix comment nvmf_log_connect_error()
  nvme-fabrics: remove extra new lines in the switch
  nvme-fabrics: remove extra comment
  nvme-fabrics: remove extra braces

 drivers/nvme/host/fabrics.c | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)

-- 
2.22.1


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] nvme-fabrics: fix comment nvmf_log_connect_error()
  2021-05-21 22:41 [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Chaitanya Kulkarni
@ 2021-05-21 22:41 ` Chaitanya Kulkarni
  2021-05-21 22:41 ` [PATCH 2/4] nvme-fabrics: remove extra new lines in the switch Chaitanya Kulkarni
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2021-05-21 22:41 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, kbusch, sagi, Chaitanya Kulkarni

Fix the comment style that matches existing code.

No functionality change in this patch.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/nvme/host/fabrics.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index a2bb7fc63a73..5a1b8a1bb145 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -254,19 +254,15 @@ int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val)
 EXPORT_SYMBOL_GPL(nvmf_reg_write32);
 
 /**
- * nvmf_log_connect_error() - Error-parsing-diagnostic print
- * out function for connect() errors.
- *
- * @ctrl: the specific /dev/nvmeX device that had the error.
- *
- * @errval: Error code to be decoded in a more human-friendly
- *	    printout.
- *
- * @offset: For use with the NVMe error code NVME_SC_CONNECT_INVALID_PARAM.
- *
- * @cmd: This is the SQE portion of a submission capsule.
- *
- * @data: This is the "Data" portion of a submission capsule.
+ * nvmf_log_connect_error() - Error-parsing-diagnostic print out function for
+ * 				connect() errors.
+ * @ctrl:	The specific /dev/nvmeX device that had the error.
+ * @errval:	Error code to be decoded in a more human-friendly
+ * 		printout.
+ * @offset:	For use with the NVMe error code
+ * 		NVME_SC_CONNECT_INVALID_PARAM.
+ * @cmd:	This is the SQE portion of a submission capsule.
+ * @data:	This is the "Data" portion of a submission capsule.
  */
 static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
 		int errval, int offset, struct nvme_command *cmd,
-- 
2.22.1


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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] nvme-fabrics: remove extra new lines in the switch
  2021-05-21 22:41 [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Chaitanya Kulkarni
  2021-05-21 22:41 ` [PATCH 1/4] nvme-fabrics: fix comment nvmf_log_connect_error() Chaitanya Kulkarni
@ 2021-05-21 22:41 ` Chaitanya Kulkarni
  2021-05-21 22:41 ` [PATCH 3/4] nvme-fabrics: remove extra comment Chaitanya Kulkarni
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2021-05-21 22:41 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, kbusch, sagi, Chaitanya Kulkarni

Remove the extra lines in the switch block that is not common practice
in the kernel code.

No functionality change in this patch.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/nvme/host/fabrics.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 5a1b8a1bb145..86004036bce7 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -271,7 +271,6 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
 	int err_sctype = errval & (~NVME_SC_DNR);
 
 	switch (err_sctype) {
-
 	case (NVME_SC_CONNECT_INVALID_PARAM):
 		if (offset >> 16) {
 			char *inv_data = "Connect Invalid Data Parameter";
@@ -314,24 +313,20 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
 			}
 		}
 		break;
-
 	case NVME_SC_CONNECT_INVALID_HOST:
 		dev_err(ctrl->device,
 			"Connect for subsystem %s is not allowed, hostnqn: %s\n",
 			data->subsysnqn, data->hostnqn);
 		break;
-
 	case NVME_SC_CONNECT_CTRL_BUSY:
 		dev_err(ctrl->device,
 			"Connect command failed: controller is busy or not available\n");
 		break;
-
 	case NVME_SC_CONNECT_FORMAT:
 		dev_err(ctrl->device,
 			"Connect incompatible format: %d",
 			cmd->connect.recfmt);
 		break;
-
 	default:
 		dev_err(ctrl->device,
 			"Connect command failed, error wo/DNR bit: %d\n",
-- 
2.22.1


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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] nvme-fabrics: remove extra comment
  2021-05-21 22:41 [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Chaitanya Kulkarni
  2021-05-21 22:41 ` [PATCH 1/4] nvme-fabrics: fix comment nvmf_log_connect_error() Chaitanya Kulkarni
  2021-05-21 22:41 ` [PATCH 2/4] nvme-fabrics: remove extra new lines in the switch Chaitanya Kulkarni
@ 2021-05-21 22:41 ` Chaitanya Kulkarni
  2021-05-21 22:42 ` [PATCH 4/4] nvme-fabrics: remove extra braces Chaitanya Kulkarni
  2021-05-25  7:32 ` [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Christoph Hellwig
  4 siblings, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2021-05-21 22:41 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, kbusch, sagi, Chaitanya Kulkarni

Remove the comment at the end of the switch that is not needed as
function is small enough.

No functionality change in this patch.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/nvme/host/fabrics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 86004036bce7..6bf775c7fbb9 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -332,7 +332,7 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
 			"Connect command failed, error wo/DNR bit: %d\n",
 			err_sctype);
 		break;
-	} /* switch (err_sctype) */
+	}
 }
 
 /**
-- 
2.22.1


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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] nvme-fabrics: remove extra braces
  2021-05-21 22:41 [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Chaitanya Kulkarni
                   ` (2 preceding siblings ...)
  2021-05-21 22:41 ` [PATCH 3/4] nvme-fabrics: remove extra comment Chaitanya Kulkarni
@ 2021-05-21 22:42 ` Chaitanya Kulkarni
  2021-05-25  7:32 ` [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Christoph Hellwig
  4 siblings, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2021-05-21 22:42 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, kbusch, sagi, Chaitanya Kulkarni

No need to use the braces around ~ operator.

No functionality change in this patch.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/nvme/host/fabrics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 6bf775c7fbb9..9eb88ef409fc 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -268,7 +268,7 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
 		int errval, int offset, struct nvme_command *cmd,
 		struct nvmf_connect_data *data)
 {
-	int err_sctype = errval & (~NVME_SC_DNR);
+	int err_sctype = errval & ~NVME_SC_DNR;
 
 	switch (err_sctype) {
 	case (NVME_SC_CONNECT_INVALID_PARAM):
-- 
2.22.1


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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error()
  2021-05-21 22:41 [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Chaitanya Kulkarni
                   ` (3 preceding siblings ...)
  2021-05-21 22:42 ` [PATCH 4/4] nvme-fabrics: remove extra braces Chaitanya Kulkarni
@ 2021-05-25  7:32 ` Christoph Hellwig
  4 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-05-25  7:32 UTC (permalink / raw)
  To: Chaitanya Kulkarni; +Cc: linux-nvme, hch, kbusch, sagi

Thanks,

applied to nvme-5.14.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-25  7:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 22:41 [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Chaitanya Kulkarni
2021-05-21 22:41 ` [PATCH 1/4] nvme-fabrics: fix comment nvmf_log_connect_error() Chaitanya Kulkarni
2021-05-21 22:41 ` [PATCH 2/4] nvme-fabrics: remove extra new lines in the switch Chaitanya Kulkarni
2021-05-21 22:41 ` [PATCH 3/4] nvme-fabrics: remove extra comment Chaitanya Kulkarni
2021-05-21 22:42 ` [PATCH 4/4] nvme-fabrics: remove extra braces Chaitanya Kulkarni
2021-05-25  7:32 ` [PATCH 0/4] nvme-fabrics: cleanup around nvmf_log_connect_error() Christoph Hellwig

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.