Re: [patch 1/1] drivers/infiniband/core/verbs.c: fix build with gcc-4.4.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2018-03-13 at 14:51 -0700, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> 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?

> 
> 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 <bart.vanassche@xxxxxxx>
> Cc: Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx>
> Cc: Sagi Grimberg <sagi@xxxxxxxxxxx>
> Cc: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> ---
> 
>  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
> --- a/drivers/infiniband/core/verbs.c~drivers-infiniband-core-verbsc-fix-build-with-gcc-444
> +++ a/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;
> _
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Doug Ledford <dledford@xxxxxxxxxx>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]