nvme-cli: fix compilation with GCC14

Wrong pointer type.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2024-05-15 18:32:28 -07:00
parent 5bce0b09e6
commit e2a3f6e340
2 changed files with 29 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nvme-cli
PKG_VERSION:=2.5
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/linux-nvme/nvme-cli/archive/refs/tags/v$(PKG_VERSION)

View File

@@ -0,0 +1,28 @@
--- a/plugins/virtium/virtium-nvme.c
+++ b/plugins/virtium/virtium-nvme.c
@@ -32,14 +32,14 @@ static char vt_default_log_file_name[256
struct vtview_log_header {
char path[256];
char test_name[256];
- long time_stamp;
+ time_t time_stamp;
struct nvme_id_ctrl raw_ctrl;
struct nvme_firmware_slot raw_fw;
};
struct vtview_smart_log_entry {
char path[256];
- long time_stamp;
+ time_t time_stamp;
struct nvme_id_ns raw_ns;
struct nvme_id_ctrl raw_ctrl;
struct nvme_smart_log raw_smart;
@@ -127,7 +127,7 @@ static void vt_convert_smart_data_to_hum
capacity = le64_to_cpu(smart->raw_ns.nsze) * lba;
- snprintf(tempbuff, sizeof(tempbuff), "log;%s;%lu;%s;%s;%-.*s;", smart->raw_ctrl.sn, smart->time_stamp, smart->path,
+ snprintf(tempbuff, sizeof(tempbuff), "log;%s;%" PRId64 ";%s;%s;%-.*s;", smart->raw_ctrl.sn, smart->time_stamp, smart->path,
smart->raw_ctrl.mn, (int)sizeof(smart->raw_ctrl.fr), smart->raw_ctrl.fr);
strcpy(text, tempbuff);
snprintf(tempbuff, sizeof(tempbuff), "Capacity;%lf;", capacity / 1000000000);