From patchwork Mon Oct 1 12:37:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 147896 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3856549lji; Mon, 1 Oct 2018 05:38:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV60qr/0MQ8/lum90EvEn/tD0tOYsgXmASdaOsEblsFTvMBRmCtgWrTVJy5HPnyp6h+30ZRoN X-Received: by 2002:a17:902:6b46:: with SMTP id g6-v6mr11304419plt.19.1538397532316; Mon, 01 Oct 2018 05:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538397532; cv=none; d=google.com; s=arc-20160816; b=MPLvaie6HW2qwfi2bUcz3x2VVu/SwY2qr0q4bHZrzuZ729sPdLiJA0bHz29S73kAjT 3WQOk885SilwuiNDfK3pJLIKF7ndDDfvEued5i5vJijngij2veJRj70wZVC0fxr545Q0 jAPOmlVr4+1bUQP7hgU58gSU09bBREoQ1125z7Yf12xdq+ndrLapa8J1xT0TFL5SdHAY f44ohYn2vlUZQ5LDocpctg40ggi3o7zqdlpJiXmesU2Nem5IkELUHtiK3cvlAc2EELkM fIYIhs+yhk6g42z37gtOCpXpZtgtkLWywewSsVuNukAIqF2l8KOfgDgsriVbhzrSnvd1 jCVQ== 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=C9OBy+U1NW8in6jPZ1eqMRPpUZk14fgu1Kgje70cQpo=; b=I8hn32d06DoZ2AJ6uFmprIile6O5FarvaERN3FGyP0RA0PZPgAxqcfU4jVWiIKFyQM QnfpWMaZMGjrd7XAmj0YoKLKHueF2lJrHOw0ZWMbHaLJbRvsOSaXhbzfy9Fw9VJ1atO5 w88hfMZ3tc+v987cpHtuaabvGL6WT/phvDjUw/0pu3+ODpv0XI6apqkyQf1ouV441ALg MITgQHmDa+GzE6PHSg8A9T58ey1rm9TixLJbwocuAyCmxZzqHq1bLFXWzNKMEtPGjqOo pxXSVuIVaqY/lYPhHceNihguGoU36YuP7iSGagCb/7T2nQ7qxwKwO9R2z7bvozZ9prNJ db2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ktz7qqlS; 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 v16-v6si12293003pgb.96.2018.10.01.05.38.52; Mon, 01 Oct 2018 05:38:52 -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=Ktz7qqlS; 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 S1729412AbeJATQ1 (ORCPT + 32 others); Mon, 1 Oct 2018 15:16:27 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37951 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729320AbeJATQ0 (ORCPT ); Mon, 1 Oct 2018 15:16:26 -0400 Received: by mail-pg1-f196.google.com with SMTP id r77-v6so9400409pgr.5 for ; Mon, 01 Oct 2018 05:38:49 -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=C9OBy+U1NW8in6jPZ1eqMRPpUZk14fgu1Kgje70cQpo=; b=Ktz7qqlSeqbvhayLW4R9we1ZkpVT1cEBnCutO+7B7nEAXw0akgn1wUaWjg7Z6QGcOc Uw67HQpq+YV8XFxp1rTvGum1fkMs/SVeeXRRKXoRKOQyytCl9HxZS1YLleM5/OPwcBsv maSih6z+E5kWODaIHqaxBkctc6j5AXRqnTGN4= 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=C9OBy+U1NW8in6jPZ1eqMRPpUZk14fgu1Kgje70cQpo=; b=W989RVggTrgHJw2oQw/FEtAs1ey/2wSaXTO3fOQCCf0yVr8Ad8ItrM96gFDTA9I8Yb LezMLd0GSfPRZKJaO/0odxeKYUGonNmv+qN4e2wV7tiaEJuOtI56ZxT3SvDZ4G+KsfMX JtPxGKy+2G7znC1auNXeNjtOxa1LYg8ylqoR7rdjXi97t2gHsM6l33So4I/j7E4jUgRK 5orWOmBx+GbKWWf+N5Yu0Ni2ryhkt+H+UkuikLnV2T7LIccm0AcF4gWpsadBx1mEPIxa cFcXyby6ygRYpElrAS9GlGeINOXqLDmfI8oUO+GH+D9B/nJIWbijw7su6sBx6/DpE0ii Z/7g== X-Gm-Message-State: ABuFfohlSZBVFRHx5bW0ManAAPyRUbb8MCQEZ8sPDun6sc/mqe0LlG1k 4FztqBxWnPBv+8HH+0JpYCzq+A== X-Received: by 2002:a17:902:1ab:: with SMTP id b40-v6mr11799943plb.82.1538397528898; Mon, 01 Oct 2018 05:38:48 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([49.207.59.231]) by smtp.gmail.com with ESMTPSA id o12-v6sm21329345pfh.20.2018.10.01.05.38.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Oct 2018 05:38:48 -0700 (PDT) From: Firoz Khan To: Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , 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/5] m68k: replace NR_syscalls macro from asm/unistd.h Date: Mon, 1 Oct 2018 18:07:54 +0530 Message-Id: <1538397477-4003-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538397477-4003-1-git-send-email-firoz.khan@linaro.org> References: <1538397477-4003-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 m68k 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 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 api/asm/unistd.h. While __NR_syscalls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. So we need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan --- arch/m68k/include/asm/unistd.h | 3 +-- arch/m68k/include/uapi/asm/unistd.h | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 30d0d3f..5072e94 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h @@ -4,8 +4,7 @@ #include - -#define NR_syscalls 380 +#define NR_syscalls __NR_syscalls #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_STAT diff --git a/arch/m68k/include/uapi/asm/unistd.h b/arch/m68k/include/uapi/asm/unistd.h index de3054f..ba4176aa 100644 --- a/arch/m68k/include/uapi/asm/unistd.h +++ b/arch/m68k/include/uapi/asm/unistd.h @@ -387,4 +387,8 @@ #define __NR_pwritev2 378 #define __NR_statx 379 +#ifdef __KERNEL__ +#define __NR_syscalls 380 +#endif + #endif /* _UAPI_ASM_M68K_UNISTD_H_ */