summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-05-07 07:25:47 +0000
committertrasz <trasz@FreeBSD.org>2014-05-07 07:25:47 +0000
commit69dfd86371c12b769288cfc9c565967ecd862a58 (patch)
tree17ef4eef86cff61ae271464a66631c7b97614a1d /sys/cam
parent91f13dce9c9f9d780bcdb49fb3e3f839c786b31a (diff)
downloadFreeBSD-src-69dfd86371c12b769288cfc9c565967ecd862a58.zip
FreeBSD-src-69dfd86371c12b769288cfc9c565967ecd862a58.tar.gz
MFC r263740:
Use a less unusual syntax in debug printfs. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ctl/ctl_frontend_iscsi.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c
index ca5ade6..b58519a 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN,
&maxcmdsn_delta, 256, "Number of commands the initiator can send "
"without confirmation");
-#define CFISCSI_DEBUG(X, ...) \
- if (debug > 1) { \
- printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
+#define CFISCSI_DEBUG(X, ...) \
+ do { \
+ if (debug > 1) { \
+ printf("%s: " X "\n", \
+ __func__, ## __VA_ARGS__); \
+ } \
} while (0)
-#define CFISCSI_WARN(X, ...) \
- if (debug > 0) { \
- printf("WARNING: %s: " X "\n", \
- __func__, ## __VA_ARGS__); \
+#define CFISCSI_WARN(X, ...) \
+ do { \
+ if (debug > 0) { \
+ printf("WARNING: %s: " X "\n", \
+ __func__, ## __VA_ARGS__); \
+ } \
} while (0)
-#define CFISCSI_SESSION_DEBUG(S, X, ...) \
- if (debug > 1) { \
- printf("%s: %s (%s): " X "\n", \
- __func__, S->cs_initiator_addr, \
- S->cs_initiator_name, ## __VA_ARGS__); \
+#define CFISCSI_SESSION_DEBUG(S, X, ...) \
+ do { \
+ if (debug > 1) { \
+ printf("%s: %s (%s): " X "\n", \
+ __func__, S->cs_initiator_addr, \
+ S->cs_initiator_name, ## __VA_ARGS__); \
+ } \
} while (0)
-#define CFISCSI_SESSION_WARN(S, X, ...) \
- if (debug > 0) { \
- printf("WARNING: %s (%s): " X "\n", \
- S->cs_initiator_addr, \
- S->cs_initiator_name, ## __VA_ARGS__); \
+#define CFISCSI_SESSION_WARN(S, X, ...) \
+ do { \
+ if (debug > 0) { \
+ printf("WARNING: %s (%s): " X "\n", \
+ S->cs_initiator_addr, \
+ S->cs_initiator_name, ## __VA_ARGS__); \
+ } \
} while (0)
#define CFISCSI_SESSION_LOCK(X) mtx_lock(&X->cs_lock)
OpenPOWER on IntegriCloud