Received: by 10.192.165.156 with SMTP id m28csp242064imm; Tue, 10 Apr 2018 20:46:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/RzzZWpG18yq/PFeDiVHfA1gP5/+YYN9QO2cCJ7Djjk0bmoekb7CiuEiujhyM4ZB3Gg0xj X-Received: by 10.98.157.7 with SMTP id i7mr2505616pfd.85.1523418386946; Tue, 10 Apr 2018 20:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523418386; cv=none; d=google.com; s=arc-20160816; b=MJIU6DvNZ4E3n4J8PirmqNq7pBCY1oprPit79kl6NO/JwjfpcjG9rtU/gOL5WBb72n R1BvmSRiuRXIvCtAea8TPP88QWFfHsy1mqqEaq7/428RacpSxI1IWXdgbirkhFaJOpJW hzgYcp02bHLSAZF3MOwvEp4VhM5wEM7xbs6UaprC8vM9dIJOt18vGVOBe41JyKTt+BUV aIHJ26WXQcWPLBtjjpr/wFOz/Tizu8mNPQx2yoYjDmFmClL9FFgsJPgvgTH3o+WcLdAs hAeIv7w8oc0zeNGKnhapaJt9ppDMb1or6FaLcGPGrm27UPqdX1fFRMoMOcxzdtWUVucO 9FdQ== 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=RbaQrWij9BCZrHgn3fl02LFRkN9sqtCcpA+xvKUXZvE=; b=SqJUriY1U7I+o+uJkTnNSuBHNdYHsIEWQr+zPJOriu6lTKMm6pcAM6+Gn52mveHyj2 ncWMMuCXXq29MgwjBiUZjC/gG4Fbq/8UaB432dURfRlgC8yoMfAeb+liet/36i9MZnJ8 ad4HY2bWhFxK915ulRxKvYZcuYbeCo4Q5V0r5f0VtoGwsSJMc2I2QgfN/MY5PlHBflKW wRB6X70wzg3NpAN/rvsbuu0xLwA+KGUS+M8B3ZKKsNIFFmeYrhMYg4TnkpDMFkaJaxc1 L7cCsRFCRrAu1V8gJDOnwGSdQOSXQTYz95MUlnv7lNYyys95BgzeGxkTQFxoUHSghFWd zSww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vIRI7Jwz; 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 y11-v6si240130plg.173.2018.04.10.20.45.49; Tue, 10 Apr 2018 20:46:26 -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=vIRI7Jwz; 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 S1752796AbeDKDeB (ORCPT + 99 others); Tue, 10 Apr 2018 23:34:01 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36262 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbeDKDd7 (ORCPT ); Tue, 10 Apr 2018 23:33:59 -0400 Received: by mail-pf0-f195.google.com with SMTP id g14so284432pfh.3; Tue, 10 Apr 2018 20:33:59 -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=RbaQrWij9BCZrHgn3fl02LFRkN9sqtCcpA+xvKUXZvE=; b=vIRI7Jwz4/3O4o7WAD76IHfTyOTxPhQvqkl7589eSxJkE5tt9IVsDTNIKv9c03cTNh ZpqMar2PGmCsfwHBclR+FQ+8nMzNb5R7+ZkUyOp+ONVAzuSfxZ9KMMFhbj0Aj2J+XC0K VSzZJ9LbCBSfhSbYM4cDRbBTQWkTx0P/SWHJZdTsUD3kbhTP1OMsbcc+S5xSJqlarvhd mW1zrFFffbrnJK+hGcqmND1XwO9EJkciQcvq/emHD6EIJie75InBMVKmihjKjzVLtnbP Onm1A0b2/CtYIgg9p07SnUAzrFhxawa1nlhfE9J5Ca5Qq9SaAN+bBGbRMi+MIBFqe8NN Fb9g== 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=RbaQrWij9BCZrHgn3fl02LFRkN9sqtCcpA+xvKUXZvE=; b=C8ovJ1tBePAUzcn2VH8IC/kE1OIc53lFlMgWYjPu8olRpfukTBYoKjo0AAby4yQTP2 DCqygQp8c7CTlMCYjmGfZIETE4ajy0/kGcq8kZbi/mgwDO+nT7DpjwRxzhcIoGhQu+Ph 0s8efdb98fXKDMNkhY6PSKzhDdOhhu8FGJTpOIjvr6UBpZqlA0UYBLfn3jnJ7xZC9Tfp KPcyF+Ch35JIFZmuLvLnL2ZOCV81pLmMj2Duj0CEfe7HMtQ+4V69bh0UPqX95n1yIr9U H7WIkVHd8Tz11VY8wsK0DPXjVCPqjb0TfQugBI63hJb7os+xE1ypjyonq1d9OP6eWj3X bn3A== X-Gm-Message-State: ALQs6tDxpaap1yFWNFAEc4Lht16+pZvHvjeMLC4/Z7NfJk8r1XwvDnDA eKrSh7fiATcEa83qEKysdIg= X-Received: by 10.99.119.2 with SMTP id s2mr2157433pgc.436.1523417638699; Tue, 10 Apr 2018 20:33:58 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id 75sm318782pfx.71.2018.04.10.20.33.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 20:33:58 -0700 (PDT) From: Jia-Ju Bai To: isdn@linux-pingi.de, davem@davemloft.net, stephen@networkplumber.org, johannes.berg@intel.com, arvind.yadav.cs@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 2/2] isdn: hisax_fcpcipnp: Replace mdelay with usleep_range in fcpcipnp_setup Date: Wed, 11 Apr 2018 11:33:51 +0800 Message-Id: <1523417631-3295-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 fcpcipnp_setup() is never called in atomic context. The call chain ending up at fcpcipnp_setup() is: [1] fcpcipnp_setup() <- fcpnp_probe() fcpnp_probe() is set as ".probe" in struct pnp_driver. This function is not called in atomic context. Despite never getting called from atomic context, fcpcipnp_setup() 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/isdn/hisax/hisax_fcpcipnp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c index e4f7573..06068a42 100644 --- a/drivers/isdn/hisax/hisax_fcpcipnp.c +++ b/drivers/isdn/hisax/hisax_fcpcipnp.c @@ -772,11 +772,11 @@ static int fcpcipnp_setup(struct fritz_adapter *adapter) // Reset outb(0, adapter->io + AVM_STATUS0); - mdelay(10); + usleep_range(10000, 11000); outb(AVM_STATUS0_RESET, adapter->io + AVM_STATUS0); - mdelay(10); + usleep_range(10000, 11000); outb(0, adapter->io + AVM_STATUS0); - mdelay(10); + usleep_range(10000, 11000); switch (adapter->type) { case AVM_FRITZ_PCIV2: -- 1.9.1