diff mbox

[04/12] tpm/st33zp24: Remove unneeded tpm_reg in get_burstcount

Message ID 1458502483-16887-5-git-send-email-christophe-h.ricard@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christophe Ricard March 20, 2016, 7:34 p.m. UTC
We can get rid of tpm_reg variable in get_burstcount.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
 drivers/char/tpm/st33zp24/st33zp24.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Jarkko Sakkinen March 22, 2016, 6:16 a.m. UTC | #1
On Sun, Mar 20, 2016 at 08:34:35PM +0100, Christophe Ricard wrote:
> We can get rid of tpm_reg variable in get_burstcount.

Maybe you should send these st33zp24 fixes as a separate patch set
as they are all unrelated to the rework.

/Jarkko

> Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
> ---
>  drivers/char/tpm/st33zp24/st33zp24.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c
> index 944d279..9e91ca7 100644
> --- a/drivers/char/tpm/st33zp24/st33zp24.c
> +++ b/drivers/char/tpm/st33zp24/st33zp24.c
> @@ -208,21 +208,21 @@ static int get_burstcount(struct tpm_chip *chip)
>  {
>  	unsigned long stop;
>  	int burstcnt, status;
> -	u8 tpm_reg, temp;
> +	u8 temp;
>  	struct st33zp24_dev *tpm_dev;
>  
>  	tpm_dev = (struct st33zp24_dev *)TPM_VPRIV(chip);
>  
>  	stop = jiffies + chip->vendor.timeout_d;
>  	do {
> -		tpm_reg = TPM_STS + 1;
> -		status = tpm_dev->ops->recv(tpm_dev->phy_id, tpm_reg, &temp, 1);
> +		status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 1,
> +					    &temp, 1);
>  		if (status < 0)
>  			return -EBUSY;
>  
> -		tpm_reg = TPM_STS + 2;
>  		burstcnt = temp;
> -		status = tpm_dev->ops->recv(tpm_dev->phy_id, tpm_reg, &temp, 1);
> +		status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 2,
> +					    &temp, 1);
>  		if (status < 0)
>  			return -EBUSY;
>  
> -- 
> 2.5.0
> 

------------------------------------------------------------------------------
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=278785351&iu=/4140
Christophe Ricard March 22, 2016, 6:21 a.m. UTC | #2
Hi Jarkko,

ok. Will do.

Best Regards
Christophe

On 22/03/2016 07:16, Jarkko Sakkinen wrote:
> On Sun, Mar 20, 2016 at 08:34:35PM +0100, Christophe Ricard wrote:
>> We can get rid of tpm_reg variable in get_burstcount.
> Maybe you should send these st33zp24 fixes as a separate patch set
> as they are all unrelated to the rework.
>
> /Jarkko
>
>> Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
>> ---
>>   drivers/char/tpm/st33zp24/st33zp24.c | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c
>> index 944d279..9e91ca7 100644
>> --- a/drivers/char/tpm/st33zp24/st33zp24.c
>> +++ b/drivers/char/tpm/st33zp24/st33zp24.c
>> @@ -208,21 +208,21 @@ static int get_burstcount(struct tpm_chip *chip)
>>   {
>>   	unsigned long stop;
>>   	int burstcnt, status;
>> -	u8 tpm_reg, temp;
>> +	u8 temp;
>>   	struct st33zp24_dev *tpm_dev;
>>   
>>   	tpm_dev = (struct st33zp24_dev *)TPM_VPRIV(chip);
>>   
>>   	stop = jiffies + chip->vendor.timeout_d;
>>   	do {
>> -		tpm_reg = TPM_STS + 1;
>> -		status = tpm_dev->ops->recv(tpm_dev->phy_id, tpm_reg, &temp, 1);
>> +		status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 1,
>> +					    &temp, 1);
>>   		if (status < 0)
>>   			return -EBUSY;
>>   
>> -		tpm_reg = TPM_STS + 2;
>>   		burstcnt = temp;
>> -		status = tpm_dev->ops->recv(tpm_dev->phy_id, tpm_reg, &temp, 1);
>> +		status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 2,
>> +					    &temp, 1);
>>   		if (status < 0)
>>   			return -EBUSY;
>>   
>> -- 
>> 2.5.0
>>


------------------------------------------------------------------------------
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=278785351&iu=/4140
diff mbox

Patch

diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c
index 944d279..9e91ca7 100644
--- a/drivers/char/tpm/st33zp24/st33zp24.c
+++ b/drivers/char/tpm/st33zp24/st33zp24.c
@@ -208,21 +208,21 @@  static int get_burstcount(struct tpm_chip *chip)
 {
 	unsigned long stop;
 	int burstcnt, status;
-	u8 tpm_reg, temp;
+	u8 temp;
 	struct st33zp24_dev *tpm_dev;
 
 	tpm_dev = (struct st33zp24_dev *)TPM_VPRIV(chip);
 
 	stop = jiffies + chip->vendor.timeout_d;
 	do {
-		tpm_reg = TPM_STS + 1;
-		status = tpm_dev->ops->recv(tpm_dev->phy_id, tpm_reg, &temp, 1);
+		status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 1,
+					    &temp, 1);
 		if (status < 0)
 			return -EBUSY;
 
-		tpm_reg = TPM_STS + 2;
 		burstcnt = temp;
-		status = tpm_dev->ops->recv(tpm_dev->phy_id, tpm_reg, &temp, 1);
+		status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 2,
+					    &temp, 1);
 		if (status < 0)
 			return -EBUSY;