Re: [PATCH] mm/oom_kill: Remove unnecessary integer promotion in format string

From: Andrew Morton

Date: Tue Dec 30 2025 - 15:33:37 EST


On Mon, 29 Dec 2025 09:27:18 +0100 Michal Hocko <mhocko@xxxxxxxx> wrote:

> On Sun 28-12-25 15:44:55, Dipendra Khadka wrote:
> > The 'h' length modifier in '%hd' is unnecessary as short integers are
> > promoted to int in variadic functions. Use '%d' instead.
> >
> > Signed-off-by: Dipendra Khadka <kdipendra88@xxxxxxxxx>
>
> Why should we change the currently correct code in the first place?
> What is an added value?

It reduces vmlinux by 2 bytes ;)

It's a teeny issue but I do like the present code - be very explicit
and careful about the types we're dealing with, don't rely on unobvious
C rules.