From patchwork Tue Oct 16 23:51:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brendan Higgins X-Patchwork-Id: 10644409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E38C213AD for ; Tue, 16 Oct 2018 23:56:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5DBF29124 for ; Tue, 16 Oct 2018 23:56:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9FD72A27D; Tue, 16 Oct 2018 23:56:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FC2129124 for ; Tue, 16 Oct 2018 23:56:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727681AbeJQHrH (ORCPT ); Wed, 17 Oct 2018 03:47:07 -0400 Received: from mail-io1-f73.google.com ([209.85.166.73]:42029 "EHLO mail-io1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbeJQHrF (ORCPT ); Wed, 17 Oct 2018 03:47:05 -0400 Received: by mail-io1-f73.google.com with SMTP id m7-v6so23428717iop.9 for ; Tue, 16 Oct 2018 16:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=aOdwwUuIBSYrb87g8bgBF5GxaXD8rfXvHJcd9fKQrvE=; b=iP/y8MyFsGmeSdqTp8obc/qxmgmmwf9LAObDYZtUylHVznP5XcuFzkpY8gv4WaAD0e L+btQwyLCtTxGnIse6dnkKY/36GGaBW9paJBnJ8t56dRi0Lza3SCKJ0ggJByY4ncyPJn bYFHjWGLxBoCZRo5cMXb+2ZiYOeivU7vz9Pzjh+I6QvydFhrsnz+FLlbSbSA20eL6ACz ROH0FnhfrLrPthtqwyxiU9xPDTs5vueFT2vNO6Wqqa/QVfkyI9LYXMrefxr0Xj+g/qkF vIqdH11a+uPoNd3j3DCR5mIPtRBQiSuHdaHYL8naDULXhd1L9Ljrd1ZDV/NstzLC/IXn UdGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=aOdwwUuIBSYrb87g8bgBF5GxaXD8rfXvHJcd9fKQrvE=; b=ICeCZwddyJjFkckK9WiiN2fOG7yHf2ca78XT1v2LD+tizPmahuw26E04nKx7PGq194 Kn8NkbTzqwNHyXGnkRW+Ilp52GZuBmnr9uSdksJrg76Gc6YB1nA2vhcVhwHyo0hRItH7 yfeQn6QW+/pIl0ykUAOIhbUMYIoGI0+xYAzhHk4tf7JPgDHgN0K/sdoeyznXyxVadIiS q3IEYrriUJFvouq2L1oe6WUZAafXPe0Omyl25DywVlEgE7HyGx59/2o7/AW4jESiI7ss WEc6ypjE9c0M+nu9tJs7WhxkkyIjji4eHl/cB1eq3eCk1pptij1Wk0JeXVttMRlTB3w0 3Mbg== X-Gm-Message-State: ABuFfoir5cOtKatkPAvVYQQKP8k75NGoxr/8i9u6duuOq6CS8Rt3zMww D6PQiQnzL+q/Rl0GiQut6iK4OnLKUZG/Ck0CHgB4hA== X-Google-Smtp-Source: ACcGV6200mvffJhOSAeesbf9j6TKPFpbmQQCP6h6Z/FAjTh6tgj7iDw357BsNkJb8O++l+p6080vLDr9Q7wrZbFtKCQf3Q== X-Received: by 2002:a24:7f05:: with SMTP id r5-v6mr17838180itc.2.1539734056061; Tue, 16 Oct 2018 16:54:16 -0700 (PDT) Date: Tue, 16 Oct 2018 16:51:01 -0700 In-Reply-To: <20181016235120.138227-1-brendanhiggins@google.com> Message-Id: <20181016235120.138227-13-brendanhiggins@google.com> Mime-Version: 1.0 References: <20181016235120.138227-1-brendanhiggins@google.com> X-Mailer: git-send-email 2.19.1.331.ge82ca0e54c-goog Subject: [RFC v1 12/31] checkpatch: added support for struct MOCK(foo) syntax From: Brendan Higgins To: gregkh@linuxfoundation.org, keescook@google.com, mcgrof@kernel.org, shuah@kernel.org Cc: joel@jms.id.au, mpe@ellerman.id.au, joe@perches.com, brakmo@fb.com, rostedt@goodmis.org, Tim.Bird@sony.com, khilman@baylibre.com, julia.lawall@lip6.fr, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, jdike@addtoit.com, richard@nod.at, linux-um@lists.infradead.org, Brendan Higgins Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds struct MOCK(foo) as a NonptrType so that it is recognized correctly in declarations. Signed-off-by: Brendan Higgins --- scripts/checkpatch.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 447857ffaf6be..9806f190796de 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -745,6 +745,10 @@ sub build_types { (?: (?:typeof|__typeof__)\s*\([^\)]*\)| (?:$typeTypedefs\b)| + # Matching a \b breaks struct MOCK(foo) syntax, + # so we need to have it not lumped in with the + # types in @typeList. + (?:struct\s+MOCK\($Ident\))| (?:${all}\b) ) (?:\s+$Modifier|\s+const)*