lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65f8a922-c0dc-4b7e-b701-5f8fd84b5b81@proton.me>
Date: Thu, 15 Aug 2024 14:32:40 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Andreas Hindborg <nmi@...aspace.dk>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>, Masahiro Yamada <masahiroy@...nel.org>
Cc: Andreas Hindborg <a.hindborg@...sung.com>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, Alice Ryhl <aliceryhl@...gle.com>, Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas@...sle.eu>, Sergio González Collado <sergio.collado@...il.com>, rust-for-linux@...r.kernel.org, linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] kbuild: rust: split up helpers.c

On 15.08.24 12:30, Andreas Hindborg wrote:
> From: Andreas Hindborg <a.hindborg@...sung.com>
> 
> This patch splits up the rust helpers C file. When rebasing patch sets on
> upstream linux, merge conflicts in helpers.c is common and time consuming
> [1]. Thus, split the file so that each kernel component can live in a
> separate file.
> 
> This patch lists helper files explicitly and thus conflicts in the file
> list is still likely. However, they should be more simple 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@...sung.com>

Looks good with `--color-moved`.

Reviewed-by: Benno Lossin <benno.lossin@...ton.me>

I got one comment suggestion below, but feel free to take it without.

> ---
> 
> Changes since v2 [2]:
> - Rebase on 6.11-rc3.
> - Use `cpp` instead of Makefile scripting to concatenate files.
> 
> Link:
> https://lore.kernel.org/rust-for-linux/20240507210818.672517-1-ojeda@kernel.org/ [2]
> ---
>  rust/Makefile               |   6 +-
>  rust/helpers.c              | 239 ------------------------------------
>  rust/helpers/README.md      |  17 +++
>  rust/helpers/blk.c          |  16 +++
>  rust/helpers/bug.c          |   9 ++
>  rust/helpers/build_assert.c |  25 ++++
>  rust/helpers/build_bug.c    |  10 ++
>  rust/helpers/err.c          |  22 ++++
>  rust/helpers/helpers.c      |  18 +++
>  rust/helpers/kunit.c        |  10 ++
>  rust/helpers/mutex.c        |  10 ++
>  rust/helpers/page.c         |  24 ++++
>  rust/helpers/refcount.c     |  22 ++++
>  rust/helpers/signal.c       |  10 ++
>  rust/helpers/slab.c         |  10 ++
>  rust/helpers/spinlock.c     |  27 ++++
>  rust/helpers/task.c         |  22 ++++
>  rust/helpers/uaccess.c      |  17 +++
>  rust/helpers/wait.c         |  10 ++
>  rust/helpers/workqueue.c    |  16 +++
>  20 files changed, 298 insertions(+), 242 deletions(-)
>  delete mode 100644 rust/helpers.c
>  create mode 100644 rust/helpers/README.md
>  create mode 100644 rust/helpers/blk.c
>  create mode 100644 rust/helpers/bug.c
>  create mode 100644 rust/helpers/build_assert.c
>  create mode 100644 rust/helpers/build_bug.c
>  create mode 100644 rust/helpers/err.c
>  create mode 100644 rust/helpers/helpers.c
>  create mode 100644 rust/helpers/kunit.c
>  create mode 100644 rust/helpers/mutex.c
>  create mode 100644 rust/helpers/page.c
>  create mode 100644 rust/helpers/refcount.c
>  create mode 100644 rust/helpers/signal.c
>  create mode 100644 rust/helpers/slab.c
>  create mode 100644 rust/helpers/spinlock.c
>  create mode 100644 rust/helpers/task.c
>  create mode 100644 rust/helpers/uaccess.c
>  create mode 100644 rust/helpers/wait.c
>  create mode 100644 rust/helpers/workqueue.c

[...]

> diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
> new file mode 100644
> index 000000000000..74dd4275c233
> --- /dev/null
> +++ b/rust/helpers/helpers.c
> @@ -0,0 +1,18 @@
> +// SPDX-License-Identifier: GPL-2.0
> +

Should there be a comment here noting that these includes are sorted
alphabetically? Since then (most) conflicts in this file can simply be
solved by concatenating all hunks and doing `:'<,'>!sort | uniq`?

---
Cheers,
Benno

> +#include "blk.c"
> +#include "bug.c"
> +#include "build_assert.c"
> +#include "build_bug.c"
> +#include "err.c"
> +#include "kunit.c"
> +#include "mutex.c"
> +#include "page.c"
> +#include "refcount.c"
> +#include "signal.c"
> +#include "slab.c"
> +#include "spinlock.c"
> +#include "task.c"
> +#include "uaccess.c"
> +#include "wait.c"
> +#include "workqueue.c"


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ