nfsd: use correct format characters
Subsystems (2)
PATCH 1/1 nfsd: use correct format characters
When compiling with -Wformat, clang emits the following warnings:
fs/nfsd/flexfilelayout.c:120:27: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
"%s.%hhu.%hhu", addr, port >> 8, port & 0xff);
~~~~ ^~~~~~~~~
%d
fs/nfsd/flexfilelayout.c:120:38: warning: format specifies type 'unsigned
char' but the argument has type 'int' [-Wformat]
"%s.%hhu.%hhu", addr, port >> 8, port & 0xff);
~~~~ ^~~~~~~~~~~
%dThe types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints.
--- fs/nfsd/flexfilelayout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/flexfilelayout.c +1 -1
@@ -117,7 +117,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, da->netaddr.addr_len =snprintf (da->netaddr.addr,FF_ADDR_LEN +1 , -"%s.%hhu.%hhu" , addr, port >>8 , port &0xff ); +"%s.%d.%d" , addr, port >>8 , port &0xff ); da->tightly_coupled = false;
Signature · 1 line
2.35.1.723.g4982287a31-goog
Hi--
Quoted 13 lines · Bill Wendling
When compiling with -Wformat, clang emits the following warnings:
fs/nfsd/flexfilelayout.c:120:27: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]"%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~ %d fs/nfsd/flexfilelayout.c:120:38: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] "%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~~~ %d
Quoted 5 lines
The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints.
Link ClangBuiltLinux/linux#378
Please make the Link: more complete, such as a URL/URI.
Quoted 10 lines
Signed-off-by Bill Wendling <[email protected]>--- fs/nfsd/flexfilelayout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/flexfilelayout.c +0
-0
fs/nfsd/flexfilelayout.c nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, · line 123
Quoted 8 lines
fs/nfsd/flexfilelayout.c +1
-1@@ -117,7 +117,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, da->netaddr.addr_len =snprintf (da->netaddr.addr,FF_ADDR_LEN +1 , -"%s.%hhu.%hhu" , addr, port >>8 , port &0xff ); +"%s.%d.%d" , addr, port >>8 , port &0xff ); da->tightly_coupled = false;
thanks.
Signature · 1 line
~Randy
Quoted 17 lines · Randy Dunlap
Hi--
Quoted 13 lines · Bill Wendling
When compiling with -Wformat, clang emits the following warnings:
fs/nfsd/flexfilelayout.c:120:27: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]"%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~ %d fs/nfsd/flexfilelayout.c:120:38: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] "%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~~~ %d
Quoted 8 lines
Quoted 5 lines
The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints.
Link ClangBuiltLinux/linux#378Please make the Link: more complete, such as a URL/URI.
Done. I sent out v2 of the patch. Sorry about this oversight!
-bw
Quoted 22 lines
Quoted 10 lines
Signed-off-by Bill Wendling <[email protected]>--- fs/nfsd/flexfilelayout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/flexfilelayout.c +0
-0fs/nfsd/flexfilelayout.c nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, · line 123
Quoted 8 lines
fs/nfsd/flexfilelayout.c +1
-1@@ -117,7 +117,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, da->netaddr.addr_len =snprintf (da->netaddr.addr,FF_ADDR_LEN +1 , -"%s.%hhu.%hhu" , addr, port >>8 , port &0xff ); +"%s.%d.%d" , addr, port >>8 , port &0xff ); da->tightly_coupled = false;thanks.
--
~Randy
PATCH v2 1/1 nfsd: use correct format characters
In reply to Bill WendlingWhen compiling with -Wformat, clang emits the following warnings:
fs/nfsd/flexfilelayout.c:120:27: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
"%s.%hhu.%hhu", addr, port >> 8, port & 0xff);
~~~~ ^~~~~~~~~
%d
fs/nfsd/flexfilelayout.c:120:38: warning: format specifies type 'unsigned
char' but the argument has type 'int' [-Wformat]
"%s.%hhu.%hhu", addr, port >> 8, port & 0xff);
~~~~ ^~~~~~~~~~~
%dThe types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints.
---
v2 - Fixed "Link" to be a valid URL.
--- fs/nfsd/flexfilelayout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/flexfilelayout.c +1 -1
@@ -117,7 +117,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, da->netaddr.addr_len =snprintf (da->netaddr.addr,FF_ADDR_LEN +1 , -"%s.%hhu.%hhu" , addr, port >>8 , port &0xff ); +"%s.%d.%d" , addr, port >>8 , port &0xff ); da->tightly_coupled = false;
Signature · 1 line
2.35.1.723.g4982287a31-goog
Quoted 17 lines · Bill Wendling
When compiling with -Wformat, clang emits the following warnings:
fs/nfsd/flexfilelayout.c:120:27: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]"%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~ %d fs/nfsd/flexfilelayout.c:120:38: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] "%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~~~ %d
Quoted 8 lines
The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints.
Signed-off-by Bill Wendling <[email protected]>---
v2 - Fixed "Link" to be a valid URL.
Hi Tom, can I get a Reviewed-by from you?
Quoted 20 lines
---
fs/nfsd/flexfilelayout.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/flexfilelayout.c +1
-1@@ -117,7 +117,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, da->netaddr.addr_len =snprintf (da->netaddr.addr,FF_ADDR_LEN +1 , -"%s.%hhu.%hhu" , addr, port >>8 , port &0xff ); +"%s.%d.%d" , addr, port >>8 , port &0xff ); da->tightly_coupled = false;Signature · 1 line
2.35.1.723.g4982287a31-goog
--
Chuck Lever
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 46 lines · Thomas Haynes
Quoted 43 lines · Bill Wendling
[You don't often get email from [email protected]. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.]
When compiling with -Wformat, clang emits the following warnings:
fs/nfsd/flexfilelayout.c:120:27: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]"%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~ %d fs/nfsd/flexfilelayout.c:120:38: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] "%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~~~ %dThe types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints.
Signed-off-by Bill Wendling <[email protected]>---
v2 - Fixed "Link" to be a valid URL.
---fs/nfsd/flexfilelayout.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)fs/nfsd/flexfilelayout.c +1
-1@@ -117,7 +117,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp, da->netaddr.addr_len =snprintf (da->netaddr.addr,FF_ADDR_LEN +1 , -"%s.%hhu.%hhu" , addr, port >>8 , port &0xff ); +"%s.%d.%d" , addr, port >>8 , port &0xff );
Quoted 8 lines
Quoted 5 lines
fs/nfsd/flexfilelayout.c +0
-1da->tightly_coupled = false; --2.35.1.723.g4982287a31-goog
Reviewed-by Tom Haynes <[email protected]>
Perfect, thanks!
--
Chuck Lever