From patchwork Fri Jul 27 03:09:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 10546595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F3D3112E for ; Fri, 27 Jul 2018 03:09:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21DD82B4B5 for ; Fri, 27 Jul 2018 03:09:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 157EB2B809; Fri, 27 Jul 2018 03:09:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C47BA2B85D for ; Fri, 27 Jul 2018 03:09:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726004AbeG0E3g (ORCPT ); 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-Google-Smtp-Source: AAOMgpcfMfGYzFACllbSqT6VT5lFQzm8egzAf4cJbTZ2HBhTsCmGlEjCJiCCbFH9zkUi7qMR2DmnoA== 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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);