KEYS: trusted: Remove set but not used variable 'keyhndl'
authorzhengbin <zhengbin13@huawei.com>
Tue, 29 Oct 2019 09:33:32 +0000 (17:33 +0800)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 12 Nov 2019 19:45:37 +0000 (21:45 +0200)
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]

Fixes: 00aa975bd031 ("KEYS: trusted: Create trusted keys subsystem")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
security/keys/trusted-keys/trusted_tpm1.c

index eb5074e4632327bb26bca48653ac693acfa3c523..d2c5ec1e040bb71775a2f7ffe6a104afc30cd30c 100644 (file)
@@ -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);