Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5865100imm; Mon, 23 Jul 2018 07:23:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0TJCCqf3zKp6ZTmd8kt8RIiaukLlrNp/1VqeywEGHQV9u69GMhSlqO5GX5Soy3AxPS5LF X-Received: by 2002:a65:658d:: with SMTP id u13-v6mr12614619pgv.20.1532355804444; Mon, 23 Jul 2018 07:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532355804; cv=none; d=google.com; s=arc-20160816; b=JnoA006fu9azQOt7YhztR+C1NfqWdwynQLwj9yHCeQCsqTc51zm9fKlMuz/zm/Dlru Zg7JUlLhmH6x//+jbH7JDhXsM6WVSO9OYCderemQpsuKqZdzqipP6nF3LJYS6VtAJVAp +sdNw6Xqf0xjVpI2FCA+IZzhdMkne8lITSpdsVsVzsEzApxACOnbIhHfbJXL8MYkDoBx ZDQLQreygdLB6G3H0re1kxfNUmxucJmUVorXyBhRm5LlX0L8dIJFs8mtw3JNnW2p8G9g rHpMFgrN8irDDhBc/BjAXznnZ/NrOw8Hjf6f8wwFhEj0lK52x92q5Ym6UYEXxfO+9/VA nIvg== 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=L8+fiPMBjv+xt4hVwLR2LcDNB5+3+svfD6YIFWrEQiU=; b=cNNvFsScxnEh4t9Tsa6PzsFqHaKBCYQ2zD3e1lM/yPkilx6n4Q/ag5W5wuOt2VT75x dCQDPsFf2+RMkbO6bvOcjfmJPKQqFKMtzEIHv/TdBsuOmWenOLgbPcFmYxIGN4MlgRSp M7+pTWUk+a9CTN2Fxa2J+NRSrAC/Y0J9daw7H3+0H8f1+708fyG4qP44hgbj3TPTsY22 hWatSbIZhLFkElBj7nibzXF/f2CipBLooJMLTo/zUJ5+xGSLSTYVVNxXdgO2uf6j2nkE bK7PrmPYSnZpqG1/6yV3BXbX93CfhB2w2UTU9/xF+kIUZ0TT51au5z6OoJxiA2ko0EqM jSKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tVivLXqV; 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 q27-v6si8909453pfj.149.2018.07.23.07.23.09; Mon, 23 Jul 2018 07:23:24 -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=tVivLXqV; 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 S2388382AbeGWPWn (ORCPT + 99 others); Mon, 23 Jul 2018 11:22:43 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36523 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388104AbeGWPWn (ORCPT ); Mon, 23 Jul 2018 11:22:43 -0400 Received: by mail-pf1-f193.google.com with SMTP id d14-v6so126452pfo.3 for ; Mon, 23 Jul 2018 07:21:14 -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=L8+fiPMBjv+xt4hVwLR2LcDNB5+3+svfD6YIFWrEQiU=; b=tVivLXqV+Oya6zIru8r7jicqZqLWaBcx8mdzaEJd2f5g5bY9Ysv8bFPofCgFus9XUo z+hFm9hFIdqlXQ8FBK1oYoE/46jDZ2N5RN9z9gGTIE2Ka14djCnN9STAFXz2tM9Sh7sm BnBdtzHMDXk08yJELESs3KBCNDRr+KXx1l9rLaWhY/iKgL5GQn+Riyk+5IJ/B78d/Vte GlqED9xa/goTWQp8VHBjpVWh40X3I3yWf3CJvjZJkSUcGINyIT3W79W0b2mccBll8dcM K0VEH/wPNSGzWSZ6onsh9mLU/BoCPT9Qcb7PRA9OVljOBp5HjE9ntzfRoo3H/V+3Eiz6 p8XA== 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=L8+fiPMBjv+xt4hVwLR2LcDNB5+3+svfD6YIFWrEQiU=; b=t3rrpzRuHQTGEK/vUHJxr0ljPH+t/b1Q6cwwXUF+FkiEww2VdujocNRxoSoS10Y4qi 9c+y199Kiyc4X6duWqx801v43740i3HIBnfASNr0mgi/Z4kHDvbggPziwKXTv22QMIfq EVlGVn9+hV7iZYUwfNwM0lCEoEG4KOEewW2NsuDZkG+4R1GdRexfdl7hGZ2eMr58WdGm K1un1VsZ3EIkn4vcaDqCCvhOelNN9T1AB9LJp5iMUsUUBNei/kjowNZH8suGQoj1Gwms WTuY4G3oL1NfRfO0NGAIj59PjXQiN9PbXzQZ38GqcrWyCCGPkeNHktM67Z3Ps1tWAZxt WdAg== X-Gm-Message-State: AOUpUlFKM89jwBa9HcSZqu9+fXV1zsjI2Iu8Nqg71n5DRsDITydeWF05 7T5mO1osTw6apWVUF/rH6fU= X-Received: by 2002:a65:6551:: with SMTP id a17-v6mr12471141pgw.132.1532355674517; Mon, 23 Jul 2018 07:21:14 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:e422:450a:e730:728b]) by smtp.gmail.com with ESMTPSA id g184-v6sm11560306pgc.22.2018.07.23.07.21.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 07:21:14 -0700 (PDT) From: Jia-Ju Bai To: stefanr@s5r6.in-berlin.de Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] firewire: init_ohci1394_dma: Replace mdelay with msleep Date: Mon, 23 Jul 2018 22:21:04 +0800 Message-Id: <20180723142104.3477-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 init_ohci1394_wait_for_busresets() and init_ohci1394_reset_and_init_dma() are never called in atomic context. They call 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/firewire/init_ohci1394_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firewire/init_ohci1394_dma.c b/drivers/firewire/init_ohci1394_dma.c index 2cc89ce745c9..6b5a3c12f715 100644 --- a/drivers/firewire/init_ohci1394_dma.c +++ b/drivers/firewire/init_ohci1394_dma.c @@ -192,7 +192,7 @@ static inline void __init init_ohci1394_wait_for_busresets(struct ohci *ohci) int i, events; for (i = 0; i < 9; i++) { - mdelay(200); + msleep(200); events = reg_read(ohci, OHCI1394_IntEventSet); if (events & OHCI1394_busReset) reg_write(ohci, OHCI1394_IntEventClear, @@ -228,7 +228,7 @@ static inline void __init init_ohci1394_reset_and_init_dma(struct ohci *ohci) reg_write(ohci, OHCI1394_IntEventClear, 0xffffffff); reg_write(ohci, OHCI1394_IntMaskClear, 0xffffffff); - mdelay(50); /* Wait 50msec to make sure we have full link enabled */ + msleep(50); /* Wait 50msec to make sure we have full link enabled */ init_ohci1394_initialize(ohci); /* -- 2.17.0