All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tom Rix <trix@redhat.com>
Cc: heikki.krogerus@linux.intel.com, nathan@kernel.org,
	ndesaulniers@google.com, sven@svenpeter.dev,
	alyssa@rosenzweig.io, marcan@marcan.st, martink@posteo.de,
	saranya.gopal@intel.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] usb: typec: tipd: improve handling of failures in interrupt handlers
Date: Thu, 21 Apr 2022 18:24:09 +0200	[thread overview]
Message-ID: <YmGFKdVAuG5JEfzg@kroah.com> (raw)
In-Reply-To: <20220409130013.1474412-1-trix@redhat.com>

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

      parent reply	other threads:[~2022-04-21 16:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09 13:00 [PATCH] usb: typec: tipd: improve handling of failures in interrupt handlers Tom Rix
2022-04-12 21:42 ` Nathan Chancellor
2022-04-21 16:24 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmGFKdVAuG5JEfzg@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alyssa@rosenzweig.io \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=marcan@marcan.st \
    --cc=martink@posteo.de \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=saranya.gopal@intel.com \
    --cc=sven@svenpeter.dev \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.