From patchwork Thu Jan 9 08:28:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 3457771 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6BB749F2E9 for ; Thu, 9 Jan 2014 08:29:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E99F20120 for ; Thu, 9 Jan 2014 08:29:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DE922010C for ; Thu, 9 Jan 2014 08:29:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751508AbaAII3D (ORCPT ); Thu, 9 Jan 2014 03:29:03 -0500 Received: from mail-pd0-f182.google.com ([209.85.192.182]:35779 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751201AbaAII3C (ORCPT ); Thu, 9 Jan 2014 03:29:02 -0500 Received: by mail-pd0-f182.google.com with SMTP id v10so2903389pde.27 for ; Thu, 09 Jan 2014 00:29:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=lG44Cx3l253J/TrfLKwxDkS2HfkMpFUEuqz8+YCr06c=; b=j2PpQ3ys4RCMsg0x8Bk9gphtVA9xTr3DQdF5t42CGXEtr51UAyK/a+oYnskoDzawLC 3NqsmNGkpw3Ykdvm5h3u8wYAv9DF6fm7mDdpOfR5P5twuA0Y82y9ly5mALWa0eAY12ih uLh2NEJUSGC/YKvVv0qJvJqY7atVgkLRwXKjEYIzXJDs+wdA5aP80JjUcJTdvdvdrkVM hslwigmpYjGOaUEWnANXuFsD4AZ1RKYC+3MqrwSfCSvSx5i9dQLU9gyrFl3M1H7WA89q f3uh5r74MtBvEkB4Qtt9GXkpvY1S+drhZAnKELHbwlP12dW4VWRe/K83eQi4HuzogwiX Pxxg== X-Received: by 10.67.3.34 with SMTP id bt2mr2198465pad.3.1389256141663; Thu, 09 Jan 2014 00:29:01 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-67-188-112-76.hsd1.ca.comcast.net. [67.188.112.76]) by mx.google.com with ESMTPSA id ki1sm8002325pbd.1.2014.01.09.00.29.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 09 Jan 2014 00:29:01 -0800 (PST) Date: Thu, 9 Jan 2014 00:28:58 -0800 From: Dmitry Torokhov To: Christopher Heiny Cc: Linux Input , Andrew Duggan , Vincent Huang , Vivian Ly , Daniel Rosenberg , Jean Delvare , Joerie de Gram , Linus Walleij , Benjamin Tissoires Subject: Re: [PATCH v2] input: synaptics-rmi4 - use snprintf instead of sprintf in rmi_i2c.c Message-ID: <20140109082858.GE27160@core.coreip.homeip.net> References: <1389230319-4737-1-git-send-email-cheiny@synaptics.com> <20140109080454.GA27160@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140109080454.GA27160@core.coreip.homeip.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Dmitry Torokhov Acked-by: Christopher Heiny --- 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);