linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: fix a couple 32-bit build warnings
@ 2016-12-22 15:28 Eric Sandeen
  2017-01-03 18:24 ` Brian Foster
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2016-12-22 15:28 UTC (permalink / raw)
  To: linux-xfs

on 32-bit builds:

mremap_f can't turn a long long into a pointer, and
dump_dirent needs proper %llx & a cast for u64 args
as is done elsewhere.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/io/mmap.c b/io/mmap.c
index dc188d0..6f1d330 100644
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -628,8 +628,8 @@ mremap_f(
 		switch (c) {
 		case 'f':
 			flags = MREMAP_FIXED|MREMAP_MAYMOVE;
-			new_addr = (void *)cvtnum(blocksize, sectsize,
-			                          optarg);
+			new_addr = (void *)(unsigned long)cvtnum(blocksize,
+			                          sectsize, optarg);
 			break;
 		case 'm':
 			flags = MREMAP_MAYMOVE;
diff --git a/io/readdir.c b/io/readdir.c
index 151b72e..b868d1b 100644
--- a/io/readdir.c
+++ b/io/readdir.c
@@ -71,9 +71,10 @@ dump_dirent(
 	long long offset,
 	struct dirent *dirent)
 {
-	printf("%08llx: d_ino: 0x%08lx", offset, dirent->d_ino);
+	printf("%08llx: d_ino: 0x%08llx", offset,
+					(unsigned long long)dirent->d_ino);
 #ifdef _DIRENT_HAVE_D_OFF
-	printf(" d_off: 0x%08lx", dirent->d_off);
+	printf(" d_off: 0x%08llx", (unsigned long long)dirent->d_off);
 #endif
 #ifdef _DIRENT_HAVE_D_RECLEN
 	printf(" d_reclen: 0x%x", dirent->d_reclen);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfsprogs: fix a couple 32-bit build warnings
  2016-12-22 15:28 [PATCH] xfsprogs: fix a couple 32-bit build warnings Eric Sandeen
@ 2017-01-03 18:24 ` Brian Foster
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Foster @ 2017-01-03 18:24 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Thu, Dec 22, 2016 at 09:28:50AM -0600, Eric Sandeen wrote:
> on 32-bit builds:
> 
> mremap_f can't turn a long long into a pointer, and
> dump_dirent needs proper %llx & a cast for u64 args
> as is done elsewhere.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Looks Ok to me:

Reviewed-by: Brian Foster <bfoster@redhat.com>

> 
> diff --git a/io/mmap.c b/io/mmap.c
> index dc188d0..6f1d330 100644
> --- a/io/mmap.c
> +++ b/io/mmap.c
> @@ -628,8 +628,8 @@ mremap_f(
>  		switch (c) {
>  		case 'f':
>  			flags = MREMAP_FIXED|MREMAP_MAYMOVE;
> -			new_addr = (void *)cvtnum(blocksize, sectsize,
> -			                          optarg);
> +			new_addr = (void *)(unsigned long)cvtnum(blocksize,
> +			                          sectsize, optarg);
>  			break;
>  		case 'm':
>  			flags = MREMAP_MAYMOVE;
> diff --git a/io/readdir.c b/io/readdir.c
> index 151b72e..b868d1b 100644
> --- a/io/readdir.c
> +++ b/io/readdir.c
> @@ -71,9 +71,10 @@ dump_dirent(
>  	long long offset,
>  	struct dirent *dirent)
>  {
> -	printf("%08llx: d_ino: 0x%08lx", offset, dirent->d_ino);
> +	printf("%08llx: d_ino: 0x%08llx", offset,
> +					(unsigned long long)dirent->d_ino);
>  #ifdef _DIRENT_HAVE_D_OFF
> -	printf(" d_off: 0x%08lx", dirent->d_off);
> +	printf(" d_off: 0x%08llx", (unsigned long long)dirent->d_off);
>  #endif
>  #ifdef _DIRENT_HAVE_D_RECLEN
>  	printf(" d_reclen: 0x%x", dirent->d_reclen);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-03 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-22 15:28 [PATCH] xfsprogs: fix a couple 32-bit build warnings Eric Sandeen
2017-01-03 18:24 ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).