From dc14ce184c34a41f940c0524ee4e77bba85a1c0a Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 16 Nov 2021 16:55:26 +0100 Subject: [PATCH] Rename aps to apws for nvme_id_psd libnvme fixed the definition for apws. Adapt nvme-cli accordingly. See 5d14afb8dbae ("types: fix wrong bits nvme_id_psd apw[178:176], aps[183:182]") in libnvme. Signed-off-by: Daniel Wagner --- nvme-print.c | 4 ++-- plugins/virtium/virtium-nvme.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nvme-print.c b/nvme-print.c index 1c059827..6036fb9b 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -369,7 +369,7 @@ static void json_nvme_id_ctrl(struct nvme_id_ctrl *ctrl, json_object_add_value_int(psd, "active_power", le16_to_cpu(ctrl->psd[i].actp)); json_object_add_value_int(psd, "active_work_scale", - ctrl->psd[i].aps); + nvme_psd_power_scale(ctrl->psd[i].apws)); json_array_add_value_object(psds, psd); } @@ -3974,7 +3974,7 @@ static void nvme_show_id_ctrl_power(struct nvme_id_ctrl *ctrl) nvme_psd_power_scale(ctrl->psd[i].ips)); printf(" active_power:"); print_ps_power_and_scale(ctrl->psd[i].actp, - nvme_psd_power_scale(ctrl->psd[i].aps)); + nvme_psd_power_scale(ctrl->psd[i].apws)); printf("\n"); } diff --git a/plugins/virtium/virtium-nvme.c b/plugins/virtium/virtium-nvme.c index a8f1ba6f..dab2fe33 100644 --- a/plugins/virtium/virtium-nvme.c +++ b/plugins/virtium/virtium-nvme.c @@ -451,7 +451,7 @@ static void vt_build_power_state_descriptor(const struct nvme_id_ctrl *ctrl) vt_convert_data_buffer_to_hex_string(&buf[20], 4, true, s); printf("%9sh", s); - temp = ctrl->psd[i].aps; + temp = ctrl->psd[i].apws; snprintf(s, sizeof(s), "%u%u", (((unsigned char)temp >> 6) & 0x01), (((unsigned char)temp >> 7) & 0x01)); printf("%3sb", s); snprintf(s, sizeof(s), "%u%u%u", (((unsigned char)temp) & 0x01), (((unsigned char)temp >> 1) & 0x01), (((unsigned char)temp >> 2) & 0x01)); -- 2.50.1