* [PATCH] drop_monitor: use genl_register_family_with_ops()
@ 2010-07-26 9:20 Changli Gao
2010-07-26 10:44 ` Neil Horman
0 siblings, 1 reply; 3+ messages in thread
From: Changli Gao @ 2010-07-26 9:20 UTC (permalink / raw)
To: Neil Horman; +Cc: David S. Miller, netdev, linux-kernel, Changli Gao
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/core/drop_monitor.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 646ef3b..bdb0e96 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drop_monitor: use genl_register_family_with_ops()
2010-07-26 9:20 [PATCH] drop_monitor: use genl_register_family_with_ops() Changli Gao
@ 2010-07-26 10:44 ` Neil Horman
2010-07-27 3:54 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Neil Horman @ 2010-07-26 10:44 UTC (permalink / raw)
To: Changli Gao; +Cc: David S. Miller, netdev, linux-kernel
On Mon, Jul 26, 2010 at 05:20:17PM +0800, Changli Gao wrote:
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> ----
> net/core/drop_monitor.c | 19 +++++--------------
> 1 file changed, 5 insertions(+), 14 deletions(-)
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 646ef3b..bdb0e96 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
> @@ -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);
>
Looks good to me, thanks!
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drop_monitor: use genl_register_family_with_ops()
2010-07-26 10:44 ` Neil Horman
@ 2010-07-27 3:54 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-07-27 3:54 UTC (permalink / raw)
To: nhorman; +Cc: xiaosuo, netdev, linux-kernel
From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 26 Jul 2010 06:44:23 -0400
> On Mon, Jul 26, 2010 at 05:20:17PM +0800, Changli Gao wrote:
>> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
...
> Looks good to me, thanks!
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-27 3:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26 9:20 [PATCH] drop_monitor: use genl_register_family_with_ops() Changli Gao
2010-07-26 10:44 ` Neil Horman
2010-07-27 3:54 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).