[PATCH] rust: replace <linux/module.h> with <linux/export.h> in rust/exports.c

Masahiro Yamada posted 1 patch 2 years ago
rust/exports.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] rust: replace <linux/module.h> with <linux/export.h> in rust/exports.c
Posted by Masahiro Yamada 2 years ago
<linux/export.h> is the right header to include for using
EXPORT_SYMBOL_GPL. <linux/module.h> includes much more bloat.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 rust/exports.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/exports.c b/rust/exports.c
index 83e2a7070cae..3803c21d1403 100644
--- a/rust/exports.c
+++ b/rust/exports.c
@@ -11,7 +11,7 @@
  * accidentally exposed.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 
 #define EXPORT_SYMBOL_RUST_GPL(sym) extern int sym; EXPORT_SYMBOL_GPL(sym)
 
-- 
2.40.1
Re: [PATCH] rust: replace <linux/module.h> with <linux/export.h> in rust/exports.c
Posted by Miguel Ojeda 2 years ago
On Fri, Nov 24, 2023 at 3:26 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> <linux/export.h> is the right header to include for using
> EXPORT_SYMBOL_GPL. <linux/module.h> includes much more bloat.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Applied to `rust-next`.

Thanks everyone!

Cheers,
Miguel
Re: [PATCH] rust: replace <linux/module.h> with <linux/export.h> in rust/exports.c
Posted by Martin Rodriguez Reboredo 2 years ago
On 11/24/23 11:26, Masahiro Yamada wrote:
> <linux/export.h> is the right header to include for using
> EXPORT_SYMBOL_GPL. <linux/module.h> includes much more bloat.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> [...]
>   
> -#include <linux/module.h>
> +#include <linux/export.h>
>   
> [...]

I'll use this in my crates patch. Regardless, LGTM.

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Re: [PATCH] rust: replace <linux/module.h> with <linux/export.h> in rust/exports.c
Posted by Miguel Ojeda 2 years ago
On Fri, Nov 24, 2023 at 3:26 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> <linux/export.h> is the right header to include for using
> EXPORT_SYMBOL_GPL. <linux/module.h> includes much more bloat.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Good catch, thanks!

Cheers,
Miguel