From patchwork Thu Aug 25 09:53:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9299097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 60211607F0 for ; Thu, 25 Aug 2016 09:53:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50FB829060 for ; Thu, 25 Aug 2016 09:53:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45C7529104; Thu, 25 Aug 2016 09:53:29 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 E1C9B29060 for ; Thu, 25 Aug 2016 09:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933444AbcHYJx2 (ORCPT ); Thu, 25 Aug 2016 05:53:28 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36028 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932568AbcHYJx1 (ORCPT ); Thu, 25 Aug 2016 05:53:27 -0400 Received: by mail-pa0-f67.google.com with SMTP id ez1so2834969pab.3 for ; Thu, 25 Aug 2016 02:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=8+hG0P2g7gzV6IHACKXZGjCkd//mOmUfyH8OIt7WVZw=; b=U2NGxcg7QgWTq4+I5bP5cHD/G9nc9shBfStQm6ud5Y9PoxAISqHoT9KyQ13PLlObyv ay+9WtHQpjqxFOPhub1cMbZ2bcj1PISTr6UWwiolCyBebqtv7ha7J1BtfuVtwjeIAUfk eJHlptLqCFbcnenJOrVFbQm8cdD5qguwaDypzLtTf2cYCT1iyUqDze8v2kXKXk+RtaFC mCamtf7Yg2qzNwKLFDYYeOUhvxlaz7/I4nfrwBZPoT7xOsJV2v8JkchGAIS5AqEzf63X LY8RoOFPFk6N3eXQhTF274OwrzGfw2noOGYSWdviJXL1XCclZWyUQ6cVTwQFr4ZDjtiQ QdkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8+hG0P2g7gzV6IHACKXZGjCkd//mOmUfyH8OIt7WVZw=; b=lLXG2rMQcCHMQXyxZ3112nwwRL/lTps661HyVlz4+o7TlivuzHEKU2FBzVF/RYzmt6 6yrwO8mAHf5tcxRQIm+s2MTbNolN2KGX43BN2Bkt+9dWtMqBAULfEXWysV9yCUNtELdV Lx1vOSDa79LKxf7kfeUlPsZ22Es881T3T9xqcd6iYTQBpRz78qlvkFw2FNk+OEyx2i3u ENwo1f8MjkBiXE52+xXqDVzznuoMkiq38uB6xwtvfvahkibv0ivVAk5pgULjt0l2xgYx 0oFov9mi7uAHyW1zbncnBlkEnKSf+D24owmIFCu8au33HFFWyQmUCHt6ySKEJmp80Eml BJrg== X-Gm-Message-State: AE9vXwPzFdaJhslmYmbYLZ1U4lUAYTl9WRTLtOi+GhsPFEiIAi7vK2uZ/UGfobX+87D9tA== X-Received: by 10.66.54.132 with SMTP id j4mr14354030pap.110.1472118806809; Thu, 25 Aug 2016 02:53:26 -0700 (PDT) Received: from roar.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id p75sm19565271pfa.71.2016.08.25.02.53.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Aug 2016 02:53:26 -0700 (PDT) From: Nicholas Piggin To: linux-kbuild@vger.kernel.org, Michal Marek Cc: Nicholas Piggin , Jan Beulich Subject: [PATCH] kbuild: genksyms fix for typeof handling Date: Thu, 25 Aug 2016 19:53:08 +1000 Message-Id: <20160825095308.23937-1-npiggin@gmail.com> X-Mailer: git-send-email 2.9.3 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The tokenizer misses counting an open-parenthesis when parsing a non-trivial typeof beginning with an open-parenthesis. This function in include/linux/ceph/libceph.h static type *lookup_##name(struct rb_root *root, typeof(((type *)0)->keyfld) key) When instantiated in net/ceph/mon_client.c, causes subsequent symbols including an EXPORT_SYMBOL in that file to be lost. Signed-off-by: Nicholas Piggin --- scripts/genksyms/lex.l | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l index e583565..5235aa5 100644 --- a/scripts/genksyms/lex.l +++ b/scripts/genksyms/lex.l @@ -289,6 +289,23 @@ repeat: } break; + case ST_TYPEOF_1: + if (token == IDENT) + { + if (is_reserved_word(yytext, yyleng) + || find_symbol(yytext, SYM_TYPEDEF, 1)) + { + yyless(0); + unput('('); + lexstate = ST_NORMAL; + token = TYPEOF_KEYW; + break; + } + _APP("(", 1); + } + lexstate = ST_TYPEOF; + /* FALLTHRU */ + case ST_TYPEOF: switch (token) { @@ -313,24 +330,6 @@ repeat: } break; - case ST_TYPEOF_1: - if (token == IDENT) - { - if (is_reserved_word(yytext, yyleng) - || find_symbol(yytext, SYM_TYPEDEF, 1)) - { - yyless(0); - unput('('); - lexstate = ST_NORMAL; - token = TYPEOF_KEYW; - break; - } - _APP("(", 1); - } - APP; - lexstate = ST_TYPEOF; - goto repeat; - case ST_BRACKET: APP; switch (token)