LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   wrapper_printk (https://www.linuxquestions.org/questions/linux-newbie-8/wrapper_printk-917662/)

GNakul 12-07-2011 11:12 PM

wrapper_printk
 
Hi all,

Please post a example wrapper for printk. I have to use that wrapper instead of printk in my kernel code.
like instead of putting
if(sync_thread_log)
printk("sync_reqest was called\n"); everywhere in the code, i will just call the wrapper function.

Kindly help. I dont know how to write wrapper functions.


Thanks
-Nakul.

kbp 12-08-2011 04:52 PM

I'm not sure how you intend to make printk any shorter, unless you had other things you needed to do like :

Code:

errorhandler( char * msg){
  // do some stuff
  // do some more stuff
  printk(msg);
}


...
errorHandler("Foo failed");
...



All times are GMT -5. The time now is 11:16 PM.