Re: [PATCH 21/28] mlx5: Avoid gcc 5.4 warning -Wempty-body

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

 



On 9/14/2016 7:55 PM, Jason Gunthorpe wrote:
No compiler we support will leave behind a function call for an empty
static inline.

I just checked, the assembly is the same before/after modulo compiler
non-determinism. There are no extra function calls.

enum {
diff --git a/libmlx5/src/qp.c b/libmlx5/src/qp.c
index c805fcae4123..23270e50af7a 100644
+++ b/libmlx5/src/qp.c
@@ -356,9 +356,7 @@ static inline int copy_eth_inline_headers(struct ibv_qp *ibqp,
	int inl_hdr_size = MLX5_ETH_L2_INLINE_HEADER_SIZE;
	int inl_hdr_copy_size = 0;
	int j = 0;
-#ifdef MLX5_DEBUG
	FILE *fp = to_mctx(ibqp->context)->dbg_fp;
-#endif

This is data path flow, dropping the #ifdef may cause a redundant assignment
for 'fp' here.

Nope:

$ nm --size libmlx4-rdmv2.so
[before]
0000000000001637 t _mlx5_post_send
[after]
0000000000001637 t _mlx5_post_send

The compilers are very smart, you don't need to hand hold them.

Thanks for checking that, will take into our regression system to run on before formally taking.
--
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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux