[PATCH 0/2] rust: add a few helpers

Andreas Hindborg posted 2 patches 1 month, 2 weeks ago
rust/helpers/helpers.c  |  1 +
rust/helpers/num_cpus.c |  8 ++++++++
rust/kernel/lib.rs      | 17 +++++++++++++++++
3 files changed, 26 insertions(+)
[PATCH 0/2] rust: add a few helpers
Posted by Andreas Hindborg 1 month, 2 weeks ago
This series adds two helpers for obtaining information about the number
of numa domans and cpu count of the system.

Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
---
Andreas Hindborg (2):
      rust: add a wrapper for the `num_possible_cpus` C function
      rust: add a wrapper for the `nr_online_nodes` C function

 rust/helpers/helpers.c  |  1 +
 rust/helpers/num_cpus.c |  8 ++++++++
 rust/kernel/lib.rs      | 17 +++++++++++++++++
 3 files changed, 26 insertions(+)
---
base-commit: 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b
change-id: 20260215-cpu-helpers-08efb2572487

Best regards,
-- 
Andreas Hindborg <a.hindborg@kernel.org>
Re: [PATCH 0/2] rust: add a few helpers
Posted by Alice Ryhl 1 month, 2 weeks ago
On Sun, Feb 15, 2026 at 09:10:14PM +0100, Andreas Hindborg wrote:
> This series adds two helpers for obtaining information about the number
> of numa domans and cpu count of the system.
> 
> Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>

I'd make both #[inline].

Alice
Re: [PATCH 0/2] rust: add a few helpers
Posted by Miguel Ojeda 1 month, 2 weeks ago
On Sun, Feb 15, 2026 at 9:10 PM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>
>  rust/kernel/lib.rs      | 17 +++++++++++++++++

Please avoid adding things to the root of the crate.

Also, for both patches, please mention for what it will be used for.

Thanks!

Cheers,
Miguel
Re: [PATCH 0/2] rust: add a few helpers
Posted by Andreas Hindborg 1 month, 2 weeks ago
"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com> writes:

> On Sun, Feb 15, 2026 at 9:10 PM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>>
>>  rust/kernel/lib.rs      | 17 +++++++++++++++++
>
> Please avoid adding things to the root of the crate.

Ok, I'll move them.

>
> Also, for both patches, please mention for what it will be used for.

The are for rust null block. I have sent a few today already without
this mention. I can send a follow up email for each with the details.

Best regards,
Andreas Hindborg