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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4735D1A63D for ; Fri, 9 Jan 2026 21:42:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1veKFQ-0007Oo-Kx; Fri, 09 Jan 2026 16:42:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1veKFN-0007OR-3J for qemu-devel@nongnu.org; Fri, 09 Jan 2026 16:42:18 -0500 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1veKFK-0005hX-Ut for qemu-devel@nongnu.org; Fri, 09 Jan 2026 16:42:16 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 327A417C4A0 for ; Sat, 10 Jan 2026 00:40:59 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 9D8CB348DB1; Sat, 10 Jan 2026 00:42:01 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: Michael Tokarev Subject: [PATCH 0/3] linux-user/syscall.c: consolidate statfs syscalls Date: Sat, 10 Jan 2026 00:41:50 +0300 Message-ID: <20260109214158.726916-1-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Here's some cleanup for linux-user/syscall.c with an RFC. It drops common ("global") `struct statfs` from syscall1() function and eliminates an ugly goto into another case label. The RFC is for the 3rd patch, which replaces two blocks of the smae code for statfs & statfs64 (which only differ in the 64 suffix) with a common macro. This way there's a single implementation of the code, so we avoid code duplication, but the usage of the C preprocessor this way makes the code a bit more ugly. What do you think about this approach? Using it, a lot of code in there can be eliminated. Michael Tokarev (3): linux-user/syscall.c: statfs: f_flags is always present linux-user/syscall.c: consolidate statfs calls linux-user/syscall.c: consolidate statfs calls further linux-user/syscall.c | 114 +++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 75 deletions(-) -- 2.47.3