From patchwork Fri Jun 21 11:17:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Govindaraj Saminathan X-Patchwork-Id: 11009821 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71A151580 for ; Fri, 21 Jun 2019 11:17:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5862428898 for ; Fri, 21 Jun 2019 11:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AF8828A15; Fri, 21 Jun 2019 11:17:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 43D9028898 for ; Fri, 21 Jun 2019 11:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=9gg+STkrC6A9cAyFgI+zu6NcjQlNRousYP7d2aJlim8=; b=owt i477FJjb5Ayu0XDwhmurcl2Dlu6SrFlaVHetsOiJ1x8qDzoBmCLIewk6uO4senkuO7Pi0/Lw4903D ehZ62jOxLL5lUxm4sEr6uni/+goWmqxBgDQOYo8sbQjzF6cApwkj8+jRGZYGzcsujNkG8MPsgG0LE 2gzTIv70Aymw0yLhUQ5I67t7/mgqJIFUqPIbGS7TWUig+2xCwq9q3Iki3EHYw3ZDDCik78YaBIgdq bmSjKRQUdbOcB4p5U3g53mVGvk/1d8Ol/x50a0IPSTQ+3UfRrLpBOr5aJFlDrmX/iEVG+roK0kMZf o0OG6clRDLzUtkFP62AiuEmIh1Qt/iw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1heHYJ-0001rL-O2; Fri, 21 Jun 2019 11:17:55 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1heHYH-0001qy-7X for ath11k@lists.infradead.org; Fri, 21 Jun 2019 11:17:54 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D0864615BF; Fri, 21 Jun 2019 11:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1561115871; bh=fOzKyrWrAAqEVkRu0yzLu6r5YpoQ63MJ6rFSq7wUEaU=; h=From:To:Cc:Subject:Date:From; b=oX6LyBNII4QWWDr30Q6kBpNMyDQY69IBee8CcgTQn91/pM2dHJnSCdHmKvi1ColjQ V23tDsfxm7moEcgBfcw3Fxm9bMTVIQPiuMKOloQgPZQf3w807SG9aclOiUNqS081LV zI24d9rqcx7POls67Bcd48yKihLz4rKJl+bQVYRc= Received: from c-gsamin-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gsamin@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7489B602A9; Fri, 21 Jun 2019 11:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1561115871; bh=fOzKyrWrAAqEVkRu0yzLu6r5YpoQ63MJ6rFSq7wUEaU=; h=From:To:Cc:Subject:Date:From; b=oX6LyBNII4QWWDr30Q6kBpNMyDQY69IBee8CcgTQn91/pM2dHJnSCdHmKvi1ColjQ V23tDsfxm7moEcgBfcw3Fxm9bMTVIQPiuMKOloQgPZQf3w807SG9aclOiUNqS081LV zI24d9rqcx7POls67Bcd48yKihLz4rKJl+bQVYRc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7489B602A9 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=gsamin@codeaurora.org From: Govindaraj Saminathan To: ath11k@lists.infradead.org Subject: [PATCH] ath11k: clean up in qmi_txn_wait error code handling Date: Fri, 21 Jun 2019 16:47:33 +0530 Message-Id: <1561115853-18202-1-git-send-email-gsamin@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190621_041753_302701_7333828E X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Govindaraj Saminathan MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP qmi_txn_wait functions resp.resp.result is assigned to ret variable and then returned from the function. The functions should not return error codes from firmware, instead it should return -EINVAL. Signed-off-by: Govindaraj Saminathan --- drivers/net/wireless/ath/ath11k/qmi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index cb9ed9c..eb86fae 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -1546,7 +1546,7 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab) if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "Host capability request failed, result: %d, err: %d\n", resp.resp.result, resp.resp.error); - ret = resp.resp.result; + ret = -EINVAL; goto out; } @@ -1610,7 +1610,7 @@ static int ath11k_qmi_fw_ind_register_send(struct ath11k_base *ab) if (resp->resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "FW Ind register request failed, result: %d, err: %d\n", resp->resp.result, resp->resp.error); - ret = resp->resp.result; + ret = -EINVAL; goto out; } @@ -1666,7 +1666,7 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab) if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "Respond mem req failed, result: %d, err: %d\n", resp.resp.result, resp.resp.error); - ret = resp.resp.result; + ret = -EINVAL; goto out; } out: @@ -1753,7 +1753,7 @@ static int ath11k_qmi_request_target_cap(struct ath11k_base *ab) if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "qmi targetcap req failed, result: %d, err: %d\n", resp.resp.result, resp.resp.error); - ret = resp.resp.result; + ret = -EINVAL; goto out; } @@ -1921,7 +1921,7 @@ static int ath11k_qmi_load_bdf(struct ath11k_base *ab) if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "qmi BDF download failed, result: %d, err: %d\n", resp.resp.result, resp.resp.error); - ret = resp.resp.result; + ret = -EINVAL; goto out_qmi_bdf; } } @@ -1970,7 +1970,7 @@ static int ath11k_qmi_wlanfw_m3_info_send(struct ath11k_base *ab) if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "qmi M3 info request failed, result: %d, err: %d\n", resp.resp.result, resp.resp.error); - ret = resp.resp.result; + ret = -EINVAL; goto out; } out: @@ -2021,7 +2021,7 @@ static int ath11k_qmi_wlanfw_mode_send(struct ath11k_base *ab, if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "Mode request failed, mode: %d, result: %d err: %d\n", mode, resp.resp.result, resp.resp.error); - ret = resp.resp.result; + ret = -EINVAL; goto out; } @@ -2099,7 +2099,7 @@ static int ath11k_qmi_wlanfw_wlan_cfg_send(struct ath11k_base *ab) if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "qmi wlan config request failed, result: %d, err: %d\n", resp.resp.result, resp.resp.error); - ret = resp.resp.result; + ret = -EINVAL; goto out; }