From patchwork Sat Jan 21 18:46:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9530611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D958B6020B for ; Sat, 21 Jan 2017 18:48:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C99EB283BC for ; Sat, 21 Jan 2017 18:48:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD178283F9; Sat, 21 Jan 2017 18:48:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, SUSPICIOUS_RECIPS, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D804283BC for ; Sat, 21 Jan 2017 18:48:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751538AbdAUSsL (ORCPT ); Sat, 21 Jan 2017 13:48:11 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:50612 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303AbdAUSsH (ORCPT ); Sat, 21 Jan 2017 13:48:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=5T3u/S9ITDKMjqBC/fwldiXIGzNhIhgDsU1Lv8uJo1s=; b=OJ6lhKd7YK63Cb 9/GtoxAAwbYU1ogdnkBBfp59jbUtMM9r4Gh2z3dg17GwXhaveRSPHEtrVaBZHu+QNo6/xj2Ykmisq Vf5tcgi2Y/pJTRGBhYsnKi03TNmgncHW8bhMdZeAeYJy0NtB5R37hFpOdW9eaqr5D65LWr09iUwHb feFOtjOPe7DKZXB3SwvFeBTS9n9UZ3d+/+RLdqzV2jEodMJ2r89jq6ktXpXfmjAGR+A6nrv/K8Sdr DXWqhcJ3phf4AI4JoB3Q2OOVXnlnH9dOAH3+XbNvvNgh8mwXhR+zJ3ManyoJFk4ECVMGLPcbdWocZ 61GKDWcmz6QPttIlgtmA==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:48094 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cV0hq-001unq-K3; Sat, 21 Jan 2017 18:48:07 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 08/13] Input: touchscreen - Use local variables consistently Date: Sat, 21 Jan 2017 10:46:00 -0800 Message-Id: <1485024365-3368-9-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485024365-3368-1-git-send-email-linux@roeck-us.net> References: <1485024365-3368-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=1.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a function declares a variable to access a structure element, use it conssistently. The conversion was done automatically with coccinelle using the following semantic patch. // Catch function parameters. // Handle those first to trigger reformatting. @@ identifier d; identifier fn; identifier svar; identifier elem; type T; identifier i; expression e; identifier fn; expression list es; @@ fn(...) { ... T d = &svar->elem; <... when != d = e; - fn(&svar->elem, es) + fn(d, es) ...> } // Now address non-functions and multiple transformations in function // parameters. @@ identifier d; identifier fn; identifier svar; identifier elem; type T; identifier i; expression e; @@ fn(...) { ... T d = &svar->elem; <... when != d = e; ( - &svar->elem + d | - svar->elem.i + d->i ) ...> } Signed-off-by: Guenter Roeck --- drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- drivers/input/touchscreen/fsl-imx25-tcq.c | 2 +- drivers/input/touchscreen/ili210x.c | 2 +- drivers/input/touchscreen/pixcir_i2c_ts.c | 4 ++-- drivers/input/touchscreen/rohm_bu21023.c | 3 +-- drivers/input/touchscreen/s3c2410_ts.c | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index e5d185fe69b9..2302aef2b2d4 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -2509,7 +2509,7 @@ static void mxt_debug_init(struct mxt_data *data) dbg->t37_pages = MXT1386_COLUMNS * MXT1386_PAGES_PER_COLUMN; else dbg->t37_pages = DIV_ROUND_UP(data->xsize * - data->info.matrix_ysize * + info->matrix_ysize * sizeof(u16), sizeof(dbg->t37_buf->data)); diff --git a/drivers/input/touchscreen/fsl-imx25-tcq.c b/drivers/input/touchscreen/fsl-imx25-tcq.c index d50ee490c9cc..47fe1f184bbc 100644 --- a/drivers/input/touchscreen/fsl-imx25-tcq.c +++ b/drivers/input/touchscreen/fsl-imx25-tcq.c @@ -507,7 +507,7 @@ static int mx25_tcq_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct input_dev *idev; struct mx25_tcq_priv *priv; - struct mx25_tsadc *tsadc = dev_get_drvdata(pdev->dev.parent); + struct mx25_tsadc *tsadc = dev_get_drvdata(dev->parent); struct resource *res; void __iomem *mem; int error; diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index fe4848bd1f4c..91dc5fb34fe1 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -280,7 +280,7 @@ static int ili210x_i2c_probe(struct i2c_client *client, goto err_remove_sysfs; } - device_init_wakeup(&client->dev, 1); + device_init_wakeup(dev, 1); dev_dbg(dev, "ILI210x initialized (IRQ: %d), firmware version %d.%d.%d", diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index 3bb0637d832e..37ff672c7802 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c @@ -461,7 +461,7 @@ static int pixcir_i2c_ts_probe(struct i2c_client *client, if (error) return error; } else { - dev_err(&client->dev, "platform data not defined\n"); + dev_err(dev, "platform data not defined\n"); return -EINVAL; } @@ -483,7 +483,7 @@ static int pixcir_i2c_ts_probe(struct i2c_client *client, input->id.bustype = BUS_I2C; input->open = pixcir_input_open; input->close = pixcir_input_close; - input->dev.parent = &client->dev; + input->dev.parent = dev; if (pdata) { input_set_abs_params(input, ABS_MT_POSITION_X, 0, pdata->x_max, 0, 0); diff --git a/drivers/input/touchscreen/rohm_bu21023.c b/drivers/input/touchscreen/rohm_bu21023.c index 611156a2ef80..eeaf6ff03597 100644 --- a/drivers/input/touchscreen/rohm_bu21023.c +++ b/drivers/input/touchscreen/rohm_bu21023.c @@ -1189,8 +1189,7 @@ static int rohm_bu21023_i2c_probe(struct i2c_client *client, error = devm_add_action(dev, rohm_ts_remove_sysfs_group, dev); if (error) { rohm_ts_remove_sysfs_group(dev); - dev_err(&client->dev, - "Failed to add sysfs cleanup action: %d\n", + dev_err(dev, "Failed to add sysfs cleanup action: %d\n", error); return error; } diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c index a4a103e1d11b..41d58e88cc8a 100644 --- a/drivers/input/touchscreen/s3c2410_ts.c +++ b/drivers/input/touchscreen/s3c2410_ts.c @@ -250,7 +250,7 @@ static int s3c2410ts_probe(struct platform_device *pdev) ts.dev = dev; - info = dev_get_platdata(&pdev->dev); + info = dev_get_platdata(dev); if (!info) { dev_err(dev, "no platform data, cannot attach\n"); return -EINVAL;