* [PATCH 1/2] nvmet: Use nvmet_is_port_enabled helper for pi_enable
@ 2021-01-07 15:34 Israel Rukshin
2021-01-07 15:34 ` [PATCH 2/2] nvmet: Fix nvmet_is_port_enabled indentation Israel Rukshin
2021-01-12 8:26 ` [PATCH 1/2] nvmet: Use nvmet_is_port_enabled helper for pi_enable Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Israel Rukshin @ 2021-01-07 15:34 UTC (permalink / raw)
To: Linux-nvme
Cc: Max Gurtovoy, Israel Rukshin, Nitzan Carmi, Christoph Hellwig,
Sagi Grimberg
Remove code duplication.
Signed-off-by: Israel Rukshin <israelr@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
drivers/nvme/target/configfs.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index c61ffd767062..b2021bf6cee5 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -266,10 +266,8 @@ static ssize_t nvmet_param_pi_enable_store(struct config_item *item,
if (strtobool(page, &val))
return -EINVAL;
- if (port->enabled) {
- pr_err("Disable port before setting pi_enable value.\n");
+ if (nvmet_is_port_enabled(port, __func__))
return -EACCES;
- }
port->pi_enable = val;
return count;
--
2.18.2
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] nvmet: Fix nvmet_is_port_enabled indentation
2021-01-07 15:34 [PATCH 1/2] nvmet: Use nvmet_is_port_enabled helper for pi_enable Israel Rukshin
@ 2021-01-07 15:34 ` Israel Rukshin
2021-01-12 8:26 ` [PATCH 1/2] nvmet: Use nvmet_is_port_enabled helper for pi_enable Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Israel Rukshin @ 2021-01-07 15:34 UTC (permalink / raw)
To: Linux-nvme
Cc: Max Gurtovoy, Israel Rukshin, Nitzan Carmi, Christoph Hellwig,
Sagi Grimberg
Remove extra tab.
Signed-off-by: Israel Rukshin <israelr@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
drivers/nvme/target/configfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index b2021bf6cee5..635a7cb45d0b 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -45,7 +45,7 @@ static bool nvmet_is_port_enabled(struct nvmet_port *p, const char *caller)
{
if (p->enabled)
pr_err("Disable port '%u' before changing attribute in %s\n",
- le16_to_cpu(p->disc_addr.portid), caller);
+ le16_to_cpu(p->disc_addr.portid), caller);
return p->enabled;
}
--
2.18.2
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] nvmet: Use nvmet_is_port_enabled helper for pi_enable
2021-01-07 15:34 [PATCH 1/2] nvmet: Use nvmet_is_port_enabled helper for pi_enable Israel Rukshin
2021-01-07 15:34 ` [PATCH 2/2] nvmet: Fix nvmet_is_port_enabled indentation Israel Rukshin
@ 2021-01-12 8:26 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-01-12 8:26 UTC (permalink / raw)
To: Israel Rukshin
Cc: Max Gurtovoy, Nitzan Carmi, Christoph Hellwig, Linux-nvme,
Sagi Grimberg
Thanks,
applied to nvme-5.11.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-12 8:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-07 15:34 [PATCH 1/2] nvmet: Use nvmet_is_port_enabled helper for pi_enable Israel Rukshin
2021-01-07 15:34 ` [PATCH 2/2] nvmet: Fix nvmet_is_port_enabled indentation Israel Rukshin
2021-01-12 8:26 ` [PATCH 1/2] nvmet: Use nvmet_is_port_enabled helper for pi_enable Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox