lkml.org 
[lkml]   [2023]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch V2 2/4] tpm: tegra: Support SPI tpm wait state detect
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-03-27 00:11    [W:0.094 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site