Skip to contentSkip to conversation

mlx5 core: Fix __udivdi3 when compiling for 32 bit arches

PATCH In review Tim Gardner 3 participants 4 messages Jul 15, 2013 – Jul 16, 2013

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

PATCH 1/1 mlx5 core: Fix __udivdi3 when compiling for 32 bit arches

Cc Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/[email protected]>
---
 drivers/net/ethernet/mellanox/mlx5/core/debugfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +1 -1
index 4273c06..9c7194b 100644
@@ -156,7 +156,7 @@ static ssize_t average_read(struct file *filp, char __user *buf, size_t count,
 	stats = filp->private_data;
 	spin_lock(&stats->lock);
 	if (stats->n)
-		field = stats->sum / stats->n;
+		field = div64_u64(stats->sum, stats->n);
 	spin_unlock(&stats->lock);
 	ret = snprintf(tbuf, sizeof(tbuf), "%llu\n", field);
 	if (ret > 0) {
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Tim Gardner
Cc Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/[email protected]>

I reported this last week and Eli wrote:

"I have this fixed in my tree and we run the driver on i386. I will check on Sunday why it is not in the patches submitted."

Anyway, the patch works for me.

Thanks.

Quoted 18 lines
---
 drivers/net/ethernet/mellanox/mlx5/core/debugfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c +1 -1
index 4273c06..9c7194b 100644
@@ -156,7 +156,7 @@ static ssize_t average_read(struct file *filp, char __user *buf, size_t count,
 	stats = filp->private_data;
 	spin_lock(&stats->lock);
 	if (stats->n)
-		field = stats->sum / stats->n;
+		field = div64_u64(stats->sum, stats->n);
 	spin_unlock(&stats->lock);
 	ret = snprintf(tbuf, sizeof(tbuf), "%llu\n", field);
 	if (ret > 0) {
Signature · 5 lines
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 6 lines · Randy Dunlap
Quoted 2 lines · Tim Gardner

Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/[email protected]> Signed-off-by: Tim Gardner <[email protected]>

I reported this last week and Eli wrote:

Quoted 8 lines

"I have this fixed in my tree and we run the driver on i386. I will check on Sunday why it is not in the patches submitted."

Anyway, the patch works for me.

Dunlap <[email protected]>

I figured someone must have seen it, but a cursory Google search on "mlx5 __udivdi3" failed to turn up anything.

rtg

Signature · 5 lines
Tim Gardner [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#3 lore raw
In reply to Randy Dunlap

From: Randy Dunlap <[email protected]>
Date: Mon, 15 Jul 2013 08:52:18 -0700

Quoted 12 lines · Tim Gardner
Quoted 2 lines
Cc Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/[email protected]>

I reported this last week and Eli wrote:

"I have this fixed in my tree and we run the driver on i386. I will check on Sunday why it is not in the patches submitted."

Anyway, the patch works for me.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html