mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Kent Yoder <key@linux.vnet.ibm.com>
Cc: tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH RESEND] char/tpm: Convert struct i2c_msg initialization to C99 format
Date: Thu, 28 Feb 2013 11:06:11 +0100	[thread overview]
Message-ID: <20130228110611.3ed77e92@endymion.delvare> (raw)

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

             reply	other threads:[~2013-02-28 10:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28 10:06 Jean Delvare [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130228110611.3ed77e92@endymion.delvare \
    --to=khali@linux-fr.org \
    --cc=akpm@linux-foundation.org \
    --cc=key@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tpmdd-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®