all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences

Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2022-12-19 17:11:01 +01:00 committed by Carles Cufí
commit 66d4c64966
67 changed files with 128 additions and 128 deletions

View file

@ -25,7 +25,7 @@ struct csip_pending_notifications {
* the array containing this struct, if the security manager overwrites
* the oldest keys, we also overwrite the oldest entry
*/
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
uint32_t age;
#endif /* CONFIG_BT_KEYS_OVERWRITE_OLDEST */
};

View file

@ -48,7 +48,7 @@ struct bt_csip_set_member_svc_inst {
bt_addr_le_t lock_client_addr;
struct bt_gatt_service *service_p;
struct csip_pending_notifications pend_notify[CONFIG_BT_MAX_PAIRED];
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
uint32_t age_counter;
#endif /* CONFIG_BT_KEYS_OVERWRITE_OLDEST */
};
@ -538,7 +538,7 @@ static void handle_csip_auth_complete(struct bt_csip_set_member_svc_inst *svc_in
if (pend_notify->active &&
bt_addr_le_eq(bt_conn_get_dst(conn), &pend_notify->addr)) {
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
pend_notify->age = svc_inst->age_counter++;
#endif /* CONFIG_BT_KEYS_OVERWRITE_OLDEST */
return;
@ -555,14 +555,14 @@ static void handle_csip_auth_complete(struct bt_csip_set_member_svc_inst *svc_in
bt_addr_le_copy(&pend_notify->addr,
bt_conn_get_dst(conn));
pend_notify->active = true;
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
pend_notify->age = svc_inst->age_counter++;
#endif /* CONFIG_BT_KEYS_OVERWRITE_OLDEST */
return;
}
}
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
struct csip_pending_notifications *oldest;
oldest = &svc_inst->pend_notify[0];

View file

@ -92,7 +92,7 @@ struct gtbs_service_inst {
const struct bt_gatt_service_static *service_p;
};
#if IS_ENABLED(CONFIG_BT_GTBS)
#if defined(CONFIG_BT_GTBS)
#define READ_BUF_SIZE (CONFIG_BT_TBS_MAX_CALLS * \
sizeof(struct bt_tbs_current_call_item) * \
CONFIG_BT_TBS_BEARER_COUNT)

View file

@ -28,7 +28,7 @@ LOG_MODULE_REGISTER(bt_tbs_client, CONFIG_BT_TBS_CLIENT_LOG_LEVEL);
#include "common/bt_str.h"
#define MAX_URI_SCHEME_LIST_SIZE 64
#if IS_ENABLED(CONFIG_BT_TBS_CLIENT_GTBS)
#if defined(CONFIG_BT_TBS_CLIENT_GTBS)
#define BT_TBS_INSTANCE_MAX_CNT (CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES + 1)
#else
#define BT_TBS_INSTANCE_MAX_CNT CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES

View file

@ -2164,7 +2164,7 @@ void bt_conn_security_changed(struct bt_conn *conn, uint8_t hci_err,
}
}
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
if (!err && conn->sec_level >= BT_SECURITY_L2) {
if (conn->type == BT_CONN_TYPE_LE) {
bt_keys_update_usage(conn->id, bt_conn_get_dst(conn));

View file

@ -53,7 +53,7 @@
#include "br.h"
#endif
#if IS_ENABLED(CONFIG_BT_DF)
#if defined(CONFIG_BT_DF)
#include "direction_internal.h"
#endif /* CONFIG_BT_DF */
@ -3060,7 +3060,7 @@ static int le_init(void)
}
#endif
#if IS_ENABLED(CONFIG_BT_DF)
#if defined(CONFIG_BT_DF)
if (BT_FEAT_LE_CONNECTIONLESS_CTE_TX(bt_dev.le.features) ||
BT_FEAT_LE_CONNECTIONLESS_CTE_RX(bt_dev.le.features) ||
BT_FEAT_LE_RX_CTE(bt_dev.le.features)) {

View file

@ -38,7 +38,7 @@ static struct bt_keys key_pool[CONFIG_BT_MAX_PAIRED];
#define BT_KEYS_STORAGE_LEN_COMPAT (BT_KEYS_STORAGE_LEN - sizeof(uint32_t))
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
static uint32_t aging_counter_val;
static struct bt_keys *last_keys_updated;
@ -102,7 +102,7 @@ struct bt_keys *bt_keys_get_addr(uint8_t id, const bt_addr_le_t *addr)
}
}
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
if (first_free_slot == ARRAY_SIZE(key_pool)) {
struct bt_keys *oldest = NULL;
bt_addr_le_t oldest_addr;
@ -138,7 +138,7 @@ struct bt_keys *bt_keys_get_addr(uint8_t id, const bt_addr_le_t *addr)
keys = &key_pool[first_free_slot];
keys->id = id;
bt_addr_le_copy(&keys->addr, addr);
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
keys->aging_counter = ++aging_counter_val;
last_keys_updated = keys;
#endif /* CONFIG_BT_KEYS_OVERWRITE_OLDEST */
@ -443,7 +443,7 @@ static int keys_set(const char *name, size_t len_rd, settings_read_cb read_cb,
}
LOG_DBG("Successfully restored keys for %s", bt_addr_le_str(&addr));
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
if (aging_counter_val < keys->aging_counter) {
aging_counter_val = keys->aging_counter;
}
@ -478,7 +478,7 @@ SETTINGS_STATIC_HANDLER_DEFINE(bt_keys, "bt/keys", NULL, keys_set, keys_commit,
#endif /* CONFIG_BT_SETTINGS */
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
void bt_keys_update_usage(uint8_t id, const bt_addr_le_t *addr)
{
__ASSERT_NO_MSG(addr != NULL);
@ -537,7 +537,7 @@ struct bt_keys *bt_keys_get_key_pool(void)
return key_pool;
}
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
uint32_t bt_keys_get_aging_counter_val(void)
{
return aging_counter_val;

View file

@ -28,7 +28,7 @@ LOG_MODULE_REGISTER(bt_keys_br);
static struct bt_keys_link_key key_pool[CONFIG_BT_MAX_PAIRED];
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
static uint32_t aging_counter_val;
static struct bt_keys_link_key *last_keys_updated;
#endif /* CONFIG_BT_KEYS_OVERWRITE_OLDEST */
@ -61,7 +61,7 @@ struct bt_keys_link_key *bt_keys_get_link_key(const bt_addr_t *addr)
}
key = bt_keys_find_link_key(BT_ADDR_ANY);
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
if (!key) {
int i;
@ -82,7 +82,7 @@ struct bt_keys_link_key *bt_keys_get_link_key(const bt_addr_t *addr)
if (key) {
bt_addr_copy(&key->addr, addr);
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
key->aging_counter = ++aging_counter_val;
last_keys_updated = key;
#endif
@ -195,7 +195,7 @@ static int link_key_set(const char *name, size_t len_rd,
memcpy(link_key->storage_start, val, len);
LOG_DBG("Successfully restored link key for %s", bt_addr_le_str(&le_addr));
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
if (aging_counter_val < link_key->aging_counter) {
aging_counter_val = link_key->aging_counter;
}
@ -207,7 +207,7 @@ static int link_key_set(const char *name, size_t len_rd,
SETTINGS_STATIC_HANDLER_DEFINE(bt_link_key, "bt/link_key", NULL, link_key_set,
NULL, NULL);
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
void bt_keys_link_key_update_usage(const bt_addr_t *addr)
{
struct bt_keys_link_key *link_key = bt_keys_find_link_key(addr);

View file

@ -22,7 +22,7 @@
/* This l2cap is the only OTS-file in use for OTC.
* If only OTC is used, the OTS log module must be registered here.
*/
#if IS_ENABLED(CONFIG_BT_OTS)
#if defined(CONFIG_BT_OTS)
LOG_MODULE_DECLARE(bt_ots, CONFIG_BT_OTS_LOG_LEVEL);
#elif IS_ENABLED(CONFIG_BT_OTS_CLIENT)
LOG_MODULE_REGISTER(bt_ots, CONFIG_BT_OTS_LOG_LEVEL);

View file

@ -18,7 +18,7 @@
LOG_MODULE_REGISTER(thread_analyzer, CONFIG_THREAD_ANALYZER_LOG_LEVEL);
#if IS_ENABLED(CONFIG_THREAD_ANALYZER_USE_PRINTK)
#if defined(CONFIG_THREAD_ANALYZER_USE_PRINTK)
#define THREAD_ANALYZER_PRINT(...) printk(__VA_ARGS__)
#define THREAD_ANALYZER_FMT(str) str "\n"
#define THREAD_ANALYZER_VSTR(str) (str)
@ -169,7 +169,7 @@ void thread_analyzer_print(void)
thread_analyzer_run(thread_print_cb);
}
#if IS_ENABLED(CONFIG_THREAD_ANALYZER_AUTO)
#if defined(CONFIG_THREAD_ANALYZER_AUTO)
void thread_analyzer_auto(void)
{

View file

@ -38,7 +38,7 @@ LOG_MODULE_REGISTER(net_ctx, CONFIG_NET_CONTEXT_LOG_LEVEL);
#include "tcp_internal.h"
#include "net_stats.h"
#if IS_ENABLED(CONFIG_NET_TCP)
#if defined(CONFIG_NET_TCP)
#include "tcp.h"
#endif

View file

@ -383,7 +383,7 @@ void net_mgmt_event_init(void)
(void)memset(events, 0, CONFIG_NET_MGMT_EVENT_QUEUE_SIZE *
sizeof(struct mgmt_event_entry));
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
/* Lowest priority cooperative thread */
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
#else

View file

@ -1254,13 +1254,13 @@ static struct net_pkt *pkt_alloc(struct k_mem_slab *slab, k_timeout_t timeout)
net_pkt_set_ipv6_next_hdr(pkt, 255);
}
#if IS_ENABLED(CONFIG_NET_TX_DEFAULT_PRIORITY)
#if defined(CONFIG_NET_TX_DEFAULT_PRIORITY)
#define TX_DEFAULT_PRIORITY CONFIG_NET_TX_DEFAULT_PRIORITY
#else
#define TX_DEFAULT_PRIORITY 0
#endif
#if IS_ENABLED(CONFIG_NET_RX_DEFAULT_PRIORITY)
#if defined(CONFIG_NET_RX_DEFAULT_PRIORITY)
#define RX_DEFAULT_PRIORITY CONFIG_NET_RX_DEFAULT_PRIORITY
#else
#define RX_DEFAULT_PRIORITY 0

View file

@ -105,7 +105,7 @@ int net_rx_priority2tc(enum net_priority prio)
}
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
#define BASE_PRIO_TX (CONFIG_NET_TC_NUM_PRIORITIES - 1)
#else
#define BASE_PRIO_TX (CONFIG_NET_TC_TX_COUNT - 1)
@ -113,7 +113,7 @@ int net_rx_priority2tc(enum net_priority prio)
#define PRIO_TX(i, _) (BASE_PRIO_TX - i)
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
#define BASE_PRIO_RX (CONFIG_NET_TC_NUM_PRIORITIES - 1)
#else
#define BASE_PRIO_RX (CONFIG_NET_TC_RX_COUNT - 1)

View file

@ -25,7 +25,7 @@ enum net_verdict net_packet_socket_input(struct net_pkt *pkt, uint8_t proto)
sa_family_t orig_family;
enum net_verdict net_verdict;
#if IS_ENABLED(CONFIG_NET_DSA)
#if defined(CONFIG_NET_DSA)
/*
* For DSA the master port is not supporting raw packets. Only the
* lan1..3 are working with them.

View file

@ -1644,7 +1644,7 @@ static uint32_t tcpv6_init_isn(struct in6_addr *saddr,
memcpy(buf.key, unique_key, sizeof(buf.key));
#if IS_ENABLED(CONFIG_NET_TCP_ISN_RFC6528)
#if defined(CONFIG_NET_TCP_ISN_RFC6528)
mbedtls_md5((const unsigned char *)&buf, sizeof(buf), hash);
#endif
@ -1679,7 +1679,7 @@ static uint32_t tcpv4_init_isn(struct in_addr *saddr,
memcpy(buf.key, unique_key, sizeof(unique_key));
#if IS_ENABLED(CONFIG_NET_TCP_ISN_RFC6528)
#if defined(CONFIG_NET_TCP_ISN_RFC6528)
mbedtls_md5((const unsigned char *)&buf, sizeof(buf), hash);
#endif
@ -3401,7 +3401,7 @@ void net_tcp_init(void)
tcp_recv_cb = tp_tcp_recv_cb;
#endif
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
#define THREAD_PRIORITY K_PRIO_COOP(0)
#else
#define THREAD_PRIORITY K_PRIO_PREEMPT(0)

View file

@ -33,7 +33,7 @@
_x; \
})
#if IS_ENABLED(CONFIG_NET_TEST_PROTOCOL)
#if defined(CONFIG_NET_TEST_PROTOCOL)
#define tcp_malloc(_size) \
tp_malloc(_size, tp_basename(__FILE__), __LINE__, __func__)
#define tcp_calloc(_nmemb, _size) \
@ -98,7 +98,7 @@
})
#if IS_ENABLED(CONFIG_NET_TEST_PROTOCOL)
#if defined(CONFIG_NET_TEST_PROTOCOL)
#define conn_seq(_conn, _req) \
tp_seq_track(TP_SEQ, &(_conn)->seq, (_req), tp_basename(__FILE__), \
__LINE__, __func__)

View file

@ -16,7 +16,7 @@ extern "C" {
#include <zephyr/net/net_pkt.h>
#include "connection.h"
#if IS_ENABLED(CONFIG_NET_TEST_PROTOCOL)
#if defined(CONFIG_NET_TEST_PROTOCOL)
#define TP_SEQ 0
#define TP_ACK 1

View file

@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL);
static K_FIFO_DEFINE(tx_queue);
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
/* Lowest priority cooperative thread */
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
#else

View file

@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(conn_mgr, CONFIG_NET_CONNECTION_MANAGER_LOG_LEVEL);
#include <conn_mgr.h>
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
#else
#define THREAD_PRIORITY K_PRIO_PREEMPT(7)

View file

@ -63,7 +63,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include "lwm2m_rd_client.h"
#endif
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
/* Lowest priority cooperative thread */
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)
#else

View file

@ -28,7 +28,7 @@ static struct sockaddr_in *in4_addr_my;
static bool init_done;
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
#define TCP_RECEIVER_THREAD_PRIORITY K_PRIO_COOP(8)
#else
#define TCP_RECEIVER_THREAD_PRIORITY K_PRIO_PREEMPT(8)

View file

@ -26,7 +26,7 @@ LOG_MODULE_DECLARE(net_zperf, CONFIG_NET_ZPERF_LOG_LEVEL);
static struct sockaddr_in6 *in6_addr_my;
static struct sockaddr_in *in4_addr_my;
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
#define UDP_RECEIVER_THREAD_PRIORITY K_PRIO_COOP(8)
#else
#define UDP_RECEIVER_THREAD_PRIORITY K_PRIO_PREEMPT(8)

View file

@ -66,19 +66,19 @@ LOG_MODULE_REGISTER(usb_dfu, CONFIG_USB_DEVICE_LOG_LEVEL);
#define INTERMITTENT_CHECK_DELAY 50
#if IS_ENABLED(CONFIG_USB_DFU_REBOOT)
#if defined(CONFIG_USB_DFU_REBOOT)
#define DFU_DESC_ATTRIBUTES_MANIF_TOL 0
#else
#define DFU_DESC_ATTRIBUTES_MANIF_TOL DFU_ATTR_MANIFESTATION_TOLERANT
#endif
#if IS_ENABLED(CONFIG_USB_DFU_ENABLE_UPLOAD)
#if defined(CONFIG_USB_DFU_ENABLE_UPLOAD)
#define DFU_DESC_ATTRIBUTES_CAN_UPLOAD DFU_ATTR_CAN_UPLOAD
#else
#define DFU_DESC_ATTRIBUTES_CAN_UPLOAD 0
#endif
#if IS_ENABLED(CONFIG_USB_DFU_WILL_DETACH)
#if defined(CONFIG_USB_DFU_WILL_DETACH)
#define DFU_DESC_ATTRIBUTES_WILL_DETACH DFU_ATTR_WILL_DETACH
#else
#define DFU_DESC_ATTRIBUTES_WILL_DETACH 0
@ -470,7 +470,7 @@ static int dfu_class_handle_to_host(struct usb_setup_packet *setup,
if (dfu_data.state == dfuMANIFEST_SYNC) {
#if IS_ENABLED(CONFIG_USB_DFU_REBOOT)
#if defined(CONFIG_USB_DFU_REBOOT)
dfu_data.state = dfuMANIFEST_WAIT_RST;
reboot_schedule();
#else

View file

@ -16,7 +16,7 @@
#include "usbd_ch9.h"
#include <zephyr/logging/log.h>
#if IS_ENABLED(CONFIG_USBD_LOG_LEVEL)
#if defined(CONFIG_USBD_LOG_LEVEL)
#define USBD_CLASS_LOG_LEVEL CONFIG_USBD_LOG_LEVEL
#else
#define USBD_CLASS_LOG_LEVEL LOG_LEVEL_NONE