Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp557729imm; Fri, 27 Jul 2018 01:52:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpezls6rWvtaK7yKpVMn57Ypbk6SyCpoeVAmP87FLjHsuWIjw6fm4TFJ85A4YUs7J+5Ref2D X-Received: by 2002:a17:902:3f81:: with SMTP id a1-v6mr5194372pld.29.1532681525589; Fri, 27 Jul 2018 01:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532681525; cv=none; d=google.com; s=arc-20160816; b=DOn7m7c2VYF5+ya6wucfcAw88z23SW1IB9VhGnZ1gILLdZP8dDfSNmp7rFOx6Ci4E3 MhxGk9VKkST70EFH4W0+E6KP9Uj4eL3SIRLYSC9LofnyYmzMPi/LpM2qvOaFeRmgSo03 KdVGpKgt2JsQM/AIbFMR5kHlyRHqlsOVL/EEG/Rhum+zWvZN0QybfhbbKPI7ICSDJOZ/ pW1gWTMYlnJnyG1rizxXJEE+fEMJQWOSvs1kcAV385xID2F3F8YLrBf4pl8TpZRxNTaS YbxGixJk84ZJvRArlPncJ815m90+TF2P1tICe1MG6raLumy6H6U1xEbUUQu5GloUhpLU rBgQ== 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=6GIpNh2bgdb/KYxb9tHqH2uePhDL83X9iGZ1KtSBckI=; b=kNMXM9B8aws6/9gaROjp3TiBHWTfJmdTCNicPwkNkWJUQTOJArPVncmVmIcT5ffKSI hJJPnzvPSRkM3gCOhTd0ObfW840/m/mRH+7X42vwpWyDCDATfc3wzjgRABNN+of+01DY 4bW7SpqWM5LFmjkeHHreCCYvAj82/ONZX6/Y436QemiEk8kPXh4JrbXY5Tl+NlOHYUR2 yuxGIA/ik8xyyPiOp/FYJPS+0Ksuhy5dL+p6+j8hVgKbZ0b5r3cULtwc8w5QlaMcCX80 e57gwnvsekiGKsP9oFIQDIUZuZm0Fklexyww/L+5bbp8bADma+4aNte5Pq9faUcv19M7 taNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eZWEZ+Ff; 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 v123-v6si3484461pfb.324.2018.07.27.01.51.47; Fri, 27 Jul 2018 01:52: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=eZWEZ+Ff; 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 S1730204AbeG0KLp (ORCPT + 99 others); Fri, 27 Jul 2018 06:11:45 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37524 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726034AbeG0KLp (ORCPT ); Fri, 27 Jul 2018 06:11:45 -0400 Received: by mail-pf1-f194.google.com with SMTP id a26-v6so1517645pfo.4; Fri, 27 Jul 2018 01:50:51 -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=6GIpNh2bgdb/KYxb9tHqH2uePhDL83X9iGZ1KtSBckI=; b=eZWEZ+FfMtmkmsTaQrrFL03RnKWneXAatS+rLfPxgE2Pmt+NiYXpLR5Myho3HLCbiA ExPeUEd0kZs4ecKir086FGgZqqEOOxq3VkHLhXzaM6b5y1ox298u9LZffK/DtBNrKda1 u2Bc73qgcr1ABoOKxnuKRFo1UxtFeSwE+HOegGgm0dkm39xbkChXbTclrsTWFNNQcp/W FAA1It9feqxrsgMAG+nMpmqkw9vz4pfR7roZPRB3O9ZTwJTiOzsSXQ/odV5SPMAp/wKJ qf8trtxKmUvI95Iz/XczMEl3SIqbZw/oTodpufsjuB0y96M4OcoRpvVlI5gDVNf7NWvc J1qQ== 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=6GIpNh2bgdb/KYxb9tHqH2uePhDL83X9iGZ1KtSBckI=; b=uKxrMOHIRc0XnfObwHw0pkyRzZ9vv7VIvuaj+pp6TbdfzBWg54g8WiuB0t0IpagxwO NPB/vOXrBsbKDTwJGp1d+QClK9fHOxu6pgMEpGhc6yL9ezF6SKH8AVpIkakLaS81/sKZ fyDxcqvNaZz+y61umHvD6WpNAS2XacxWJAm8WKSGuH2X5VxSHmjS5TlaHXVJignLBq1l TqMTpxjeRbXJr/57f9znIazrD4nT4+3+Pn4zRKS0GMM5uB/puRgU2yjEZj/+tHfS2dgV uJLdOHJ6tN6CoMZLBGE9dOgDPb6Hoa4DgMzgEib3cu6/959L1V6jbEWeaCk1gj6A8Kjs UgBQ== X-Gm-Message-State: AOUpUlGFtI27gNElB7SXtXTxt7BKFx4CTXdaylj6nJ5E9yTutrr45Ll/ uCWG6cKRCD9nAyKCT/DP9tE= X-Received: by 2002:a63:f449:: with SMTP id p9-v6mr5327193pgk.213.1532681451424; Fri, 27 Jul 2018 01:50:51 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id c88-v6sm6041924pfe.132.2018.07.27.01.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:50:50 -0700 (PDT) From: Jia-Ju Bai To: 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: realtek: rtl8225se: Replace mdelay() with msleep() in rtl8225se_rf_init Date: Fri, 27 Jul 2018 16:50:45 +0800 Message-Id: <20180727085045.3949-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 rtl8225se_rf_init() is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). This patch only replaces the mdelay() that has >20ms time to wait. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c b/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c index fde89866fa8d..51e32df6120b 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c +++ b/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c @@ -363,7 +363,7 @@ void rtl8225se_rf_init(struct ieee80211_hw *dev) rtl8187se_rf_writereg(dev, 0x00, 0x0037); mdelay(11); rtl8187se_rf_writereg(dev, 0x04, 0x0160); mdelay(11); rtl8187se_rf_writereg(dev, 0x07, 0x0080); mdelay(11); - rtl8187se_rf_writereg(dev, 0x02, 0x088D); mdelay(221); + rtl8187se_rf_writereg(dev, 0x02, 0x088D); msleep(221); rtl8187se_rf_writereg(dev, 0x00, 0x0137); mdelay(11); rtl8187se_rf_writereg(dev, 0x07, 0x0000); mdelay(1); rtl8187se_rf_writereg(dev, 0x07, 0x0180); mdelay(1); @@ -386,7 +386,7 @@ void rtl8225se_rf_init(struct ieee80211_hw *dev) rtl8187se_rf_writereg(dev, 0x00, 0x00BF); mdelay(1); rtl8187se_rf_writereg(dev, 0x0D, 0x08DF); mdelay(1); rtl8187se_rf_writereg(dev, 0x02, 0x004D); mdelay(1); - rtl8187se_rf_writereg(dev, 0x04, 0x0975); mdelay(31); + rtl8187se_rf_writereg(dev, 0x04, 0x0975); msleep(31); rtl8187se_rf_writereg(dev, 0x00, 0x0197); mdelay(1); rtl8187se_rf_writereg(dev, 0x05, 0x05AB); mdelay(1); -- 2.17.0