summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-08-14 20:37:49 -0700
committerJakub Kicinski <kuba@kernel.org>2024-08-14 20:37:50 -0700
commita9c60712d71ff07197b2982899b9db28ed548ded (patch)
tree8e64940553b079df86e17237a30c4cebc9c3620a
parent35c9ffba80a8539f57a0cb1515e376dfb8058a23 (diff)
parent6c5cdabb3ec325f1846dad72f520814bbda79dca (diff)
Merge branch 'uapi-net-sched-cxgb4-fix-wflex-array-member-not-at-end-warning'
Gustavo A. R. Silva says: ==================== UAPI: net/sched - cxgb4: Fix -Wflex-array-member-not-at-end warning Small patch series aimed at fixing a -Wflex-array-member-not-at-end warning by creating a new tagged struct within a flexible structure. We then use this new struct type to fix a problematic middle-flex-array declaration in a composite struct. ==================== Link: https://patch.msgid.link/cover.1723586870.git.gustavoars@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h2
-rw-r--r--include/uapi/linux/pkt_cls.h23
2 files changed, 14 insertions, 11 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h
index 9050568a034c..64663112cad8 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_u32_parse.h
@@ -242,7 +242,7 @@ struct cxgb4_next_header {
* field's value to jump to next header such as IHL field
* in IPv4 header.
*/
- struct tc_u32_sel sel;
+ struct tc_u32_sel_hdr sel;
struct tc_u32_key key;
/* location of jump to make */
const struct cxgb4_match_field *jump;
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index d36d9cdf0c00..2c32080416b5 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -246,16 +246,19 @@ struct tc_u32_key {
};
struct tc_u32_sel {
- unsigned char flags;
- unsigned char offshift;
- unsigned char nkeys;
-
- __be16 offmask;
- __u16 off;
- short offoff;
-
- short hoff;
- __be32 hmask;
+ /* New members MUST be added within the __struct_group() macro below. */
+ __struct_group(tc_u32_sel_hdr, hdr, /* no attrs */,
+ unsigned char flags;
+ unsigned char offshift;
+ unsigned char nkeys;
+
+ __be16 offmask;
+ __u16 off;
+ short offoff;
+
+ short hoff;
+ __be32 hmask;
+ );
struct tc_u32_key keys[];
};