* [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics
@ 2024-07-30 3:51 Roopni Devanathan
2024-07-30 15:10 ` Jeff Johnson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Roopni Devanathan @ 2024-07-30 3:51 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Roopni Devanathan
The API print_array_to_buf() currently supports printing
arrays with 0 indexing. In some cases, a few arrays need
to be printed with 1-based indexing, i.e., array should be
printed, starting with 1.
Add a new version of print_array_to_buf(), named
print_array_to_buf_v2(), which implements the functionality
of print_array_to_buf(), but with an extra variable,
pointing to the index starting with which the array should
be printed. Modify print_array_to_buf() to call
print_array_to_buf_v2() with 0 as the starting index.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
---
drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
index f1b7e74aefe4..4d7fe4b4f320 100644
--- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
+++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
@@ -12,8 +12,8 @@
#include "dp_rx.h"
static u32
-print_array_to_buf(u8 *buf, u32 offset, const char *header,
- const __le32 *array, u32 array_len, const char *footer)
+print_array_to_buf_v2(u8 *buf, u32 offset, const char *header, u32 stats_index,
+ const __le32 *array, u32 array_len, const char *footer)
{
int index = 0;
u8 i;
@@ -26,7 +26,7 @@ print_array_to_buf(u8 *buf, u32 offset, const char *header,
for (i = 0; i < array_len; i++) {
index += scnprintf(buf + offset + index,
(ATH12K_HTT_STATS_BUF_SIZE - offset) - index,
- " %u:%u,", i, le32_to_cpu(array[i]));
+ " %u:%u,", stats_index++, le32_to_cpu(array[i]));
}
/* To overwrite the last trailing comma */
index--;
@@ -40,6 +40,13 @@ print_array_to_buf(u8 *buf, u32 offset, const char *header,
return index;
}
+static u32
+print_array_to_buf(u8 *buf, u32 offset, const char *header,
+ const __le32 *array, u32 array_len, const char *footer)
+{
+ return print_array_to_buf_v2(buf, offset, header, 0, array, array_len, footer);
+}
+
static void
htt_print_tx_pdev_stats_cmn_tlv(const void *tag_buf, u16 tag_len,
struct debug_htt_stats_req *stats_req)
base-commit: db1ce56e6e1d395dd42a3cd6332a871d9be59c45
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics
2024-07-30 3:51 [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics Roopni Devanathan
@ 2024-07-30 15:10 ` Jeff Johnson
2024-07-30 16:32 ` Jeff Johnson
2024-10-03 14:56 ` Jeff Johnson
2 siblings, 0 replies; 5+ messages in thread
From: Jeff Johnson @ 2024-07-30 15:10 UTC (permalink / raw)
To: Roopni Devanathan, ath12k; +Cc: linux-wireless
In the future if you need to repost a patch, please add a REPOST tag to the
subject, and below the "---" explain the reason for the repost.
Having duplicate subjects confuses the reviewers and perhaps some of the
automated tooling.
Also suggest you use scripts/get_maintainer.pl to properly populate the list
of recipients in the future:
% scripts/get_maintainer.pl --no-rolestats drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
Kalle Valo <kvalo@kernel.org>
Jeff Johnson <jjohnson@kernel.org>
linux-wireless@vger.kernel.org
ath12k@lists.infradead.org
linux-kernel@vger.kernel.org
(Normally you send To: the people and Cc: the lists)
/jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics
2024-07-30 3:51 [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics Roopni Devanathan
2024-07-30 15:10 ` Jeff Johnson
@ 2024-07-30 16:32 ` Jeff Johnson
2024-10-03 14:56 ` Jeff Johnson
2 siblings, 0 replies; 5+ messages in thread
From: Jeff Johnson @ 2024-07-30 16:32 UTC (permalink / raw)
To: Roopni Devanathan, ath12k; +Cc: linux-wireless
On 7/29/2024 8:51 PM, Roopni Devanathan wrote:
> The API print_array_to_buf() currently supports printing
> arrays with 0 indexing. In some cases, a few arrays need
> to be printed with 1-based indexing, i.e., array should be
> printed, starting with 1.
>
> Add a new version of print_array_to_buf(), named
> print_array_to_buf_v2(), which implements the functionality
> of print_array_to_buf(), but with an extra variable,
> pointing to the index starting with which the array should
> be printed. Modify print_array_to_buf() to call
> print_array_to_buf_v2() with 0 as the starting index.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics
2024-07-30 3:51 [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics Roopni Devanathan
2024-07-30 15:10 ` Jeff Johnson
2024-07-30 16:32 ` Jeff Johnson
@ 2024-10-03 14:56 ` Jeff Johnson
2024-10-04 8:57 ` Roopni Devanathan
2 siblings, 1 reply; 5+ messages in thread
From: Jeff Johnson @ 2024-10-03 14:56 UTC (permalink / raw)
To: Roopni Devanathan, ath12k; +Cc: linux-wireless
On 7/29/2024 8:51 PM, Roopni Devanathan wrote:
> The API print_array_to_buf() currently supports printing
> arrays with 0 indexing. In some cases, a few arrays need
> to be printed with 1-based indexing, i.e., array should be
> printed, starting with 1.
>
> Add a new version of print_array_to_buf(), named
> print_array_to_buf_v2(), which implements the functionality
> of print_array_to_buf(), but with an extra variable,
> pointing to the index starting with which the array should
> be printed. Modify print_array_to_buf() to call
> print_array_to_buf_v2() with 0 as the starting index.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
I'm in the process of pulling in this change and the dependent debugfs
patches, but was never quite happy with the naming of the new function.
Discussed with Kalle and suggest the new function be called something like
print_array_to_buf_index() so that the new name has some semantic guidance to
how it is different.
Can you update this patch and the dependent ones to use this name?
/jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics
2024-10-03 14:56 ` Jeff Johnson
@ 2024-10-04 8:57 ` Roopni Devanathan
0 siblings, 0 replies; 5+ messages in thread
From: Roopni Devanathan @ 2024-10-04 8:57 UTC (permalink / raw)
To: Jeff Johnson, ath12k; +Cc: linux-wireless
On 10/3/2024 8:26 PM, Jeff Johnson wrote:
> On 7/29/2024 8:51 PM, Roopni Devanathan wrote:
>> The API print_array_to_buf() currently supports printing
>> arrays with 0 indexing. In some cases, a few arrays need
>> to be printed with 1-based indexing, i.e., array should be
>> printed, starting with 1.
>>
>> Add a new version of print_array_to_buf(), named
>> print_array_to_buf_v2(), which implements the functionality
>> of print_array_to_buf(), but with an extra variable,
>> pointing to the index starting with which the array should
>> be printed. Modify print_array_to_buf() to call
>> print_array_to_buf_v2() with 0 as the starting index.
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
>
> I'm in the process of pulling in this change and the dependent debugfs
> patches, but was never quite happy with the naming of the new function.
> Discussed with Kalle and suggest the new function be called something like
> print_array_to_buf_index() so that the new name has some semantic guidance to
> how it is different.
>
> Can you update this patch and the dependent ones to use this name?
>
> /jeff
>
Sure, Jeff. I'll make this change and send out the revised patches.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-04 8:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 3:51 [PATCH] wifi: ath12k: Modify print_array_to_buf() to support arrays with 1-based semantics Roopni Devanathan
2024-07-30 15:10 ` Jeff Johnson
2024-07-30 16:32 ` Jeff Johnson
2024-10-03 14:56 ` Jeff Johnson
2024-10-04 8:57 ` Roopni Devanathan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox