* [PATCH] rust: remove unnecessary #includes
@ 2024-10-09 15:09 Tamir Duberstein
2024-10-09 15:37 ` Dirk Behme
0 siblings, 1 reply; 10+ messages in thread
From: Tamir Duberstein @ 2024-10-09 15:09 UTC (permalink / raw)
To: rust-for-linux
Cc: Gary Guo, Tamir Duberstein, Miguel Ojeda, Alex Gaynor, Boqun Feng,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Dirk Behme, Filipe Xavier, linux-kernel
Commit e26fa546042a ("rust: kbuild: auto generate helper exports")
removed the need for these by automatically generating the exports; it
removed the explicit uses of EXPORT_SYMBOL_GPL but didn't remove the
header includes.
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
rust/exports.c | 6 +++---
rust/helpers/build_bug.c | 1 -
rust/helpers/err.c | 1 -
rust/helpers/kunit.c | 1 -
rust/helpers/mutex.c | 1 -
rust/helpers/refcount.c | 1 -
rust/helpers/signal.c | 1 -
rust/helpers/spinlock.c | 1 -
rust/helpers/task.c | 1 -
rust/helpers/wait.c | 1 -
rust/helpers/workqueue.c | 1 -
11 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/rust/exports.c b/rust/exports.c
index e5695f3b45b7..fd278e272751 100644
--- a/rust/exports.c
+++ b/rust/exports.c
@@ -3,9 +3,9 @@
* A hack to export Rust symbols for loadable modules without having to redo
* the entire `include/linux/export.h` logic in Rust.
*
- * This requires the Rust's new/future `v0` mangling scheme because the default
- * one ("legacy") uses invalid characters for C identifiers (thus we cannot use
- * the `EXPORT_SYMBOL_*` macros).
+ * This requires Rust's new/future `v0` mangling scheme because the default one
+ * ("legacy") uses invalid characters for C identifiers (thus we cannot use the
+ * `EXPORT_SYMBOL_*` macros).
*
* All symbols are exported as GPL-only to guarantee no GPL-only feature is
* accidentally exposed.
diff --git a/rust/helpers/build_bug.c b/rust/helpers/build_bug.c
index e994f7b5928c..44e579488037 100644
--- a/rust/helpers/build_bug.c
+++ b/rust/helpers/build_bug.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/errname.h>
const char *rust_helper_errname(int err)
diff --git a/rust/helpers/err.c b/rust/helpers/err.c
index be3d45ef78a2..544c7cb86632 100644
--- a/rust/helpers/err.c
+++ b/rust/helpers/err.c
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/err.h>
-#include <linux/export.h>
__force void *rust_helper_ERR_PTR(long err)
{
diff --git a/rust/helpers/kunit.c b/rust/helpers/kunit.c
index 9d725067eb3b..b85a4d394c11 100644
--- a/rust/helpers/kunit.c
+++ b/rust/helpers/kunit.c
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <kunit/test-bug.h>
-#include <linux/export.h>
struct kunit *rust_helper_kunit_get_current_test(void)
{
diff --git a/rust/helpers/mutex.c b/rust/helpers/mutex.c
index a17ca8cdb50c..7e00680958ef 100644
--- a/rust/helpers/mutex.c
+++ b/rust/helpers/mutex.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/mutex.h>
void rust_helper_mutex_lock(struct mutex *lock)
diff --git a/rust/helpers/refcount.c b/rust/helpers/refcount.c
index f47afc148ec3..d6adbd2e45a1 100644
--- a/rust/helpers/refcount.c
+++ b/rust/helpers/refcount.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/refcount.h>
refcount_t rust_helper_REFCOUNT_INIT(int n)
diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c
index 63c407f80c26..1a6bbe9438e2 100644
--- a/rust/helpers/signal.c
+++ b/rust/helpers/signal.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/sched/signal.h>
int rust_helper_signal_pending(struct task_struct *t)
diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c
index 775ed4d549ae..b7b0945e8b3c 100644
--- a/rust/helpers/spinlock.c
+++ b/rust/helpers/spinlock.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/spinlock.h>
void rust_helper___spin_lock_init(spinlock_t *lock, const char *name,
diff --git a/rust/helpers/task.c b/rust/helpers/task.c
index 7ac789232d11..190fdb2c8e2f 100644
--- a/rust/helpers/task.c
+++ b/rust/helpers/task.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/sched/task.h>
struct task_struct *rust_helper_get_current(void)
diff --git a/rust/helpers/wait.c b/rust/helpers/wait.c
index c7336bbf2750..ae48e33d9da3 100644
--- a/rust/helpers/wait.c
+++ b/rust/helpers/wait.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/wait.h>
void rust_helper_init_wait(struct wait_queue_entry *wq_entry)
diff --git a/rust/helpers/workqueue.c b/rust/helpers/workqueue.c
index f59427acc323..b2b82753509b 100644
--- a/rust/helpers/workqueue.c
+++ b/rust/helpers/workqueue.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/workqueue.h>
void rust_helper_init_work_with_key(struct work_struct *work, work_func_t func,
--
2.47.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] rust: remove unnecessary #includes
2024-10-09 15:09 [PATCH] rust: remove unnecessary #includes Tamir Duberstein
@ 2024-10-09 15:37 ` Dirk Behme
2024-10-09 15:58 ` Miguel Ojeda
0 siblings, 1 reply; 10+ messages in thread
From: Dirk Behme @ 2024-10-09 15:37 UTC (permalink / raw)
To: Tamir Duberstein, rust-for-linux
Cc: Gary Guo, Miguel Ojeda, Alex Gaynor, Boqun Feng,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Dirk Behme, Filipe Xavier, linux-kernel
Am 09.10.24 um 17:09 schrieb Tamir Duberstein:
> Commit e26fa546042a ("rust: kbuild: auto generate helper exports")
> removed the need for these by automatically generating the exports; it
> removed the explicit uses of EXPORT_SYMBOL_GPL but didn't remove the
> header includes.
I was about to send the same patch. You have been faster. Thanks! :)
Two nits:
* Theoretically the grammer fix in exports.c could go into an
independent patch. But if not it at least should be mentioned in the
commit message. Let Miguel decide if he wants an extra patch or not ;)
* Maybe a
Fixes: e26fa546042a ("rust: kbuild: auto generate helper exports")
tag could be added? Even though Miguel might route it through
rust-next as its not urgent for routing through rust-fixes.
Anyhow, regarding the main change:
Reviewed-by: Dirk Behme <dirk.behme@gmail.com>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
> ---
> rust/exports.c | 6 +++---
> rust/helpers/build_bug.c | 1 -
> rust/helpers/err.c | 1 -
> rust/helpers/kunit.c | 1 -
> rust/helpers/mutex.c | 1 -
> rust/helpers/refcount.c | 1 -
> rust/helpers/signal.c | 1 -
> rust/helpers/spinlock.c | 1 -
> rust/helpers/task.c | 1 -
> rust/helpers/wait.c | 1 -
> rust/helpers/workqueue.c | 1 -
> 11 files changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/rust/exports.c b/rust/exports.c
> index e5695f3b45b7..fd278e272751 100644
> --- a/rust/exports.c
> +++ b/rust/exports.c
> @@ -3,9 +3,9 @@
> * A hack to export Rust symbols for loadable modules without having to redo
> * the entire `include/linux/export.h` logic in Rust.
> *
> - * This requires the Rust's new/future `v0` mangling scheme because the default
> - * one ("legacy") uses invalid characters for C identifiers (thus we cannot use
> - * the `EXPORT_SYMBOL_*` macros).
> + * This requires Rust's new/future `v0` mangling scheme because the default one
> + * ("legacy") uses invalid characters for C identifiers (thus we cannot use the
> + * `EXPORT_SYMBOL_*` macros).
> *
> * All symbols are exported as GPL-only to guarantee no GPL-only feature is
> * accidentally exposed.
> diff --git a/rust/helpers/build_bug.c b/rust/helpers/build_bug.c
> index e994f7b5928c..44e579488037 100644
> --- a/rust/helpers/build_bug.c
> +++ b/rust/helpers/build_bug.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/errname.h>
>
> const char *rust_helper_errname(int err)
> diff --git a/rust/helpers/err.c b/rust/helpers/err.c
> index be3d45ef78a2..544c7cb86632 100644
> --- a/rust/helpers/err.c
> +++ b/rust/helpers/err.c
> @@ -1,7 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
>
> #include <linux/err.h>
> -#include <linux/export.h>
>
> __force void *rust_helper_ERR_PTR(long err)
> {
> diff --git a/rust/helpers/kunit.c b/rust/helpers/kunit.c
> index 9d725067eb3b..b85a4d394c11 100644
> --- a/rust/helpers/kunit.c
> +++ b/rust/helpers/kunit.c
> @@ -1,7 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
>
> #include <kunit/test-bug.h>
> -#include <linux/export.h>
>
> struct kunit *rust_helper_kunit_get_current_test(void)
> {
> diff --git a/rust/helpers/mutex.c b/rust/helpers/mutex.c
> index a17ca8cdb50c..7e00680958ef 100644
> --- a/rust/helpers/mutex.c
> +++ b/rust/helpers/mutex.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/mutex.h>
>
> void rust_helper_mutex_lock(struct mutex *lock)
> diff --git a/rust/helpers/refcount.c b/rust/helpers/refcount.c
> index f47afc148ec3..d6adbd2e45a1 100644
> --- a/rust/helpers/refcount.c
> +++ b/rust/helpers/refcount.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/refcount.h>
>
> refcount_t rust_helper_REFCOUNT_INIT(int n)
> diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c
> index 63c407f80c26..1a6bbe9438e2 100644
> --- a/rust/helpers/signal.c
> +++ b/rust/helpers/signal.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/sched/signal.h>
>
> int rust_helper_signal_pending(struct task_struct *t)
> diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c
> index 775ed4d549ae..b7b0945e8b3c 100644
> --- a/rust/helpers/spinlock.c
> +++ b/rust/helpers/spinlock.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/spinlock.h>
>
> void rust_helper___spin_lock_init(spinlock_t *lock, const char *name,
> diff --git a/rust/helpers/task.c b/rust/helpers/task.c
> index 7ac789232d11..190fdb2c8e2f 100644
> --- a/rust/helpers/task.c
> +++ b/rust/helpers/task.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/sched/task.h>
>
> struct task_struct *rust_helper_get_current(void)
> diff --git a/rust/helpers/wait.c b/rust/helpers/wait.c
> index c7336bbf2750..ae48e33d9da3 100644
> --- a/rust/helpers/wait.c
> +++ b/rust/helpers/wait.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/wait.h>
>
> void rust_helper_init_wait(struct wait_queue_entry *wq_entry)
> diff --git a/rust/helpers/workqueue.c b/rust/helpers/workqueue.c
> index f59427acc323..b2b82753509b 100644
> --- a/rust/helpers/workqueue.c
> +++ b/rust/helpers/workqueue.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/workqueue.h>
>
> void rust_helper_init_work_with_key(struct work_struct *work, work_func_t func,
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rust: remove unnecessary #includes
2024-10-09 15:37 ` Dirk Behme
@ 2024-10-09 15:58 ` Miguel Ojeda
2024-10-09 16:12 ` Tamir Duberstein
2024-10-10 9:10 ` [PATCH] rust: remove unnecessary #includes Andreas Hindborg
0 siblings, 2 replies; 10+ messages in thread
From: Miguel Ojeda @ 2024-10-09 15:58 UTC (permalink / raw)
To: Dirk Behme
Cc: Tamir Duberstein, rust-for-linux, Gary Guo, Miguel Ojeda,
Alex Gaynor, Boqun Feng, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Dirk Behme,
Filipe Xavier, linux-kernel
On Wed, Oct 9, 2024 at 5:37 PM Dirk Behme <dirk.behme@gmail.com> wrote:
>
> * Theoretically the grammer fix in exports.c could go into an
> independent patch. But if not it at least should be mentioned in the
> commit message. Let Miguel decide if he wants an extra patch or not ;)
Indeed, in general, one should not have unstated/unrelated changes.
> * Maybe a
>
> Fixes: e26fa546042a ("rust: kbuild: auto generate helper exports")
>
> tag could be added? Even though Miguel might route it through
> rust-next as its not urgent for routing through rust-fixes.
I think this is a cleanup, i.e. just unnecessary `#include`s being
present, right? In other words, there is no "bug" apart from not being
optimal (one could see cleanups as things that should have been done,
but I guess we should draw the line somewhere).
Andreas: was there a reason to keep those `#include`s, just in case?
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rust: remove unnecessary #includes
2024-10-09 15:58 ` Miguel Ojeda
@ 2024-10-09 16:12 ` Tamir Duberstein
2024-10-09 16:17 ` Miguel Ojeda
2024-10-10 9:10 ` [PATCH] rust: remove unnecessary #includes Andreas Hindborg
1 sibling, 1 reply; 10+ messages in thread
From: Tamir Duberstein @ 2024-10-09 16:12 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Dirk Behme, rust-for-linux, Gary Guo, Miguel Ojeda, Alex Gaynor,
Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, Dirk Behme, Filipe Xavier, linux-kernel
On Wed, Oct 9, 2024 at 11:58 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Andreas: was there a reason to keep those `#include`s, just in case?
FWIW already not all files in rust/helpers/ had these `#include`s,
e.g. `uaccess.c`.
Thanks for calling out the grammar fix, I'll state that in v2. Should I split it
into a separate patch?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] rust: remove unnecessary #includes
2024-10-09 16:12 ` Tamir Duberstein
@ 2024-10-09 16:17 ` Miguel Ojeda
2024-10-09 16:25 ` [PATCH v2] rust: remove unnecessary header includes Tamir Duberstein
0 siblings, 1 reply; 10+ messages in thread
From: Miguel Ojeda @ 2024-10-09 16:17 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Dirk Behme, rust-for-linux, Gary Guo, Miguel Ojeda, Alex Gaynor,
Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, Dirk Behme, Filipe Xavier, linux-kernel
On Wed, Oct 9, 2024 at 6:12 PM Tamir Duberstein <tamird@gmail.com> wrote:
>
> Thanks for calling out the grammar fix, I'll state that in v2. Should I split it
> into a separate patch?
Yes, please (ideally as an independent patch, i.e. it does not need to
be in the same series).
Cheers,
Miguel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2] rust: remove unnecessary header includes
2024-10-09 16:17 ` Miguel Ojeda
@ 2024-10-09 16:25 ` Tamir Duberstein
2024-10-10 9:17 ` Andreas Hindborg
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Tamir Duberstein @ 2024-10-09 16:25 UTC (permalink / raw)
To: rust-for-linux
Cc: Tamir Duberstein, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Dirk Behme, Fiona Behrens, Filipe Xavier,
linux-kernel
Commit e26fa546042a ("rust: kbuild: auto generate helper exports")
removed the need for these by automatically generating the exports; it
removed the explicit uses of `EXPORT_SYMBOL_GPL` but didn't remove the
`#include <linux/export.h>`s.
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
V1 -> V2: Split grammar improvement into separate patch.
rust/helpers/build_bug.c | 1 -
rust/helpers/err.c | 1 -
rust/helpers/kunit.c | 1 -
rust/helpers/mutex.c | 1 -
rust/helpers/refcount.c | 1 -
rust/helpers/signal.c | 1 -
rust/helpers/spinlock.c | 1 -
rust/helpers/task.c | 1 -
rust/helpers/wait.c | 1 -
rust/helpers/workqueue.c | 1 -
10 files changed, 10 deletions(-)
diff --git a/rust/helpers/build_bug.c b/rust/helpers/build_bug.c
index e994f7b5928c..44e579488037 100644
--- a/rust/helpers/build_bug.c
+++ b/rust/helpers/build_bug.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/errname.h>
const char *rust_helper_errname(int err)
diff --git a/rust/helpers/err.c b/rust/helpers/err.c
index be3d45ef78a2..544c7cb86632 100644
--- a/rust/helpers/err.c
+++ b/rust/helpers/err.c
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/err.h>
-#include <linux/export.h>
__force void *rust_helper_ERR_PTR(long err)
{
diff --git a/rust/helpers/kunit.c b/rust/helpers/kunit.c
index 9d725067eb3b..b85a4d394c11 100644
--- a/rust/helpers/kunit.c
+++ b/rust/helpers/kunit.c
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <kunit/test-bug.h>
-#include <linux/export.h>
struct kunit *rust_helper_kunit_get_current_test(void)
{
diff --git a/rust/helpers/mutex.c b/rust/helpers/mutex.c
index a17ca8cdb50c..7e00680958ef 100644
--- a/rust/helpers/mutex.c
+++ b/rust/helpers/mutex.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/mutex.h>
void rust_helper_mutex_lock(struct mutex *lock)
diff --git a/rust/helpers/refcount.c b/rust/helpers/refcount.c
index f47afc148ec3..d6adbd2e45a1 100644
--- a/rust/helpers/refcount.c
+++ b/rust/helpers/refcount.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/refcount.h>
refcount_t rust_helper_REFCOUNT_INIT(int n)
diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c
index 63c407f80c26..1a6bbe9438e2 100644
--- a/rust/helpers/signal.c
+++ b/rust/helpers/signal.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/sched/signal.h>
int rust_helper_signal_pending(struct task_struct *t)
diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c
index 775ed4d549ae..b7b0945e8b3c 100644
--- a/rust/helpers/spinlock.c
+++ b/rust/helpers/spinlock.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/spinlock.h>
void rust_helper___spin_lock_init(spinlock_t *lock, const char *name,
diff --git a/rust/helpers/task.c b/rust/helpers/task.c
index 7ac789232d11..190fdb2c8e2f 100644
--- a/rust/helpers/task.c
+++ b/rust/helpers/task.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/sched/task.h>
struct task_struct *rust_helper_get_current(void)
diff --git a/rust/helpers/wait.c b/rust/helpers/wait.c
index c7336bbf2750..ae48e33d9da3 100644
--- a/rust/helpers/wait.c
+++ b/rust/helpers/wait.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/wait.h>
void rust_helper_init_wait(struct wait_queue_entry *wq_entry)
diff --git a/rust/helpers/workqueue.c b/rust/helpers/workqueue.c
index f59427acc323..b2b82753509b 100644
--- a/rust/helpers/workqueue.c
+++ b/rust/helpers/workqueue.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/workqueue.h>
void rust_helper_init_work_with_key(struct work_struct *work, work_func_t func,
--
2.47.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] rust: remove unnecessary #includes
2024-10-09 15:58 ` Miguel Ojeda
2024-10-09 16:12 ` Tamir Duberstein
@ 2024-10-10 9:10 ` Andreas Hindborg
1 sibling, 0 replies; 10+ messages in thread
From: Andreas Hindborg @ 2024-10-10 9:10 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Dirk Behme, Tamir Duberstein, rust-for-linux, Gary Guo,
Miguel Ojeda, Alex Gaynor, Boqun Feng, Björn Roy Baron,
Benno Lossin, Alice Ryhl, Trevor Gross, Dirk Behme, Filipe Xavier,
linux-kernel
"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com> writes:
> On Wed, Oct 9, 2024 at 5:37 PM Dirk Behme <dirk.behme@gmail.com> wrote:
>>
>> * Theoretically the grammer fix in exports.c could go into an
>> independent patch. But if not it at least should be mentioned in the
>> commit message. Let Miguel decide if he wants an extra patch or not ;)
>
> Indeed, in general, one should not have unstated/unrelated changes.
>
>> * Maybe a
>>
>> Fixes: e26fa546042a ("rust: kbuild: auto generate helper exports")
>>
>> tag could be added? Even though Miguel might route it through
>> rust-next as its not urgent for routing through rust-fixes.
>
> I think this is a cleanup, i.e. just unnecessary `#include`s being
> present, right? In other words, there is no "bug" apart from not being
> optimal (one could see cleanups as things that should have been done,
> but I guess we should draw the line somewhere).
>
> Andreas: was there a reason to keep those `#include`s, just in case?
I don't think so, it looks like they should have been removed with
Gary's patch that did the auto export.
BR Andreas
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] rust: remove unnecessary header includes
2024-10-09 16:25 ` [PATCH v2] rust: remove unnecessary header includes Tamir Duberstein
@ 2024-10-10 9:17 ` Andreas Hindborg
2024-10-12 18:43 ` Gary Guo
2024-10-21 18:12 ` Miguel Ojeda
2 siblings, 0 replies; 10+ messages in thread
From: Andreas Hindborg @ 2024-10-10 9:17 UTC (permalink / raw)
To: Tamir Duberstein
Cc: rust-for-linux, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Alice Ryhl, Trevor Gross,
Dirk Behme, Fiona Behrens, Filipe Xavier, linux-kernel
"Tamir Duberstein" <tamird@gmail.com> writes:
> Commit e26fa546042a ("rust: kbuild: auto generate helper exports")
> removed the need for these by automatically generating the exports; it
> removed the explicit uses of `EXPORT_SYMBOL_GPL` but didn't remove the
> `#include <linux/export.h>`s.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] rust: remove unnecessary header includes
2024-10-09 16:25 ` [PATCH v2] rust: remove unnecessary header includes Tamir Duberstein
2024-10-10 9:17 ` Andreas Hindborg
@ 2024-10-12 18:43 ` Gary Guo
2024-10-21 18:12 ` Miguel Ojeda
2 siblings, 0 replies; 10+ messages in thread
From: Gary Guo @ 2024-10-12 18:43 UTC (permalink / raw)
To: Tamir Duberstein
Cc: rust-for-linux, Miguel Ojeda, Alex Gaynor, Boqun Feng,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Dirk Behme, Fiona Behrens, Filipe Xavier,
linux-kernel
On Wed, 9 Oct 2024 12:25:30 -0400
Tamir Duberstein <tamird@gmail.com> wrote:
> Commit e26fa546042a ("rust: kbuild: auto generate helper exports")
> removed the need for these by automatically generating the exports; it
> removed the explicit uses of `EXPORT_SYMBOL_GPL` but didn't remove the
> `#include <linux/export.h>`s.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> V1 -> V2: Split grammar improvement into separate patch.
>
> rust/helpers/build_bug.c | 1 -
> rust/helpers/err.c | 1 -
> rust/helpers/kunit.c | 1 -
> rust/helpers/mutex.c | 1 -
> rust/helpers/refcount.c | 1 -
> rust/helpers/signal.c | 1 -
> rust/helpers/spinlock.c | 1 -
> rust/helpers/task.c | 1 -
> rust/helpers/wait.c | 1 -
> rust/helpers/workqueue.c | 1 -
> 10 files changed, 10 deletions(-)
>
> diff --git a/rust/helpers/build_bug.c b/rust/helpers/build_bug.c
> index e994f7b5928c..44e579488037 100644
> --- a/rust/helpers/build_bug.c
> +++ b/rust/helpers/build_bug.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/errname.h>
>
> const char *rust_helper_errname(int err)
> diff --git a/rust/helpers/err.c b/rust/helpers/err.c
> index be3d45ef78a2..544c7cb86632 100644
> --- a/rust/helpers/err.c
> +++ b/rust/helpers/err.c
> @@ -1,7 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
>
> #include <linux/err.h>
> -#include <linux/export.h>
>
> __force void *rust_helper_ERR_PTR(long err)
> {
> diff --git a/rust/helpers/kunit.c b/rust/helpers/kunit.c
> index 9d725067eb3b..b85a4d394c11 100644
> --- a/rust/helpers/kunit.c
> +++ b/rust/helpers/kunit.c
> @@ -1,7 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
>
> #include <kunit/test-bug.h>
> -#include <linux/export.h>
>
> struct kunit *rust_helper_kunit_get_current_test(void)
> {
> diff --git a/rust/helpers/mutex.c b/rust/helpers/mutex.c
> index a17ca8cdb50c..7e00680958ef 100644
> --- a/rust/helpers/mutex.c
> +++ b/rust/helpers/mutex.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/mutex.h>
>
> void rust_helper_mutex_lock(struct mutex *lock)
> diff --git a/rust/helpers/refcount.c b/rust/helpers/refcount.c
> index f47afc148ec3..d6adbd2e45a1 100644
> --- a/rust/helpers/refcount.c
> +++ b/rust/helpers/refcount.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/refcount.h>
>
> refcount_t rust_helper_REFCOUNT_INIT(int n)
> diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c
> index 63c407f80c26..1a6bbe9438e2 100644
> --- a/rust/helpers/signal.c
> +++ b/rust/helpers/signal.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/sched/signal.h>
>
> int rust_helper_signal_pending(struct task_struct *t)
> diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c
> index 775ed4d549ae..b7b0945e8b3c 100644
> --- a/rust/helpers/spinlock.c
> +++ b/rust/helpers/spinlock.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/spinlock.h>
>
> void rust_helper___spin_lock_init(spinlock_t *lock, const char *name,
> diff --git a/rust/helpers/task.c b/rust/helpers/task.c
> index 7ac789232d11..190fdb2c8e2f 100644
> --- a/rust/helpers/task.c
> +++ b/rust/helpers/task.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/sched/task.h>
>
> struct task_struct *rust_helper_get_current(void)
> diff --git a/rust/helpers/wait.c b/rust/helpers/wait.c
> index c7336bbf2750..ae48e33d9da3 100644
> --- a/rust/helpers/wait.c
> +++ b/rust/helpers/wait.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/wait.h>
>
> void rust_helper_init_wait(struct wait_queue_entry *wq_entry)
> diff --git a/rust/helpers/workqueue.c b/rust/helpers/workqueue.c
> index f59427acc323..b2b82753509b 100644
> --- a/rust/helpers/workqueue.c
> +++ b/rust/helpers/workqueue.c
> @@ -1,6 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/export.h>
> #include <linux/workqueue.h>
>
> void rust_helper_init_work_with_key(struct work_struct *work, work_func_t func,
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] rust: remove unnecessary header includes
2024-10-09 16:25 ` [PATCH v2] rust: remove unnecessary header includes Tamir Duberstein
2024-10-10 9:17 ` Andreas Hindborg
2024-10-12 18:43 ` Gary Guo
@ 2024-10-21 18:12 ` Miguel Ojeda
2 siblings, 0 replies; 10+ messages in thread
From: Miguel Ojeda @ 2024-10-21 18:12 UTC (permalink / raw)
To: Tamir Duberstein
Cc: rust-for-linux, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Dirk Behme, Fiona Behrens, Filipe Xavier,
linux-kernel
On Wed, Oct 9, 2024 at 6:26 PM Tamir Duberstein <tamird@gmail.com> wrote:
>
> Commit e26fa546042a ("rust: kbuild: auto generate helper exports")
> removed the need for these by automatically generating the exports; it
> removed the explicit uses of `EXPORT_SYMBOL_GPL` but didn't remove the
> `#include <linux/export.h>`s.
>
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Applied to `rust-next` -- thanks everyone!
[ Reworded title. - Miguel ]
Cheers,
Miguel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-10-21 18:12 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 15:09 [PATCH] rust: remove unnecessary #includes Tamir Duberstein
2024-10-09 15:37 ` Dirk Behme
2024-10-09 15:58 ` Miguel Ojeda
2024-10-09 16:12 ` Tamir Duberstein
2024-10-09 16:17 ` Miguel Ojeda
2024-10-09 16:25 ` [PATCH v2] rust: remove unnecessary header includes Tamir Duberstein
2024-10-10 9:17 ` Andreas Hindborg
2024-10-12 18:43 ` Gary Guo
2024-10-21 18:12 ` Miguel Ojeda
2024-10-10 9:10 ` [PATCH] rust: remove unnecessary #includes Andreas Hindborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).