summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--util/logging.h6
-rw-r--r--util/types.c2
-rw-r--r--util/types.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/util/logging.h b/util/logging.h
index 7b1814c..bf02984 100644
--- a/util/logging.h
+++ b/util/logging.h
@@ -5,6 +5,12 @@
#include <stdbool.h>
+#define print_info(...) \
+ do { \
+ if (log_level >= LOG_INFO) \
+ printf(__VA_ARGS__); \
+ } while (false)
+
extern int log_level;
int map_log_level(int verbose, bool quiet);
diff --git a/util/types.c b/util/types.c
index 376c734..20c121b 100644
--- a/util/types.c
+++ b/util/types.c
@@ -48,7 +48,7 @@ uint64_t int48_to_long(__u8 *data)
return result;
}
-static long double uint128_t_to_double(nvme_uint128_t data)
+long double uint128_t_to_double(nvme_uint128_t data)
{
long double result = 0;
int i;
diff --git a/util/types.h b/util/types.h
index 9e0806c..b2e8fc8 100644
--- a/util/types.h
+++ b/util/types.h
@@ -41,6 +41,7 @@ uint64_t int48_to_long(__u8 *data);
char *uint128_t_to_string(nvme_uint128_t val);
char *uint128_t_to_l10n_string(nvme_uint128_t val);
char *uint128_t_to_si_string(nvme_uint128_t val, __u32 bytes_per_unit);
+long double uint128_t_to_double(nvme_uint128_t data);
const char *util_uuid_to_string(unsigned char uuid[NVME_UUID_LEN]);
const char *util_fw_to_string(char *c);