diff mbox

[3.11-rc1] mlx5 core: Fix __udivdi3 when compiling for 32 bit arches

Message ID 1373900205-69711-1-git-send-email-tim.gardner@canonical.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Tim Gardner July 15, 2013, 2:56 p.m. UTC
Cc: Eli Cohen <eli@mellanox.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/debugfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Randy Dunlap July 15, 2013, 3:52 p.m. UTC | #1
On 07/15/13 07:56, Tim Gardner wrote:
> Cc: Eli Cohen <eli@mellanox.com>
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

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.

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
>  drivers/net/ethernet/mellanox/mlx5/core/debugfs.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
> index 4273c06..9c7194b 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
> @@ -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) {
>
Tim Gardner July 15, 2013, 8:23 p.m. UTC | #2
On 07/15/2013 09:52 AM, Randy Dunlap wrote:
> On 07/15/13 07:56, Tim Gardner wrote:
>> Cc: Eli Cohen <eli@mellanox.com> Signed-off-by: Tim Gardner
>> <tim.gardner@canonical.com>
> 
> 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.
> 
> Acked-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: Randy
> Dunlap <rdunlap@infradead.org>
> 

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

rtg
David Miller July 16, 2013, 7:36 p.m. UTC | #3
From: Randy Dunlap <rdunlap@infradead.org>
Date: Mon, 15 Jul 2013 08:52:18 -0700

> On 07/15/13 07:56, Tim Gardner wrote:
>> Cc: Eli Cohen <eli@mellanox.com>
>> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> 
> 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.
> 
> Acked-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>

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

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
index 4273c06..9c7194b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
@@ -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) {