Re: [PATCH][ATM] allow atm to be loaded as a module

From: David S. Miller (davem@redhat.com)
Date: Thu May 15 2003 - 18:47:32 EST


   From: chas williams <chas@cmf.nrl.navy.mil>
   Date: Thu, 15 May 2003 17:40:33 -0400

Please make this smaller.

   +static int __init atm_init(void)
   +{
   + int error;
   +
   + if ((error = atmpvc_init()) < 0) {
   + printk(KERN_ERR "atmpvc_init() failed with %d\n", error);
   + goto done;
   + }
   + if ((error = atmsvc_init()) < 0) {
   + printk(KERN_ERR "atmsvc_init() failed with %d\n", error);
   + atmpvc_exit();
   + goto done;
   + }
   +#ifdef CONFIG_PROC_FS
   + if ((error = atm_proc_init()) < 0) {
   + printk(KERN_ERR "atm_proc_init() failed with %d\n",error);
   + atmpvc_exit();
   + atmsvc_exit();
   + goto done;
   + }
   +#endif
   +done:
   + return error;
   +}

Duplicating the exit functions (up to 3 times) is a huge waste of
space and no compiler is going to do this rearrangement for you.
Yes, this means use gotos....
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:59 EST