[bug report] wifi: ath12k: Add support for reading variant from ACPI to download board data file
Dan Carpenter
error27 at gmail.com
Fri Apr 24 01:59:31 PDT 2026
Hello Lingbo Kong,
Commit 0a43c3a520e9 ("wifi: ath12k: Add support for reading variant
from ACPI to download board data file") from Jan 13, 2025
(linux-next), leads to the following Smatch static checker warning:
drivers/net/wireless/ath/ath12k/acpi.c:395 ath12k_acpi_start()
warn: set error code if 'ab->acpi.bdf_string[0] == 0'
drivers/net/wireless/ath/ath12k/acpi.c
351 int ath12k_acpi_start(struct ath12k_base *ab)
352 {
353 acpi_status status;
354 int ret;
355
356 ab->acpi.acpi_tas_enable = false;
357 ab->acpi.acpi_disable_11be = false;
358 ab->acpi.acpi_disable_rfkill = false;
359 ab->acpi.acpi_bios_sar_enable = false;
360 ab->acpi.acpi_cca_enable = false;
361 ab->acpi.acpi_band_edge_enable = false;
362 ab->acpi.acpi_enable_bdf = false;
363 ab->acpi.bdf_string[0] = '\0';
364
365 if (!ab->hw_params->acpi_guid)
366 /* not supported with this hardware */
367 return 0;
368
369 ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_SUPPORT_FUNCS);
370 if (ret) {
371 ath12k_dbg(ab, ATH12K_DBG_BOOT, "failed to get ACPI DSM data: %d\n", ret);
372 return ret;
373 }
374
375 if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi, ATH12K_ACPI_FUNC_BIT_DISABLE_FLAG)) {
376 ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_DISABLE_FLAG);
377 if (ret) {
378 ath12k_warn(ab, "failed to get ACPI DISABLE FLAG: %d\n", ret);
379 return ret;
380 }
381
382 if (ATH12K_ACPI_CHEK_BIT_VALID(ab->acpi,
383 ATH12K_ACPI_DSM_DISABLE_11BE_BIT))
384 ab->acpi.acpi_disable_11be = true;
385
386 if (!ATH12K_ACPI_CHEK_BIT_VALID(ab->acpi,
387 ATH12K_ACPI_DSM_DISABLE_RFKILL_BIT))
388 ab->acpi.acpi_disable_rfkill = true;
389 }
390
391 if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi, ATH12K_ACPI_FUNC_BIT_BDF_EXT)) {
392 ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_BDF_EXT);
393 if (ret || ab->acpi.bdf_string[0] == '\0') {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Should we set the error code for an empty string?
394 ath12k_warn(ab, "failed to get ACPI BDF EXT: %d\n", ret);
--> 395 return ret;
396 }
397
398 ab->acpi.acpi_enable_bdf = true;
399 }
400
401 if (ATH12K_ACPI_FUNC_BIT_VALID(ab->acpi, ATH12K_ACPI_FUNC_BIT_TAS_CFG)) {
402 ret = ath12k_acpi_dsm_get_data(ab, ATH12K_ACPI_DSM_FUNC_TAS_CFG);
403 if (ret) {
404 ath12k_warn(ab, "failed to get ACPI TAS config table: %d\n", ret);
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
More information about the ath12k
mailing list