Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4881535imm; Tue, 18 Sep 2018 00:18:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbFobUzvqy06XUVkiq+J9PEIbojPWl14m9OjhbVzF74FMiXLO87OLqXVn1qUcAcWGm09/mk X-Received: by 2002:a62:4bc6:: with SMTP id d67-v6mr29418103pfj.175.1537255090965; Tue, 18 Sep 2018 00:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537255090; cv=none; d=google.com; s=arc-20160816; b=ckkx7OZJR3R2UBogMsYEkY2e4LKImLQO9K4IDbWeL1pDqesuEAE51tb1kOphZp6k3z u6lhc2YxBzbsV/VQrGvO/bi0kbFNZI2sCTFWkreMigX5Ku/NGAEK7EvQ32sKmDfB0kSo HIX3/LXsQO6xbeW6JaA95HI3LJ0FJzKgZpFAGAKQbnn3HzfAJxAQtE5tsFBBfdQuBkSW 8qGK4t4XPj+HGfxV/q9fj9txOGOT0uw27kyQi0jFhwVx2iorUaKnnH+6jk8QxUE1qpp9 SBzMIFSMvEH3B1ceOu+ZhYNCNIZgkGzWbAJ8/d101M596/k3biTw7wxvJHmC/5BWHQWN JjmQ== 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 :references:in-reply-to:mime-version:dkim-signature; bh=c0noeHIX0ldlcFPDgUobaOdsnZbk9b8UyXSiH2PgIxE=; b=jQ/RohReiiqE8Bl60eWEcRaMHJUqg/lyjR+4Gp9LDF7eK50D0Jvvjmnuxbo6YKOkLM su4dph8YSXYqd9w5Oz5K4mffk2AeVNJhvAOnR/kaYLrOEcDq66U22NC7A7DG8sisVhsd 6Y462qq5SIBIx4pD4zHDrnt1ag3UQCitDERjPpue5uyxYNB1t9r7KhtfYCo/wo6QMmnw Ff8fri9TCsIpxuXgJ/aSXp4mm6phlT/6rT9fztjSMp9HBCuMX6vqx4K1ygD9jRKGIkLx K7bCkepTYiYhe3rytUu9ZS28Uy3JckyiQOYNyucFWkCEq9yKMDT3iKac2CAUreJpQOpt 76xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HpILf7qM; 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 p23-v6si17137572pgl.394.2018.09.18.00.17.54; Tue, 18 Sep 2018 00:18:10 -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=HpILf7qM; 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 S1728773AbeIRMsM (ORCPT + 99 others); Tue, 18 Sep 2018 08:48:12 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:34378 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbeIRMsM (ORCPT ); Tue, 18 Sep 2018 08:48:12 -0400 Received: by mail-yb1-f194.google.com with SMTP id 184-v6so402215ybg.1 for ; Tue, 18 Sep 2018 00:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=c0noeHIX0ldlcFPDgUobaOdsnZbk9b8UyXSiH2PgIxE=; b=HpILf7qMKTbrpxv0l/5vDzxoKPioPmi0QPX26d4UqRNP70KF4PwrNWjAmVASA18H/E NiQDN8tO1JwnDL+ehxI0IdzkL2XMYL3oaKVtrVX6zQdswXgsI0FwflZ0FmK8bRGP041N yavyLpvQlPEZlTuKYgvtK+yIihE5/RPF3WMsY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=c0noeHIX0ldlcFPDgUobaOdsnZbk9b8UyXSiH2PgIxE=; b=Mbc8eGWic9jIfIuC4MgqolKeP57YONOGGh32aKCSWP8unuL2KtFLYWmlZDPzWmC9ct NHkER5CDPpoVUdaPMfyRw9h5f8c+EC3jkwFzi20Z85ar4OkXTZCMpyWlIV3FVqjGhxV6 5ac1P32vk/UbJTtIorFxBSNgIYyy4Kt2H6EMJMzQfWmJ1q210iCs6N6j+YBagSCNIWVr 942nJIviK6T9MjyJAoQA73C1Yn9XMHC5LBn3kWMjl/Zx546JJVn1/qH05yKfSreH36Gj +jowtOTFmw3/RrZ7GMAAdWt21XyNk9tvaZANGKTlo6lLwGUgZgP3ZBOpiLC5rLkxnJBs fX1w== X-Gm-Message-State: APzg51AAAdW+MKaiHSKtAgdFiYvbm6qD0i+gvIGmkbC+wrZlgXY5Vcfp 3Vy66wJDdNvDXutxAUPBgFYRPAUE/B/mPryxNvVdog== X-Received: by 2002:a25:e548:: with SMTP id c69-v6mr11778281ybh.393.1537255014875; Tue, 18 Sep 2018 00:16:54 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0d:cc4f:0:0:0:0:0 with HTTP; Tue, 18 Sep 2018 00:16:54 -0700 (PDT) In-Reply-To: References: <1533791723-3882-1-git-send-email-firoz.khan@linaro.org> <1533791723-3882-3-git-send-email-firoz.khan@linaro.org> From: Firoz Khan Date: Tue, 18 Sep 2018 12:46:54 +0530 Message-ID: Subject: Re: [PATCH 2/4] m68k: Replace NR_syscalls macro from asm/unistd.h To: Geert Uytterhoeven Cc: linux-m68k , y2038 Mailman List , Linux Kernel Mailing List , Linux-Arch , Arnd Bergmann , 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 9 August 2018 at 13:00, Geert Uytterhoeven wrote: > Hi Firoz, > > One first comment below... > > On Thu, Aug 9, 2018 at 7:16 AM Firoz Khan wrote: >> 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 moved the >> NR_syscalls macro from asm/unistd.h to uapi/asm/unistd.h. The macro >> name also 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. > > It can indeed not be part of the UAPI, as UAPI definitions can never change, > while new syscalls will be added in the future, increasing the number ;-) Thanks for your reply :) Sorry for the delayed response :( I would like to keep __NR_syscalls macro to uapi header in order to simplify the system call table generation script. Otherwise the __NR_syscalls macro need to update manually. That become a problem. Please check the below implementation in uapi file make sense? It is an easy workaround to leave __NR_syscalls macro in uapi/asm/unistd.h and enclose it in #ifdef __KERNEL__ ... ... #define __NR_pwritev2 378 #define __NR_statx 379 #ifdef __KERNEL__ #define __NR_syscalls 380 #endif ... ... > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds