diff mbox

[1/3] infiniband: rxe: avoid 64-bit division

Message ID 1465822509-4167617-1-git-send-email-arnd@arndb.de (mailing list archive)
State Not Applicable
Headers show

Commit Message

Arnd Bergmann June 13, 2016, 12:54 p.m. UTC
The rxe driver fails to build on 32-bit because of a 64-bit division:

In function `rxe_qp_from_attr':
:(.text+0x53158): undefined reference to `__aeabi_uldivmod'

We can easily avoid this division by converting the nanosecond value
into jiffies directly rather than converting to microseconds first.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/infiniband/hw/rxe/rxe_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leon Romanovsky June 13, 2016, 1:18 p.m. UTC | #1
On Mon, Jun 13, 2016 at 02:54:53PM +0200, Arnd Bergmann wrote:
> The rxe driver fails to build on 32-bit because of a 64-bit division:
> 
> In function `rxe_qp_from_attr':
> :(.text+0x53158): undefined reference to `__aeabi_uldivmod'
> 
> We can easily avoid this division by converting the nanosecond value
> into jiffies directly rather than converting to microseconds first.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks Arnd,
All three patches are applied on topic/rxe now.
Moni Shoua June 13, 2016, 3:27 p.m. UTC | #2
thanks. will be applied to next series

On Mon, Jun 13, 2016 at 4:18 PM, Leon Romanovsky <leon@kernel.org> wrote:
> On Mon, Jun 13, 2016 at 02:54:53PM +0200, Arnd Bergmann wrote:
>> The rxe driver fails to build on 32-bit because of a 64-bit division:
>>
>> In function `rxe_qp_from_attr':
>> :(.text+0x53158): undefined reference to `__aeabi_uldivmod'
>>
>> We can easily avoid this division by converting the nanosecond value
>> into jiffies directly rather than converting to microseconds first.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Thanks Arnd,
> All three patches are applied on topic/rxe now.
--
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/infiniband/hw/rxe/rxe_qp.c b/drivers/infiniband/hw/rxe/rxe_qp.c
index aa11ac3032b2..4e7b0985aab8 100644
--- a/drivers/infiniband/hw/rxe/rxe_qp.c
+++ b/drivers/infiniband/hw/rxe/rxe_qp.c
@@ -664,7 +664,7 @@  int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask,
 			qp->qp_timeout_jiffies = 0;
 		} else {
 			/* According to the spec, timeout = 4.096 * 2 ^ attr->timeout [us] */
-			int j = usecs_to_jiffies((4096ULL << attr->timeout) / 1000);
+			int j = nsecs_to_jiffies(4096ULL << attr->timeout);
 
 			qp->qp_timeout_jiffies = j ? j : 1;
 		}