[PATCH 04/13] rust: helpers: Remove err helper

Alistair Francis posted 13 patches 2 weeks, 3 days ago
There is a newer version of this series
[PATCH 04/13] rust: helpers: Remove err helper
Posted by Alistair Francis 2 weeks, 3 days ago
Now that we support wrap-static-fns we no longer need the custom helper.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 rust/bindgen_static_functions |  4 ++++
 rust/helpers/err.c            | 19 -------------------
 rust/helpers/helpers.c        |  1 -
 3 files changed, 4 insertions(+), 20 deletions(-)
 delete mode 100644 rust/helpers/err.c

diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions
index 42e45ce342211..0269efa83c618 100644
--- a/rust/bindgen_static_functions
+++ b/rust/bindgen_static_functions
@@ -5,3 +5,7 @@
 
 --allowlist-function blk_mq_rq_to_pdu
 --allowlist-function blk_mq_rq_from_pdu
+
+--allowlist-function ERR_PTR
+--allowlist-function IS_ERR
+--allowlist-function PTR_ERR
diff --git a/rust/helpers/err.c b/rust/helpers/err.c
deleted file mode 100644
index be3d45ef78a25..0000000000000
--- a/rust/helpers/err.c
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-
-#include <linux/err.h>
-#include <linux/export.h>
-
-__force void *rust_helper_ERR_PTR(long err)
-{
-	return ERR_PTR(err);
-}
-
-bool rust_helper_IS_ERR(__force const void *ptr)
-{
-	return IS_ERR(ptr);
-}
-
-long rust_helper_PTR_ERR(__force const void *ptr)
-{
-	return PTR_ERR(ptr);
-}
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index 0f0c16c1e8149..40e51daef412e 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -9,7 +9,6 @@
 
 #include "bug.c"
 #include "build_assert.c"
-#include "err.c"
 #include "kunit.c"
 #include "mutex.c"
 #include "page.c"
-- 
2.47.0