lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1465822509-4167617-1-git-send-email-arnd@arndb.de>
Date:	Mon, 13 Jun 2016 14:54:53 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Leon Romanovsky <leon@...nel.org>
Cc:	netdev@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
	Moni Shoua <monis@...lanox.com>,
	Doug Ledford <dledford@...hat.com>,
	Sean Hefty <sean.hefty@...el.com>,
	Hal Rosenstock <hal.rosenstock@...il.com>,
	Amir Vadai <amirv@...lanox.com>,
	Kamal Heib <kamalh@...lanox.com>, linux-rdma@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] infiniband: rxe: avoid 64-bit division

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@...db.de>
---
 drivers/infiniband/hw/rxe/rxe_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 		}
-- 
2.7.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ