From: Changli Gao Date: Tue, 27 Jul 2010 03:59:42 +0000 (-0700) Subject: drop_monitor: use genl_register_family_with_ops() X-Git-Tag: 2.1b_release~7593^2~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a256be70c57d6f8c827d09d645a1f6fe9330af72;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git drop_monitor: use genl_register_family_with_ops() [ Fix unused local variable build warnings. -DaveM ] Signed-off-by: Changli Gao Acked-by: Neil Horman Signed-off-by: David S. Miller --- diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index 646ef3b..36e603c 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c @@ -347,9 +347,9 @@ static struct notifier_block dropmon_net_notifier = { static int __init init_net_drop_monitor(void) { - int cpu; - int rc, i, ret; struct per_cpu_dm_data *data; + int cpu, rc; + printk(KERN_INFO "Initalizing network drop monitor service\n"); if (sizeof(void *) > 8) { @@ -357,21 +357,12 @@ static int __init init_net_drop_monitor(void) return -ENOSPC; } - if (genl_register_family(&net_drop_monitor_family) < 0) { + rc = genl_register_family_with_ops(&net_drop_monitor_family, + dropmon_ops, + ARRAY_SIZE(dropmon_ops)); + if (rc) { printk(KERN_ERR "Could not create drop monitor netlink family\n"); - return -EFAULT; - } - - rc = -EFAULT; - - for (i = 0; i < ARRAY_SIZE(dropmon_ops); i++) { - ret = genl_register_ops(&net_drop_monitor_family, - &dropmon_ops[i]); - if (ret) { - printk(KERN_CRIT "Failed to register operation %d\n", - dropmon_ops[i].cmd); - goto out_unreg; - } + return rc; } rc = register_netdevice_notifier(&dropmon_net_notifier);