Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1235236lqt; Tue, 19 Mar 2024 18:07:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVfD/qedMg4r+tM953a+3RPOTZn14QfqxBga5BJc5QfmQ8FPrh2PsFUeFy2k1ylHcBWRp7o7ergA1cOhQUpnk5SLqCuNLTnKA04jrOqnQ== X-Google-Smtp-Source: AGHT+IFdUxp5cLUudIbVLD4oDQQYTgQnWwVKpIpEtvJAtIRJ5rrmHKu7VrTJ+XUBO4+bquKYe6qF X-Received: by 2002:a17:907:a70f:b0:a46:671a:75f1 with SMTP id vw15-20020a170907a70f00b00a46671a75f1mr12339013ejc.3.1710896823722; Tue, 19 Mar 2024 18:07:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710896823; cv=pass; d=google.com; s=arc-20160816; b=VCGJiGNcpCCDMmiHlspYtzTYWj3D/YArxMKqzxXsak0WnbXM9VeVTl20L6AYvURCWm LNAav8QvjeBqYfkEAjVh8zdt2htJqQ+M6Uq3i3gtyZMnaolm5kK5WzugmZX+3yN2HFP4 EOOlShnDwmXdLkd7N+5tql/wAcq2/lK7wBnRnRxxU7fcQJY1Ttv6to7ogmFM31tdPIi6 PrQsEMkAHWbF/nplCqMCaaIsK82osxdQ5DqSvsQUhQbfXcCyIWwx/oZ3o+RxYeKaKjQY ifKoENNCUZ8gJktscG+k7gWpX6D9kF74p95gulxsihBVO5CN6HPRBhnTK4NsqJWe1xu7 7EeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=t/h71+wlEHwsYZEPUlyMmXrPN2hMz8pUG7Chz3Ai/os=; fh=MxTMBbpPis+LJg6f98kFxxaQtu01YonzaHniHOzTjro=; b=ag+ISdw2gs1OSaJkVk5LTePIU3XbmsLP+IAi+KJNhYdjQKXDhqQ6jRpBBuncJsCcap VGEYcwRmbm8T0huAxofSHNTlfwe56R+cathD36E+dqh3HlEUfB23IA7IL5SqvpYncIT+ ADEOexCKclLL1AHEx/SNplJ0FdYhLbqKAXvKKQ5/a3+v7nYbQw+juvLpw25Glw2MEkp3 hP5wtZjlIhrZJxXje/N2pun0ILWt5c7U+3bejQf23e9isN16hgNpIjfJjfio+VoyMMlT KWvjCC/0IR0EMuB9oGX8Sz5e7Nqup7MaruVJ7X+Livuy+bbvHP2JSnNwNd/Bq1DR934v c+7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Ikhg9kGp; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-4938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hr17-20020a1709073f9100b00a46a9d5ea2csi3573725ejc.907.2024.03.19.18.07.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 18:07:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Ikhg9kGp; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-4938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 428B41F240FA for ; Wed, 20 Mar 2024 01:06:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE384522F; Wed, 20 Mar 2024 01:06:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Ikhg9kGp" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C6264C90 for ; Wed, 20 Mar 2024 01:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710896803; cv=none; b=tvMpvG1R56ZCxtAZKrVBbGhrnslzvzehQ2iAbCI5jYzyXJc7/K2wgkL+SUFKlmkqJBmvmxW8wmgJ97oKr1c4pmz1+eiJYzI6p/5a1vBztsgmbJaomcSg6oHQpbENuxUjaSbfN5tz1mG0hh1p2JCiqU+RQzO98Awj/ogeq7U78LU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710896803; c=relaxed/simple; bh=BswgVwet0J1iiomw+BzU2YYJCD31yL0733y/fU+Ptrc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=h9IWSVvW14bSD9eRHPNOB3eZwcBUmgFkkTLSmdAfm4vzqN3ND8A5QVBsnhPAf2CUP7CNsnPDDrype9pjjXkg2Dq4fpNZuosjYK9gtWutHCgoz4RW8vdmcYGvbC+HUIJyvH99yf0oA80ZbaE+Pxltkx05KrCXhe2Gcaotjil3NvY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Ikhg9kGp; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42K0wwE0024144; Wed, 20 Mar 2024 01:06:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=t/h71+wlEHwsYZEPUlyMmXrPN2hMz8pUG7Chz3Ai/os=; b=Ik hg9kGpyhLOHYUXchOX87MI0ULCB9LsM2XWa3SB3tPXXhY7P9HKayyOQytMgsQ6H+ allAsskeBHG2ZAp6stKth64rA3SeVvmyzdqTHIYcBEHO1LUaRKrmbHoFVKNy2pMl NTFkG5YGiMNvvJTBSwoPseEVtv4s5gNDY8Y02oxrNveOMYAop1SKrThuvG60gMkA X4PCLcHtbhRToL4DInwVWt0IfKymnw/dRZj8q2u9VhKk/JDZ3usTWgd4TuAPnZGS 3USVU1xROHpOfWmKco2migH5cMibRGd7ME/XtZcR4jPGJO9BL2C7HiGqWhV+JmCe nej5F8Q+D2r4oegEBNig== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wy9ee9u4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Mar 2024 01:06:38 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42K16bQ1013151 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Mar 2024 01:06:37 GMT Received: from hu-periyasa-blr.qualcomm.com (10.80.80.8) 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.40; Tue, 19 Mar 2024 18:06:36 -0700 From: Karthikeyan Periyasamy To: CC: , Karthikeyan Periyasamy Subject: [PATCH v2 3/3] wifi: ath12k: Refactor error handler of Rxdma replenish Date: Wed, 20 Mar 2024 06:36:15 +0530 Message-ID: <20240320010615.91331-4-quic_periyasa@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320010615.91331-1-quic_periyasa@quicinc.com> References: <20240320010615.91331-1-quic_periyasa@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: c7EhqJqvGPmcKRB0I08AceHAHZ5PcGCB X-Proofpoint-ORIG-GUID: c7EhqJqvGPmcKRB0I08AceHAHZ5PcGCB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-19_10,2024-03-18_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=874 bulkscore=0 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 suspectscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403140001 definitions=main-2403200006 The Rxdma replenish handler currently contains redundant code in both the success and error cases. To avoid the redundant code, implement a conditional jump mechanism by placing a goto statement to prevent unnecessary execution of the error handling code when the operation is successful. This change streamline the code readability and enhance its efficiency. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy --- drivers/net/wireless/ath/ath12k/dp_rx.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index 2a0e4faadcf1..a593beecdd12 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -337,7 +337,7 @@ int ath12k_dp_rx_bufs_replenish(struct ath12k_base *ab, num_remain = req_entries; if (!num_remain) - goto skip_replenish; + goto out; /* Get the descriptor from free list */ if (list_empty(used_list)) { @@ -389,22 +389,14 @@ int ath12k_dp_rx_bufs_replenish(struct ath12k_base *ab, ath12k_hal_rx_buf_addr_info_set(desc, paddr, cookie, mgr); } -skip_replenish: - ath12k_hal_srng_access_end(ab, srng); - - if (!list_empty(used_list)) - ath12k_dp_rx_enqueue_free(dp, used_list); - - spin_unlock_bh(&srng->lock); - - return req_entries - num_remain; + goto out; fail_dma_unmap: dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), DMA_FROM_DEVICE); fail_free_skb: dev_kfree_skb_any(skb); - +out: ath12k_hal_srng_access_end(ab, srng); if (!list_empty(used_list)) -- 2.34.1