lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 31 Mar 2016 13:15:36 +0300
From:	Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To:	Christophe Ricard <christophe-h.ricard@...com>
Cc:	Marcel Selhorst <tpmdd@...horst.net>,
	Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
	"moderated list:TPM DEVICE DRIVER" 
	<tpmdd-devel@...ts.sourceforge.net>,
	open list <linux-kernel@...r.kernel.org>,
	Peter Huewe <peterhuewe@....de>
Subject: Re: [PATCH] tpm: cleanup tpm_tis_remove()

Christophe,

On Thu, Mar 31, 2016 at 01:11:27PM +0300, Jarkko Sakkinen wrote:
> 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.

Can you test this patch your hardware and reply with Tested-by tag if it
does? I can then update your iobase patch to apply on top of this.

I thought it was better idea to simplify the expression a little bit
than make it even worse mess.

/Jarkko

> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
> ---
>  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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ