Re: [PATCH] x86/lib: Fix num_digits() signed overflow for INT_MIN
From: David Laight
Date: Wed Jan 21 2026 - 06:06:34 EST
On Tue, 20 Jan 2026 21:13:46 +0100
Borislav Petkov <bp@xxxxxxxxx> wrote:
> On Tue, Jan 20, 2026 at 11:50:41AM -0800, H. Peter Anvin wrote:
> > For negative numbers? Dave Hansen pointed out that we currently don't ever
> > pass negative numbers, in which case it would make more sense to have the
> > function simply take an unsigned int.
>
> Yes, that's why I'm asking what we're even fixing here...
You can certainly just document it doesn't work for INT_MIN.
David