Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3993741imm; Mon, 30 Jul 2018 07:00:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfS6qP3cxaI+ote33+vk5H4vnW+uFwtDV4eRhuZMvsBrdz3KTJa5Kf2Dlp0nvBwbZJbd7tO X-Received: by 2002:a17:902:14e:: with SMTP id 72-v6mr16430639plb.299.1532959258806; Mon, 30 Jul 2018 07:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532959258; cv=none; d=google.com; s=arc-20160816; b=w/7FIj1X5F0jUE5iGf9nqQe0cgDZ5iJDTEUGQ/+iJsU1t40jNDPr9lfuKBxWLkMcOt SnvRMA6zTDUW6NnpohKfN6rSz9Bu3eR1U9jQ8iQYWIxdcY4MFYsBxYtg3shpUPQwCtLz nQJu9bcTnKYEy4MqnkCj2BhqXC6Jqd3TqlgCJFG2ZUnJcXhe8posnyYmufDVAJ9fZTZM PVJchx/XNSIS2RsdRhuOi3YbYhIZdGArOJ0DNc9Ig0DQ34ZHtJExZVJBvJk+xmvEJYpi IeawyaT6Bwd2L8Kefe8aR0YRUKoGJxBEnzVxXj4b4MywlITh9tbw2S9aqw3g06ob0UOP YS8Q== 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=dBiCWXblctIr3vvyM+Skj+Lv6yBR00qTBG4Bud6S7Bk=; b=EV7HWVV27BsBTK7mG+HrBhd2+c443oSuoRhwZFtDwZtiAp74YHMVLY4/6sfLGvnwUX Dz+LJmnlmhO2JA11OeRf4FPwMHjXw9A7PRwkpdxZJ64+V7lsga1oFKl3sqHubmRfbyjq W6RW4NnBNv1IWSk57wF3V35lG9QOZZNPs/SZaIVJ6IhITrblbnC6blxrNA+F47kpdVYF Dq0yUb3qT73msIy051mUFy7lydvlB4YUSyv1rdIWHkC760oAdD81vy3jHIiGa+iMyFgm CBSlhlIvmaf7zOa78WAb9RtRbXGexO7FDCD/FIVXmnCQyfsOBLINn4DsvOqt02Mu9ajl iCCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YHcDPxi7; 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=QUARANTINE 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 x3-v6si11847748pfj.289.2018.07.30.07.00.43; Mon, 30 Jul 2018 07:00:58 -0700 (PDT) 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=YHcDPxi7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726828AbeG3Pe6 (ORCPT + 99 others); Mon, 30 Jul 2018 11:34:58 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46574 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbeG3Pe6 (ORCPT ); Mon, 30 Jul 2018 11:34:58 -0400 Received: by mail-pg1-f193.google.com with SMTP id p23-v6so7303668pgv.13; Mon, 30 Jul 2018 06:59:50 -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=dBiCWXblctIr3vvyM+Skj+Lv6yBR00qTBG4Bud6S7Bk=; b=YHcDPxi7ZzvCeoYbhbi0xhpKITv3aQhStS2eDLRRm8HWaAFjZxSO6seqXgOxf7K+dS Mh2T2J0Qwo2RL6XON5uQccpV1eUb7vXGMOMp+ttBCPQ+k2poPEItaJ2U7doDRYGtw7te 1CRIoQnE61G0hIDb40jvMoVw/5jpxpeAG4lnyzu3pbzGoswM3rlrJOFCyRkwHjnY+PTx 0WbHpxcj4gt/rA0CHDmXn07/rijL3aWLs67Mr8xyo//6FcUDk2Qb4XGJauzMACCxF2tb k5P6GP70dkNiJ3durrP65YnWgcCEeIdkU+i4EqQ9uW9HSUs5MyMn5j7UqdaujREZ/xcK Ew5Q== 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=dBiCWXblctIr3vvyM+Skj+Lv6yBR00qTBG4Bud6S7Bk=; b=depOdyvk+plEgB3Bq4oobWNzj71LRyN9Q74XqfXHQNvcB/xVH3xUeyNDvUGkOCm+Wv fatNMESvOGMQx7aGcnXlcj2mdieDhKvvsCFaJMH4SmZAFH3eam7tsCB05+z2KN5qw9uv YeO70OgbSxAy3+CSVC9qH2vuswVBf8fypWHRTkwejXLhadL9mEEfkyq2pGm5y5vfICdI lPFh31ELdikOL/zz6Wiw5/Yh9wirQtRM8GKweMVQiL+azXM9YztdXdA5SzLdRyyv2mCP RXW1ctAfvuRmbGjNIVxPGSzEsZO3voSl9QVgGVOX1sFGHgFpcMuf2bW5GUt5xTfNmfCM Fogw== X-Gm-Message-State: AOUpUlE5pW3Um4SlUrLDQMrRatUkcICX7/3c+Fh2BPBhB2L7D4YtffXe +IcglNqDmfK4B7kkbw9FBO8= X-Received: by 2002:a65:58c8:: with SMTP id e8-v6mr16280702pgu.96.1532959190454; Mon, 30 Jul 2018 06:59:50 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:4550:ab75:cee3:d6c1]) by smtp.gmail.com with ESMTPSA id n12-v6sm32934094pfh.146.2018.07.30.06.59.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jul 2018 06:59:49 -0700 (PDT) From: Jia-Ju Bai To: a.zummo@towertech.it, alexandre.belloni@bootlin.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] rtc: rtc-mrst: Replace mdelay() with msleep() in mrst_read_time() Date: Mon, 30 Jul 2018 21:59:03 +0800 Message-Id: <20180730135903.9442-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mrst_read_time() 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/rtc/rtc-mrst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c index fcb9de5218b2..e4015f70f9fe 100644 --- a/drivers/rtc/rtc-mrst.c +++ b/drivers/rtc/rtc-mrst.c @@ -91,7 +91,7 @@ static int mrst_read_time(struct device *dev, struct rtc_time *time) unsigned long flags; if (vrtc_is_updating()) - mdelay(20); + msleep(20); spin_lock_irqsave(&rtc_lock, flags); time->tm_sec = vrtc_cmos_read(RTC_SECONDS); -- 2.17.0