aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2018-03-26 22:31:29 +0000
committerConrad Meyer <cem@FreeBSD.org>2018-03-26 22:31:29 +0000
commit289b9798be1bf488e4f0a17184a300862e078867 (patch)
tree940651f44cf5b16050385ce1c34e340019fde555
parentd48315f087843aba5bc1ddff09084d0bdae646cf (diff)
downloadsrc-289b9798be1bf488e4f0a17184a300862e078867.tar.gz
src-289b9798be1bf488e4f0a17184a300862e078867.zip
OCF: CRYPTDEB(): Enhance to allow formatted logging
Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=331598
-rw-r--r--sys/opencrypto/crypto.c2
-rw-r--r--sys/opencrypto/cryptodev.h7
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index 0e3ae6965ca5..79abc050764f 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -525,7 +525,7 @@ crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int crid)
(*sid) |= (lid & 0xffffffff);
cap->cc_sessions++;
} else
- CRYPTDEB("dev newsession failed");
+ CRYPTDEB("dev newsession failed: %d", err);
} else {
CRYPTDEB("no driver");
err = EOPNOTSUPP;
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h
index ea5173af62ac..eea1a00c50b8 100644
--- a/sys/opencrypto/cryptodev.h
+++ b/sys/opencrypto/cryptodev.h
@@ -348,10 +348,11 @@ struct cryptostats {
#ifdef _KERNEL
#if 0
-#define CRYPTDEB(s) do { printf("%s:%d: %s\n", __FILE__, __LINE__, s); \
- } while (0)
+#define CRYPTDEB(s, ...) do { \
+ printf("%s:%d: " s "\n", __FILE__, __LINE__, ## __VA_ARGS__); \
+} while (0)
#else
-#define CRYPTDEB(s) do { } while (0)
+#define CRYPTDEB(...) do { } while (0)
#endif
/* Standard initialization structure beginning */