From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEF29CD37B3 for ; Sun, 17 Sep 2023 15:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235802AbjIQPJI (ORCPT ); Sun, 17 Sep 2023 11:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237269AbjIQPI7 (ORCPT ); Sun, 17 Sep 2023 11:08:59 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B84DB187; Sun, 17 Sep 2023 08:08:53 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 38HF8KQT014506; Sun, 17 Sep 2023 17:08:20 +0200 Date: Sun, 17 Sep 2023 17:08:20 +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 2/4] tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks Message-ID: <20230917150820.GA14418@1wt.eu> References: <20230914-nolibc-syscall-nr-v1-0-e50df410da11@weissschuh.net> <20230914-nolibc-syscall-nr-v1-2-e50df410da11@weissschuh.net> <20230917025851.GE9646@1wt.eu> <2bd688b7-5f1b-44ca-a41b-6e90dc3e8557@t-8ch.de> <20230917094827.GA11081@1wt.eu> <1ef57a1e-89d3-4eb6-be12-3045a31f99e4@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1ef57a1e-89d3-4eb6-be12-3045a31f99e4@t-8ch.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 17, 2023 at 05:07:18PM +0200, Thomas Weißschuh wrote: > On 2023-09-17 11:48:27+0200, Willy Tarreau wrote: > > [..] > > > Maybe the macro-equivalent of this? > > > > > > static inline int __nolibc_enosys(...) > > > { > > > return -ENOSYS; > > > } > > > > > > The only-vararg function unfortunately needs C23 so we can't use it. > > > > > > It's clear to the users that this is about ENOSYS and we don't need a > > > bunch of new macros similar. > > > > I like it, I didn't think about varargs, it's an excellent idea! Let's > > just do simpler, start with a first arg "syscall_num" that we may later > > reuse for debugging, and just mark this one unused: > > > > static inline int __nolibc_enosys(int syscall_num, ...) > > { > > (void)syscall_num; > > return -ENOSYS; > > } > > But which syscall_num to use, as the point of __nolibc_enosys() would be > that no syscall number is available and the defines are missing. good point :-) > For debugging we could add a string argument, though. That works for me. Willy