diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2024-08-09 17:22:12 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-08-13 02:54:24 +0200 |
commit | e2d0fadd703c3a3a6ebe318ec82ea64c08d709c2 (patch) | |
tree | 7a3527b0b320497a38c5357be27a9564dd87b8e4 /net/sched | |
parent | Merge branch 'net-nexthop-increase-weight-to-u16' (diff) | |
download | linux-e2d0fadd703c3a3a6ebe318ec82ea64c08d709c2.tar.xz linux-e2d0fadd703c3a3a6ebe318ec82ea64c08d709c2.zip |
sched: act_ct: avoid -Wflex-array-member-not-at-end warning
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.
Remove unnecessary flex-array member `pad[]` and refactor the related
code a bit.
Fix the following warning:
net/sched/act_ct.c:57:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://patch.msgid.link/ZrY0JMVsImbDbx6r@cute
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/act_ct.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 3ba8e7e739b5..2197eb625658 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -44,8 +44,6 @@ static DEFINE_MUTEX(zones_mutex); struct zones_ht_key { struct net *net; u16 zone; - /* Note : pad[] must be the last field. */ - u8 pad[]; }; struct tcf_ct_flow_table { @@ -62,7 +60,7 @@ struct tcf_ct_flow_table { static const struct rhashtable_params zones_params = { .head_offset = offsetof(struct tcf_ct_flow_table, node), .key_offset = offsetof(struct tcf_ct_flow_table, key), - .key_len = offsetof(struct zones_ht_key, pad), + .key_len = offsetofend(struct zones_ht_key, zone), .automatic_shrinking = true, }; |