diff --git a/hello1.c b/hello1.c index d72a526..8d2487f 100644 --- a/hello1.c +++ b/hello1.c @@ -46,7 +46,7 @@ struct TimingList { static struct TimingList *tl_head; -static struct TimingList* write_first_node(void) +static struct TimingList *write_first_node(void) { tl_head = kmalloc(sizeof(struct TimingList), GFP_KERNEL); tl_head->next = NULL; @@ -54,7 +54,7 @@ static struct TimingList* write_first_node(void) return tl_head; } -static struct TimingList* insert_next_node(struct TimingList *tail) +static struct TimingList *insert_next_node(struct TimingList *tail) { struct TimingList *new_tl_node = kmalloc(sizeof(struct TimingList), GFP_KERNEL); @@ -65,7 +65,7 @@ static struct TimingList* insert_next_node(struct TimingList *tail) return new_tl_node; } -static struct TimingList* add_new_node(struct TimingList *tail) +static struct TimingList *add_new_node(struct TimingList *tail) { if (tail == NULL) return write_first_node(); @@ -93,6 +93,7 @@ void destroy_list(void) curr_tl = next_tl; } } +EXPORT_SYMBOL(destroy_list); static int __init hello_init(void) { @@ -112,14 +113,13 @@ void print_hello(int msg_count) current_tail->t_after = ktime_get(); } } +EXPORT_SYMBOL(print_hello); static void __exit hello_exit(void) { destroy_list(); } -EXPORT_SYMBOL(print_hello); -EXPORT_SYMBOL(destroy_list); module_init(hello_init); module_exit(hello_exit); diff --git a/hello2.c b/hello2.c index 834606f..5315fc0 100644 --- a/hello2.c +++ b/hello2.c @@ -49,9 +49,8 @@ static int __init hello_init(void) return -EINVAL; } - if (msg_count == 0 || msg_count >= 5) { + if (msg_count == 0 || msg_count >= 5) pr_warn("Warning: msg_count = %d (msg_count == 0 or 5 <= msg_count <= 10)\n", msg_count); - } print_hello(msg_count); return 0; diff --git a/inc/hello1.h b/inc/hello1.h index aed9048..678cfb8 100644 --- a/inc/hello1.h +++ b/inc/hello1.h @@ -1,2 +1,2 @@ -void print_hello(int); +void print_hello(int msg_count); void destroy_list(void);