Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp554699imm; Fri, 27 Jul 2018 01:47:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcKf19BmypBf7OgMhbMlnBJSqnwxSDzaL2bgycr3hTuU38nmL0ilRe3bU4od3WVGVk28egi X-Received: by 2002:aa7:8645:: with SMTP id a5-v6mr5616425pfo.247.1532681263169; Fri, 27 Jul 2018 01:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532681263; cv=none; d=google.com; s=arc-20160816; b=SKiOUBuE4H2BepugCw2W43bBqMCGWkVnjMkcl0lW8rlQgBxKtofTp4gqhcRkgUaZI1 kAM0pq3G72RhxfgSJK3BdtBaTn8IC7mUkVilHeXu0vQ3WcqJR2qhNgVWsHHuD/+Rk7aF YOlHkWX81FYS9Bm21lw6NP8SmdzyccAtvkC8nwy6MdHE4wkJW9AxhT2b++/Nq89n/ezD S43uSx8scxOfDqRu3ub/pInxHNyqmiq0tent615C83qybug/e43C1CngCoySE2C/4oMo T8dl+B5cK/Uf34+4Fnjv/v9N35+O2kjZv+YIwvakVx7EmmVkk8MsjVTvBBF36w7XrY7e ymdw== 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=HfMP2w542DW7GZm/67DEFYm7v+68mgXV8RJ5TgNWbpE=; b=IYtwUm1tjgfQIlXr5jUuj7PvtUnnGl/NAVVVWLmjkhcgt3pkwUE0q52Ph9g9LEBQbP luVKZ2h4bAzgtgHhDXEWhMAIjasABr5VcEmqUD9qVrQFWoqv3WLDLX4O8F86ESVGtBmu FGlMy7TokfisftiMMcSipSkBZbPCooEKS5y5S+TDetWz7OXS3ZHZ1GcpApJFT3c+b9OU keNEuEsW/xNVzrqLFSEKv/hcdBpSGciZbOB7D4ejQhgNtsMl7RGmCzJXtaXIqf2CVr07 yJ01fAAR9nMLBpB6zddVFF2Ich/uVD39YQryDtkaEbvktc0Kj7qd6d/ZkQ4/+vwzPou/ 5UlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="u/xRWYFw"; 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 o12-v6si3063616plg.154.2018.07.27.01.47.25; Fri, 27 Jul 2018 01:47:43 -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="u/xRWYFw"; 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 S1730376AbeG0KGe (ORCPT + 99 others); Fri, 27 Jul 2018 06:06:34 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:46144 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729431AbeG0KGd (ORCPT ); Fri, 27 Jul 2018 06:06:33 -0400 Received: by mail-pl0-f67.google.com with SMTP id t17-v6so2022828ply.13; Fri, 27 Jul 2018 01:45:41 -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=HfMP2w542DW7GZm/67DEFYm7v+68mgXV8RJ5TgNWbpE=; b=u/xRWYFwPHlbT+fu6knhtwtLLY+B81LzkghP8HRsc7R9ZCxSGFrqGwBX78oSvN7GJv +7LUPHcgTfIlfIUSzTFk/S463sDFXq/Do5yGUWhTTKlpqWqLaHrAOcaTYqzGxe4083u+ 7EJfJJDnYWTXg1oHNtwkqU+LaYbDPJgFNPoPptUYsDopsWq39BwPv0gjeJd45KHiZ/Y4 t4CYUM8eCgxsN8f0+SN21NmLhzZ/kzhRF9UhbMaeFtcqwXPaRxabYTm/cvCHuNfkpIsf cscCzUnbs5SUSwSP3dhFt7h9nh5/MUweVSdtnjhqRP+4+3KCgu35QTG7iu2l7oyLcZ85 F6Bg== 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=HfMP2w542DW7GZm/67DEFYm7v+68mgXV8RJ5TgNWbpE=; b=KToIiizkhtdYpyDQmRSqHwKDkXSiDRkUp+IJRbBtG41gVkL+wMugP5Nwc1o4mrba13 3Auxr3xgmVNYMkPoDTWBTxnAG3lpZgx0QdoqVYbEpqJX4yfPC+kc2P7wd9Gpchf1lg0O 1Lg8/YJomByZllVF3nE70Sq/bHHK0GIKQ5wWGXsFiL2Rd9fpqTPZkWPQ9d8Wk7WY3AEG dcHnnJNlnJWMVrF8v25edEpHluWg6Zf9hc3tJoliWp1GUteEIWn+Zn3iyadg0MLGjNMF ip6fA5k5bs+SpRXUoqoWvYCsrVpmUR/F3g29sAcE/jxH4b3LAV7dMW/GVajWHkO0CY3A zITA== X-Gm-Message-State: AOUpUlE0wUdI8CS7BpvVDANPHdTM19RgrGqLFAlPvrqck3y2IDNlzpcb QsJrEi8iv5TbENdQu9K0Kls= X-Received: by 2002:a17:902:d692:: with SMTP id v18-v6mr5224036ply.59.1532681141670; Fri, 27 Jul 2018 01:45:41 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id e19-v6sm4004205pgv.48.2018.07.27.01.45.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:45:41 -0700 (PDT) From: Jia-Ju Bai To: simon@thekelleys.org.uk, kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: wireless: atmel: Replace mdelay() with msleep() in probe_atmel_card() Date: Fri, 27 Jul 2018 16:45:35 +0800 Message-Id: <20180727084535.3848-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 probe_atmel_card() 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/wireless/atmel/atmel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/atmel/atmel.c b/drivers/net/wireless/atmel/atmel.c index d122386c382b..d90f04e14292 100644 --- a/drivers/net/wireless/atmel/atmel.c +++ b/drivers/net/wireless/atmel/atmel.c @@ -3692,7 +3692,7 @@ static int probe_atmel_card(struct net_device *dev) atmel_write16(dev, GCR, 0x0060); atmel_write16(dev, GCR, 0x0040); - mdelay(500); + msleep(500); if (atmel_read16(dev, MR2) == 0) { /* No stored firmware so load a small stub which just -- 2.17.0