* [Kernel-janitors] Re: linux2.6.7: af_ax25.c init cleanup
@ 2004-08-01 22:12 Domen Puncer
0 siblings, 0 replies; only message in thread
From: Domen Puncer @ 2004-08-01 22:12 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 3917 bytes --]
On 01/08/04 21:39 +0200, Walter Harms wrote:
> Hi list,
> i was looking for propper init sequences when in
> noticed that some error conditions are not catched.
>
> I had to rely on C&P so its possible that
> tabs become space.
Yes, all tabs became spaces.
If your mailer can't insert a file then you should probably change it.
>
> walter
>
> Signed-off-by: walter (wharms@bfs.de)
>
> --- linux-2.6.7/net/ax25/af_ax25.c.bak 2004-07-31 17:24:20.000000000 +0200
> +++ linux-2.6.7/net/ax25/af_ax25.c 2004-08-01 11:13:55.174924520 +0200
> @@ -1994,37 +1994,82 @@
> EXPORT_SYMBOL(null_ax25_address);
> EXPORT_SYMBOL(ax25_display_timer);
>
> +#ifdef CONFIG_PROC_FS
> +static int ax25_init_proc(void) {
Could be __init
> + int err;
> + err=proc_net_fops_create("ax25_route", S_IRUGO, &ax25_route_fops);
Spaces before and after '='
> + if (err < 0)
> + goto exit_ax25_route;
> + err=proc_net_fops_create("ax25", S_IRUGO, &ax25_info_fops);
> + if (err < 0)
> + goto exit_ax25;
> + err=proc_net_fops_create("ax25_calls", S_IRUGO, &ax25_uid_fops);
> + if (err < 0)
> + goto exit_ax25_calls;
> + return 0;
> +exit_ax25_calls:
> + proc_net_remove("ax25_calls");
> +exit_ax25:
> + proc_net_remove("ax25");
> +exit_ax25_route:
> + proc_net_remove("ax25_route");
> +
> + return -1;
> +}
> +#else
> +static int ax25_init_proc(void) {
inline or a macro would be better imo
> + return 0;
> +}
> +#endif
> +
> +
> static int __init ax25_init(void)
> {
> - sock_register(&ax25_family_ops);
> + int err;
> + err=sock_register(&ax25_family_ops);
> + if (err < 0)
> + goto exit_1;
> +
> dev_add_pack(&ax25_packet_type);
> - register_netdevice_notifier(&ax25_dev_notifier);
> + err=register_netdevice_notifier(&ax25_dev_notifier);
> + if (err < 0)
> + goto exit_free_sock ;
Space before ;
> +
> +#ifdef CONFIG_SYSCTL
> ax25_register_sysctl();
> +#endif
No need for ifdef, see ax25.h
> +
> +
> + err=ax25_init_proc();
> + if (err < 0)
> + printk(KERN_WARNING "%s: unable to init proc interface\n",__FUNCTION__);
Too long line
2 empty lines follow
>
> - proc_net_fops_create("ax25_route", S_IRUGO, &ax25_route_fops);
> - proc_net_fops_create("ax25", S_IRUGO, &ax25_info_fops);
> - proc_net_fops_create("ax25_calls", S_IRUGO, &ax25_uid_fops);
>
> return 0;
> +exit_free_sock:
> + dev_remove_pack(&ax25_packet_type);
> + sock_unregister(AF_X25);
> +exit_1:
> + return -1;
This should probably be replaced with apropriate -ERROR
> }
> module_init(ax25_init);
>
>
> -MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>");
> -MODULE_DESCRIPTION("The amateur radio AX.25 link layer protocol");
> -MODULE_LICENSE("GPL");
> -MODULE_ALIAS_NETPROTO(PF_AX25);
> -
> static void __exit ax25_exit(void)
> {
> +#ifdef CONFIG_PROC_FS
Not needed, see proc_fs.h
> proc_net_remove("ax25_route");
> proc_net_remove("ax25");
> proc_net_remove("ax25_calls");
> +#endif
> ax25_rt_free();
> ax25_uid_free();
> ax25_dev_free();
>
> +#ifdef CONFIG_SYSCTL
Not needed
> ax25_unregister_sysctl();
> +#endif
> +
> unregister_netdevice_notifier(&ax25_dev_notifier);
>
> dev_remove_pack(&ax25_packet_type);
> @@ -2032,3 +2077,8 @@
> sock_unregister(PF_AX25);
> }
> module_exit(ax25_exit);
> +
> +MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>");
> +MODULE_DESCRIPTION("The amateur radio AX.25 link layer protocol");
> +MODULE_LICENSE("GPL");
> +MODULE_ALIAS_NETPROTO(PF_AX25);
>
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> http://lists.osdl.org/mailman/listinfo/kernel-janitors
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-01 22:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-01 22:12 [Kernel-janitors] Re: linux2.6.7: af_ax25.c init cleanup Domen Puncer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.