1From dcc5033eb17003d078525e146e2a4fec29f71f84 Mon Sep 17 00:00:00 2001
2From: Michael Forney <mforney@mforney.org>
3Date: Wed, 1 Apr 2026 21:37:21 -0700
4Subject: [PATCH] Use C23 syntax for packed attribute and alignment
5
6---
7 include/linux-private/linux/gen_stats.h | 4 ++--
8 include/linux-private/linux/if_ether.h | 4 ++--
9 include/linux-private/linux/socket.h | 3 ++-
10 3 files changed, 6 insertions(+), 5 deletions(-)
11
12diff --git a/include/linux-private/linux/gen_stats.h b/include/linux-private/linux/gen_stats.h
13index 24a861c0..f2e3d45e 100644
14--- a/include/linux-private/linux/gen_stats.h
15+++ b/include/linux-private/linux/gen_stats.h
16@@ -25,10 +25,10 @@ struct gnet_stats_basic {
17 __u64 bytes;
18 __u32 packets;
19 };
20-struct gnet_stats_basic_packed {
21+struct [[gnu::packed]] gnet_stats_basic_packed {
22 __u64 bytes;
23 __u32 packets;
24-} __attribute__ ((packed));
25+};
26
27 /**
28 * struct gnet_stats_rate_est - rate estimator
29diff --git a/include/linux-private/linux/if_ether.h b/include/linux-private/linux/if_ether.h
30index 8c36f63e..8887d042 100644
31--- a/include/linux-private/linux/if_ether.h
32+++ b/include/linux-private/linux/if_ether.h
33@@ -158,11 +158,11 @@
34 #endif
35
36 #if __UAPI_DEF_ETHHDR
37-struct ethhdr {
38+struct [[gnu::packed]] ethhdr {
39 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
40 unsigned char h_source[ETH_ALEN]; /* source ether addr */
41 __be16 h_proto; /* packet type ID field */
42-} __attribute__((packed));
43+};
44 #endif
45
46
47diff --git a/include/linux-private/linux/socket.h b/include/linux-private/linux/socket.h
48index 268b9482..93a7b713 100644
49--- a/include/linux-private/linux/socket.h
50+++ b/include/linux-private/linux/socket.h
51@@ -12,11 +12,12 @@
52 typedef unsigned short __kernel_sa_family_t;
53
54 struct __kernel_sockaddr_storage {
55+ _Alignas(_K_SS_ALIGNSIZE) /* force desired alignment */
56 __kernel_sa_family_t ss_family; /* address family */
57 /* Following field(s) are implementation specific */
58 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
59 /* space to achieve desired size, */
60 /* _SS_MAXSIZE value minus size of ss_family */
61-} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
62+};
63
64 #endif /* _LINUX_SOCKET_H */
65--
662.49.0
67