mellanox: mlxsw: Use '%zx' to print size_t format

This change “mellanox: mlxsw: Use ‘%zx’ to print size_t format” in Linux kernel is authored by Fabio Estevam <fabio.estevam [at]> on Mon Aug 10 09:54:28 2015 -0300.

mellanox: mlxsw: Use '%zx' to print size_t format

Use '%zx' to print size_t format in order to fix the following build warning:

drivers/net/ethernet/mellanox/mlxsw/item.h:65:3: warning: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' [-Wformat=]

Signed-off-by: Fabio Estevam <>
Acked-by: Jiri Pirko <>
Signed-off-by: David S. Miller <>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit ed8db18.

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/net/ethernet/mellanox/mlxsw/item.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/item.h b/drivers/net/ethernet/mellanox/mlxsw/item.h
index 4d0ac88..ffd55d0 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/item.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/item.h
@@ -62,7 +62,7 @@ struct mlxsw_item {
 	if (item->offset % typesize != 0 ||
 	    item->step % typesize != 0 ||
 	    item->in_step_offset % typesize != 0) {
-		pr_err("mlxsw: item bug (name=%s,offset=%x,step=%x,in_step_offset=%x,typesize=%lx)n",
+		pr_err("mlxsw: item bug (name=%s,offset=%x,step=%x,in_step_offset=%x,typesize=%zx)n",
 		       item->name, item->offset, item->step,
 		       item->in_step_offset, typesize);

The commit for this change in Linux stable tree is ed8db18 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *