Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp547342imm; Fri, 27 Jul 2018 01:37:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeax5SoOwqv2CXxbmNLfjDN/Dg7yfpEK/yvE2jjXdQucgU9N6D2kJKnR4VQRhgm1BBf6Af+ X-Received: by 2002:a17:902:1703:: with SMTP id i3-v6mr5068350pli.263.1532680670226; Fri, 27 Jul 2018 01:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532680670; cv=none; d=google.com; s=arc-20160816; b=O0OaBCvBw4DrOaCLYACtnmLDryr/GsKhdUhMVUP0UDKf/qEHpvH5Akc10GIvNTMWIZ 8dn1N5lfl3oGwGVhqdSJRcaKtxoeD622bg5ZiMxj9zHeHZyePBNOpG8iIkwYHXDkPXZX cBm9a44GJbHblAIUG7CluVyuzRd52sNxTV0Ibe3ifOmglHWoC5x4RjGsiDma1d13QRnb 8KVX8euLr/qzEIFnNxL9bR61FaSnLC4YA/QZyhOUcCpNeDqlEXX1pAetgG2p1rcsXwod THeaJgiUBvNP2LAKeO8zHkYLj5ceM8kET10IKMQA+J1ZIUY75SkkiJIzJZMJ9XXQu5vl pqww== 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=ua4GP1DxrV1sLFxG80m4lAKLpm8j2fKndJKiDrySTJE=; b=re2wK3nj2eBCySWEo6NoGsfjtSLaVan4MXmXH5gopB7hNDgjgbguZyF8ewKmXXh8ey RneG9HdzNPnEoYs6M8y63k5YLvPxM8VXKvmF9+FeDz5kJ94pcqnJPye/kf8eYJWuLlHM fIC/JN5/3Hh9r03x5QkVfkBFb/K78gt1/Hgg0jL/Ytgmj05lqCDxWGYU/Tyh+oeVX6VU b8Air1QfTs7i6GHz7UIlY5kS/SXbwhERxfcXhhAk4Ib4tPxHNdfHLWBBIxfXQPzTc/qB z0lMv+6NCYSgtumUpctK3adgFCQ1pXFRTL2rGA352yoLTV+7Gu9kGCG8NAZ8WzUr/aI2 /Img== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lsTliRHf; 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 j10-v6si2920750pgq.503.2018.07.27.01.37.35; Fri, 27 Jul 2018 01:37:50 -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=lsTliRHf; 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 S1730473AbeG0J50 (ORCPT + 99 others); Fri, 27 Jul 2018 05:57:26 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45269 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729420AbeG0J50 (ORCPT ); Fri, 27 Jul 2018 05:57:26 -0400 Received: by mail-pg1-f193.google.com with SMTP id f1-v6so2820168pgq.12; Fri, 27 Jul 2018 01:36:37 -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=ua4GP1DxrV1sLFxG80m4lAKLpm8j2fKndJKiDrySTJE=; b=lsTliRHf/dxhQNHttcwGcCWbjO6yJXrD0tVRBeQ+BKtDiQafmyWxGrRhnFC6wkEVVE YY5t4KCfNPJUZkyHlbZzehaieOI9K4m7ijyEifaPwuf2SO6c7HP2ACS02HpayLTwOafv DMPnRI8jzMphmxfQZJjjbUsedyxtatCYgUEGS/HMLW4Bn2GHKyYbdWC4A810UykeTUza KJk1MYavFKJY4CrdOoX30XWDR99/6GEtQlNFnM3iLaZ4izGwi/7nxbRoSp6eAFPdSVEO Gv8junUQXiFlrHcEin+1wIzbgnm0qimf0sUvG5KwBiGkRFBIAtTLDdQSrixW/hPs4IZ1 D+XQ== 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=ua4GP1DxrV1sLFxG80m4lAKLpm8j2fKndJKiDrySTJE=; b=XDPI5n821NogdS6tUVgE17zr5AWFHN+rXYlKpczsl0hpHp9M6yndAHdE4eAOpfSOrS LNNfOULqcrwJEcNv8RZDsMD3DAvER7NIe7eJtRZ9yRiTnF5Gf6ktavfBMYbakuh5aNN2 crmDbdZuBv8JFpGM9kfA3pcI2G383tRfP1Ocgf1aUoqMEHLHIvx73zdSyAMQd0QTwtZG Fumm7qhPfJOD2r/aJpXP4+AEutv5u0UZoqkLa922jZrLUke3EJ5OQYlk++vb43g3dfVQ bMahuV9vn7L3SMm97a8Aphq2s9VgJO6XZQ2w0RtAqgIFX9MTtosaWtt/q02ih9JsRTEM prqA== X-Gm-Message-State: AOUpUlH/Cv7jr6GjCI/g988yIR11u91dFdLaV9rP2YwihMy2J4OKbqjd CghBCGNtL8wPXU3QUCHFw4N7Ce5I X-Received: by 2002:a63:cf4a:: with SMTP id b10-v6mr5223589pgj.235.1532680596829; Fri, 27 Jul 2018 01:36:36 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id w70-v6sm4652558pgd.18.2018.07.27.01.36.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:36:36 -0700 (PDT) From: Jia-Ju Bai To: petkan@nucleusys.com Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: usb: pegasus: Replace mdelay() with msleep() in setup_pegasus_II() Date: Fri, 27 Jul 2018 16:36:29 +0800 Message-Id: <20180727083629.18663-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 setup_pegasus_II() 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/usb/pegasus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 6514c86f043e..f4247b275e09 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c @@ -1067,7 +1067,7 @@ static inline void setup_pegasus_II(pegasus_t *pegasus) set_register(pegasus, Reg1d, 0); set_register(pegasus, Reg7b, 1); - mdelay(100); + msleep(100); if ((pegasus->features & HAS_HOME_PNA) && mii_mode) set_register(pegasus, Reg7b, 0); else -- 2.17.0