Skip to contentSkip to conversation

objtool/rust: add one more `noreturn` Rust function

PATCH Applied Miguel Ojeda 2 participants 2 messages Feb 6 – Feb 10

Subsystems (2)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 objtool/rust: add one more `noreturn` Rust function

objtool with Rust 1.84.0 reports:

rust/kernel.o: error: objtool: _RNvXNtNtCsaRPFapPOzLs_6kernel3str9parse_intaNtNtB2_7private12FromStrRadix14from_str_radix() falls through to next function _RNvXNtNtCsaRPFapPOzLs_6kernel3str9parse_intaNtNtB2_7private12FromStrRadix16from_u64_negated()

This is very similar to commit c18f35e49049 ("objtool/rust: add one more noreturn Rust function"), which added from_ascii_radix_panic for Rust 1.86.0, except that Rust 1.84.0 ends up needing from_str_radix_panic.

Thus add it to the list to fix the warning.

Cc FUJITA Tomonori <[email protected]>
Fixes 51d9ee90ea90 ("rust: str: add radix prefixed integer parsing functions")
---
 tools/objtool/check.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/objtool/check.c +2 -1
index 719ec727efd4..7cfb8c8f2fab 100644
@@ -197,7 +197,8 @@ static bool is_rust_noreturn(const struct symbol *func)
 	 * as well as changes to the source code itself between versions (since
 	 * these come from the Rust standard library).
 	 */
-	return str_ends_with(func->name, "_4core3num22from_ascii_radix_panic")				||
+	return str_ends_with(func->name, "_4core3num20from_str_radix_panic")				||
+	       str_ends_with(func->name, "_4core3num22from_ascii_radix_panic")				||
 	       str_ends_with(func->name, "_4core5sliceSp15copy_from_slice17len_mismatch_fail")		||
 	       str_ends_with(func->name, "_4core6option13expect_failed")				||
 	       str_ends_with(func->name, "_4core6option13unwrap_failed")				||

base-commit: 18f7fcd5e69a04df57b563360b88be72471d6b62

Signature · 1 line
2.53.0
Applied
#1 lore raw
Quoted 10 lines · Miguel Ojeda

objtool with Rust 1.84.0 reports:

rust/kernel.o: error: objtool: _RNvXNtNtCsaRPFapPOzLs_6kernel3str9parse_intaNtNtB2_7private12FromStrRadix14from_str_radix() falls through to next function _RNvXNtNtCsaRPFapPOzLs_6kernel3str9parse_intaNtNtB2_7private12FromStrRadix16from_u64_negated()

This is very similar to commit c18f35e49049 ("objtool/rust: add one more noreturn Rust function"), which added from_ascii_radix_panic for Rust 1.86.0, except that Rust 1.84.0 ends up needing from_str_radix_panic.

Quoted 8 lines

Thus add it to the list to fix the warning.

Cc FUJITA Tomonori <[email protected]>
Fixes 51d9ee90ea90 ("rust: str: add radix prefixed integer parsing functions")

Applied to rust-fixes -- thanks!

Since I added the other fix for Gary (Klint), let me add this one too already. I may need to rebase or not.

Cheers,
Miguel