diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-01 14:45:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-01 14:45:49 -0500 |
commit | d984e6197ecd2babc1537f42dc1e676133005cda (patch) | |
tree | 59bebd70ee13d33a7ffbedef060fead93ee6576a /net/dccp | |
parent | 65698610f58153eb7621be3fb4f57ca318b19c60 (diff) |
dccp: Fix compile warning in probe code.
Commit 1386be55e32a3c5d8ef4a2b243c530a7b664c02c ("dccp: fix
auto-loading of dccp(_probe)") fixed a bug but created a new
compiler warning:
net/dccp/probe.c: In function ‘dccpprobe_init’:
net/dccp/probe.c:166:2: warning: the omitted middle operand in ?: will always be ‘true’, suggest explicit middle operand [-Wparentheses]
try_then_request_module() is built for situations where the
"existence" test is some lookup function that returns a non-NULL
object on success, and with a reference count of some kind held.
Here we're looking for a success return of zero from the jprobe
registry.
Instead of fighting the way try_then_request_module() works, simply
open code what we want to happen in a local helper function.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/probe.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/dccp/probe.c b/net/dccp/probe.c index 33d0e6297c21..0a8d6ebd9b45 100644 --- a/net/dccp/probe.c +++ b/net/dccp/probe.c | |||
@@ -152,6 +152,17 @@ static const struct file_operations dccpprobe_fops = { | |||
152 | .llseek = noop_llseek, | 152 | .llseek = noop_llseek, |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static __init int setup_jprobe(void) | ||
156 | { | ||
157 | int ret = register_jprobe(&dccp_send_probe); | ||
158 | |||
159 | if (ret) { | ||
160 | request_module("dccp"); | ||
161 | ret = register_jprobe(&dccp_send_probe); | ||
162 | } | ||
163 | return ret; | ||
164 | } | ||
165 | |||
155 | static __init int dccpprobe_init(void) | 166 | static __init int dccpprobe_init(void) |
156 | { | 167 | { |
157 | int ret = -ENOMEM; | 168 | int ret = -ENOMEM; |
@@ -163,8 +174,7 @@ static __init int dccpprobe_init(void) | |||
163 | if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops)) | 174 | if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops)) |
164 | goto err0; | 175 | goto err0; |
165 | 176 | ||
166 | try_then_request_module((ret = register_jprobe(&dccp_send_probe)) == 0, | 177 | ret = setup_jprobe(); |
167 | "dccp"); | ||
168 | if (ret) | 178 | if (ret) |
169 | goto err1; | 179 | goto err1; |
170 | 180 | ||