Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1091116imm; Wed, 4 Jul 2018 11:22:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdcBasy6VabOtRVYmKZwqp72zliD2P2kw1hy4Gf5h6hDVlXfwCNACIZhE4KpyTpMm6QdQq4 X-Received: by 2002:a62:4add:: with SMTP id c90-v6mr1356893pfj.23.1530728521458; Wed, 04 Jul 2018 11:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530728521; cv=none; d=google.com; s=arc-20160816; b=Wh9ZIwIFBB14VhNFxYDEiXEC8Rp9yBHm+biKqWrlJWMLdRm54X/PwwMVqjtnjQwByD dyYfqVz54AMItF8wxL96wB34EnyTJarIEhzwZI0CzMT16Hqtt5RAEAbV+X5dHnQ4e2a0 2ZwICuDgITJhq9pdJpWnv9sj+5ciFto2O1XskTj97XsNHOA5yVqFnmdfkaFitBrkMW9t 4PLsF62k4kTM/b3Y57REa8v3hdsiZqZUR+RBtGQ49Re//8lh4Ty6jmOzH6hwYsd7/UiO WtJt8UieFDPLdn4RPoJJ57fHcEYfdhn/LEp2Uyo7YglNj8LOYeO6jLwqu3a+BJnobZxV tLuw== 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 :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=Xt8CEei5XB2ZL7i4bsXPfUf9Gp0c8sd0HcRk78N7VQQ=; b=Km1GjxxJaCs/eb7xrncA9j68WaF1RlG94wlE2OpI/nzZGN/6ql5Eiar/66VINn9ruT z2f9HMBnzhXW/ztujSneNjmZydGnqMstRS9T6fzsLgyvV4BdppwX5xJOHiDYO1ylLL2w uOMR/37JGZyKttkbbxda1dKbMFqcJfpOy7ofy0nxM0sf1LGCQPRqMYGxuJunV2Rwged3 AXtRmmrDtxxkjpHvd0oz6u/oaaI32YMZwbY3zcFlIjVsW/qJx/5PabqiAuIoiHDIKhaw TdDnv8zmWdlSYJhXFMcPD23Ti+Pi2b5RcTEsGTotDSMO5WcpilBl1k+wVgFxqosgyx6O +33w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=msVGwaxd; dkim=pass header.i=@codeaurora.org header.s=default header.b=msVGwaxd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si4009567plr.131.2018.07.04.11.21.47; Wed, 04 Jul 2018 11:22:01 -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=@codeaurora.org header.s=default header.b=msVGwaxd; dkim=pass header.i=@codeaurora.org header.s=default header.b=msVGwaxd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752881AbeGDSUD (ORCPT + 99 others); Wed, 4 Jul 2018 14:20:03 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:45596 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260AbeGDSUC (ORCPT ); Wed, 4 Jul 2018 14:20:02 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C561F60B24; Wed, 4 Jul 2018 18:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530728401; bh=KOes/5/GG5l6FtmtxD2S5wtOrfKOXe1tcavXmk25+kE=; h=From:To:Cc:Subject:Date:From; b=msVGwaxdqRKXsXApaeawtNR3eEQe3kRuPVtbEeeSi5v0D7+kbtrSt+6IAIdppXl+/ kkgQ0oY8Kyu8yihRV0ENJd8Y0h2u2E/0Yx2RS6sqLn9wJE/n7A1JXqrBjxVmBJNVZU jbRtyu7490fMp97bxmYJTEN+97xEUVuLGwevFZB8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from pheragu-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pheragu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0A90260B19; Wed, 4 Jul 2018 18:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530728401; bh=KOes/5/GG5l6FtmtxD2S5wtOrfKOXe1tcavXmk25+kE=; h=From:To:Cc:Subject:Date:From; b=msVGwaxdqRKXsXApaeawtNR3eEQe3kRuPVtbEeeSi5v0D7+kbtrSt+6IAIdppXl+/ kkgQ0oY8Kyu8yihRV0ENJd8Y0h2u2E/0Yx2RS6sqLn9wJE/n7A1JXqrBjxVmBJNVZU jbRtyu7490fMp97bxmYJTEN+97xEUVuLGwevFZB8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0A90260B19 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pheragu@codeaurora.org From: Prakruthi Deepak Heragu To: apw@canonical.com, joe@perches.com Cc: linux-kernel@vger.kernel.org, ckadabi@codeaurora.org, tsoni@codeaurora.org, bryanh@codeaurora.org, Israel Schlesinger , Stepan Moskovchenko , Prakruthi Deepak Heragu Subject: [PATCH] checkpatch: Add warnings for use of mdelay() Date: Wed, 4 Jul 2018 11:18:53 -0700 Message-Id: <1530728333-31590-1-git-send-email-pheragu@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mdelay() is not a preferred API to be used to insert delay in the kernel code unless the context is atomic. Instead, msleep() API can be used. This patch introduces this warning. Signed-off-by: Israel Schlesinger Signed-off-by: Stepan Moskovchenko Signed-off-by: Prakruthi Deepak Heragu --- scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a9c0550..14bba3f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5572,6 +5572,12 @@ sub process { "Comparing get_jiffies_64() is almost always wrong; prefer time_after64, time_before64 and friends\n" . $herecurr); } +# check the patch for use of mdelay + if ($line =~ /\bmdelay\s*\(/) { + WARN("MDELAY", + "use of mdelay() found: msleep() is the preferred API.\n" . $herecurr ); + } + # warn about #ifdefs in C files # if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { # print "#ifdef in C files should be avoided\n"; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project