[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190709163827.2u6jeflrhg44q7dy@linux.intel.com>
Date: Tue, 9 Jul 2019 19:38:27 +0300
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Mimi Zohar <zohar@...ux.ibm.com>, Nayna Jain <nayna@...ux.ibm.com>,
linux-integrity@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, Jason Gunthorpe <jgg@...pe.ca>,
Sachin Sant <sachinp@...ux.vnet.ibm.com>,
George Wilson <gcwilson@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>,
Michal Suchanek <msuchanek@...e.de>,
Peter Huewe <peterhuewe@....de>
Subject: Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks
On Mon, Jul 08, 2019 at 03:43:04PM -0700, Christoph Hellwig wrote:
> On Mon, Jul 08, 2019 at 06:24:04PM -0400, Mimi Zohar wrote:
> > > static int tpm_get_pcr_allocation(struct tpm_chip *chip)
> > > {
> > > int rc;
> > >
> > > rc = (chip->flags & TPM_CHIP_FLAG_TPM2) ?
> > > tpm2_get_pcr_allocation(chip) :
> > > tpm1_get_pcr_allocation(chip);
> >
> > >
> > > return rc > 0 ? -ENODEV : rc;
> > > }
> > >
> > > This addresses the issue that Stefan also pointed out. You have to
> > > deal with the TPM error codes.
> >
> > Hm, in the past I was told by Christoph not to use the ternary
> > operator. Have things changed? Other than removing the comment, the
> > only other difference is the return.
>
> In the end it is a matter of personal preference, but I find the
> quote version above using the ternary horribly obsfucated.
I fully agree that the return statement is an obsfucated mess and
not a good place at all for using ternary operator.
/Jarkko
Powered by blists - more mailing lists