Re: [PATCH net 2/3] net: ethtool: tsconfig: Fix ts filters and types enums size check

From: Kory Maincent
Date: Thu Jan 30 2025 - 04:25:12 EST


On Wed, 29 Jan 2025 16:45:08 -0800
Jakub Kicinski <kuba@xxxxxxxxxx> wrote:

> On Tue, 28 Jan 2025 16:35:47 +0100 Kory Maincent wrote:
> > Fix the size check for the hwtstamp_tx_types and hwtstamp_rx_filters
> > enumerations.
>
> This is just a code cleanup, the constants are way smaller than 32
> today. The assert being too restrictive makes no functional difference.

That's right, it was mainly for consistency with the other assert. And to avoid
possible future mistake but indeed reaching 32 bit is not expected soon. Should
I remove the patch as it is not a functional issue?

> > Align this check with the approach used in tsinfo for
> > consistency and correctness.
>
> First-principles based explanation of why 32 is the correct value would
> be much better than just alignment. Otherwise reviewer has to figure out
> whether we should be changing from >= to > or vice versa...

Ack, I will if I keep the patch.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com