diff mbox

iw_cxgb4: fix for 64-bit integer division

Message ID 1405616463-23156-1-git-send-email-hariprasad@chelsio.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Hariprasad Shenai July 17, 2014, 5:01 p.m. UTC
Fixed error introduced in commit id 7730b4c (" cxgb4/iw_cxgb4: work request
logging feature") while compiling on 32 bit architecture reported by kbuild.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Sergei Shtylyov July 17, 2014, 6:44 p.m. UTC | #1
Hello.

On 07/17/2014 09:01 PM, Hariprasad Shenai wrote:

> Fixed error introduced in commit id 7730b4c (" cxgb4/iw_cxgb4: work request
> logging feature") while compiling on 32 bit architecture reported by kbuild.

> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
> ---
>   drivers/infiniband/hw/cxgb4/device.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)

> diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
> index df1f1b5..bb0de61 100644
> --- a/drivers/infiniband/hw/cxgb4/device.c
> +++ b/drivers/infiniband/hw/cxgb4/device.c
[...]
> @@ -150,7 +151,7 @@ static int wr_log_show(struct seq_file *seq, void *v)
>   	int prev_ts_set = 0;
>   	int idx, end;
>
> -#define ts2ns(ts) ((ts) * dev->rdev.lldi.cclk_ps / 1000)
> +#define ts2ns(ts) div64_ul((ts) * dev->rdev.lldi.cclk_ps , 1000)

    Don't need space before comma.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller July 17, 2014, 11:52 p.m. UTC | #2
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 17 Jul 2014 22:44:42 +0400

> Hello.
> 
> On 07/17/2014 09:01 PM, Hariprasad Shenai wrote:
> 
>> Fixed error introduced in commit id 7730b4c (" cxgb4/iw_cxgb4: work
>> request
>> logging feature") while compiling on 32 bit architecture reported by
>> kbuild.
> 
>> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
>> ---
>>   drivers/infiniband/hw/cxgb4/device.c |    3 ++-
>>   1 files changed, 2 insertions(+), 1 deletions(-)
> 
>> diff --git a/drivers/infiniband/hw/cxgb4/device.c
>> b/drivers/infiniband/hw/cxgb4/device.c
>> index df1f1b5..bb0de61 100644
>> --- a/drivers/infiniband/hw/cxgb4/device.c
>> +++ b/drivers/infiniband/hw/cxgb4/device.c
> [...]
>> @@ -150,7 +151,7 @@ static int wr_log_show(struct seq_file *seq, void
>> *v)
>>   	int prev_ts_set = 0;
>>   	int idx, end;
>>
>> -#define ts2ns(ts) ((ts) * dev->rdev.lldi.cclk_ps / 1000)
>> +#define ts2ns(ts) div64_ul((ts) * dev->rdev.lldi.cclk_ps , 1000)
> 
>    Don't need space before comma.

I killed the space when applying this patch, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index df1f1b5..bb0de61 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -33,6 +33,7 @@ 
 #include <linux/moduleparam.h>
 #include <linux/debugfs.h>
 #include <linux/vmalloc.h>
+#include <linux/math64.h>
 
 #include <rdma/ib_verbs.h>
 
@@ -150,7 +151,7 @@  static int wr_log_show(struct seq_file *seq, void *v)
 	int prev_ts_set = 0;
 	int idx, end;
 
-#define ts2ns(ts) ((ts) * dev->rdev.lldi.cclk_ps / 1000)
+#define ts2ns(ts) div64_ul((ts) * dev->rdev.lldi.cclk_ps , 1000)
 
 	idx = atomic_read(&dev->rdev.wr_log_idx) &
 		(dev->rdev.wr_log_size - 1);