The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] Char: tpm: fixed white spaces and braces coding style issues
@ 2015-01-17 16:03 Bruno E O Meneguele
  2015-01-18 13:33 ` Peter Hüwe
  0 siblings, 1 reply; 3+ messages in thread
From: Bruno E O Meneguele @ 2015-01-17 16:03 UTC (permalink / raw)
  To: peterhuewe; +Cc: linux-kernel, Bruno E O Meneguele

Fixed some coding style issues.

Signed-off-by: Bruno E O Meneguele <bmeneguele@gmail.com>
---
 drivers/char/tpm/tpm.h              | 10 +++++-----
 drivers/char/tpm/tpm_i2c_stm_st33.c | 10 ++++++----
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index e4d0888d2eab..51d843c43b25 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -10,13 +10,13 @@
  * Maintained by: <tpmdd-devel@lists.sourceforge.net>
  *
  * Device driver for TCG/TCPA TPM (trusted platform module).
- * Specifications at www.trustedcomputinggroup.org	 
+ * Specifications at www.trustedcomputinggroup.org
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation, version 2 of the
  * License.
- * 
+ *
  */
 #include <linux/module.h>
 #include <linux/delay.h>
@@ -88,7 +88,7 @@ struct tpm_vendor_specific {
 	u16 manufacturer_id;
 };
 
-#define TPM_VPRIV(c)	(c)->vendor.priv
+#define TPM_VPRIV(c)	 ((c)->vendor.priv)
 
 #define TPM_VID_INTEL    0x8086
 #define TPM_VID_WINBOND  0x1050
@@ -110,7 +110,7 @@ struct tpm_chip {
 	struct dentry **bios_dir;
 
 	struct list_head list;
-	void (*release) (struct device *);
+	void (*release)(struct device *);
 };
 
 #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
@@ -321,7 +321,7 @@ extern int tpm_get_timeouts(struct tpm_chip *);
 extern void tpm_gen_interrupt(struct tpm_chip *);
 extern int tpm_do_selftest(struct tpm_chip *);
 extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32);
-extern struct tpm_chip* tpm_register_hardware(struct device *,
+extern struct tpm_chip *tpm_register_hardware(struct device *,
 					      const struct tpm_class_ops *ops);
 extern void tpm_dev_vendor_release(struct tpm_chip *);
 extern void tpm_remove_hardware(struct device *);
diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c
index 4669e3713428..02cd398bef14 100644
--- a/drivers/char/tpm/tpm_i2c_stm_st33.c
+++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
@@ -157,6 +157,7 @@ static int read8_reg(struct i2c_client *client, u8 tpm_register,
 static void clear_interruption(struct i2c_client *client)
 {
 	u8 interrupt;
+
 	I2C_READ_DATA(client, TPM_INT_STATUS, &interrupt, 1);
 	I2C_WRITE_DATA(client, TPM_INT_STATUS, &interrupt, 1);
 	I2C_READ_DATA(client, TPM_INT_STATUS, &interrupt, 1);
@@ -233,6 +234,7 @@ static u8 tpm_stm_i2c_status(struct tpm_chip *chip)
 {
 	struct i2c_client *client;
 	u8 data;
+
 	client = (struct i2c_client *)TPM_VPRIV(chip);
 
 	I2C_READ_DATA(client, TPM_STS, &data, 1);
@@ -679,7 +681,7 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
 				IRQF_TRIGGER_HIGH,
 				"TPM SERIRQ management", chip);
 		if (err < 0) {
-			dev_err(chip->dev , "TPM SERIRQ signals %d not available\n",
+			dev_err(chip->dev, "TPM SERIRQ signals %d not available\n",
 				gpio_to_irq(platform_data->io_serirq));
 			goto _irq_set;
 		}
@@ -784,11 +786,11 @@ static int tpm_st33_i2c_pm_suspend(struct device *dev)
 	struct st33zp24_platform_data *pin_infos = dev->platform_data;
 	int ret = 0;
 
-	if (power_mgt) {
+	if (power_mgt)
 		gpio_set_value(pin_infos->io_lpcpd, 0);
-	} else {
+	else
 		ret = tpm_pm_suspend(dev);
-	}
+
 	return ret;
 }				/* tpm_st33_i2c_suspend() */
 
-- 
2.2.1


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

* Re: [PATCH] Char: tpm: fixed white spaces and braces coding style issues
  2015-01-17 16:03 [PATCH] Char: tpm: fixed white spaces and braces coding style issues Bruno E O Meneguele
@ 2015-01-18 13:33 ` Peter Hüwe
  2015-01-18 17:20   ` Bruno Meneguele
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Hüwe @ 2015-01-18 13:33 UTC (permalink / raw)
  To: Bruno E O Meneguele; +Cc: linux-kernel

Hi Bruno,

thanks for your patch!
The patch is fine, 
but unfortunately not against the latest version of the tpm subsytem code.

You can find the latest version of the tpm subsystem at   
https://github.com/PeterHuewe/linux-tpmdd 
the for-james branch is usually the best choice here.

Nevertheless, I quickly ported it to the latest code (see below)
--> applied.



> Fixed some coding style issues.
Usually it is quite good if you include the reports by checkpatch.

Thanks,
Peter


So this is what got merged, the rest does not apply anymore due to recent code 
changes:



From: Bruno E O Meneguele <bmeneguele@gmail.com>
Date: Sat, 17 Jan 2015 17:03:30 +0100
Subject: [PATCH] char/tpm: fixed white spaces coding style issues

Fixed some coding style issues reported by checkpatch.

Signed-off-by: Bruno E O Meneguele <bmeneguele@gmail.com>
[phuewe: ported to latest code]
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 drivers/char/tpm/tpm.h              | 6 +++---
 drivers/char/tpm/tpm_i2c_stm_st33.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index cc421cf..7b0727c 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -10,13 +10,13 @@
  * Maintained by: <tpmdd-devel@lists.sourceforge.net>
  *
  * Device driver for TCG/TCPA TPM (trusted platform module).
- * Specifications at www.trustedcomputinggroup.org	 
+ * Specifications at www.trustedcomputinggroup.org
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation, version 2 of the
  * License.
- * 
+ *
  */
 #include <linux/module.h>
 #include <linux/delay.h>
@@ -141,7 +141,7 @@ struct tpm_vendor_specific {
 	u16 manufacturer_id;
 };
 
-#define TPM_VPRIV(c)	(c)->vendor.priv
+#define TPM_VPRIV(c)     ((c)->vendor.priv)
 
 #define TPM_VID_INTEL    0x8086
 #define TPM_VID_WINBOND  0x1050
diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c 
b/drivers/char/tpm/tpm_i2c_stm_st33.c
index dbab8d0..612845b 100644
--- a/drivers/char/tpm/tpm_i2c_stm_st33.c
+++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
@@ -777,7 +777,7 @@ tpm_stm_i2c_probe(struct i2c_client *client, const struct 
i2c_device_id *id)
 				IRQF_TRIGGER_HIGH,
 				"TPM SERIRQ management", chip);
 		if (ret < 0) {
-			dev_err(chip->pdev , "TPM SERIRQ signals %d not available\n",
+			dev_err(chip->pdev, "TPM SERIRQ signals %d not available\n",
 				client->irq);
 			goto _tpm_clean_answer;
 		}
-- 
2.0.5


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

* Re: [PATCH] Char: tpm: fixed white spaces and braces coding style issues
  2015-01-18 13:33 ` Peter Hüwe
@ 2015-01-18 17:20   ` Bruno Meneguele
  0 siblings, 0 replies; 3+ messages in thread
From: Bruno Meneguele @ 2015-01-18 17:20 UTC (permalink / raw)
  To: Peter Hüwe; +Cc: Bruno E O Meneguele, linux-kernel

Hello Peter, 

sorry about that! But thank you very much for the advice.
This is my first patch on Linux Kernel, so each word will help me a lot.

Thanks, 
Bruno

On Sun, Jan 18, 2015 at 02:33:23PM +0100, Peter Hüwe wrote:
> Hi Bruno,
> 
> thanks for your patch!
> The patch is fine, 
> but unfortunately not against the latest version of the tpm subsytem code.
> 
> You can find the latest version of the tpm subsystem at   
> https://github.com/PeterHuewe/linux-tpmdd 
> the for-james branch is usually the best choice here.
> 
> Nevertheless, I quickly ported it to the latest code (see below)
> --> applied.
> 
> 
> 
> > Fixed some coding style issues.
> Usually it is quite good if you include the reports by checkpatch.
> 
> Thanks,
> Peter
> 
> 
> So this is what got merged, the rest does not apply anymore due to recent code 
> changes:
> 
> 
> 
> From: Bruno E O Meneguele <bmeneguele@gmail.com>
> Date: Sat, 17 Jan 2015 17:03:30 +0100
> Subject: [PATCH] char/tpm: fixed white spaces coding style issues
> 
> Fixed some coding style issues reported by checkpatch.
> 
> Signed-off-by: Bruno E O Meneguele <bmeneguele@gmail.com>
> [phuewe: ported to latest code]
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> ---
>  drivers/char/tpm/tpm.h              | 6 +++---
>  drivers/char/tpm/tpm_i2c_stm_st33.c | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index cc421cf..7b0727c 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -10,13 +10,13 @@
>   * Maintained by: <tpmdd-devel@lists.sourceforge.net>
>   *
>   * Device driver for TCG/TCPA TPM (trusted platform module).
> - * Specifications at www.trustedcomputinggroup.org	 
> + * Specifications at www.trustedcomputinggroup.org
>   *
>   * This program is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU General Public License as
>   * published by the Free Software Foundation, version 2 of the
>   * License.
> - * 
> + *
>   */
>  #include <linux/module.h>
>  #include <linux/delay.h>
> @@ -141,7 +141,7 @@ struct tpm_vendor_specific {
>  	u16 manufacturer_id;
>  };
>  
> -#define TPM_VPRIV(c)	(c)->vendor.priv
> +#define TPM_VPRIV(c)     ((c)->vendor.priv)
>  
>  #define TPM_VID_INTEL    0x8086
>  #define TPM_VID_WINBOND  0x1050
> diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c 
> b/drivers/char/tpm/tpm_i2c_stm_st33.c
> index dbab8d0..612845b 100644
> --- a/drivers/char/tpm/tpm_i2c_stm_st33.c
> +++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
> @@ -777,7 +777,7 @@ tpm_stm_i2c_probe(struct i2c_client *client, const struct 
> i2c_device_id *id)
>  				IRQF_TRIGGER_HIGH,
>  				"TPM SERIRQ management", chip);
>  		if (ret < 0) {
> -			dev_err(chip->pdev , "TPM SERIRQ signals %d not available\n",
> +			dev_err(chip->pdev, "TPM SERIRQ signals %d not available\n",
>  				client->irq);
>  			goto _tpm_clean_answer;
>  		}
> -- 
> 2.0.5
> 

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

end of thread, other threads:[~2015-01-18 17:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-17 16:03 [PATCH] Char: tpm: fixed white spaces and braces coding style issues Bruno E O Meneguele
2015-01-18 13:33 ` Peter Hüwe
2015-01-18 17:20   ` Bruno Meneguele

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox