Skip to contentSkip to conversation

Patch "mlx5: avoid build warnings on 32-bit" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message May 3, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mlx5: avoid build warnings on 32-bit

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mlx5-avoid-build-warnings-on-32-bit.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 065bd8c28ba37d04c9a5b732173c1508954b1f58 Mon Sep 17 00:00:00 2001

From: Arnd Bergmann <[email protected]>
Date: Tue, 13 Jan 2015 17:08:06 +0100
Subject: mlx5: avoid build warnings on 32-bit

From: Arnd Bergmann <[email protected]>

commit 065bd8c28ba37d04c9a5b732173c1508954b1f58 upstream.

The mlx5 driver passes a string pointer in through a 'u64' variable, which on 32-bit machines causes a build warning:

drivers/net/ethernet/mellanox/mlx5/core/debugfs.c: In function 'qp_read_field':
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:303:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

The code is in fact safe, so we can shut up the warning by adding extra type casts.

---
 drivers/net/ethernet/mellanox/mlx5/core/debugfs.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +3 -3
@@ -300,11 +300,11 @@ static u64 qp_read_field(struct mlx5_cor
 		param = qp->pid;
 		break;
 	case QP_STATE:
-		param = (u64)mlx5_qp_state_str(be32_to_cpu(ctx->flags) >> 28);
+		param = (unsigned long)mlx5_qp_state_str(be32_to_cpu(ctx->flags) >> 28);
 		*is_str = 1;
 		break;
 	case QP_XPORT:
-		param = (u64)mlx5_qp_type_str((be32_to_cpu(ctx->flags) >> 16) & 0xff);
+		param = (unsigned long)mlx5_qp_type_str((be32_to_cpu(ctx->flags) >> 16) & 0xff);
 		*is_str = 1;
 		break;
 	case QP_MTU:
@@ -464,7 +464,7 @@ static ssize_t dbg_read(struct file *fil
 
 
 	if (is_str)
-		ret = snprintf(tbuf, sizeof(tbuf), "%s\n", (const char *)field);
+		ret = snprintf(tbuf, sizeof(tbuf), "%s\n", (const char *)(unsigned long)field);
 	else
 		ret = snprintf(tbuf, sizeof(tbuf), "0x%llx\n", field);
 

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/ib-iser-fix-sparse-warnings.patch queue-3.18/cred-userns-define-current_user_ns-as-a-function.patch queue-3.18/pci-xilinx-fix-harmless-format-string-warning.patch queue-3.18/alsa-ppc-awacs-shut-up-maybe-uninitialized-warning.patch queue-3.18/net-tg3-avoid-uninitialized-variable-warning.patch queue-3.18/mtd-avoid-stack-overflow-in-mtd-cfi-code.patch queue-3.18/powerpc-ptrace-fix-out-of-bounds-array-access-warning.patch queue-3.18/mlx5-avoid-build-warnings-on-32-bit.patch queue-3.18/drbd-avoid-redefinition-of-bits_per_page.patch