[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72=g=CnEQTkc50qozUdOBZECr7Jr2NCRfGFaKh751i6Sww@mail.gmail.com>
Date: Tue, 9 May 2023 13:10:54 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: Alice Ryhl <aliceryhl@...gle.com>, gary@...yguo.net,
alex.gaynor@...il.com, benno.lossin@...ton.me,
bjorn3_gh@...tonmail.com, boqun.feng@...il.com,
linux-kernel@...r.kernel.org, ojeda@...nel.org,
patches@...ts.linux.dev, rust-for-linux@...r.kernel.org,
wedsonaf@...il.com
Subject: Re: [PATCH v2] rust: error: add missing error codes
On Tue, May 9, 2023 at 10:46 AM Greg KH <gregkh@...uxfoundation.org> wrote:
>
> It depends on which arch you are building for. That's why we have
> per-platform errno.h files, the values are different for different ones.
> So you need to handle them all properly somehow. How is rust going to
> handle per-arch stuff like this?
We can do conditional compilation in the same file, possibly with a
Rust macro which takes a nice table that shows all arches at once.
We can also split into files like C and move it to each `arch/`, there
are a couple of approaches for this. This is best for `MAINTAINERS`,
although these headers almost never change, so it is not a big
advantage.
We could also automatically do everything based on the C headers, too.
Back then it felt to me like too much complexity for little gain,
given those C headers almost never change, but now it may be worth it.
Or, instead, having a test that verifies they are the same instead,
and that way we don't introduce complexity for the build itself.
Alice only needs `ERESTARTSYS` so far, as far as I understand, so
perhaps it is simplest to only add the rest of the non-generic ones
for the moment; and gather opinions on the approaches above meanwhile.
Cheers,
Miguel
Powered by blists - more mailing lists