mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rajiv Andrade <srajiv@linux.vnet.ibm.com>,
	m.selhorst@sirrix.com
Subject: Re: [PATCH] [REPOST] tpm: suppress durations sysfs output if not read
Date: Wed, 24 Aug 2011 09:31:06 +1000 (EST)	[thread overview]
Message-ID: <alpine.LRH.2.00.1108240930570.1603@tundra.namei.org> (raw)
In-Reply-To: <1314103930.17826.2.camel@d941e-10>

On Tue, 23 Aug 2011, Stefan Berger wrote:

> Suppress the output in the 'durations' sysfs entry if they were not read
> during driver initialization. This is similar to other sysfs entries
> that return nothing if for some reason sending the commands to the TPM
> fails.
> 
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next


> 
> ---
>  drivers/char/tpm/tpm.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> Index: linux-2.6/drivers/char/tpm/tpm.c
> ===================================================================
> --- linux-2.6.orig/drivers/char/tpm/tpm.c
> +++ linux-2.6/drivers/char/tpm/tpm.c
> @@ -963,6 +963,9 @@ ssize_t tpm_show_durations(struct device
>  {
>  	struct tpm_chip *chip = dev_get_drvdata(dev);
>  
> +	if (chip->vendor.duration[TPM_LONG] == 0)
> +		return 0;
> +
>  	return sprintf(buf, "%d %d %d [%s]\n",
>  		       jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]),
>  		       jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]),
> 

-- 
James Morris
<jmorris@namei.org>

      reply	other threads:[~2011-08-23 23:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 12:52 Stefan Berger
2011-08-23 23:31 ` James Morris [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=alpine.LRH.2.00.1108240930570.1603@tundra.namei.org \
    --to=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.selhorst@sirrix.com \
    --cc=srajiv@linux.vnet.ibm.com \
    --cc=stefanb@linux.vnet.ibm.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

all inboxes | Powered by JetHome®