From patchwork Sat Jan 21 18:45:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9530595 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 F01656020B for ; Sat, 21 Jan 2017 18:48:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2466283BC for ; Sat, 21 Jan 2017 18:48:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D72B6283F9; Sat, 21 Jan 2017 18:48:15 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 8783C283BC for ; Sat, 21 Jan 2017 18:48:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751517AbdAUSsI (ORCPT ); Sat, 21 Jan 2017 13:48:08 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:50223 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751261AbdAUSsH (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=aiZthuPcRS9CX97KZaL4qvYPdifCiTjj4Sd5JQ1kAK4=; b=Wm8QpnkY7euPbo hE6lkpWtHUSiO7zUwyQiTARqrCe0AJ4caZgxNPLAPxT7MJe3f6lnlffyC5tqKIFRDLtaAiOwPxj7K FaNohaxNRUM/Jd4miTg2uqgah7qSYXtSR1pPFOrwIIdF+IYRRtZfFBAPLBI18jglrDVYVSeLbN24e TR9QqUjkUWCRs3lY8N9o+dDM0MuuiS2eKsgKmLBj6V2CmOXAkGQL8IQUutCCwPEoQwpUVNn7EG/a/ YcRIhDpnMRufUxLkV4TVnurNMlhm4xoIg40noh1YaANByRlVFWXANzVxGLbS0vGrn77ZMbeiQCNYX zvFDZ+O0wuElfvunmOjw==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:48090 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cV0hc-001u5O-4u; Sat, 21 Jan 2017 18:47:52 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH 07/13] Input: rmi4 - Use local variables consistently Date: Sat, 21 Jan 2017 10:45:59 -0800 Message-Id: <1485024365-3368-8-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.0 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/rmi4/rmi_bus.c | 4 ++-- drivers/input/rmi4/rmi_driver.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c index 1c40d94ca506..f754e09ac7a7 100644 --- a/drivers/input/rmi4/rmi_bus.c +++ b/drivers/input/rmi4/rmi_bus.c @@ -261,10 +261,10 @@ int __rmi_register_function_handler(struct rmi_function_handler *handler, driver->probe = rmi_function_probe; driver->remove = rmi_function_remove; - error = driver_register(&handler->driver); + error = driver_register(driver); if (error) { pr_err("driver_register() failed for %s, error: %d\n", - handler->driver.name, error); + driver->name, error); return error; } diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index 11447ab1055c..47e75021ee79 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -836,7 +836,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev, void *ctx, const struct pdt_entry *pdt) { struct device *dev = &rmi_dev->dev; - struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); + struct rmi_driver_data *data = dev_get_drvdata(dev); int *current_irq_count = ctx; struct rmi_function *fn; int i; @@ -1040,7 +1040,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) } if (data->bootloader_mode) - dev_warn(&rmi_dev->dev, "Device in bootloader mode.\n"); + dev_warn(dev, "Device in bootloader mode.\n"); data->irq_count = irq_count; data->num_of_irq_regs = (data->irq_count + 7) / 8;