ATH11K Archive mirror
 help / color / mirror / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: Kalle Valo <kvalo@kernel.org>, Tom Rix <trix@redhat.com>,
	linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org,
	ath11k@lists.infradead.org, Dmitry Antipov <dmantipov@yandex.ru>
Subject: [PATCH 3/5] wifi: ath11k: simplify spectral pull functions
Date: Thu, 24 Aug 2023 10:50:46 +0300	[thread overview]
Message-ID: <20230824075121.121144-3-dmantipov@yandex.ru> (raw)
In-Reply-To: <20230824075121.121144-1-dmantipov@yandex.ru>

Since 'ath11k_spectral_pull_summary()' and 'ath11k_spectral_pull_search()'
always returns 0, both of them may be converted to 'void' and
'ath11k_spectral_process_fft()' may be simplified accordingly.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/ath/ath11k/spectral.c | 24 ++++++++--------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/spectral.c b/drivers/net/wireless/ath/ath11k/spectral.c
index 705868198df4..97eb2a457685 100644
--- a/drivers/net/wireless/ath/ath11k/spectral.c
+++ b/drivers/net/wireless/ath/ath11k/spectral.c
@@ -470,10 +470,10 @@ static const struct file_operations fops_scan_bins = {
 	.llseek = default_llseek,
 };
 
-static int ath11k_spectral_pull_summary(struct ath11k *ar,
-					struct wmi_dma_buf_release_meta_data *meta,
-					struct spectral_summary_fft_report *summary,
-					struct ath11k_spectral_summary_report *report)
+static void ath11k_spectral_pull_summary(struct ath11k *ar,
+					 struct wmi_dma_buf_release_meta_data *meta,
+					 struct spectral_summary_fft_report *summary,
+					 struct ath11k_spectral_summary_report *report)
 {
 	report->timestamp = __le32_to_cpu(summary->timestamp);
 	report->agc_total_gain = FIELD_GET(SPECTRAL_SUMMARY_INFO0_AGC_TOTAL_GAIN,
@@ -500,13 +500,11 @@ static int ath11k_spectral_pull_summary(struct ath11k *ar,
 					__le32_to_cpu(summary->info2));
 
 	memcpy(&report->meta, meta, sizeof(*meta));
-
-	return 0;
 }
 
-static int ath11k_spectral_pull_search(struct ath11k *ar,
-				       struct spectral_search_fft_report *search,
-				       struct ath11k_spectral_search_report *report)
+static void ath11k_spectral_pull_search(struct ath11k *ar,
+					struct spectral_search_fft_report *search,
+					struct ath11k_spectral_search_report *report)
 {
 	report->timestamp = __le32_to_cpu(search->timestamp);
 	report->detector_id = FIELD_GET(SPECTRAL_FFT_REPORT_INFO0_DETECTOR_ID,
@@ -531,8 +529,6 @@ static int ath11k_spectral_pull_search(struct ath11k *ar,
 				       __le32_to_cpu(search->info2));
 	report->rel_pwr_db = FIELD_GET(SPECTRAL_FFT_REPORT_INFO2_REL_PWR_DB,
 				       __le32_to_cpu(search->info2));
-
-	return 0;
 }
 
 static u8 ath11k_spectral_get_max_exp(s8 max_index, u8 max_magnitude,
@@ -629,11 +625,7 @@ int ath11k_spectral_process_fft(struct ath11k *ar,
 		return ret;
 	}
 
-	ret = ath11k_spectral_pull_search(ar, data, &search);
-	if (ret) {
-		ath11k_warn(ab, "failed to pull search report %d\n", ret);
-		return ret;
-	}
+	ath11k_spectral_pull_search(ar, data, &search);
 
 	chan_width_mhz = summary->meta.ch_width;
 
-- 
2.41.0


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2023-08-24  7:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24  7:50 [PATCH 1/5] wifi: ath11k: drop redundant check in ath11k_dp_rx_mon_dest_process() Dmitry Antipov
2023-08-24  7:50 ` [PATCH 2/5] wifi: ath11k: remove unused members of 'struct ath11k_base' Dmitry Antipov
2023-08-24 17:54   ` Jeff Johnson
2023-08-24  7:50 ` Dmitry Antipov [this message]
2023-08-24 17:39   ` [PATCH 3/5] wifi: ath11k: simplify spectral pull functions Jeff Johnson
2023-08-24  7:50 ` [PATCH 4/5] wifi: ath11k: use kstrtoul_from_user() where appropriate Dmitry Antipov
2023-08-24 17:46   ` Jeff Johnson
2023-09-28 14:25   ` Kalle Valo
2023-08-24  7:50 ` [PATCH 5/5] wifi: ath11k: fix stack usage of ath11k_mac_op_remain_on_channel() Dmitry Antipov
2023-08-24 17:53   ` Jeff Johnson
2023-08-24 15:30 ` [PATCH 1/5] wifi: ath11k: drop redundant check in ath11k_dp_rx_mon_dest_process() Jeff Johnson
2023-09-21  8:15 ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230824075121.121144-3-dmantipov@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=ath11k@lists.infradead.org \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=quic_jjohnson@quicinc.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).