diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-05-02 05:50:03 -0400 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-05-28 21:01:58 -0400 |
commit | 052991d7ac7f7b2c0319e6ccd2e8a48a71f2bd58 (patch) | |
tree | 07706156ef906951c2f602aadfa7793c4409aa0b /drivers/net/wimax | |
parent | 8ac1101f8cd58a62517ba86745bc000d3a21f09b (diff) |
wimax/i2400m: remove redundant readiness checks from i2400m_report_tlv_*()
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>
Diffstat (limited to 'drivers/net/wimax')
-rw-r--r-- | drivers/net/wimax/i2400m/control.c | 6 | ||||
-rw-r--r-- | 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 b42e34727983..bd193ae2178b 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, | |||
292 | 292 | ||
293 | d_fnstart(3, dev, "(i2400m %p ss %p [%u])\n", i2400m, ss, i2400m_state); | 293 | d_fnstart(3, dev, "(i2400m %p ss %p [%u])\n", i2400m, ss, i2400m_state); |
294 | 294 | ||
295 | if (unlikely(i2400m->ready == 0)) /* act if up */ | ||
296 | goto out; | ||
297 | if (i2400m->state != i2400m_state) { | 295 | if (i2400m->state != i2400m_state) { |
298 | i2400m->state = i2400m_state; | 296 | i2400m->state = i2400m_state; |
299 | wake_up_all(&i2400m->state_wq); | 297 | wake_up_all(&i2400m->state_wq); |
@@ -341,7 +339,6 @@ void i2400m_report_tlv_system_state(struct i2400m *i2400m, | |||
341 | i2400m->bus_reset(i2400m, I2400M_RT_WARM); | 339 | i2400m->bus_reset(i2400m, I2400M_RT_WARM); |
342 | break; | 340 | break; |
343 | }; | 341 | }; |
344 | out: | ||
345 | d_fnend(3, dev, "(i2400m %p ss %p [%u]) = void\n", | 342 | d_fnend(3, dev, "(i2400m %p ss %p [%u]) = void\n", |
346 | i2400m, ss, i2400m_state); | 343 | i2400m, ss, i2400m_state); |
347 | } | 344 | } |
@@ -372,8 +369,6 @@ void i2400m_report_tlv_media_status(struct i2400m *i2400m, | |||
372 | 369 | ||
373 | d_fnstart(3, dev, "(i2400m %p ms %p [%u])\n", i2400m, ms, status); | 370 | d_fnstart(3, dev, "(i2400m %p ms %p [%u])\n", i2400m, ms, status); |
374 | 371 | ||
375 | if (unlikely(i2400m->ready == 0)) /* act if up */ | ||
376 | goto out; | ||
377 | switch (status) { | 372 | switch (status) { |
378 | case I2400M_MEDIA_STATUS_LINK_UP: | 373 | case I2400M_MEDIA_STATUS_LINK_UP: |
379 | netif_carrier_on(net_dev); | 374 | netif_carrier_on(net_dev); |
@@ -393,7 +388,6 @@ void i2400m_report_tlv_media_status(struct i2400m *i2400m, | |||
393 | dev_err(dev, "HW BUG? unknown media status %u\n", | 388 | dev_err(dev, "HW BUG? unknown media status %u\n", |
394 | status); | 389 | status); |
395 | }; | 390 | }; |
396 | out: | ||
397 | d_fnend(3, dev, "(i2400m %p ms %p [%u]) = void\n", | 391 | d_fnend(3, dev, "(i2400m %p ms %p [%u]) = void\n", |
398 | i2400m, ms, status); | 392 | i2400m, ms, status); |
399 | } | 393 | } |
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c index a4adc78102fb..7643850a6fb8 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) | |||
177 | struct i2400m_work *iw = | 177 | struct i2400m_work *iw = |
178 | container_of(ws, struct i2400m_work, ws); | 178 | container_of(ws, struct i2400m_work, ws); |
179 | struct i2400m_report_hook_args *args = (void *) iw->pl; | 179 | struct i2400m_report_hook_args *args = (void *) iw->pl; |
180 | i2400m_report_hook(iw->i2400m, args->l3l4_hdr, args->size); | 180 | if (iw->i2400m->ready) |
181 | i2400m_report_hook(iw->i2400m, args->l3l4_hdr, args->size); | ||
181 | kfree_skb(args->skb_rx); | 182 | kfree_skb(args->skb_rx); |
182 | i2400m_put(iw->i2400m); | 183 | i2400m_put(iw->i2400m); |
183 | kfree(iw); | 184 | kfree(iw); |