From 2822061d0e17d5acdbc46740b535021115f11071 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 9 Nov 2024 09:09:56 +0100 Subject: Adding upstream version 2.11. Signed-off-by: Daniel Baumann --- util/logging.h | 6 ++++++ util/types.c | 2 +- util/types.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'util') 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 +#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); -- cgit v1.2.3