[PATCH v6 0/4] rust: Add bug/warn abstractions
Miguel Ojeda
miguel.ojeda.sandonis at gmail.com
Tue Jul 22 17:48:20 PDT 2025
On Fri, May 2, 2025 at 11:46 AM FUJITA Tomonori
<fujita.tomonori at gmail.com> wrote:
>
> This patchset adds warn_on macro with the bug/warn abstraction that
> utilizes the kernel's BUG/WARN feature via assembly.
Ok, let's move forward with this.
I took a look at the first three patches and compared the expanded
output for the existing macros, to make sure we (hopefully) don't
break anything else.
It seems OK, I only noticed a removed newline. Was that intentional?
There was also a bad parameter name, but that was not hurting anything
since it was unused.
(For the x86 one could be closer removing a couple spaces, but it
should not matter and other x86 files format it that way, so I didn't
change it. I also noticed unexpected spaces used for aligning the
macro, but it turned out it was in the original already, so I left it
also unchanged.)
Then I found a few more bits on the last patch.
Tomo, could you please double-check you are OK with all the changes,
and please run the tests you did back then on `rust-next` again for
all arches, given it has been a while since you posted it (plus I did
a few changes on top, after all)? I would appreciate it, thanks in
advance!
To be clear, I didn't re-check every single thing/combination, but
hopefully what I caught helps. Since there are no users anyway (of the
last patch) right now, it should be fairly safe.
Applied to `rust-next` -- thanks everyone!
[ Fixed typo in macro parameter name. - Miguel ]
[ Remove ending newline in `ARCH_WARN_ASM` content to be closer to the
original. - Miguel ]
[ Avoid evaluating the condition twice (a good idea in general,
but it also matches the C side). Simplify with `as_char_ptr()`
to avoid a cast. Cast to `ffi` integer types for
`warn_slowpath_fmt`. Avoid cast for `null()`. - Miguel ]
Cheers,
Miguel
More information about the linux-arm-kernel
mailing list