All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NVMe-CLI Fix id-ns fpi field when Human Readable option selected.
@ 2018-05-15 19:53 Jeff Lien
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Lien @ 2018-05-15 19:53 UTC (permalink / raw)


Currently when fpi = 0, the Format Progress Indicator Remaining is
100% and should be 0%.  This patch fixes that condition.

Signed-off-by: Jeff Lien <jeff.lien at wdc.com>
---
 nvme-print.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/nvme-print.c b/nvme-print.c
index d63f58d..7b65a09 100644
--- a/nvme-print.c
+++ b/nvme-print.c
@@ -569,11 +569,17 @@ static void show_nvme_id_ns_fpi(__u8 fpi)
 {
 	__u8 fpis = (fpi & 0x80) >> 7;
 	__u8 fpii = fpi & 0x7F;
+	__u8 remaining;
 	printf("  [7:7] : %#x\tFormat Progress Indicator %sSupported\n",
 		fpis, fpis ? "" : "Not ");
-	if (fpis || (!fpis && fpii))
-	printf("  [6:0] : %#x\tFormat Progress Indicator (Remaining %d%%)\n",
-		fpii, 100 - fpii);
+	if (fpis || (!fpis && fpii)) {
+		if (fpii)
+			remaining = 100 - fpii;
+		else
+			remaining = 0;
+		printf("  [6:0] : %#x\tFormat Progress Indicator (Remaining %d%%)\n",
+				fpii, remaining);
+	}
 	printf("\n");
 }
 
-- 
2.14.2.746.g8fb8a94

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

* [PATCH] NVMe-CLI Fix id-ns fpi field when Human Readable option selected.
  2018-06-21 18:58 Jeff Lien
@ 2018-06-21 20:32 ` Keith Busch
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Busch @ 2018-06-21 20:32 UTC (permalink / raw)


On Thu, Jun 21, 2018@01:58:17PM -0500, Jeff Lien wrote:
> Currently when fpi = 0, the Format Progress Indicator Remaining is
> 100% and should be 0%.  This patch fixes that condition.
> 
> Signed-off-by: Jeff Lien <jeff.lien at wdc.com>

Thanks for the catch, patch applied.

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

* [PATCH] NVMe-CLI Fix id-ns fpi field when Human Readable option selected.
@ 2018-06-21 18:58 Jeff Lien
  2018-06-21 20:32 ` Keith Busch
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Lien @ 2018-06-21 18:58 UTC (permalink / raw)


Currently when fpi = 0, the Format Progress Indicator Remaining is
100% and should be 0%.  This patch fixes that condition.

Signed-off-by: Jeff Lien <jeff.lien at wdc.com>
---
 nvme-print.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nvme-print.c b/nvme-print.c
index 4e7cb9f..25a4e03 100644
--- a/nvme-print.c
+++ b/nvme-print.c
@@ -573,7 +573,7 @@ static void show_nvme_id_ns_fpi(__u8 fpi)
 		fpis, fpis ? "" : "Not ");
 	if (fpis || (!fpis && fpii))
 	printf("  [6:0] : %#x\tFormat Progress Indicator (Remaining %d%%)\n",
-		fpii, 100 - fpii);
+		fpii, fpii);
 	printf("\n");
 }
 
-- 
2.14.2.746.g8fb8a94

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

end of thread, other threads:[~2018-06-21 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15 19:53 [PATCH] NVMe-CLI Fix id-ns fpi field when Human Readable option selected Jeff Lien
2018-06-21 18:58 Jeff Lien
2018-06-21 20:32 ` Keith Busch

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.