linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Paul Menzel <pmenzel@molgen.mpg.de>,
	Krishna Yarlagadda <kyarlagadda@nvidia.com>,
	robh+dt@kernel.org, peterhuewe@gmx.de, jgg@ziepe.ca,
	jarkko@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	jonathanh@nvidia.com, skomatineni@nvidia.com,
	ldewangan@nvidia.com
Subject: Re: [Patch V2 2/4] tpm: tegra: Support SPI tpm wait state detect
Date: Mon, 6 Feb 2023 17:10:32 +0100	[thread overview]
Message-ID: <Y+EmeP3ccaxxaBHX@orome> (raw)
In-Reply-To: <Y+D+SHT63awKdC4H@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

On Mon, Feb 06, 2023 at 01:19:04PM +0000, Mark Brown wrote:
> On Mon, Feb 06, 2023 at 12:02:56PM +0100, Paul Menzel wrote:
> > Am 03.02.23 um 14:01 schrieb Krishna Yarlagadda:
> 
> > > +	/* If the SPI device has an IRQ then use that */
> > > +	if (dev->irq > 0)
> > > +		irq = dev->irq;
> > > +	else
> > > +		irq = -1;
> 
> > Use ternary operator?
> 
> >     irq = dev->irq > 0 ? dev->irq : -1;
> 
> No, please write the code using normal conditional instructions.  This
> isn't the IOCCC and the ternery operator is rarely a legibility aid.

Looks like the SPI core sets dev->irq = 0 for any error other than
-EPROBE_DEFER and the TPM TIS core checks for irq != 0 before trying to
setup that IRQ, so seems like we can just skip this altogether and pass
in dev->irq directly.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-02-06 16:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 13:01 [Patch V2 0/4] Tegra TPM driver with hw flow control Krishna Yarlagadda
2023-02-03 13:01 ` [Patch V2 1/4] dt-bindings: tpm: Add compatible for Tegra TPM Krishna Yarlagadda
2023-02-03 18:57   ` Rob Herring
2023-02-03 13:01 ` [Patch V2 2/4] tpm: tegra: Support SPI tpm wait state detect Krishna Yarlagadda
2023-02-03 23:43   ` kernel test robot
2023-02-04  9:48   ` kernel test robot
2023-02-06 11:02   ` Paul Menzel
2023-02-06 13:19     ` Mark Brown
2023-02-06 16:10       ` Thierry Reding [this message]
2023-02-03 13:01 ` [Patch V2 3/4] spi: dt-bindings: Add Tegra TPM wait polling flag Krishna Yarlagadda
2023-02-03 19:49   ` Rob Herring
2023-02-23 16:26     ` Krishna Yarlagadda
2023-02-03 13:01 ` [Patch V2 4/4] spi: tegra210-quad: Enable TPM wait polling Krishna Yarlagadda

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=Y+EmeP3ccaxxaBHX@orome \
    --to=thierry.reding@gmail.com \
    --cc=broonie@kernel.org \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kyarlagadda@nvidia.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=pmenzel@molgen.mpg.de \
    --cc=robh+dt@kernel.org \
    --cc=skomatineni@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).