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

Commit 6b92658

Browse files
committed
Mark modinfo variables #[used] (fixes #251)
1 parent b355d71 commit 6b92658

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -87,28 +87,37 @@ macro_rules! kernel_module {
8787

8888
(@attribute author, $value:expr) => {
8989
#[link_section = ".modinfo"]
90+
#[used]
9091
pub static AUTHOR_KEY: [u8; 7] = *b"author=";
9192
#[link_section = ".modinfo"]
93+
#[used]
9294
pub static AUTHOR_VALUE: [u8; $value.len()] = *$value;
9395
#[link_section = ".modinfo"]
96+
#[used]
9497
pub static AUTHOR_NUL: [u8; 1] = *b"\0";
9598
};
9699

97100
(@attribute description, $value:expr) => {
98101
#[link_section = ".modinfo"]
102+
#[used]
99103
pub static DESCRIPTION_KEY: [u8; 12] = *b"description=";
100104
#[link_section = ".modinfo"]
105+
#[used]
101106
pub static DESCRIPTION_VALUE: [u8; $value.len()] = *$value;
102107
#[link_section = ".modinfo"]
108+
#[used]
103109
pub static DESCRIPTION_NUL: [u8; 1] = *b"\0";
104110
};
105111

106112
(@attribute license, $value:expr) => {
107113
#[link_section = ".modinfo"]
114+
#[used]
108115
pub static LICENSE_KEY: [u8; 8] = *b"license=";
109116
#[link_section = ".modinfo"]
117+
#[used]
110118
pub static LICENSE_VALUE: [u8; $value.len()] = *$value;
111119
#[link_section = ".modinfo"]
120+
#[used]
112121
pub static LICENSE_NUL: [u8; 1] = *b"\0";
113122
};
114123
}

0 commit comments

Comments
 (0)