]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rust: helpers: remove guard for rust-bindgen bug
authorSven Van Asbroeck <thesven73@gmail.com>
Tue, 13 Apr 2021 14:45:47 +0000 (10:45 -0400)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 27 Apr 2021 03:06:13 +0000 (05:06 +0200)
On 32-bit arm, `size_t` and 'uintptr_t` are incompatible,
which will trigger the static assertion.

The bug which this guard protects against
(https://github.com/rust-lang/rust-bindgen/issues/1671)
was fixed upstream as of rust-bindgen v0.53:
https://github.com/rust-lang/rust-bindgen/pull/1688
d650823839f7 ("Remove size_t to usize conversion")

The current recommended rust-bindgen version for building
the Linux kernel is v0.56, so the guard can be safely
dropped.

Out of an abundance of caution, remove the guard only
if building for 32-bit arm.

Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
[normalized title]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/helpers.c

index 4cae8c27f8f927bde0d744a1a73c501e569ef04c..133fe9119990f8850b892c2e2c21fc52dca86bcb 100644 (file)
@@ -81,6 +81,8 @@ void rust_helper_kunmap(struct page *page)
 }
 EXPORT_SYMBOL_GPL(rust_helper_kunmap);
 
+#if !defined(CONFIG_ARM)
 // See https://github.com/rust-lang/rust-bindgen/issues/1671
 static_assert(__builtin_types_compatible_p(size_t, uintptr_t),
        "size_t must match uintptr_t, what architecture is this??");
+#endif