Commit a256be70 authored by Changli Gao's avatar Changli Gao Committed by David S. Miller

drop_monitor: use genl_register_family_with_ops()

[ Fix unused local variable build warnings. -DaveM ]
Signed-off-by: default avatarChangli Gao <xiaosuo@gmail.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 416c2f9c
...@@ -347,9 +347,9 @@ static struct notifier_block dropmon_net_notifier = { ...@@ -347,9 +347,9 @@ static struct notifier_block dropmon_net_notifier = {
static int __init init_net_drop_monitor(void) static int __init init_net_drop_monitor(void)
{ {
int cpu;
int rc, i, ret;
struct per_cpu_dm_data *data; struct per_cpu_dm_data *data;
int cpu, rc;
printk(KERN_INFO "Initalizing network drop monitor service\n"); printk(KERN_INFO "Initalizing network drop monitor service\n");
if (sizeof(void *) > 8) { if (sizeof(void *) > 8) {
...@@ -357,21 +357,12 @@ static int __init init_net_drop_monitor(void) ...@@ -357,21 +357,12 @@ static int __init init_net_drop_monitor(void)
return -ENOSPC; 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"); printk(KERN_ERR "Could not create drop monitor netlink family\n");
return -EFAULT; return rc;
}
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;
}
} }
rc = register_netdevice_notifier(&dropmon_net_notifier); rc = register_netdevice_notifier(&dropmon_net_notifier);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment