diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-09 08:09:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-09 08:09:56 +0000 |
commit | 2822061d0e17d5acdbc46740b535021115f11071 (patch) | |
tree | 8c14f8690f3689562c5fd1d550e1883629ced2a8 /util | |
parent | Adding upstream version 2.10.2. (diff) | |
download | nvme-cli-upstream.tar.xz nvme-cli-upstream.zip |
Adding upstream version 2.11.upstream/2.11upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | util/logging.h | 6 | ||||
-rw-r--r-- | util/types.c | 2 | ||||
-rw-r--r-- | util/types.h | 1 |
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); |