]> git.baikalelectronics.ru Git - kernel.git/commit
rtlwifi: use tasklet_setup to initialize rx_work_tasklet
authorEmil Renner Berthing <kernel@esmil.dk>
Tue, 26 Jan 2021 17:15:50 +0000 (18:15 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 8 Feb 2021 10:37:49 +0000 (12:37 +0200)
commit53536fe7dbede53e8713ce6518b4b214361d754c
tree79d5bcc7fd81b7a8425c73f82458f4251a5bad74
parent57f0bccc4c0ef5f4b06c28e9e1cf2996ae6ace63
rtlwifi: use tasklet_setup to initialize rx_work_tasklet

In commit c1d19f2322f0 most of the tasklets in this driver was
updated to the new API. However for the rx_work_tasklet only the
type of the callback was changed from
  void _rtl_rx_work(unsigned long data)
to
  void _rtl_rx_work(struct tasklet_struct *t).

The initialization of rx_work_tasklet was still open-coded and the
function pointer just cast into the old type, and hence nothing sets
rx_work_tasklet.use_callback = true and the callback was still called as

  t->func(t->data);

with uninitialized/zero t->data.

Commit 6582deb7da99 changed the casting of _rtl_rx_work a bit and
initialized t->data to a pointer to the tasklet cast to an unsigned
long.

This way calling t->func(t->data) might actually work through all the
casting, but it still doesn't update the code to use the new tasklet
API.

Let's use the new tasklet_setup to initialize rx_work_tasklet properly
and set rx_work_tasklet.use_callback = true so that the callback is
called as

  t->callback(t);

without all the casting.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210126171550.3066-1-kernel@esmil.dk
drivers/net/wireless/realtek/rtlwifi/usb.c