Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4233787rdb; Thu, 14 Sep 2023 16:36:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWNQCT4K9iCykQe27EdBLQkIvYtCW+nX2MPYTQ7uRqJ7C4kFUsbIfBZeOmS1Csr3DRdXLN X-Received: by 2002:a05:6a20:5648:b0:154:b4cb:2e8c with SMTP id is8-20020a056a20564800b00154b4cb2e8cmr252970pzc.24.1694734562861; Thu, 14 Sep 2023 16:36:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694734562; cv=none; d=google.com; s=arc-20160816; b=Xhr4a1llF98THZnnu3xDl7g4cm8Y1rb1lCqO6ERToB88v/8rJ56/l8sZ9keZr0GokP 8uqf7BRHJnMfMImW6S2hIwnzLzbuGTo8OuI/aLolQzQcZMdzO2cPDQt+l4ijd7X+Nwxy hBQpx39hOGTkBB6cSFX8c6C8DRfKGqGFA0K9Yq/eOzgRalwisKn3zRmHbsqcNuqjvNi2 uPvsKaXGRsl/suPfOI8BbPFvHb8qYvYUI7AmGMd3rgLjg9iFSPA7RB2NTtziVV/9o8uQ 1UrfEncQV3tNoN5jIjgxU0o9rH4XVtfNlKpsx2wppYhif/JxJYP4SrJXYGuVc1BZdZh/ GgjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=VS5omclDy3oniz92XfXL1gqbRojQdj9K/4l/+LddOJ0=; fh=LCOVxoshOjscswlkwLhU7uwUF8EARZtMunIxgbfvf8U=; b=Kgk3kkFadzV/XJaiHa6GEMUZuvuCEmun2U3cpubnHOHk2WzVeXipBg6sa/n9Kv2cCf 8hTLXbEVqINlyZyTeh5HNzDNqPV5eaUd/L6iFmEeQfPmN2YKFWoOzUhFVntOsnhaApB6 l+DwykR6WL+5DZU+WyRKqvLorng+oaH+TrJwGSAMiC+ojOtYfgNIbaC5EKBtz++o8FjA TiHkeX4/IjMONRPxTW5N+Pul+Jz2o9mzwIa899P65KNTSUR/+Lo27Nb0expH8H2eqEBy UdvabAsq5mCatsrCIpeFAPsiWGYisCB0hAlgimGMHOaXKqaWr2FYcY3kzwvQzBVTf993 MIBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QAyD27Tf; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y16-20020a170902b49000b001c38d1cd443si2301027plr.238.2023.09.14.16.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 16:36:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QAyD27Tf; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 270FB8062935; Thu, 14 Sep 2023 10:07:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238709AbjINRHL (ORCPT + 57 others); Thu, 14 Sep 2023 13:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232000AbjINRHK (ORCPT ); Thu, 14 Sep 2023 13:07:10 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E36D11FE1; Thu, 14 Sep 2023 10:07:05 -0700 (PDT) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38EFEPat026692; Thu, 14 Sep 2023 17:06:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=VS5omclDy3oniz92XfXL1gqbRojQdj9K/4l/+LddOJ0=; b=QAyD27Tfoq3ApMqGseXEJMgkHjxE4aLrzxF91opPn4+NvyscQ7HHOkzBCay457yTYnVc aRs8IqLAbp8P8pVOhhRVjtyoFRZbWYe0ox+W16SzQPOt5nPYMge+Em0dnwxZjOAEu8a4 YEkGRcO8GJBLteYJRskkvyw6qGVk/kg+2R6JH5ElZ/BQ/HXcLmYBw6KFEZOVNoezZFC/ Gdgl9yQ9LT3tLk6vaWQOEoGPizwhDhsmiYECWZBTk4ZVqLvLRgeYa7pDSK6Zexr7kgUH P2IzbMraTe+EvPTi1st8uWD6kF7uVSD5Nn0mBWQ8U0+BdD87NBLJRXVxlBgNhOL46Kis Jg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t3wx19kps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 17:06:53 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38EH6qdc004174 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 17:06:52 GMT Received: from [10.111.183.186] (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Thu, 14 Sep 2023 10:06:52 -0700 Message-ID: <7427d5aa-902a-4013-8aa9-f986bb5218a4@quicinc.com> Date: Thu, 14 Sep 2023 10:06:51 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH wireless-next 7/9] wifi: ath12k: Remove unnecessary (void*) conversions Content-Language: en-US To: Wu Yunchuan , CC: , , , References: <20230914040525.1170102-1-yunchuan@nfschina.com> From: Jeff Johnson In-Reply-To: <20230914040525.1170102-1-yunchuan@nfschina.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Q1UfUiFg-rmx_-W3ymAyC5ujLujnkhDE X-Proofpoint-ORIG-GUID: Q1UfUiFg-rmx_-W3ymAyC5ujLujnkhDE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-14_09,2023-09-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 adultscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 impostorscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309140148 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 14 Sep 2023 10:07:16 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email On 9/13/2023 9:05 PM, Wu Yunchuan wrote: > No need cast (void*) to (struct hal_rx_ppdu_end_user_stats *), > (struct ath12k_rx_desc_info *) or (struct hal_tx_msdu_ext_desc *). > > Signed-off-by: Wu Yunchuan > --- > drivers/net/wireless/ath/ath12k/dp_mon.c | 6 ++---- > drivers/net/wireless/ath/ath12k/dp_rx.c | 2 +- > drivers/net/wireless/ath/ath12k/dp_tx.c | 2 +- > 3 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c > index f1e57e98bdc6..41cfe7bd865f 100644 > --- a/drivers/net/wireless/ath/ath12k/dp_mon.c > +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c > @@ -13,8 +13,7 @@ > static void ath12k_dp_mon_rx_handle_ofdma_info(void *rx_tlv, > struct hal_rx_user_status *rx_user_status) > { > - struct hal_rx_ppdu_end_user_stats *ppdu_end_user = > - (struct hal_rx_ppdu_end_user_stats *)rx_tlv; > + struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv; > > rx_user_status->ul_ofdma_user_v0_word0 = > __le32_to_cpu(ppdu_end_user->usr_resp_ref); > @@ -26,8 +25,7 @@ static void > ath12k_dp_mon_rx_populate_byte_count(void *rx_tlv, void *ppduinfo, > struct hal_rx_user_status *rx_user_status) > { > - struct hal_rx_ppdu_end_user_stats *ppdu_end_user = > - (struct hal_rx_ppdu_end_user_stats *)rx_tlv; > + struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv; > u32 mpdu_ok_byte_count = __le32_to_cpu(ppdu_end_user->mpdu_ok_cnt); > u32 mpdu_err_byte_count = __le32_to_cpu(ppdu_end_user->mpdu_err_cnt); > for both of the above IMO the better solution is to change the prototype to replace void *rx_tlv with struct hal_rx_ppdu_end_user_stats *ppdu_end_user and to remove the local variable further, I think you can add const to that since the TLV is only read, not written this better describes that the function requires a specific flavor of RX TLV rather than handling any RX TLV > diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c > index e6e64d437c47..ff5f66ca7783 100644 > --- a/drivers/net/wireless/ath/ath12k/dp_rx.c > +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c > @@ -3730,7 +3730,7 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab, > continue; > } > > - desc_info = (struct ath12k_rx_desc_info *)err_info.rx_desc; > + desc_info = err_info.rx_desc; this is ok > > /* retry manual desc retrieval if hw cc is not done */ > if (!desc_info) { > diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c > index 8874c815d7fa..98ddf46b3bb9 100644 > --- a/drivers/net/wireless/ath/ath12k/dp_tx.c > +++ b/drivers/net/wireless/ath/ath12k/dp_tx.c > @@ -109,7 +109,7 @@ static struct ath12k_tx_desc_info *ath12k_dp_tx_assign_buffer(struct ath12k_dp * > static void ath12k_hal_tx_cmd_ext_desc_setup(struct ath12k_base *ab, void *cmd, This function is only called from one place, and it is already passing a variable that is of type struct hal_tx_msdu_ext_desc * so IMO a better solution is to change the prototype to replace void *cmd with struct hal_tx_msdu_ext_desc *tcl_ext_desc and remove the local variable again this better describes that the function requires a specific payload rather than a generic opaque payload as a general rule, use void * when the payload has some level of opaqueness and use a specific struct * when the payload must be of a specific type > struct hal_tx_info *ti) > { > - struct hal_tx_msdu_ext_desc *tcl_ext_cmd = (struct hal_tx_msdu_ext_desc *)cmd; > + struct hal_tx_msdu_ext_desc *tcl_ext_cmd = cmd; > > tcl_ext_cmd->info0 = le32_encode_bits(ti->paddr, > HAL_TX_MSDU_EXT_INFO0_BUF_PTR_LO);