[PATCH] rust: bug: fix `dead_code` warning in `warn_on!`

FUJITA Tomonori tomo at flapping.org
Fri Aug 7 22:30:13 PDT 2026


On Sat, 8 Aug 2026 01:21:23 +0200
Miguel Ojeda <miguel.ojeda.sandonis at gmail.com> wrote:

> On Sat, Aug 8, 2026 at 12:43 AM FUJITA Tomonori <tomo at flapping.org> wrote:
>>
>> I sent a fix for this bug a few days ago:
>>
>> https://lore.kernel.org/all/20260801024841.786664-1-tomo@flapping.org/
> 
> Ah, right, sorry! I also saw another one with `rusttest` for arm64 and
> riscv64. Did you see that one? We probably need a `cfg(testlib)`
> split.

Is this the one you saw?

error: invalid instruction mnemonic 'brk'
  --> rust/kernel/bug.rs:63:17
   |
63 | /                 concat!(
64 | |                     "/* {size} */",
65 | |                     include!(concat!(env!("OBJTREE"), "/rust/kernel/generated_arch_warn_asm.rs")),
66 | |                     include!(concat!(env!("OBJTREE"), "/rust/kernel/generated_arch_reachable_asm.rs")));
   | |_______________________________________________________________________________________________________^
   |
note: instantiated into assembly here
  --> <inline asm>:1:115
   |
 1 |     /* 8 */.pushsection __bug_table,"aw"; .align 2; 14470: .long 14471f - .;.short 2305;.align 2; .popsection; 14471:brk 0x800
   |                                                                                                                      ^^^

It shows up when `make rusttest` runs with `ARCH=` set to an
architecture other than the host's.

I posted a `cfg(testlib)` split for it:

https://lore.kernel.org/all/20260808022608.1125174-1-tomo@flapping.org/


While at it, a question: what is `rusttest` meant to cover when
`ARCH=` is not the host's?



More information about the linux-arm-kernel mailing list