From patchwork Thu Feb 25 09:18:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junlin Yang X-Patchwork-Id: 12103899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 024A0C433E0 for ; Thu, 25 Feb 2021 10:56:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0D1264E21 for ; Thu, 25 Feb 2021 10:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232465AbhBYK4L (ORCPT ); Thu, 25 Feb 2021 05:56:11 -0500 Received: from m12-11.163.com ([220.181.12.11]:51547 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233720AbhBYKyK (ORCPT ); Thu, 25 Feb 2021 05:54:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=SCoNv n+9QsqsnhVecLhlDBk099Ose5roiO9XWmqQc2M=; b=JNHAfkPEUzgOxG0lamJ4C 3urxkz8IFaxBdkkdSDYjmpGj2OosXIj3j6ML7uiX9JsZ7p7ibrWmT+lo/znyZNg5 XNyFyqbUzHqBBL4EwZrWQjWeC75TRYMtBX6TfSEzMX6nzxAXuI4PHbUVs8ulPdtA At9/GiI2umnDBKewGSoRjs= Received: from yangjunlin.ccdomain.com (unknown [218.17.89.92]) by smtp7 (Coremail) with SMTP id C8CowADHz6NmazdgGSQ+PQ--.888S2; Thu, 25 Feb 2021 17:18:31 +0800 (CST) From: angkery To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Junlin Yang Subject: [PATCH] Input: Remove unneeded variable Date: Thu, 25 Feb 2021 17:18:30 +0800 Message-Id: <20210225091830.545-1-angkery@163.com> X-Mailer: git-send-email 2.24.0.windows.2 MIME-Version: 1.0 X-CM-TRANSID: C8CowADHz6NmazdgGSQ+PQ--.888S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrZF1DuF15JrWrAF13tw1DKFg_yoWfurbE9r yav397Xr40yw1ktr1DXr13ZF9F9F4qvFW8ZF47tw13u34YqrZ8A3yDArs7Zr4qqw4xCFyD u3W5GryfAw18GjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUn-_-DUUUUU== X-Originating-IP: [218.17.89.92] X-CM-SenderInfo: 5dqjyvlu16il2tof0z/xtbCBgFEI13I01JQCwAAsv Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Junlin Yang The variable "ret" is initialized to zero and then returned. So remove the ret variable and return zero. Generated by:scripts/coccinelle/misc/returnvar.cocci Signed-off-by: Junlin Yang --- drivers/input/input.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index ccaeb24..8cdc3fe 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1746,8 +1746,6 @@ void input_reset_device(struct input_dev *dev) static int input_inhibit_device(struct input_dev *dev) { - int ret = 0; - mutex_lock(&dev->mutex); if (dev->inhibited) @@ -1769,7 +1767,7 @@ static int input_inhibit_device(struct input_dev *dev) out: mutex_unlock(&dev->mutex); - return ret; + return 0; } static int input_uninhibit_device(struct input_dev *dev)