opnsense-src/sys/dev/netmap
Alex Richardson daedb8bb36 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

(cherry picked from commit 2ed21f90906b230476d3f12ff9dce0e2c4642af2)
2026-06-02 07:26:00 +02:00
..
if_ptnet.c vtnet, ptnet: include opt_*.h files early 2025-09-08 10:25:23 +02:00
if_re_netmap.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
if_vtnet_netmap.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
netmap.c netmap: Make memory pools NUMA-aware 2024-10-28 16:39:50 +00:00
netmap_bdg.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
netmap_bdg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
netmap_freebsd.c netmap: Drain selinfo sleepers in nm_os_selinfo_uninit() 2026-05-21 07:32:51 +02:00
netmap_generic.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
netmap_kern.h netmap: Make memory pools NUMA-aware 2024-10-28 16:39:50 +00:00
netmap_kloop.c netmap: silence -Wdefault-const-init-field-unsafe warning 2026-06-02 07:26:00 +02:00
netmap_legacy.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
netmap_mbq.c sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
netmap_mbq.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
netmap_mem2.c netmap: Let memory allocator parameters be settable via loader.conf 2026-01-10 08:57:40 +01:00
netmap_mem2.h netmap: Make memory pools NUMA-aware 2024-10-28 16:39:50 +00:00
netmap_monitor.c sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
netmap_null.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
netmap_offloadings.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
netmap_pipe.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
netmap_vale.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00