Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit fdee153

Browse files
committed
Start moving to 2018-style macros
1 parent 2874dd4 commit fdee153

File tree

5 files changed

+8
-14
lines changed

5 files changed

+8
-14
lines changed

hello-world/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ extern crate alloc;
55
use alloc::borrow::ToOwned;
66
use alloc::string::String;
77

8-
#[macro_use]
9-
extern crate linux_kernel_module;
8+
use linux_kernel_module;
109

1110
struct HelloWorldModule {
1211
message: String,
@@ -28,7 +27,7 @@ impl Drop for HelloWorldModule {
2827
}
2928
}
3029

31-
kernel_module!(
30+
linux_kernel_module::kernel_module!(
3231
HelloWorldModule,
3332
author: "Alex Gaynor and Geoffrey Thomas",
3433
description: "An extremely simple kernel module",

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#[macro_use]
55
extern crate alloc;
6-
#[macro_use]
76
extern crate bitflags;
87

98
use core::panic::PanicInfo;
@@ -14,7 +13,6 @@ mod c_types;
1413
pub mod chrdev;
1514
mod error;
1615
pub mod filesystem;
17-
#[macro_use]
1816
pub mod printk;
1917
pub mod sysctl;
2018
mod types;

tests/chrdev/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#![no_std]
22
#![feature(const_str_as_bytes)]
33

4-
#[macro_use]
5-
extern crate linux_kernel_module;
4+
use linux_kernel_module;
65

76
struct ChrdevTestModule {
87
_dev: linux_kernel_module::chrdev::DeviceNumberRegion,
@@ -19,7 +18,7 @@ impl linux_kernel_module::KernelModule for ChrdevTestModule {
1918
}
2019
}
2120

22-
kernel_module!(
21+
linux_kernel_module::kernel_module!(
2322
ChrdevTestModule,
2423
author: "Alex Gaynor and Geoffrey Thomas",
2524
description: "A module for testing character devices",

tests/printk/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#![no_std]
22
#![feature(const_str_as_bytes)]
33

4-
#[macro_use]
5-
extern crate linux_kernel_module;
4+
use linux_kernel_module;
65

76
struct PrintkTestModule;
87

@@ -16,7 +15,7 @@ impl linux_kernel_module::KernelModule for PrintkTestModule {
1615
}
1716
}
1817

19-
kernel_module!(
18+
linux_kernel_module::kernel_module!(
2019
PrintkTestModule,
2120
author: "Alex Gaynor and Geoffrey Thomas",
2221
description: "A module for testing println!()",

tests/sysctl/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
use core::sync::atomic::AtomicBool;
55

6-
#[macro_use]
7-
extern crate linux_kernel_module;
6+
use linux_kernel_module;
87

98
use linux_kernel_module::sysctl::Sysctl;
109
use linux_kernel_module::Mode;
@@ -33,7 +32,7 @@ impl linux_kernel_module::KernelModule for SysctlTestModule {
3332
}
3433
}
3534

36-
kernel_module!(
35+
linux_kernel_module::kernel_module!(
3736
SysctlTestModule,
3837
author: "Alex Gaynor and Geoffrey Thomas",
3938
description: "A module for testing sysctls",

0 commit comments

Comments
 (0)