Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp348931imm; Thu, 26 Jul 2018 20:52:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc3UoAolf+MVXs9uK540XbXr2UHS/qbFOIQNFxPvlmPHlEs6a5/NdNA5pejZhtNxHmBPBn4 X-Received: by 2002:a62:b29c:: with SMTP id z28-v6mr4963995pfl.8.1532663542256; Thu, 26 Jul 2018 20:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532663542; cv=none; d=google.com; s=arc-20160816; b=H57GUo1apzY/O9YJ/jlUaCX1llcV1lR3orhG3azVBnlxtM+FYumZptbrpVbEP9Q4Gy uzdxTTVQorahuJG1XpGOUU9txchompgEW4P6zq4P91r7VIvGNPqz2gczSbpifHFXNrut H9l4iwo4F6873SueBpyQZTSF1x/QwCgMUDBz3BeoFp+U7ezMqG2/Bi8DYCgYpm2tY+Jn OHoVPb2eVqW/axajaRnZMQlek2/ScMvoIOX9Tley6FQ/skU7rwtN4ww7fgAOH70AS/aX 7sUkeU7/R3IFAH0FLTmpKVVdtC9S/SM+TCCztGUP5SmYfPLgnzW9HdaSiqKSKq8rlfAO G96A== 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=WoCYEQ4/93geepmV3eG3C0h/RgQuGzZsmsCCY/grRXs=; b=rUmLyQlHDfzmmzqbP3ATG/m6sqcoqHIRD/e/PrpBJnMJdvUlR1Tk1nuV0fUaN/FMLV 6gnS6d2jsIqHQalNGuVqaHOhLdj77akAp2VUxxR9vn/Dyq6mVvXKam3o2MQfaOmYa4UD u9rmdQhpYxaO639nEEcdrlu8e1pqgdLdTPIerqJ9ahv9NCC74LvZkkUV6Cc9xrTShheN tJh/d97KEAIn3jagsAVN117uupBipP1mdnFFCaFDJd+0kMlCe1GZJ1oknZdNA8cQaM5G Va1yu2bfn45/wL9t9PoxW0NtFFu+C7HLzaMcEh038bRpuIiPDjWD0mDn0nBKSo1Do8IM FwMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EJfDGKUq; 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 r9-v6si2534130pgp.591.2018.07.26.20.52.06; Thu, 26 Jul 2018 20:52:22 -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=EJfDGKUq; 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 S1729181AbeG0FLF (ORCPT + 99 others); Fri, 27 Jul 2018 01:11:05 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:41096 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbeG0FLF (ORCPT ); Fri, 27 Jul 2018 01:11:05 -0400 Received: by mail-pl0-f66.google.com with SMTP id w8-v6so1719955ply.8; Thu, 26 Jul 2018 20:51: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=WoCYEQ4/93geepmV3eG3C0h/RgQuGzZsmsCCY/grRXs=; b=EJfDGKUqMLo61dsBsCup/Kv0hW6Z5/cvajjhxdSm7jV7e7XeGpeJlQGHAgxXOIY2Ea Gr90QVJy67aVfxwCrYU49Syn8Uzy24kQAoApK4L3mtKkiILldnega505KtvyXfd4cd/x VRJtqlw3b1vAEwt8NMeMZo01R/K3Wvn9eIBY1FWZ/9a0xowKKdvqtQO5NotAPyncBHTh 4sW4xvTzf2/9wp9OtyjlzLj6k/6HUO9uAWIzwdBd3TvlBCIr/IrumoysLFM2zFNLebZ4 DnMZH5qx0t4DkS7Jwvo8l/6jS7U6IHXa5VHs+2gWhn1b0chUhR4aIVM4lo5atDAYszem uASA== 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=WoCYEQ4/93geepmV3eG3C0h/RgQuGzZsmsCCY/grRXs=; b=Blx9Sb3ym/Xt3JhkkxcuVFhqopqInKDEZynEVjdVncP/+H/S3g6D593AQZaRCVYnaw 37yOg1Goysaysk7yGJ+kjuQHBMSHIL28dxNeFxoccoB9wuNsupK5fd6NcIrsJpohv/Zc 1XoB0rgIGClQLNO7QJCz11OY9g45BKaK/oF9btTmYCXX4Y+wWA9GgKn5gC6aL6kPVg+l Wn7e1t9dvajZyjIe9tqMhdsH4KA42eFiNhgoiNQHta4+0ps0o6QF+gSP+EB6USBXIf9H mp9lYkHGdyYengcKHOXz/mEphfKBzyIM6G+hsRsxFAD2IMw9FwcZoMdGdzJxRb6+WVnN 8C4Q== X-Gm-Message-State: AOUpUlGEaHoKOXV5C68xBbGAXpc554yYUso6oWJDn6UL4MysFRSOi/yS jkrmb2mHA2abgSJeG9kdYGUUVg2j X-Received: by 2002:a17:902:7b97:: with SMTP id w23-v6mr4509516pll.66.1532663474046; Thu, 26 Jul 2018 20:51:14 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id u9-v6sm9824748pfi.104.2018.07.26.20.51.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 20:51:13 -0700 (PDT) From: Jia-Ju Bai To: ionut@badula.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: adaptec: Replace mdelay() with msleep() in starfire_init_one() Date: Fri, 27 Jul 2018 11:51:06 +0800 Message-Id: <20180727035106.5185-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 starfire_init_one() 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/net/ethernet/adaptec/starfire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c index 3872ab96b80a..097467f44b0d 100644 --- a/drivers/net/ethernet/adaptec/starfire.c +++ b/drivers/net/ethernet/adaptec/starfire.c @@ -802,7 +802,7 @@ static int starfire_init_one(struct pci_dev *pdev, int mii_status; for (phy = 0; phy < 32 && phy_idx < PHY_CNT; phy++) { mdio_write(dev, phy, MII_BMCR, BMCR_RESET); - mdelay(100); + msleep(100); boguscnt = 1000; while (--boguscnt > 0) if ((mdio_read(dev, phy, MII_BMCR) & BMCR_RESET) == 0) -- 2.17.0