Skip to content

Commit 4e1b04a

Browse files
bwendlingchucklever
authored andcommitted
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); ~~~~ ^~~~~~~~~~~ %d 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#378 Signed-off-by: Bill Wendling <[email protected]> Signed-off-by: Chuck Lever <[email protected]> Reviewed-by: Tom Haynes <[email protected]>
1 parent 23a9dbb commit 4e1b04a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/flexfilelayout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ nfsd4_ff_proc_getdeviceinfo(struct super_block *sb, struct svc_rqst *rqstp,
117117

118118
da->netaddr.addr_len =
119119
snprintf(da->netaddr.addr, FF_ADDR_LEN + 1,
120-
"%s.%hhu.%hhu", addr, port >> 8, port & 0xff);
120+
"%s.%d.%d", addr, port >> 8, port & 0xff);
121121

122122
da->tightly_coupled = false;
123123

0 commit comments

Comments
 (0)