All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: Joe Perches <joe@perches.com>, anton@tuxera.com
Cc: linux-ntfs-dev@lists.sourceforge.net,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Liqin Chen <liqin.linux@gmail.com>,
	"lennox.wu@gmail.com >> Lennox Wu" <lennox.wu@gmail.com>
Subject: [PATCH] fs/ntfs: Use '%tx' instead of '%zx'
Date: Mon, 23 Jun 2014 09:35:27 +0800	[thread overview]
Message-ID: <53A7845F.40404@gmail.com> (raw)

For subtraction between 2 pointers, the result's type is 'ptrdiff_t', so
need use '%tx' instead of '%zx'.

The related warning (allmodconfig under unicore32):

    CC [M]  fs/ntfs/compress.o
  fs/ntfs/compress.c: In function 'ntfs_decompress':
  fs/ntfs/compress.c:207:2: warning: format '%zx' expects argument of type 'size_t', but argument 5 has type 'long int' [-Wformat=]
    ntfs_debug("Beginning sub-block at offset = 0x%zx in the cb.",
    ^
    CC [M]  fs/ntfs/dir.o
  fs/ntfs/dir.c: In function 'ntfs_readdir':
  fs/ntfs/dir.c:1197:3: warning: format '%zx' expects argument of type 'size_t', but argument 5 has type 'long int' [-Wformat=]
     ntfs_debug("In index root, offset 0x%zx.", (u8*)ie - (u8*)ir);
     ^

Also let the related code match linux kernel styles which is found by
'scripts/checkpatch.pl'.


Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 fs/ntfs/compress.c | 2 +-
 fs/ntfs/dir.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c
index f82498c..2ba8280 100644
--- a/fs/ntfs/compress.c
+++ b/fs/ntfs/compress.c
@@ -204,7 +204,7 @@ static int ntfs_decompress(struct page *dest_pages[], int *dest_index,
 
 	ntfs_debug("Entering, cb_size = 0x%x.", cb_size);
 do_next_sb:
-	ntfs_debug("Beginning sub-block at offset = 0x%zx in the cb.",
+	ntfs_debug("Beginning sub-block at offset = 0x%tx in the cb.",
 			cb - cb_start);
 	/*
 	 * Have we reached the end of the compression block or the end of the
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
index 9e38daf..2d3c32d 100644
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -1194,7 +1194,7 @@ static int ntfs_readdir(struct file *file, struct dir_context *actor)
 	 * or signals an error (both covered by the rc test).
 	 */
 	for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
-		ntfs_debug("In index root, offset 0x%zx.", (u8*)ie - (u8*)ir);
+		ntfs_debug("In index root, offset 0x%tx.", (u8 *)ie - (u8 *)ir);
 		/* Bounds checks. */
 		if (unlikely((u8*)ie < (u8*)ir || (u8*)ie +
 				sizeof(INDEX_ENTRY_HEADER) > index_end ||
-- 
1.9.2.459.g68773ac

             reply	other threads:[~2014-06-23  1:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23  1:35 Chen Gang [this message]
2014-06-23  1:46 ` [PATCH] fs/ntfs: Use '%tx' instead of '%zx' Joe Perches
2014-06-23  3:00   ` Chen Gang

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=53A7845F.40404@gmail.com \
    --to=gang.chen.5i5j@gmail.com \
    --cc=anton@tuxera.com \
    --cc=joe@perches.com \
    --cc=lennox.wu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=liqin.linux@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.