All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/ntfs: Use '%tx' instead of '%zx'
@ 2014-06-23  1:35 Chen Gang
  2014-06-23  1:46 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2014-06-23  1:35 UTC (permalink / raw)
  To: Joe Perches, anton
  Cc: linux-ntfs-dev, linux-kernel@vger.kernel.org, Liqin Chen,
	lennox.wu@gmail.com >> Lennox Wu

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

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

* Re: [PATCH] fs/ntfs: Use '%tx' instead of '%zx'
  2014-06-23  1:35 [PATCH] fs/ntfs: Use '%tx' instead of '%zx' Chen Gang
@ 2014-06-23  1:46 ` Joe Perches
  2014-06-23  3:00   ` Chen Gang
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2014-06-23  1:46 UTC (permalink / raw)
  To: Chen Gang, Anton Altaparmakov
  Cc: anton, linux-ntfs-dev, linux-kernel@vger.kernel.org, Liqin Chen,
	lennox.wu@gmail.com >> Lennox Wu

Please make sure to cc the specific maintainer

$ ./scripts/get_maintainer.pl -f fs/ntfs/
Anton Altaparmakov <anton@tuxera.com> (supporter:NTFS FILESYSTEM)
linux-ntfs-dev@lists.sourceforge.net (open list:NTFS FILESYSTEM)
linux-kernel@vger.kernel.org (open list)

(cc'ing Anton)

btw Anton, it seems ntfs_debug does not terminate
messages with a "\n".  That means that messages
could be interleaved with other output.

Maybe this patch as well as Chen Gang's below should be applied
---
 fs/ntfs/debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ntfs/debug.c b/fs/ntfs/debug.c
index dd6103c..1e824f0 100644
--- a/fs/ntfs/debug.c
+++ b/fs/ntfs/debug.c
@@ -126,7 +126,8 @@ void __ntfs_debug (const char *file, int line, const char *function,
 	va_start(args, fmt);
 	vaf.fmt = fmt;
 	vaf.va = &args;
-	pr_debug("(%s, %d): %s(): %pV", file, line, flen ? function : "", &vaf);
+	pr_debug("(%s, %d): %s(): %pV\n",
+		 file, line, flen ? function : "", &vaf);
 	va_end(args);
 }
 

On Mon, 2014-06-23 at 09:35 +0800, Chen Gang wrote:
> 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 ||




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

* Re: [PATCH] fs/ntfs: Use '%tx' instead of '%zx'
  2014-06-23  1:46 ` Joe Perches
@ 2014-06-23  3:00   ` Chen Gang
  0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2014-06-23  3:00 UTC (permalink / raw)
  To: Joe Perches, Anton Altaparmakov
  Cc: linux-ntfs-dev, linux-kernel@vger.kernel.org, Liqin Chen,
	lennox.wu@gmail.com >> Lennox Wu


On 06/23/2014 09:46 AM, Joe Perches wrote:
> Please make sure to cc the specific maintainer
> 
> $ ./scripts/get_maintainer.pl -f fs/ntfs/
> Anton Altaparmakov <anton@tuxera.com> (supporter:NTFS FILESYSTEM)
> linux-ntfs-dev@lists.sourceforge.net (open list:NTFS FILESYSTEM)
> linux-kernel@vger.kernel.org (open list)
> 
> (cc'ing Anton)
> 

Yes, I have sent to specific maintainer.


> btw Anton, it seems ntfs_debug does not terminate
> messages with a "\n".  That means that messages
> could be interleaved with other output.
> 
> Maybe this patch as well as Chen Gang's below should be applied
> ---
>  fs/ntfs/debug.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ntfs/debug.c b/fs/ntfs/debug.c
> index dd6103c..1e824f0 100644
> --- a/fs/ntfs/debug.c
> +++ b/fs/ntfs/debug.c
> @@ -126,7 +126,8 @@ void __ntfs_debug (const char *file, int line, const char *function,
>  	va_start(args, fmt);
>  	vaf.fmt = fmt;
>  	vaf.va = &args;
> -	pr_debug("(%s, %d): %s(): %pV", file, line, flen ? function : "", &vaf);
> +	pr_debug("(%s, %d): %s(): %pV\n",
> +		 file, line, flen ? function : "", &vaf);
>  	va_end(args);
>  }
>  

Hmm... at least, the patch above is fine to me.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

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

end of thread, other threads:[~2014-06-23  3:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-23  1:35 [PATCH] fs/ntfs: Use '%tx' instead of '%zx' Chen Gang
2014-06-23  1:46 ` Joe Perches
2014-06-23  3:00   ` Chen Gang

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.