public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
	Arnd Bergmann <arnd@arndb.de>, Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH] ufs: Fix build errors on 32 bit machines
Date: Sat, 17 Jun 2017 10:35:13 -0700	[thread overview]
Message-ID: <1497720913-10787-1-git-send-email-linux@roeck-us.net> (raw)

Various 32 builds fail with error messages such as

ERROR: "__udivdi3" [fs/ufs/ufs.ko] undefined!

due to a variable type change from 32 bit to 64 bit.

Fixes: c596961d1b4c ("ufs: fix s_size/s_dsize users")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 fs/ufs/balloc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c
index 0315fea1d589..a93121873fa6 100644
--- a/fs/ufs/balloc.c
+++ b/fs/ufs/balloc.c
@@ -459,7 +459,7 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
 	    case UFS_OPTSPACE:
 		request = newcount;
 		if (uspi->s_minfree < 5 || uspi->cs_total.cs_nffree
-		    > uspi->s_dsize * uspi->s_minfree / (2 * 100))
+		    > div_u64(uspi->s_dsize * uspi->s_minfree, 2 * 100))
 			break;
 		usb1->fs_optim = cpu_to_fs32(sb, UFS_OPTTIME);
 		break;
@@ -468,8 +468,8 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
 	
 	    case UFS_OPTTIME:
 		request = uspi->s_fpb;
-		if (uspi->cs_total.cs_nffree < uspi->s_dsize *
-		    (uspi->s_minfree - 2) / 100)
+		if (uspi->cs_total.cs_nffree <
+		    div_u64(uspi->s_dsize * (uspi->s_minfree - 2), 100))
 			break;
 		usb1->fs_optim = cpu_to_fs32(sb, UFS_OPTTIME);
 		break;
-- 
2.7.4

             reply	other threads:[~2017-06-17 17:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-17 17:35 Guenter Roeck [this message]
2017-06-17 18:23 ` [PATCH] ufs: Fix build errors on 32 bit machines Al Viro
2017-06-17 18:51   ` Al Viro
2017-06-18  9:30   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497720913-10787-1-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=dushistov@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox