All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Tom Rix <trix@redhat.com>, Kalle Valo <kvalo@kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH] [v2] wifi: rtw89: cleanup firmware elements parsing
Date: Fri, 20 Oct 2023 05:54:15 +0000	[thread overview]
Message-ID: <03284f2e74444d5ebf103dfe46bf5657@realtek.com> (raw)
In-Reply-To: <20231020040940.33154-1-dmantipov@yandex.ru>



> -----Original Message-----
> From: Dmitry Antipov <dmantipov@yandex.ru>
> Sent: Friday, October 20, 2023 12:10 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Tom Rix <trix@redhat.com>; Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; Dmitry
> Antipov <dmantipov@yandex.ru>
> Subject: [PATCH] [v2] wifi: rtw89: cleanup firmware elements parsing
> 
> When compiling with clang-18, I've noticed the following:
> 
> drivers/net/wireless/realtek/rtw89/fw.c:389:28: warning: cast to smaller
> integer type 'enum rtw89_fw_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
>   389 |         enum rtw89_fw_type type = (enum rtw89_fw_type)data;
>       |                                   ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/wireless/realtek/rtw89/fw.c:569:13: warning: cast to smaller
> integer type 'enum rtw89_rf_path' from 'const void *' [-Wvoid-pointer-to-enum-cast]
>   569 |                 rf_path = (enum rtw89_rf_path)data;
>       |                           ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> So avoid brutal everything-to-const-void-and-back casts, introduce
> 'union rtw89_fw_element_arg' to pass parameters to element handler
> callbacks, and adjust all of the related bits accordingly. Compile
> tested only.
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>

I take this patch locally, and performance looks as regular. Thanks.

Acked-and-tested-by: Ping-Ke Shih <pkshih@realtek.com>



  reply	other threads:[~2023-10-20  5:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19  9:38 [PATCH] wifi: rtw89: fix clang-specific -Wvoid-pointer-to-enum-cast Dmitry Antipov
2023-10-20  3:15 ` Ping-Ke Shih
2023-10-20  4:09   ` [PATCH] [v2] wifi: rtw89: cleanup firmware elements parsing Dmitry Antipov
2023-10-20  5:54     ` Ping-Ke Shih [this message]
2023-10-25  9:09     ` 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=03284f2e74444d5ebf103dfe46bf5657@realtek.com \
    --to=pkshih@realtek.com \
    --cc=dmantipov@yandex.ru \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=trix@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.