Remove -Wno-format in esp_phy, esp_wifi, wpa_supplicant components

pull/11112/head
muhaidong 2023-03-24 14:10:59 +08:00 zatwierdzone przez BOT
rodzic a3782377d7
commit 61a5785414
12 zmienionych plików z 33 dodań i 32 usunięć

Wyświetl plik

@ -122,5 +122,3 @@ if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION)
esptool_py_flash_target_image(${phy_name}-flash ${phy_name} "${phy_partition_offset}" "${phy_init_data_bin}")
esptool_py_flash_target_image(flash ${phy_name} "${phy_partition_offset}" "${phy_init_data_bin}")
endif()
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

Wyświetl plik

@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <stdbool.h>
#include <sys/lock.h>
@ -483,7 +484,7 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void)
ESP_LOGE(TAG, "PHY data partition not found");
return NULL;
}
ESP_LOGD(TAG, "loading PHY init data from partition at offset 0x%x", partition->address);
ESP_LOGD(TAG, "loading PHY init data from partition at offset 0x%" PRIx32 "", partition->address);
size_t init_data_store_length = sizeof(phy_init_magic_pre) +
sizeof(esp_phy_init_data_t) + sizeof(phy_init_magic_post);
uint8_t* init_data_store = (uint8_t*) malloc(init_data_store_length);
@ -650,9 +651,9 @@ static esp_err_t load_cal_data_from_nvs_handle(nvs_handle_t handle,
return err;
}
uint32_t cal_format_version = phy_get_rf_cal_version() & (~BIT(16));
ESP_LOGV(TAG, "phy_get_rf_cal_version: %d\n", cal_format_version);
ESP_LOGV(TAG, "phy_get_rf_cal_version: %" PRId32 "\n", cal_format_version);
if (cal_data_version != cal_format_version) {
ESP_LOGD(TAG, "%s: expected calibration data format %d, found %d",
ESP_LOGD(TAG, "%s: expected calibration data format %" PRId32 ", found %" PRId32 "",
__func__, cal_format_version, cal_data_version);
return ESP_FAIL;
}
@ -708,7 +709,7 @@ static esp_err_t store_cal_data_to_nvs_handle(nvs_handle_t handle,
}
uint32_t cal_format_version = phy_get_rf_cal_version() & (~BIT(16));
ESP_LOGV(TAG, "phy_get_rf_cal_version: %d\n", cal_format_version);
ESP_LOGV(TAG, "phy_get_rf_cal_version: %" PRId32 "\n", cal_format_version);
err = nvs_set_u32(handle, PHY_CAL_VERSION_KEY, cal_format_version);
if (err != ESP_OK) {
ESP_LOGE(TAG, "%s: store calibration version failed(0x%x)\n", __func__, err);

Wyświetl plik

@ -2,4 +2,3 @@ idf_component_register(SRC_DIRS .
PRIV_INCLUDE_DIRS . ${CMAKE_CURRENT_BINARY_DIR}
PRIV_REQUIRES cmock test_utils nvs_flash ulp esp_common esp_phy esp_wifi
)
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

Wyświetl plik

@ -66,5 +66,4 @@ if(CONFIG_ESP_WIFI_ENABLED)
endforeach()
endif()
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
endif()

Wyświetl plik

@ -10,6 +10,7 @@
#include "esp_private/wifi.h"
#include "esp_wifi_netif.h"
#include <string.h>
#include <inttypes.h>
#ifdef CONFIG_ESP_WIFI_NAN_ENABLE
#include "apps_private/wifi_apps_private.h"
#endif
@ -37,7 +38,7 @@ static void wifi_start(void *esp_netif, esp_event_base_t base, int32_t event_id,
uint8_t mac[6];
esp_err_t ret;
ESP_LOGD(TAG, "%s esp-netif:%p event-id%d", __func__, esp_netif, event_id);
ESP_LOGD(TAG, "%s esp-netif:%p event-id%" PRId32 "", __func__, esp_netif, event_id);
wifi_netif_driver_t driver = esp_netif_get_io_driver(esp_netif);

Wyświetl plik

@ -738,7 +738,7 @@ uint8_t esp_wifi_nan_publish_service(const wifi_nan_publish_cfg_t *publish_cfg,
return 0;
}
ESP_LOGI(TAG, "Started Publishing %s [Service ID - %lu]", publish_cfg->service_name, pub_id);
ESP_LOGI(TAG, "Started Publishing %s [Service ID - %u]", publish_cfg->service_name, pub_id);
nan_record_own_svc(pub_id, ESP_NAN_PUBLISH, publish_cfg->service_name, ndp_resp_needed);
return pub_id;
@ -767,7 +767,7 @@ uint8_t esp_wifi_nan_subscribe_service(const wifi_nan_subscribe_cfg_t *subscribe
return 0;
}
ESP_LOGI(TAG, "Started Subscribing to %s [Service ID - %lu]", subscribe_cfg->service_name, sub_id);
ESP_LOGI(TAG, "Started Subscribing to %s [Service ID - %u]", subscribe_cfg->service_name, sub_id);
nan_record_own_svc(sub_id, ESP_NAN_SUBSCRIBE, subscribe_cfg->service_name, false);
return sub_id;

Wyświetl plik

@ -5,7 +5,7 @@
*/
#include <string.h>
#include <inttypes.h>
#include "esp_err.h"
#include "utils/includes.h"
@ -199,7 +199,7 @@ void wpa2_task(void *pvParameters )
if(sm->wpa2_sig_cnt[e->sig]) {
sm->wpa2_sig_cnt[e->sig]--;
} else {
wpa_printf(MSG_ERROR, "wpa2_task: invalid sig cnt, sig=%d cnt=%d", e->sig, sm->wpa2_sig_cnt[e->sig]);
wpa_printf(MSG_ERROR, "wpa2_task: invalid sig cnt, sig=%" PRId32 " cnt=%d", e->sig, sm->wpa2_sig_cnt[e->sig]);
}
DATA_MUTEX_GIVE();
}
@ -230,7 +230,7 @@ void wpa2_task(void *pvParameters )
break;
} else {
if (s_wifi_wpa2_sync_sem) {
wpa_printf(MSG_DEBUG, "WPA2: wifi->wpa2 api completed sig(%d)", e->sig);
wpa_printf(MSG_DEBUG, "WPA2: wifi->wpa2 api completed sig(%" PRId32 ")", e->sig);
os_semphr_give(s_wifi_wpa2_sync_sem);
} else {
wpa_printf(MSG_ERROR, "WPA2: null wifi->wpa2 sync sem");
@ -243,7 +243,7 @@ void wpa2_task(void *pvParameters )
wpa_printf(MSG_DEBUG, "WPA2: task deleted");
s_wpa2_queue = NULL;
if (s_wifi_wpa2_sync_sem) {
wpa_printf(MSG_DEBUG, "WPA2: wifi->wpa2 api completed sig(%d)", e->sig);
wpa_printf(MSG_DEBUG, "WPA2: wifi->wpa2 api completed sig(%" PRId32 ")", e->sig);
os_semphr_give(s_wifi_wpa2_sync_sem);
} else {
wpa_printf(MSG_ERROR, "WPA2: null wifi->wpa2 sync sem");
@ -385,10 +385,10 @@ int eap_sm_process_request(struct eap_sm *sm, struct wpabuf *reqData)
}
if (!eap_sm_allowMethod(sm, reqVendor, reqVendorMethod)) {
wpa_printf(MSG_DEBUG, "EAP: vendor %u method %u not allowed",
wpa_printf(MSG_DEBUG, "EAP: vendor %" PRIu32 " method %" PRIu32 " not allowed",
reqVendor, reqVendorMethod);
wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_PROPOSED_METHOD
"vendor=%u method=%u -> NAK",
"vendor=%" PRIu32 " method=%" PRIu32 " -> NAK",
reqVendor, reqVendorMethod);
goto build_nak;
}
@ -535,7 +535,7 @@ static int eap_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len, uint8_t *bss
plen = be_to_host16(hdr->length);
data_len = plen + sizeof(*hdr);
wpa_printf(MSG_DEBUG, "IEEE 802.1X RX: version=%d type=%d length=%d",
wpa_printf(MSG_DEBUG, "IEEE 802.1X RX: version=%d type=%d length=%" PRId32 "",
hdr->version, hdr->type, plen);
if (hdr->version < EAPOL_VERSION) {
/* TODO: backwards compatibility */

Wyświetl plik

@ -15,6 +15,7 @@
#include "esp_wpa3_i.h"
#include "endian.h"
#include "esp_hostap.h"
#include <inttypes.h>
#ifdef CONFIG_SAE_PK
#include "common/bss.h"
@ -308,7 +309,7 @@ static int wpa3_parse_sae_msg(u8 *buf, size_t len, u32 sae_msg_type, u16 status)
esp_wpa3_free_sae_data();
break;
default:
wpa_printf(MSG_ERROR, "wpa3: Invalid SAE msg type(%d)!", sae_msg_type);
wpa_printf(MSG_ERROR, "wpa3: Invalid SAE msg type(%" PRId32 ")!", sae_msg_type);
ret = ESP_FAIL;
break;
}

Wyświetl plik

@ -5,6 +5,7 @@
*/
#include <string.h>
#include <inttypes.h>
#include "utils/includes.h"
#include "common.h"
@ -135,12 +136,12 @@ void wps_task(void *pvParameters )
if (s_wps_sig_cnt[e->sig]) {
s_wps_sig_cnt[e->sig]--;
} else {
wpa_printf(MSG_ERROR, "wpsT: invalid sig cnt, sig=%d cnt=%d", e->sig, s_wps_sig_cnt[e->sig]);
wpa_printf(MSG_ERROR, "wpsT: invalid sig cnt, sig=%" PRId32 " cnt=%d", e->sig, s_wps_sig_cnt[e->sig]);
}
DATA_MUTEX_GIVE();
}
wpa_printf(MSG_DEBUG, "wpsT: rx sig=%d", e->sig);
wpa_printf(MSG_DEBUG, "wpsT: rx sig=%" PRId32 "", e->sig);
switch (e->sig) {
case SIG_WPS_ENABLE:
@ -148,7 +149,7 @@ void wps_task(void *pvParameters )
case SIG_WPS_START:
param = (wps_ioctl_param_t *)e->par;
if (!param) {
wpa_printf(MSG_ERROR, "wpsT: invalid param sig=%d", e->sig);
wpa_printf(MSG_ERROR, "wpsT: invalid param sig=%" PRId32 "", e->sig);
os_semphr_give(s_wps_api_sem);
break;
}
@ -197,7 +198,7 @@ void wps_task(void *pvParameters )
break;
default:
wpa_printf(MSG_ERROR, "wpsT: invalid sig=%d", e->sig);
wpa_printf(MSG_ERROR, "wpsT: invalid sig=%" PRId32 "", e->sig);
break;
}
os_free(e);
@ -216,11 +217,11 @@ void wps_task(void *pvParameters )
*/
int wps_post(uint32_t sig, uint32_t par)
{
wpa_printf(MSG_DEBUG, "wps post: sig=%d cnt=%d", sig, s_wps_sig_cnt[sig]);
wpa_printf(MSG_DEBUG, "wps post: sig=%" PRId32 " cnt=%d", sig, s_wps_sig_cnt[sig]);
DATA_MUTEX_TAKE();
if (s_wps_sig_cnt[sig]) {
wpa_printf(MSG_DEBUG, "wps post: sig=%d processing", sig);
wpa_printf(MSG_DEBUG, "wps post: sig=%" PRId32 " processing", sig);
DATA_MUTEX_GIVE();
return ESP_OK;
} else {
@ -854,13 +855,13 @@ int wps_start_msg_timer(void)
if (sm->wps->state == WPS_FINISHED) {
msg_timeout = 100;
wpa_printf(MSG_DEBUG, "start msg timer WPS_FINISHED %d ms", msg_timeout);
wpa_printf(MSG_DEBUG, "start msg timer WPS_FINISHED %" PRId32 " ms", msg_timeout);
eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL);
eloop_register_timeout(0, msg_timeout*1000, wifi_station_wps_msg_timeout, NULL, NULL);
ret = 0;
} else if (sm->wps->state == RECV_M2) {
msg_timeout = 5;
wpa_printf(MSG_DEBUG, "start msg timer RECV_M2 %d ms", msg_timeout);
wpa_printf(MSG_DEBUG, "start msg timer RECV_M2 %" PRId32 " ms", msg_timeout);
eloop_cancel_timeout(wifi_station_wps_msg_timeout, NULL, NULL);
eloop_register_timeout(msg_timeout, 0, wifi_station_wps_msg_timeout, NULL, NULL);
ret = 0;
@ -948,7 +949,7 @@ int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len)
data_len = plen + sizeof(*hdr);
eap_len = be_to_host16(ehdr->length);
wpa_printf(MSG_DEBUG, "IEEE 802.1X RX: version=%d type=%d length=%d",
wpa_printf(MSG_DEBUG, "IEEE 802.1X RX: version=%d type=%d length=%" PRId32 "",
hdr->version, hdr->type, plen);
if (hdr->version < EAPOL_VERSION) {
@ -1009,7 +1010,7 @@ int wps_sm_rx_eapol_internal(u8 *src_addr, u8 *buf, u32 len)
eloop_register_timeout(3, 0, wifi_station_wps_eapol_start_handle, NULL, NULL);
break;
case EAP_TYPE_EXPANDED:
wpa_printf(MSG_DEBUG, "=========expanded plen[%d], %d===========", plen, sizeof(*ehdr));
wpa_printf(MSG_DEBUG, "=========expanded plen[%" PRId32 "], %d===========", plen, sizeof(*ehdr));
if (ehdr->identifier == sm->current_identifier) {
ret = 0;
wpa_printf(MSG_DEBUG, "wps: ignore overlap identifier");

Wyświetl plik

@ -2,7 +2,6 @@ idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "." "${CMAKE_CURRENT_BINARY_DIR}"
PRIV_INCLUDE_DIRS "../src" "../esp_supplicant/src"
PRIV_REQUIRES cmock esp_common test_utils wpa_supplicant mbedtls esp_wifi esp_event)
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
idf_component_get_property(esp_supplicant_dir wpa_supplicant COMPONENT_DIR)

Wyświetl plik

@ -4,6 +4,7 @@
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#include "string.h"
#include <inttypes.h>
#include "esp_system.h"
#include "unity.h"
#include "esp_system.h"
@ -46,7 +47,7 @@ void callback(void *a, void *b)
}
t++;
ESP_LOGI("Eloop Test", "timer[%d] ran after %d msec of scheduled time",
ESP_LOGI("Eloop Test", "timer[%d] ran after %" PRId32 " msec of scheduled time",
*i, ms_diff);
}

Wyświetl plik

@ -11,6 +11,7 @@
*/
#include "string.h"
#include <inttypes.h>
#include "esp_system.h"
#include "unity.h"
#include "esp_system.h"
@ -135,7 +136,7 @@ void esp_send_action_frame(uint8_t *dest_mac, const uint8_t *buf, uint32_t len,
req->rx_cb = dummy_rx_action;
memcpy(req->data, buf, req->data_len);
ESP_LOGI(TAG, "Action Tx - MAC:" MACSTR ", Channel-%d, WaitT-%d",
ESP_LOGI(TAG, "Action Tx - MAC:" MACSTR ", Channel-%d, WaitT-%" PRId32 "",
MAC2STR(dest_mac), channel, wait_time_ms);
TEST_ESP_OK(esp_wifi_action_tx_req(WIFI_OFFCHAN_TX_REQ, channel, wait_time_ms, req));