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í
parent ea33f2fce4
commit 66d4c64966
67 changed files with 128 additions and 128 deletions

View file

@ -39,7 +39,7 @@ struct switch_cfg {
gpio_pin_t pin;
gpio_dt_flags_t flags;
bool on;
#if IS_ENABLED(CONFIG_LOG)
#if defined(CONFIG_LOG)
uint8_t port;
bool info;
const char *name;
@ -175,7 +175,7 @@ static int init(const struct device *dev)
flags |= (cfg->on ? GPIO_OUTPUT_ACTIVE
: GPIO_OUTPUT_INACTIVE);
rc = gpio_pin_configure(cfg->gpio, cfg->pin, flags);
#if IS_ENABLED(CONFIG_LOG)
#if defined(CONFIG_LOG)
LOG_DBG("Configuring P%d.%02d with flags: 0x%08x",
cfg->port, cfg->pin, flags);
if (rc) {

View file

@ -6,7 +6,7 @@
#define DLCI_CONTROL 0
#if IS_ENABLED(CONFIG_GSM_MUX)
#if defined(CONFIG_GSM_MUX)
#define DLCI_AT CONFIG_GSM_MUX_DLCI_AT
#define DLCI_PPP CONFIG_GSM_MUX_DLCI_PPP
#else

View file

@ -89,10 +89,10 @@ static struct net_if *get_iface(struct e1000_dev *ctx, uint16_t vlan_tag)
static enum ethernet_hw_caps e1000_caps(const struct device *dev)
{
return
#if IS_ENABLED(CONFIG_NET_VLAN)
#if defined(CONFIG_NET_VLAN)
ETHERNET_HW_VLAN |
#endif
#if IS_ENABLED(CONFIG_ETH_E1000_PTP_CLOCK)
#if defined(CONFIG_ETH_E1000_PTP_CLOCK)
ETHERNET_PTP |
#endif
ETHERNET_LINK_10BASE_T | ETHERNET_LINK_100BASE_T |

View file

@ -37,7 +37,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include <zephyr/drivers/ptp_clock.h>
#endif
#if IS_ENABLED(CONFIG_NET_DSA)
#if defined(CONFIG_NET_DSA)
#include <zephyr/net/dsa.h>
#endif
@ -868,7 +868,7 @@ static int eth_rx(struct eth_context *context)
#endif /* CONFIG_PTP_CLOCK_MCUX */
iface = get_iface(context, vlan_tag);
#if IS_ENABLED(CONFIG_NET_DSA)
#if defined(CONFIG_NET_DSA)
iface = dsa_net_recv(iface, &pkt);
#endif
if (net_recv_data(iface, pkt) < 0) {
@ -1200,7 +1200,7 @@ static void eth_iface_init(struct net_if *iface)
context->iface = iface;
}
#if IS_ENABLED(CONFIG_NET_DSA)
#if defined(CONFIG_NET_DSA)
dsa_register_master_tx(iface, &eth_tx);
#endif
ethernet_init(iface);
@ -1217,7 +1217,7 @@ static enum ethernet_hw_caps eth_mcux_get_capabilities(const struct device *dev)
#if defined(CONFIG_PTP_CLOCK_MCUX)
ETHERNET_PTP |
#endif
#if IS_ENABLED(CONFIG_NET_DSA)
#if defined(CONFIG_NET_DSA)
ETHERNET_DSA_MASTER_PORT |
#endif
#if defined(CONFIG_ETH_MCUX_HW_ACCELERATION)
@ -1272,7 +1272,7 @@ static const struct ethernet_api api_funcs = {
#endif
.get_capabilities = eth_mcux_get_capabilities,
.set_config = eth_mcux_set_config,
#if IS_ENABLED(CONFIG_NET_DSA)
#if defined(CONFIG_NET_DSA)
.send = dsa_tx,
#else
.send = eth_tx,

View file

@ -436,7 +436,7 @@ static void eth_iface_init(struct net_if *iface)
ctx->init_done = true;
#if IS_ENABLED(CONFIG_ETH_NATIVE_POSIX_RANDOM_MAC)
#if defined(CONFIG_ETH_NATIVE_POSIX_RANDOM_MAC)
/* 00-00-5E-00-53-xx Documentation RFC 7042 */
gen_random_mac(ctx->mac_addr, 0x00, 0x00, 0x5E);
@ -650,7 +650,7 @@ LISTIFY(CONFIG_ETH_NATIVE_POSIX_INTERFACE_COUNT, DEFINE_ETH_DEVICE, (;), _);
#if defined(CONFIG_ETH_NATIVE_POSIX_PTP_CLOCK)
#if IS_ENABLED(CONFIG_NET_GPTP)
#if defined(CONFIG_NET_GPTP)
BUILD_ASSERT( \
CONFIG_ETH_NATIVE_POSIX_INTERFACE_COUNT == CONFIG_NET_GPTP_NUM_PORTS, \
"Number of network interfaces must match gPTP port count");

View file

@ -54,7 +54,7 @@ static int erase_synchronously(uint32_t addr, uint32_t size);
#endif /* !CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE */
static const struct flash_parameters flash_nrf_parameters = {
#if IS_ENABLED(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS)
#if defined(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS)
.write_block_size = 1,
#else
.write_block_size = 4,
@ -408,7 +408,7 @@ static int write_op(void *context)
nrf_flash_sync_get_timestamp_begin();
}
#endif /* !CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE */
#if IS_ENABLED(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS)
#if defined(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS)
/* If not aligned, write unaligned beginning */
if (!is_aligned_32(w_ctx->flash_addr)) {
uint32_t count = sizeof(uint32_t) - (w_ctx->flash_addr & 0x3);
@ -460,7 +460,7 @@ static int write_op(void *context)
}
#endif /* !CONFIG_SOC_FLASH_NRF_RADIO_SYNC_NONE */
}
#if IS_ENABLED(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS)
#if defined(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS)
/* Write remaining unaligned data */
if (w_ctx->len) {
if (SUSPEND_POFWARN()) {

View file

@ -69,7 +69,7 @@ struct spi_flash_at45_config {
#if ANY_INST_HAS_WP_GPIOS
const struct gpio_dt_spec *wp;
#endif
#if IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT)
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
struct flash_pages_layout pages_layout;
#endif
uint32_t chip_size;
@ -500,7 +500,7 @@ static int spi_flash_at45_erase(const struct device *dev, off_t offset,
return err;
}
#if IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT)
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
static void spi_flash_at45_pages_layout(const struct device *dev,
const struct flash_pages_layout **layout,
size_t *layout_size)
@ -594,7 +594,7 @@ static int spi_flash_at45_init(const struct device *dev)
return err;
}
#if IS_ENABLED(CONFIG_PM_DEVICE)
#if defined(CONFIG_PM_DEVICE)
static int spi_flash_at45_pm_action(const struct device *dev,
enum pm_device_action action)
{
@ -636,7 +636,7 @@ static const struct flash_driver_api spi_flash_at45_api = {
.write = spi_flash_at45_write,
.erase = spi_flash_at45_erase,
.get_parameters = flash_at45_get_parameters,
#if IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT)
#if defined(CONFIG_FLASH_PAGE_LAYOUT)
.page_layout = spi_flash_at45_pages_layout,
#endif
};

View file

@ -475,7 +475,7 @@ static bool nrf5_tx_csma_ca(struct net_pkt *pkt, uint8_t *payload)
}
#endif
#if IS_ENABLED(CONFIG_NET_PKT_TXTIME)
#if defined(CONFIG_NET_PKT_TXTIME)
/**
* @brief Convert 32-bit target time to absolute 64-bit target time.
*/
@ -601,7 +601,7 @@ static int nrf5_tx(const struct device *dev,
ret = nrf5_tx_csma_ca(pkt, nrf5_radio->tx_psdu);
break;
#endif
#if IS_ENABLED(CONFIG_NET_PKT_TXTIME)
#if defined(CONFIG_NET_PKT_TXTIME)
case IEEE802154_TX_MODE_TXTIME:
case IEEE802154_TX_MODE_TXTIME_CCA:
__ASSERT_NO_MSG(pkt);
@ -998,7 +998,7 @@ void nrf_802154_received_timestamp_raw(uint8_t *data, int8_t power, uint8_t lqi,
nrf5_data.rx_frames[i].rssi = power;
nrf5_data.rx_frames[i].lqi = lqi;
#if IS_ENABLED(CONFIG_NET_PKT_TIMESTAMP)
#if defined(CONFIG_NET_PKT_TIMESTAMP)
nrf5_data.rx_frames[i].time = nrf_802154_mhr_timestamp_get(time, data[0]);
#endif
@ -1085,7 +1085,7 @@ void nrf_802154_transmitted_raw(uint8_t *frame,
nrf5_data.ack_frame.rssi = metadata->data.transmitted.power;
nrf5_data.ack_frame.lqi = metadata->data.transmitted.lqi;
#if IS_ENABLED(CONFIG_NET_PKT_TIMESTAMP)
#if defined(CONFIG_NET_PKT_TIMESTAMP)
nrf5_data.ack_frame.time =
nrf_802154_mhr_timestamp_get(
metadata->data.transmitted.time, nrf5_data.ack_frame.psdu[0]);

View file

@ -11,7 +11,7 @@
#include <soc.h>
#include <zephyr/drivers/ipm.h>
#include <zephyr/irq.h>
#if IS_ENABLED(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_IPM_IMX_REV2)
#define DT_DRV_COMPAT nxp_imx_mu_rev2
#include "fsl_mu.h"
#else
@ -37,7 +37,7 @@ struct imx_mu_data {
void *user_data;
};
#if IS_ENABLED(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_IPM_IMX_REV2)
/*!
* @brief Check RX full status.
*
@ -126,7 +126,7 @@ static void imx_mu_isr(const struct device *dev)
}
if (all_registers_full) {
for (i = 0; i < IMX_IPM_DATA_REGS; i++) {
#if IS_ENABLED(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_IPM_IMX_REV2)
data32[i] = MU_ReceiveMsg(base,
(id * IMX_IPM_DATA_REGS) + i);
#else
@ -181,7 +181,7 @@ static int imx_mu_ipm_send(const struct device *dev, int wait, uint32_t id,
/* Actual message is passing using 32 bits registers */
memcpy(data32, data, size);
#if IS_ENABLED(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_IPM_IMX_REV2)
if (wait) {
for (i = 0; i < IMX_IPM_DATA_REGS; i++) {
MU_SendMsgNonBlocking(base, id * IMX_IPM_DATA_REGS + i,
@ -248,7 +248,7 @@ static int imx_mu_ipm_set_enabled(const struct device *dev, int enable)
{
const struct imx_mu_config *config = dev->config;
MU_Type *base = MU(config);
#if IS_ENABLED(CONFIG_IPM_IMX_REV2)
#if defined(CONFIG_IPM_IMX_REV2)
#if CONFIG_IPM_IMX_MAX_DATA_SIZE_4
if (enable) {
MU_EnableInterrupts(base, kMU_Rx0FullInterruptEnable);

View file

@ -26,7 +26,7 @@ static struct ipm_nrf_data nrfx_ipm_data;
static void gipm_init(void);
static void gipm_send(uint32_t id);
#if IS_ENABLED(CONFIG_IPM_NRF_SINGLE_INSTANCE)
#if defined(CONFIG_IPM_NRF_SINGLE_INSTANCE)
static void nrfx_ipc_handler(uint8_t event_idx, void *p_context)
{
@ -231,7 +231,7 @@ LISTIFY(NRFX_IPC_ID_MAX_VALUE, VIPM_DEVICE, (;), _);
static void gipm_init(void)
{
/* Init IPC */
#if IS_ENABLED(CONFIG_IPM_NRF_SINGLE_INSTANCE)
#if defined(CONFIG_IPM_NRF_SINGLE_INSTANCE)
nrfx_ipc_init(0, nrfx_ipc_handler, (void *)&nrfx_ipm_data);
#else
nrfx_ipc_init(0, vipm_dispatcher, (void *)&nrfx_ipm_data);

View file

@ -1023,7 +1023,7 @@ static int ppp_start(const struct device *dev)
* configuration is enabled, and use that. If none are enabled,
* then use our own config.
*/
#if IS_ENABLED(CONFIG_GSM_MUX)
#if defined(CONFIG_GSM_MUX)
const struct device *mux;
mux = uart_mux_find(CONFIG_GSM_MUX_DLCI_PPP);

View file

@ -15,7 +15,7 @@
#include <zephyr/drivers/uart.h>
#include <zephyr/sys/device_mmio.h>
#include <zephyr/irq.h>
#if IS_ENABLED(CONFIG_PINCTRL)
#if defined(CONFIG_PINCTRL)
#include <zephyr/drivers/pinctrl.h>
#endif
@ -51,7 +51,7 @@ struct pl011_regs {
struct pl011_config {
DEVICE_MMIO_ROM;
uint32_t sys_clk_freq;
#if IS_ENABLED(CONFIG_PINCTRL)
#if defined(CONFIG_PINCTRL)
const struct pinctrl_dev_config *pincfg;
#endif
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@ -395,7 +395,7 @@ static int pl011_init(const struct device *dev)
* virtualization software).
*/
if (!data->sbsa) {
#if IS_ENABLED(CONFIG_PINCTRL)
#if defined(CONFIG_PINCTRL)
ret = pinctrl_apply_state(config->pincfg, PINCTRL_STATE_DEFAULT);
if (ret) {
return ret;
@ -442,7 +442,7 @@ static int pl011_init(const struct device *dev)
return 0;
}
#if IS_ENABLED(CONFIG_PINCTRL)
#if defined(CONFIG_PINCTRL)
#define PINCTRL_DEFINE(n) PINCTRL_DT_INST_DEFINE(n);
#define PINCTRL_INIT(n) .pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n),
#else

View file

@ -11,7 +11,7 @@
#include <zephyr/drivers/spi.h>
#include <zephyr/sys/util.h>
#include <soc.h>
#if IS_ENABLED(CONFIG_PINCTRL)
#if defined(CONFIG_PINCTRL)
#include <zephyr/drivers/pinctrl.h>
#endif
@ -245,10 +245,10 @@ LOG_MODULE_REGISTER(spi_pl022);
struct spi_pl022_cfg {
const uint32_t reg;
const uint32_t pclk;
#if IS_ENABLED(CONFIG_PINCTRL)
#if defined(CONFIG_PINCTRL)
const struct pinctrl_dev_config *pincfg;
#endif
#if IS_ENABLED(CONFIG_SPI_PL022_INTERRUPT)
#if defined(CONFIG_SPI_PL022_INTERRUPT)
void (*irq_config)(const struct device *port);
#endif
};
@ -350,7 +350,7 @@ static int spi_pl022_configure(const struct device *dev,
SSP_WRITE_REG(SSP_CR0(cfg->reg), cr0);
SSP_WRITE_REG(SSP_CR1(cfg->reg), cr1);
#if IS_ENABLED(CONFIG_SPI_PL022_INTERRUPT)
#if defined(CONFIG_SPI_PL022_INTERRUPT)
SSP_WRITE_REG(SSP_IMSC(cfg->reg),
SSP_IMSC_MASK_RORIM | SSP_IMSC_MASK_RTIM | SSP_IMSC_MASK_RXIM);
#endif
@ -365,7 +365,7 @@ static inline bool spi_pl022_transfer_ongoing(struct spi_pl022_data *data)
return spi_context_tx_on(&data->ctx) || spi_context_rx_on(&data->ctx);
}
#if IS_ENABLED(CONFIG_SPI_PL022_INTERRUPT)
#if defined(CONFIG_SPI_PL022_INTERRUPT)
static void spi_pl022_async_xfer(const struct device *dev)
{
@ -537,7 +537,7 @@ static int spi_pl022_transceive_impl(const struct device *dev,
spi_context_cs_control(ctx, true);
#if IS_ENABLED(CONFIG_SPI_PL022_INTERRUPT)
#if defined(CONFIG_SPI_PL022_INTERRUPT)
spi_pl022_start_async_xfer(dev);
ret = spi_context_wait_for_completion(ctx);
#else
@ -570,7 +570,7 @@ static int spi_pl022_transceive(const struct device *dev,
return spi_pl022_transceive_impl(dev, config, tx_bufs, rx_bufs, NULL, NULL);
}
#if IS_ENABLED(CONFIG_SPI_ASYNC)
#if defined(CONFIG_SPI_ASYNC)
static int spi_pl022_transceive_async(const struct device *dev,
const struct spi_config *config,
@ -596,7 +596,7 @@ static int spi_pl022_release(const struct device *dev,
static struct spi_driver_api spi_pl022_api = {
.transceive = spi_pl022_transceive,
#if IS_ENABLED(CONFIG_SPI_ASYNC)
#if defined(CONFIG_SPI_ASYNC)
.transceive_async = spi_pl022_transceive_async,
#endif
.release = spi_pl022_release
@ -613,7 +613,7 @@ static int spi_pl022_init(const struct device *dev)
struct spi_pl022_data *data = dev->data;
int ret;
#if IS_ENABLED(CONFIG_PINCTRL)
#if defined(CONFIG_PINCTRL)
const struct spi_pl022_cfg *cfg = dev->config;
ret = pinctrl_apply_state(cfg->pincfg, PINCTRL_STATE_DEFAULT);
@ -623,7 +623,7 @@ static int spi_pl022_init(const struct device *dev)
}
#endif
#if IS_ENABLED(CONFIG_SPI_PL022_INTERRUPT)
#if defined(CONFIG_SPI_PL022_INTERRUPT)
cfg->irq_config(dev);
#endif
@ -645,7 +645,7 @@ static int spi_pl022_init(const struct device *dev)
return 0;
}
#if IS_ENABLED(CONFIG_PINCTRL)
#if defined(CONFIG_PINCTRL)
#define PINCTRL_DEFINE(n) PINCTRL_DT_INST_DEFINE(n);
#define PINCTRL_INIT(n) .pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n),
#else
@ -653,7 +653,7 @@ static int spi_pl022_init(const struct device *dev)
#define PINCTRL_INIT(n)
#endif /* CONFIG_PINCTRL */
#if IS_ENABLED(CONFIG_SPI_PL022_INTERRUPT)
#if defined(CONFIG_SPI_PL022_INTERRUPT)
#define DECLARE_IRQ_CONFIGURE(idx) \
static void spi_pl022_irq_config_##idx(const struct device *dev) \
{ \

View file

@ -12,7 +12,7 @@
#include "udc_common.h"
#include <zephyr/logging/log.h>
#if IS_ENABLED(CONFIG_UDC_DRIVER_LOG_LEVEL)
#if defined(CONFIG_UDC_DRIVER_LOG_LEVEL)
#define UDC_COMMON_LOG_LEVEL CONFIG_UDC_DRIVER_LOG_LEVEL
#else
#define UDC_COMMON_LOG_LEVEL LOG_LEVEL_NONE
@ -1091,7 +1091,7 @@ void udc_ctrl_update_stage(const struct device *dev,
data->stage = next_stage;
}
#if IS_ENABLED(CONFIG_UDC_WORKQUEUE)
#if defined(CONFIG_UDC_WORKQUEUE)
K_KERNEL_STACK_DEFINE(udc_work_q_stack, CONFIG_UDC_WORKQUEUE_STACK_SIZE);
struct k_work_q udc_work_q;

View file

@ -458,7 +458,7 @@ int udc_ctrl_submit_status(const struct device *dev,
void udc_ctrl_update_stage(const struct device *dev,
struct net_buf *const buf);
#if IS_ENABLED(CONFIG_UDC_WORKQUEUE)
#if defined(CONFIG_UDC_WORKQUEUE)
extern struct k_work_q udc_work_q;
static inline struct k_work_q *udc_get_work_q(void)

View file

@ -12,7 +12,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/conn.h>
#if IS_ENABLED(CONFIG_BT_BAP_SCAN_DELEGATOR)
#if defined(CONFIG_BT_BAP_SCAN_DELEGATOR)
#define BT_BAP_SCAN_DELEGATOR_MAX_METADATA_LEN CONFIG_BT_BAP_SCAN_DELEGATOR_MAX_METADATA_LEN
#define BT_BAP_SCAN_DELEGATOR_MAX_SUBGROUPS CONFIG_BT_BAP_SCAN_DELEGATOR_MAX_SUBGROUPS
#else

View file

@ -48,7 +48,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_OPENTHREAD_L2_LOG_LEVEL);
#define FRAME_TYPE_MASK 0x07
#define FRAME_TYPE_ACK 0x02
#if IS_ENABLED(CONFIG_NET_TC_THREAD_COOPERATIVE)
#if defined(CONFIG_NET_TC_THREAD_COOPERATIVE)
#define OT_WORKER_PRIORITY K_PRIO_COOP(CONFIG_OPENTHREAD_THREAD_PRIORITY)
#else
#define OT_WORKER_PRIORITY K_PRIO_PREEMPT(CONFIG_OPENTHREAD_THREAD_PRIORITY)

View file

@ -147,7 +147,7 @@ void main(void)
printk("OK\n");
#if IS_ENABLED(CONFIG_PM_DEVICE)
#if defined(CONFIG_PM_DEVICE)
printk("Putting the flash device into suspended state... ");
err = pm_device_action_run(flash_dev, PM_DEVICE_ACTION_SUSPEND);
if (err != 0) {

View file

@ -16,7 +16,7 @@ LOG_MODULE_DECLARE(tagoio_http_post, CONFIG_TAGOIO_HTTP_POST_LOG_LEVEL);
#include "sockets.h"
#if IS_ENABLED(CONFIG_TAGOIO_MANUAL_SERVER)
#if defined(CONFIG_TAGOIO_MANUAL_SERVER)
#define TAGOIO_SERVER CONFIG_TAGOIO_API_SERVER_IP
#else
#define TAGOIO_SERVER "api.tago.io"

View file

@ -501,7 +501,7 @@ static int start_app(void)
#if defined(CONFIG_USERSPACE)
#define STACK_SIZE 2048
#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(8)

View file

@ -36,7 +36,7 @@ static const unsigned char private_key[] = {
#else
#define STACK_SIZE 1024
#endif
#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(8)

View file

@ -21,7 +21,7 @@ extern struct k_mem_domain app_domain;
#define APP_DMEM
#endif
#if IS_ENABLED(CONFIG_NET_TC_THREAD_PREEMPTIVE)
#if defined(CONFIG_NET_TC_THREAD_PREEMPTIVE)
#define THREAD_PRIORITY K_PRIO_PREEMPT(8)
#else
#define THREAD_PRIORITY K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)

View file

@ -14,7 +14,7 @@
#define STACK_SIZE 2048
#endif
#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(8)

View file

@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(net_mgmt_sock_sample, LOG_LEVEL_DBG);
#define MAX_BUF_LEN 64
#define STACK_SIZE 1024
#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(8)

View file

@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(net_pkt_sock_sample, LOG_LEVEL_DBG);
#include <zephyr/net/net_mgmt.h>
#define STACK_SIZE 1024
#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(8)

View file

@ -18,7 +18,7 @@ BUILD_ASSERT(IS_ENABLED(CONFIG_LOG_BACKEND_NET), "syslog backend not enabled");
#define SLEEP_BETWEEN_PRINTS 3
#if IS_ENABLED(CONFIG_LOG_BACKEND_NET)
#if defined(CONFIG_LOG_BACKEND_NET)
extern const struct log_backend *log_backend_net_get(void);
#endif

View file

@ -24,7 +24,7 @@ LOG_MODULE_REGISTER(wpan_serial, CONFIG_USB_DEVICE_LOG_LEVEL);
#include <net_private.h>
#include <zephyr/net/ieee802154_radio.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(8)

View file

@ -18,7 +18,7 @@ LOG_MODULE_REGISTER(wpanusb);
#include "wpanusb.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(8)
@ -28,7 +28,7 @@ LOG_MODULE_REGISTER(wpanusb);
#define WPANUSB_PROTOCOL 0
/* Max packet size for endpoints */
#if IS_ENABLED(CONFIG_USB_DC_HAS_HS_SUPPORT)
#if defined(CONFIG_USB_DC_HAS_HS_SUPPORT)
#define WPANUSB_BULK_EP_MPS 512
#else
#define WPANUSB_BULK_EP_MPS 64

View file

@ -12,7 +12,7 @@
#include <errno.h>
#include <zephyr/sys/printk.h>
#if IS_ENABLED(CONFIG_SETTINGS_FILE)
#if defined(CONFIG_SETTINGS_FILE)
#include <zephyr/fs/fs.h>
#include <zephyr/fs/littlefs.h>
#endif
@ -422,7 +422,7 @@ static void example_initialization(void)
{
int rc;
#if IS_ENABLED(CONFIG_SETTINGS_FILE)
#if defined(CONFIG_SETTINGS_FILE)
FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(cstorage);
/* mounting info */

View file

@ -29,7 +29,7 @@ uint8_t ring_buffer[RING_BUF_SIZE];
struct ring_buf ringbuf;
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT)
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
USBD_CONFIGURATION_DEFINE(config_1,
USB_SCD_SELF_POWERED,
200);
@ -162,7 +162,7 @@ void main(void)
return;
}
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT)
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
ret = enable_usb_device_next();
#else
ret = usb_enable(NULL);

View file

@ -13,7 +13,7 @@
BUILD_ASSERT(DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart),
"Console device is not ACM CDC UART device");
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT)
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
USBD_CONFIGURATION_DEFINE(config_1,
USB_SCD_SELF_POWERED,
200);
@ -80,7 +80,7 @@ void main(void)
const struct device *const dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
uint32_t dtr = 0;
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT)
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
if (enable_usb_device_next()) {
return;
}

View file

@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(webusb);
#include "webusb.h"
/* Max packet size for Bulk endpoints */
#if IS_ENABLED(CONFIG_USB_DC_HAS_HS_SUPPORT)
#if defined(CONFIG_USB_DC_HAS_HS_SUPPORT)
#define WEBUSB_BULK_EP_MPS 512
#else
#define WEBUSB_BULK_EP_MPS 64

View file

@ -51,7 +51,7 @@ BUILD_ASSERT(CHECK(1), MSG(1));
BUILD_ASSERT(CHECK(2), MSG(2));
BUILD_ASSERT(CHECK(3), MSG(3));
#if IS_ENABLED(CONFIG_SOC_NRF52811)
#if defined(CONFIG_SOC_NRF52811)
BUILD_ASSERT(!(SPI_ENABLED(1) && I2C_ENABLED(0)),
"Only one of the following peripherals can be enabled: "
"SPI1, SPIM1, SPIS1, TWI0, TWIM0, TWIS0. "

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

View file

@ -27,7 +27,7 @@
#include "bs_tracing.h"
#include "commands.h"
#if IS_ENABLED(CONFIG_BT_HCI_CORE_LOG_LEVEL_DBG)
#if defined(CONFIG_BT_HCI_CORE_LOG_LEVEL_DBG)
#define LOG_LEVEL LOG_LEVEL_DBG
#else
#define LOG_LEVEL CONFIG_BT_LOG_LEVEL

View file

@ -230,7 +230,7 @@ ZTEST(bt_keys_get_addr_full_list_overwrite_oldest, test_full_list_key_0_in_use_k
bt_addr_le_t *addr = BT_ADDR_LE_5;
uint32_t expected_oldest_params_ref_idx;
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
/* Normally first items inserted in the list are the oldest.
* For this particular test, we need to override that by setting
* the 'aging_counter'

View file

@ -21,7 +21,7 @@ struct id_addr_type {
/* keys.c declarations */
struct bt_keys *bt_keys_get_key_pool(void);
#if IS_ENABLED(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
#if defined(CONFIG_BT_KEYS_OVERWRITE_OLDEST)
uint32_t bt_keys_get_aging_counter_val(void);
#endif

View file

@ -14,7 +14,7 @@
#include <zephyr/storage/disk_access.h>
#include <zephyr/device.h>
#if IS_ENABLED(CONFIG_DISK_DRIVER_SDMMC)
#if defined(CONFIG_DISK_DRIVER_SDMMC)
#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_RAM)
#define DISK_NAME CONFIG_DISK_RAM_VOLUME_NAME

View file

@ -12,7 +12,7 @@
#include <zephyr/timing/timing.h>
#include <zephyr/random/rand32.h>
#if IS_ENABLED(CONFIG_DISK_DRIVER_SDMMC)
#if defined(CONFIG_DISK_DRIVER_SDMMC)
#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_RAM)
#define DISK_NAME CONFIG_DISK_RAM_VOLUME_NAME

View file

@ -26,7 +26,7 @@ static ZTEST_BMEM int fd;
static ZTEST_BMEM struct in6_addr addr_v6;
static ZTEST_DMEM struct in_addr addr_v4 = { { { 192, 0, 2, 3 } } };
#if IS_ENABLED(CONFIG_NET_SOCKETS_LOG_LEVEL_DBG)
#if defined(CONFIG_NET_SOCKETS_LOG_LEVEL_DBG)
#define DBG(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else
#define DBG(fmt, ...)

View file

@ -10,7 +10,7 @@
#include <zephyr/fs/fs.h>
#define FATFS_MNTP "/NAND:"
#if IS_ENABLED(CONFIG_FS_FATFS_LFN)
#if defined(CONFIG_FS_FATFS_LFN)
#define TEST_FILE FATFS_MNTP \
"/testlongfilenamethatsmuchlongerthan8.3chars.text"
#else

View file

@ -33,7 +33,7 @@ struct usb_test_config {
struct usb_ep_descriptor if0_in2_ep;
} __packed;
#if IS_ENABLED(CONFIG_USB_DC_HAS_HS_SUPPORT)
#if defined(CONFIG_USB_DC_HAS_HS_SUPPORT)
#define TEST_BULK_EP_MPS 512
#else
#define TEST_BULK_EP_MPS 64

View file

@ -11,7 +11,7 @@
#include <zephyr/usb/usb_device.h>
/* Max packet size for endpoints */
#if IS_ENABLED(CONFIG_USB_DC_HAS_HS_SUPPORT)
#if defined(CONFIG_USB_DC_HAS_HS_SUPPORT)
#define BULK_EP_MPS 512
#else
#define BULK_EP_MPS 64