mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert Carr" <rcarrlkm@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.18] atmel.c: General clean up
Date: Mon, 21 Aug 2006 22:28:54 -0400	[thread overview]
Message-ID: <c0835eaf0608211928k706cdb0bve3b08012d61b03f1@mail.gmail.com> (raw)

Just general cleanup, SET_MODULE_OWNER is defunct, using time_after is
preferable to comparing jiffies, and general practice is to set
last_rx after netif_rx (right?). This is my first attempt at a patch
so if I have horribly messed something up feedback is appreciated.


  --- a/drivers/net/wireless/atmel.c	2006-08-22 02:11:11.000000000 -0400
+++ b/drivers/net/wireless/atmel.c	2006-08-22 02:10:16.000000000 -0400
@@ -65,6 +65,7 @@
 #include <linux/crc32.h>
 #include <linux/proc_fs.h>
 #include <linux/device.h>
+#include <linux/jiffies.h>
 #include <linux/moduleparam.h>
 #include <linux/firmware.h>
 #include <net/ieee80211.h>
@@ -920,11 +921,12 @@ static void fast_rx_path(struct atmel_pr
 	else
  		memcpy(&skbp[6], header->addr2, 6); /* source address */

-	priv->dev->last_rx = jiffies;
  	skb->dev = priv->dev;
  	skb->protocol = eth_type_trans(skb, priv->dev);
  	skb->ip_summed = CHECKSUM_NONE;
  	netif_rx(skb);
+	priv->dev->last_rx = jiffies;
  	priv->stats.rx_bytes += 12 + msdu_size;
  	priv->stats.rx_packets++;
 }
@@ -1028,11 +1030,12 @@ static void frag_rx_path(struct atmel_pr
  				memcpy(skb_put(skb, priv->frag_len + 12),
  				       priv->rx_buf,
  				       priv->frag_len + 12);
-				priv->dev->last_rx = jiffies;
  				skb->dev = priv->dev;
  				skb->protocol = eth_type_trans(skb, priv->dev);
  				skb->ip_summed = CHECKSUM_NONE;
  				netif_rx(skb);
+			       priv->dev->last_rx = jiffies;
  				priv->stats.rx_bytes += priv->frag_len + 12;
  				priv->stats.rx_packets++;
 			}
@@ -1391,7 +1394,7 @@ static int atmel_validate_channel(struct
 {
 	/* check that channel is OK, if so return zero,
 	   else return suitable default channel */
-	int i;
+      unsigned int i;

 	for (i = 0; i < sizeof(channel_table)/sizeof(channel_table[0]); i++)
  		if (priv->reg_domain == channel_table[i].reg_domain) {
@@ -1606,7 +1609,7 @@ struct net_device *init_atmel_card(unsig
  	       dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
  	       dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] );

-	SET_MODULE_OWNER(dev);
  	return dev;

 err_out_res:
@@ -2291,7 +2294,7 @@ static int atmel_set_scan(struct net_dev
  		return -EAGAIN;

 	/* Timeout old surveys. */
-	if ((jiffies - priv->last_survey) > (20 * HZ))
+	if (time_after(jiffies, data->last_updated + HZ * 20))
  		priv->site_survey_state = SITE_SURVEY_IDLE;
  	priv->last_survey = jiffies;




Signed-off-by: Robert Carr <rcarrlkm@gmail.com>

                 reply	other threads:[~2006-08-22  2:28 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=c0835eaf0608211928k706cdb0bve3b08012d61b03f1@mail.gmail.com \
    --to=rcarrlkm@gmail.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®