Re: [PATCH net] net: pse-pd: tps23881: Fix boolean evaluation for bitmask checks

From: Simon Horman
Date: Tue Sep 24 2024 - 03:18:52 EST


On Mon, Sep 23, 2024 at 05:34:26PM +0200, Kory Maincent wrote:
> Fixed potential incorrect boolean evaluation when checking bitmask values.
> The existing code assigned the result of bitwise operations directly to
> boolean variables, which could lead to unexpected values.
> This has been corrected by explicitly converting the results to booleans
> using the !! operator.
>
> Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
> Signed-off-by: Kory Maincent <kory.maincent@xxxxxxxxxxx>

Thanks Kory,

I agree that these changes are correct.
But are they fixes; can this manifest in a bug?
(If so, I suspect the Kernel is riddled with such bugs.)

...