From patchwork Thu Sep 27 14:15:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 147711 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2065997lji; Thu, 27 Sep 2018 07:16:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV62/SfBkg064qX/wp2usGWERDdAs5/s8XHNhdSTLV7JvcUUlc804PuhmHembihFZS2KJJBWU X-Received: by 2002:a63:5f03:: with SMTP id t3-v6mr10608295pgb.68.1538057772781; Thu, 27 Sep 2018 07:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538057772; cv=none; d=google.com; s=arc-20160816; b=HSeABbJsFF3LKbILdet/OmmH0Z5UxnzADNm983EiKiX6z93jnNSjIDqOrlQJOidSal 6ERTLImSgntQMrOT5I8r+WZW/jr2A7uH4UlyLYkQDy1jI/Urb9ssops6/to8mcXk26mb 5wdUGlt6Er9vWMTeHlecmwnobJHFNKpWma7KalJVxRROdg6Wymp7e4jE+QRG6bcDR1J2 DQOUGTAr0tvjTO7TivQR7wOkKlP8yEZqmFdOXgGhiwGkWsLE7GX1iwNzf41fLyD2vghe 8/y4iC29S0LEwpz7j+2VGlonMGy+27sboKbnz+KfOv4vX0DePB8OrbUXgnSnAHu+HXB9 Octg== 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=KGoQGubBVpBkrdiSvI5XeRwl9OiEQoVsXrMuDsHBZAgyU4MUMkOM4z98KUzZHz2wMY WizJ3VHDex2qQyrOHl0y79hZn47lvwbLqBUSeIh9khXs5l1RWwub8fo8IO0DpS3zFyAd qNTpiMIkHwNUrEWEysEqOmnh21d0QLc4+YKHm979w6y/QBbGma5n4yiVsU0WJrkjG2Om sLYcccph1beI3sE4iqiAFZvIUISB+c91UfeCrWfBmAID1Uz6ohoezDg0W1CM5QWFppTS mYw+R6vaU2GR88E2L1lyOrQmRV7Sui7c/N84zOcinVj+WJtAb6oadl4NOqtCSBQAi3ZB Eo4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MkH6yCwz; 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 x27-v6si2555462pff.196.2018.09.27.07.16.12; Thu, 27 Sep 2018 07:16:12 -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=MkH6yCwz; 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 S1727979AbeI0Uei (ORCPT + 32 others); Thu, 27 Sep 2018 16:34:38 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39002 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727318AbeI0Uei (ORCPT ); Thu, 27 Sep 2018 16:34:38 -0400 Received: by mail-pf1-f194.google.com with SMTP id j8-v6so2028204pff.6 for ; Thu, 27 Sep 2018 07:16:10 -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=MkH6yCwza8WPqQKk9MDz+wHEGdJd9E0YPhcH8+viIL2isMP9wPACn48taRmloxCev7 U1hEr7/yIIO7K8WNuyyimHGEzUx+69sHXQI6Np8pOPp1vDy7c1FKkmnz1KGLwURefUip 27pQIZ56ceza6+ZQIqoZMjhVUHqLC5znHq00k= 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=n4YYLVM1wLJLj+N82I16egM5QbegGsKmRwh1msToQcoLiQ/5O5CYM/QTUhhZJzRi28 oFYYCFI7cpi1lnwSNVrkGnCJnduUc7If6ULWEHl/ljHV/MFTxHidOEjAUu2GlQFarlDA BvFXXwhsMRVKVvuXCIOu0NbJhKK7A9O1MNuJ+dQ/T+++LJzhQxS+IuVqlQHVQY1giO/V UP9zJYusdNgY4qmy87MPOucs71ZxjBep2sxTSGrCQ2ADQtKD19aTix8HrQ7govddP9t3 YoLyoHfCdgaG6cS+0K8nJBWy0xYDUvv9nOL7jr6iBOq5GqRMxuYfaXwj5zE2M3Lh+8Xt lDtQ== X-Gm-Message-State: ABuFfoh7Lp3QU4bKkXEPwEOKnat3zT1NG/GTJg6MQfxiy7nMp7MkpC4J oimwzMxRDOEyjplIra6D03Jeig== X-Received: by 2002:a17:902:1681:: with SMTP id h1-v6mr11257754plh.262.1538057769552; Thu, 27 Sep 2018 07:16:09 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([106.51.105.186]) by smtp.gmail.com with ESMTPSA id m20-v6sm110399pfj.171.2018.09.27.07.16.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Sep 2018 07:16:09 -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 v2 2/7] ia64: replace NR_syscalls macro from asm/unistd.h Date: Thu, 27 Sep 2018 19:45:15 +0530 Message-Id: <1538057720-3392-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538057720-3392-1-git-send-email-firoz.khan@linaro.org> References: <1538057720-3392-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 */