aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2013-09-18 11:21:34 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-10-24 11:16:54 -0400
commit8e6a8285668b139460cc6852bfd58fdbd00c7157 (patch)
treec983ee5e0b21469e7dd67ba3ac013a8480a1da44 /drivers/s390/crypto
parentf1d86b61fb6692c592e937dfb5069e4057855a3b (diff)
s390/s390dbf: use debug_level_enabled() where applicable
Refactor direct debug level comparisons with the (internal) s390db->level member. Use the debug_level_enabled() function instead. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto')
-rw-r--r--drivers/s390/crypto/zcrypt_debug.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/s390/crypto/zcrypt_debug.h b/drivers/s390/crypto/zcrypt_debug.h
index 841ea72e4a4e..28d9349de1ad 100644
--- a/drivers/s390/crypto/zcrypt_debug.h
+++ b/drivers/s390/crypto/zcrypt_debug.h
@@ -11,12 +11,6 @@
11/* that gives us 15 characters in the text event views */ 11/* that gives us 15 characters in the text event views */
12#define ZCRYPT_DBF_LEN 16 12#define ZCRYPT_DBF_LEN 16
13 13
14/* sort out low debug levels early to avoid wasted sprints */
15static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
16{
17 return (level <= dbf_grp->level);
18}
19
20#define DBF_ERR 3 /* error conditions */ 14#define DBF_ERR 3 /* error conditions */
21#define DBF_WARN 4 /* warning conditions */ 15#define DBF_WARN 4 /* warning conditions */
22#define DBF_INFO 6 /* informational */ 16#define DBF_INFO 6 /* informational */
@@ -25,7 +19,7 @@ static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
25 19
26#define ZCRYPT_DBF_COMMON(level, text...) \ 20#define ZCRYPT_DBF_COMMON(level, text...) \
27 do { \ 21 do { \
28 if (zcrypt_dbf_passes(zcrypt_dbf_common, level)) { \ 22 if (debug_level_enabled(zcrypt_dbf_common, level)) { \
29 char debug_buffer[ZCRYPT_DBF_LEN]; \ 23 char debug_buffer[ZCRYPT_DBF_LEN]; \
30 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \ 24 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
31 debug_text_event(zcrypt_dbf_common, level, \ 25 debug_text_event(zcrypt_dbf_common, level, \
@@ -35,7 +29,7 @@ static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
35 29
36#define ZCRYPT_DBF_DEVICES(level, text...) \ 30#define ZCRYPT_DBF_DEVICES(level, text...) \
37 do { \ 31 do { \
38 if (zcrypt_dbf_passes(zcrypt_dbf_devices, level)) { \ 32 if (debug_level_enabled(zcrypt_dbf_devices, level)) { \
39 char debug_buffer[ZCRYPT_DBF_LEN]; \ 33 char debug_buffer[ZCRYPT_DBF_LEN]; \
40 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \ 34 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
41 debug_text_event(zcrypt_dbf_devices, level, \ 35 debug_text_event(zcrypt_dbf_devices, level, \
@@ -45,7 +39,7 @@ static inline int zcrypt_dbf_passes(debug_info_t *dbf_grp, int level)
45 39
46#define ZCRYPT_DBF_DEV(level, device, text...) \ 40#define ZCRYPT_DBF_DEV(level, device, text...) \
47 do { \ 41 do { \
48 if (zcrypt_dbf_passes(device->dbf_area, level)) { \ 42 if (debug_level_enabled(device->dbf_area, level)) { \
49 char debug_buffer[ZCRYPT_DBF_LEN]; \ 43 char debug_buffer[ZCRYPT_DBF_LEN]; \
50 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \ 44 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
51 debug_text_event(device->dbf_area, level, \ 45 debug_text_event(device->dbf_area, level, \