diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2013-09-18 17:21:34 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-10-24 17:16:54 +0200 |
commit | 8e6a8285668b139460cc6852bfd58fdbd00c7157 (patch) | |
tree | c983ee5e0b21469e7dd67ba3ac013a8480a1da44 /drivers/s390/net | |
parent | f1d86b61fb6692c592e937dfb5069e4057855a3b (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/net')
-rw-r--r-- | drivers/s390/net/claw.h | 8 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_dbug.c | 2 | ||||
-rw-r--r-- | drivers/s390/net/lcs.h | 8 | ||||
-rw-r--r-- | drivers/s390/net/netiucv.c | 8 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 2 |
5 files changed, 5 insertions, 23 deletions
diff --git a/drivers/s390/net/claw.h b/drivers/s390/net/claw.h index 1bc5904df19f..3339b9b607b3 100644 --- a/drivers/s390/net/claw.h +++ b/drivers/s390/net/claw.h @@ -114,15 +114,9 @@ do { \ debug_event(claw_dbf_##name,level,(void*)(addr),len); \ } while (0) -/* Allow to sort out low debug levels early to avoid wasted sprints */ -static inline int claw_dbf_passes(debug_info_t *dbf_grp, int level) -{ - return (level <= dbf_grp->level); -} - #define CLAW_DBF_TEXT_(level,name,text...) \ do { \ - if (claw_dbf_passes(claw_dbf_##name, level)) { \ + if (debug_level_enabled(claw_dbf_##name, level)) { \ sprintf(debug_buffer, text); \ debug_text_event(claw_dbf_##name, level, \ debug_buffer); \ diff --git a/drivers/s390/net/ctcm_dbug.c b/drivers/s390/net/ctcm_dbug.c index 6514e1cb3f1c..8363f1c966ef 100644 --- a/drivers/s390/net/ctcm_dbug.c +++ b/drivers/s390/net/ctcm_dbug.c @@ -66,7 +66,7 @@ void ctcm_dbf_longtext(enum ctcm_dbf_names dbf_nix, int level, char *fmt, ...) char dbf_txt_buf[64]; va_list args; - if (level > (ctcm_dbf[dbf_nix].id)->level) + if (!debug_level_enabled(ctcm_dbf[dbf_nix].id, level)) return; va_start(args, fmt); vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args); diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h index 8c03392ac833..150fcb4cebc3 100644 --- a/drivers/s390/net/lcs.h +++ b/drivers/s390/net/lcs.h @@ -16,15 +16,9 @@ do { \ debug_event(lcs_dbf_##name,level,(void*)(addr),len); \ } while (0) -/* Allow to sort out low debug levels early to avoid wasted sprints */ -static inline int lcs_dbf_passes(debug_info_t *dbf_grp, int level) -{ - return (level <= dbf_grp->level); -} - #define LCS_DBF_TEXT_(level,name,text...) \ do { \ - if (lcs_dbf_passes(lcs_dbf_##name, level)) { \ + if (debug_level_enabled(lcs_dbf_##name, level)) { \ sprintf(debug_buffer, text); \ debug_text_event(lcs_dbf_##name, level, debug_buffer); \ } \ diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 279ad504ec3c..9b333fcf1a4c 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -105,15 +105,9 @@ MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf); -/* Allow to sort out low debug levels early to avoid wasted sprints */ -static inline int iucv_dbf_passes(debug_info_t *dbf_grp, int level) -{ - return (level <= dbf_grp->level); -} - #define IUCV_DBF_TEXT_(name, level, text...) \ do { \ - if (iucv_dbf_passes(iucv_dbf_##name, level)) { \ + if (debug_level_enabled(iucv_dbf_##name, level)) { \ char* __buf = get_cpu_var(iucv_dbf_txt_buf); \ sprintf(__buf, text); \ debug_text_event(iucv_dbf_##name, level, __buf); \ diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 0a328d0d11be..d7b66a28fe75 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -5096,7 +5096,7 @@ void qeth_dbf_longtext(debug_info_t *id, int level, char *fmt, ...) char dbf_txt_buf[32]; va_list args; - if (level > id->level) + if (!debug_level_enabled(id, level)) return; va_start(args, fmt); vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args); |