From: root Date: Wed, 22 Jun 2016 20:37:26 +0000 (-0700) Subject: In set_feature: print value instead of status X-Git-Tag: v0.8~2^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e5a7d0902aad962b305ab3344c49cc1b0a850a8b;p=users%2Fsagi%2Fnvme-cli.git In set_feature: print value instead of status In nvme_feature_show_fields: Correct printed output of Arbitration Burst --- diff --git a/nvme-print.c b/nvme-print.c index 3dd099ab..9a3673fd 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -1039,7 +1039,11 @@ void nvme_feature_show_fields(__u32 fid, unsigned int result, unsigned char *buf printf("\tHigh Priority Weight (HPW): %u\n", ((result & 0xff000000) >> 24) + 1); printf("\tMedium Priority Weight (MPW): %u\n", ((result & 0x00ff0000) >> 16) + 1); printf("\tLow Priority Weight (LPW): %u\n", ((result & 0x0000ff00) >> 8) + 1); - printf("\tArbitration Burst (AB): %u\n", 1 << (result & 0x00000007)); + printf("\tArbitration Burst (AB): "); + if ((result & 0x00000007) == 7) + printf("No limit\n"); + else + printf("%u\n", 1 << (result & 0x00000007)); break; case NVME_FEAT_POWER_MGMT: field = (result & 0x000000E0) >> 5; diff --git a/nvme.c b/nvme.c index 690a2134..8e616245 100644 --- a/nvme.c +++ b/nvme.c @@ -1504,7 +1504,7 @@ static int set_feature(int argc, char **argv, struct command *cmd, struct plugin } if (!err) { printf("set-feature:%02x (%s), value:%#08x\n", cfg.feature_id, - nvme_feature_to_string(cfg.feature_id), result); + nvme_feature_to_string(cfg.feature_id), cfg.value); if (buf) { if (cfg.feature_id == NVME_FEAT_LBA_RANGE) show_lba_range((struct nvme_lba_range_type *)buf,