Skip to content

Commit

Permalink
drop_monitor: use genl_register_family_with_ops()
Browse files Browse the repository at this point in the history
[ 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>
  • Loading branch information
Changli Gao authored and David S. Miller committed Jul 27, 2010
1 parent 416c2f9 commit a256be7
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions net/core/drop_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,31 +347,22 @@ 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) {
printk(KERN_ERR "Unable to store program counters on this arch, Drop monitor failed\n");
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);
Expand Down

0 comments on commit a256be7

Please sign in to comment.