diff mbox

[V9fs-developer] fs/9p: fix flags in the format of printf

Message ID 1382844984-7550-1-git-send-email-dinggnu@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cong Ding Oct. 27, 2013, 3:36 a.m. UTC
To print "int" value, we should use %d rather than %u.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
 fs/9p/vfs_inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Van Hensbergen Oct. 27, 2013, 8:07 p.m. UTC | #1
Actually there are some pending patches to switch major minor to u32 which
better matches the semantics of major/minor.  So the sscanf will be
appropriate once those patches are applied.

    -eric



On Sat, Oct 26, 2013 at 10:36 PM, Cong Ding <dinggnu@gmail.com> wrote:

> To print "int" value, we should use %d rather than %u.
>
> Signed-off-by: Cong Ding <dinggnu@gmail.com>
> ---
>  fs/9p/vfs_inode.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
> index af7d531..dcc099a 100644
> --- a/fs/9p/vfs_inode.c
> +++ b/fs/9p/vfs_inode.c
> @@ -147,7 +147,7 @@ static umode_t p9mode2unixmode(struct
> v9fs_session_info *v9ses,
>                 int major = -1, minor = -1;
>
>                 strlcpy(ext, stat->extension, sizeof(ext));
> -               sscanf(ext, "%c %u %u", &type, &major, &minor);
> +               sscanf(ext, "%c %d %d", &type, &major, &minor);
>                 switch (type) {
>                 case 'c':
>                         res |= S_IFCHR;
> --
> 1.7.9.5
>
>
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
diff mbox

Patch

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index af7d531..dcc099a 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -147,7 +147,7 @@  static umode_t p9mode2unixmode(struct v9fs_session_info *v9ses,
 		int major = -1, minor = -1;
 
 		strlcpy(ext, stat->extension, sizeof(ext));
-		sscanf(ext, "%c %u %u", &type, &major, &minor);
+		sscanf(ext, "%c %d %d", &type, &major, &minor);
 		switch (type) {
 		case 'c':
 			res |= S_IFCHR;