From: Thierry Reding <thierry.reding@gmail.com>
To: Lee Jones <lee.jones@linaro.org>, Samuel Ortiz <sameo@linux.intel.com>
Cc: Andrew Bresticker <abrestic@chromium.org>,
Vincent Palatin <vpalatin@chromium.org>,
Rhyland Klein <rklein@nvidia.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v5 2/2] mfd: cros ec: spi: Use 0 instead of '\0' consistently
Date: Mon, 16 Dec 2013 12:09:40 +0100 [thread overview]
Message-ID: <1387192180-15333-2-git-send-email-treding@nvidia.com> (raw)
In-Reply-To: <1387192180-15333-1-git-send-email-treding@nvidia.com>
memset() was being called with the second parameter set to '\0', which
is equivalent but longer than the more canonical 0. Update the code to
use the latter variant consistently across the driver.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v5:
- new patch
drivers/mfd/cros_ec_spi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c
index 8e262bfb603e..84af8d7a4295 100644
--- a/drivers/mfd/cros_ec_spi.c
+++ b/drivers/mfd/cros_ec_spi.c
@@ -112,7 +112,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
/* Receive data until we see the header byte */
deadline = jiffies + msecs_to_jiffies(EC_MSG_DEADLINE_MS);
do {
- memset(&trans, '\0', sizeof(trans));
+ memset(&trans, 0, sizeof(trans));
trans.cs_change = 1;
trans.rx_buf = ptr = ec_dev->din;
trans.len = EC_MSG_PREAMBLE_COUNT;
@@ -164,7 +164,7 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
dev_dbg(ec_dev->dev, "loop, todo=%d, need_len=%d, ptr=%zd\n",
todo, need_len, ptr - ec_dev->din);
- memset(&trans, '\0', sizeof(trans));
+ memset(&trans, 0, sizeof(trans));
trans.cs_change = 1;
trans.rx_buf = ptr;
trans.len = todo;
@@ -224,7 +224,7 @@ static int cros_ec_command_spi_xfer(struct cros_ec_device *ec_dev,
/* Transmit phase - send our message */
debug_packet(ec_dev->dev, "out", ec_dev->dout, len);
- memset(&trans, '\0', sizeof(trans));
+ memset(&trans, 0, sizeof(trans));
trans.tx_buf = ec_dev->dout;
trans.len = len;
trans.cs_change = 1;
--
1.8.4.2
next prev parent reply other threads:[~2013-12-16 11:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 11:09 [PATCH v5 1/2] mfd: cros ec: spi: Add delay for raising CS Thierry Reding
2013-12-16 11:09 ` Thierry Reding [this message]
2013-12-16 13:51 ` [PATCH v5 2/2] mfd: cros ec: spi: Use 0 instead of '\0' consistently Lee Jones
2013-12-16 13:50 ` [PATCH v5 1/2] mfd: cros ec: spi: Add delay for raising CS Lee Jones
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=1387192180-15333-2-git-send-email-treding@nvidia.com \
--to=thierry.reding@gmail.com \
--cc=abrestic@chromium.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rklein@nvidia.com \
--cc=sameo@linux.intel.com \
--cc=vpalatin@chromium.org \
/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