netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Inaky Perez-Gonzalez <inaky@linux.intel.com>
To: netdev@vger.kernel.org, wimax@linuxwimax.org
Subject: [patch 2.6.31 05/10] wimax/i2400m: remove redundant readiness checks from i2400m_report_tlv_*()
Date: Wed, 27 May 2009 18:05:10 -0700	[thread overview]
Message-ID: <74bd64a25b220d21e50c7c9a85f26ff6617b3728.1243472510.git.inaky@linux.intel.com> (raw)
In-Reply-To: <ba98dde3cde9f5910789b32852c692fc8cd0a4aa.1243472510.git.inaky@linux.intel.com>
In-Reply-To: <cover.1243472509.git.inaky@linux.intel.com>

Functions i2400m_report_tlv*() are only called from
i2400m_report_hook(), called in a workqueue by
i2400m_report_hook_work(). The scheduler checks for device readiness
before scheduling.

Added an extra check for readiness in i2400m_report_hook_work(), which
makes all the checks down the line redundant.

Obviously the device state could change in the middle, but error
handling would take care of that.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
---
 drivers/net/wimax/i2400m/control.c |    6 ------
 drivers/net/wimax/i2400m/rx.c      |    3 ++-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wimax/i2400m/control.c b/drivers/net/wimax/i2400m/control.c
index b42e347..bd193ae 100644
--- a/drivers/net/wimax/i2400m/control.c
+++ b/drivers/net/wimax/i2400m/control.c
@@ -292,8 +292,6 @@ void i2400m_report_tlv_system_state(struct i2400m *i2400m,
 
 	d_fnstart(3, dev, "(i2400m %p ss %p [%u])\n", i2400m, ss, i2400m_state);
 
-	if (unlikely(i2400m->ready == 0))	/* act if up */
-		goto out;
 	if (i2400m->state != i2400m_state) {
 		i2400m->state = i2400m_state;
 		wake_up_all(&i2400m->state_wq);
@@ -341,7 +339,6 @@ void i2400m_report_tlv_system_state(struct i2400m *i2400m,
 		i2400m->bus_reset(i2400m, I2400M_RT_WARM);
 		break;
 	};
-out:
 	d_fnend(3, dev, "(i2400m %p ss %p [%u]) = void\n",
 		i2400m, ss, i2400m_state);
 }
@@ -372,8 +369,6 @@ void i2400m_report_tlv_media_status(struct i2400m *i2400m,
 
 	d_fnstart(3, dev, "(i2400m %p ms %p [%u])\n", i2400m, ms, status);
 
-	if (unlikely(i2400m->ready == 0))	/* act if up */
-		goto out;
 	switch (status) {
 	case I2400M_MEDIA_STATUS_LINK_UP:
 		netif_carrier_on(net_dev);
@@ -393,7 +388,6 @@ void i2400m_report_tlv_media_status(struct i2400m *i2400m,
 		dev_err(dev, "HW BUG? unknown media status %u\n",
 			status);
 	};
-out:
 	d_fnend(3, dev, "(i2400m %p ms %p [%u]) = void\n",
 		i2400m, ms, status);
 }
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c
index a4adc78..7643850 100644
--- a/drivers/net/wimax/i2400m/rx.c
+++ b/drivers/net/wimax/i2400m/rx.c
@@ -177,7 +177,8 @@ void i2400m_report_hook_work(struct work_struct *ws)
 	struct i2400m_work *iw =
 		container_of(ws, struct i2400m_work, ws);
 	struct i2400m_report_hook_args *args = (void *) iw->pl;
-	i2400m_report_hook(iw->i2400m, args->l3l4_hdr, args->size);
+	if (iw->i2400m->ready)
+		i2400m_report_hook(iw->i2400m, args->l3l4_hdr, args->size);
 	kfree_skb(args->skb_rx);
 	i2400m_put(iw->i2400m);
 	kfree(iw);
-- 
1.6.2.3


  reply	other threads:[~2009-05-28  1:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28  1:05 [patch 2.6.31 00/10] WiMAX pull request Inaky Perez-Gonzalez
2009-05-28  1:05 ` [patch 2.6.31 01/10] wimax/i2400m: generate fake source MAC address with random_ether_addr() Inaky Perez-Gonzalez
2009-05-28  1:05   ` [patch 2.6.31 02/10] wimax/i2400m: trace commands sent from user space on the "echo" pipe Inaky Perez-Gonzalez
2009-05-28  1:05     ` [patch 2.6.31 03/10] wimax/i2400m: allow kernel commands to device to be logged too Inaky Perez-Gonzalez
2009-05-28  1:05       ` [patch 2.6.31 04/10] wimax/i2400m: factor out 'state report's TLV handling to a function Inaky Perez-Gonzalez
2009-05-28  1:05         ` Inaky Perez-Gonzalez [this message]
2009-05-28  1:05           ` [patch 2.6.31 06/10] wimax: document why wimax_msg_*() operations can be used in any state Inaky Perez-Gonzalez
2009-05-28  1:05             ` [patch 2.6.31 07/10] wimax/i2400m: sdio: set the block size before enabling the function Inaky Perez-Gonzalez
2009-05-28  1:05               ` [patch 2.6.31 08/10] wimax: Add netlink interface to get device state Inaky Perez-Gonzalez
2009-05-28  1:05                 ` [patch 2.6.31 09/10] wimax/i2400m: usb: fix device reset on autosuspend while not yet idle Inaky Perez-Gonzalez
2009-05-28  1:05                   ` [patch 2.6.31 10/10] wimax: a new API call was added, increment minor protocol version number Inaky Perez-Gonzalez
2009-05-28  1:21                 ` [patch 2.6.31 08/10] wimax: Add netlink interface to get device state Stephen Hemminger
2009-05-28 16:16                   ` Inaky Perez-Gonzalez
2009-05-28 22:06                     ` David Miller
2009-05-28 22:09                       ` Inaky Perez-Gonzalez
  -- strict thread matches above, loose matches on Subject: below --
2009-05-29  1:12 [patch 2.6.31 00/10] WiMAX pull request (v2) Inaky Perez-Gonzalez
2009-05-29  1:12 ` [patch 2.6.31 05/10] wimax/i2400m: remove redundant readiness checks from i2400m_report_tlv_*() Inaky Perez-Gonzalez

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=74bd64a25b220d21e50c7c9a85f26ff6617b3728.1243472510.git.inaky@linux.intel.com \
    --to=inaky@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=wimax@linuxwimax.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;
as well as URLs for NNTP newsgroup(s).