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:I fully agree that the return statement is an obsfucated mess and
In the end it is a matter of personal preference, but I find thestatic int tpm_get_pcr_allocation(struct tpm_chip *chip)Hm, in the past I was told by Christoph not to use the ternary
{
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.
operator. ÂHave things changed? ÂOther than removing the comment, the
only other difference is the return.
quote version above using the ternary horribly obsfucated.
not a good place at all for using ternary operator.