Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp323492imm; Thu, 26 Jul 2018 20:11:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdz/UzTxVgmplwBBeQnJ07Ink/QEujgpz2kz4pCrCBjM36ehny/tbGxYcHEGq82Sujd8q/B X-Received: by 2002:a63:e516:: with SMTP id r22-v6mr4276047pgh.170.1532661090542; Thu, 26 Jul 2018 20:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532661090; cv=none; d=google.com; s=arc-20160816; b=wh33HjfrGwdMKnBTEajon3z+pU2047KSkzZXesfwGZEiFqBjlkWHNi3ETtfNgRNkVC 5Xe8LRJePU8BFp9XrTCrJtUr6mhrUZ3Tmv+sLnlNOBUUFyGTQYv8Jpd206znNFsa61/X yyuG1HP3LWUHwUmFBhACk+fm/ziBF2T8uFcAdRz+/j4omuIRgNYdMOxc+lzj8uElzTyy 2jzDSl+AW1eInfiuj1gIt1voJ0wfpsNsT9CYphKPpY6ujthAmmMMEIUsDh5fRWlGboUZ +43EgGXrV/x4hLU4bcKQfSSXxdShr1v7BMNFcJhrIwAg6mOw9undKOw5cljmGaRTsTdr JOcg== 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=41J/SOVhxZEjw918E/K6mTpeFIBmuc1SeLyB24bZaiQ=; b=DstD5rI2h8TRpaPfpoEi+O6PEHhDKV8/u4TbIlIkD7gSasZHnK1j2x6Oqaxp7WT2CY 8Op295GIcxtzNbL9LE11CenLBBZVZfESrbn1ItNjJyngi3Yv5Dl4a1+McvFtGR2S1YZm dX/oB2cw3/Lt2v0uaDLySJ1reSN/saDNtFFnroHCWsgpiHZ9UiKnzq2r3bIDGY/hXVvX r/g0PPl9k+wy+TFOYc9Wz8Vq28WZm2BNThKnTAqXNZAk6QIvjgIXwI2Hr1IZZzA/yjiQ ubudL0RWEVTpKWaQC4T+75j/UbBSkdiQPQpX2e5JPy5eoEKVWgeElu2/rYAFvZmLQfv7 8Fww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cdofheyr; 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 y65-v6si2917537pgb.199.2018.07.26.20.11.15; Thu, 26 Jul 2018 20:11:30 -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=cdofheyr; 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 S1729533AbeG0E3g (ORCPT + 99 others); Fri, 27 Jul 2018 00:29:36 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:43958 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbeG0E3g (ORCPT ); Fri, 27 Jul 2018 00:29:36 -0400 Received: by mail-pl0-f65.google.com with SMTP id x6-v6so1678993plv.10; Thu, 26 Jul 2018 20:09:53 -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=41J/SOVhxZEjw918E/K6mTpeFIBmuc1SeLyB24bZaiQ=; b=cdofheyrk2ZgTS7VyVFCKJVq55hIgwCqzRQu50aEntmfbDKWAo3+kNj86i+ZCmMhUt Zw9niCl6QDnRfGzL/2plKUQgqp03h+0l8V5S8oV/Rx9GJk29+zH2kKb4D9VIpYl+ob/O QxCyNy4DQxaK3GUm04GYGYfz2NjkbvIbS20lyVoHQFeFg+w6Dkq+2nOE9ysqMWmOBi7z KPhFRgGlvJz65oZGFolB7BX1JH+gdmcHXT3CXLeztrE2xlwKCB6BoHAmryPZDLGIl5Cq tun2CxbiP749oz/qJP2X9M8BocIYW304lYVOBTVHX+29uNKBBTSquZrFJUPo7mQCxRpC TbtA== 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=41J/SOVhxZEjw918E/K6mTpeFIBmuc1SeLyB24bZaiQ=; b=KLJ5SrXDuw+HgJqgKK2uBpjW47OL6M6VIv0WIQNPwekxtCaKsxWJLbWlbGDGpkCU+c M49iWhK5ZxvzV0eJaEvMJNQeewfqu2+X0Z4txeXcc1FRJ94ZGpE93yhPEis3rkoI+Fxg cstNq5n0CdRJ7cithkEv/VDHbdkO8MtncOsnp0qKSdyyIb677Za8iXx7yl1ATI7leTpO o3YzWm9SfwlKVVywWqkzZU1YFZKAwNWmiMV/UcPSKBqWL9fJNrO01oXpBNouJSz1SHeZ ELuAYM5/9T8c+hcz/nFeTMzALpTWOAalt8iT8GaM854iUZTGDjknzJvirv6v3xz3MU72 fTxw== X-Gm-Message-State: AOUpUlEcyt1J3YLaulND9JnnPStPpvg7/NvIMEbzQhd41axg5xIAg7m2 gPAkT02yNPwxazt9PfOAc8/bjvyJ X-Received: by 2002:a17:902:8a4:: with SMTP id 33-v6mr4243776pll.343.1532660993118; Thu, 26 Jul 2018 20:09:53 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id c12-v6sm6991302pfl.20.2018.07.26.20.09.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 20:09:52 -0700 (PDT) From: Jia-Ju Bai To: mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] media: pci: cx23885: Replace mdelay() with msleep() and usleep_range() in altera_ci_slot_reset() Date: Fri, 27 Jul 2018 11:09:46 +0800 Message-Id: <20180727030946.2886-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 altera_ci_slot_reset() 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/media/pci/cx23885/altera-ci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index 70aec9bb7e95..62bc8049b320 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c @@ -346,7 +346,7 @@ static int altera_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot) mutex_unlock(&inter->fpga_mutex); for (;;) { - mdelay(50); + msleep(50); mutex_lock(&inter->fpga_mutex); -- 2.17.0