Skip to contentSkip to conversation

drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4

PATCH In review [email protected] 2 participants 5 messages Mar 13, 2018 – Mar 14, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4

From: Andrew Morton <[email protected]>
Subject: drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4

gcc-4.4.4 has issues with initialization of anonymous unions.

drivers/infiniband/core/verbs.c: In function '__ib_drain_sq':
drivers/infiniband/core/verbs.c:2204: error: unknown field 'wr_cqe' specified in initializer drivers/infiniband/core/verbs.c:2204: warning: initialization makes integer from pointer without a cast

Work around this.

Fixes a1ae7d0345edd5 ("RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access")
Cc Bart Van Assche <[email protected]>
Cc Steve Wise <[email protected]>
Cc Sagi Grimberg <[email protected]>
Cc Jason Gunthorpe <[email protected]>

---

 drivers/infiniband/core/verbs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/verbs.c renamed from drivers/infiniband/core/verbs.c~drivers-infiniband-core-verbsc-fix-build-with-gcc-444 +2 -1
diff -puN drivers/infiniband/core/verbs.c~drivers-infiniband-core-verbsc-fix-build-with-gcc-444 drivers/infiniband/core/verbs.c
@@ -2200,8 +2200,9 @@ static void __ib_drain_sq(struct ib_qp *
 	struct ib_send_wr *bad_swr;
 	struct ib_rdma_wr swr = {
 		.wr = {
+			.next = NULL,
+			{ .wr_cqe	= &sdrain.cqe, },
 			.opcode	= IB_WR_RDMA_WRITE,
-			.wr_cqe	= &sdrain.cqe,
 		},
 	};
 	int ret;

_

#1 lore raw
Quoted 4 lines · On Tue, 2018-03-13 at 14:51 -0700, [email protected] wrote:

From: Andrew Morton <[email protected]>
Subject: drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4

gcc-4.4.4 has issues with initialization of anonymous unions.

That compiler was released in April of 2010, almost a full 8 years ago. What still uses it, and do we seriously care?

Quoted 38 lines

drivers/infiniband/core/verbs.c: In function '__ib_drain_sq':
drivers/infiniband/core/verbs.c:2204: error: unknown field 'wr_cqe' specified in initializer drivers/infiniband/core/verbs.c:2204: warning: initialization makes integer from pointer without a cast

Work around this.

Fixes a1ae7d0345edd5 ("RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access")
Cc Bart Van Assche <[email protected]>
Cc Steve Wise <[email protected]>
Cc Sagi Grimberg <[email protected]>
Cc Jason Gunthorpe <[email protected]>

---

 drivers/infiniband/core/verbs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/infiniband/core/verbs.c~drivers-infiniband-core-verbsc-fix-build-with-gcc-444 drivers/infiniband/core/verbs.c

drivers/infiniband/core/verbs.c renamed from drivers/infiniband/core/verbs.c~drivers-infiniband-core-verbsc-fix-build-with-gcc-444 +2 -1
@@ -2200,8 +2200,9 @@ static void __ib_drain_sq(struct ib_qp *
 	struct ib_send_wr *bad_swr;
 	struct ib_rdma_wr swr = {
 		.wr = {
+			.next = NULL,
+			{ .wr_cqe	= &sdrain.cqe, },
 			.opcode	= IB_WR_RDMA_WRITE,
-			.wr_cqe	= &sdrain.cqe,
 		},
 	};
 	int ret;

_
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD
#2 lore raw
Quoted 8 lines · On Wed, 14 Mar 2018 16:41:00 -0400 Doug Ledford <[email protected]> wrote:
Quoted 4 lines · On Tue, 2018-03-13 at 14:51 -0700, [email protected] wrote:

From: Andrew Morton <[email protected]>
Subject: drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4

gcc-4.4.4 has issues with initialization of anonymous unions.

That compiler was released in April of 2010, almost a full 8 years ago. What still uses it, and do we seriously care?

Documentation/Changes still says gcc-3.2. A few people are using the older versions. There's talk going around about requiring something more recent but nothing has happened yet.

#3 lore raw
Quoted 6 lines · Andrew Morton
Quoted 4 lines · On Wed, 14 Mar 2018 16:41:00 -0400 Doug Ledford <[email protected]> wrote:
Quoted 3 lines · On Tue, 2018-03-13 at 14:51 -0700, [email protected] wrote:

From: Andrew Morton <[email protected]>
Subject: drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

gcc-4.4.4 has issues with initialization of anonymous unions.

That compiler was released in April of 2010, almost a full 8 years ago. What still uses it, and do we seriously care?

Documentation/Changes still says gcc-3.2. A few people are using the older versions. There's talk going around about requiring something more recent but nothing has happened yet.

OK, count this as a grumble about the outdated compiler requirement :-/. The code this patches looks nice and clean, this patch uglies it up.

Signature · 3 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD
#4 lore raw
Quoted 12 lines · Doug Ledford
Quoted 11 lines · Andrew Morton
Quoted 8 lines · On Wed, 14 Mar 2018 16:41:00 -0400 Doug Ledford <[email protected]> wrote:
Quoted 4 lines · On Tue, 2018-03-13 at 14:51 -0700, [email protected] wrote:

From: Andrew Morton <[email protected]>
Subject: drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4

gcc-4.4.4 has issues with initialization of anonymous unions.

That compiler was released in April of 2010, almost a full 8 years ago. What still uses it, and do we seriously care?

Quoted 7 lines
Quoted 3 lines

Documentation/Changes still says gcc-3.2. A few people are using the older versions. There's talk going around about requiring something more recent but nothing has happened yet.

OK, count this as a grumble about the outdated compiler requirement :-/. The code this patches looks nice and clean, this patch uglies it up.

If it wasn't obvious BTW, this and the other patch you sent have been applied to for-next area, begrudgingly ;-)

Signature · 3 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD