All of lore.kernel.org
 help / color / mirror / Atom feed
From: Domen Puncer <domen@coderock.org>
To: kernel-janitors@vger.kernel.org
Subject: [Kernel-janitors] Re: linux2.6.7: af_ax25.c init cleanup
Date: Sun, 01 Aug 2004 22:12:31 +0000	[thread overview]
Message-ID: <20040801221231.GA2276@masina.coderock.org> (raw)

[-- 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

                 reply	other threads:[~2004-08-01 22:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040801221231.GA2276@masina.coderock.org \
    --to=domen@coderock.org \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.