svn commit: r265505 - in stable/10/sys: cam/ctl dev/iscsi
Edward Tomasz Napierala
trasz at FreeBSD.org
Wed May 7 07:25:48 UTC 2014
Author: trasz
Date: Wed May 7 07:25:47 2014
New Revision: 265505
URL: http://svnweb.freebsd.org/changeset/base/265505
Log:
MFC r263740:
Use a less unusual syntax in debug printfs.
Sponsored by: The FreeBSD Foundation
Modified:
stable/10/sys/cam/ctl/ctl_frontend_iscsi.c
stable/10/sys/dev/iscsi/icl.c
stable/10/sys/dev/iscsi/iscsi.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:20:02 2014 (r265504)
+++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed May 7 07:25:47 2014 (r265505)
@@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO
&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)
Modified: stable/10/sys/dev/iscsi/icl.c
==============================================================================
--- stable/10/sys/dev/iscsi/icl.c Wed May 7 07:20:02 2014 (r265504)
+++ stable/10/sys/dev/iscsi/icl.c Wed May 7 07:25:47 2014 (r265505)
@@ -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)
Modified: stable/10/sys/dev/iscsi/iscsi.c
==============================================================================
--- stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:20:02 2014 (r265504)
+++ stable/10/sys/dev/iscsi/iscsi.c Wed May 7 07:25:47 2014 (r265505)
@@ -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)
More information about the svn-src-stable
mailing list