From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Date: Tue, 24 Oct 2017 13:56:22 +0000 Subject: Re: [PATCH 1/2] xen-tpmfront: Use common error handling code in vtpm_send() Message-Id: <20171024135622.uswu3apuj23njbna@linux.intel.com> List-Id: References: <9cfcbfd0-75c3-4de5-f735-0ace23d2abcb@users.sourceforge.net> <20171023134257.txnpbg5c5z7uaquf@linux.intel.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring Cc: linux-integrity@vger.kernel.org, Jason Gunthorpe , Peter =?iso-8859-1?Q?H=FCwe?= , LKML , kernel-janitors@vger.kernel.org On Mon, Oct 23, 2017 at 03:57:30PM +0200, SF Markus Elfring wrote: > >> @@ -108,11 +106,14 @@ static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count) > >> if (wait_for_tpm_stat(chip, VTPM_STATUS_IDLE, duration, > >> &priv->read_queue, true) < 0) { > >> /* got a signal or timeout, try to cancel */ > >> - vtpm_cancel(chip); > >> - return -ETIME; > >> + goto cancel_vtpm; > >> } > >> > >> return count; > >> + > >> +cancel_vtpm: > >> + vtpm_cancel(chip); > >> + return -ETIME; > >> } > >> > >> static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count) > >> -- > >> 2.14.2 > >> > > > > NAK > > Do you need any more facts to show the influence of the proposed small code reduction? > > Regards, > Markus Already explained when I reviewed another patch dealing with -ETIME. /Jarkko