From patchwork Mon Aug 19 12:29:16 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: 171605 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp2909375ily; Mon, 19 Aug 2019 05:29:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPEIzs+uQ0Gt1F3GJL+0pgy/L1nJ8bOKamAkJvlt+lLlAKU/Qwh6sTlYx1+pQKKX49tMe4 X-Received: by 2002:a65:6114:: with SMTP id z20mr19898220pgu.141.1566217772562; Mon, 19 Aug 2019 05:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566217772; cv=none; d=google.com; s=arc-20160816; b=XxaAS4GZIHKmzmGjdlFdratZbTH+pO/gik4deRDZcwrkMzwUqtBsw2Jak+TXq+cD2S Ku3SH/KHkYWvB/ZrrjZGPpP97y6e/E0aa8CkdtH+kpWcfZMCTW/EIyPJqWFTKEe4/26a X7OSs0WwdJ5+71nqPKmBJdyMZ6YlUhK1D4K81IF94x3Yp5TqILmbfGR7VvsQ6CUj//tR lOODaOjidaR5aHZ75TkJJwOlPJ+aweFjg85G26kY7odWQyUv5fVmt1b0tLl8HUBS/0Yc PXve6ZSmKHBekV9ZJOrRBkBEXGA0g0q0aQei5uDL7FmVvDlPX//IP7Cebd1jLQcoHKAg 5Eiw== 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=/Lkq7PyhFSMlRWs2aZOTcYP+scQchDf6HkZe+skhQ30=; b=lNrMCrvQTGHQpD9hamyaUmtzhdkoeoHvU5L1YmPmOKoq9sNJkeACMJw7/OB9qqYi5i kZ8fSwtMYj9qYmGnKyYlKDRB1RsKA9ms46MO45ChIMoY/hbMpUKdXQoJWnuIqaa95zuH sJJwVuxMkpCXMKoA3sRjxjy02VTlcJj+vyYzt9RaXkWjJjtkTGLF97tZ/mmbFR8X369m 5STTppJEd2r5EzdzLATwZDA8V6A7JiP/XCXeySuDj20br8RWpmMs6EpX4HMlZtcAU6x7 E7G+xjkHDduJXh9OFKAMrL1YRo1F2iOcYlFsdNXjyPyR/THr96kCVuiBZP1o+/GbZ2Mf mHMA== 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 b42si8725376pjc.18.2019.08.19.05.29.32; Mon, 19 Aug 2019 05:29:32 -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 S1727601AbfHSM3b (ORCPT + 28 others); Mon, 19 Aug 2019 08:29:31 -0400 Received: from foss.arm.com ([217.140.110.172]:53568 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727301AbfHSM3a (ORCPT ); Mon, 19 Aug 2019 08:29:30 -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 5567728; Mon, 19 Aug 2019 05:29:30 -0700 (PDT) Received: from e110176-lin.kfn.arm.com (unknown [10.50.4.159]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 20B7B3F246; Mon, 19 Aug 2019 05:29:28 -0700 (PDT) From: Gilad Ben-Yossef To: Andy Whitcroft , Joe Perches Cc: Ofir Drang , John Hubbard , linux-kernel@vger.kernel.org Subject: [PATCH v2] checkpatch: add *_NOTIFIER_HEAD as var definition Date: Mon, 19 Aug 2019 15:29:16 +0300 Message-Id: <20190819122917.11896-1-gilad@benyossef.com> X-Mailer: git-send-email 2.23.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 Cc: John Hubbard --- Changes from v1: - Fixed misposition of braces. - Tested on 1k last commits from Linux tree. scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) -- 2.23.0 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 93a7edfe0f05..8bc0e753a329 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) {