Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1099041imm; Wed, 4 Jul 2018 11:31:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfO/FeBHhoa3ChDIwJo3kmE5R4w5/aw1q+C6XtiOVwdLimD7IMU1WkkEK5jpdVQb0heTuqy X-Received: by 2002:a65:40ca:: with SMTP id u10-v6mr2804071pgp.2.1530729117348; Wed, 04 Jul 2018 11:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530729117; cv=none; d=google.com; s=arc-20160816; b=sBVRoadvM8P8lLAZv3MzrXHPMVusfrH5zEK1/9oOrNpzsVSuXAfk4MUuRd2te/Vk5P 6kuP4TXU9V1SZ8j5uuh+PW0PyZPPWW25Zt4dk4EMWuWZ12wSlLF5kZTWm52MKoBkdg4O IFTOBi07FvjlfftaVesRfCUaOR2tLw3eoVFkgQora2SjXm3eNf510uWWHQJT7PguWEJI m85+wjnKTTd/sbbQ7BSJTeWAyVEBd8XRAOkqmDgZY2cJJBcKmXFhaA9WFaV5x2mTztBV UC4LcP7Y8P75tVdMo8M6bNvA6Uy7bxyDZf0jt/R6Dj2y9ljYOWuYYpFWO9dAQWs720uq wueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=eqeyE/Pdgm7qLB5TlLCMS/AZuFEQtPXqFxU9Dq0WpmM=; b=Q/iJfTK3JHgIEo6UCD5UB9kQuDEnVTm461STRQSXsKDiYqZ0WzCi59WPIOZ6ValDWB M8zTYzayjVIGMa+SyLyDxIuEnIj1C2jDKvonm8UfquLgsPis1Kivglt1Irnuc9QnU+X9 LR/v3OtI6EdKKpqUE2pNbd37zCpdHskUNWqNLN0TJfLp0bjXskN1TpZS7ykp6BHn1a55 Vpx1qfWcaja0VqZ+c+Ucx5f6gSckk63OFmfGZ97QlMqXCT/3ob0r76HxwtgtEe5HBLwz E00kjREsmS/rUR1Hqxp6Ek8a/6TS3A1JIbLio8b1hDd23Ox4PMmX//leBhtFlUmt1wFf Oxlg== ARC-Authentication-Results: i=1; mx.google.com; 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 w26-v6si3872247pgk.372.2018.07.04.11.31.41; Wed, 04 Jul 2018 11:31:57 -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; 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 S1752839AbeGDSbA (ORCPT + 99 others); Wed, 4 Jul 2018 14:31:00 -0400 Received: from smtprelay0114.hostedemail.com ([216.40.44.114]:33077 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752401AbeGDSa7 (ORCPT ); Wed, 4 Jul 2018 14:30:59 -0400 Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave06.hostedemail.com (Postfix) with ESMTP id D3C8B8009669 for ; Wed, 4 Jul 2018 18:30:58 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 004C2837F24A; Wed, 4 Jul 2018 18:30:57 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 20,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:7903:10004:10400:10848:11026:11232:11658:11914:12048:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21060:21080:21433:21451:21627:30012:30054:30070:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:codeaurora.org-dnsbl7.mailshell.net-127.0.0.120,Custom_rules:0:0:0,LFtime:27,LUA_SUMMARY:none X-HE-Tag: snow33_811f550f725b X-Filterd-Recvd-Size: 2457 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Wed, 4 Jul 2018 18:30:55 +0000 (UTC) Message-ID: <173cc189627e0d6618b535fcd1ce6a4c90ce2ad0.camel@perches.com> Subject: Re: [PATCH] checkpatch: Add warnings for use of mdelay() From: Joe Perches To: Prakruthi Deepak Heragu , apw@canonical.com, Julia Lawall , Dan Carpenter Cc: linux-kernel@vger.kernel.org, ckadabi@codeaurora.org, tsoni@codeaurora.org, bryanh@codeaurora.org, Israel Schlesinger , Stepan Moskovchenko Date: Wed, 04 Jul 2018 11:30:53 -0700 In-Reply-To: <1530728333-31590-1-git-send-email-pheragu@codeaurora.org> References: <1530728333-31590-1-git-send-email-pheragu@codeaurora.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-07-04 at 11:18 -0700, Prakruthi Deepak Heragu wrote: > 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 Really? 3 sign-offs for one trivial patch while getting simple whitespace issues wrong? > diff --git 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 ); No space after $herecurr > + } > + NACK - I think this is unreasonable. checkpatch is stupid and can only remain that way. It cannot check for any particular use in atomic that is appropriate and should not warn with a false positive when the use is appropriate. $ git grep -w mdelay | wc -l 2700 How many of those are correct? If you want a check like this to be useful, write something for coccinelle or smatch.