diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-20 09:22:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-21 09:31:44 -0400 |
commit | ffa94db6042e6fd014ae0bed8832ac707ef2afe9 (patch) | |
tree | c2e98dc23546be53b311bf4eb010e824709e4d76 /fs/lockd | |
parent | 9304a8120a6ac06d08874d2aec76f52d3376dfe4 (diff) |
SUNRPC/LOCKD: Fix build warnings when CONFIG_SUNRPC_DEBUG is undefined
Stephen Rothwell reports:
net/sunrpc/rpcb_clnt.c: In function 'rpcb_enc_mapping':
net/sunrpc/rpcb_clnt.c:820:19: warning: unused variable 'task' [-Wunused-variable]
net/sunrpc/rpcb_clnt.c: In function 'rpcb_dec_getport':
net/sunrpc/rpcb_clnt.c:837:19: warning: unused variable 'task' [-Wunused-variable]
net/sunrpc/rpcb_clnt.c: In function 'rpcb_dec_set':
net/sunrpc/rpcb_clnt.c:860:19: warning: unused variable 'task' [-Wunused-variable]
net/sunrpc/rpcb_clnt.c: In function 'rpcb_enc_getaddr':
net/sunrpc/rpcb_clnt.c:892:19: warning: unused variable 'task' [-Wunused-variable]
net/sunrpc/rpcb_clnt.c: In function 'rpcb_dec_getaddr':
net/sunrpc/rpcb_clnt.c:914:19: warning: unused variable 'task' [-Wunused-variable]
fs/lockd/svclock.c:49:20: warning: 'nlmdbg_cookie2a' declared 'static' but never defined [-Wunused-function]
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/svclock.c | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index f0179c3745d2..e46353f41a42 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c | |||
@@ -46,7 +46,6 @@ static void nlmsvc_remove_block(struct nlm_block *block); | |||
46 | static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock); | 46 | static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock); |
47 | static void nlmsvc_freegrantargs(struct nlm_rqst *call); | 47 | static void nlmsvc_freegrantargs(struct nlm_rqst *call); |
48 | static const struct rpc_call_ops nlmsvc_grant_ops; | 48 | static const struct rpc_call_ops nlmsvc_grant_ops; |
49 | static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie); | ||
50 | 49 | ||
51 | /* | 50 | /* |
52 | * The list of blocked locks to retry | 51 | * The list of blocked locks to retry |
@@ -54,6 +53,35 @@ static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie); | |||
54 | static LIST_HEAD(nlm_blocked); | 53 | static LIST_HEAD(nlm_blocked); |
55 | static DEFINE_SPINLOCK(nlm_blocked_lock); | 54 | static DEFINE_SPINLOCK(nlm_blocked_lock); |
56 | 55 | ||
56 | #ifdef LOCKD_DEBUG | ||
57 | static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) | ||
58 | { | ||
59 | /* | ||
60 | * We can get away with a static buffer because we're only | ||
61 | * called with BKL held. | ||
62 | */ | ||
63 | static char buf[2*NLM_MAXCOOKIELEN+1]; | ||
64 | unsigned int i, len = sizeof(buf); | ||
65 | char *p = buf; | ||
66 | |||
67 | len--; /* allow for trailing \0 */ | ||
68 | if (len < 3) | ||
69 | return "???"; | ||
70 | for (i = 0 ; i < cookie->len ; i++) { | ||
71 | if (len < 2) { | ||
72 | strcpy(p-3, "..."); | ||
73 | break; | ||
74 | } | ||
75 | sprintf(p, "%02x", cookie->data[i]); | ||
76 | p += 2; | ||
77 | len -= 2; | ||
78 | } | ||
79 | *p = '\0'; | ||
80 | |||
81 | return buf; | ||
82 | } | ||
83 | #endif | ||
84 | |||
57 | /* | 85 | /* |
58 | * Insert a blocked lock into the global list | 86 | * Insert a blocked lock into the global list |
59 | */ | 87 | */ |
@@ -935,32 +963,3 @@ nlmsvc_retry_blocked(void) | |||
935 | 963 | ||
936 | return timeout; | 964 | return timeout; |
937 | } | 965 | } |
938 | |||
939 | #ifdef RPC_DEBUG | ||
940 | static const char *nlmdbg_cookie2a(const struct nlm_cookie *cookie) | ||
941 | { | ||
942 | /* | ||
943 | * We can get away with a static buffer because we're only | ||
944 | * called with BKL held. | ||
945 | */ | ||
946 | static char buf[2*NLM_MAXCOOKIELEN+1]; | ||
947 | unsigned int i, len = sizeof(buf); | ||
948 | char *p = buf; | ||
949 | |||
950 | len--; /* allow for trailing \0 */ | ||
951 | if (len < 3) | ||
952 | return "???"; | ||
953 | for (i = 0 ; i < cookie->len ; i++) { | ||
954 | if (len < 2) { | ||
955 | strcpy(p-3, "..."); | ||
956 | break; | ||
957 | } | ||
958 | sprintf(p, "%02x", cookie->data[i]); | ||
959 | p += 2; | ||
960 | len -= 2; | ||
961 | } | ||
962 | *p = '\0'; | ||
963 | |||
964 | return buf; | ||
965 | } | ||
966 | #endif | ||