From patchwork Thu Sep 20 15:06:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 147097 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2113514ljw; Thu, 20 Sep 2018 08:07:13 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda0Xs3yHQqeswgE1gxzPq7//crYYK7oPv/x6kBtWOjQFCNv8tYg41IaD65nmfz9pfjBeWrr X-Received: by 2002:a63:5d55:: with SMTP id o21-v6mr7725195pgm.349.1537456033722; Thu, 20 Sep 2018 08:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537456033; cv=none; d=google.com; s=arc-20160816; b=vCFe3tHsBq0nj7zjw1pTPgJuk0rFGp2WHhavmI90MmkIGcby2IXyW58IZHO2d/p+yJ T5VpoKX7MF1F3XEXwDsJCtP0AgmHjp9qkqcfFu0TIfvewFUSRrIelw2vfhshoxhEkl1/ zfUmcNTmTxEYCvJvjEakGnl4CyF1qHVmEaN+gmETj/Q0AcLRwCMy1lauYM3cj5/Kj23p eQB3PsXpa5ncjcY3LTTNzDmWNtJ9kxRQEZCcrUqTMqLYVGdjvK05SwX7O3hNT0pNRdEV 7Qtb28CezyCTgTpFmOvGmSEorDkWi4qDt8qFPUcQKRQ7Ff1xzNc++stf0BqFrqEniP77 4gsw== 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=CX41ki2kczu1qAQ/hv2i6mgWeOgVj6gPhu2iwSGbJw4=; b=Ho4DvDhaQQ7jy2/0hm1/jw/xKcOshufEda7w9RXsrSsYT/wAj7Hxx1m2b+0mN69psJ ePzntuxIsLsVsQOBb2RFw1FTeDUBw+69MoCCEXhH4UHRvedvY4Lrotmh36GQ7IRh+WFJ WcK3kbGQjtvPa/lsatq4QdzAfCXYEChf1bLLzrmTHZmrxJJ2pepGV/1iD4foHZIAnb97 nQloP4hEb49mdbc8+8CAmkstZVbgQZpU0uY+fuY6/66DHYALF2zZ2oof81UkJmSbVDWw OaRiwxh8Q5ATT9U5DseyOePbVL3+Gxe5m2lbMjaZemfNGzAz/Tk6h1Z1iT0HIm/HwFsm rbOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AfB0g5Pd; 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 h17-v6si23545847pgg.218.2018.09.20.08.07.04; Thu, 20 Sep 2018 08:07:13 -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=AfB0g5Pd; 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 S2387785AbeITUus (ORCPT + 32 others); Thu, 20 Sep 2018 16:50:48 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38804 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387728AbeITUus (ORCPT ); Thu, 20 Sep 2018 16:50:48 -0400 Received: by mail-pg1-f193.google.com with SMTP id t84-v6so4571392pgb.5 for ; Thu, 20 Sep 2018 08:06:54 -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=CX41ki2kczu1qAQ/hv2i6mgWeOgVj6gPhu2iwSGbJw4=; b=AfB0g5Pd4Qqi0cygwYQX6lH8seBTd1v1q8Q4xES7uATertP3is7ZpDCmnXOrLMz5OA M3iBWFSm3UWMAVHvXg5McpMu/JrZL2hOlOSFOpM2Uoh6FzW7kn2Dw7I46NK7I3ncRQRG Gc9IR6NGvHvN+7l3EgLFQ9fd9A8opyd90zyQQ= 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=CX41ki2kczu1qAQ/hv2i6mgWeOgVj6gPhu2iwSGbJw4=; b=oU5hsCztiOtr6rTKhNwU0AK4vnuiqVPqp2KkLqXE9W856gKphZNaQiQfVY7LeVbG3T 0eEA1ICMI14MnS187UShfcHG7QzjPQ5qAUA+NFdTcussRplySxkKk+j2YKk+8HNXsI4H 7j5LjAnAweALW+0M6qTt0fNYfe5WMnx3SZqgY9wIS6d12PjsDyXr+iE743nRw9UrjsCD TS35xdpZ4lp88XA6I8wqXjiUst/rNJSbsQOTcm9kFJB+aqoZYvHksMFxKJIojrVi5+Vd cTKsgtyWE+kevngnMa1cJIQDZDIeheK9vPjtpG8MO7/RaDzIwj0nF0G5sqEUw2s+V+e6 OuxQ== X-Gm-Message-State: APzg51Cu5cVO+uWUYjw1VdJgzt8wtJceRVS09FCNbwCpU8AoIKBlBfFq jsoKi5GXwQdbXsa7l3g3+1q+Pg== X-Received: by 2002:a63:7f06:: with SMTP id a6-v6mr37524094pgd.296.1537456013788; Thu, 20 Sep 2018 08:06:53 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([106.51.107.142]) by smtp.gmail.com with ESMTPSA id k64-v6sm36222991pfg.141.2018.09.20.08.06.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Sep 2018 08:06:53 -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 v2 2/5] m68k: Replace NR_syscalls macro from asm/unistd.h Date: Thu, 20 Sep 2018 20:36:10 +0530 Message-Id: <1537455973-12468-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537455973-12468-1-git-send-email-firoz.khan@linaro.org> References: <1537455973-12468-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 untill 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 Reviewed-by: Geert Uytterhoeven 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_ */