summaryrefslogtreecommitdiffstats
path: root/main.h
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2013-02-01 02:48:49 -0600
committerKyle Kaminski <kyle@kkaminsk.com>2013-02-01 02:48:49 -0600
commit2a64bd55f015dde0b32c752377d5820d9d280873 (patch)
tree31d3ca4c80d1ad63ab0b1985577bcd6231dcf2c8 /main.h
parent20c1a6d14c9447b87394221fa42a0e85aca1b060 (diff)
downloadkernelhello-2a64bd55f015dde0b32c752377d5820d9d280873.tar.gz
kernelhello-2a64bd55f015dde0b32c752377d5820d9d280873.tar.bz2
kernelhello-2a64bd55f015dde0b32c752377d5820d9d280873.zip
fix improper ptr check, fix offset calc, ratelimit printk messages
Diffstat (limited to 'main.h')
-rw-r--r--main.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.h b/main.h
index cb751d0..e2727db 100644
--- a/main.h
+++ b/main.h
@@ -9,8 +9,12 @@
*/
#ifdef HELLO_DEBUG
#define PDEBUG(fmt, args...) printk( KERN_DEBUG "[hello] " fmt, ##args)
+ #define PRDEBUG(fmt, args...) if (printk_ratelimit()) \
+ printk( KERN_DEBUG "[hello] " fmt, ##args)
#else
- #define PDEBUG(fmt, args...) /* not debugging: nothing */
+ /* not debugging: nothing */
+ #define PDEBUG(fmt, args...)
+ #define PRDEBUG(fmt, args...)
#endif
#ifndef HELLO_MAJOR