On Tue, May 07, 2024 at 11:08:18PM +0200, Miguel Ojeda wrote:
From: Andreas Hindborg <a.hindborg@xxxxxxxxxxx>
When rebasing patch sets on top of upstream Linux, merge conflicts in
helpers.c are common and time consuming [1]. Thus, split the file so
that each kernel component can live in a separate file.
Each helper file is listed explicitly and thus conflicts in the file
list are still likely. However, they should be simpler to resolve than
the conflicts usually seen in helpers.c.
Link: https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/Splitting.20up.20helpers.2Ec/near/426694012 [1]
Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxxx>
Reviewed-by: Sergio González Collado <sergio.collado@xxxxxxxxx>
Tested-by: Sergio González Collado <sergio.collado@xxxxxxxxx>
Link: https://lore.kernel.org/r/20240416074607.1395481-1-nmi@xxxxxxxxxxxx
[ Reworded message slightly and fixed nits in it. Applied commit
84373132b831 ("rust: helpers: Fix grammar in comment") here. Added
SPDX license identifier in new Makefile. Applied Markdown formatting.
Added `.gitignore`. Included `helpers_combined.c` in the `clean`
target. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
This overall looks good to me, one thing below I think should be
changed..
---
This is a patch from Andreas that I was going to apply to `rust-next`
with the tweaks mentioned above, but I noticed Kbuild was not Cc'd, so
we decided to send this as a "v2" and thus give a chance to Kbuild to
take a look for next cycle.
If something in the diff to v1 is wrong, it is my fault, not Andreas' :)
[...]
diff --git a/rust/helpers/build_bug.c b/rust/helpers/build_bug.c
new file mode 100644
index 000000000000..f3106f248485
--- /dev/null
+++ b/rust/helpers/build_bug.c
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <linux/errname.h>
+
+const char *rust_helper_errname(int err)
+{
+ return errname(err);
+}
+EXPORT_SYMBOL_GPL(rust_helper_errname);
.. this build_bug.c should be avoided, but this function should go into
err.c.