Re: [RFC PATCH v2 2/5] powerpc/syscalls: Remove unused offset parameter

2019-01-17 Thread Firoz Khan
Hi Michael,

On Wed, 16 Jan 2019 at 18:57, Michael Ellerman  wrote:
>
> We never pass a value for offset, nor do we need to, so remove the
> offset logic.

The idea behind all these effort is to come up with a common script for alpha,
ia64, m68k, microblaze, mips, parisc, powerpc, sh, sparc and xtensa. If I'm
right, ia64 and mips pass offset and rest of the architecture doesn't. Inorder
to come up with a offset logic to accommodate those 2 archs requirements.

I think x86, arm and s390 can use the same support with minor changes. So
prefix also need to use it.

I already create a patch series for powerpc with unified script. the changes u
suggested will make difficult to make unified script.

Thanks
Firoz


[RFC PATCH v2 2/5] powerpc/syscalls: Remove unused offset parameter

2019-01-16 Thread Michael Ellerman
We never pass a value for offset, nor do we need to, so remove the
offset logic.

Signed-off-by: Michael Ellerman 
---
 arch/powerpc/kernel/syscalls/Makefile  |  6 ++
 arch/powerpc/kernel/syscalls/syscallhdr.sh | 10 ++
 arch/powerpc/kernel/syscalls/syscalltbl.sh |  8 ++--
 3 files changed, 6 insertions(+), 18 deletions(-)

v2: No change.

diff --git a/arch/powerpc/kernel/syscalls/Makefile 
b/arch/powerpc/kernel/syscalls/Makefile
index 27b48954808d..5e65f68fb7b7 100644
--- a/arch/powerpc/kernel/syscalls/Makefile
+++ b/arch/powerpc/kernel/syscalls/Makefile
@@ -12,14 +12,12 @@ systbl := $(srctree)/$(src)/syscalltbl.sh
 quiet_cmd_syshdr = SYSHDR  $@
   cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@'   \
   '$(syshdr_abis_$(basetarget))'   \
-  '$(syshdr_pfx_$(basetarget))'\
-  '$(syshdr_offset_$(basetarget))'
+  '$(syshdr_pfx_$(basetarget))'
 
 quiet_cmd_systbl = SYSTBL  $@
   cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@'   \
   '$(systbl_abis_$(basetarget))'   \
-  '$(systbl_abi_$(basetarget))'\
-  '$(systbl_offset_$(basetarget))'
+  '$(systbl_abi_$(basetarget))'
 
 syshdr_abis_unistd_32 := common,nospu,32
 $(uapi)/unistd_32.h: $(syscall) $(syshdr)
diff --git a/arch/powerpc/kernel/syscalls/syscallhdr.sh 
b/arch/powerpc/kernel/syscalls/syscallhdr.sh
index c0a9a32937f1..e1e490ea10ab 100644
--- a/arch/powerpc/kernel/syscalls/syscallhdr.sh
+++ b/arch/powerpc/kernel/syscalls/syscallhdr.sh
@@ -5,7 +5,6 @@ in="$1"
 out="$2"
 my_abis=`echo "($3)" | tr ',' '|'`
 prefix="$4"
-offset="$5"
 
 fileguard=_UAPI_ASM_POWERPC_`basename "$out" | sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
@@ -17,13 +16,8 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort 
-n | (
 
nxt=0
while read nr abi name entry compat ; do
-   if [ -z "$offset" ]; then
-   printf "#define __NR_%s%s\t%s\n" \
-   "${prefix}" "${name}" "${nr}"
-   else
-   printf "#define __NR_%s%s\t(%s + %s)\n" \
-   "${prefix}" "${name}" "${offset}" "${nr}"
-   fi
+   printf "#define __NR_%s%s\t%s\n" \
+   "${prefix}" "${name}" "${nr}"
nxt=$((nr+1))
done
 
diff --git a/arch/powerpc/kernel/syscalls/syscalltbl.sh 
b/arch/powerpc/kernel/syscalls/syscalltbl.sh
index fd620490a542..01e57093a51a 100644
--- a/arch/powerpc/kernel/syscalls/syscalltbl.sh
+++ b/arch/powerpc/kernel/syscalls/syscalltbl.sh
@@ -5,7 +5,6 @@ in="$1"
 out="$2"
 my_abis=`echo "($3)" | tr ',' '|'`
 my_abi="$4"
-offset="$5"
 
 emit() {
t_nxt="$1"
@@ -21,15 +20,12 @@ emit() {
 
 grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
nxt=0
-   if [ -z "$offset" ]; then
-   offset=0
-   fi
 
while read nr abi name entry compat ; do
if [ "$my_abi" = "c32" ] && [ ! -z "$compat" ]; then
-   emit $((nxt+offset)) $((nr+offset)) $compat
+   emit $nxt $nr $compat
else
-   emit $((nxt+offset)) $((nr+offset)) $entry
+   emit $nxt $nr $entry
fi
nxt=$((nr+1))
done
-- 
2.20.1