1
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
1
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
2
getting ready to enable it, globally.
2
getting ready to enable it, globally.
3
3
4
Move the conflicting declaration to the end of the structure. Notice
4
Remove unused flex-array member `class_data` from
5
that `struct opa_mad_notice_attr` is a flexible structure --a structure
5
`struct opa_mad_notice_attr`.
6
that contains a flexible-array member.
7
6
8
Fix the following warning:
7
Fix the following warning:
9
8
10
drivers/infiniband/hw/hfi1/mad.c:23:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
9
drivers/infiniband/hw/hfi1/mad.c:23:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
11
10
12
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
11
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
13
---
12
---
14
drivers/infiniband/hw/hfi1/mad.c | 4 +++-
13
Changes in v2:
15
1 file changed, 3 insertions(+), 1 deletion(-)
14
- Remove unused flexible array. (Jason)
16
15
17
diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c
16
v1:
17
- Link: https://lore.kernel.org/linux-hardening/Z-WgwsCYIXaBxnvs@kspp/
18
19
drivers/infiniband/hw/hfi1/mad.h | 1 -
20
1 file changed, 1 deletion(-)
21
22
diff --git a/drivers/infiniband/hw/hfi1/mad.h b/drivers/infiniband/hw/hfi1/mad.h
18
index XXXXXXX..XXXXXXX 100644
23
index XXXXXXX..XXXXXXX 100644
19
--- a/drivers/infiniband/hw/hfi1/mad.c
24
--- a/drivers/infiniband/hw/hfi1/mad.h
20
+++ b/drivers/infiniband/hw/hfi1/mad.c
25
+++ b/drivers/infiniband/hw/hfi1/mad.h
21
@@ -XXX,XX +XXX,XX @@
26
@@ -XXX,XX +XXX,XX @@ struct opa_mad_notice_attr {
22
27
        } __packed ntc_2048;
23
struct trap_node {
28
24
    struct list_head list;
29
    };
25
-    struct opa_mad_notice_attr data;
30
-    u8    class_data[];
26
    __be64 tid;
27
    int len;
28
    u32 retry;
29
    u8 in_use;
30
    u8 repress;
31
+
32
+    /* Must be last --ends in a flexible-array member. */
33
+    struct opa_mad_notice_attr data;
34
};
31
};
35
32
36
static int smp_length_check(u32 data_size, u32 request_len)
33
#define IB_VLARB_LOWPRI_0_31 1
37
--
34
--
38
2.43.0
35
2.43.0
diff view generated by jsdifflib