From patchwork Thu Jan 9 22:25:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 3463371 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9E2DCC02DC for ; Thu, 9 Jan 2014 22:25:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DCAE20109 for ; Thu, 9 Jan 2014 22:25:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80B0F200F3 for ; Thu, 9 Jan 2014 22:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751425AbaAIWZv (ORCPT ); Thu, 9 Jan 2014 17:25:51 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:40430 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbaAIWZu (ORCPT ); Thu, 9 Jan 2014 17:25:50 -0500 Received: by mail-pa0-f54.google.com with SMTP id kl14so3856840pab.41 for ; Thu, 09 Jan 2014 14:25:50 -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=SntFCnSfBZ04xTV0rjUu5pPSf86OHMXHcdqT262pvys=; b=WOu2pDAXCGhOBMyaj+ITSxHUgR2bcdmR0jmLxyVYFHqU6FPpWuRPG4OMAsZtq3CFHa aqanflWIzPBBg3mwsxY6YRtcP25tSvl9T8fWoT5UB9mUGZiN+UDN5OY0bmn6zY53luQH TXoS14On/bCvbkJWit9YPllxP31E660HqXlqa+odGq+PG2f5vvo62Scv5Dk38k7EPq3J X8+XOsf+AmO0umSVzS9e+1pvNhoF8FaGiZsu6jwebSo+UWeZlvdb8dw4bs8ZRDpbCXh1 ujHuQyJOxYBXI58f4y5tKCHkOhxKF/QbyEWQqoE62jdkElwLDdPV05cdVv/Qmz1n01Y3 eZnw== X-Received: by 10.66.139.130 with SMTP id qy2mr6443718pab.73.1389306350359; Thu, 09 Jan 2014 14:25:50 -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 sd3sm12344623pbb.42.2014.01.09.14.25.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 09 Jan 2014 14:25:49 -0800 (PST) Date: Thu, 9 Jan 2014 14:25:46 -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: <20140109222546.GA20994@core.coreip.homeip.net> References: <1389230319-4737-1-git-send-email-cheiny@synaptics.com> <20140109080454.GA27160@core.coreip.homeip.net> <52CF1359.6080207@synaptics.com> <20140109212949.GA31257@core.coreip.homeip.net> <52CF16B8.7000409@synaptics.com> <52CF1E74.6060202@synaptics.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <52CF1E74.6060202@synaptics.com> 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 02:11:00PM -0800, Christopher Heiny wrote: > On 01/09/2014 01:38 PM, Christopher Heiny wrote: > >On 01/09/2014 01:29 PM, Dmitry Torokhov wrote: > >>On Thu, Jan 09, 2014 at 01:23:37PM -0800, Christopher Heiny wrote: > >>>>On 01/09/2014 12:04 AM, 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: > >>>>> > > >>>>> >Input: synaptics-rmi4 - clean up debug handling in rmi_i2c > >>>>> > > >>>>> >From: Dmitry Torokhov > >>>>> > > >>>>> >Kernel now has standard facility to format and print binary > >>>>buffers, let's > >>>>> >use it. By doing so we no longer need to allocate memory for > >>>>debug buffers > >>>>> >and we can let debugfs code go as well. > >>>> > >>>>Not sure where to put this comment, so I'll drop it here. > >>>> > >>>>I agree the buffers can go. I realized that on the drive home last > >>>>night, but was too tired to follow up. > >>>> > >>>>Talking with some of the folks who use this feature, there's a > >>>>desire to keep some sort of finer control on whether the comms > >>>>buffers are printed or not - either the existing debugfs setup > >>>>(preferred, since it lets them turn on the dmesg clutter only when > >>>>needed), or by converting to a config option such as > >>>>CONFIG_RMI4_COMMS_DEBUG. It's very useful in new platform > >>>>development, since there's a surprising number of ways in which the > >>>>reads and writes can go wonky on new hardware. > > > > >>That is why you have CONFIG_DYNAMIC_DEBUG: you can activate these debug > >>statements at will using the common kernel mechanisms. > > > >I'll check this out and get back. > > Looks CONFIG_DYNAMIC_DEBUG will work fine! > > Acked-by: Christopher Heiny Cool, thanks! And another one: Input: synaptics-rmi4 - fix disabling gpio config in i2c transport From: Dmitry Torokhov We need to pass into pdata->gpio_config() gpio_data which is already a pointer, and not its address. Signed-off-by: Dmitry Torokhov Acked-by: Christopher Heiny --- drivers/input/rmi4/rmi_i2c.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c index ebe74ec..12aea8c 100644 --- a/drivers/input/rmi4/rmi_i2c.c +++ b/drivers/input/rmi4/rmi_i2c.c @@ -168,7 +168,8 @@ exit: static int rmi_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { - const struct rmi_device_platform_data *pdata = dev_get_platdata(&client->dev); + const struct rmi_device_platform_data *pdata = + dev_get_platdata(&client->dev); struct rmi_transport_dev *xport; struct rmi_i2c_data *data; int retval; @@ -250,12 +251,13 @@ err_gpio: static int rmi_i2c_remove(struct i2c_client *client) { struct rmi_transport_dev *xport = i2c_get_clientdata(client); - struct rmi_device_platform_data *pdata = dev_get_platdata(&client->dev); + const struct rmi_device_platform_data *pdata = + dev_get_platdata(&client->dev); rmi_unregister_transport_device(xport); if (pdata->gpio_config) - pdata->gpio_config(&pdata->gpio_data, false); + pdata->gpio_config(pdata->gpio_data, false); return 0; }