Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4466655rdb; Fri, 15 Sep 2023 03:13:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaZajLhn/UhplK+AXyLHuC6vKfGjqkahZcEchvr5IUE04JtdrG2t/R8SxgTUusbfNyMf5T X-Received: by 2002:a05:6a21:7888:b0:14d:7130:7bb3 with SMTP id bf8-20020a056a21788800b0014d71307bb3mr1555425pzc.13.1694772790490; Fri, 15 Sep 2023 03:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694772790; cv=none; d=google.com; s=arc-20160816; b=WVzvPvXz2a3gObXolCXVbVfn1ZzttiyD3e0Yd3rbJm/FY+J3BW0IZ6CGp1EM2kClXI zcj0AcPZRL3qKQXbamgA6jocgF4w1ixL6/fv4H2BwrRomIUkKg2e7hfjSqdSoay/P5ji iM9YLjqe7fDNFL+8ZYTcK0I6wMVgVynQ/Nc3197DmpL3oChAM6hXnIJRn9pf+iZaK+UN EK5svBx+cV/Xxc5X5jSec7rtB7JTy1Ohzxwj2QLpXy0uUnCz1HZT3psKyXo94lJrfuJk P5rNOMjt42dlL7ddATLyL7YmLWW/S5rMYk29lYqvIdqGRq/xw1fFg5L2dpWkgq2xvmeo uBPg== 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:cc:to :content-language:subject:user-agent:mime-version:date:message-id; bh=sjbZ2MsTpNiPLS2JsuO9WaiI//4N1i06nYz8qxsw6mo=; fh=mTbNqW48mC4Y1XwCwKtCzSbzmSdhOh/9TRMdHOkU8D0=; b=fQcNHtnNOR+K3Ujs59HACXggLEIrT7VApgJkTq2lbxu4D8YXuS1iN0RdYdTKlAHweA I6k/V0B/z85UZINhxV2irD4HDEs09SlZD+VExdBTvhvmiDVZDYa0KBV3k1wpkUe97lti Zhjg38fkH6pIEc6gYBQaq7uyFa7GU55K+8iJB4L+/wwhK/lspz6BZ7HMrACOQnYuwcE0 AGArRPt0yvLUv3FUq0tEGbxTdTEmBtrDp4rKMMe6q5b4sZ2tzF2EAF7pjSCjqWMOycrW ye3LUmNimU+MLDVOpun23Oe6jTYMb1esNt7UkYELpbjTvT7HtY/Lq/8tAFweCXE37pVT 9HTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id cr7-20020a056a000f0700b0068e29a05fa4si3027883pfb.326.2023.09.15.03.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 03:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 36F4B809C3A0; Fri, 15 Sep 2023 03:06:29 -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 S234102AbjIOKGY (ORCPT + 57 others); Fri, 15 Sep 2023 06:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233958AbjIOKGX (ORCPT ); Fri, 15 Sep 2023 06:06:23 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 632ED30E6; Fri, 15 Sep 2023 03:05:33 -0700 (PDT) Received: from [172.30.11.106] (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 959CE60AB00DC; Fri, 15 Sep 2023 18:05:30 +0800 (CST) Message-ID: <5bb164e7-c147-64d1-031d-0ba20cfffa77@nfschina.com> Date: Fri, 15 Sep 2023 18:05:29 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH wireless-next 7/9] wifi: ath12k: Remove unnecessary (void*) conversions Content-Language: en-US To: Jeff Johnson , kvalo@kernel.org Cc: ath12k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org X-MD-Sfrom: yunchuan@nfschina.com X-MD-SrcIP: 180.167.10.98 From: yunchuan In-Reply-To: <7427d5aa-902a-4013-8aa9-f986bb5218a4@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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 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]); Fri, 15 Sep 2023 03:06:29 -0700 (PDT) On 2023/9/15 01:06, Jeff Johnson wrote: > 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 > Hi, Sounds like a good idea, I will check other patches for this situation. Thanks for your suggestions. Wu Yunchuan