From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E0BACDB474 for ; Fri, 20 Oct 2023 05:54:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346936AbjJTFyb convert rfc822-to-8bit (ORCPT ); Fri, 20 Oct 2023 01:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235623AbjJTFy3 (ORCPT ); Fri, 20 Oct 2023 01:54:29 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B8ACA for ; Thu, 19 Oct 2023 22:54:27 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 39K5sGxaD3838771, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.93/5.92) with ESMTPS id 39K5sGxaD3838771 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 13:54:16 +0800 Received: from RTEXMBS03.realtek.com.tw (172.21.6.96) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Fri, 20 Oct 2023 13:54:16 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS03.realtek.com.tw (172.21.6.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 20 Oct 2023 13:54:15 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::40c2:6c24:2df4:e6c7]) by RTEXMBS04.realtek.com.tw ([fe80::40c2:6c24:2df4:e6c7%5]) with mapi id 15.01.2375.007; Fri, 20 Oct 2023 13:54:15 +0800 From: Ping-Ke Shih To: Dmitry Antipov CC: Tom Rix , Kalle Valo , "linux-wireless@vger.kernel.org" Subject: RE: [PATCH] [v2] wifi: rtw89: cleanup firmware elements parsing Thread-Topic: [PATCH] [v2] wifi: rtw89: cleanup firmware elements parsing Thread-Index: AQHaAwuJwJleqZFKiUy1cRrrMiPrQ7BSK6sw Date: Fri, 20 Oct 2023 05:54:15 +0000 Message-ID: <03284f2e74444d5ebf103dfe46bf5657@realtek.com> References: <661e7dffafdb403abc2c4cab23c7d1ed@realtek.com> <20231020040940.33154-1-dmantipov@yandex.ru> In-Reply-To: <20231020040940.33154-1-dmantipov@yandex.ru> Accept-Language: en-US, zh-TW Content-Language: zh-TW x-originating-ip: [172.21.71.113] x-kse-serverinfo: RTEXMBS03.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > -----Original Message----- > From: Dmitry Antipov > Sent: Friday, October 20, 2023 12:10 PM > To: Ping-Ke Shih > Cc: Tom Rix ; Kalle Valo ; linux-wireless@vger.kernel.org; Dmitry > Antipov > 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 I take this patch locally, and performance looks as regular. Thanks. Acked-and-tested-by: Ping-Ke Shih