diff mbox series

[v1] tpm: Fix regression in tpm_tis_synquacer.c

Message ID 20220322105933.1242-1-johannes.holland@infineon.com (mailing list archive)
State New, archived
Headers show
Series [v1] tpm: Fix regression in tpm_tis_synquacer.c | expand

Commit Message

Johannes Holland March 22, 2022, 10:59 a.m. UTC
Remove unused variables and type mismatch (integer from pointer without
a cast).

Signed-off-by: Johannes Holland <johannes.holland@infineon.com>
---
 drivers/char/tpm/tpm_tis_synquacer.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

Comments

Paul Menzel March 22, 2022, 11:02 a.m. UTC | #1
Dear Johannes,


Thank you for the patch.


Am 22.03.22 um 11:59 schrieb Johannes Holland:
> Remove unused variables and type mismatch (integer from pointer without
> a cast).

Maybe also paste the compiler error message?

As it’s a regression, please also add a Fixes line.


Kind regards,

Paul


> Signed-off-by: Johannes Holland <johannes.holland@infineon.com>
> ---
>   drivers/char/tpm/tpm_tis_synquacer.c | 18 ++++--------------
>   1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis_synquacer.c b/drivers/char/tpm/tpm_tis_synquacer.c
> index 2751be8e6065..679196c61401 100644
> --- a/drivers/char/tpm/tpm_tis_synquacer.c
> +++ b/drivers/char/tpm/tpm_tis_synquacer.c
> @@ -39,11 +39,6 @@ static int tpm_tis_synquacer_read_bytes(struct tpm_tis_data *data, u32 addr,
>   					enum tpm_tis_io_mode io_mode)
>   {
>   	struct tpm_tis_synquacer_phy *phy = to_tpm_tis_tcg_phy(data);
> -	__le16 result_le16;
> -	__le32 result_le32;
> -	u16 result16;
> -	u32 result32;
> -
>   	switch (io_mode) {
>   	case TPM_TIS_PHYS_8:
>   		while (len--)
> @@ -69,11 +64,6 @@ static int tpm_tis_synquacer_write_bytes(struct tpm_tis_data *data, u32 addr,
>   					 enum tpm_tis_io_mode io_mode)
>   {
>   	struct tpm_tis_synquacer_phy *phy = to_tpm_tis_tcg_phy(data);
> -	__le16 result_le16;
> -	__le32 result_le32;
> -	u16 result16;
> -	u32 result32;
> -
>   	switch (io_mode) {
>   	case TPM_TIS_PHYS_8:
>   		while (len--)
> @@ -86,10 +76,10 @@ static int tpm_tis_synquacer_write_bytes(struct tpm_tis_data *data, u32 addr,
>   		 * Due to the limitation of SPI controller on SynQuacer,
>   		 * 16/32 bits access must be done in byte-wise and descending order.
>   		 */
> -		iowrite8(&value[3], phy->iobase + addr + 3);
> -		iowrite8(&value[2], phy->iobase + addr + 2);
> -		iowrite8(&value[1], phy->iobase + addr + 1);
> -		iowrite8(&value[0], phy->iobase + addr);
> +		iowrite8(value[3], phy->iobase + addr + 3);
> +		iowrite8(value[2], phy->iobase + addr + 2);
> +		iowrite8(value[1], phy->iobase + addr + 1);
> +		iowrite8(value[0], phy->iobase + addr);
>   		break;
>   	}
>
Jarkko Sakkinen March 22, 2022, 8:27 p.m. UTC | #2
On Tue, Mar 22, 2022 at 11:59:32AM +0100, Johannes Holland wrote:
> Remove unused variables and type mismatch (integer from pointer without
> a cast).
> 
> Signed-off-by: Johannes Holland <johannes.holland@infineon.com>
> ---
>  drivers/char/tpm/tpm_tis_synquacer.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis_synquacer.c b/drivers/char/tpm/tpm_tis_synquacer.c
> index 2751be8e6065..679196c61401 100644
> --- a/drivers/char/tpm/tpm_tis_synquacer.c
> +++ b/drivers/char/tpm/tpm_tis_synquacer.c
> @@ -39,11 +39,6 @@ static int tpm_tis_synquacer_read_bytes(struct tpm_tis_data *data, u32 addr,
>  					enum tpm_tis_io_mode io_mode)
>  {
>  	struct tpm_tis_synquacer_phy *phy = to_tpm_tis_tcg_phy(data);
> -	__le16 result_le16;
> -	__le32 result_le32;
> -	u16 result16;
> -	u32 result32;
> -
>  	switch (io_mode) {
>  	case TPM_TIS_PHYS_8:
>  		while (len--)
> @@ -69,11 +64,6 @@ static int tpm_tis_synquacer_write_bytes(struct tpm_tis_data *data, u32 addr,
>  					 enum tpm_tis_io_mode io_mode)
>  {
>  	struct tpm_tis_synquacer_phy *phy = to_tpm_tis_tcg_phy(data);
> -	__le16 result_le16;
> -	__le32 result_le32;
> -	u16 result16;
> -	u32 result32;
> -
>  	switch (io_mode) {
>  	case TPM_TIS_PHYS_8:
>  		while (len--)
> @@ -86,10 +76,10 @@ static int tpm_tis_synquacer_write_bytes(struct tpm_tis_data *data, u32 addr,
>  		 * Due to the limitation of SPI controller on SynQuacer,
>  		 * 16/32 bits access must be done in byte-wise and descending order.
>  		 */
> -		iowrite8(&value[3], phy->iobase + addr + 3);
> -		iowrite8(&value[2], phy->iobase + addr + 2);
> -		iowrite8(&value[1], phy->iobase + addr + 1);
> -		iowrite8(&value[0], phy->iobase + addr);
> +		iowrite8(value[3], phy->iobase + addr + 3);
> +		iowrite8(value[2], phy->iobase + addr + 2);
> +		iowrite8(value[1], phy->iobase + addr + 1);
> +		iowrite8(value[0], phy->iobase + addr);
>  		break;
>  	}
>  
> -- 
> 2.31.1.windows.1
> 

Please make a fresh version of the patch:

Applying: tpm: Fix regression in tpm_tis_synquacer.c
Using index info to reconstruct a base tree...
M	drivers/char/tpm/tpm_tis_synquacer.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/char/tpm/tpm_tis_synquacer.c
CONFLICT (content): Merge conflict in drivers/char/tpm/tpm_tis_synquacer.c
error: Failed to merge in the changes.
Patch failed at 0001 tpm: Fix regression in tpm_tis_synquacer.c
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Also your CC list is lacking Jason and linux-kernel
(look into scripts/get_maintainer.pl).

BR, Jarkko
diff mbox series

Patch

diff --git a/drivers/char/tpm/tpm_tis_synquacer.c b/drivers/char/tpm/tpm_tis_synquacer.c
index 2751be8e6065..679196c61401 100644
--- a/drivers/char/tpm/tpm_tis_synquacer.c
+++ b/drivers/char/tpm/tpm_tis_synquacer.c
@@ -39,11 +39,6 @@  static int tpm_tis_synquacer_read_bytes(struct tpm_tis_data *data, u32 addr,
 					enum tpm_tis_io_mode io_mode)
 {
 	struct tpm_tis_synquacer_phy *phy = to_tpm_tis_tcg_phy(data);
-	__le16 result_le16;
-	__le32 result_le32;
-	u16 result16;
-	u32 result32;
-
 	switch (io_mode) {
 	case TPM_TIS_PHYS_8:
 		while (len--)
@@ -69,11 +64,6 @@  static int tpm_tis_synquacer_write_bytes(struct tpm_tis_data *data, u32 addr,
 					 enum tpm_tis_io_mode io_mode)
 {
 	struct tpm_tis_synquacer_phy *phy = to_tpm_tis_tcg_phy(data);
-	__le16 result_le16;
-	__le32 result_le32;
-	u16 result16;
-	u32 result32;
-
 	switch (io_mode) {
 	case TPM_TIS_PHYS_8:
 		while (len--)
@@ -86,10 +76,10 @@  static int tpm_tis_synquacer_write_bytes(struct tpm_tis_data *data, u32 addr,
 		 * Due to the limitation of SPI controller on SynQuacer,
 		 * 16/32 bits access must be done in byte-wise and descending order.
 		 */
-		iowrite8(&value[3], phy->iobase + addr + 3);
-		iowrite8(&value[2], phy->iobase + addr + 2);
-		iowrite8(&value[1], phy->iobase + addr + 1);
-		iowrite8(&value[0], phy->iobase + addr);
+		iowrite8(value[3], phy->iobase + addr + 3);
+		iowrite8(value[2], phy->iobase + addr + 2);
+		iowrite8(value[1], phy->iobase + addr + 1);
+		iowrite8(value[0], phy->iobase + addr);
 		break;
 	}