Patchwork [U-Boot] fs: zfs: fix illegal use of fp

login
register
mail settings
Submitter Alejandro Mery
Date Oct. 31, 2012, 6:21 p.m.
Message ID <1351707693-7962-1-git-send-email-amery@geeks.cl>
Download mbox | patch
Permalink /patch/195991/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Alejandro Mery - Oct. 31, 2012, 6:21 p.m.
the upcoming sunxi (allwinner a10/a13) platform enables zfs
by default, and using linaro's hf -msoft-float makes the build
fail because this u64 division.

Signed-off-by: Alejandro Mery <amery@geeks.cl>
---
 fs/zfs/zfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Stefan Roese - Nov. 1, 2012, 9:56 a.m.
On 10/31/2012 07:21 PM, Alejandro Mery wrote:
> the upcoming sunxi (allwinner a10/a13) platform enables zfs
> by default, and using linaro's hf -msoft-float makes the build
> fail because this u64 division.
> 
> Signed-off-by: Alejandro Mery <amery@geeks.cl>

Acked-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
Anatolij Gustschin - Nov. 14, 2012, 12:25 p.m.
Hi,

On Wed, 31 Oct 2012 19:21:33 +0100
Alejandro Mery <amery@geeks.cl> wrote:

> the upcoming sunxi (allwinner a10/a13) platform enables zfs
> by default, and using linaro's hf -msoft-float makes the build
> fail because this u64 division.
> 
> Signed-off-by: Alejandro Mery <amery@geeks.cl>
> ---
>  fs/zfs/zfs.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied to staging/agust@denx.de, thanks!

Anatolij

Patch

diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
index 360f723..ff857ae 100644
--- a/fs/zfs/zfs.c
+++ b/fs/zfs/zfs.c
@@ -30,6 +30,7 @@ 
 #include <linux/ctype.h>
 #include <asm/byteorder.h>
 #include "zfs_common.h"
+#include "div64.h"
 
 block_dev_desc_t *zfs_dev_desc;
 
@@ -2158,7 +2159,8 @@  zfs_read(zfs_file_t file, char *buf, uint64_t len)
 		/*
 		 * Find requested blkid and the offset within that block.
 		 */
-		uint64_t blkid = (file->offset + red) /	 blksz;
+		uint64_t blkid = file->offset + red;
+		blkid = do_div(blkid, blksz);
 		free(data->file_buf);
 		data->file_buf = 0;