Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp331664imm; Thu, 26 Jul 2018 20:23:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdmZVVpumQbL1bN2hn/H8Evnj5C/3XzNOUuJpAoL87ogUEbpjrTldkFPgnop/YURoJEQdEE X-Received: by 2002:a17:902:143:: with SMTP id 61-v6mr4292154plb.171.1532661835096; Thu, 26 Jul 2018 20:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532661835; cv=none; d=google.com; s=arc-20160816; b=J0qGDpvJdb8O/rxoZIdwVIPdlSPDuJ2zoIB936B1QT+uQk1dljoHYN60Q9H22NT7PU kS8avOhO/Mn6Et68TD4X9CUCsao4JatO2njSl5Id8OmNCn4Uh7oxMd4NxD7PEDWYAsTL oo8JE0AIEBIKiByaTuYAmaFdfWwBItZGRZAIVXqwszgUOu0kkOyPDeRU6uZqcrNMwIKm KPl4KJQeQG847UyzMq1rYTrAJNXwdXwDgZgl7hcAcZQIiTddj7lqHvtbZQpe/Re6UmT3 907GUFsJyQwWfbXr1mBA4L5t4LvxxzLAgFJvVojdwnczAw/ezf6HTyzb8lPuK+peZ9F7 qtlQ== 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=aDcdg20wqS6l0/q3CQjePZhEkFF3+kY6U4pe4Gk9R54=; b=uD1nC9hxNNnJiOVYiUydxsNR65IFP1RfwBSnp+Xu7bQE7qUwg2WazQ/iJ5MrqwsbSA iOG2W87SrIsqQHnRAJXAvaJLkfzqFJS1EVL6g7Vq3jj2PsmB2MTh867K86zSKk0G85wQ 5qvkgBjtHUV5HIRxnr6psiCa+dGp297xlXCy5V5W9seZp3i3ECaT1v+ybtS/7WIEncap /wuo4tgDoKP59GjsC3AevFmcfbTjZEDuBZUmEVAiiT9UbFZ28W/2VPrOkjf/hafpL5Xn 3gxwsP6dE0DZtoCttcDgLpmwJynREGmo4q3W0BZQT34/R1Qtgky1xPACzHPy14tt0DYF 6gDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eXAt1Ahv; 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-v6si2614393plg.396.2018.07.26.20.23.40; Thu, 26 Jul 2018 20:23:55 -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=eXAt1Ahv; 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 S1726136AbeG0EmF (ORCPT + 99 others); Fri, 27 Jul 2018 00:42:05 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36288 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbeG0EmF (ORCPT ); Fri, 27 Jul 2018 00:42:05 -0400 Received: by mail-pf1-f195.google.com with SMTP id d14-v6so1247492pfo.3; Thu, 26 Jul 2018 20:22:18 -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=aDcdg20wqS6l0/q3CQjePZhEkFF3+kY6U4pe4Gk9R54=; b=eXAt1AhvKyMeezhPM4xyuU4IReMU66uHnWj5eEcpHKWhNXh5p0mde+5/Ww1t0Tmr3i SNkw1GXGSYdyMPgSa6otzHe9SkT5J/rd8XPjyogz4X+oFAiMmwFuN579HMQ0T4Qf4x8T esQWJ2WQqvG+/xNqHAqda6gPGvxgZTAqb7wrseC9XHEtwT8huR9U97PrsK9SonfjdTAw Yj9paL2k4KYQqyRYCybCXfmqUOrRQ/FA0+U3/zbXbVCnOHqgz2kJBMUnIaAJdGacUVBy kbx3mbfW/quYFMmhJ9207ixT6smnPIwhyqYXsEgPVTWmEcFospjuCZzhCYwE2BzqKDkc etFw== 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=aDcdg20wqS6l0/q3CQjePZhEkFF3+kY6U4pe4Gk9R54=; b=Xwxobb4qbXJc7/P1PCBjTeAIsBKYuINmyPkbRinifcNFZOLwgA5HI16dlm9X4g85y6 e4Xr+YtWM4AUHlhRNkVthN53wV8c23Ma6pfI+HPsAn9HYJEeMWQuhTwfezBb0T4sUemR aCJ3fQKTMQIMhvGLl4lMftMqCzg8mf7L4rypPgmy0ictNGhIOXi26l1yT0eb+OnXh8AF h9McR2RWXEzHPhfkHiY/iQTb2NV9HNR/axJeR705ljuCEEGiEXANzeJ78Ws0JnfuwoEA Rc7GnviNZ1Wj10fMf88hfSlvv2mwExdjW1bTG0h2H0A5B0lAR+FU3S9sJEnp9FeJOqs9 p/GQ== X-Gm-Message-State: AOUpUlHajftmXmSCYkFFHLF9TuGNuLK2ZA0RD8KobqBQSXciwEqm/ZTR Kn29swvK7Sv6uCRAOJcb/CY= X-Received: by 2002:a62:591a:: with SMTP id n26-v6mr4831928pfb.94.1532661738417; Thu, 26 Jul 2018 20:22:18 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id d11-v6sm3861267pfo.135.2018.07.26.20.22.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 20:22:17 -0700 (PDT) From: Jia-Ju Bai To: mchehab@kernel.org, hans.verkuil@cisco.com, bhumirks@gmail.com, colin.king@canonical.com, viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] media: pci: cx25821: Replace mdelay() with msleep() Date: Fri, 27 Jul 2018 11:22:09 +0800 Message-Id: <20180727032209.3320-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 cx25821_gpio_init(), cx25821_initialize() and cx25821_registers_init() are never called in atomic context. They call 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/cx25821/cx25821-core.c | 4 ++-- drivers/media/pci/cx25821/cx25821-gpio.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c index 040c6c251d3a..2f0171134f7e 100644 --- a/drivers/media/pci/cx25821/cx25821-core.c +++ b/drivers/media/pci/cx25821/cx25821-core.c @@ -428,7 +428,7 @@ static void cx25821_registers_init(struct cx25821_dev *dev) tmp |= FLD_USE_ALT_PLL_REF; cx_write(CLK_RST, tmp & ~(FLD_VID_I_CLK_NOE | FLD_VID_J_CLK_NOE)); - mdelay(100); + msleep(100); } int cx25821_sram_channel_setup(struct cx25821_dev *dev, @@ -803,7 +803,7 @@ static void cx25821_initialize(struct cx25821_dev *dev) cx_write(CLK_DELAY, cx_read(CLK_DELAY) & 0x80000000); cx_write(PAD_CTRL, 0x12); /* for I2C */ cx25821_registers_init(dev); /* init Pecos registers */ - mdelay(100); + msleep(100); for (i = 0; i < VID_CHANNEL_NUM; i++) { cx25821_set_vip_mode(dev, dev->channels[i].sram_channels); diff --git a/drivers/media/pci/cx25821/cx25821-gpio.c b/drivers/media/pci/cx25821/cx25821-gpio.c index 76b8f619e55a..f5ffaf880e5f 100644 --- a/drivers/media/pci/cx25821/cx25821-gpio.c +++ b/drivers/media/pci/cx25821/cx25821-gpio.c @@ -88,7 +88,7 @@ void cx25821_gpio_init(struct cx25821_dev *dev) default: /* set GPIO 5 to select the path for Medusa/Athena */ cx25821_set_gpiopin_logicvalue(dev, 5, 1); - mdelay(20); + msleep(20); break; } -- 2.17.0