Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7191077ybi; Mon, 8 Jul 2019 16:33:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbtmAfteq4w2V7V5N+Lxh99wnwhUmCVBRTgz6xER537Tm+FZTz7hNJceIG9krDmV9Sa59T X-Received: by 2002:a17:902:42d:: with SMTP id 42mr27068326ple.228.1562628826739; Mon, 08 Jul 2019 16:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562628826; cv=none; d=google.com; s=arc-20160816; b=V7Mdn8y7BF8pfqRRiqFgTg/RlzjM1X/cMBh2hJSSXplqrxxwej+yhurgeTHTIeZbCC Q2/g577D3y+PSbnvp31EYJLr+U94caC3PbxC7/JC7BTnq1qDQ0qHtRkT80I2aQ+3WG/R z/EnBfOszi4Bt9oFZHDbTKmK79f1tG12WpxIW6MMiYuCig6TWLFoQktMK0YBkuzVOTrK rocOsEpani9Cyzic7V+qKRQx9cbZ5ul0tmDUSlGF6cK8A9TPzV87K9MwvoDj0K24oNg6 hqHna5/FavjvaYRMzzDnrGIlyZpwuBB+Q05LzHEekUys4suIFs42qZphRLwpsI8Ug0+l 6E0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject; bh=dKjq6j29IafCK2ylNI/kUuZXFhXQss/DrY0nsdUX/Vg=; b=gIEsLyxkkdJXqoYHGvPM2c2EmQ+koAmAMEwONm5zZ8l+xU56AGCfvbSXJl9ECvPlro D1LfTtNNFyXzbvoVoF1g0vGavFJgoS6TYBJkiMC9yzF4u/gcDS4driNc6ISqQxHQ9olC ohGUkruQq1DsA5Jlh9Eq19tg0bhgyKHyZQHimpSgHu6pQgaOxPJpOfp+xrh+ageCrZrC CCf2etjfOcfLOHg1y0G7qA7U5tNWBt660K8vrFHN69+GkrcIjAHCXBLn3sKq042AYQlr xS4BJ4e5ySOriZsLjJY4ojf1f2gtP75I6nvdip/vZUbu2y1KFJM7bTprzNOMK9MuT3b4 SRXA== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si783542pjs.95.2019.07.08.16.33.31; Mon, 08 Jul 2019 16:33:46 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbfGHWYY (ORCPT + 99 others); Mon, 8 Jul 2019 18:24:24 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:9402 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725815AbfGHWYY (ORCPT ); Mon, 8 Jul 2019 18:24:24 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x68MM2kS132420 for ; Mon, 8 Jul 2019 18:24:23 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tmdtb1f6d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 08 Jul 2019 18:24:22 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Jul 2019 23:24:21 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 8 Jul 2019 23:24:18 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x68MOGwh62586898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Jul 2019 22:24:17 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DF966A4055; Mon, 8 Jul 2019 22:24:16 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5545FA4051; Mon, 8 Jul 2019 22:24:15 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.110.58]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 8 Jul 2019 22:24:15 +0000 (GMT) Subject: Re: [PATCH v2] tpm: tpm_ibm_vtpm: Fix unallocated banks From: Mimi Zohar To: Jarkko Sakkinen , Nayna Jain , linux-integrity@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Jason Gunthorpe , Sachin Sant , George Wilson , Michael Ellerman , Michal Suchanek , Peter Huewe , Christoph Hellwig Date: Mon, 08 Jul 2019 18:24:04 -0400 In-Reply-To: <586c629b6d3c718f0c1585d77fe175fe007b27b1.camel@linux.intel.com> References: <1562458725-15999-1-git-send-email-nayna@linux.ibm.com> <586c629b6d3c718f0c1585d77fe175fe007b27b1.camel@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19070822-0020-0000-0000-000003516D0B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070822-0021-0000-0000-000021A5192F Message-Id: <1562624644.11461.66.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-08_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907080276 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jarkko, On Mon, 2019-07-08 at 18:11 +0300, Jarkko Sakkinen wrote: > On Sat, 2019-07-06 at 20:18 -0400, Nayna Jain wrote: > > +/* > > + * tpm_get_pcr_allocation() - initialize the chip allocated banks for PCRs > > + * @chip: TPM chip to use. > > + */ > > +static int tpm_get_pcr_allocation(struct tpm_chip *chip) > > +{ > > + int rc; > > + > > + if (chip->flags & TPM_CHIP_FLAG_TPM2) > > + rc = tpm2_get_pcr_allocation(chip); > > + else > > + rc = tpm1_get_pcr_allocation(chip); > > + > > + return rc; > > +} > > It is just a trivial static function, which means that kdoc comment is > not required and neither it is useful. Please remove that. I would > rewrite the function like: > > 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. Mimi