KEYS: trusted: Remove set but not used variable 'keyhndl'
diff mbox series

Message ID 1572341612-31893-1-git-send-email-zhengbin13@huawei.com
State New
Headers show
Series
  • KEYS: trusted: Remove set but not used variable 'keyhndl'
Related show

Commit Message

zhengbin Oct. 29, 2019, 9:33 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

security/keys/trusted-keys/trusted_tpm1.c: In function tpm_unseal:
security/keys/trusted-keys/trusted_tpm1.c:588:11: warning: variable keyhndl set but not used [-Wunused-but-set-variable]

It is introduced by commit 00aa975bd031 ("KEYS: trusted:
Create trusted keys subsystem"), but never used, so remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 security/keys/trusted-keys/trusted_tpm1.c | 2 --
 1 file changed, 2 deletions(-)

--
2.7.4

Comments

Jarkko Sakkinen Oct. 29, 2019, 2:16 p.m. UTC | #1
On Tue, Oct 29, 2019 at 05:33:32PM +0800, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> security/keys/trusted-keys/trusted_tpm1.c: In function tpm_unseal:
> security/keys/trusted-keys/trusted_tpm1.c:588:11: warning: variable keyhndl set but not used [-Wunused-but-set-variable]
> 
> It is introduced by commit 00aa975bd031 ("KEYS: trusted:
> Create trusted keys subsystem"), but never used, so remove it.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

I'll pick this to my tree.

/Jarkko
Jarkko Sakkinen Oct. 29, 2019, 2:18 p.m. UTC | #2
On Tue, Oct 29, 2019 at 04:16:37PM +0200, Jarkko Sakkinen wrote:
> On Tue, Oct 29, 2019 at 05:33:32PM +0800, zhengbin wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > security/keys/trusted-keys/trusted_tpm1.c: In function tpm_unseal:
> > security/keys/trusted-keys/trusted_tpm1.c:588:11: warning: variable keyhndl set but not used [-Wunused-but-set-variable]
> > 
> > It is introduced by commit 00aa975bd031 ("KEYS: trusted:
> > Create trusted keys subsystem"), but never used, so remove it.
> > 
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: zhengbin <zhengbin13@huawei.com>
> 
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> 
> I'll pick this to my tree.

Please use fixes tag next time instead of ad hoc.

Anyway, applied, thanks.

/Jarkko

Patch
diff mbox series

diff --git a/security/keys/trusted-keys/trusted_tpm1.c b/security/keys/trusted-keys/trusted_tpm1.c
index eb5074e..d2c5ec1 100644
--- a/security/keys/trusted-keys/trusted_tpm1.c
+++ b/security/keys/trusted-keys/trusted_tpm1.c
@@ -585,7 +585,6 @@  static int tpm_unseal(struct tpm_buf *tb,
 	uint32_t authhandle2 = 0;
 	unsigned char cont = 0;
 	uint32_t ordinal;
-	uint32_t keyhndl;
 	int ret;

 	/* sessions for unsealing key and data */
@@ -601,7 +600,6 @@  static int tpm_unseal(struct tpm_buf *tb,
 	}

 	ordinal = htonl(TPM_ORD_UNSEAL);
-	keyhndl = htonl(SRKHANDLE);
 	ret = tpm_get_random(chip, nonceodd, TPM_NONCE_SIZE);
 	if (ret != TPM_NONCE_SIZE) {
 		pr_info("trusted_key: tpm_get_random failed (%d)\n", ret);