nvme-cli: fix compilation with GCC14
authorRosen Penev <rosenp@gmail.com>
Thu, 16 May 2024 01:32:28 +0000 (18:32 -0700)
committerRosen Penev <rosenp@gmail.com>
Fri, 17 May 2024 06:44:55 +0000 (23:44 -0700)
Wrong pointer type.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
utils/nvme-cli/Makefile
utils/nvme-cli/patches/010-gcc14.patch [new file with mode: 0644]

index 9a2ea41ffc01502958c301a009a91494c032517d..4e52be3313b87a7ccbe8c97b669f6ec68df21290 100644 (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)
diff --git a/utils/nvme-cli/patches/010-gcc14.patch b/utils/nvme-cli/patches/010-gcc14.patch
new file mode 100644 (file)
index 0000000..63bc241
--- /dev/null
@@ -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);