netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Emil Renner Berthing <kernel@esmil.dk>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	Ping-Ke Shih <pkshih@realtek.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Allen Pais <allen.lkml@gmail.com>,
	Romain Perier <romain.perier@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rtlwifi: use tasklet_setup to initialize rx_work_tasklet
Date: Wed, 27 Jan 2021 17:33:10 +0200	[thread overview]
Message-ID: <87lfce8keh.fsf@codeaurora.org> (raw)
In-Reply-To: <CANBLGcwmTt2bmpwST1qHzOFhVoYYPC_gEz3nARzR9mOOg6nOHA@mail.gmail.com> (Emil Renner Berthing's message of "Wed, 27 Jan 2021 16:25:39 +0100")

Emil Renner Berthing <kernel@esmil.dk> writes:

> On Wed, 27 Jan 2021 at 16:20, Kalle Valo <kvalo@codeaurora.org> wrote:
>>
>> Willem de Bruijn <willemdebruijn.kernel@gmail.com> writes:
>>
>> > On Wed, Jan 27, 2021 at 5:23 AM Emil Renner Berthing <kernel@esmil.dk> wrote:
>> >>
>> >> In commit d3ccc14dfe95 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 6b8c7574a5f8 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.
>> >>
>> >> Fixes: 6b8c7574a5f8 ("rtlwifi: fix build warning")
>> >> Fixes: d3ccc14dfe95 ("rtlwifi/rtw88: convert tasklets to use new
>> >> tasklet_setup() API")
>> >> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
>> >
>> > Since the current code works, this could target net-next
>>
>> This should go to wireless-drivers-next, not net-next.
>>
>> > without Fixes tags.
>>
>> Correct, no need for Fixes tag as there's no bug to fix. This is only
>> cleanup AFAICS.

Forgot to mention that I can remove the Fixes tags during commit, so no
need to resend just because of those.

> I can definitely see how you can reasonably disagree, but I would not
> be comfortable having code that only works because the calling
> conventions of all relevant architectures happen to put the first
> unsigned long argument and the first pointer argument in the same
> register.

If there's a bug this patch fixes please explain it clearly in the
commit log. But as I read it (though I admit very quickly) I understood
this is just cleanup.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2021-01-27 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 17:15 [PATCH] rtlwifi: use tasklet_setup to initialize rx_work_tasklet Emil Renner Berthing
2021-01-27 14:47 ` Willem de Bruijn
2021-01-27 15:19   ` Kalle Valo
2021-01-27 15:25     ` Emil Renner Berthing
2021-01-27 15:33       ` Kalle Valo [this message]
2021-01-27 16:01         ` Emil Renner Berthing
2021-02-08 10:38 ` Kalle Valo

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=87lfce8keh.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=allen.lkml@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kernel@esmil.dk \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=romain.perier@gmail.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /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).