Re: [PATCH 2/2] devres: Provide kmalloc_obj*-style API for devm_kmalloc
From: Linus Torvalds
Date: Thu Nov 12 2026 - 13:11:07 EST
On Thu, 12 Nov 2026 at 09:33, Alejandro Colomar
<alx+linux-hardening@xxxxxxxxxx> wrote:
>
> I don't agree that the code is worse. It's _different_, just like Rust
> forces one to write different code
different *is* worse. We do not want to have random strange syntax
that differs from all normal rules for some little unimportant detail
when I already outlined something that has standard C syntax and is
superior from a technical angle.
Code needs to be legible, and that means that it should follow a
pattern that people are used to, not have random single-byte markers.
The goal is to be readable to *HUMANS*. And no, removing the (more
common) function to allocate just a single object in favor of using a
"1" is not human-friendly. And adding a pointless "," to make a
compiler think it's not a missing argument is not human-friendly.
And honestly, I don't think Rust is a great example of human-friendly either.
Linus