Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3984559imm; Mon, 30 Jul 2018 06:52:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdrlOUKj2DmWTlI7RTlbHzkDTyfrjJUWGx0UDuomhcT3I015jAEL+/1g77NshuKDxXrnAnH X-Received: by 2002:a17:902:864b:: with SMTP id y11-v6mr16798071plt.335.1532958731018; Mon, 30 Jul 2018 06:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532958730; cv=none; d=google.com; s=arc-20160816; b=XYxn7MWvUYPJFx/BU0klmxu1bcRZpyZm2kfmyRCqlQvqA8wT53QNpvaO+BXlMsmoQ9 nT9YAwhANILDskVcI8eq/7ymn0ZocV0tRIL1zaLkvYnGP4Ol5T6Uwa6S3wGkwQRUTqK0 UU1tGuutCP/6xfePbcRKwzF4EBdtc2gEP2yXYSCiNu2LM2xc/Nnsg/qWbUDi6q/b5FDX cwoLxwyD5tG8TPmGPhZ8MONQf5z+bv6sv+SIaNNZ5mFwAH5EWhouOYq2pRMUHIStk10T lFGwkiJAREGLctjd6/OnUetDVKIrJuXFTg/7UTbWdUizUq5NeNcdPThu5dWjGgHnJmmZ o7hQ== 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=tCz22AsCObLojGGLfy1+GWdAdICfkV4UlIXdWEY5QW0=; b=FiomSWuQidKMlaQ01ZXmGKf7FUtEMomhdklx3bBeZyadCvm8PeGHHr4tc1iFYNrtfC cjdS1LTwsrpFg/4mvb2cVudJDDNSHPOfYlyjIE/FqTKQXESYQG28+AQXCHM2Gazpkaq0 DbqRGpxkskxqMjPP1PFsEaoAtuPQ1MlOsgjqBdJoXavMmvPkZp214A4GdwtKZwVh0Kt8 FiqFR+c/eLlW0frwIoJrEgGKIKvrPNlEhD1Cb2hnumzYAJN+zNtyC4Ar9FDiS6SHr9nU NcQfv0XxCnYsGPirMm0RNl6MAK1PH01KA9ruQLpXskv7aNHiQjo+PsyL0AWy+g26Wx7c JUcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZCQ8e0M+; 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 66-v6si10512964plb.428.2018.07.30.06.51.56; Mon, 30 Jul 2018 06:52:10 -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=ZCQ8e0M+; 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 S1727658AbeG3PZl (ORCPT + 99 others); Mon, 30 Jul 2018 11:25:41 -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-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"); } -- 2.17.0