Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755207AbcCaGiA (ORCPT ); Thu, 31 Mar 2016 02:38:00 -0400 Received: from mga03.intel.com ([134.134.136.65]:15174 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbcCaGh7 (ORCPT ); Thu, 31 Mar 2016 02:37:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,421,1455004800"; d="scan'208";a="935254652" Date: Thu, 31 Mar 2016 09:37:56 +0300 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Peter Huewe , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH] tpm: remove redundant code from self-test functions Message-ID: <20160331063756.GA6393@intel.com> References: <1459344045-21602-1-git-send-email-jarkko.sakkinen@linux.intel.com> <20160331054623.GB20504@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160331054623.GB20504@obsidianresearch.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 618 Lines: 17 On Wed, Mar 30, 2016 at 11:46:23PM -0600, Jason Gunthorpe wrote: > On Wed, Mar 30, 2016 at 04:20:45PM +0300, Jarkko Sakkinen wrote: > > > - rc = be32_to_cpu(cmd.header.out.return_code); > > if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) { > > This line is the entire reason it is open coded, I see it being > removed, but I don't see how the functionality is maintained? When tpm_trance_cmd() returns a positive number it is the TPM error code that it returns. tpm_pcr_read() does pass through whatever tpm_trace_cmd() returns so the above condition should still work as expected. > Jason /Jarkko