mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: "David S. Miller" <davem@redhat.com>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.6 IrDA] irlan - irlan_common cleanup
Date: Wed, 14 Apr 2004 15:19:40 -0700	[thread overview]
Message-ID: <20040414221940.GG5434@bougret.hpl.hp.com> (raw)

irXXX_irlan_common_cleanup.diff :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		<Patch from Stephen Hemminger>
	o [FEATURE] Minor type changes in irlan_common for clarity:
        - use const
        - init and exit can be static
        - use skb_queue_purge to flush queue
        - get rid of noisy old comment


diff -Nru a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
--- a/net/irda/irlan/irlan_common.c	Fri Mar 19 11:44:11 2004
+++ b/net/irda/irlan/irlan_common.c	Fri Mar 19 11:44:11 2004
@@ -75,14 +75,14 @@
 static int access = ACCESS_PEER; /* PEER, DIRECT or HOSTED */
 
 #ifdef CONFIG_PROC_FS
-static char *irlan_access[] = {
+static const char *irlan_access[] = {
 	"UNKNOWN",
 	"DIRECT",
 	"PEER",
 	"HOSTED"
 };
 
-static char *irlan_media[] = {
+static const char *irlan_media[] = {
 	"UNKNOWN",
 	"802.3",
 	"802.5"
@@ -115,7 +115,7 @@
  *    Initialize IrLAN layer
  *
  */
-int __init irlan_init(void)
+static int __init irlan_init(void)
 {
 	struct irlan_cb *new;
 	__u16 hints;
@@ -156,7 +156,7 @@
 	return 0;
 }
 
-void __exit irlan_cleanup(void) 
+static void __exit irlan_cleanup(void) 
 {
 	struct irlan_cb *self, *next;
 
@@ -242,8 +242,6 @@
  */
 static void __irlan_close(struct irlan_cb *self)
 {
-	struct sk_buff *skb;
-
 	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );
 	
 	ASSERT_RTNL();
@@ -260,8 +258,7 @@
 		iriap_close(self->client.iriap);
 
 	/* Remove frames queued on the control channel */
-	while ((skb = skb_dequeue(&self->client.txq)))
-		dev_kfree_skb(skb);
+	skb_queue_purge(&self->client.txq);
 
 	/* Unregister and free self via destructor */
 	unregister_netdevice(self->dev);
@@ -1177,19 +1174,6 @@
 MODULE_PARM(access, "i");
 MODULE_PARM_DESC(access, "Access type DIRECT=1, PEER=2, HOSTED=3");
 
-/*
- * Function init_module (void)
- *
- *    Initialize the IrLAN module, this function is called by the
- *    modprobe(1) program.
- */
 module_init(irlan_init);
-
-/*
- * Function cleanup_module (void)
- *
- *    Remove the IrLAN module, this function is called by the rmmod(1)
- *    program
- */
 module_exit(irlan_cleanup);
 

                 reply	other threads:[~2004-04-14 22:25 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=20040414221940.GG5434@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=davem@redhat.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®