From patchwork Mon Jan 23 00:48:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9531561 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 960826020B for ; Mon, 23 Jan 2017 00:49:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8301327E33 for ; Mon, 23 Jan 2017 00:49:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77C5927F07; Mon, 23 Jan 2017 00:49:11 +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 2B06F27E33 for ; Mon, 23 Jan 2017 00:49:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750841AbdAWAtF (ORCPT ); Sun, 22 Jan 2017 19:49:05 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:54145 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbdAWAtD (ORCPT ); Sun, 22 Jan 2017 19:49:03 -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=8g5m3PgPjNVDDws6XIyzzm0RmRLOBEMYqlxf+7wRxnA=; b=klHwb9VqpWksnA mYxK0yqEMV/G96YB48wY54PdesLqLXD+cg16HgEkzvEBaKDlfjzePMrqa2WPXCkN5DVy/H9ZLtwoB sU1PGUFjWKXbYgy0Rb0aPQV5C6h7rURkq03xQ+fdFcUZhpqAfFxuzE4PqYTfcw0LrYFuRIsks16lc h934MJ3aDF1wNGOp0JsQ9VKcsynFJ/sVL2k1P/8XLy337PN9zafbBOwsVJ5lTwgD2JUDb9jtYEvml 3e2O5xIzb1NmSVPT/yNmQs1pxjp2AYni3FkVKxXHnV8iT9DOh9sUvdOuwtqn0o7aN225c+6MG+OPU bMlYSAvMfBqAgcdLQRrQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:35508 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cVSod-000II3-RN; Mon, 23 Jan 2017 00:49:00 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH 3/5] Input: mouse - drop unnecessary calls to input_set_drvdata Date: Sun, 22 Jan 2017 16:48:22 -0800 Message-Id: <1485132505-14562-4-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485132505-14562-1-git-send-email-linux@roeck-us.net> References: <1485132505-14562-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 Since there is no call to dev_get_drvdata() or input_get_drvdata(), the call to input_set_drvdata() is unnecessary and can be dropped. The conversion was done automatically using the following coccinelle script. @used@ @@ ( input_get_drvdata(...) | dev_get_drvdata(...) ) @depends on !used@ @@ - input_set_drvdata(...); Signed-off-by: Guenter Roeck --- drivers/input/mouse/cypress_ps2.c | 2 -- drivers/input/mouse/maplemouse.c | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c index faa3a980d4f5..21bad3e75fee 100644 --- a/drivers/input/mouse/cypress_ps2.c +++ b/drivers/input/mouse/cypress_ps2.c @@ -414,8 +414,6 @@ static int cypress_set_input_params(struct input_dev *input, __set_bit(BTN_RIGHT, input->keybit); __set_bit(BTN_MIDDLE, input->keybit); - input_set_drvdata(input, cytp); - return 0; } diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index 0a60717b91c6..25f0ecb90126 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -87,7 +87,6 @@ static int probe_maple_mouse(struct device *dev) mse->dev = input_dev; mse->mdev = mdev; - input_set_drvdata(input_dev, mse); input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);