Received: by 10.223.164.202 with SMTP id h10csp395283wrb; Mon, 6 Nov 2017 08:23:10 -0800 (PST) X-Google-Smtp-Source: ABhQp+ScC6LQpFakVRzG9gccuyJj+QbHr+QtEjRC1DZCDbBuxbHbonJuzJduhurB5PIQDP9bcF0n X-Received: by 10.159.218.148 with SMTP id w20mr15693782plp.398.1509985390719; Mon, 06 Nov 2017 08:23:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509985390; cv=none; d=google.com; s=arc-20160816; b=GcViuk7zg0QL+mECWsU/lo9koruI0m9sOvHZLAi1SduwWDv+IfR9E1ScdPPqcIikGp Rm1vytCZMngO00vzrDjsRGuUc1xI80KgXbBaiGE9v+jpdOUvIpitIR6hetV50cOUe7JJ zJK3hui87mWmAxtQcVPQE/zaL1+b/z5pjPj3+K0SWS8tOXPDKP/9Aaakw/Ze+kE4aGwr RBUD/XRI/UB9z/iRhuiOGrvHobSCSIItyY3uHYmIuee8aLhOZXH2pqLZfHylUF2acLjR WhZkHT8st3YICicerQXL5o/4CRqPWe3J9QFs5z5ajtmzGmdq0r1vRGQ61ia8fOI5wkqa 21Vw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=dUriFVmAe3HfwkTn6kNPmFA8dhDmSNF0UU59gZCqMSQ=; b=DPsINDvg8QNm/VzTqdGU1HdhKbuC1YhIGWtPf9fO+jAuDpFqO02ey+cY6BjHuYtt0R TeXCgSYMPI0sazUIiorcZAlKgkGXSzKIcYikySJIcecXfB5+V8feAGEjgGD1QwCPys7L wcCKEQE7VqTBUzGg3Wi5VP6PRsmrcezNhKJJpeVjwH1/Nh4vHT6+hkR7x9QFb0AD6Nzy V2NnZBu/gOZ+sQvrqRDk6Yaf8gs7ULHjBrCal6xgtjAmt7t8AJ3Bn49wEhe2rL+eU9YZ FbLofcsG6FoufROtvc+G/RPNl8pB8ZJEZHHeNTXIAZFvjfWPR7aLh3ITqiqtWvzINPp7 zzKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alibaba-inc.com header.s=default header.b=M4nulr1n; 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=NONE dis=NONE) header.from=alibaba-inc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si11311613pgc.392.2017.11.06.08.22.57; Mon, 06 Nov 2017 08:23:10 -0800 (PST) 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=@alibaba-inc.com header.s=default header.b=M4nulr1n; 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=NONE dis=NONE) header.from=alibaba-inc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754094AbdKFQIo (ORCPT + 97 others); Mon, 6 Nov 2017 11:08:44 -0500 Received: from out0-241.mail.aliyun.com ([140.205.0.241]:52478 "EHLO out0-241.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754082AbdKFQIk (ORCPT ); Mon, 6 Nov 2017 11:08:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alibaba-inc.com; s=default; t=1509984511; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type; bh=dUriFVmAe3HfwkTn6kNPmFA8dhDmSNF0UU59gZCqMSQ=; b=M4nulr1neIP3WiNcoJMLMKre9tub0mc7qKrRSRfo3HNdjEVdnkse5zavYhLSMev6hYyy1Q1rv0LQoW/TgX/lLJDqIQa11SlguuDxaA/hMX8gTOeYi4+kafB5m9FSl6Z4A3kKUUHwAIlh+pR6gmfQCdq6MNPHwmicxTJaDrdSzz4= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03291;MF=yang.s@alibaba-inc.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---.9L8Kleo_1509984506; Received: from US-143344MP.local(mailfrom:yang.s@alibaba-inc.com ip:121.0.29.200) by smtp.aliyun-inc.com(127.0.0.1); Tue, 07 Nov 2017 00:08:27 +0800 Subject: Re: [RFC PATCH] scripts: checkpatch.pl: remove obsolete in_atomic rule To: Michal Hocko Cc: apw@canonical.com, joe@perches.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org References: <1509736086-408-1-git-send-email-yang.s@alibaba-inc.com> <20171106135248.p556wpkukoqzaegy@dhcp22.suse.cz> From: "Yang Shi" Message-ID: <4c2a4bfa-0e85-6385-58fd-af83349201e9@alibaba-inc.com> Date: Tue, 07 Nov 2017 00:08:21 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20171106135248.p556wpkukoqzaegy@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/6/17 5:52 AM, Michal Hocko wrote: > On Sat 04-11-17 03:08:06, Yang Shi wrote: >> checkpatch.pl still reports the below in_atomic warning: >> >> WARNING: use of in_atomic() is incorrect outside core kernel code >> + if (in_atomic()) >> >> But, in_atomic() has been used outside kernel dir for a long time, and >> even drivers. So, remove the obsolete rule even though they can be >> ignored. > > NAK. in_atomic is tricky and shouldn't be used. I would bet most of the > usage is simply broken. See more http://lkml.kernel.org/r/20171106100558.GD3165@worktop.lehotels.local Thanks for following up. Yes, it sounds so. However, there is not a reliable and effective approach to check atomic context for both PREEMPT and !PREEMPT. Yang > >> Signed-off-by: Yang Shi >> CC: Andrew Morton >> --- >> Not sure if removing the obsolete rule is preferred by checkpatch.pl, anyway >> it sounds not make sense to keep invalid rule. >> >> scripts/checkpatch.pl | 11 ----------- >> 1 file changed, 11 deletions(-) >> >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index 8b80bac..e8cf94f 100755 >> --- a/scripts/checkpatch.pl >> +++ b/scripts/checkpatch.pl >> @@ -6231,17 +6231,6 @@ sub process { >> "Using $1 should generally have parentheses around the comparison\n" . $herecurr); >> } >> >> -# whine mightly about in_atomic >> - if ($line =~ /\bin_atomic\s*\(/) { >> - if ($realfile =~ m@^drivers/@) { >> - ERROR("IN_ATOMIC", >> - "do not use in_atomic in drivers\n" . $herecurr); >> - } elsif ($realfile !~ m@^kernel/@) { >> - WARN("IN_ATOMIC", >> - "use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); >> - } >> - } >> - >> # whine about ACCESS_ONCE >> if ($^V && $^V ge 5.10.0 && >> $line =~ /\bACCESS_ONCE\s*$balanced_parens\s*(=(?!=))?\s*($FuncArg)?/) { >> -- >> 1.8.3.1 > From 1583325069998343906@xxx Mon Nov 06 13:54:13 +0000 2017 X-GM-THRID: 1583073096436484454 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread