Re: [PATCH] usb: typec: tipd: improve handling of failures in interrupt handlers

From: Greg KH
Date: Thu Apr 21 2022 - 12:27:14 EST


On Sat, Apr 09, 2022 at 09:00:13AM -0400, Tom Rix wrote:
> clang static analysis reports this representative issue
> core.c:516:6: warning: Branch condition evaluates
> to a garbage value
> if (event)
> ^~~~~
>
> In cd321x_interrupt(), a successful call to
> tps6598x_read64() is the only way event is set,
> and if a failure happens the irq should not be
> reported as handled.

Please use the full 72 columns.

>
> Instead of initializing event, rework the
> usage of ret by initializing it to IRQ_NONE
> and then setting it when event is known to
> be not zero. This removes the if-statement
> before the return.

So the code today is correct, but clang is wrong? We don't need to do
anything then...

> tps6598x_interrupt() is similar.

This line makes no sense, sorry.

greg k-h