Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp126730rdb; Mon, 18 Sep 2023 09:59:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtBGOP4p6goB5wkt/PkNds/HtqoHNZpZO+Tvco11f3DYsgHKANmJmrZYKrhy+kwCQrO2S6 X-Received: by 2002:a17:90a:3186:b0:268:ca63:e412 with SMTP id j6-20020a17090a318600b00268ca63e412mr8747343pjb.4.1695056359312; Mon, 18 Sep 2023 09:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695056359; cv=none; d=google.com; s=arc-20160816; b=kZ9J0DY2J5/6fes9jInPmb3duo9YwDvYVupMoZgGNUq+/8c0NNjCtRLjn7yNCDiIdF gbEUHl882lK+bicTD6pRX4RDf3CwQ7K5TdyiyjcbvHsc0RsKH52uLFHELKP4lICsgcm9 D37OLWBbhNSV8wapwPTK6DFSqcy8jRtpo6OgNRbPI+iHuZRzAzRglIG1yGtWY67x06Sn BB9rVWQ8GT4Npmp9ntq1XaCPV++nLH2txFrpV2Ahi5/gddGnfYx+H2YfjlQf5+xx9eka eoritQeI3FIj39xxq8fJui/iBLRwvw5tDf8cz4PUhAj87INO/NYTtrJTc2Xm53KRHut2 L/2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XdjE+qFIluy7V50fj6UlGy3Brp6+e5NilxSdL91c6mk=; fh=q3eJ70+nPBBOurH5DI6uivZtkSdfT1YhlPrRDAlF5bE=; b=Td32zhEtxSXRvUeT1l+OcZjAzAG4R3IhIqluuzCOA+/tstqzGdUUsJ4vKTX2S45RTc 7pBvabbIbDXF+2Dmub/IjEgPKAcl0g6TdnyO9FEHn5wKylWS2H0rGyn6hY/xanrA3hk1 HYJzG5vDLKkFvQP2G3rOJ4/dKnVSWXZfUsDJ+L/VfrQ4jw6Dj1S/Xzmz3abZdPb/wbZc rMXmaf1WK+qszZolomEWng53uo0sDkgiu3a+t5qBcsf8xB8FJfW7wOAxkMVEqp8IJVkE CuijSTx08bZ/sfcuNeFGyJBcR6nY0285xEOJgUvxNOKZbquvsnmwZchfciAASaln8o8E torA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id mp22-20020a17090b191600b0027484e3240csi6957529pjb.159.2023.09.18.09.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 09:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9D99280E06A4; Mon, 18 Sep 2023 09:33:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230251AbjIRQdQ (ORCPT + 99 others); Mon, 18 Sep 2023 12:33:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbjIRQc5 (ORCPT ); Mon, 18 Sep 2023 12:32:57 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 53B9B55B7; Mon, 18 Sep 2023 09:19:50 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 38IGJFHZ028574; Mon, 18 Sep 2023 18:19:15 +0200 Date: Mon, 18 Sep 2023 18:19:15 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Shuah Khan , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 2/4] tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks Message-ID: References: <20230917-nolibc-syscall-nr-v2-0-03863d509b9a@weissschuh.net> <20230917-nolibc-syscall-nr-v2-2-03863d509b9a@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230917-nolibc-syscall-nr-v2-2-03863d509b9a@weissschuh.net> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 09:33:33 -0700 (PDT) Hi Thomas, On Sun, Sep 17, 2023 at 05:36:17PM +0200, Thomas Wei?schuh wrote: > The ENOSYS fallback code does not use its functions parameters. > This can lead to compiler warnings about unused parameters. > > Explicitly avoid these warnings. > > Signed-off-by: Thomas Wei?schuh > --- > tools/include/nolibc/sys.h | 44 +++++++++++++++++++++++++++----------------- > 1 file changed, 27 insertions(+), 17 deletions(-) > > diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h > index b478750c9004..8389820e1928 100644 > --- a/tools/include/nolibc/sys.h > +++ b/tools/include/nolibc/sys.h > @@ -43,6 +43,16 @@ > : __sysret_arg; /* return original value */ \ > }) > > +/* Syscall ENOSYS helper: Avoids unused-parameter warnings and provides a > + * debugging hook. > + */ > + > +static __inline__ int __nolibc_enosys(const char *syscall, ...) > +{ > + (void)syscall; > + return -ENOSYS; > +} > + > > /* Functions in this file only describe syscalls. They're declared static so > * that the compiler usually decides to inline them while still being allowed > @@ -133,7 +143,7 @@ int sys_chmod(const char *path, mode_t mode) > #elif defined(__NR_chmod) > return my_syscall2(__NR_chmod, path, mode); > #else > - return -ENOSYS; > + return __nolibc_enosys(__func__, path, mode); > #endif > } (...) It's much cleaner like this. Acked-by: Willy Tarreau Feel free to push the whole series to the next branch. Thank you! Willy