iTsy2HYcnZB3znzaieY46Zjv9pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765916565; a=rsa-sha256; cv=none; b=D6WC+pRWmaHgFGKE3bmf9/DWl1QIgIbT6dPnnJf7RMSVxXru75wTQmtiq+huiDETvgLqXa 7/M6TDh4qDweQL5eTVgycKm6brLyufwTJnYMoUe3SaK7nu9dDN0/7885KopLSBNagOcXqx U8Mr+pmY0gTacOPKEMRyNVvXR1e13HAP8WQNpGipED+F2nG1zw1srmAFo2RFvkvmntSUDT kwwpblI8keQEIIaS6OmhB7/zGnAbXNwUBAhf9MLCCA2con7IfywySsSBItifJRFyt871Om bAo2jKyPhAIdLGYegCFkQw++I2UnwKMDNVzq1hnvAt1TuzOufP1KyjkbHbu+bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dW7dx3YKvz65c for ; Tue, 16 Dec 2025 20:22:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37c10 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 20:22:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 2ed21f90906b - main - netmap: silence -Wdefault-const-init-field-unsafe warning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ed21f90906b230476d3f12ff9dce0e2c4642af2 Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 20:22:45 +0000 Message-Id: <6941bf95.37c10.4da4ae17@gitrepo.freebsd.org> The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2ed21f90906b230476d3f12ff9dce0e2c4642af2 commit 2ed21f90906b230476d3f12ff9dce0e2c4642af2 Author: Alex Richardson AuthorDate: 2025-12-16 18:09:57 +0000 Commit: Alex Richardson CommitDate: 2025-12-16 20:21:45 +0000 netmap: silence -Wdefault-const-init-field-unsafe warning The netmap_ring struct starts with various const members and rencent clang warns about leaving them uninitialized. Having them const in the first place is highly suspicious since they are updated with various macros but using hand-coded __DECONST(). But fixing that is a more invasive change that I am unable to test. ``` .../freebsd/sys/dev/netmap/netmap_kloop.c:320:21: error: default initialization of an object of type 'struct netmap_ring' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe] 320 | struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */ | ^ .../freebsd/sys/net/netmap.h:290:16: note: member 'buf_ofs' declared 'const' here 290 | const int64_t buf_ofs; | ^ ``` Test Plan: Compiles Reviewed by: vmaffione, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52568 --- sys/dev/netmap/netmap_kloop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/netmap/netmap_kloop.c b/sys/dev/netmap/netmap_kloop.c index ba9e67076e72..ac3ca2d8d21f 100644 --- a/sys/dev/netmap/netmap_kloop.c +++ b/sys/dev/netmap/netmap_kloop.c @@ -161,7 +161,8 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring_args *a) struct netmap_kring *kring = a->kring; struct nm_csb_atok *csb_atok = a->csb_atok; struct nm_csb_ktoa *csb_ktoa = a->csb_ktoa; - struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */ + /* shadow copy of the netmap_ring */ + struct netmap_ring shadow_ring = {0}; #ifdef SYNC_KLOOP_POLL bool more_txspace = false; #endif /* SYNC_KLOOP_POLL */ @@ -317,7 +318,8 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring_args *a) struct netmap_kring *kring = a->kring; struct nm_csb_atok *csb_atok = a->csb_atok; struct nm_csb_ktoa *csb_ktoa = a->csb_ktoa; - struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */ + /* shadow copy of the netmap_ring */ + struct netmap_ring shadow_ring = {0}; int dry_cycles = 0; #ifdef SYNC_KLOOP_POLL bool some_recvd = false;