From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965366AbbEMUuY (ORCPT ); Wed, 13 May 2015 16:50:24 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:54141 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965239AbbEMUuV (ORCPT ); Wed, 13 May 2015 16:50:21 -0400 From: Arnd Bergmann To: Jaegeuk Kim Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Yossi Goldfill , linux-f2fs-devel@lists.sourceforge.net, Changman Lee Subject: [PATCH] f2fs: fix building on 32-bit architectures Date: Wed, 13 May 2015 22:49:58 +0200 Message-ID: <2179770.3R5P5nr1c7@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:a6Y7xrW7/RbpBY0nM1kJ4i4vdM5ry5tQ3GyWmb8h8Hx7jUz2pQG 15POohWjso0N3GscUd5uK55WAxC1CGdtU8RXWq1CQFDXFAolz63KXL5Yw7fwxjWLBAa3XfM qB3YUSsckIlNyr+mAhGCnd4Q1KzrAuNm42bmQkI8fVZ5Phaf5u9f7QMC7dRZDDYrEbaIw4+ 4T7BWZqWFTYUQvzhlHu5g== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A bug fix to the debug output extended the type of some local variables to 64-bit, which now causes the kernel to fail building because of missing 64-bit division functions: ERROR: "__aeabi_uldivmod" [fs/f2fs/f2fs.ko] undefined! In the kernel, we have to use div_u64 or do_div to do this, in order to annotate that this is an expensive operation. As the function is only called for debug out, we know this is not performance critical, so it is safe to use div_u64. Signed-off-by: Arnd Bergmann Fixes: d1f85bd38db19 ("f2fs: avoid value overflow in showing current status") --- This patch is required for ARM allmodconfig builds. diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index efbc83f07305..75176e0dd6c8 100644 --- a/fs/f2fs/debug.c +++ b/fs/f2fs/debug.c @@ -113,10 +113,10 @@ static void update_sit_info(struct f2fs_sb_info *sbi) ndirty++; } } - dist = MAIN_SECS(sbi) * hblks_per_sec * hblks_per_sec / 100; - si->bimodal = bimodal / dist; + dist = div_u64(MAIN_SECS(sbi) * hblks_per_sec * hblks_per_sec, 100); + si->bimodal = div_u64(bimodal, dist); if (si->dirty_count) - si->avg_vblocks = total_vblocks / ndirty; + si->avg_vblocks = div_u64(total_vblocks, ndirty); else si->avg_vblocks = 0; }