From patchwork Mon Jun 13 12:54:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9172881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33C3A6075D for ; Mon, 13 Jun 2016 12:54:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24D4221C9A for ; Mon, 13 Jun 2016 12:54:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16EA426861; Mon, 13 Jun 2016 12:54:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A625E21C9A for ; Mon, 13 Jun 2016 12:54:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423189AbcFMMyF (ORCPT ); Mon, 13 Jun 2016 08:54:05 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:55263 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422747AbcFMMyE (ORCPT ); Mon, 13 Jun 2016 08:54:04 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LfikE-1bn7uP0gnq-00pPAj; Mon, 13 Jun 2016 14:53:43 +0200 From: Arnd Bergmann To: Leon Romanovsky Cc: netdev@vger.kernel.org, Arnd Bergmann , Moni Shoua , Doug Ledford , Sean Hefty , Hal Rosenstock , Amir Vadai , Kamal Heib , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] infiniband: rxe: avoid 64-bit division Date: Mon, 13 Jun 2016 14:54:53 +0200 Message-Id: <1465822509-4167617-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:optUkLshVitxiRsULd9cIn50UQI58FFYcsbon66mr1xrkeOLz0W 3Rd9n/pLy5VBVZcNLYSY26m5XbKrkB3pxRjWRV0HxlAbXpJ91m6s7ug+/hRTJdflMAMCRGU DNlPHnovdDiRM3bLxc9TFsv8n3yKNtOup21FBM9RbhFW0M21E/u3kEGkexwRGrXfPinYptO T/M24t52MULt45YfPipEw== X-UI-Out-Filterresults: notjunk:1; V01:K0:KcJmInCCJ0U=:RegmuPsHAFHdhM/Tj+FzJo 5v3cx6q7OII7UvGH14yjOVOaeoehUblANi5y7CfRUcLnshOVaIWzxS32M+AT3IJ6csYzJXpJc evbCgo2uJ+25W71FSH90qHprJ1U8MeTtgQLiq4vkHydD+sW9G7wAWinIlGo8IkQn648emacnr xUbudZz5aXh7TLJ7OUBU5TufPeOjTGoQaiWMeWVyLXgNgfBbvu6J8DXKNbkZhj7qVM+vPOy+a qEdgeYMZ4c/PcsFfDgOARh7CnA9m3ERhgw5zvX2V+UJfj3pkp3oiqTgqVO/+QEnKGtIXSQY2O M+qOiU14VxeA1cuYOBATS8IARPjya1UTHGMKQKNJTcYVN1O5nENt6LYe29h3Ey+RZeHxyU15o 4jfexkMBz2gZAl9MWqhJ33YYUY1XUBbcTz7NVmX5iMTswUnMsYS7n1PJzYluZYeyRjLF1WTxV l1hDKCNUWlo1+ZHCnbuzCLxWUeRe27IgsjcaPshX/G+kiDEuFVGQuGtKulCIC7qPcBa1nEtPp 0Isua5/QDdXsuTdwowKiTbi7PlVe3K+pgFUBBIxiWY4tFTs1138qUbh2mSvArIgaomZWh1DVc ga8kKt3nkRm3mrwMKy4TcHu4dehKntdrsMpeiH5c8XanJT6LAnj2pdsaEZZQWmo/F6pv2bY3R Yz2UcpC1mMCiRicYVOY+1plZrFjvOdmWLEeM5EVrHhFym7uNQq/PI60AUt8wnoKvJfdk= Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; }