aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-07-26 23:59:42 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-26 23:59:42 -0400
commita256be70c57d6f8c827d09d645a1f6fe9330af72 (patch)
tree8557ccb681ea452f00057343e628f0d88b8d5cd3 /net
parent416c2f9cf5524cb53392cbcf99fef7aa687192ce (diff)
drop_monitor: use genl_register_family_with_ops()
[ Fix unused local variable build warnings. -DaveM ] Signed-off-by: Changli Gao <xiaosuo@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/drop_monitor.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 646ef3bc7200..36e603c78ce9 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -347,9 +347,9 @@ static struct notifier_block dropmon_net_notifier = {
347 347
348static int __init init_net_drop_monitor(void) 348static int __init init_net_drop_monitor(void)
349{ 349{
350 int cpu;
351 int rc, i, ret;
352 struct per_cpu_dm_data *data; 350 struct per_cpu_dm_data *data;
351 int cpu, rc;
352
353 printk(KERN_INFO "Initalizing network drop monitor service\n"); 353 printk(KERN_INFO "Initalizing network drop monitor service\n");
354 354
355 if (sizeof(void *) > 8) { 355 if (sizeof(void *) > 8) {
@@ -357,21 +357,12 @@ static int __init init_net_drop_monitor(void)
357 return -ENOSPC; 357 return -ENOSPC;
358 } 358 }
359 359
360 if (genl_register_family(&net_drop_monitor_family) < 0) { 360 rc = genl_register_family_with_ops(&net_drop_monitor_family,
361 dropmon_ops,
362 ARRAY_SIZE(dropmon_ops));
363 if (rc) {
361 printk(KERN_ERR "Could not create drop monitor netlink family\n"); 364 printk(KERN_ERR "Could not create drop monitor netlink family\n");
362 return -EFAULT; 365 return rc;
363 }
364
365 rc = -EFAULT;
366
367 for (i = 0; i < ARRAY_SIZE(dropmon_ops); i++) {
368 ret = genl_register_ops(&net_drop_monitor_family,
369 &dropmon_ops[i]);
370 if (ret) {
371 printk(KERN_CRIT "Failed to register operation %d\n",
372 dropmon_ops[i].cmd);
373 goto out_unreg;
374 }
375 } 366 }
376 367
377 rc = register_netdevice_notifier(&dropmon_net_notifier); 368 rc = register_netdevice_notifier(&dropmon_net_notifier);