Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp678486rwr; Thu, 20 Apr 2023 05:10:39 -0700 (PDT) X-Google-Smtp-Source: AKy350a7FX5r/kfKdp+sPPZPdY8c1z0S2nJpI0A+dRQ8lt8TcwuIzoSekCh3KewmkmvwBbu6GOrc X-Received: by 2002:a05:6a00:14d2:b0:63b:7af1:47c9 with SMTP id w18-20020a056a0014d200b0063b7af147c9mr1516664pfu.13.1681992639167; Thu, 20 Apr 2023 05:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681992639; cv=none; d=google.com; s=arc-20160816; b=P+HtspHtD5mKU8y0rznveLp2QwmkmRbH6uAxCl3Qeo/tT5X1CSUsG29by2bFRPxXsb w4jdi1epix5f/DfOHX1/YP/KyIctivqrzasbDjnseuQLdNFqEpuLP7MT4E2ODtcUN3Gp jYx2A+o0uZoHbT5StZ6R+4fxjWx0Hr5H3A1jiyGJin/8KCbISPOUujSgEZl21u/2dmpk LGc2l+2+EBqSYfU9XNwBrVc3slod6QhIBgBolUu1wAiO9BZxUGKzZnZziIp0Bnk0g/3V 3JGAdcxRsTqptVmTbRPWgI2XdMPYNofkM33NVKraRnh0nUjlhdltViV8EvLvtPo5v5au XFjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=p+TbnmmYvqSa77jOGPBaTOH0lEIU5dKKi6f2LvhZta8=; b=VQ8AhVz3i3PB5LkSfmuYOmogjz5AMJQhBDmAE8HsVRZWgngXGlgJ+LFmBd38LseFk8 zMo2vPKArmAQPmltJ05Vu3fDQgi6cVlUV7bEM4L/ECGzUV57sFyu9TVIPDz2WkNZPxrv MGrsh7q/PAylvqw3icBfgr7X+o+VhenRPyhs/f7WuO0ZaVJeCvm+98mikQEfS4XAJ3zB 3SuqvaLJGjFY9CjzcyGMIBOByR4UhRk9aybKrK5EWTQ7d3V/oVtFjvwxKFAPYt0A8AWi ba1JyakjsyU2IicPNu31gkoITChFk+hK5Vhd5W7q/TOoGmkW+0jRdhjqLzvzMgIIwehT buCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=VOioj4Or; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a63170e000000b00508d4eae759si1429454pgl.231.2023.04.20.05.10.29; Thu, 20 Apr 2023 05:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=VOioj4Or; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234127AbjDTMJX (ORCPT + 63 others); Thu, 20 Apr 2023 08:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231827AbjDTMJV (ORCPT ); Thu, 20 Apr 2023 08:09:21 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E35373A89 for ; Thu, 20 Apr 2023 05:09:20 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33KArbSp019021; Thu, 20 Apr 2023 12:09:17 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-type; s=qcppdkim1; bh=p+TbnmmYvqSa77jOGPBaTOH0lEIU5dKKi6f2LvhZta8=; b=VOioj4OrVbNFVz0vofbOEdzBAAXWDTusI61ZgpSBeNxalaR4zDv5iKr38efou1/LpdY0 wAga4kS/SkQz2ClZsIGsTl0JzSRv7ME+yZArO9gsZlBJ1QcjEphAJF6iTaT3sGBTzZbK PDFqjPmBVDT/FT6a8kPODs1oZqQ6xiqx8nq/42lNIEIHEvunv60Sqxp8/gc14vj9vtgp MFiItgUKVtPCAEvUGXfGcXpumxVuY+W6DvvxpRN9cOIFDVJTYFvkxYXizkK3YOyaFDyo Yclqw8aflOBb+nNib5CUonBIree1HJyU3cWwIWHEeJulw+WeX2/e/EJ4ZnY68NHSKXvO Rg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q2ryq1kam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Apr 2023 12:09:17 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33KC9GQA001496 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 20 Apr 2023 12:09:16 GMT Received: from rajkbhag-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Thu, 20 Apr 2023 05:09:14 -0700 From: Raj Kumar Bhagat To: CC: , Govindaraj Saminathan , Raj Kumar Bhagat Subject: [PATCH v3 2/4] wifi: ath11k: optimize ath11k_tm_cmd_get_version Date: Thu, 20 Apr 2023 17:38:38 +0530 Message-ID: <20230420120840.18712-3-quic_rajkbhag@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230420120840.18712-1-quic_rajkbhag@quicinc.com> References: <20230420120840.18712-1-quic_rajkbhag@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: bWLspQSyZXwGGUp3TaYJ_Ae9IN8_CjJz X-Proofpoint-GUID: bWLspQSyZXwGGUp3TaYJ_Ae9IN8_CjJz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-20_08,2023-04-20_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=870 lowpriorityscore=0 clxscore=1015 mlxscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304200098 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Govindaraj Saminathan Currently ath11k_tm_cmd_get_version() uses local variable ret. optimize ath11k_tm_cmd_get_version() to avoid local variable use. Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Govindaraj Saminathan Signed-off-by: Raj Kumar Bhagat --- drivers/net/wireless/ath/ath11k/testmode.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/testmode.c b/drivers/net/wireless/ath/ath11k/testmode.c index ebeca5eb6a67..f562f860ebf3 100644 --- a/drivers/net/wireless/ath/ath11k/testmode.c +++ b/drivers/net/wireless/ath/ath11k/testmode.c @@ -24,7 +24,6 @@ static const struct nla_policy ath11k_tm_policy[ATH11K_TM_ATTR_MAX + 1] = { static int ath11k_tm_cmd_get_version(struct ath11k *ar, struct nlattr *tb[]) { struct sk_buff *skb; - int ret; ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE, "testmode cmd get version_major %d version_minor %d\n", @@ -36,18 +35,12 @@ static int ath11k_tm_cmd_get_version(struct ath11k *ar, struct nlattr *tb[]) if (!skb) return -ENOMEM; - ret = nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MAJOR, - ATH11K_TESTMODE_VERSION_MAJOR); - if (ret) { - kfree_skb(skb); - return ret; - } - - ret = nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MINOR, - ATH11K_TESTMODE_VERSION_MINOR); - if (ret) { + if (nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MAJOR, + ATH11K_TESTMODE_VERSION_MAJOR) || + nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MINOR, + ATH11K_TESTMODE_VERSION_MINOR)) { kfree_skb(skb); - return ret; + return -ENOBUFS; } return cfg80211_testmode_reply(skb); -- 2.17.1