From 79923cd9694ea7b91032f1f5debdf785e09f89af Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 28 Apr 2019 19:50:02 +0000 Subject: [PATCH 1/2] Burn down a TODO about modinfo name now that we have const fns --- src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c06448c6..4bb1a66a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,9 +60,7 @@ macro_rules! kernel_module { #[link_section = ".modinfo"] #[allow(non_upper_case_globals)] // TODO: Generate a name the same way the kernel's `__MODULE_INFO` does. - // TODO: This needs to be a `&'static [u8]`, since the kernel defines this as a - // `const char []`. - pub static $name: &'static str = concat!(stringify!($name), "=", $value); + pub static $name: &'static [u8] = concat!(stringify!($name), "=", $value, '\0').as_bytes(); }; } From 99983be27e585aad1a86288914ae851734129c05 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 28 Apr 2019 19:55:20 +0000 Subject: [PATCH 2/2] Need this feature --- tests/sysctl/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sysctl/src/lib.rs b/tests/sysctl/src/lib.rs index 45fbc871..84e9a052 100644 --- a/tests/sysctl/src/lib.rs +++ b/tests/sysctl/src/lib.rs @@ -1,4 +1,5 @@ #![no_std] +#![feature(const_str_as_bytes)] use core::sync::atomic::AtomicBool;