From patchwork Fri Jul 27 02:32:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 10546575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5ACE112B for ; Fri, 27 Jul 2018 02:32:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B93F52BA11 for ; Fri, 27 Jul 2018 02:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADCB52BA15; Fri, 27 Jul 2018 02:32:26 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,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 5D2AF2BA11 for ; Fri, 27 Jul 2018 02:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731898AbeG0DwB (ORCPT ); Thu, 26 Jul 2018 23:52:01 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35045 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731587AbeG0DwA (ORCPT ); Thu, 26 Jul 2018 23:52:00 -0400 Received: by mail-pf1-f193.google.com with SMTP id q7-v6so1209222pff.2; Thu, 26 Jul 2018 19:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hw5ZqMfoQIrkB/wTxn21h/0+whhSGPLmeaphm84CJ0M=; b=Xz12QzVEr1EqymWFiIijq/uaSBKYhbqZ/0Zbeo9+YJqE9HslYUGQmAvOMquRorD+LY JYsvoA1F/40wXCQXrXkhEd36Azz0rGgS2OKFZj4jN94ZjDDkUsBKotkNLhJ6alyEFPOx LjxoVDp9R85IoaLcTUY218jGixo8qfB+xWkaqt/xYTgdR5uR9ohEIUMNnCyV5eGejYw3 zKEpougjj1YMYUm1GNHI/BdsDriDUf+QcyrJw2eYAdeg9OcStqtYLAnQD+o393shpXxJ 3QxukU64rEtvGV/PBE7q2gswSZmx5RPrsEyWgeFXrbUj6t2fWYs0Pm05VZb2r1MaCyii pZkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hw5ZqMfoQIrkB/wTxn21h/0+whhSGPLmeaphm84CJ0M=; b=R0cGSe+757jDVf+xeh7EOJENy8XGQyPDab/DlA7b2H8SMLCHr0hYdwObwAF2TFEJkX QXbinLauLj1OzhqpE0DAx2g0dha+1jd5VkNp6ugyc44ITha9m5p5nUNaxsIxVTXJqaIB XhoiMCXK1IPAhYhedGWbpM5DXccR4QP4XhTDlNMbnudMA3E9rSpx7Vw4gV1PNF6A0uAf AdJkJLh+7vuyNc1YVfgZc4kgjBJ/Dy96L02cyoFzWimoCr5adjfIrxfAImuR4EwyrjY6 a2CYgePPpqvba2cQ1ShVkQ8ItsIs9j0Z/0nx+2wMhX5t2VenNUbhEPADigeh2wTNnsLC e0kQ== X-Gm-Message-State: AOUpUlF4gDux5xTwtpJFr3M3fZhdYyc7uUzpbnOWuEv7JOjLXJ+M2qq1 g3N9UTFBlM9KTotjmvs8nwbEbINk X-Google-Smtp-Source: AAOMgpfzrw2De8buhnPRZCOAr1vIRbNVjduWip5K7sKgCO9wpvLk9FVk2FDtUsQP8/bmk53DVWSOFw== X-Received: by 2002:a63:b40e:: with SMTP id s14-v6mr4262672pgf.9.1532658745023; Thu, 26 Jul 2018 19:32:25 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id q28-v6sm4475300pfg.144.2018.07.26.19.32.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 19:32:24 -0700 (PDT) From: Jia-Ju Bai To: dmitry.torokhov@gmail.com, rydberg@bitmath.org, gregkh@linuxfoundation.org, andi@etezian.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] input: touchscreen: wdt87xx_i2c: Replace mdelay() with msleep() in wdt87xx_resume() Date: Fri, 27 Jul 2018 10:32:16 +0800 Message-Id: <20180727023216.1467-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 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 wdt87xx_resume() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/input/touchscreen/wdt87xx_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c index 20f7f3902757..166edeb77776 100644 --- a/drivers/input/touchscreen/wdt87xx_i2c.c +++ b/drivers/input/touchscreen/wdt87xx_i2c.c @@ -1142,7 +1142,7 @@ static int __maybe_unused wdt87xx_resume(struct device *dev) * The chip may have been reset while system is resuming, * give it some time to settle. */ - mdelay(100); + msleep(100); error = wdt87xx_send_command(client, VND_CMD_START, 0); if (error)