Received: by 10.213.65.68 with SMTP id h4csp3911391imn; Tue, 10 Apr 2018 06:34:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/+cCBopm6wvwsUtkbC8Cv1b8DZZOgXDuUU8spwzAfftqVnwDLiesep08Eh7kIi45Y5JByO X-Received: by 2002:a17:902:549:: with SMTP id 67-v6mr497817plf.276.1523367255964; Tue, 10 Apr 2018 06:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523367255; cv=none; d=google.com; s=arc-20160816; b=v3aARSx32v/dUNftm8IDn2Yw8Ykrb9OMb0uK6zfcVmKkJyzUErykUWQqIz8EEvrkVX ScsFJEGzBCAgRIOcUKE3Ps1M1Qk3a4Yg47mqRwGAxQdCuUdOT1ERx4smqWM6b1bSf7tj WDRZP9N+GRX9sBAheE6hrHpnsrrStCUjkQlh0YyScOOt0J8Gj5dDUZ79At+pq0XERyMp cWk4p/lYQ21AcO/E+OjTsPQnztiCsIANnp1G/uEBz2EDroOS4nGr+2nEjL/Fqh0iR3pd UjqGjEI0Kg3sXkn+UvqyYsb03DYMWnSbahNUpsTI86t9qMU5aJsSLzx5T/Il86iQww/b nyvw== 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=Gf0mt3HR+iGusPqsZkyZku2tnwLTyEUfhgdVCSf9Fyg=; b=i1pwZNN0X2AscI347biPFoNVcHRnXYCUTQoFrnLnej9mUM8x5qwITQ9kmlVoQhnNal fhCFaYDTWZ4VdC+dgOYxlwSEsaC/wRDDwa8e9ZiwuEn2dHqlJ+vYvWT646A53V43A6OI lvzicD1dByVVe/uw1IRaEqDv3o8Q3jYjnS6E9dO3j7Tiyssy/X5XGGAPrez7Y+YAuXQL ZlHYq1VYvjDYO9D/9YjTLTuIzQCgeZgdbCv9xwvSZ7we0hyTFGqIZuAqj1UUu9dzuvc2 hwLOAAy2Le6vAlHRb5wPdyIeU/qFhs5rTHJkSqZvKilIup9MmN1pWwU0mPMpOh80zxji Zxjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YQeWNAmF; 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-v6si2720966plg.173.2018.04.10.06.33.38; Tue, 10 Apr 2018 06:34:15 -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=YQeWNAmF; 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 S1753919AbeDJNaT (ORCPT + 99 others); Tue, 10 Apr 2018 09:30:19 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:38833 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435AbeDJNaR (ORCPT ); Tue, 10 Apr 2018 09:30:17 -0400 Received: by mail-pf0-f196.google.com with SMTP id y69so8315107pfb.5; Tue, 10 Apr 2018 06:30:17 -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=Gf0mt3HR+iGusPqsZkyZku2tnwLTyEUfhgdVCSf9Fyg=; b=YQeWNAmF3IeEAf1F2ZAYdnD1z8NnR1JWvCPsOvAkI3c9wcQUGBqWCFv2D8s3Zx3d9J J6rJ08q2xWvCNFPbt4SuYCuyNiPoAprs5QYJKXEnC4NZdpAR3okehz8KLKVxgdJ/eNFh SOtyxnxLSAgW+0TraNScOsnWVDHq+oujbLKLazNEHajmySDEtbePJ6P9udlhgosYa1Ko OT8FqbSa1pm1PzuOY/+exa5Ma1Bib5hcm54mSeIy0a07V4Uw9kX7sWxVVEPryMfY0sMJ AOFl+dH0UyTKTI9/SjOQJRozkL8bQQDcyAy3IGCIBPP7HVjVgdn9JE5aS2eRo2cFUAUw klFQ== 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=Gf0mt3HR+iGusPqsZkyZku2tnwLTyEUfhgdVCSf9Fyg=; b=L0HkZ+sobOADcu3dk89ULwsp6gaFdoXdDf5whFq2xJUOYzuzjOgXJU0MebhKspeOch PoSa4REa0Brd2W5FZEmhgAUiP5kv26n+YclR4jvqFGxKQiQtobivNBoxYWv1sHOLv7XF YxiG1+eHtiyhBFU63+MFTVXeXmg9BMWzWctDd3HHPslS1UZEPkPDEhXvazPN/HBMvT6c CuAX3o9VNbgGqupWKNmupiznUIOAsrkzIWaM24paHiWoyaX/LmXTgbq8H04z9yE/e31k LMHTBRPDr0zNqw98ZqBggg8/DW4RFG6mHlln+5qzM2sON74SUOZOGdxB835xUkvrhCWU IyOw== X-Gm-Message-State: ALQs6tBGBg+6A2tATwbHvG8dMBAb+kSwPCw5CsAVio7+7m8A0tfHIu/u q/NlamF9kJsh0J5Y9F5FF74= X-Received: by 10.99.115.69 with SMTP id d5mr293248pgn.289.1523367016884; Tue, 10 Apr 2018 06:30:16 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:8dc7:7954:4991:f324]) by smtp.gmail.com with ESMTPSA id m21sm5627436pgn.0.2018.04.10.06.30.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 06:30:16 -0700 (PDT) From: Jia-Ju Bai To: kvalo@codeaurora.org, davem@davemloft.net, stephen@networkplumber.org, arvind.yadav.cs@gmail.com, johannes.berg@intel.com Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 1/2] net: wireless: zydas: Replace mdelay with msleep in zd1201_probe Date: Tue, 10 Apr 2018 21:30:04 +0800 Message-Id: <1523367004-31935-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 zd1201_probe() is never called in atomic context. zd1201_probe() is only set as ".probe" in struct usb_driver. Despite never getting called from atomic context, zd1201_probe() calls mdelay() to busily wait. This is not necessary and can be replaced with msleep() 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/wireless/zydas/zd1201.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/zydas/zd1201.c b/drivers/net/wireless/zydas/zd1201.c index 581e857..12774e9 100644 --- a/drivers/net/wireless/zydas/zd1201.c +++ b/drivers/net/wireless/zydas/zd1201.c @@ -1767,7 +1767,7 @@ static int zd1201_probe(struct usb_interface *interface, goto err_zd; } - mdelay(100); + msleep(100); err = zd1201_drvr_start(zd); if (err) goto err_zd; -- 1.9.1