Re: [PATCH v4] scripts: checkpatch: warn on Rust panicking methods

From: Miguel Ojeda

Date: Thu Feb 05 2026 - 16:06:43 EST


On Thu, Feb 5, 2026 at 2:24 PM Dirk Behme <dirk.behme@xxxxxxxxxxxx> wrote:
>
> And how would a developer know that a `checkpatch.pl` warning on
> `unwrap()` is a false positive or not (i.e. is to be fixed)?

It depends on the context, like some other `checkpatch.pl`
errors/warnings, i.e. there is always some degree of developer
discretion. Or, at least, that is the way I think about
`checkpatch.pl` warnings, but maybe the maintainers think otherwise
(Cc'ing).

To give concrete advice, we could perhaps link to
https://rust.docs.kernel.org/kernel/error/type.Result.html#error-codes-in-c-and-rust,
for instance. (Please see my other reply on v5 about it).

Cheers,
Miguel