From patchwork Fri Jul 27 08:07:38 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: 950034 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=osuosl.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BRKwQmiI"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41cM5d73Lbz9s0R for ; Fri, 27 Jul 2018 18:07:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8BF488799A; Fri, 27 Jul 2018 08:07:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j6FcecK31JXs; Fri, 27 Jul 2018 08:07:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1C9C187A11; Fri, 27 Jul 2018 08:07:48 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 308901C2AD7 for ; Fri, 27 Jul 2018 08:07:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2D59B88CFB for ; Fri, 27 Jul 2018 08:07:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r9mNzPWbaKam for ; Fri, 27 Jul 2018 08:07:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by hemlock.osuosl.org (Postfix) with ESMTPS id C900C88CF2 for ; Fri, 27 Jul 2018 08:07:46 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id s7-v6so2785394pgv.3 for ; Fri, 27 Jul 2018 01:07:46 -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=qzVHO/6sRR1GOrx8CgUKWp1sL45+HfcyKN9jRLMtR+Y=; b=BRKwQmiIpymZ+OesLXnursMQJlKSI0gJC1SFJRjNiNiSpDvFOGLw/wAhbJTSazeXcS fCaYjRznAW00hZ/6yjvdoCCzNkHa6V1C9vN4uzoaYProX72rF3yIG+81pRxWeVeSmYF4 PiDuwYPflwbvzAYQ4Q9x5lkPDR61iI/KAIGs9WMt6X/P8Asbpw0DN0gEOPkBXoC6wx27 4fFsHLzyglOoDyhKd3njiau0bTzdNMwIE4dXdXM9Gp729PfizshmFXC+UDmJuZ8/CuCn 2pzmGjXnvKhdNciGcfeRpCIl242v5j372tbS8M7aEzrbBitX6FusSZ8s9XB1H8F/BE3S +ldg== 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=qzVHO/6sRR1GOrx8CgUKWp1sL45+HfcyKN9jRLMtR+Y=; b=Bzz2+GPWKuiqithS0rOim02ldqxGgnjYf3IZ+JRYFvU76b56JEl0kfpi9zLBjQwm5Y KW05B9tT0+eWqMvc7WixoLa8bX5hUBj+E/10Vtc9eIrdV4sSzR1hQmUOb5nVKmO+N8Sy xy34H7ZpHuw14++NX7rR4ncgIEKTCf63z/d+U52RxCTE1aqhOIwVxBwtveKrHJyWEeI6 AA9PBmTVzDB8AYXZOggJpjSFIt+zfQOdiRB5YrKijYG+oziRABaKnIqhc9iAz9G8lKPA tdCnFe0B1Vzq8VdB7q9MDte5q6ybAUix8vSYnPT+dn2j6BQv1N03ZARxJhvgBTkSc442 fxmw== X-Gm-Message-State: AOUpUlFP/EZZuYfM7tErsHKcV+LEbVH7NFsbFjgMyohGhXl8956mY0EB lrLSRWvg0Z7pGDtYzn3+auA= X-Google-Smtp-Source: AAOMgpd2T4kwj3lkyyl5TGoXT7oyljRiAzOA6aQkeWvFaabIhFY72fLT5t4K4hPIqopSR4FWdBfiYg== X-Received: by 2002:a63:e116:: with SMTP id z22-v6mr4904421pgh.89.1532678866556; Fri, 27 Jul 2018 01:07:46 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id l27-v6sm6302873pfi.180.2018.07.27.01.07.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:07:46 -0700 (PDT) From: Jia-Ju Bai To: jeffrey.t.kirsher@intel.com Date: Fri, 27 Jul 2018 16:07:38 +0800 Message-Id: <20180727080738.3301-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Subject: [Intel-wired-lan] [PATCH] net: intel: igb: Replace mdelay() with msleep() in igb_integrated_phy_loopback() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Jia-Ju Bai , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" igb_integrated_phy_loopback() 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 Tested-by: Aaron Brown --- drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index e77ba0d5866d..4e64c9a6f1b6 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -1670,7 +1670,7 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter) if (hw->phy.type == e1000_phy_m88) igb_phy_disable_receiver(adapter); - mdelay(500); + msleep(500); return 0; }