From patchwork Thu Jul 4 10:44:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 168469 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2101451ilk; Thu, 4 Jul 2019 03:45:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7zXTnWMYCpQYS3A2HmApKLoO+VpcPaQsSSROI8ywhXFUQq3v5k7ilnwSAJmeko2Y/fnk5 X-Received: by 2002:a17:902:b43:: with SMTP id 61mr49628907plq.322.1562237108480; Thu, 04 Jul 2019 03:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562237108; cv=none; d=google.com; s=arc-20160816; b=eBqGagT6PkqdKRqCtDu58kdluoKNnNu/0xaWVwTGlpo3ug86KlIemUJgkjLTuLjf/z n4dL5LxYd6utFwSEhanrCMU/vU+e40gaETxAFhldVuewMhyGbVdK4akAHo5m5+v2eTf8 95ujcUVJIuzPnzF+LmRtb3kyRikGj5aOnRL9+L7gyeKxQR8v0ndS9YMO1SV5lOzNIjLO nywqdPNa5wNfxHGr4Q9JtUqkbEIzbkz1n/+2+EMgqo6rOC116bB7JvmxWL+BwkuFif+9 MoeCfjG+bFHVYIdhMj8sHpIC2ieTqdc06m0Mt33khr6j4B1hIYRo68zvSXmxcPJD4cbV 41kA== 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 :message-id:date:subject:cc:to:from; bh=cgBxgX4x37RbUJ08LlqzrUf9SvswI1lR++NG7HX32ks=; b=uiQ8LbaRmGTq1a+mct0tvTyrwaAsAL3ltYBcUQ69ZdPV6fOTEJDDAWnH8OskizF+wb UibeWmRXSretHVfvhRbK4Ll8oWBTK7W9i52N2YhHmZPtjgCNozAsbQCCiBLDLUc0tLRA KjG8aO13Y0lv/VGu3mG8Akja/F47O/Ho9EIKFR2DOifRPBm3PMlLCwrnVSU7bLwzxfUb G7fBmJBher+7/FXA/6IPEsx7jrjbBj7JGcHWS10hBoWA8MKGq5Tk5jNXzLpP3qMCKxDp T4MPnhJYxKf3XbpWxTpLincyiAX9ggUAvoIVTkmYbXmD/oABfxQ9XNnUOVc6mVydkvNl Ta0g== 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 h3si5018512pld.32.2019.07.04.03.45.08; Thu, 04 Jul 2019 03:45:08 -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 S1727607AbfGDKpH (ORCPT + 30 others); Thu, 4 Jul 2019 06:45:07 -0400 Received: from foss.arm.com ([217.140.110.172]:38950 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727385AbfGDKpG (ORCPT ); Thu, 4 Jul 2019 06:45:06 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 40AE52B; Thu, 4 Jul 2019 03:45:06 -0700 (PDT) Received: from e110176-lin.kfn.arm.com (unknown [10.50.4.178]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3595E3F703; Thu, 4 Jul 2019 03:45:05 -0700 (PDT) From: Gilad Ben-Yossef To: Andy Whitcroft , Joe Perches Cc: Ofir Drang , linux-kernel@vger.kernel.org Subject: [PATCH v2] checkpatch: add *_NOTIFIER_HEAD as var definition Date: Thu, 4 Jul 2019 13:44:57 +0300 Message-Id: <20190704104457.30045-1-gilad@benyossef.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add *_NOTIFIER_HEAD as variable definition to avoid code like this: ATOMIC_NOTIFIER_HEAD(foo); EXPORT_SYMBOL_GPL(foo); >From triggering the the following warning: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable Signed-off-by: Gilad Ben-Yossef --- Changes from v1: - Better RegExp as suggested by Joe Perches. scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) -- 2.21.0 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 342c7c781ba5..9cadda7024ae 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3864,6 +3864,7 @@ sub process { ^.DEFINE_$Ident\(\Q$name\E\)| ^.DECLARE_$Ident\(\Q$name\E\)| ^.LIST_HEAD\(\Q$name\E\)| + ^.{$Ident}_NOTIFIER_HEAD\(\Q$name\E\)| ^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(| \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\() )/x) {