drop_monitor: use genl_register_family_with_ops()
Subsystems (3)
PATCH 1/1 drop_monitor: use genl_register_family_with_ops()
Signed-off-by Changli Gao <[email protected]>
----
net/core/drop_monitor.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
net/core/drop_monitor.c +5 -14
@@ -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);
Quoted 27 lines · Changli Gao
Signed-off-by Changli Gao <[email protected]>----
net/core/drop_monitor.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)net/core/drop_monitor.c +4
-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,
net/core/drop_monitor.c static int __init init_net_drop_monitor(void) · line 368
Quoted 10 lines
net/core/drop_monitor.c +1
-6- &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);
Looks good to me, thanks!
Acked-by Neil Horman <[email protected]>
From: Neil Horman <[email protected]>
Date: Mon, 26 Jul 2010 06:44:23 -0400
Quoted 2 lines · Changli Gao
Quoted 1 line
Signed-off-by Changli Gao <[email protected]>
...
Quoted 2 lines
Looks good to me, thanks!
Acked-by Neil Horman <[email protected]>
Applied, thanks.