mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format
@ 2013-02-28 10:06 Jean Delvare
  2013-02-28 22:12 ` [tpmdd-devel] " Peter Hüwe
  2013-03-04 20:17 ` Kent Yoder
  0 siblings, 2 replies; 7+ messages in thread
From: Jean Delvare @ 2013-02-28 10:06 UTC (permalink / raw)
  To: Kent Yoder; +Cc: tpmdd-devel, linux-kernel, Andrew Morton

From: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>

Convert the struct i2c_msg initialization to C99 format. This makes
maintaining and editing the code simpler. Also helps once other fields
like transferred are added in future.

Thanks to Julia Lawall for automating the conversion.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: Peter Huewe <peter.huewe@infineon.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
v2: removed zero initialization of flags.

Patch already sent by Shubhrajyoti Datta on 2012-10-10.

 drivers/char/tpm/tpm_i2c_infineon.c |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

--- linux-3.9-rc0.orig/drivers/char/tpm/tpm_i2c_infineon.c	2013-02-28 09:54:50.184560055 +0100
+++ linux-3.9-rc0/drivers/char/tpm/tpm_i2c_infineon.c	2013-02-28 10:59:08.639682373 +0100
@@ -90,8 +90,17 @@ static struct i2c_driver tpm_tis_i2c_dri
 static int iic_tpm_read(u8 addr, u8 *buffer, size_t len)
 {
 
-	struct i2c_msg msg1 = { tpm_dev.client->addr, 0, 1, &addr };
-	struct i2c_msg msg2 = { tpm_dev.client->addr, I2C_M_RD, len, buffer };
+	struct i2c_msg msg1 = {
+		.addr = tpm_dev.client->addr,
+		.len = 1,
+		.buf = &addr
+	};
+	struct i2c_msg msg2 = {
+		.addr = tpm_dev.client->addr,
+		.flags = I2C_M_RD,
+		.len = len,
+		.buf = buffer
+	};
 
 	int rc;
 	int count;
@@ -138,7 +147,11 @@ static int iic_tpm_write_generic(u8 addr
 	int rc = -EIO;
 	int count;
 
-	struct i2c_msg msg1 = { tpm_dev.client->addr, 0, len + 1, tpm_dev.buf };
+	struct i2c_msg msg1 = {
+		.addr = tpm_dev.client->addr,
+		.len = len + 1,
+		.buf = tpm_dev.buf
+	};
 
 	if (len > TPM_BUFSIZE)
 		return -EINVAL;


-- 
Jean Delvare

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

* Re: [tpmdd-devel] [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format
  2013-02-28 10:06 [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format Jean Delvare
@ 2013-02-28 22:12 ` Peter Hüwe
  2013-02-28 22:32   ` Jean Delvare
  2013-03-04 20:17 ` Kent Yoder
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Hüwe @ 2013-02-28 22:12 UTC (permalink / raw)
  To: tpmdd-devel; +Cc: Jean Delvare, Kent Yoder, akpm, linux-kernel

Hi,

thanks for resending.


Am Donnerstag, 28. Februar 2013, 11:06:11 schrieb Jean Delvare:
> From: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
> 
> Convert the struct i2c_msg initialization to C99 format. This makes
> maintaining and editing the code simpler. Also helps once other fields
> like transferred are added in future.
> 
> Thanks to Julia Lawall for automating the conversion.
> 
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> Acked-by: Peter Huewe <peter.huewe@infineon.com>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> ---
> v2: removed zero initialization of flags.
> 
> Patch already sent by Shubhrajyoti Datta on 2012-10-10.
> 
>  drivers/char/tpm/tpm_i2c_infineon.c |   19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)

As it was not yet applied I folded it into my patch
"Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)"


Thanks,
Peter

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

* Re: [tpmdd-devel] [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format
  2013-02-28 22:12 ` [tpmdd-devel] " Peter Hüwe
@ 2013-02-28 22:32   ` Jean Delvare
  2013-02-28 22:46     ` Kent Yoder
  0 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2013-02-28 22:32 UTC (permalink / raw)
  To: Peter Hüwe; +Cc: tpmdd-devel, Kent Yoder, akpm, linux-kernel

On Thu, 28 Feb 2013 23:12:51 +0100, Peter Hüwe wrote:
> thanks for resending.

You're welcome.

> Am Donnerstag, 28. Februar 2013, 11:06:11 schrieb Jean Delvare:
> > From: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
> > 
> > Convert the struct i2c_msg initialization to C99 format. This makes
> > maintaining and editing the code simpler. Also helps once other fields
> > like transferred are added in future.
> > 
> > Thanks to Julia Lawall for automating the conversion.
> > 
> > Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> > Acked-by: Peter Huewe <peter.huewe@infineon.com>
> > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > ---
> > v2: removed zero initialization of flags.
> > 
> > Patch already sent by Shubhrajyoti Datta on 2012-10-10.
> > 
> >  drivers/char/tpm/tpm_i2c_infineon.c |   19 ++++++++++++++++---
> >  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> As it was not yet applied I folded it into my patch
> "Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)"

I'd suggest not to. Mixing actual changes with cleanups is generally
discouraged.

-- 
Jean Delvare

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

* Re: [tpmdd-devel] [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format
  2013-02-28 22:32   ` Jean Delvare
@ 2013-02-28 22:46     ` Kent Yoder
  2013-02-28 22:58       ` Peter Hüwe
  0 siblings, 1 reply; 7+ messages in thread
From: Kent Yoder @ 2013-02-28 22:46 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Peter Hüwe, tpmdd-devel, Kent Yoder, akpm, linux-kernel

On Thu, Feb 28, 2013 at 4:32 PM, Jean Delvare <khali@linux-fr.org> wrote:
> On Thu, 28 Feb 2013 23:12:51 +0100, Peter Hüwe wrote:
>> thanks for resending.
>
> You're welcome.
>
>> Am Donnerstag, 28. Februar 2013, 11:06:11 schrieb Jean Delvare:
>> > From: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
>> >
>> > Convert the struct i2c_msg initialization to C99 format. This makes
>> > maintaining and editing the code simpler. Also helps once other fields
>> > like transferred are added in future.
>> >
>> > Thanks to Julia Lawall for automating the conversion.
>> >
>> > Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
>> > Acked-by: Peter Huewe <peter.huewe@infineon.com>
>> > Signed-off-by: Jean Delvare <khali@linux-fr.org>
>> > ---
>> > v2: removed zero initialization of flags.
>> >
>> > Patch already sent by Shubhrajyoti Datta on 2012-10-10.
>> >
>> >  drivers/char/tpm/tpm_i2c_infineon.c |   19 ++++++++++++++++---
>> >  1 file changed, 16 insertions(+), 3 deletions(-)
>>
>> As it was not yet applied I folded it into my patch
>> "Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)"
>
> I'd suggest not to. Mixing actual changes with cleanups is generally
> discouraged.

  Yes, please don't do this.  Also because it makes it really
confusing for me to figure out whether something has been applied or
not and if I have the right people on the sign off.

  Peter, can you resend without it?  I'll have a new staging tree with
everything up in the next day or two.

Thanks,
Kent

> --
> Jean Delvare
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [tpmdd-devel] [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format
  2013-02-28 22:46     ` Kent Yoder
@ 2013-02-28 22:58       ` Peter Hüwe
       [not found]         ` <20130228230712.GA17686@ennui.austin.ibm.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Hüwe @ 2013-02-28 22:58 UTC (permalink / raw)
  To: Kent Yoder; +Cc: Jean Delvare, tpmdd-devel, Kent Yoder, akpm, linux-kernel

> > I'd suggest not to. Mixing actual changes with cleanups is generally
> > discouraged.
> 
>   Yes, please don't do this.  Also because it makes it really
> confusing for me to figure out whether something has been applied or
> not and if I have the right people on the sign off.
> 
>   Peter, can you resend without it?  I'll have a new staging tree with
> everything up in the next day or two.


Yes, no problem.
I'll create a patch without it -
I'll make it this way that you can apply the conversion patch first and then 
the change.

Thanks,
Peter

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

* RE: [tpmdd-devel] [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format
       [not found]         ` <20130228230712.GA17686@ennui.austin.ibm.com>
@ 2013-03-04 14:44           ` Peter.Huewe
  0 siblings, 0 replies; 7+ messages in thread
From: Peter.Huewe @ 2013-03-04 14:44 UTC (permalink / raw)
  To: key, PeterHuewe; +Cc: khali, tpmdd-devel, akpm, shpedoikal, linux-kernel

>> Yes, no problem.
>> I'll create a patch without it -
>> I'll make it this way that you can apply the conversion patch first 
>> and then the change.

>Thanks!
>Kent

The new version of my patch was just sent - please apply this one first.

Thanks,
Peter





-----------------------------------------------
Peter Huewe
Dipl. Inf. (FH)

Infineon Technologies AG 
CCS TI SWT SW ESW
Tel: 	+49 821 25851-86
Fax: 	+49 821 25851-40

Peter.Huewe@infineon.com

****VISIT US AT: www.infineon.com *****
Infineon Technologies AG 
Vorsitzender des Aufsichtsrats: Wolfgang Mayrhuber
Vorstand: Dr. Reinhard Ploss (Vorsitzender), Dominik Asam, Arunjai Mittal
Sitz der Gesellschaft: Neubiberg 
Registergericht: München HRB 126492 
 

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

* Re: [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format
  2013-02-28 10:06 [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format Jean Delvare
  2013-02-28 22:12 ` [tpmdd-devel] " Peter Hüwe
@ 2013-03-04 20:17 ` Kent Yoder
  1 sibling, 0 replies; 7+ messages in thread
From: Kent Yoder @ 2013-03-04 20:17 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Kent Yoder, tpmdd-devel, linux-kernel, Andrew Morton

On Thu, Feb 28, 2013 at 4:06 AM, Jean Delvare <khali@linux-fr.org> wrote:
> From: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
>
> Convert the struct i2c_msg initialization to C99 format. This makes
> maintaining and editing the code simpler. Also helps once other fields
> like transferred are added in future.
>
> Thanks to Julia Lawall for automating the conversion.

Staged here:

https://github.com/shpedoikal/linux.git tpmdd-03-04-13

Thanks,
Kent

> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
> Acked-by: Peter Huewe <peter.huewe@infineon.com>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> ---
> v2: removed zero initialization of flags.
>
> Patch already sent by Shubhrajyoti Datta on 2012-10-10.
>
>  drivers/char/tpm/tpm_i2c_infineon.c |   19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
>
> --- linux-3.9-rc0.orig/drivers/char/tpm/tpm_i2c_infineon.c      2013-02-28 09:54:50.184560055 +0100
> +++ linux-3.9-rc0/drivers/char/tpm/tpm_i2c_infineon.c   2013-02-28 10:59:08.639682373 +0100
> @@ -90,8 +90,17 @@ static struct i2c_driver tpm_tis_i2c_dri
>  static int iic_tpm_read(u8 addr, u8 *buffer, size_t len)
>  {
>
> -       struct i2c_msg msg1 = { tpm_dev.client->addr, 0, 1, &addr };
> -       struct i2c_msg msg2 = { tpm_dev.client->addr, I2C_M_RD, len, buffer };
> +       struct i2c_msg msg1 = {
> +               .addr = tpm_dev.client->addr,
> +               .len = 1,
> +               .buf = &addr
> +       };
> +       struct i2c_msg msg2 = {
> +               .addr = tpm_dev.client->addr,
> +               .flags = I2C_M_RD,
> +               .len = len,
> +               .buf = buffer
> +       };
>
>         int rc;
>         int count;
> @@ -138,7 +147,11 @@ static int iic_tpm_write_generic(u8 addr
>         int rc = -EIO;
>         int count;
>
> -       struct i2c_msg msg1 = { tpm_dev.client->addr, 0, len + 1, tpm_dev.buf };
> +       struct i2c_msg msg1 = {
> +               .addr = tpm_dev.client->addr,
> +               .len = len + 1,
> +               .buf = tpm_dev.buf
> +       };
>
>         if (len > TPM_BUFSIZE)
>                 return -EINVAL;
>
>
> --
> Jean Delvare
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

end of thread, other threads:[~2013-03-04 20:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28 10:06 [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format Jean Delvare
2013-02-28 22:12 ` [tpmdd-devel] " Peter Hüwe
2013-02-28 22:32   ` Jean Delvare
2013-02-28 22:46     ` Kent Yoder
2013-02-28 22:58       ` Peter Hüwe
     [not found]         ` <20130228230712.GA17686@ennui.austin.ibm.com>
2013-03-04 14:44           ` Peter.Huewe
2013-03-04 20:17 ` Kent Yoder

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

Powered by JetHome