Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6727296rwd; Tue, 6 Jun 2023 00:42:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7DttSII0KsNvUPUrWmfwaLVSFqzXIWM4O0oB++efOQ8Mds20cK8SBK6kLaD35d+2viX8VZ X-Received: by 2002:a05:6870:8227:b0:192:5cba:4c10 with SMTP id n39-20020a056870822700b001925cba4c10mr1392874oae.40.1686037322178; Tue, 06 Jun 2023 00:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686037322; cv=none; d=google.com; s=arc-20160816; b=gNzaZ6W9aaJxbMYE/543yGA9nN7Roo72r/2z5oviVJKGwHxv0jqVJ/04y7zXw5Flmn KyipIWkBVNCoZbbGtaYwgEPsTSu82K28kpbmAyjO0ifEJYszLTUnKpWVewM/7n8wBUjb S/afo0cxGJyZHm98RVH1+lIyCvvpkkrtEr0Z7oDD/qjkGSgquFQEEo+KIf0M4iscn5Xe wscNZFqDzhx01ig2HC2BuXGM/x/ReaRcSw3W2EzQIhWHgKGPYqUQ5npzJUuWvgkB3VX4 NqS/qjvXVWjQpbAov0221n6u4u+5awP4AXMiT833ud42Cbp1XA4JpWDM1XQy9cbQNDL9 7Mag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=JP6R94uQbzQBfUBBvYz80fUZWf0TL/O0HNFiOYoH0g8=; b=Mgq3uSDdV2Mt4sVsLIXQcuW10cvavYiSEEMB1pHlr9GXfHsXX5JZt6B2MCsmMUc4zv xTjEuG8OvuoecZMmkZivrSvB6Dt7p7jxK0FuNtQak3aheFyw/LVJEzoz1OdYYN1yD1YR UDY8yroaFFPF/3avV36kTxEmjRYxIf2DyeoO1+eqPKW59EGu1Fxaxf5sTMJUWddB3bMk FjpkKa5a2YbmlgS3xdQk519hl2w0gZTOP5dadBFmNqManJdzd8FQWUhhomid4VW1yH8i xYJR38Z/AgK9J38VvNTJuPOYHM4/rbwdl6ESoQzGerV4ow6CoOA/OrNnSTDM/SSJWWPb +r4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b="VzA/5wvw"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="NJZ/bUau"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a632c0c000000b00543d33304e6si1525199pgs.667.2023.06.06.00.41.50; Tue, 06 Jun 2023 00:42:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b="VzA/5wvw"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="NJZ/bUau"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235754AbjFFHfz (ORCPT + 99 others); Tue, 6 Jun 2023 03:35:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235090AbjFFHfx (ORCPT ); Tue, 6 Jun 2023 03:35:53 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3DB711D; Tue, 6 Jun 2023 00:35:51 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 129EA5C00CC; Tue, 6 Jun 2023 03:35:49 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 06 Jun 2023 03:35:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1686036949; x=1686123349; bh=JP 6R94uQbzQBfUBBvYz80fUZWf0TL/O0HNFiOYoH0g8=; b=VzA/5wvw+R/Q0vEigx C6bAunIc1d6yzEraxrGySxrM2Id2FfJbsuAgHJIWW7cxm+dvWvB+5urBCTuP/aCt oBtRxJh+nBd0aERvmDnApWrYKp9f+vx1onw2ekLHupDXSbY1FoeS1M0XW1vntoYb QILd8QYJa+0e2BlpOuwrHwouhgh8HewOcxOwEZjxWf43hJtvhpcbUDhizkUiqr4W 6XPiIvx3fOWe63trfROGA4YOvcPc4PFY6vjuSb6FTWqBJaD4F5DlISMf4dvrOHKp CN3YJvGMiM1ktsW/dO7PZ+kK5QPvg8i7+CdDMH53oVygrDLDsIx+HdbQ9crCMRnD RdxQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1686036949; x=1686123349; bh=JP6R94uQbzQBf UBBvYz80fUZWf0TL/O0HNFiOYoH0g8=; b=NJZ/bUauyn6r9C2HniX6H8c+cfhTz zWalf2888DaLopnoz27/2Bhayjh1J7fAqLRxel8pdEoGtvN74uqeJskTSRP+PjKx 1ACNlag3qsQY4TwYXeJOX+b6caxIE6GXgCvw4UocZ0dAj8RKictsabo9jR4oKDSb 1kPRfEvSld4q463ZukNMi2EZc6nMf5UK3T0Fo1KnhqbzjaBEyZKdIbUbcpwUoKGw O2+xz/3sKW1RDpfi5te+Ln8XeCEquZEZYHke4XoS6cJg+aDrbTXLBxYVcKZsKBGE d4uBpzsPSLmAiOa9419nOpkYnrH3vHZog8Nh8bztyXiKFPz58qOvk7IWQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedttddguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeevhfffledtgeehfeffhfdtgedvheejtdfgkeeuvefgudffteettdekkeeu feehudenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5175CB60086; Tue, 6 Jun 2023 03:35:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-447-ge2460e13b3-fm-20230525.001-ge2460e13 Mime-Version: 1.0 Message-Id: <4fcdd08c-e6fb-40b7-9f2b-77f96e798b37@app.fastmail.com> In-Reply-To: References: Date: Tue, 06 Jun 2023 09:35:27 +0200 From: "Arnd Bergmann" To: "Zhangjin Wu" , "Willy Tarreau" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Subject: Re: [PATCH v3 1/3] tools/nolibc: fix up #error compile failures with -ENOSYS Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 3, 2023, at 11:01, Zhangjin Wu wrote: > > Suggested-by: Arnd Bergmann > Link: > https://lore.kernel.org/linux-riscv/5e7d2adf-e96f-41ca-a4c6-5c87a25d4c9c@app.fastmail.com/ > Signed-off-by: Zhangjin Wu > --- > tools/include/nolibc/sys.h | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h > index 856249a11890..78c86f124335 100644 > --- a/tools/include/nolibc/sys.h > +++ b/tools/include/nolibc/sys.h > @@ -124,7 +124,7 @@ int sys_chmod(const char *path, mode_t mode) > #elif defined(__NR_chmod) > return my_syscall2(__NR_chmod, path, mode); > #else > -#error Neither __NR_fchmodat nor __NR_chmod defined, cannot implement > sys_chmod() > + return -ENOSYS; > #endif > } I think the most logical would be to have each syscall (chmod, fchmodat, ...) have its own function that returns -ENOSYS if that is not defined, and have the logic that decides which one to use as a separate function. This patch is a step in that direction though, so I think that's totally fine. Arnd