* [PATCH] rust: Sort rust/helpers.c's #include directives
@ 2023-04-25 20:28 Ariel Miculas
2023-04-25 20:37 ` Miguel Ojeda
0 siblings, 1 reply; 12+ messages in thread
From: Ariel Miculas @ 2023-04-25 20:28 UTC (permalink / raw)
To: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, gary, bjorn3_gh, benno.lossin
Cc: Ariel Miculas
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1003
Signed-off-by: Ariel Miculas <amiculas@cisco.com>
---
rust/helpers.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/rust/helpers.c b/rust/helpers.c
index 81e80261d597..59a23b1647fb 100644
--- a/rust/helpers.c
+++ b/rust/helpers.c
@@ -18,13 +18,17 @@
* accidentally exposed.
*/
+/*
+ * Sorted alphabetically.
+ */
+
#include <linux/bug.h>
#include <linux/build_bug.h>
#include <linux/err.h>
-#include <linux/refcount.h>
#include <linux/mutex.h>
-#include <linux/spinlock.h>
+#include <linux/refcount.h>
#include <linux/sched/signal.h>
+#include <linux/spinlock.h>
#include <linux/wait.h>
__noreturn void rust_helper_BUG(void)
--
2.40.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] rust: Sort rust/helpers.c's #include directives
2023-04-25 20:28 [PATCH] rust: Sort rust/helpers.c's #include directives Ariel Miculas
@ 2023-04-25 20:37 ` Miguel Ojeda
2023-04-26 8:13 ` Ariel Miculas
2023-04-26 8:17 ` Ariel Miculas
0 siblings, 2 replies; 12+ messages in thread
From: Miguel Ojeda @ 2023-04-25 20:37 UTC (permalink / raw)
To: Ariel Miculas
Cc: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, gary, bjorn3_gh, benno.lossin, Ariel Miculas
Hi Ariel,
On Tue, Apr 25, 2023 at 10:28 PM Ariel Miculas <ariel.miculas@gmail.com> wrote:
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1003
> Signed-off-by: Ariel Miculas <amiculas@cisco.com>
First of all, thanks for the patch!
These tags look OK, but if you want to attribute the patches to your
Cisco address, could you please send them from that address?
Also, the commit description is missing. In the kernel, we give the
rationale for a change and describe what the patch does for every
commit.
Please take a look at `Documentation/process/submitting-patches.rst`
and try `scripts/checkpatch.pl` -- it can point some issues like this.
> +/*
> + * Sorted alphabetically.
> + */
Please join this comment with the top one, i.e. please do not open a
new /* */ block, like it is done in the other file mentioned in the
linked issue.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] rust: Sort rust/helpers.c's #include directives
2023-04-25 20:37 ` Miguel Ojeda
@ 2023-04-26 8:13 ` Ariel Miculas
2023-04-26 8:23 ` Ariel Miculas
2023-04-26 8:17 ` Ariel Miculas
1 sibling, 1 reply; 12+ messages in thread
From: Ariel Miculas @ 2023-04-26 8:13 UTC (permalink / raw)
To: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, gary, bjorn3_gh, benno.lossin
Cc: Ariel Miculas
Sort the #include directives of rust/helpers.c alphabetically and add a
comment specifying this.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1003
Signed-off-by: Ariel Miculas <amiculas@cisco.com>
---
rust/helpers.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/rust/helpers.c b/rust/helpers.c
index 81e80261d597..73c01db0c828 100644
--- a/rust/helpers.c
+++ b/rust/helpers.c
@@ -16,15 +16,17 @@
*
* All symbols are exported as GPL-only to guarantee no GPL-only feature is
* accidentally exposed.
+ *
+ * Sorted alphabetically.
*/
#include <linux/bug.h>
#include <linux/build_bug.h>
#include <linux/err.h>
-#include <linux/refcount.h>
#include <linux/mutex.h>
-#include <linux/spinlock.h>
+#include <linux/refcount.h>
#include <linux/sched/signal.h>
+#include <linux/spinlock.h>
#include <linux/wait.h>
__noreturn void rust_helper_BUG(void)
--
2.40.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] rust: Sort rust/helpers.c's #include directives
2023-04-25 20:37 ` Miguel Ojeda
2023-04-26 8:13 ` Ariel Miculas
@ 2023-04-26 8:17 ` Ariel Miculas
2023-04-26 17:55 ` Miguel Ojeda
1 sibling, 1 reply; 12+ messages in thread
From: Ariel Miculas @ 2023-04-26 8:17 UTC (permalink / raw)
To: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, gary, bjorn3_gh, benno.lossin
Cc: Ariel Miculas
Sort the #include directives of rust/helpers.c alphabetically and add a
comment specifying this.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1003
Signed-off-by: Ariel Miculas <amiculas@cisco.com>
---
rust/helpers.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/rust/helpers.c b/rust/helpers.c
index 81e80261d597..73c01db0c828 100644
--- a/rust/helpers.c
+++ b/rust/helpers.c
@@ -16,15 +16,17 @@
*
* All symbols are exported as GPL-only to guarantee no GPL-only feature is
* accidentally exposed.
+ *
+ * Sorted alphabetically.
*/
#include <linux/bug.h>
#include <linux/build_bug.h>
#include <linux/err.h>
-#include <linux/refcount.h>
#include <linux/mutex.h>
-#include <linux/spinlock.h>
+#include <linux/refcount.h>
#include <linux/sched/signal.h>
+#include <linux/spinlock.h>
#include <linux/wait.h>
__noreturn void rust_helper_BUG(void)
--
2.40.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] rust: Sort rust/helpers.c's #include directives
2023-04-26 8:13 ` Ariel Miculas
@ 2023-04-26 8:23 ` Ariel Miculas
0 siblings, 0 replies; 12+ messages in thread
From: Ariel Miculas @ 2023-04-26 8:23 UTC (permalink / raw)
To: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, gary, bjorn3_gh, benno.lossin
Cc: Ariel Miculas
My bad, I'm sending this again from my cisco account.
On Wed, Apr 26, 2023 at 11:14 AM Ariel Miculas <ariel.miculas@gmail.com> wrote:
>
> Sort the #include directives of rust/helpers.c alphabetically and add a
> comment specifying this.
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1003
> Signed-off-by: Ariel Miculas <amiculas@cisco.com>
> ---
> rust/helpers.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/rust/helpers.c b/rust/helpers.c
> index 81e80261d597..73c01db0c828 100644
> --- a/rust/helpers.c
> +++ b/rust/helpers.c
> @@ -16,15 +16,17 @@
> *
> * All symbols are exported as GPL-only to guarantee no GPL-only feature is
> * accidentally exposed.
> + *
> + * Sorted alphabetically.
> */
>
> #include <linux/bug.h>
> #include <linux/build_bug.h>
> #include <linux/err.h>
> -#include <linux/refcount.h>
> #include <linux/mutex.h>
> -#include <linux/spinlock.h>
> +#include <linux/refcount.h>
> #include <linux/sched/signal.h>
> +#include <linux/spinlock.h>
> #include <linux/wait.h>
>
> __noreturn void rust_helper_BUG(void)
> --
> 2.40.0
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] rust: Sort rust/helpers.c's #include directives
2023-04-26 8:17 ` Ariel Miculas
@ 2023-04-26 17:55 ` Miguel Ojeda
2023-04-26 20:49 ` [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c Ariel Miculas
0 siblings, 1 reply; 12+ messages in thread
From: Miguel Ojeda @ 2023-04-26 17:55 UTC (permalink / raw)
To: Ariel Miculas
Cc: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, gary, bjorn3_gh, benno.lossin
On Wed, Apr 26, 2023 at 10:18 AM Ariel Miculas <amiculas@cisco.com> wrote:
>
> Sort the #include directives of rust/helpers.c alphabetically and add a
> comment specifying this.
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1003
> Signed-off-by: Ariel Miculas <amiculas@cisco.com>
Looks better, and the content is fine!
A few minor notes and tips:
- Please annotate the version of the series when you resubmit a
patch series, e.g. v2, v3, etc. `git-format-patch` can do this for you
via e.g. `-v2`.
- Typically the title would be prefixed like "rust: helpers: sort
includes". In general, try to take a look at a subsystem's pattern for
similar commits.
- The description should also give the rationale for the change,
i.e. the "why" and the "what". This one, for instance, could say that
this is done to improve readability and to be consistent with the
other files with a similar approach within `rust/`.
I can fix these on my side if you prefer, but it may be good practice
if you want to send a quick new version.
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c
2023-04-26 17:55 ` Miguel Ojeda
@ 2023-04-26 20:49 ` Ariel Miculas
2023-04-26 20:55 ` Martin Rodriguez Reboredo
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Ariel Miculas @ 2023-04-26 20:49 UTC (permalink / raw)
To: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, gary, bjorn3_gh, benno.lossin
Cc: Ariel Miculas
Sort the #include directives of rust/helpers.c alphabetically and add a
comment specifying this. The reason for this is to improve readability
and to be consistent with the other files with a similar approach within
'rust/'.
Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1003
Signed-off-by: Ariel Miculas <amiculas@cisco.com>
---
rust/helpers.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/rust/helpers.c b/rust/helpers.c
index 81e80261d597..73c01db0c828 100644
--- a/rust/helpers.c
+++ b/rust/helpers.c
@@ -16,15 +16,17 @@
*
* All symbols are exported as GPL-only to guarantee no GPL-only feature is
* accidentally exposed.
+ *
+ * Sorted alphabetically.
*/
#include <linux/bug.h>
#include <linux/build_bug.h>
#include <linux/err.h>
-#include <linux/refcount.h>
#include <linux/mutex.h>
-#include <linux/spinlock.h>
+#include <linux/refcount.h>
#include <linux/sched/signal.h>
+#include <linux/spinlock.h>
#include <linux/wait.h>
__noreturn void rust_helper_BUG(void)
--
2.40.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c
2023-04-26 20:49 ` [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c Ariel Miculas
@ 2023-04-26 20:55 ` Martin Rodriguez Reboredo
2023-04-26 21:04 ` Ariel Miculas
2023-04-27 12:36 ` Gary Guo
2023-07-19 20:01 ` Miguel Ojeda
2 siblings, 1 reply; 12+ messages in thread
From: Martin Rodriguez Reboredo @ 2023-04-26 20:55 UTC (permalink / raw)
To: Ariel Miculas, rust-for-linux, linux-kernel, ojeda, alex.gaynor,
wedsonaf, boqun.feng, gary, bjorn3_gh, benno.lossin
On 4/26/23 17:49, Ariel Miculas wrote:
> Sort the #include directives of rust/helpers.c alphabetically and add a
> comment specifying this. The reason for this is to improve readability
> and to be consistent with the other files with a similar approach within
> 'rust/'.
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1003
> Signed-off-by: Ariel Miculas <amiculas@cisco.com>
> ---
> [...]
Shouldn't the link use the `Link: <url> [1]` format? Otherwise LGTM.
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c
2023-04-26 20:55 ` Martin Rodriguez Reboredo
@ 2023-04-26 21:04 ` Ariel Miculas
2023-04-26 21:28 ` Miguel Ojeda
0 siblings, 1 reply; 12+ messages in thread
From: Ariel Miculas @ 2023-04-26 21:04 UTC (permalink / raw)
To: Martin Rodriguez Reboredo
Cc: Ariel Miculas, rust-for-linux, linux-kernel, ojeda, alex.gaynor,
wedsonaf, boqun.feng, gary, bjorn3_gh, benno.lossin
This is the format I see in https://docs.kernel.org/process/5.Posting.html#
```
Link: https://example.com/somewhere.html optional-other-stuff
```
And looking briefly through the git log I see the simple `Link:
www.example.com` format.
But I'm happy to change this if needed, can you point me to the right format?
On Wed, Apr 26, 2023 at 11:57 PM Martin Rodriguez Reboredo
<yakoyoku@gmail.com> wrote:
>
> On 4/26/23 17:49, Ariel Miculas wrote:
> > Sort the #include directives of rust/helpers.c alphabetically and add a
> > comment specifying this. The reason for this is to improve readability
> > and to be consistent with the other files with a similar approach within
> > 'rust/'.
> >
> > Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> > Link: https://github.com/Rust-for-Linux/linux/issues/1003
> > Signed-off-by: Ariel Miculas <amiculas@cisco.com>
> > ---
> > [...]
> Shouldn't the link use the `Link: <url> [1]` format? Otherwise LGTM.
>
> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c
2023-04-26 21:04 ` Ariel Miculas
@ 2023-04-26 21:28 ` Miguel Ojeda
0 siblings, 0 replies; 12+ messages in thread
From: Miguel Ojeda @ 2023-04-26 21:28 UTC (permalink / raw)
To: Ariel Miculas
Cc: Martin Rodriguez Reboredo, Ariel Miculas, rust-for-linux,
linux-kernel, ojeda, alex.gaynor, wedsonaf, boqun.feng, gary,
bjorn3_gh, benno.lossin
On Wed, Apr 26, 2023 at 11:04 PM Ariel Miculas <ariel.miculas@gmail.com> wrote:
>
> This is the format I see in https://docs.kernel.org/process/5.Posting.html#
> ```
> Link: https://example.com/somewhere.html optional-other-stuff
> ```
> And looking briefly through the git log I see the simple `Link:
> www.example.com` format.
Indeed, the one you have in the commit is the right one :)
There are 5 commits in the kernel with the format mentioned by Martin,
but they were probably unintentional.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c
2023-04-26 20:49 ` [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c Ariel Miculas
2023-04-26 20:55 ` Martin Rodriguez Reboredo
@ 2023-04-27 12:36 ` Gary Guo
2023-07-19 20:01 ` Miguel Ojeda
2 siblings, 0 replies; 12+ messages in thread
From: Gary Guo @ 2023-04-27 12:36 UTC (permalink / raw)
To: Ariel Miculas
Cc: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, bjorn3_gh, benno.lossin
On Wed, 26 Apr 2023 23:49:23 +0300
Ariel Miculas <amiculas@cisco.com> wrote:
> Sort the #include directives of rust/helpers.c alphabetically and add a
> comment specifying this. The reason for this is to improve readability
> and to be consistent with the other files with a similar approach within
> 'rust/'.
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1003
> Signed-off-by: Ariel Miculas <amiculas@cisco.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> rust/helpers.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/rust/helpers.c b/rust/helpers.c
> index 81e80261d597..73c01db0c828 100644
> --- a/rust/helpers.c
> +++ b/rust/helpers.c
> @@ -16,15 +16,17 @@
> *
> * All symbols are exported as GPL-only to guarantee no GPL-only feature is
> * accidentally exposed.
> + *
> + * Sorted alphabetically.
> */
>
> #include <linux/bug.h>
> #include <linux/build_bug.h>
> #include <linux/err.h>
> -#include <linux/refcount.h>
> #include <linux/mutex.h>
> -#include <linux/spinlock.h>
> +#include <linux/refcount.h>
> #include <linux/sched/signal.h>
> +#include <linux/spinlock.h>
> #include <linux/wait.h>
>
> __noreturn void rust_helper_BUG(void)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c
2023-04-26 20:49 ` [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c Ariel Miculas
2023-04-26 20:55 ` Martin Rodriguez Reboredo
2023-04-27 12:36 ` Gary Guo
@ 2023-07-19 20:01 ` Miguel Ojeda
2 siblings, 0 replies; 12+ messages in thread
From: Miguel Ojeda @ 2023-07-19 20:01 UTC (permalink / raw)
To: Ariel Miculas
Cc: rust-for-linux, linux-kernel, ojeda, alex.gaynor, wedsonaf,
boqun.feng, gary, bjorn3_gh, benno.lossin
On Wed, Apr 26, 2023 at 10:50 PM Ariel Miculas <amiculas@cisco.com> wrote:
>
> Sort the #include directives of rust/helpers.c alphabetically and add a
> comment specifying this. The reason for this is to improve readability
> and to be consistent with the other files with a similar approach within
> 'rust/'.
>
> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1003
> Signed-off-by: Ariel Miculas <amiculas@cisco.com>
Applied to `rust-next`, thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-07-19 20:01 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-25 20:28 [PATCH] rust: Sort rust/helpers.c's #include directives Ariel Miculas
2023-04-25 20:37 ` Miguel Ojeda
2023-04-26 8:13 ` Ariel Miculas
2023-04-26 8:23 ` Ariel Miculas
2023-04-26 8:17 ` Ariel Miculas
2023-04-26 17:55 ` Miguel Ojeda
2023-04-26 20:49 ` [PATCH v3] rust: helpers: sort includes alphabetically in rust/helpers.c Ariel Miculas
2023-04-26 20:55 ` Martin Rodriguez Reboredo
2023-04-26 21:04 ` Ariel Miculas
2023-04-26 21:28 ` Miguel Ojeda
2023-04-27 12:36 ` Gary Guo
2023-07-19 20:01 ` Miguel Ojeda
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).