From patchwork Thu May 5 02:03:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 755692 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4523emD027606 for ; Thu, 5 May 2011 02:03:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752478Ab1EECDk (ORCPT ); Wed, 4 May 2011 22:03:40 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:44950 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752605Ab1EECDi (ORCPT ); Wed, 4 May 2011 22:03:38 -0400 Received: by iyb14 with SMTP id 14so1449065iyb.19 for ; Wed, 04 May 2011 19:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=h9Mxgz+O2/Yk5UxySPLtrO5ocALy4ZX8qZ3YoEV7CZE=; b=dyuSgCiZe1dE9q+M/mESH3Cfk0GjchxAUYVPBXNOjk3+GvyhGgLvOmxfEBQhhOkpL9 O+rIqOmcq8WMdBA4g4VKNQU60tXsQn1skLSFzdQjJWD60TSJN7zBWLltgYQVKJShQuWG t5bY3Oo/XHpujRI64RGIcNGEfExxy6Knx8U2c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=oDQyDfNKhNv3HMPXZTACU2c6KfEEr5NZi7YKJ4qniQs4w7TfR16JhITRUUqedhixCu VAMa/nbF6bEI2c6Ugt1zyyptfyxAlhfvbtUArqYp/3mTMkqibX5W3x2gZ/yXoKNQU4L8 kWWOtfJTtWX6OmllrtdktPheFQPtUz69wOMrU= Received: by 10.231.193.68 with SMTP id dt4mr777058ibb.123.1304561017977; Wed, 04 May 2011 19:03:37 -0700 (PDT) Received: from localhost.localdomain (76-10-146-236.dsl.teksavvy.com [76.10.146.236]) by mx.google.com with ESMTPS id gy41sm688054ibb.56.2011.05.04.19.03.37 (version=SSLv3 cipher=OTHER); Wed, 04 May 2011 19:03:37 -0700 (PDT) From: Arnaud Lacombe To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Arnaud Lacombe Subject: [RFC 3/9] genksyms: pass hash and lookup functions name and target language though the input file Date: Wed, 4 May 2011 22:03:18 -0400 Message-Id: <1304561004-2684-4-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.3.4.574.g608b.dirty In-Reply-To: <1304561004-2684-1-git-send-email-lacombar@gmail.com> References: <1304561004-2684-1-git-send-email-lacombar@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 05 May 2011 02:03:41 +0000 (UTC) Renaming hash and lookup functions on the command line would reduces its genericity. Use the .gperf file to pass this information. Do the same for the target language. --- scripts/genksyms/Makefile | 2 +- scripts/genksyms/genksyms.gperf | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile index 82bb25f..de6675d 100644 --- a/scripts/genksyms/Makefile +++ b/scripts/genksyms/Makefile @@ -29,7 +29,7 @@ lex.%.c: %.l cp $@ $@_shipped %.hash.c: %.gperf - gperf -t --output-file $@ -L ANSI-C -a -C -E -g -H is_reserved_hash -k 1,3,$$ -N is_reserved_word -p -t $< + gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $< cp $@ $@_shipped endif diff --git a/scripts/genksyms/genksyms.gperf b/scripts/genksyms/genksyms.gperf index e6349ac..3e77a94 100644 --- a/scripts/genksyms/genksyms.gperf +++ b/scripts/genksyms/genksyms.gperf @@ -1,3 +1,6 @@ +%language=ANSI-C +%define hash-function-name is_reserved_hash +%define lookup-function-name is_reserved_word %{ struct resword; static const struct resword *is_reserved_word(register const char *str, register unsigned int len);