From patchwork Thu Oct 11 04:24:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 148591 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1659593lji; Wed, 10 Oct 2018 21:25:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV62TP57zKOYF7OKncuHx52bcvokpyDcwvMa5Qh4vlsRvmI8Ci7BX1zwNQsWrsHurh/ix70a9 X-Received: by 2002:a63:8343:: with SMTP id h64-v6mr30594392pge.368.1539231946358; Wed, 10 Oct 2018 21:25:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539231946; cv=none; d=google.com; s=arc-20160816; b=TcVr6HN00caT2RICGN/tqhg8Jte4h8G4s1jBcePVU0PoV1dG+0h2BnNbZEgTzgo2C9 IePppYW9kDsBKlEHbeKfO0uX+SX2SGzTk/hNnNgzXOgMLmOrmWiGBIyNi87sjaj8ssVR SRm30JgAw4eNI86n3r/ZSyloFFmll3pMylBhnMTBXsHM8JhyA4N939x6agY3A4d4SrWK 176xqVHQJy+ViQIlyP0ymJo9w/ja6kp2uGkP3DAJ2pbG6OYZeVyCVRV26hy3N+tEF0Kv FWsvu/HXyGyHdQ0PRs3rqwqwkFFpHK3mUU8u8ksifTHS0JP4tDTu8cmhPMbcjJpfj5Mi Noig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=uCe8GDuDIsW/oywTVVyhSQ6yR7tNM4OEAIIVzFvTQ8s=; b=Qh6SWHEvLSMRPRQZLlNyvVveqADDhMUMItHVX1kUpyu6kqTyoNcq4t50voHLqM/hTN Jks3skNegYHAlsSp0to/LE2i2oVPpq9mzT0ScD4aOdVohWA9NCAk1rvpt/HPJqR30TBn yb/wxq6eGJ3Defp9/OPKFBRaHnhAvIdE9Wrg6KN/LEMToDt027KzNKu21hMcrgCbAx+6 PviYIn414EluH1GDLKVgdHqBn3Zu1QNOjY/PR0iQvtvn0IIP4SjfjVWq8Pkle3XRcqwd 7Q0jc+5sP2OWvqaPSeuFSoocUvBEmq/72CLSSlo60aT1jsGPyyyGqfje62ICVxd2qwxz BIBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hPpOjYSV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si20661973pfb.144.2018.10.10.21.25.45; Wed, 10 Oct 2018 21:25:46 -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; dkim=pass header.i=@linaro.org header.s=google header.b=hPpOjYSV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727500AbeJKLvA (ORCPT + 32 others); Thu, 11 Oct 2018 07:51:00 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35613 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727392AbeJKLu7 (ORCPT ); Thu, 11 Oct 2018 07:50:59 -0400 Received: by mail-pg1-f194.google.com with SMTP id v133-v6so3534501pgb.2 for ; Wed, 10 Oct 2018 21:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uCe8GDuDIsW/oywTVVyhSQ6yR7tNM4OEAIIVzFvTQ8s=; b=hPpOjYSVjWj5QqFPNKKVes0E3Z0l2Mw36Vo/xwjOR18ks3qZ+boyD+BFXZ7/Iglm+G V3+zwimixLlMG1sg0T5HhqYwoSNM5pdfP6gKr1eklWTT9mTtXU768U4mOiO9HReIdFf+ moRktkDYccBIbOaRUqgGFdmbt8nxySgXt3FrY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uCe8GDuDIsW/oywTVVyhSQ6yR7tNM4OEAIIVzFvTQ8s=; b=mXh8zPuPVMLWiUMuQe5p7XY+7+fIA16TPYu17hQa2aZ7LJnouBTBpVBqHA486V3zi1 CkzxwtPZOzAumaUPYBfIbkMPxPfMMlRGJFyhdcFqfksLr9Icbefn5InekOml5KHsIPYR 14tist8ZsIbZC2mYFTji0GtvYMMQuSLjZXrAZZBiy07kxk6SkfRHg4E38ZHRilcK7IJ/ 64NWGOSksraGR0ZRQYqfeoR3Q142InftHqbBI+k98p38mNBRXDAUIxmp2EGfUkDc7lzZ opp3B7E3j7lmwABtPtZ+blDBV86ifrKZS3se6Go7Ar2s2LOaxT3E1/gWc7uio4dvgxk5 +s4Q== X-Gm-Message-State: ABuFfohIPSTNBvN160FeKe9XfcRB4dSd9YvJ3XkTe1gzfYreyAdmfTt5 Upk0MWQJncFJbxfVbToXeZjqNg== X-Received: by 2002:a62:4ec9:: with SMTP id c192-v6mr37319155pfb.221.1539231935764; Wed, 10 Oct 2018 21:25:35 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id n63-v6sm26113748pfn.9.2018.10.10.21.25.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Oct 2018 21:25:35 -0700 (PDT) From: Firoz Khan To: linux-ia64@vger.kernel.org, Tony Luck , Fenghua Yu , Thomas Gleixner , Greg Kroah-Hartman , Philippe Ombredanne , Kate Stewart Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, arnd@arndb.de, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH v3 2/7] ia64: replace NR_syscalls macro from asm/unistd.h Date: Thu, 11 Oct 2018 09:54:50 +0530 Message-Id: <1539231895-4118-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539231895-4118-1-git-send-email-firoz.khan@linaro.org> References: <1539231895-4118-1-git-send-email-firoz.khan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NR_syscalls macro holds the number of system call exist in IA64 architecture. This macro is currently the part of asm/unistd.h file. We have to change the value of NR_syscalls, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file contains the number of system call information. So we have two option to update NR_syscalls value. 1. Update NR_syscalls in asm/unistd.h manually by counting the no.of system calls. No need to update NR_syscalls until we either add a new system call or delete an existing system call. 2. We can keep this feature it above mentioned script, that'll count the number of syscalls and keep it in a generated file. In this case we don't need to explicitly update NR_syscalls in asm/unistd.h file. The 2nd option will be the recommended one. For that, I come up with another macro - __NR_syscalls which will be updated by the script and it will be present in uapi/asm/unistd.h. The macro name changed form NR_syscalls to __NR_syscalls for making the name convention same across all architecture. While __NR_syscalls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan --- arch/ia64/include/asm/unistd.h | 4 +--- arch/ia64/include/uapi/asm/unistd.h | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index ffb705d..397b143 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h @@ -10,9 +10,7 @@ #include - - -#define NR_syscalls 326 /* length of syscall table */ +#define NR_syscalls __NR_syscalls /* length of syscall table */ /* * The following defines stop scripts/checksyscalls.sh from complaining about diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 4d590c9..4186dc2 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h @@ -341,4 +341,8 @@ #define __NR_preadv2 1348 #define __NR_pwritev2 1349 +#ifdef __KERNEL__ +#define __NR_syscalls 326 +#endif + #endif /* _UAPI_ASM_IA64_UNISTD_H */