All of lore.kernel.org
 help / color / mirror / Atom feed
From: shaulka@012.net.il
To: p_gortmaker@yahoo.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/net/{ne,smc-ultra}.c: Avoid compilation warnings by registering init and exit functions
Date: Thu, 31 Aug 2006 15:21:03 +0200	[thread overview]
Message-ID: <11cf840538e0.44f6fe5f@default.domain> (raw)

  This patch is against 2.6.17-11.
1) Meant to get rid of the following compilation warnings
         WARNING: drivers/net/ne.o - Section mismatch: reference to .init.text: from .text between 'init_module' (at offset 0xeb) and 'ne_close'
         WARNING: drivers/net/smc-ultra.o - Section mismatch: reference to .init.data:ultra_portlist from .text between 'init_module' (at offset 0xa4) and 'ultra_close_card'

2) Isn't the registration of a module's __init and __exit functions while making them
    static much encouraged in 2.6? I followed the Linux Device Drivers book.

Signed-off-by: Shaul Karl <shaulka@012.net.il>

---

drivers/net/ne.c        |    8 ++++++--
drivers/net/smc-ultra.c |   10 ++++++----
2 files changed, 12 insertions(+), 6 deletions(-)

--- linux-source-2.6.17/drivers/net/ne.c.orig   2006-08-29 14:55:59.000000000 +0300
+++ linux-source-2.6.17/drivers/net/ne.c        2006-08-29 18:27:13.000000000 +0300
@@ -829,7 +829,7 @@ that the ne2k probe is the last 8390 bas
 is at boot) and so the probe will get confused by any other 8390 cards.
 ISA device autoprobes on a running machine are not recommended anyway. */

-int init_module(void)
+static int __init init_ne_module(void)
 {
        int this_dev, found = 0;

@@ -867,7 +867,7 @@ static void cleanup_card(struct net_devi
        release_region(dev->base_addr, NE_IO_EXTENT);
 }

-void cleanup_module(void)
+static void __exit cleanup_ne_module(void)
 {
        int this_dev;

@@ -880,4 +880,8 @@ void cleanup_module(void)
                }
        }
 }
+
+module_init(init_ne_module);
+module_exit(cleanup_ne_module);
+
 #endif /* MODULE */

--- linux-source-2.6.17/drivers/net/smc-ultra.c.orig    2006-08-29 15:03:33.000000000 +0300
+++ linux-source-2.6.17/drivers/net/smc-ultra.c 2006-08-29 18:29:53.000000000 +0300
@@ -553,8 +553,7 @@ MODULE_LICENSE("GPL");

 /* This is set up so that only a single autoprobe takes place per call.
 ISA device autoprobes on a running machine are not recommended. */
-int
-init_module(void)
+static int __init init_smcUltra_module(void)
 {
        struct net_device *dev;
        int this_dev, found = 0;
@@ -594,8 +593,7 @@ static void cleanup_card(struct net_devi
        iounmap(ei_status.mem);
 }

-void
-cleanup_module(void)
+static void __exit cleanup_smcUltra_module(void)
 {
        int this_dev;

@@ -608,4 +606,8 @@ cleanup_module(void)
                }
        }
 }
+
+module_init(init_smcUltra_module);
+module_exit(cleanup_smcUltra_module);
+
 #endif /* MODULE */



                 reply	other threads:[~2006-08-31 13:15 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=11cf840538e0.44f6fe5f@default.domain \
    --to=shaulka@012.net.il \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=p_gortmaker@yahoo.com \
    /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.