Skip to content

Commit 724836d

Browse files
committed
nvme: do not output debug infos on info level
Do not clutter the info message level with debug information. Signed-off-by: Daniel Wagner <wagi@kernel.org>
1 parent 569c767 commit 724836d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

nvme.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ static int open_blkdev_direct(char *dev, int flags, __u32 nsid)
330330

331331
if (blkdev) {
332332
fd = open(blkdev, flags);
333-
print_info("blkdev: %s, fd: %d\n", blkdev, fd);
333+
print_debug("blkdev: %s, fd: %d\n", blkdev, fd);
334334
}
335335

336336
if (fd < 0) {
337337
fd = open(dev, flags);
338-
print_info("dev: %s, fd: %d\n", dev, fd);
338+
print_debug("dev: %s, fd: %d\n", dev, fd);
339339
}
340340

341341
return fd;

util/logging.h

+10-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55

66
#include <stdbool.h>
77

8-
#define print_info(...) \
9-
do { \
10-
if (log_level >= LOG_INFO) \
11-
printf(__VA_ARGS__); \
8+
#define print_info(...) \
9+
do { \
10+
if (log_level >= LOG_INFO) \
11+
printf(__VA_ARGS__); \
12+
} while (false)
13+
14+
#define print_debug(...) \
15+
do { \
16+
if (log_level >= LOG_DEBUG) \
17+
printf(__VA_ARGS__); \
1218
} while (false)
1319

1420
extern int log_level;

0 commit comments

Comments
 (0)