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

FUJITA Tomonori <[email protected]>
Newsgroups dev.linux.lists.soc,dev.linux.lists.loongarch,org.infradead.lists.linux-arm-kernel,org.kernel.vger.rust-for-linux,org.kernel.vger.stable
Message-ID <[email protected]>
On Sat, 8 Aug 2026 01:21:23 +0200
Miguel Ojeda <[email protected]> wrote:

> On Sat, Aug 8, 2026 at 12:43 AM FUJITA Tomonori <[email protected]> wrote:
>>
>> I sent a fix for this bug a few days ago:
>>
>> https://lore.kernel.org/all/[email protected]/
> 
> 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/[email protected]/


While at it, a question: what is `rusttest` meant to cover when
`ARCH=` is not the host's?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.