[PATCH] Input: i8042 - cleanup of debug code (was Re: 2.6.22-rc2-mm1)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(some irrelevant CCs dropped)

On Wed, 23 May 2007, Dmitry Torokhov wrote:

> It looks like you are now in the same position I was some time ago WRT 
> to debug information for i8042 - constantly asking people to enable 
> debug, recompile and send the results. May I recommend changing 
> CONFIG_HID_DEBUG to "default y if !EMBEDDED" and controlling debug 
> output via a module parameter? -ENOPATCH though...

Hi Dmitry,

I have just queued corresponding patch in HID tree.

BTW when looking at the i8042 code I have just noticed that the trivial 
cleanup below could be possible.



From: Jiri Kosina <[email protected]>

Input: i8042 - cleanup of debug code
    
Debugging facility of i8042 is now toggled in runtime instead
of needing to recompile the kernel. Therefore the DEBUG macro
is useless (it's hardcoded to be defined anyway). Remove it.
    
Signed-off-by: Jiri Kosina <[email protected]>

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 3888dc3..5c3405d 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -69,12 +69,9 @@ module_param_named(nopnp, i8042_nopnp, b
 MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings");
 #endif
 
-#define DEBUG
-#ifdef DEBUG
 static int i8042_debug;
 module_param_named(debug, i8042_debug, bool, 0600);
 MODULE_PARM_DESC(debug, "Turn i8042 debugging mode on and off");
-#endif
 
 #include "i8042.h"
 
diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
index b3eb7a7..eec4b32 100644
--- a/drivers/input/serio/i8042.h
+++ b/drivers/input/serio/i8042.h
@@ -106,7 +106,6 @@
  * Debug.
  */
 
-#ifdef DEBUG
 static unsigned long i8042_start_time;
 #define dbg_init() do { i8042_start_time = jiffies; } while (0)
 #define dbg(format, arg...) 							\
@@ -115,9 +114,4 @@ static unsigned long i8042_start_time;
 			printk(KERN_DEBUG __FILE__ ": " format " [%d]\n" ,	\
 	 			## arg, (int) (jiffies - i8042_start_time));	\
 	} while (0)
-#else
-#define dbg_init() do { } while (0)
-#define dbg(format, arg...) do {} while (0)
-#endif
-
 #endif /* _I8042_H */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux