From fb0e3235eaf76fcfcede7a0f132d2d7a117f112e Mon Sep 17 00:00:00 2001 From: Ryan Libby Date: Fri, 30 Jun 2017 22:01:18 +0000 Subject: [PATCH] g_virstor.h: macro parenthesization Build with gcc -Wint-in-bool-context revealed a macro parenthesization error (invoking LOG_MSG with a ternary expression for lvl). Reviewed by: markj Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential revision: https://reviews.freebsd.org/D11411 --- sys/geom/virstor/g_virstor.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/geom/virstor/g_virstor.h b/sys/geom/virstor/g_virstor.h index 062ca94eb57..a6b181380ee 100644 --- a/sys/geom/virstor/g_virstor.h +++ b/sys/geom/virstor/g_virstor.h @@ -48,8 +48,8 @@ struct virstor_map_entry { #define LOG_MSG(lvl, ...) do { \ if (g_virstor_debug >= (lvl)) { \ printf("GEOM_" G_VIRSTOR_CLASS_NAME); \ - if (lvl > 0) \ - printf("[%u]", lvl); \ + if ((lvl) > 0) \ + printf("[%u]", (lvl)); \ printf(": "); \ printf(__VA_ARGS__); \ printf("\n"); \ @@ -60,8 +60,8 @@ struct virstor_map_entry { #define LOG_REQ(lvl, bp, ...) do { \ if (g_virstor_debug >= (lvl)) { \ printf("GEOM_" G_VIRSTOR_CLASS_NAME); \ - if (lvl > 0) \ - printf("[%u]", lvl); \ + if ((lvl) > 0) \ + printf("[%u]", (lvl)); \ printf(": "); \ printf(__VA_ARGS__); \ printf(" "); \