2023-05-03 11:01:05

by Benno Lossin

[permalink] [raw]
Subject: Re: [PATCH] rust: bindings: fix sorting of rust/bindings/bindings_helper.h's #includes

On 27.04.23 00:57, [email protected] wrote:
> From: Roy Matero <[email protected]>
>
> Fix sorting of rust/bindings/binding_helper.h's includes,
> to maintain consistency and rust idoms
>
> Suggested-by: Miguel Ojeda <[email protected]>
> Link: https://github.com/Rust-for-Linux/linux/issues/1002
>
> Signed-off-by: Roy Matero <[email protected]>

A couple of nits for the commit message (these can be
applied by Miguel when picking the patch, if he agrees):
- capitalize 'Rust',
- add a `.` at the end,
- remove the newline between the tags.

I am not sure if the tags at the end should be sorted in any
way.

Reviewed-by: Benno Lossin <[email protected]>

> ---
> rust/bindings/bindings_helper.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> index 50e7a76d5455..dc8d97272e71 100644
> --- a/rust/bindings/bindings_helper.h
> +++ b/rust/bindings/bindings_helper.h
> @@ -6,10 +6,10 @@
> * Sorted alphabetically.
> */
>
> -#include <linux/slab.h>
> #include <linux/refcount.h>
> -#include <linux/wait.h>
> #include <linux/sched.h>
> +#include <linux/slab.h>
> +#include <linux/wait.h>
>
> /* `bindgen` gets confused at certain things. */
> const gfp_t BINDINGS_GFP_KERNEL = GFP_KERNEL;
> --
> 2.40.1
>

--
Cheers,
Benno


2023-05-03 11:09:15

by Miguel Ojeda

[permalink] [raw]
Subject: Re: [PATCH] rust: bindings: fix sorting of rust/bindings/bindings_helper.h's #includes

On Wed, May 3, 2023 at 12:45 PM Benno Lossin <[email protected]> wrote:
>
> A couple of nits for the commit message (these can be
> applied by Miguel when picking the patch, if he agrees):

Given this is one of the "get yourself familiarized with the kernel's
development process" issues that I create from time to time, it is a
good opportunity for Roy to fix those and send a v2.

Roy, could you please do that? Please pass `-v2` to `git format-patch`
when you do so, then also collect the two `Reviewed-by`s you got and
put them above your `Signed-off-by`.

> - capitalize 'Rust',
> - add a `.` at the end,
> - remove the newline between the tags.

Also: typo "idoms" -> "idioms", and the title could be improved to:

rust: bindings: sort `#include`s of `bindings_helper.h`

since "rust/bindings" is already given by the prefixes etc.

However, what does it mean "...and rust idoms"? This is C code, not
Rust code, and thus it should follow kernel C idioms (which, in some
cases, do sort the `#include`s too, so that is fine).

Perhaps remove that bit, or say instead "Rust subsystem idioms"
instead (since we do want to keep them sorted :)

Thanks!

Cheers,
Miguel