linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Christopher Heiny <cheiny@synaptics.com>
Cc: Linux Input <linux-input@vger.kernel.org>,
	Andrew Duggan <aduggan@synaptics.com>,
	Vincent Huang <vincent.huang@tw.synaptics.com>,
	Vivian Ly <vly@synaptics.com>,
	Daniel Rosenberg <daniel.rosenberg@synaptics.com>,
	Jean Delvare <khali@linux-fr.org>,
	Joerie de Gram <j.de.gram@gmail.com>,
	Linus Walleij <linus.walleij@stericsson.com>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: Re: [PATCH v2] input: synaptics-rmi4 - use snprintf instead of sprintf in rmi_i2c.c
Date: Thu, 9 Jan 2014 00:28:58 -0800	[thread overview]
Message-ID: <20140109082858.GE27160@core.coreip.homeip.net> (raw)
In-Reply-To: <20140109080454.GA27160@core.coreip.homeip.net>

On Thu, Jan 09, 2014 at 12:04:54AM -0800, Dmitry Torokhov wrote:
> On Wed, Jan 08, 2014 at 05:18:39PM -0800, Christopher Heiny wrote:
> > This is a trivial change to replace the sprintf loop with snprintf using
> > up-to-date format capability.
> 
> Hmm, how about we do this instead:

And another small one...

Input: synaptics-rmi4 - transport name should be a const pointer

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/rmi4/rmi_bus.h |    2 +-
 drivers/input/rmi4/rmi_i2c.c |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/rmi4/rmi_bus.h b/drivers/input/rmi4/rmi_bus.h
index 65dd934..3e8b57a 100644
--- a/drivers/input/rmi4/rmi_bus.h
+++ b/drivers/input/rmi4/rmi_bus.h
@@ -148,7 +148,7 @@ struct rmi_driver {
  * @att_count Number of times ATTN assertions have been handled.
  */
 struct rmi_transport_info {
-	char *proto;
+	const char *proto;
 	long tx_count;
 	long tx_bytes;
 	long tx_errs;
diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c
index ea01823..ebe74ec 100644
--- a/drivers/input/rmi4/rmi_i2c.c
+++ b/drivers/input/rmi4/rmi_i2c.c
@@ -38,8 +38,6 @@ struct rmi_i2c_data {
 #define RMI_PAGE_SELECT_REGISTER 0xff
 #define RMI_I2C_PAGE(addr) (((addr) >> 8) & 0xff)
 
-static char *xport_proto_name = "i2c";
-
 /*
  * rmi_set_page - Set RMI page
  * @xport: The pointer to the rmi_transport_dev struct
@@ -217,7 +215,7 @@ static int rmi_i2c_probe(struct i2c_client *client,
 
 	xport->write_block = rmi_i2c_write_block;
 	xport->read_block = rmi_i2c_read_block;
-	xport->info.proto = xport_proto_name;
+	xport->info.proto = "i2c";
 
 	mutex_init(&data->page_mutex);
 

-- 
Dmitry

  reply	other threads:[~2014-01-09  8:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09  1:18 [PATCH v2] input: synaptics-rmi4 - use snprintf instead of sprintf in rmi_i2c.c Christopher Heiny
2014-01-09  8:04 ` Dmitry Torokhov
2014-01-09  8:28   ` Dmitry Torokhov [this message]
2014-01-09 20:29     ` Christopher Heiny
2014-01-09 20:48       ` Dmitry Torokhov
2014-01-09 21:02         ` Christopher Heiny
2014-01-09 21:23   ` Christopher Heiny
2014-01-09 21:29     ` Dmitry Torokhov
2014-01-09 21:38       ` Christopher Heiny
2014-01-09 22:11         ` Christopher Heiny
2014-01-09 22:25           ` Dmitry Torokhov
2014-01-09 22:47             ` Christopher Heiny

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=20140109082858.GE27160@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=aduggan@synaptics.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=cheiny@synaptics.com \
    --cc=daniel.rosenberg@synaptics.com \
    --cc=j.de.gram@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-input@vger.kernel.org \
    --cc=vincent.huang@tw.synaptics.com \
    --cc=vly@synaptics.com \
    /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;
as well as URLs for NNTP newsgroup(s).