Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sunrpc: Fix compilation error (`make W=1`) when dprintk() is no-op

Clang compiler is not happy about set but unused variables:

.../flexfilelayout/flexfilelayoutdev.c:56:9: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
.../flexfilelayout/flexfilelayout.c:1505:6: error: variable 'err' set but not used [-Werror,-Wunused-but-set-variable]
.../nfs4proc.c:9244:12: error: variable 'ptr' set but not used [-Werror,-Wunused-but-set-variable]

Fix these by forwarding parameters of dprintk() to no_printk().
The positive side-effect is a format-string checker enabled even for the cases
when dprintk() is no-op.

Fixes: d67ae825a59d ("pnfs/flexfiles: Add the FlexFile Layout Driver")
Fixes: fc931582c260 ("nfs41: create_session operation")
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Andy Shevchenko and committed by
Chuck Lever
6f57293a adcc5911

+11 -5
+5
fs/lockd/svclock.c
··· 74 74 75 75 return buf; 76 76 } 77 + #else 78 + static inline const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) 79 + { 80 + return "???"; 81 + } 77 82 #endif 78 83 79 84 /*
+6 -2
include/linux/sunrpc/debug.h
··· 38 38 do { \ 39 39 ifdebug(fac) \ 40 40 __sunrpc_printk(fmt, ##__VA_ARGS__); \ 41 + else \ 42 + no_printk(fmt, ##__VA_ARGS__); \ 41 43 } while (0) 42 44 43 45 # define dfprintk_rcu(fac, fmt, ...) \ ··· 48 46 rcu_read_lock(); \ 49 47 __sunrpc_printk(fmt, ##__VA_ARGS__); \ 50 48 rcu_read_unlock(); \ 49 + } else { \ 50 + no_printk(fmt, ##__VA_ARGS__); \ 51 51 } \ 52 52 } while (0) 53 53 54 54 #else 55 55 # define ifdebug(fac) if (0) 56 - # define dfprintk(fac, fmt, ...) do {} while (0) 57 - # define dfprintk_rcu(fac, fmt, ...) do {} while (0) 56 + # define dfprintk(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) 57 + # define dfprintk_rcu(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) 58 58 #endif 59 59 60 60 /*
-3
include/linux/sunrpc/sched.h
··· 95 95 int tk_rpc_status; /* Result of last RPC operation */ 96 96 unsigned short tk_flags; /* misc flags */ 97 97 unsigned short tk_timeouts; /* maj timeouts */ 98 - 99 - #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS) 100 98 unsigned short tk_pid; /* debugging aid */ 101 - #endif 102 99 unsigned char tk_priority : 2,/* Task priority */ 103 100 tk_garb_retry : 2, 104 101 tk_cred_retry : 2;