|
|
Subscribe / Log in / New account

Driver porting: hello world

Driver porting: hello world

Posted Jul 15, 2004 11:37 UTC (Thu) by littertiger (guest, #22470)
Parent article: Driver porting: hello world

I don't know what the "KERN_INFO" means in the example.
if write like that, there are compiling errors.


to post comments

Driver porting: hello world

Posted Jul 28, 2004 9:28 UTC (Wed) by PsychoJamin (guest, #23518) [Link]

KERN_INFO is part of a macro defined in <linux/kernel.h>

It replaces the need for <0> .. <7> in printk messages which specifies the priority of the message. Where 0 is the highest priority and 7 is the lowest.

As these are macros there is no need for a ',' between it ans the rest of the printk parameter. ie printk(KERN_INFO "Hello\n"); not printk(KERN_INFO, "Hello\n");

The definietions are as follows:

#define KERN_EMERG "<0>" /* system is unusable */
#define KERN_ALERT "<1>" /* action must be taken immediately */
#define KERN_CRIT "<2>" /* critical conditions */
#define KERN_ERR "<3>" /* error conditions */
#define KERN_WARNING "<4>" /* warning conditions */
#define KERN_NOTICE "<5>" /* normal but significant condition */
#define KERN_INFO "<6>" /* informational */
#define KERN_DEBUG "<7>" /* debug-level messages */


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds