Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp664751imm; Fri, 12 Oct 2018 04:51:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV602quxv5v2C0vj1v1LCTVIXNCnZVtaz9Ua5pxkOca/f+vqOkWxLuxjw2FhWuPcl/a0X78Po X-Received: by 2002:a63:f252:: with SMTP id d18-v6mr5298844pgk.2.1539345117726; Fri, 12 Oct 2018 04:51:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539345117; cv=none; d=google.com; s=arc-20160816; b=01fsQnCWUeWhOyEOqVrMkHVMLsI8oaJBXeiybTYgglpXwS/g2cFB1oe/CTRKn3T9yA WSlv8GmsJroM+1wRjMIG0IY33j911esTJriOL63ncLf/K5OCAZtg9xt+KdpV1TC0yA0H HQjKTEuYKLylpxRWHhUJF6AA0P99ijhgGVf5JxcMyCFUl7/cZwHKW48Ph7O8UaSuRH/R PV75/LyWd9l+HKkp67arWlTmRzia+Hs3KOxg2dVRDZ3QJrD95jX/r0i2OXK5Lnjofrow JLVXwbM+3LIbHIR4BckQCUKpyJof96dsWIAomLWW2E+Sv2LeAcRPQ3p43eeVT6UMASOR xHQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=XtCn8ZP92iUsc6yQWrJSlNbSghzGVmlgpaQ1Sp23KVk=; b=I0u7v2JX/pcdIVSFXGWf+vo9dyvLAcS+VXMCcryrHEsmPk+G8ZqtR7TqryLiUuUkJC LJKhvMXGZgK6BF9u2FeRVmqaLuMXUkczf3merN54sxq5UNEn9gVdMwaDSUnl0rGpAeAe ZGk5zSH18K8/W/2kz/MCwU7xT3V9wuhk8X9FWG/L0tKiAZUzRRkj40wF4Mkit9jWoAxc bdOZSd5p6CoBGjgadBfKnY69Ee6C7OIce9YHUXyL7jwr09t/KOoN2IQ2A9wcMVZ56OcG rXAm7/D+1TKAkTdhBUMuGWiij6Xl6vNJZWUBh+hDXtH4YSzJCPEGIwdo+nl72AMuvp5p d7EQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38-v6si1122144pgb.30.2018.10.12.04.51.42; Fri, 12 Oct 2018 04:51:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728291AbeJLTX1 (ORCPT + 99 others); Fri, 12 Oct 2018 15:23:27 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:45065 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726699AbeJLTX1 (ORCPT ); Fri, 12 Oct 2018 15:23:27 -0400 Received: by mail-qt1-f196.google.com with SMTP id e10-v6so13465709qtq.12; Fri, 12 Oct 2018 04:51:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XtCn8ZP92iUsc6yQWrJSlNbSghzGVmlgpaQ1Sp23KVk=; b=YK+jC4kETMd16c7kD+mQUgbIk359DwSgXy8iEswmnE2EZOR7aUqgQQr8tSp92/HXr/ NKFLzE08jGqG5vmFfiKIbEvhpjjuf3OvZBonRDxV7pC7CfbGAu5N4v2/1NlzPvHlXxLX +Gtv0olt1HXJInuN0AM2+kjoZ3t0lr6BjPQyttOC3YGVUIdyYzNDQhUrAUEXPnohq0xL lSXiRnekRdn9D5UGlSPYLwc0HE9CjTwwmniJHH82k4rLqebK+x6AzyifrRnYLT5wzwP4 EaL7N0VIXIiQf7HuJxfl7IxiCtG2sKAPUk1Ye/ZoHlM9XVD3W4V4dEs6uaBOGCMJGXwq lqfg== X-Gm-Message-State: ABuFfogpqCbFyTViOPNkJJPhSDj9dFMFAdNvJEr9zwne1RkJUuoVn/vS Vk63H5m/lKROCilIxMtVefU+tLU2m2M870D7jmk= X-Received: by 2002:ac8:1d11:: with SMTP id d17-v6mr5241410qtl.343.1539345080789; Fri, 12 Oct 2018 04:51:20 -0700 (PDT) MIME-Version: 1.0 References: <1539337442-3676-1-git-send-email-firoz.khan@linaro.org> <1539337442-3676-4-git-send-email-firoz.khan@linaro.org> In-Reply-To: <1539337442-3676-4-git-send-email-firoz.khan@linaro.org> From: Arnd Bergmann Date: Fri, 12 Oct 2018 13:51:04 +0200 Message-ID: Subject: Re: [PATCH v4 3/6] parisc: add system call table generation support To: Firoz Khan Cc: Parisc List , "James E.J. Bottomley" , Helge Deller , Thomas Gleixner , gregkh , Philippe Ombredanne , Kate Stewart , y2038 Mailman List , Linux Kernel Mailing List , linux-arch , Deepa Dinamani , Marcin Juszkiewicz Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 12, 2018 at 11:45 AM Firoz Khan wrote: > diff --git a/arch/parisc/kernel/syscalls/Makefile b/arch/parisc/kernel/syscalls/Makefile > new file mode 100644 > index 0000000..a0af5a3 > --- /dev/null > +++ b/arch/parisc/kernel/syscalls/Makefile > +syshdr_abi_unistd_32 := common,32 > +syshdr_offset_unistd_32 := __NR_Linux > +$(uapi)/unistd_32.h: $(syscall) $(syshdr) > + $(call if_changed,syshdr) > + > +syshdr_abi_unistd_64 := common,64 > +syshdr_offset_unistd_64 := __NR_Linux > +$(uapi)/unistd_64.h: $(syscall) $(syshdr) > + $(call if_changed,syshdr) The __NR_Linux seems misplaced here, don't we need that only for ia64 and mips? > +systbl_abi_syscall_table_32 := common,32 > +$(kapi)/syscall_table_32.h: $(syscall) $(systbl) > + $(call if_changed,systbl) > + > +systbl_abi_syscall_table_64 := common,64 > +$(kapi)/syscall_table_64.h: $(syscall) $(systbl) > + $(call if_changed,systbl) Have you considered making the 'common' part implied? I expected to see it done that way, although listing it explicitly doesn't seem harmful either. > +systbl_abi_syscall_table_c32 := common,compat,32 > +$(kapi)/syscall_table_c32.h: $(syscall) $(systbl) > + $(call if_changed,systbl) The way you specify 'compat' as one item in a list of ABIs seems rather odd, I'd suggest keeping that a separate flag. I think you can also pass arguments to 'if_changed', rather than setting a global variable to control it. arch/powerpc/boot/Makefile has some examples of that. It should be possible to do this like $(kapi)/syscall_table_c32.h: $(syscall) $(systbl) $(call if_changed,systbl,common|32,compat) Passing "common|32" as the list of ABIs in the first argument, and 'compat' as the second argument. > diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl > new file mode 100644 > index 0000000..7c9f268 > --- /dev/null > +++ b/arch/parisc/kernel/syscalls/syscall.tbl ... > +346 common copy_file_range sys_copy_file_range > +347 common preadv2 sys_preadv2 compat_sys_preadv2 > +348 common pwritev2 sys_pwritev2 compat_sys_pwritev2 > +349 common statx sys_statx > +350 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents > \ No newline at end of file Here is the missing newline again. This should never happen if your text editor is configured correctly. > diff --git a/arch/parisc/kernel/syscalls/syscallhdr.sh b/arch/parisc/kernel/syscalls/syscallhdr.sh > new file mode 100644 > index 0000000..607d4ca > --- /dev/null > +++ b/arch/parisc/kernel/syscalls/syscallhdr.sh > @@ -0,0 +1,35 @@ > +#!/bin/sh > +# SPDX-License-Identifier: GPL-2.0 > + > +in="$1" > +out="$2" > +my_abis=`echo "($3)" | tr ',' '|'` > +prefix="$4" > +offset="$5" > + > +fileguard=_UAPI_ASM_PARISC_`basename "$out" | sed \ > + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ > + -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` Maybe use ${ARCH} instead of PARISC here to keep it the same across architectures? > + my_abi="$(cut -d'|' -f2 <<< $my_abis)" > + while read nr abi name entry compat ; do > + if [ $my_abi = "compat" ]; then This check seems really fragile, but if you add another argument to the script instead of listing "compat" as the second option in the list of ABIs, I think it's fine. ARnd