The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Arsenii Pashchenko <ulijg308@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/4] wifi: rtw88: rtw8822c: convert DAC IQ buffers and signatures to s32
Date: Fri, 14 Aug 2026 07:42:20 +0000	[thread overview]
Message-ID: <9242742673fc4ac09e8a9b0d2a4c5eb7@realtek.com> (raw)
In-Reply-To: <12e170032b884c8693a08c780fb8aa677aa4af4c.1786545572.git.ulijg308@gmail.com>

Arsenii Pashchenko <ulijg308@gmail.com> wrote:
> Prepare the DAC IQ calibration path for signed math by converting the
> temporary stack arrays 'iv' and 'qv' from u32 to s32. Update all
> internal function signatures to accept s32 pointers.
> 
> To guarantee bisectability, wrap the existing unsigned logic in
> temporary casts to u32. This maintains identical mathematical behavior
> and avoids any compiler sign-compare warnings.
> 
> Signed-off-by: Arsenii Pashchenko <ulijg308@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/rtw8822c.c | 49 +++++++++++--------
>  1 file changed, 28 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> index 244c80264..896e3e7b9 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
> @@ -153,9 +153,12 @@ static void rtw8822c_dac_restore_reg(struct rtw_dev *rtwdev,
>         }
>  }
> 
> -static void rtw8822c_rf_minmax_cmp(struct rtw_dev *rtwdev, u32 value,
> -                                  u32 *min, u32 *max)
> +static void rtw8822c_rf_minmax_cmp(struct rtw_dev *rtwdev, s32 value_s32,
> +                                  s32 *min_s32, s32 *max_s32)
>  {
> +       u32 value = (u32)value_s32;
> +       u32 *min = (u32 *)min_s32;
> +       u32 *max = (u32 *)max_s32;

blank line

Also, it is possible to avoid all casting from s32 to u32, even just a
transition patch? I guess compiler can silently ignore this, and it'd
be much easier to review. Otherwise, I need to check if you remove
these casting clearly. 

>         if (value >= 0x200) {
>                 if (*min >= 0x200) {
>                         if (*min > value)
> @@ -182,8 +185,10 @@ static void rtw8822c_rf_minmax_cmp(struct rtw_dev *rtwdev, u32 value,
>         }
>  }
> 
> -static void __rtw8822c_dac_iq_sort(struct rtw_dev *rtwdev, u32 *v1, u32 *v2)
> +static void __rtw8822c_dac_iq_sort(struct rtw_dev *rtwdev, s32 *v1_s32, s32 *v2_s32)
>  {
> +       u32 *v1 = (u32 *)v1_s32;
> +       u32 *v2 = (u32 *)v2_s32;

blank line

>         if (*v1 >= 0x200 && *v2 >= 0x200) {
>                 if (*v1 > *v2)
>                         swap(*v1, *v2);

[...]


  reply	other threads:[~2026-08-14  7:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 14:45 [PATCH 0/4] wifi: rtw88: rtw8822c: refactor DAC IQ calibration to s32 Arsenii Pashchenko
2026-08-12 14:45 ` [PATCH 1/4] wifi: rtw88: rtw8822c: convert DAC IQ buffers and signatures " Arsenii Pashchenko
2026-08-14  7:42   ` Ping-Ke Shih [this message]
2026-08-12 14:45 ` [PATCH 2/4] wifi: rtw88: rtw8822c: use sign_extend32 for DAC IQ validation Arsenii Pashchenko
2026-08-14  7:49   ` Ping-Ke Shih
2026-08-14  8:03     ` Ping-Ke Shih
2026-08-12 14:45 ` [PATCH 3/4] wifi: rtw88: rtw8822c: switch to the kernel's sort() library Arsenii Pashchenko
2026-08-14  7:57   ` Ping-Ke Shih
2026-08-12 14:45 ` [PATCH 4/4] wifi: rtw88: rtw8822c: simplify amplitude search and offset via s32 Arsenii Pashchenko
2026-08-14  8:10   ` Ping-Ke Shih

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=9242742673fc4ac09e8a9b0d2a4c5eb7@realtek.com \
    --to=pkshih@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=ulijg308@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