summaryrefslogtreecommitdiffstats
path: root/plugins/solidigm/solidigm-telemetry
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-04 12:52:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-04 12:52:51 +0000
commit7552ed51f78ca1ad311228f76e90cf8c120ee2f6 (patch)
treedec5ce8e28f081567cb33c77a178bcac6dd76169 /plugins/solidigm/solidigm-telemetry
parentAdding upstream version 2.5. (diff)
downloadnvme-cli-7552ed51f78ca1ad311228f76e90cf8c120ee2f6.tar.xz
nvme-cli-7552ed51f78ca1ad311228f76e90cf8c120ee2f6.zip
Adding upstream version 2.6.upstream/2.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/solidigm/solidigm-telemetry')
-rw-r--r--plugins/solidigm/solidigm-telemetry/nlog.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/solidigm/solidigm-telemetry/nlog.c b/plugins/solidigm/solidigm-telemetry/nlog.c
index 43b8918..926772b 100644
--- a/plugins/solidigm/solidigm-telemetry/nlog.c
+++ b/plugins/solidigm/solidigm-telemetry/nlog.c
@@ -8,15 +8,16 @@
#include "nlog.h"
#include "config.h"
#include <string.h>
-#include <math.h>
#include <stdio.h>
+#include "ccan/ilog/ilog.h"
+
#define LOG_ENTRY_HEADER_SIZE 1
#define LOG_ENTRY_TIMESTAMP_SIZE 2
#define LOG_ENTRY_NUM_ARGS_MAX 8
#define LOG_ENTRY_MAX_SIZE (LOG_ENTRY_HEADER_SIZE + LOG_ENTRY_TIMESTAMP_SIZE + \
LOG_ENTRY_NUM_ARGS_MAX)
-#define NUM_ARGS_MASK ((1 << ((int)log2(LOG_ENTRY_NUM_ARGS_MAX)+1)) - 1)
+#define NUM_ARGS_MASK ((1 << ((int)STATIC_ILOG_32(LOG_ENTRY_NUM_ARGS_MAX))) - 1)
#define MAX_HEADER_MISMATCH_TRACK 10
static int formats_find(struct json_object *formats, uint32_t val, struct json_object **format)