From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
linux-integrity@vger.kernel.org
Cc: "Jason Gunthorpe" <jgunthorpe@obsidianresearch.com>,
"Peter Hüwe" <PeterHuewe@gmx.de>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] tpm_i2c_nuvoton: Use common error handling code in i2c_nuvoton_send()
Date: Mon, 23 Oct 2017 15:46:52 +0200 [thread overview]
Message-ID: <65bebe74-587b-eb5f-44f3-2e354fd2b82d@users.sourceforge.net> (raw)
In-Reply-To: <20171023133813.3xflw4k2npydp26c@linux.intel.com>
>> @@ -457,12 +455,15 @@ static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len)
>> &priv->read_queue);
>> if (rc) {
>> dev_err(dev, "%s() timeout command duration\n", __func__);
>> - i2c_nuvoton_ready(chip);
>> - return rc;
>> + goto write_ready;
>> }
>>
>> dev_dbg(dev, "%s() -> %zd\n", __func__, len);
>> return len;
>> +
>> +write_ready:
>> + i2c_nuvoton_ready(chip);
>> + return rc;
>> }
>>
>> static bool i2c_nuvoton_req_canceled(struct tpm_chip *chip, u8 status)
>> --
>> 2.14.2
>>
>
> Setting the commandReady bit gives means to abort the command.
> Setting the bit is not the end goal.
Does your constructive feedback mean that there are any more implementation details
to consider besides the suggested code layout adjustment?
> Use something like err_cancel instead.
I am unsure about this suggestion. Will a simple replacement be sufficient
at the end?
Regards,
Markus
prev parent reply other threads:[~2017-10-23 13:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-21 20:11 [PATCH] tpm_i2c_nuvoton: Use common error handling code in i2c_nuvoton_send() SF Markus Elfring
2017-10-23 13:38 ` Jarkko Sakkinen
2017-10-23 13:46 ` SF Markus Elfring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65bebe74-587b-eb5f-44f3-2e354fd2b82d@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=PeterHuewe@gmx.de \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).