mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kent Yoder <key@linux.vnet.ibm.com>
To: Peter Huewe <peterhuewe@gmx.de>
Cc: Marcel Selhorst <tpmdd@selhorst.net>,
	Sirrix AG <tpmdd@sirrix.com>,
	tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] char/tpm: Remove duplicated lookup table
Date: Wed, 14 Nov 2012 16:17:38 -0600	[thread overview]
Message-ID: <20121114221738.GB533@ennui.austin.ibm.com> (raw)
In-Reply-To: <1352759838-27175-1-git-send-email-peterhuewe@gmx.de>

On Mon, Nov 12, 2012 at 11:37:17PM +0100, Peter Huewe wrote:
> The entries in tpm_protected_ordinal_duration are exactly the same as
> the first 12 in tpm_ordinal_duration, so we can simply remove this one,
> and save some bytes.
> 
> This does not change the behavior of the driver.
> 
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>

 Applied, thanks.

Kent

> ---
> This patch reflects only my opinion and work, 
> and is not related to my employer or anybody else.
> 
>  drivers/char/tpm/tpm.c |   18 +-----------------
>  1 files changed, 1 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
> index 93211df..9e3c529 100644
> --- a/drivers/char/tpm/tpm.c
> +++ b/drivers/char/tpm/tpm.c
> @@ -65,21 +65,6 @@ static DECLARE_BITMAP(dev_mask, TPM_NUM_DEVICES);
>   * values of the SHORT, MEDIUM, and LONG durations are retrieved
>   * from the chip during initialization with a call to tpm_get_timeouts.
>   */
> -static const u8 tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL] = {
> -	TPM_UNDEFINED,		/* 0 */
> -	TPM_UNDEFINED,
> -	TPM_UNDEFINED,
> -	TPM_UNDEFINED,
> -	TPM_UNDEFINED,
> -	TPM_UNDEFINED,		/* 5 */
> -	TPM_UNDEFINED,
> -	TPM_UNDEFINED,
> -	TPM_UNDEFINED,
> -	TPM_UNDEFINED,
> -	TPM_SHORT,		/* 10 */
> -	TPM_SHORT,
> -};
> -
>  static const u8 tpm_ordinal_duration[TPM_MAX_ORDINAL] = {
>  	TPM_UNDEFINED,		/* 0 */
>  	TPM_UNDEFINED,
> @@ -357,8 +342,7 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip,
>  	else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) <
>  		 TPM_MAX_PROTECTED_ORDINAL)
>  		duration_idx =
> -		    tpm_protected_ordinal_duration[ordinal &
> -						   TPM_PROTECTED_ORDINAL_MASK];
> +		    tpm_ordinal_duration[ordinal & TPM_PROTECTED_ORDINAL_MASK];
> 
>  	if (duration_idx != TPM_UNDEFINED)
>  		duration = chip->vendor.duration[duration_idx];
> -- 
> 1.7.8.6
> 


      parent reply	other threads:[~2012-11-14 22:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 22:37 Peter Huewe
2012-11-12 22:37 ` [PATCH 2/2] char/tpm: simplify duration calculation and eliminate sparse warning Peter Huewe
2012-11-14 22:18   ` Kent Yoder
2012-11-14 22:37     ` Peter Hüwe
2012-11-15 16:42       ` Kent Yoder
     [not found]         ` <fa7287de-06dd-40b4-9d9a-56fcc8a5f670@email.android.com>
2012-11-15 21:53           ` Kent Yoder
2012-11-15 23:31             ` [PATCH v2] char/tpm: simplify duration calculation and eliminate smatch warning Peter Huewe
2012-11-16 17:33               ` Kent Yoder
2012-11-14 22:17 ` Kent Yoder [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=20121114221738.GB533@ennui.austin.ibm.com \
    --to=key@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    --cc=tpmdd@sirrix.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®