diff mbox series

tpm/st33zp24: Fix name collision with TPM_BUFSIZE

Message ID 20190201174117.23440-1-jarkko.sakkinen@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series tpm/st33zp24: Fix name collision with TPM_BUFSIZE | expand

Commit Message

Jarkko Sakkinen Feb. 1, 2019, 5:41 p.m. UTC
Rename TPM_BUFSIZE defined in drivers/char/tpm/st33zp24/st33zp24.h to
ST33ZP24_BUFSIZE as it collides with TPM_BUFSIZE defined in
drivers/char/tpm/tpm.h.

Cc: stable@vger.kernel.org
Fixes: bf38b8710892 ("tpm/tpm_i2c_stm_st33: Split tpm_i2c_tpm_st33 in 2 layers (core + phy)")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/st33zp24/i2c.c      | 2 +-
 drivers/char/tpm/st33zp24/spi.c      | 2 +-
 drivers/char/tpm/st33zp24/st33zp24.h | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Mimi Zohar Feb. 3, 2019, 11 p.m. UTC | #1
Hi Jarkko,

On Fri, 2019-02-01 at 19:41 +0200, Jarkko Sakkinen wrote:
> Rename TPM_BUFSIZE defined in drivers/char/tpm/st33zp24/st33zp24.h to
> ST33ZP24_BUFSIZE as it collides with TPM_BUFSIZE defined in
> drivers/char/tpm/tpm.h.
> 
> Cc: stable@vger.kernel.org
> Fixes: bf38b8710892 ("tpm/tpm_i2c_stm_st33: Split tpm_i2c_tpm_st33 in 2 layers (core + phy)")
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

FYI, I'm seeing a similar redefined TPM_BUFSIZE in tpm_i2c_infineon.c.

Mimi

> ---
>  drivers/char/tpm/st33zp24/i2c.c      | 2 +-
>  drivers/char/tpm/st33zp24/spi.c      | 2 +-
>  drivers/char/tpm/st33zp24/st33zp24.h | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c
> index be5d1abd3e8e..8390c5b54c3b 100644
> --- a/drivers/char/tpm/st33zp24/i2c.c
> +++ b/drivers/char/tpm/st33zp24/i2c.c
> @@ -33,7 +33,7 @@
>  
>  struct st33zp24_i2c_phy {
>  	struct i2c_client *client;
> -	u8 buf[TPM_BUFSIZE + 1];
> +	u8 buf[ST33ZP24_BUFSIZE + 1];
>  	int io_lpcpd;
>  };
>  
> diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c
> index d7909ab287a8..ff019a1e3c68 100644
> --- a/drivers/char/tpm/st33zp24/spi.c
> +++ b/drivers/char/tpm/st33zp24/spi.c
> @@ -63,7 +63,7 @@
>   * some latency byte before the answer is available (max 15).
>   * We have 2048 + 1024 + 15.
>   */
> -#define ST33ZP24_SPI_BUFFER_SIZE (TPM_BUFSIZE + (TPM_BUFSIZE / 2) +\
> +#define ST33ZP24_SPI_BUFFER_SIZE (ST33ZP24_BUFSIZE + (ST33ZP24_BUFSIZE / 2) +\
>  				  MAX_SPI_LATENCY)
>  
>  
> diff --git a/drivers/char/tpm/st33zp24/st33zp24.h b/drivers/char/tpm/st33zp24/st33zp24.h
> index 6f4a4198af6a..20da0a84988d 100644
> --- a/drivers/char/tpm/st33zp24/st33zp24.h
> +++ b/drivers/char/tpm/st33zp24/st33zp24.h
> @@ -18,8 +18,8 @@
>  #ifndef __LOCAL_ST33ZP24_H__
>  #define __LOCAL_ST33ZP24_H__
>  
> -#define TPM_WRITE_DIRECTION             0x80
> -#define TPM_BUFSIZE                     2048
> +#define TPM_WRITE_DIRECTION	0x80
> +#define ST33ZP24_BUFSIZE	2048
>  
>  struct st33zp24_dev {
>  	struct tpm_chip *chip;
Jarkko Sakkinen Feb. 4, 2019, 12:06 p.m. UTC | #2
On Sun, Feb 03, 2019 at 06:00:54PM -0500, Mimi Zohar wrote:
> Hi Jarkko,
> 
> On Fri, 2019-02-01 at 19:41 +0200, Jarkko Sakkinen wrote:
> > Rename TPM_BUFSIZE defined in drivers/char/tpm/st33zp24/st33zp24.h to
> > ST33ZP24_BUFSIZE as it collides with TPM_BUFSIZE defined in
> > drivers/char/tpm/tpm.h.
> > 
> > Cc: stable@vger.kernel.org
> > Fixes: bf38b8710892 ("tpm/tpm_i2c_stm_st33: Split tpm_i2c_tpm_st33 in 2 layers (core + phy)")
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> 
> FYI, I'm seeing a similar redefined TPM_BUFSIZE in tpm_i2c_infineon.c.

Ugh, I'll fix that one too and send a revised patch. Thanks for pointing
that one out!

/Jarkko
diff mbox series

Patch

diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c
index be5d1abd3e8e..8390c5b54c3b 100644
--- a/drivers/char/tpm/st33zp24/i2c.c
+++ b/drivers/char/tpm/st33zp24/i2c.c
@@ -33,7 +33,7 @@ 
 
 struct st33zp24_i2c_phy {
 	struct i2c_client *client;
-	u8 buf[TPM_BUFSIZE + 1];
+	u8 buf[ST33ZP24_BUFSIZE + 1];
 	int io_lpcpd;
 };
 
diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c
index d7909ab287a8..ff019a1e3c68 100644
--- a/drivers/char/tpm/st33zp24/spi.c
+++ b/drivers/char/tpm/st33zp24/spi.c
@@ -63,7 +63,7 @@ 
  * some latency byte before the answer is available (max 15).
  * We have 2048 + 1024 + 15.
  */
-#define ST33ZP24_SPI_BUFFER_SIZE (TPM_BUFSIZE + (TPM_BUFSIZE / 2) +\
+#define ST33ZP24_SPI_BUFFER_SIZE (ST33ZP24_BUFSIZE + (ST33ZP24_BUFSIZE / 2) +\
 				  MAX_SPI_LATENCY)
 
 
diff --git a/drivers/char/tpm/st33zp24/st33zp24.h b/drivers/char/tpm/st33zp24/st33zp24.h
index 6f4a4198af6a..20da0a84988d 100644
--- a/drivers/char/tpm/st33zp24/st33zp24.h
+++ b/drivers/char/tpm/st33zp24/st33zp24.h
@@ -18,8 +18,8 @@ 
 #ifndef __LOCAL_ST33ZP24_H__
 #define __LOCAL_ST33ZP24_H__
 
-#define TPM_WRITE_DIRECTION             0x80
-#define TPM_BUFSIZE                     2048
+#define TPM_WRITE_DIRECTION	0x80
+#define ST33ZP24_BUFSIZE	2048
 
 struct st33zp24_dev {
 	struct tpm_chip *chip;