]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Rename aps to apws for nvme_id_psd
authorDaniel Wagner <dwagner@suse.de>
Tue, 16 Nov 2021 15:55:26 +0000 (16:55 +0100)
committerDaniel Wagner <dwagner@suse.de>
Tue, 16 Nov 2021 16:01:09 +0000 (17:01 +0100)
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 <dwagner@suse.de>
nvme-print.c
plugins/virtium/virtium-nvme.c

index 1c0598277e5fe51d0f33d91a458df7a1dd8e3159..6036fb9ba6d711922d05357dd3d5715069ef82cd 100644 (file)
@@ -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");
 
        }
index a8f1ba6f54ac3f058c8ef10592dfc268062fe284..dab2fe33ec464834cdf630ae562389839526b126 100644 (file)
@@ -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));