summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
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/dev/iscsi
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/dev/iscsi')
-rw-r--r--sys/dev/iscsi/icl.c17
-rw-r--r--sys/dev/iscsi/iscsi.c41
2 files changed, 34 insertions, 24 deletions
diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c
index 5d203d8..9fa6951 100644
--- a/sys/dev/iscsi/icl.c
+++ b/sys/dev/iscsi/icl.c
@@ -86,15 +86,18 @@ static uma_zone_t icl_pdu_zone;
static volatile u_int icl_ncons;
-#define ICL_DEBUG(X, ...) \
- if (debug > 1) { \
- printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
+#define ICL_DEBUG(X, ...) \
+ do { \
+ if (debug > 1) \
+ printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
} while (0)
-#define ICL_WARN(X, ...) \
- if (debug > 0) { \
- printf("WARNING: %s: " X "\n", \
- __func__, ## __VA_ARGS__); \
+#define ICL_WARN(X, ...) \
+ do { \
+ if (debug > 0) { \
+ printf("WARNING: %s: " X "\n", \
+ __func__, ## __VA_ARGS__); \
+ } \
} while (0)
#define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock)
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index e97fdf7..1e21421 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -99,29 +99,36 @@ static uma_zone_t iscsi_outstanding_zone;
#define CONN_SESSION(X) ((struct iscsi_session *)X->ic_prv0)
#define PDU_SESSION(X) (CONN_SESSION(X->ip_conn))
-#define ISCSI_DEBUG(X, ...) \
- if (debug > 1) { \
- printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
+#define ISCSI_DEBUG(X, ...) \
+ do { \
+ if (debug > 1) \
+ printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
} while (0)
-#define ISCSI_WARN(X, ...) \
- if (debug > 0) { \
- printf("WARNING: %s: " X "\n", \
- __func__, ## __VA_ARGS__); \
+#define ISCSI_WARN(X, ...) \
+ do { \
+ if (debug > 0) { \
+ printf("WARNING: %s: " X "\n", \
+ __func__, ## __VA_ARGS__); \
+ } \
} while (0)
-#define ISCSI_SESSION_DEBUG(S, X, ...) \
- if (debug > 1) { \
- printf("%s: %s (%s): " X "\n", \
- __func__, S->is_conf.isc_target_addr, \
- S->is_conf.isc_target, ## __VA_ARGS__); \
+#define ISCSI_SESSION_DEBUG(S, X, ...) \
+ do { \
+ if (debug > 1) { \
+ printf("%s: %s (%s): " X "\n", \
+ __func__, S->is_conf.isc_target_addr, \
+ S->is_conf.isc_target, ## __VA_ARGS__); \
+ } \
} while (0)
-#define ISCSI_SESSION_WARN(S, X, ...) \
- if (debug > 0) { \
- printf("WARNING: %s (%s): " X "\n", \
- S->is_conf.isc_target_addr, \
- S->is_conf.isc_target, ## __VA_ARGS__); \
+#define ISCSI_SESSION_WARN(S, X, ...) \
+ do { \
+ if (debug > 0) { \
+ printf("WARNING: %s (%s): " X "\n", \
+ S->is_conf.isc_target_addr, \
+ S->is_conf.isc_target, ## __VA_ARGS__); \
+ } \
} while (0)
#define ISCSI_SESSION_LOCK(X) mtx_lock(&X->is_lock)
OpenPOWER on IntegriCloud