Skip to contentSkip to conversation

RDMA/mlx5: Fix -Wformat warning in check_ucmd_data()

PATCH Applied Tom Seewald 3 participants 3 messages Jun 5, 2020 – Jun 15, 2020

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

PATCH 1/1 RDMA/mlx5: Fix -Wformat warning in check_ucmd_data()

Variables of type size_t should use %zu rather than %lu [1]. The variables "inlen", "ucmd", "last", and "size" are all size_t, so use the correct format specifiers.

[1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html

---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +1 -1
index 81bf6b975e0e..e51b39632605 100644
@@ -2907,7 +2907,7 @@ static int check_ucmd_data(struct mlx5_ib_dev *dev,
 	if (!ret)
 		mlx5_ib_dbg(
 			dev,
-			"udata is not cleared, inlen = %lu, ucmd = %lu, last = %lu, size = %lu\n",
+			"udata is not cleared, inlen = %zu, ucmd = %zu, last = %zu, size = %zu\n",
 			udata->inlen, params->ucmd_size, last, size);
 	return ret ? 0 : -EINVAL;
 }
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Tom Seewald

Variables of type size_t should use %zu rather than %lu [1]. The variables "inlen", "ucmd", "last", and "size" are all size_t, so use the correct format specifiers.

[1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html

---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,

#2 lore raw
In reply to Tom Seewald
Quoted 11 lines · Tom Seewald

Variables of type size_t should use %zu rather than %lu [1]. The variables "inlen", "ucmd", "last", and "size" are all size_t, so use the correct format specifiers.

[1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html

---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc with a Fixes line

Thanks,
Jason