Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp525522imm; Fri, 27 Jul 2018 01:08:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdmfiK/Ml6ewcvPYHel/A1tSlrmJ+Lqs8o0mJPeV7js+lcRDyku3NylZbG6sJsEiV2pZFGX X-Received: by 2002:a17:902:5857:: with SMTP id f23-v6mr5102279plj.206.1532678939541; Fri, 27 Jul 2018 01:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532678939; cv=none; d=google.com; s=arc-20160816; b=dDIWj8SOx5A0qkNfW9LNb++2qLp7L4Oueq1jtplsOTX/vmPFmSKXOr9iuu6KchOr1l JjZNSJAMme2Ov7I1pke4RJcJCzzNzSqFVvXcBsshVHo6hREcVVtPA5ENc3F7zrBpgbum c+Ed6/fo3Gp/HjBorTrHzVvrTWO00Dm+X08OP7JaHowliTo1bNg6c3QIIMlcAk32ARLL faLbaW2XlW2TNJ34Io2x2sLjbuEen2Tq+iWMYhVsROusrqz5TIERiYKWVqNeW19L3hCR 6J15Bay8wxIHh7GRnCy8HOsk1vcR7wMKanOJRhhFBbMIGF9kGpe7ozEzXu/J0Umh6GU3 vmaA== 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=qzVHO/6sRR1GOrx8CgUKWp1sL45+HfcyKN9jRLMtR+Y=; b=dqXvK72wWxK7HSctugzgNz1v1TttO1Q3XZKgPDIyaTTW643GaESjBLl7c74efdCRsy cs3UN1YxouKricFGGv+Y7njNwI4z5oiREX9ZabW7Ij1+RSkgtPlYxfdOYxuxUrHUfwJK 9lLrCYt2vPQaE7VkICpn9zbiNVTtr72UBhopW0U3pckU8eMS5tCL92TovWLL9HCavcqB SMiFWlbsAEItiDArO00BPPLa3vomKtDmFqehu5j5JKwrF6gRsv/uQV9x/cPPfMEmGoZM EPQb718kTNBmwblm1RihXuU8BP+UzdQHcFA48Ale2NxHXGckDRBaZgHxP/orgmnN/hXn DJSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BRKwQmiI; 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 c18-v6si3374067pgh.530.2018.07.27.01.08.44; Fri, 27 Jul 2018 01:08:59 -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=BRKwQmiI; 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 S1729565AbeG0J23 (ORCPT + 99 others); Fri, 27 Jul 2018 05:28:29 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44471 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbeG0J23 (ORCPT ); Fri, 27 Jul 2018 05:28:29 -0400 Received: by mail-pg1-f195.google.com with SMTP id r1-v6so2781810pgp.11; 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=qsbnXyl0I/XxfoPB74ednitLnFWtiJaltM5XSGcc/tEU/rH4urHQPa2ElmKcvHGBFH ryngjhS5Jix4nplp6GocCxY+hbOwH+fhj7bnQLr05e0ZWRpdkRELmNnY+0p9iHaWmTfO oJ8dHbNJgDR84wKO+U1hfMf8Gc4DvEMwXovOLe4CS0vjI+OaKSvu0U6SizWefS4RMtPX +RUOjPE+GJHSIvApZ5KDhvZ6qy+RYn/Hq8TwfXkNGMuThK9fp5qn2K6+liwKHibQ4J/h U86PXGDav8GRliPDnApGyWVpP69Fm4OVsVHOX2+Y9s4EsT0DboHIDWavQn8Djj+8mbJ/ 7wqQ== X-Gm-Message-State: AOUpUlGQ4Co46ot32liX4j8kiX1cem+kF9Y6/oWANLmT341sWJ183uuQ 02ZgnLFOmu/5dDbK2Ff2ks0= 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 Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: intel: igb: Replace mdelay() with msleep() in igb_integrated_phy_loopback() 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } -- 2.17.0