Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6] / drivers / s390 / net / lcs.h
index 0e1e4a0..d58fea5 100644 (file)
@@ -16,11 +16,19 @@ 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 {                                       \
-       sprintf(debug_buffer, text);  \
-               debug_text_event(lcs_dbf_##name,level, debug_buffer);\
-} while (0)
+       do { \
+               if (lcs_dbf_passes(lcs_dbf_##name, level)) { \
+                       sprintf(debug_buffer, text); \
+                       debug_text_event(lcs_dbf_##name, level, debug_buffer); \
+               } \
+       } while (0)
 
 /**
  *     sysfs related stuff
@@ -138,6 +146,7 @@ enum lcs_channel_states {
        LCS_CH_STATE_RUNNING,
        LCS_CH_STATE_SUSPENDED,
        LCS_CH_STATE_CLEARED,
+       LCS_CH_STATE_ERROR,
 };
 
 /**