All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot for H. Peter Anvin" <hpa@linux.intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	matthltc@us.ibm.com, tglx@linutronix.de, hpa@linux.intel.com
Subject: [tip:x86/syscall] x86: Simplify syscallhdr.sh
Date: Fri, 18 Nov 2011 16:34:41 -0800	[thread overview]
Message-ID: <tip-f14525f9e033f344996905744f41680ea2b877ce@git.kernel.org> (raw)
In-Reply-To: <20111118221558.GA6408@count0.beaverton.ibm.com>

Commit-ID:  f14525f9e033f344996905744f41680ea2b877ce
Gitweb:     http://git.kernel.org/tip/f14525f9e033f344996905744f41680ea2b877ce
Author:     H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri, 18 Nov 2011 16:03:27 -0800
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Fri, 18 Nov 2011 16:03:27 -0800

x86: Simplify syscallhdr.sh

Simplify syscallhdr.sh by letting grep sort out the ABIs that we want,
rather than relying on manual list matching.  This is safe since the
ABI strings already have to consist only of characters which are valid in C
macro names.

Suggested-by: Matt Helsley <matthltc@us.ibm.com>
Link: http://lkml.kernel.org/r/20111118221558.GA6408@count0.beaverton.ibm.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/syscalls/syscallhdr.sh |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/arch/x86/syscalls/syscallhdr.sh b/arch/x86/syscalls/syscallhdr.sh
index 0d473ff..b3c5930 100644
--- a/arch/x86/syscalls/syscallhdr.sh
+++ b/arch/x86/syscalls/syscallhdr.sh
@@ -2,33 +2,20 @@
 
 in="$1"
 out="$2"
-my_abis=`echo "$3" | tr ',' ' '`
+my_abis=`echo "($3)" | tr ',' '|'`
 prefix="$4"
 offset="$5"
 
 fileguard=_ASM_X86_`basename "$out" | sed \
     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
     -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'`
-
-in_list () {
-    local x
-    for x in $1; do
-	if [ x"$x" = x"$2" ]; then
-	    return 0
-	fi
-    done
-    return 1
-}
-
-grep '^[0-9]' "$in" | sort -n | (
+grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
     echo "#ifndef ${fileguard}"
     echo "#define ${fileguard} 1"
     echo ""
 
     while read nr abi name entry ; do
-	if in_list "$my_abis" "$abi"; then
-	    echo "#define __NR_${prefix}${name}" $((nr+offset))
-        fi
+	echo "#define __NR_${prefix}${name}" $((nr+offset))
     done
 
     echo ""

  parent reply	other threads:[~2011-11-19  0:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-17 22:37 [PATCH 0/8] RFC x86: Generate system calls from a simple table H. Peter Anvin
2011-11-17 22:37 ` [PATCH 1/8] kbuild: Add support for installing generated asm headers H. Peter Anvin
2011-11-21 17:27   ` Michal Marek
2011-11-17 22:37 ` [PATCH 2/8] kbuild: Add support for an "archheaders" target H. Peter Anvin
2011-11-21 17:25   ` Michal Marek
2011-11-21 17:33     ` H. Peter Anvin
2011-11-21 20:03       ` Michal Marek
2011-11-22 22:57     ` [tip:x86/syscall] kbuild, headers.sh: Don't make archheaders explicitly tip-bot for H. Peter Anvin
2011-11-17 22:37 ` [PATCH 3/8] x86-64, syscall: Adjust comment spacing and remove typo H. Peter Anvin
2011-11-19  0:35   ` [tip:x86/syscall] x86, syscall: Re-fix typo in comment tip-bot for H. Peter Anvin
2011-11-17 22:37 ` [PATCH 4/8] x86-64, ia32: Move compat_ni_syscall into C and its own file H. Peter Anvin
2011-11-17 22:37 ` [PATCH 5/8] trace: Include <asm/asm-offsets.h> in trace_syscalls.c H. Peter Anvin
2011-11-17 22:42   ` Steven Rostedt
2011-11-17 22:44     ` H. Peter Anvin
2011-11-17 22:51     ` H. Peter Anvin
2011-11-17 22:37 ` [PATCH 6/8] x86: Machine-readable syscall tables and scripts to process them H. Peter Anvin
2011-11-18 22:15   ` Matt Helsley
2011-11-18 23:13     ` H. Peter Anvin
2011-11-19  0:34     ` tip-bot for H. Peter Anvin [this message]
2011-11-19  1:07   ` [tip:x86/syscall] x86, syscall: Allow syscall offset to be symbolic tip-bot for H. Peter Anvin
2011-11-17 22:37 ` [PATCH 7/8] checksyscalls: Use arch/x86/syscalls/syscall_32.tbl as source H. Peter Anvin
2011-11-21 17:28   ` Michal Marek
2011-11-17 22:37 ` [PATCH 8/8] x86: Generate system call tables and unistd_*.h from tables H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-f14525f9e033f344996905744f41680ea2b877ce@git.kernel.org \
    --to=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=matthltc@us.ibm.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.