replace printk calls with pr_ macros

This commit is contained in:
ІО-23 Шмуляр Олег 2024-12-01 19:06:10 +02:00
parent 19b922d4e4
commit a64d55a819
Signed by: hasslesstech
GPG Key ID: 09745A46126DDD4C
1 changed files with 4 additions and 6 deletions

View File

@ -76,7 +76,7 @@ static struct TimingList* add_new_node(struct TimingList *tail)
static void print_time_diff(struct TimingList *node) static void print_time_diff(struct TimingList *node)
{ {
printk(KERN_EMERG "%lld\n", node->t_after - node->t_before); pr_info("%lld\n", node->t_after - node->t_before);
} }
void destroy_list(void) void destroy_list(void)
@ -98,14 +98,12 @@ void destroy_list(void)
static int __init hello_init(void) static int __init hello_init(void)
{ {
if (msg_count > 10) { if (msg_count > 10) {
printk(KERN_EMERG "Error: msg_count too large (%d > 10)\n", pr_err("Error: msg_count too large (%d > 10)\n", msg_count);
msg_count);
return -EINVAL; return -EINVAL;
} }
if (msg_count == 0 || msg_count >= 5) { if (msg_count == 0 || msg_count >= 5) {
printk(KERN_EMERG "Warning: msg_count = %d (msg_count == 0 or 5 <= msg_count <= 10)\n", pr_warn("Warning: msg_count = %d (msg_count == 0 or 5 <= msg_count <= 10)\n", msg_count);
msg_count);
} }
return 0; return 0;
@ -120,7 +118,7 @@ void print_hello(void)
current_tail = add_new_node(current_tail); current_tail = add_new_node(current_tail);
current_tail->t_before = ktime_get(); current_tail->t_before = ktime_get();
printk(KERN_EMERG "Hello, world!\n"); pr_info("Hello, world!\n");
current_tail->t_after = ktime_get(); current_tail->t_after = ktime_get();
} }
} }