[PATCH 4/8] wifi: ath12k: introduce ath12k_hw_warn()

Kalle Valo kvalo at kernel.org
Tue Oct 29 08:41:12 PDT 2024


Jeff Johnson <quic_jjohnson at quicinc.com> writes:

> On 10/23/2024 6:30 AM, Kalle Valo wrote:
>> From: Kalle Valo <quic_kvalo at quicinc.com>
>> 
>> In the following patch we need to use ath12k_warn() but don't easily have
>> access to struct ath12k_base (ab) but do have access to struct ath12k_hw (ah).
>> So add a new warning helper ath12_hw_warn() which takes the latter but the log
>> output is still identical but uses the struct device pointer stored to struct
>> ath12k_hw.
>> 
>> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>> 
>> Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
>> ---
>>  drivers/net/wireless/ath/ath12k/core.h  | 2 ++
>>  drivers/net/wireless/ath/ath12k/debug.c | 4 ++--
>
> Qualcomm Innovation Center copyright missing 2024

Will fix.

>> --- a/drivers/net/wireless/ath/ath12k/debug.h
>> +++ b/drivers/net/wireless/ath/ath12k/debug.h
>> @@ -31,7 +31,10 @@ enum ath12k_debug_mask {
>>  
>>  __printf(2, 3) void ath12k_info(struct ath12k_base *ab, const char *fmt, ...);
>>  __printf(2, 3) void ath12k_err(struct ath12k_base *ab, const char *fmt, ...);
>> -__printf(2, 3) void ath12k_warn(struct ath12k_base *ab, const char *fmt, ...);
>> +__printf(2, 3) void __ath12k_warn(struct device *dev, const char *fmt, ...);
>> +
>> +#define ath12k_warn(ab, fmt, ...) __ath12k_warn((ab)->dev, fmt, ##__VA_ARGS__)
>> +#define ath12k_hw_warn(ah, fmt, ...) __ath12k_warn((ah)->dev, fmt, ##__VA_ARGS__)
>
> for consistency should we do this for the other log levels as well?
>
> are there places where we currently retrieve ab just for logging where we
> already have ah, and hence could avoid the extra dereference?

That's a good idea but IMHO the cleanup can wait after MLO has landed.
Right now there should not be many places where we have to use the
ath12k_hw_warn() variant.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



More information about the ath12k mailing list