X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fax25%2Fsysctl_net_ax25.c;h=f288fc4aef9bcd64a16add98a0b7ed86acb232da;hb=cc9bd5cebc0825e0fabc0186ab85806a0891104f;hp=d23a27f25d2fd63c94568482c07a3696b607c3ca;hpb=9cdf083f981b8d37b3212400a359368661385099;p=linux-2.6 diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c index d23a27f25d..f288fc4aef 100644 --- a/net/ax25/sysctl_net_ax25.c +++ b/net/ax25/sysctl_net_ax25.c @@ -31,23 +31,10 @@ static struct ctl_table_header *ax25_table_header; static ctl_table *ax25_table; static int ax25_table_size; -static ctl_table ax25_dir_table[] = { - { - .ctl_name = NET_AX25, - .procname = "ax25", - .mode = 0555, - }, - { .ctl_name = 0 } -}; - -static ctl_table ax25_root_table[] = { - { - .ctl_name = CTL_NET, - .procname = "net", - .mode = 0555, - .child = ax25_dir_table - }, - { .ctl_name = 0 } +static struct ctl_path ax25_path[] = { + { .procname = "net", .ctl_name = CTL_NET, }, + { .procname = "ax25", .ctl_name = NET_AX25, }, + { } }; static const ctl_table ax25_param_table[] = { @@ -181,6 +168,7 @@ static const ctl_table ax25_param_table[] = { .extra1 = &min_proto, .extra2 = &max_proto }, +#ifdef CONFIG_AX25_DAMA_SLAVE { .ctl_name = NET_AX25_DAMA_SLAVE_TIMEOUT, .procname = "dama_slave_timeout", @@ -191,6 +179,8 @@ static const ctl_table ax25_param_table[] = { .extra1 = &min_ds_timeout, .extra2 = &max_ds_timeout }, +#endif + { .ctl_name = 0 } /* that's all, folks! */ }; @@ -224,16 +214,6 @@ void ax25_register_sysctl(void) ax25_table[n].procname = ax25_dev->dev->name; ax25_table[n].mode = 0555; -#ifndef CONFIG_AX25_DAMA_SLAVE - /* - * We do not wish to have a representation of this parameter - * in /proc/sys/ when configured *not* to include the - * AX.25 DAMA slave code, do we? - */ - - child[AX25_VALUES_DS_TIMEOUT].procname = NULL; -#endif - child[AX25_MAX_VALUES].ctl_name = 0; /* just in case... */ for (k = 0; k < AX25_MAX_VALUES; k++) @@ -243,9 +223,7 @@ void ax25_register_sysctl(void) } spin_unlock_bh(&ax25_dev_lock); - ax25_dir_table[0].child = ax25_table; - - ax25_table_header = register_sysctl_table(ax25_root_table, 1); + ax25_table_header = register_sysctl_paths(ax25_path, ax25_table); } void ax25_unregister_sysctl(void) @@ -253,7 +231,6 @@ void ax25_unregister_sysctl(void) ctl_table *p; unregister_sysctl_table(ax25_table_header); - ax25_dir_table[0].child = NULL; for (p = ax25_table; p->ctl_name; p++) kfree(p->child); kfree(ax25_table);