From patchwork Mon Jul 30 13:50:29 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: 10549115 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 5508E139A for ; Mon, 30 Jul 2018 13:51:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4690829F03 for ; Mon, 30 Jul 2018 13:51:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44F962A0F1; Mon, 30 Jul 2018 13:51:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 DDC6E29F03 for ; Mon, 30 Jul 2018 13:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727159AbeG3PZk (ORCPT ); Mon, 30 Jul 2018 11:25:40 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46434 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbeG3PZk (ORCPT ); Mon, 30 Jul 2018 11:25:40 -0400 Received: by mail-pf1-f194.google.com with SMTP id u24-v6so4562790pfn.13; Mon, 30 Jul 2018 06:50:35 -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=tCz22AsCObLojGGLfy1+GWdAdICfkV4UlIXdWEY5QW0=; b=ZCQ8e0M+aK9Qh44UXoAV5jMs2VUzcqp6Qtm+neCSxBWio3dbobSJ9EInBFz/+iBD40 UZFQHw+bpqRtguAflJhQh9W/hUOSRbVskfP+0eRE8hA23U6usYegl9xRU3FWyUB4ToOr JevYwOD/vKuqaEwUxdDsN1KuWLbCoy9/nStfhCt7DDQWveCGh8BEGpQ+kJoChWrs+3xO 2rI3tNGwC5EvF10seDucHO2g6VlEGbFAXwQjlbgq+IVwi5mJPfBDQ5+eTaBSSnbXJYo4 3yMqg1IO6egyXO6poTEOiuoLK+xa5XxePR6gQikhdAoqU1gur5gVGZIH7RbIwWuv3MNS Nk8w== 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=tCz22AsCObLojGGLfy1+GWdAdICfkV4UlIXdWEY5QW0=; b=KcYiqOkpG+XANOtKL1Cnn8ZI5Fn1tK72fPyLISlPHrGXeBGdT7Hj4tdlGu47G6Pjfh j9iZpkv+kuIxx1LgaBeGa0JpERgX1WV2Is1vxx1u3PqoQjwJEyr5QW8A0WBoPMxjMaaW 0gw+wNMeYiZ6KNUt/tLBhAEid5ex7HD3EA5vGxsr/IHqTTLpdRVlUR4VVE583oeM8hf8 y1oLgZlrGJDOQt0iNHHW6CxAbIZsobwvRTML5lF7MLzhJWD2g9ZefqVhi7Ky0S1DBaTd ni/XPJuEO+EPl66cFcMhT7FWJ7iUX30j+9SqsC5x0oy1P2T9G0788FJhW5Aa4GTi6J6f 9GHA== X-Gm-Message-State: AOUpUlHjycucKkpJ1Bd0UfLMaDEJw7d6VY3acyuwHq0mBRzlEEbAa5PC j4NE/HAICFBJkhF2TGVkJoc= X-Google-Smtp-Source: AAOMgpcQy1J8sEbsvkwCybk6TAjlIqR3KRDPmBGhg6enS66l98ymf0u9mDFb7FHY025kIXR94xE5dA== X-Received: by 2002:a63:b95c:: with SMTP id v28-v6mr16428265pgo.162.1532958634867; Mon, 30 Jul 2018 06:50:34 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:4550:ab75:cee3:d6c1]) by smtp.gmail.com with ESMTPSA id r22-v6sm20270696pfl.112.2018.07.30.06.50.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jul 2018 06:50:34 -0700 (PDT) From: Jia-Ju Bai To: sre@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] power: reset: syscon-poweroff: Replace mdelay() with msleep() in syscon_poweroff() Date: Mon, 30 Jul 2018 21:50:29 +0800 Message-Id: <20180730135029.9228-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP syscon_poweroff() 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/power/reset/syscon-poweroff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/reset/syscon-poweroff.c b/drivers/power/reset/syscon-poweroff.c index f9f1cb54fbf9..b8b154606dbe 100644 --- a/drivers/power/reset/syscon-poweroff.c +++ b/drivers/power/reset/syscon-poweroff.c @@ -36,7 +36,7 @@ static void syscon_poweroff(void) /* Issue the poweroff */ regmap_update_bits(map, offset, mask, value); - mdelay(1000); + msleep(1000); pr_emerg("Unable to poweroff system\n"); }