From patchwork Tue Apr 10 13:30:04 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: 10333189 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E758A60365 for ; Tue, 10 Apr 2018 13:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA25928928 for ; Tue, 10 Apr 2018 13:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEB5328D42; Tue, 10 Apr 2018 13:30:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7B8628928 for ; Tue, 10 Apr 2018 13:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753019AbeDJNaT (ORCPT ); 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-Google-Smtp-Source: AIpwx48hQn/C31AYSQAHL8LwFI179NL7NM5MKJTUs1Ei72k1Jy5W1qvbDXZgk0+5j2/eEUNf60rkRQ== 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;