Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4236201rdb; Thu, 14 Sep 2023 16:42:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8g2x2tWrPtQsvZm9wvkq4t2dmdTN5uiR48MgQAFElUWwQ7aU3rAlNT909kW8lsaVChxyg X-Received: by 2002:a05:6358:45e:b0:141:c7c9:42ee with SMTP id 30-20020a056358045e00b00141c7c942eemr337601rwe.0.1694734944651; Thu, 14 Sep 2023 16:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694734944; cv=none; d=google.com; s=arc-20160816; b=F4ZwpBs+RIKDp4u9EoYtVVuNUTn6Qo9TYiOjQt7koKG+OmOot+ToDx1IXFVrvAsiQB XbhKFKFu4MfX1yDu6TAzJvZJ4C1/xhC3U2/cDSzPQlWdD9U+DOhAwHhJib0tu9wAh9Fx 5auLwyl5em7+LmrXQVKy3Tr7EZxcgT2PikP3lNYzR/lYvsCNl/RuM7TdXyySfYqwL3hK 4mgo/F5cewW/JjY7zgBDWSxzFFOlvk/6e8fl6aN4iAKuEkLLISFgXssjF8a4m+ZB3nJO 7wDrUsqh6EFhSuQFTmIwiooQREnEGGGZQB+yDZfRl8GofCQOHPwlwXnQtdAOk3381LIL zJkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=1JyR3SiVxwWb7dvLAewKEzYLq3P1HydneB5Caa8lTZQ=; fh=azYK+WW57en7GGRdjKWjQOHkHDsNRqF/+6hheqDI200=; b=NZvdLq4phwrKqfwKfxLvA5WKHTK7+k/xJRmzlqcRz3qLrR+nWYYChf+Q8q73qFlZ/3 UIEFpJdUE2FfC3BNJl+o0BYNji+WTt0Wye7GOkJJqSYQ54/izhlJCFndDR5pp7+IJLVU fRSrthzidBluourVu9SNRoyJEeYTKHVbDqD+j+JZUFJ5eePeJCb+wAKafsBPRpwbMy+9 nAo0ba2i14JxxNjQcW+fVlDYP182IBBd+a1xz+CKjAMsFc6XC1j+eDlsLijajomlI/QK 11RWsptSl5B2uPTkg/CStCVSWjlRDnho8qyPunfLFHdMCuNxtPTOhrPKYLzIREDEOVd4 Za/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=l0Q201ay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k24-20020a63ff18000000b00577f65baa3esi1799114pgi.775.2023.09.14.16.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 16:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=l0Q201ay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 067D58061378; Thu, 14 Sep 2023 09:02:20 -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 S241646AbjINQCV (ORCPT + 99 others); Thu, 14 Sep 2023 12:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241675AbjINQCA (ORCPT ); Thu, 14 Sep 2023 12:02:00 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 385682726; Thu, 14 Sep 2023 09:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1694707293; bh=rklkaKmuEop2mkqsY9+prLbWDx4KQ6pug1wWbwN/pUU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=l0Q201ayEAQrclQ0up4pYQXtSYdkzEK6uNrRoR2Ydz94iDRpFdRko733hWRKljKnX ek6mnVsHkN6wTlz9/mww7YXQUCAYev+O1cs3rkGQ/+0U4BHjqbkFa6enJpUr0UJXSr m4iTLUZQUUJE93+vAqr0qmdRE9D8GGyIxx+th+Tc= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 14 Sep 2023 18:01:18 +0200 Subject: [PATCH 2/4] tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230914-nolibc-syscall-nr-v1-2-e50df410da11@weissschuh.net> References: <20230914-nolibc-syscall-nr-v1-0-e50df410da11@weissschuh.net> In-Reply-To: <20230914-nolibc-syscall-nr-v1-0-e50df410da11@weissschuh.net> To: Willy Tarreau , Paul Walmsley , Palmer Dabbelt , Albert Ou , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694707292; l=3290; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=rklkaKmuEop2mkqsY9+prLbWDx4KQ6pug1wWbwN/pUU=; b=3ASFNj+C1ZmK459CmYHIr9/+BQymJpv0Mz8eFVb1MBFyHEdV/HJa8qwuKaUDzvCrAjBT06SAh 2EY0avaf7rvCgBGFJj+0E3x0xKlFz9hy/NC6XYAJ7QBGapHZ5vh9TUM X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= 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]); Thu, 14 Sep 2023 09:02:20 -0700 (PDT) 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 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index b478750c9004..bc56310c6bdf 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -133,6 +133,8 @@ int sys_chmod(const char *path, mode_t mode) #elif defined(__NR_chmod) return my_syscall2(__NR_chmod, path, mode); #else + (void)path; + (void)mode; return -ENOSYS; #endif } @@ -156,6 +158,9 @@ int sys_chown(const char *path, uid_t owner, gid_t group) #elif defined(__NR_chown) return my_syscall3(__NR_chown, path, owner, group); #else + (void)path; + (void)owner; + (void)group; return -ENOSYS; #endif } @@ -230,6 +235,8 @@ int sys_dup2(int old, int new) #elif defined(__NR_dup2) return my_syscall2(__NR_dup2, old, new); #else + (void)old; + (void)new; return -ENOSYS; #endif } @@ -486,6 +493,8 @@ int sys_gettimeofday(struct timeval *tv, struct timezone *tz) #ifdef __NR_gettimeofday return my_syscall2(__NR_gettimeofday, tv, tz); #else + (void)tv; + (void)tz; return -ENOSYS; #endif } @@ -563,6 +572,8 @@ int sys_link(const char *old, const char *new) #elif defined(__NR_link) return my_syscall2(__NR_link, old, new); #else + (void)old; + (void)new; return -ENOSYS; #endif } @@ -584,6 +595,9 @@ off_t sys_lseek(int fd, off_t offset, int whence) #ifdef __NR_lseek return my_syscall3(__NR_lseek, fd, offset, whence); #else + (void)fd; + (void)offset; + (void)whence; return -ENOSYS; #endif } @@ -607,6 +621,8 @@ int sys_mkdir(const char *path, mode_t mode) #elif defined(__NR_mkdir) return my_syscall2(__NR_mkdir, path, mode); #else + (void)path; + (void)mode; return -ENOSYS; #endif } @@ -629,6 +645,7 @@ int sys_rmdir(const char *path) #elif defined(__NR_unlinkat) return my_syscall3(__NR_unlinkat, AT_FDCWD, path, AT_REMOVEDIR); #else + (void)path; return -ENOSYS; #endif } @@ -652,6 +669,9 @@ long sys_mknod(const char *path, mode_t mode, dev_t dev) #elif defined(__NR_mknod) return my_syscall3(__NR_mknod, path, mode, dev); #else + (void)path; + (void)mode; + (void)dev; return -ENOSYS; #endif } @@ -742,6 +762,9 @@ int sys_open(const char *path, int flags, mode_t mode) #elif defined(__NR_open) return my_syscall3(__NR_open, path, flags, mode); #else + (void)path; + (void)flags; + (void)mode; return -ENOSYS; #endif } @@ -842,6 +865,9 @@ int sys_poll(struct pollfd *fds, int nfds, int timeout) #elif defined(__NR_poll) return my_syscall3(__NR_poll, fds, nfds, timeout); #else + (void)fds; + (void)nfds; + (void)timeout; return -ENOSYS; #endif } @@ -934,6 +960,11 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva #endif return my_syscall5(__NR__newselect, nfds, rfds, wfds, efds, timeout); #else + (void)nfds; + (void)rfds; + (void)wfds; + (void)efds; + (void)timeout; return -ENOSYS; #endif } -- 2.42.0