Received: by 10.192.165.156 with SMTP id m28csp174103imm; Tue, 10 Apr 2018 19:09:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx49hLRbqcxsYmDL6jnIbVhCLLVY3y6LFG/eWBDw69YT8YSGf8GDQx5LIS0OU0yLgV0UUzvr0 X-Received: by 10.101.81.204 with SMTP id i12mr1981842pgq.206.1523412545086; Tue, 10 Apr 2018 19:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523412545; cv=none; d=google.com; s=arc-20160816; b=dWuRMtLn6R8H5p2bKMxyRRYFCHXkKkBeKwJTIBEbiG53vFs0ww2IZe1ceNoa3H9mZX J+4/pX6kS1Isc25b0f2Jtpa6AO4bWu1cg/6d60kdE8X7MPFHQzdmHAWR9jDEyJkwjuZC EUNq68/dN+PcIXXUngDASgcsM2hWuTwrsSNiEuFp+T8TAHoCY+nFrqCGWfRPiDqnM7PV BIz4kvFC80DGc3ngP33KLFUlv2KMQsoPbffXAYsmDCUWauUTpCLdyfQs2ljRF+DlS2KJ c6XhsKw5QKX3YN0BrDNA2FgUflMZ94RQbBWy3Yw6iXT0UiHLYP0Elqt0H6Yu8X3CKMeF KFiw== 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=EneuiYEMJYPBd1/yXvDJQ6pevUek3g/GtjsoDlvBLeI=; b=pX/dbYVTPlnWXFQk9zG/y6eM6RH2+FG+OztRs7sPHDgBobWS5KdOGMS/r89Roph9Xs Aiq/y1R8C69EpRm0O8GF1BEm5W40JazWU2FRr2Iug3bViZLmNvdDX/5noKIDZk1MPKCA E3xoVSFqFRe9m4U7QJdTMmYd4WQfYWC/CUKXhHiWbDF0WiwHuHZ8L6FlWsM8hY/bnIbc WEX/4ujQXWJ+w/xcUppfJN0Fp5gGS7nx5rpOFDXtiwaZq18qp0rInUb3zC4jY104pOja xeQtdFeuh2H+ZutP8YF9UmS24NuB32SIPfEMBa6asJ2xejIQjqXnIO/P3vF1e6cT/oCw STFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s6lPty9e; 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 r28si13378pfk.405.2018.04.10.19.08.27; Tue, 10 Apr 2018 19:09:05 -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=s6lPty9e; 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 S1752898AbeDKCBL (ORCPT + 99 others); Tue, 10 Apr 2018 22:01:11 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:40247 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbeDKCBK (ORCPT ); Tue, 10 Apr 2018 22:01:10 -0400 Received: by mail-pl0-f67.google.com with SMTP id x4-v6so210476pln.7; Tue, 10 Apr 2018 19:01:10 -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=EneuiYEMJYPBd1/yXvDJQ6pevUek3g/GtjsoDlvBLeI=; b=s6lPty9elvPMA4QL/myRxFINvf8ENysaximm6uhwJoIqGn7CLNZlNaXm+y28CICBoI Dxs542+/5dckXTRRnz15dX+TlWqLkwSUILValT2Qc5kY5FlhJf9if4Iv+iouZmqmzqxJ 4oPMVhHlsAPAHhBkMpxAdED6HYjHnaMf3DyswlUmvOgE2ekE1tfdG2kzsEG1I85kyekX /pJIacAZxWxMFyy76801xw8N8C9WRh2e7aPrVDacmkyInqD5zPK3xG1hbWSJzQqBlJf+ Gprf1m3EPlUVcv9mIkZGtC1prkdj1nj98GjPDOy0pp+gfOLuS0ssEvaHqFMqDooAKWdZ VY4g== 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=EneuiYEMJYPBd1/yXvDJQ6pevUek3g/GtjsoDlvBLeI=; b=pf3x2ZuPUxjd+0lr9IPYiP/WfN+7QKfud7vIGOCRpPtJ+wEk3eDbvQjBenZQ8Ak6ff s8roO0kcWIialwXQheoMJ6yPz8TfytpXy99zfapeHT86zc91ow/knxIWZNsrONe9UUHY DUdIbCeRI+bJ0vGBAne+8fVmaikP7PI29tueox94C+rExsH9eMbKzlhwrx4t8uf0ClxW aPRrzEhK+1xUksQ6cqCzjz5RhDxm9Fqg941SqtIqLgfyAd2T/Swa5zIe/HDvxZ5w2Jlh 46Rtkyf+0vVeqaUK0syg8htEnJdljkSso45l1sDuWAl2+rfjFr0QPTFf0HL2JhquUqzF We+A== X-Gm-Message-State: ALQs6tA+n692JHM6hz2u9iG+NpoeAB0uaxybPmLY5U3CrNmBpsu32o3a Eb87atQbrek+Zt9tsRnpMcI= X-Received: by 2002:a17:902:5416:: with SMTP id d22-v6mr2906952pli.111.1523412069801; Tue, 10 Apr 2018 19:01:09 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id d4sm65063pgc.43.2018.04.10.19.01.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 19:01:09 -0700 (PDT) From: Jia-Ju Bai To: davem@davemloft.net, dhowells@redhat.com, stephen@networkplumber.org, johannes.berg@intel.com, arvind.yadav.cs@gmail.com Cc: netdev@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] dec: tulip: de4x5: Replace mdelay with usleep_range in de4x5_hw_init Date: Wed, 11 Apr 2018 10:00:54 +0800 Message-Id: <1523412054-2108-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org de4x5_hw_init() is never called in atomic context. de4x5_hw_init() is only called by de4x5_pci_probe(), which is only set as ".probe" in struct pci_driver. Despite never getting called from atomic context, de4x5_hw_init() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- drivers/net/ethernet/dec/tulip/de4x5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c index 0affee9..3fb0119 100644 --- a/drivers/net/ethernet/dec/tulip/de4x5.c +++ b/drivers/net/ethernet/dec/tulip/de4x5.c @@ -1107,7 +1107,7 @@ static int (*dc_infoblock[])(struct net_device *dev, u_char, u_char *) = { pdev = to_pci_dev (gendev); pci_write_config_byte(pdev, PCI_CFDA_PSM, WAKEUP); } - mdelay(10); + usleep(10000, 11000); RESET_DE4X5; -- 1.9.1