Skip to content

Commit 559fbb4

Browse files
author
Jarkko Sakkinen
committed
tpm: cleanup tpm_tis_remove()
Created a local variable pointing to the INT_ENABLE_x register. The expression clearing INT_ENABLE_x.globalIntEnable is unreadable and hard to modify without surpassing the 80 char boundary. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Christophe Ricard <christophe-h.ricard@st.com>
1 parent 7742c39 commit 559fbb4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/char/tpm/tpm_tis.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -650,15 +650,13 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts");
650650

651651
static void tpm_tis_remove(struct tpm_chip *chip)
652652
{
653+
void __iomem *reg = chip->vendor.iobase +
654+
TPM_INT_ENABLE(chip->vendor.locality);
655+
653656
if (chip->flags & TPM_CHIP_FLAG_TPM2)
654657
tpm2_shutdown(chip, TPM2_SU_CLEAR);
655658

656-
iowrite32(~TPM_GLOBAL_INT_ENABLE &
657-
ioread32(chip->vendor.iobase +
658-
TPM_INT_ENABLE(chip->vendor.
659-
locality)),
660-
chip->vendor.iobase +
661-
TPM_INT_ENABLE(chip->vendor.locality));
659+
iowrite32(~TPM_GLOBAL_INT_ENABLE & ioread32(reg), reg);
662660
release_locality(chip, chip->vendor.locality, 1);
663661
}
664662

0 commit comments

Comments
 (0)