Received: by 10.223.176.46 with SMTP id f43csp809198wra; Fri, 26 Jan 2018 07:15:54 -0800 (PST) X-Google-Smtp-Source: AH8x226uSlr+C4OSC1aN4SlbO7ECxnVQnAxV5vASjrHuhKumxviWFhg5Fx1wuLSiIc5gb4VnOSLt X-Received: by 2002:a17:902:49:: with SMTP id 67-v6mr14324315pla.424.1516979753931; Fri, 26 Jan 2018 07:15:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516979753; cv=none; d=google.com; s=arc-20160816; b=LOGsO8DE4q20NpTyfmZBMQkdbTC/xwL7zGY3J9+EuE9MHtQT7RhuLivqMCwjNji89t UKfQL+SHH8uq7kEUAirVBB+xngRvEx43++g72WQIpR399nsujgyRksYv3AYFFg8bU5ev ln1AjRBcX8W6++uIExBWxGxkRirZKyBqlVRptB65rHBgRr+0RlnlZ7kw+Ra88VmvDE/3 dYQSjUU7J337GyrzCDIkp5vBVX7t45g345Cs4c9sbuB2Meg/auDlCGHL1Pvypw9YP4jy WP/MCryE4IRXQqzOg6T6nemzGymo9p+OXYc0t9I5CW93ARGhALaS/IA2Q+ERm9rDx63j iCDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=HF7WQcObtW0q1BuxX6G5x7hNOqNB4TpldD9erlKWmoI=; b=EG6OoSpkRmzygOXf1ht5eRbG0uuC+R6kTADrjiLn/7LKB/HsbcqiHSgw3EAMQPD5Ab OUIq1PhewwoGrujTn6S2cOfZKSfeTvD3nY88GI2lSdygS13l+8UGt9K0oonIvdd27sTi uwp5FjhDm80/1mX+eVI/bmVhTgX3+UoIRwACyVn900lNEr5/zniGP2oqyVHmH5gCKtp+ FtAp76NdBtYxwGzoqc+WvCnb1lvndvtjexHzEEgSTLAQVq1lcGffCDLixpDCvfInN66A O3oDAMQNs19gsXdMzS5SGen/+aQ6CQi1dFImVy0Pa45x5qltNGYMo9AzCbw2g2WU3Ni5 zwNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MDwZ5UW9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b126si3105223pgc.610.2018.01.26.07.15.39; Fri, 26 Jan 2018 07:15:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MDwZ5UW9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753701AbeAZPOp (ORCPT + 99 others); Fri, 26 Jan 2018 10:14:45 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:43475 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753687AbeAZPOl (ORCPT ); Fri, 26 Jan 2018 10:14:41 -0500 Received: by mail-pg0-f67.google.com with SMTP id n17so432335pgf.10 for ; Fri, 26 Jan 2018 07:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=HF7WQcObtW0q1BuxX6G5x7hNOqNB4TpldD9erlKWmoI=; b=MDwZ5UW9dJKy+GbTHgExXWPHs4Jh88PgxkdcQAn2hBIu2Pt33das145KuKf/vbfNL+ ryy2e9qEg8kUgas0tP4dayZXpUGVAzKBHjNQK361IDGnFRtDzsUWPW/19iq+vmM+8ccY mZzX8FrS7Rbe6hYnolsZ5d6C5PKNRFFn/TmKGdB+unOy32FkP0lE1rLIoBjVhETKw70u wfm8W4DX/NnX7mli58MKJ/DhgB+8k88x5//3DH13ZtqmlksGxs5TBEO0Ufchsr/+jhib P7MirbXkD5wF9SG6meC2PTcIFZSRRfBR1DM00zasSAW9/YOEMQJr003Lfml7SwfxLdr5 9OnQ== 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=HF7WQcObtW0q1BuxX6G5x7hNOqNB4TpldD9erlKWmoI=; b=Hq5yC4k+74a8TEIjxOhKq9HY8o/uMiuo3p96Xvy+d96wGIax1BWC9dXS+UnW7ulAon 6VlNmcEOu27pF7JzEw9sNnkvMZibTK7xCmdYMSN37LDPiK/Zki7N8Y0m4dzkdR9eH3FZ kqF9wmayD9hhiArxE9YtmD3yBL7wsxXJarg+rzU4ZtpKuR1W6ApBLkNvbsJs1jWE07ek Ny8WDPp+Yik87lBxvBzzOlPClSb8n6AuHe/u045mz2Z11hLE/PLjhRCSZ2+yW7j8e7Qn KwEozbyCE4kSnwUTsrH3Lp9Mi5w8pKiptAJ2ewF2kgKj12G6dbxykkuFTjuKdEBsqm1y vy/Q== X-Gm-Message-State: AKwxytfEdWrq1rUoNDiLW45G6YLDxuQU5wxeihpbNhWO0TFgF6jNyLxx vMKpKwTb0Cj78ffyLAHf5oA= X-Received: by 2002:a17:902:42a3:: with SMTP id h32-v6mr14275645pld.56.1516979680685; Fri, 26 Jan 2018 07:14:40 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:3967:a579:e81d:66fa]) by smtp.gmail.com with ESMTPSA id h13sm16520651pfi.40.2018.01.26.07.14.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 07:14:39 -0800 (PST) From: Jia-Ju Bai To: miguel.ojeda.sandonis@gmail.com, w@1wt.eu Cc: linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] auxdisplay: charlcd: delete mdelay in long_sleep Date: Fri, 26 Jan 2018 23:19:15 +0800 Message-Id: <1516979955-7466-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function long_sleep() calls mdelay() when in an interrupt handler. But only charlcd_clear_display() and charlcd_init_display calls long_sleep(), and my tool finds that the two functions are never called in an interrupt handler. Thus mdelay() and in_interrupt() are not necessary. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/auxdisplay/charlcd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 642afd8..9e84795 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -102,10 +102,7 @@ struct charlcd_priv { /* sleeps that many milliseconds with a reschedule */ static void long_sleep(int ms) { - if (in_interrupt()) - mdelay(ms); - else - schedule_timeout_interruptible(msecs_to_jiffies(ms)); + schedule_timeout_interruptible(msecs_to_jiffies(ms)); } /* turn the backlight on or off */ -- 1.7.9.5