diff options
| author | ruki <[email protected]> | 2021-12-11 00:41:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-12-11 00:41:41 +0800 |
| commit | 349a22942e600821aa72424bbfa58f021357b1cf (patch) | |
| tree | 5df337d32f9e4dd8464becb82771dc762a04a8a2 /tests/projects/linux/driver/hello/src | |
| parent | 7908560287910061c942125db6f76884aa2e51b2 (diff) | |
improve module tests
Diffstat (limited to 'tests/projects/linux/driver/hello/src')
| -rw-r--r-- | tests/projects/linux/driver/hello/src/add.c | 3 | ||||
| -rw-r--r-- | tests/projects/linux/driver/hello/src/hello.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/tests/projects/linux/driver/hello/src/add.c b/tests/projects/linux/driver/hello/src/add.c new file mode 100644 index 000000000..59aab4983 --- /dev/null +++ b/tests/projects/linux/driver/hello/src/add.c @@ -0,0 +1,3 @@ +int add(int a, int b) { + return a + b; +} diff --git a/tests/projects/linux/driver/hello/src/hello.c b/tests/projects/linux/driver/hello/src/hello.c index 2614fb2cc..414a03bb2 100644 --- a/tests/projects/linux/driver/hello/src/hello.c +++ b/tests/projects/linux/driver/hello/src/hello.c @@ -6,9 +6,11 @@ MODULE_AUTHOR("Ruki"); MODULE_DESCRIPTION("A simple Hello World Module"); MODULE_ALIAS("a simplest module"); +int add(int a, int b); + int hello_init(void) { - printk(KERN_INFO "Hello World\n"); + printk(KERN_INFO "Hello World: %d\n", add(1, 2)); return 0; } |
