Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8127485ybi; Tue, 9 Jul 2019 09:39:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRcJraHuw0CjUEBJKJYTXhSev7Y1YLsQkNwhHcQfe83JZio6T80Bt3CSaP7/oyyQOLsDFO X-Received: by 2002:a63:c508:: with SMTP id f8mr32297145pgd.48.1562690377979; Tue, 09 Jul 2019 09:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562690377; cv=none; d=google.com; s=arc-20160816; b=VVCMhpqEZ+qW8DdMLbm6RbtKKmzgabDzR3M2SEHCo99kqgAwKo7zV2KONyr3RLta5y UX9S4UXKy4RVtPQeSwV3vVvQeUukBjk1PGsVDStNh4wKzGLHr8ICnWwnXMtuW0p2oyVt Cdp/NKBV5E00KVrNts/OLoOVbarFdOE/rn42h6bQ1+ITIYi9gWPosNDxDk1Q+t8nuneL PPSt18K/gRn/K8cMQbn1rfMk/1ZgZQs6WdEg8YGDbxtrP2D4akXRVzoR0ncB8Lj16WSY vMw8xSmdGNrBSpIO7vTF9LhHzbmlCzo7pfGaae0U9sSYDtcE3cJNbqDmlauezps43ZiP vlOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nz+y2xCfQbUXj1DzY4NgjLYMWUB9tf5C9PTPrsq/TXk=; b=qoQ7aYVVXsuiWbnSXjMXZK8Tno+mLlKHJ6/VYppdZ72EoIrsKqs56dyWMRH7ZTCvsc l26+SUGSshOAP7lTSFpRpnFeoPZulUUPhx88GI+AuUd3SRmTBJuyhYvpLqbCtqDjofSB NCkwLcuOLdxATCn5lcJ52S6N/DBKEnC36LxLn4ggIX34FKfOh6ApEABvtfag3CY68FgZ qY1JGna45nM6XqgW1wrIUV1LcKUeF0DcyynBu0shw5E8P9R9Qn3se0Ah2CyJDrKstmOl rbG7SQ018rZvuR8EiaVOOgoWvYxdXHOE1+ouVLdZK3K1ecKHmLmFsgi+O1sGUL/SZD8g OwaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14si12575897ply.347.2019.07.09.09.39.22; Tue, 09 Jul 2019 09:39:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726601AbfGIQif (ORCPT + 99 others); Tue, 9 Jul 2019 12:38:35 -0400 Received: from mga17.intel.com ([192.55.52.151]:35477 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbfGIQie (ORCPT ); Tue, 9 Jul 2019 12:38:34 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2019 09:38:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,470,1557212400"; d="scan'208";a="173613342" Received: from mmaitert-mobl2.ger.corp.intel.com (HELO localhost) ([10.249.34.54]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jul 2019 09:38:28 -0700 Date: Tue, 9 Jul 2019 19:38:27 +0300 From: Jarkko Sakkinen To: Christoph Hellwig Cc: Mimi Zohar , Nayna Jain , linux-integrity@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Jason Gunthorpe , Sachin Sant , George Wilson , Michael Ellerman , Michal Suchanek , Peter Huewe Subject: Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks Message-ID: <20190709163827.2u6jeflrhg44q7dy@linux.intel.com> References: <1562458725-15999-1-git-send-email-nayna@linux.ibm.com> <586c629b6d3c718f0c1585d77fe175fe007b27b1.camel@linux.intel.com> <1562624644.11461.66.camel@linux.ibm.com> <20190708224304.GA25838@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190708224304.GA25838@infradead.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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