From patchwork Tue Jul 10 15:21:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10517165 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 A5BC66032A for ; Tue, 10 Jul 2018 15:21:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94A0F28D64 for ; Tue, 10 Jul 2018 15:21:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88B6828D95; Tue, 10 Jul 2018 15:21:58 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 266A028D64 for ; Tue, 10 Jul 2018 15:21:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934213AbeGJPV4 (ORCPT ); Tue, 10 Jul 2018 11:21:56 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:40773 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934064AbeGJPVz (ORCPT ); Tue, 10 Jul 2018 11:21:55 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0LibhV-1gDKbe2WGz-00cyuN; Tue, 10 Jul 2018 17:21:47 +0200 From: Arnd Bergmann To: Jens Axboe Cc: Arnd Bergmann , Tejun Heo , Josef Bacik , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] block: iolatency: avoid 64-bit division Date: Tue, 10 Jul 2018 17:21:34 +0200 Message-Id: <20180710152146.2371336-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:XyocjbQFefAhj3c/bBIEQ15lCKAaGoxSg9237vfr9dEN8XZkfbU WWAZf6Waok7o8dp+g/lNtmVlOs7p+HurBsmWWBfKrH2zZR49JuCxrovK7Bg5Ac7cFDsPkEY o0XbBwSKrybbDNcjo9oUolaIrUvNZwUxYoBSStaS9oM8DuB6mB7ySZObAm4tuezVgHVZVtI ell4rX/Idyevjig3J3qQQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:+9NDxLDRql0=:f1V6LWvmkqTjc91JNmh/X9 950MUw3uL5eSP/jsn+IJqmlkALQ1DEfwvLdENF9Gsf2dm0oSeXPDJ0x22K8dA+oPz3GaPtKxT KDYc97/lfqN+66RzZJICZf5xJ89v8+h9gc9pTlntxLc5d7cD6Z2fhmXGfLJ+Z2bLYOXEN8+6i fsZuOmupy8vQkqHduUqKyZRZ+4SGhW+gyMEm272mU8vWaIiWk1XMDI4qTlDg1lq+R18G749De PizaabuzHdHiF5t/nPtnEMAK2RUuR9ssP4Xk6iaUSw1uHJSNC0Dqm5w3WZACbPsq85dczmOyo Ttat7HWuQtgrbTSiRzmnugMSCI7V1bJ+freExm82theUsJixhUw5HsXLawJl7RtuUtSli53t9 cms1XY/IcV7RMn8MyrwtcW3KWLLdEYKLksPvqEAusQZ0IzmMGRBpY3+ghORaGBTOJNpJaPFfY yky9Q8bfuPMt3pB+3rMjFluZrSXU4wtNZS7nudsIcybgW6S3LezQOJXsZXySGXWIrqmXkHOnQ lToVDyKCy1ptxoBG5MrCtmksgfkpr8fyaE7Xmuq60Vhii+wZoszWS8LL22+T5rK8p7VEmquAn UZmeFwrwssQDmJjlTeqfKSLM19aZmynKIwvBLevv7+TvuntA+/m6T28R4tjvT6rZh+LDTHQqB BHJ6FDpe+2sjI2MR1XNDdMWsncDEYtKreVWviEoc40p6LJ05ZeQBxnOzi6+3w0HttiMY= Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 32-bit architectures, dividing a 64-bit number needs to use the do_div() function or something like it to avoid a link failure: block/blk-iolatency.o: In function `iolatency_prfill_limit': blk-iolatency.c:(.text+0x8cc): undefined reference to `__aeabi_uldivmod' Using div_u64() gives us the best output and avoids the need for an explicit cast. Fixes: d70675121546 ("block: introduce blk-iolatency io controller") Signed-off-by: Arnd Bergmann Reviewed-by: Josef Bacik --- block/blk-iolatency.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c index a35a1f580337..56ddb2c68752 100644 --- a/block/blk-iolatency.c +++ b/block/blk-iolatency.c @@ -798,8 +798,7 @@ static u64 iolatency_prfill_limit(struct seq_file *sf, if (!dname || !iolat->min_lat_nsec) return 0; seq_printf(sf, "%s target=%llu\n", - dname, - (unsigned long long)iolat->min_lat_nsec / NSEC_PER_USEC); + dname, div_u64(iolat->min_lat_nsec, NSEC_PER_USEC)); return 0; }