Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp562520imm; Fri, 27 Jul 2018 01:59:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpchG+bhdki5V/uWuLXJpi91SLO5oEg5hXetGae1RxgnNzTYt7MiWTAcHpnuh4VSzdPSzurS X-Received: by 2002:a65:6292:: with SMTP id f18-v6mr5237928pgv.85.1532681945366; Fri, 27 Jul 2018 01:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532681945; cv=none; d=google.com; s=arc-20160816; b=O5LpqwvYcQ3asceZDQmaqbm6SzaCD1vZYhjYcMlMZ83UPL+vWxSkmuuAVABOsOlnI0 mCW8hBc0H19Ij/8ir5ye1CaXAeJXmon1XED+KLiD5ML3yKrdaFgqAyiZO38IiMwJO9lJ utfiN/WHTE4AeAF7bQtD8J+gmI6cdmbE3CysmCR0uVwtz+oZj7JC6XkO5Fft44vXuZla 2BzNxn17QgUpgdohZBVoFaRJ26P3cBfyVEcVDg0nWCkppDdfZVxHrURwkgqTRjlrxdYf 93o0uIiDgAy89KtwT6hIT1mmtNjBPCLiSx3bkkTEv6h4ki71UuBK92YRueFjmvii2CBY kF6g== 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=tAknk93iXRXfEaLS/SlYbFRYN4UqDbUTH7Wuwk94oZI=; b=PpELlcOZda39fgFl0j9xWTAF/sSL4mnzJo+znaCbC7hvDhCgoKi+JlCuYQI4APGOqI 16jMi0z3+8T+hT2Ul1LYTLADXZ0yCnmAVfoYsfnrQG2gs8Ns6JxaBYa2CxZ/O3+g3jyr 1rLzRxM4VKF96u2TcmBU0UhkEjPs237RE5g6ZFSJ6t1cDDSezbtXofk7dUZmt2eM5w69 hypF6r+Bsh8lPTfAG3vJyODcLDhpktcy/6qLwo5HFRgUYkO0jci2nEJ1Fh/OoroB4t5j Z12ixT5ZfNHXNxa7qsU3B/jfq1kxGgxGSqpmA9hqGbROBG38deT/uQW2Pt7HZDjMuvrK /iLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="QR/mJOAT"; 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 q35-v6si3281857pgb.219.2018.07.27.01.58.50; Fri, 27 Jul 2018 01:59: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="QR/mJOAT"; 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 S1729539AbeG0KS5 (ORCPT + 99 others); Fri, 27 Jul 2018 06:18:57 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43157 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729445AbeG0KS5 (ORCPT ); Fri, 27 Jul 2018 06:18:57 -0400 Received: by mail-pg1-f195.google.com with SMTP id v13-v6so2853668pgr.10 for ; Fri, 27 Jul 2018 01:58:03 -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=tAknk93iXRXfEaLS/SlYbFRYN4UqDbUTH7Wuwk94oZI=; b=QR/mJOATjfVpI09KHpDOjepdigOp+0D2tJp2RS1QKhtStnruR09Uhim8PHH3y6SkvU ukfY7wALM9cmWRFS5S6y3Y+m0Hkk8CHRln+qwfFgsA44+eis3sELZV/oMppiu5kgUOb7 NDfrt9f/LdQQOxpXu16XIy3qg5W6D7tCAo51AjRiYRb5ijUasbpSRtbCgBwnAnO3wf2f P4sM1RjNFVrPuziJ7zhsUW3urwXePh1rBti3qbRzUSpZchqvCw3BG9GAZc1kKXhFHBwl Mro8uDpAZkopsR8AQFpexkMa9cfnwhdE/WMlmWxNTQ61bgoYMrEzpvcd0FHbh1aXUJjL N0bg== 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=tAknk93iXRXfEaLS/SlYbFRYN4UqDbUTH7Wuwk94oZI=; b=Qk6Tct1R/czVQuKE2mgq1gXOhwM2WasWrd9OpPnQtyOQubHbcO4BhVuQLJN0M9+bv/ NFIM750Qp+puMXOYORNrPyGcAiWRGspXcfRzNFq7gMHYCCJspSyr6q0mfBAlQ4dUC+9A ql5bCjrxALTivBnv1exCf2hT/aTuPDmGBECIgEOVruIW0i9pp0WkuvtRCQyl7/5momwZ HSqzZL0fV0rQfJpLllUzmPVH4H1KjuOqKv18kNf/2aeJL4bkPyb/yx+eJO8/MK4s+ZZn KBcyhRUHdD7j9UyEfuvunZyvoHMuvYsk9Xet5DNHmpG+S9pWcfeqruPSmT6kdmwwt8Od l6yg== X-Gm-Message-State: AOUpUlH4Rgq5wqt/V93ETpEpx91qG8SskJbo2D55QQhIe9B8SWuLEz2D 9hbdL4PMz7iB09tHs1pti5E= X-Received: by 2002:a63:4c21:: with SMTP id z33-v6mr5195920pga.383.1532681883307; Fri, 27 Jul 2018 01:58:03 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id t21-v6sm6678693pfi.73.2018.07.27.01.58.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:58:02 -0700 (PDT) From: Jia-Ju Bai To: perex@perex.cz, tiwai@suse.com, bhumirks@gmail.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] sound: pci: cthw20k1: Replace mdelay() with msleep() Date: Fri, 27 Jul 2018 16:57:56 +0800 Message-Id: <20180727085756.12440-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 hw_pll_init(), hw_reset_dac() and hw_card_init() are never called in atomic context. They 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 --- sound/pci/ctxfi/cthw20k1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index 8e6eb9d7984b..6a051a1c3724 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c @@ -1319,7 +1319,7 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr) break; hw_write_20kx(hw, PLLCTL, pllctl); - mdelay(40); + msleep(40); } if (i >= 3) { dev_alert(hw->card->dev, "PLL initialization failed!!!\n"); @@ -1407,7 +1407,7 @@ static int hw_reset_dac(struct hw *hw) /* To be effective, need to reset the DAC twice. */ for (i = 0; i < 2; i++) { /* set gpio */ - mdelay(100); + msleep(100); gpioorg = (u16)hw_read_20kx(hw, GPIO); gpioorg &= 0xfffd; hw_write_20kx(hw, GPIO, gpioorg); @@ -2030,7 +2030,7 @@ static int hw_card_init(struct hw *hw, struct card_conf *info) hw_write_20kx(hw, GIE, 0); /* Reset all SRC pending interrupts */ hw_write_20kx(hw, SRCIP, 0); - mdelay(30); + msleep(30); /* Detect the card ID and configure GPIO accordingly. */ switch (hw->model) { -- 2.17.0