tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm: cleanup tpm_tis_remove()
@ 2016-03-31 10:11 Jarkko Sakkinen
  2016-03-31 10:15 ` Jarkko Sakkinen
  0 siblings, 1 reply; 7+ messages in thread
From: Jarkko Sakkinen @ 2016-03-31 10:11 UTC (permalink / raw)
  To: Peter Huewe
  Cc: open list, moderated list:TPM DEVICE DRIVER, Christophe Ricard

Created a local variable for the register in order to clean up
experession where TPM_GLOBAL_INT_ENABLE is cleared. This expression is
horrible to read and makes changing the function uncomfortable because
like easily surpass 80 characters.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/char/tpm/tpm_tis.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 068f021..ce2b984 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -658,15 +658,14 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts");
 
 static void tpm_tis_remove(struct tpm_chip *chip)
 {
+	void __iomem *reg = chip->vendor.iobase +
+		TPM_INT_ENABLE(chip->vendor.locality);
+
 	if (chip->flags & TPM_CHIP_FLAG_TPM2)
 		tpm2_shutdown(chip, TPM2_SU_CLEAR);
 
-	iowrite32(~TPM_GLOBAL_INT_ENABLE &
-		  ioread32(chip->vendor.iobase +
-			   TPM_INT_ENABLE(chip->vendor.
-					  locality)),
-		  chip->vendor.iobase +
-		  TPM_INT_ENABLE(chip->vendor.locality));
+	iowrite32(~TPM_GLOBAL_INT_ENABLE & ioread32(reg), reg);
+
 	release_locality(chip, chip->vendor.locality, 1);
 }
 
-- 
2.7.4


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-31 16:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-31 10:11 [PATCH] tpm: cleanup tpm_tis_remove() Jarkko Sakkinen
2016-03-31 10:15 ` Jarkko Sakkinen
     [not found]   ` <20160331101536.GA20686-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-31 10:17     ` Jarkko Sakkinen
     [not found]       ` <20160331101713.GB20686-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-31 10:29         ` Jarkko Sakkinen
     [not found]           ` <20160331102958.GA22364-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-31 10:33             ` Christophe Henri RICARD
2016-03-31 14:55             ` Christophe Henri RICARD
     [not found]               ` <8646C2A85C5D44419E1B33F16B0BD501024AFA6B6E-+EwDPpWUVoThJTuQ9jeba9BPR1lH4CV8@public.gmane.org>
2016-03-31 16:19                 ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).