diff mbox series

[U-Boot,3/4] fs: btrfs: Fix printf length modifier

Message ID 20171006130459.29127-3-marek.behun@nic.cz
State Changes Requested
Delegated to: Tom Rini
Headers show
Series [U-Boot,1/4] linux/time.h: Remove dead code | expand

Commit Message

Marek Behún Oct. 6, 2017, 1:04 p.m. UTC
Change %lu to %u. The compiler issues a warning otherwise.

Signed-off-by: Marek Behun <marek.behun@nic.cz>
---
 fs/btrfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Behún Oct. 6, 2017, 1:14 p.m. UTC | #1
Hmm, this is weird. Tom's commit 6b7fd350

http://git.denx.de/?p=u-boot.git;a=commit;h=6b7fd350e85a97892a2cb066364797f3f3dcb9c9

forces %lu here, because the %u issued a warning.
But my compiler warns when %lu is used.
Maybe we should use PRIu32 instead...

...

On Fri,  6 Oct 2017 15:04:58 +0200
Marek Behún <marek.behun@nic.cz> wrote:

> Change %lu to %u. The compiler issues a warning otherwise.
> 
> Signed-off-by: Marek Behun <marek.behun@nic.cz>
> ---
>  fs/btrfs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 2529c2b3b6..706286ee2d 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -147,7 +147,7 @@ static int btrfs_check_super(struct
> btrfs_super_block *sb) 
>  	if (sb->sys_chunk_array_size < sizeof(struct btrfs_key) +
>  	    sizeof(struct btrfs_chunk)) {
> -		printf("%s: system chunk array too small %u <
> %lu\n", __func__,
> +		printf("%s: system chunk array too small %u < %u\n",
> __func__, sb->sys_chunk_array_size, (u32) sizeof(struct btrfs_key)
>  		       + sizeof(struct btrfs_chunk));
>  		ret = -1;
Tom Rini Oct. 6, 2017, 2:23 p.m. UTC | #2
On Fri, Oct 06, 2017 at 03:14:53PM +0200, Marek Behún wrote:
> Hmm, this is weird. Tom's commit 6b7fd350
> 
> http://git.denx.de/?p=u-boot.git;a=commit;h=6b7fd350e85a97892a2cb066364797f3f3dcb9c9
> 
> forces %lu here, because the %u issued a warning.
> But my compiler warns when %lu is used.
> Maybe we should use PRIu32 instead...

Yes, oops :)

> 
> ...
> 
> On Fri,  6 Oct 2017 15:04:58 +0200
> Marek Behún <marek.behun@nic.cz> wrote:
> 
> > Change %lu to %u. The compiler issues a warning otherwise.
> > 
> > Signed-off-by: Marek Behun <marek.behun@nic.cz>
> > ---
> >  fs/btrfs/super.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> > index 2529c2b3b6..706286ee2d 100644
> > --- a/fs/btrfs/super.c
> > +++ b/fs/btrfs/super.c
> > @@ -147,7 +147,7 @@ static int btrfs_check_super(struct
> > btrfs_super_block *sb) 
> >  	if (sb->sys_chunk_array_size < sizeof(struct btrfs_key) +
> >  	    sizeof(struct btrfs_chunk)) {
> > -		printf("%s: system chunk array too small %u <
> > %lu\n", __func__,
> > +		printf("%s: system chunk array too small %u < %u\n",
> > __func__, sb->sys_chunk_array_size, (u32) sizeof(struct btrfs_key)
> >  		       + sizeof(struct btrfs_chunk));
> >  		ret = -1;
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
diff mbox series

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 2529c2b3b6..706286ee2d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -147,7 +147,7 @@  static int btrfs_check_super(struct btrfs_super_block *sb)
 
 	if (sb->sys_chunk_array_size < sizeof(struct btrfs_key) +
 	    sizeof(struct btrfs_chunk)) {
-		printf("%s: system chunk array too small %u < %lu\n", __func__,
+		printf("%s: system chunk array too small %u < %u\n", __func__,
 		       sb->sys_chunk_array_size, (u32) sizeof(struct btrfs_key)
 		       + sizeof(struct btrfs_chunk));
 		ret = -1;