From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Tomas Winkler <tomas.winkler@intel.com>, Jason Gunthorpe <jgg@ziepe.ca>
Cc: Alexander Usyskin <alexander.usyskin@intel.com>,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2 v5] tpm: cmd_ready command can be issued only after granting locality
Date: Mon, 26 Feb 2018 14:09:40 +0200 [thread overview]
Message-ID: <1519646980.12825.4.camel@linux.intel.com> (raw)
In-Reply-To: <20180225120049.29308-1-tomas.winkler@intel.com>
On Sun, 2018-02-25 at 14:00 +0200, Tomas Winkler wrote:
> if (need_locality && chip->ops->relinquish_locality) {
> - chip->ops->relinquish_locality(chip, chip->locality);
> + /* this coud be on error path, don't override error code */
> + int l_rc = chip->ops->relinquish_locality(chip, chip-
> >locality);
> +
> + if (l_rc)
> + dev_err(&chip->dev, "%s: relinquish_locality: error
> %d\n",
> + __func__, l_rc);
> +
> chip->locality = -1;
> }
The 'l_rc' declaration causes NAK as I've stated before.
Why don't you just make a helper function:
static void tpm_relinquish_locality(struct tpm_chip *chip)
{
int rc;
if (!chip->ops->relinquish_locality)
return 0;
rc = chip->ops->relinquish_locality(chip);
if (rc)
dev_err(&chip->dev, "%s: error %d\n", __func__, rc);
chip->locality = -1;
}
Then the original code would be simply:
if (need_locality)
tpm_relinquish_locality(chip);
/Jarkko
next prev parent reply other threads:[~2018-02-26 12:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-25 12:00 [PATCH 1/2 v5] tpm: cmd_ready command can be issued only after granting locality Tomas Winkler
2018-02-26 12:09 ` Jarkko Sakkinen [this message]
2018-02-26 13:59 ` Winkler, Tomas
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=1519646980.12825.4.camel@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=alexander.usyskin@intel.com \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=tomas.winkler@intel.com \
/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