Skip to content

Commit 052991d

Browse files
author
Inaky Perez-Gonzalez
committed
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>
1 parent 8ac1101 commit 052991d

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

‎drivers/net/wimax/i2400m/control.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,6 @@ void i2400m_report_tlv_system_state(struct i2400m *i2400m,
292292

293293
d_fnstart(3, dev, "(i2400m %p ss %p [%u])\n", i2400m, ss, i2400m_state);
294294

295-
if (unlikely(i2400m->ready == 0)) /* act if up */
296-
goto out;
297295
if (i2400m->state != i2400m_state) {
298296
i2400m->state = i2400m_state;
299297
wake_up_all(&i2400m->state_wq);
@@ -341,7 +339,6 @@ void i2400m_report_tlv_system_state(struct i2400m *i2400m,
341339
i2400m->bus_reset(i2400m, I2400M_RT_WARM);
342340
break;
343341
};
344-
out:
345342
d_fnend(3, dev, "(i2400m %p ss %p [%u]) = void\n",
346343
i2400m, ss, i2400m_state);
347344
}
@@ -372,8 +369,6 @@ void i2400m_report_tlv_media_status(struct i2400m *i2400m,
372369

373370
d_fnstart(3, dev, "(i2400m %p ms %p [%u])\n", i2400m, ms, status);
374371

375-
if (unlikely(i2400m->ready == 0)) /* act if up */
376-
goto out;
377372
switch (status) {
378373
case I2400M_MEDIA_STATUS_LINK_UP:
379374
netif_carrier_on(net_dev);
@@ -393,7 +388,6 @@ void i2400m_report_tlv_media_status(struct i2400m *i2400m,
393388
dev_err(dev, "HW BUG? unknown media status %u\n",
394389
status);
395390
};
396-
out:
397391
d_fnend(3, dev, "(i2400m %p ms %p [%u]) = void\n",
398392
i2400m, ms, status);
399393
}

‎drivers/net/wimax/i2400m/rx.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ void i2400m_report_hook_work(struct work_struct *ws)
177177
struct i2400m_work *iw =
178178
container_of(ws, struct i2400m_work, ws);
179179
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);
181182
kfree_skb(args->skb_rx);
182183
i2400m_put(iw->i2400m);
183184
kfree(iw);

0 commit comments

Comments
 (0)