everywhere: replace #if IS_ENABLED() as per docs

Replace `#if IS_ENABLED()` with `#if defined()` as recommended by the
documentation of `IS_ENABLED`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
Jordan Yates 2024-06-24 20:59:51 +10:00 committed by Anas Nashif
commit 91f8c1aea9
53 changed files with 215 additions and 215 deletions

View file

@ -15,11 +15,11 @@
struct int_list_header {
uint32_t table_size;
uint32_t offset;
#if IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
#if defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
uint32_t swi_table_entry_size;
uint32_t shared_isr_table_entry_size;
uint32_t shared_isr_client_num_offset;
#endif /* IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */
#endif /* defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */
};
/* These values are not included in the resulting binary, but instead form the
@ -29,13 +29,13 @@ struct int_list_header {
Z_GENERIC_SECTION(.irq_info) __used struct int_list_header _iheader = {
.table_size = IRQ_TABLE_SIZE,
.offset = CONFIG_GEN_IRQ_START_VECTOR,
#if IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
#if defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
.swi_table_entry_size = sizeof(struct _isr_table_entry),
#if IS_ENABLED(CONFIG_SHARED_INTERRUPTS)
#if defined(CONFIG_SHARED_INTERRUPTS)
.shared_isr_table_entry_size = sizeof(struct z_shared_isr_table_entry),
.shared_isr_client_num_offset = offsetof(struct z_shared_isr_table_entry, client_num),
#endif /* IS_ENABLED(CONFIG_SHARED_INTERRUPTS) */
#endif /* IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */
#endif /* defined(CONFIG_SHARED_INTERRUPTS) */
#endif /* defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */
};
/* These are placeholder tables. They will be replaced by the real tables

View file

@ -467,19 +467,19 @@ int cache_instr_flush_and_invd_range(void *addr, size_t size)
return -ENOTSUP;
}
#if IS_ENABLED(CONFIG_DCACHE_LINE_SIZE_DETECT)
#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT)
size_t cache_data_line_size_get(void)
{
return cache_cfg.data_line_size;
}
#endif /* IS_ENABLED(CONFIG_DCACHE_LINE_SIZE_DETECT) */
#endif /* defined(CONFIG_DCACHE_LINE_SIZE_DETECT) */
#if IS_ENABLED(CONFIG_ICACHE_LINE_SIZE_DETECT)
#if defined(CONFIG_ICACHE_LINE_SIZE_DETECT)
size_t cache_instr_line_size_get(void)
{
return cache_cfg.instr_line_size;
}
#endif /* IS_ENABLED(CONFIG_ICACHE_LINE_SIZE_DETECT) */
#endif /* defined(CONFIG_ICACHE_LINE_SIZE_DETECT) */
static int andes_cache_init(void)
{
@ -492,7 +492,7 @@ static int andes_cache_init(void)
LOG_ERR("Platform doesn't support I-cache, "
"please disable CONFIG_ICACHE");
}
#if IS_ENABLED(CONFIG_ICACHE_LINE_SIZE_DETECT)
#if defined(CONFIG_ICACHE_LINE_SIZE_DETECT)
/* Icache line size */
if (line_size <= 5) {
cache_cfg.instr_line_size = 1 << (line_size + 2);
@ -507,7 +507,7 @@ static int andes_cache_init(void)
#else
LOG_ERR("Please specific the i-cache-line-size "
"CPU0 property of the DT");
#endif /* IS_ENABLED(CONFIG_ICACHE_LINE_SIZE_DETECT) */
#endif /* defined(CONFIG_ICACHE_LINE_SIZE_DETECT) */
}
if (IS_ENABLED(CONFIG_DCACHE)) {
@ -516,7 +516,7 @@ static int andes_cache_init(void)
LOG_ERR("Platform doesn't support D-cache, "
"please disable CONFIG_DCACHE");
}
#if IS_ENABLED(CONFIG_DCACHE_LINE_SIZE_DETECT)
#if defined(CONFIG_DCACHE_LINE_SIZE_DETECT)
/* Dcache line size */
if (line_size <= 5) {
cache_cfg.data_line_size = 1 << (line_size + 2);
@ -531,7 +531,7 @@ static int andes_cache_init(void)
#else
LOG_ERR("Please specific the d-cache-line-size "
"CPU0 property of the DT");
#endif /* IS_ENABLED(CONFIG_DCACHE_LINE_SIZE_DETECT) */
#endif /* defined(CONFIG_DCACHE_LINE_SIZE_DETECT) */
}
if (!(csr_read(NDS_MMSC_CFG) & MMSC_CFG_CCTLCSR)) {

View file

@ -208,7 +208,7 @@ static ALWAYS_INLINE int nds_l2_cache_init(void)
{
unsigned long line_size;
#if IS_ENABLED(CONFIG_SYSCON)
#if defined(CONFIG_SYSCON)
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(syscon), andestech_atcsmu100, okay)
uint32_t system_cfg;
const struct device *syscon_dev = DEVICE_DT_GET(DT_NODELABEL(syscon));
@ -228,7 +228,7 @@ static ALWAYS_INLINE int nds_l2_cache_init(void)
return 0;
}
#endif /* andestech_atcsmu100 dts node status okay */
#endif /* IS_ENABLED(CONFIG_SYSCON) */
#endif /* defined(CONFIG_SYSCON) */
uint32_t l2c_ctrl;

View file

@ -274,7 +274,7 @@ static int flash_sim_write(const struct device *dev, const off_t offset,
#endif /* CONFIG_FLASH_SIMULATOR_STATS */
/* only pull bits to zero */
#if IS_ENABLED(CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE)
#if defined(CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE)
#if FLASH_SIMULATOR_ERASE_VALUE == 0xFF
*(MOCK_FLASH(offset + i)) &= *((uint8_t *)data + i);
#else

View file

@ -67,14 +67,14 @@ int z_impl_flash_flatten(const struct device *dev, off_t offset, size_t size)
(const struct flash_driver_api *)dev->api;
__maybe_unused const struct flash_parameters *params = api->get_parameters(dev);
#if IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
if ((flash_params_get_erase_cap(params) & FLASH_ERASE_C_EXPLICIT) &&
api->erase != NULL) {
return api->erase(dev, offset, size);
}
#endif
#if IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
#if defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
return flash_fill(dev, params->erase_value, offset, size);
#else
return -ENOSYS;

View file

@ -184,7 +184,7 @@ static int flash_nrf_write(const struct device *dev, off_t addr,
return -EINVAL;
}
#if !IS_ENABLED(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS)
#if !defined(CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS)
if (!is_aligned_32(addr) || (len % sizeof(uint32_t))) {
LOG_ERR("not word-aligned: 0x%08lx:%zu",
(unsigned long)addr, len);

View file

@ -525,7 +525,7 @@ static void spi_flash_at45_pages_layout(const struct device *dev,
*layout = &cfg->pages_layout;
*layout_size = 1;
}
#endif /* IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT) */
#endif /* defined(CONFIG_FLASH_PAGE_LAYOUT) */
static int power_down_op(const struct device *dev, uint8_t opcode,
uint32_t delay)
@ -636,7 +636,7 @@ static int spi_flash_at45_pm_action(const struct device *dev,
return 0;
}
#endif /* IS_ENABLED(CONFIG_PM_DEVICE) */
#endif /* defined(CONFIG_PM_DEVICE) */
static const struct flash_parameters *
flash_at45_get_parameters(const struct device *dev)

View file

@ -739,7 +739,7 @@ static int nrf5_continuous_carrier(const struct device *dev)
}
#endif
#if !IS_ENABLED(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT)
#if !defined(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT)
static void nrf5_radio_irq(const void *arg)
{
ARG_UNUSED(arg);
@ -752,7 +752,7 @@ static void nrf5_irq_config(const struct device *dev)
{
ARG_UNUSED(dev);
#if !IS_ENABLED(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT)
#if !defined(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT)
IRQ_CONNECT(DT_IRQN(DT_NODELABEL(radio)), NRF_802154_IRQ_PRIORITY, nrf5_radio_irq, NULL, 0);
irq_enable(DT_IRQN(DT_NODELABEL(radio)));
#endif

View file

@ -357,7 +357,7 @@ static void plic_irq_handler(const struct device *dev)
z_irq_spurious(NULL);
}
#if IS_ENABLED(PLIC_DRV_HAS_COMPAT(andestech_nceplic100))
#if PLIC_DRV_HAS_COMPAT(andestech_nceplic100)
trig_val = riscv_plic_irq_trig_val(dev, local_irq);
/*
* Edge-triggered interrupts on Andes NCEPLIC100 have to be acknowledged first before
@ -377,7 +377,7 @@ static void plic_irq_handler(const struct device *dev)
* PLIC controller that the IRQ has been handled
* for level triggered interrupts.
*/
#if IS_ENABLED(PLIC_DRV_HAS_COMPAT(andestech_nceplic100))
#if PLIC_DRV_HAS_COMPAT(andestech_nceplic100)
/* For NCEPLIC100, handle only if level-triggered */
if (trig_val == PLIC_TRIG_LEVEL) {
sys_write32(local_irq, claim_complete_addr);

View file

@ -167,7 +167,7 @@ static int imx_mu_ipm_send(const struct device *dev, int wait, uint32_t id,
const struct imx_mu_config *config = dev->config;
MU_Type *base = MU(config);
uint32_t data32[IMX_IPM_DATA_REGS] = {0};
#if !IS_ENABLED(CONFIG_HAS_MCUX)
#if !defined(CONFIG_HAS_MCUX)
mu_status_t status;
#endif
int i;

View file

@ -408,7 +408,7 @@ static int regulator_da1469x_init(const struct device *dev)
return regulator_common_init(dev, 0);
}
#if IS_ENABLED(CONFIG_PM_DEVICE)
#if defined(CONFIG_PM_DEVICE)
static int regulator_da1469x_pm_action(const struct device *dev,
enum pm_device_action action)
{

View file

@ -21,10 +21,10 @@
#if defined(CONFIG_PINCTRL)
#include <zephyr/drivers/pinctrl.h>
#endif
#if IS_ENABLED(CONFIG_RESET)
#if defined(CONFIG_RESET)
#include <zephyr/drivers/reset.h>
#endif
#if IS_ENABLED(CONFIG_CLOCK_CONTROL)
#if defined(CONFIG_CLOCK_CONTROL)
#include <zephyr/drivers/clock_control.h>
#endif
@ -41,10 +41,10 @@ struct pl011_config {
#if defined(CONFIG_PINCTRL)
const struct pinctrl_dev_config *pincfg;
#endif
#if IS_ENABLED(CONFIG_RESET)
#if defined(CONFIG_RESET)
const struct reset_dt_spec reset;
#endif
#if IS_ENABLED(CONFIG_CLOCK_CONTROL)
#if defined(CONFIG_CLOCK_CONTROL)
const struct device *clock_dev;
clock_control_subsys_t clock_id;
#endif
@ -445,7 +445,7 @@ static int pl011_init(const struct device *dev)
DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE);
#if IS_ENABLED(CONFIG_RESET)
#if defined(CONFIG_RESET)
if (config->reset.dev) {
ret = reset_line_toggle_dt(&config->reset);
if (ret) {
@ -454,7 +454,7 @@ static int pl011_init(const struct device *dev)
}
#endif
#if IS_ENABLED(CONFIG_CLOCK_CONTROL)
#if defined(CONFIG_CLOCK_CONTROL)
if (config->clock_dev) {
clock_control_on(config->clock_dev, config->clock_id);
clock_control_get_rate(config->clock_dev, config->clock_id, &data->clk_freq);
@ -560,7 +560,7 @@ static int pl011_init(const struct device *dev)
#define PINCTRL_INIT(n)
#endif /* CONFIG_PINCTRL */
#if IS_ENABLED(CONFIG_RESET)
#if defined(CONFIG_RESET)
#define RESET_INIT(n) \
IF_ENABLED(DT_INST_NODE_HAS_PROP(0, resets), (.reset = RESET_DT_SPEC_INST_GET(n),))
#else

View file

@ -179,7 +179,7 @@ static int reg_test_bit(uint8_t bit, mm_reg_t addr, uint32_t off)
/* Common registers settings, bits etc... */
/* CTRLR0 settings */
#if !IS_ENABLED(CONFIG_SPI_DW_HSSI)
#if !defined(CONFIG_SPI_DW_HSSI)
#define DW_SPI_CTRLR0_SCPH_BIT (6)
#define DW_SPI_CTRLR0_SCPOL_BIT (7)
#define DW_SPI_CTRLR0_TMOD_SHIFT (8)

View file

@ -275,11 +275,11 @@ struct spi_pl022_cfg {
const uint32_t reg;
const uint32_t pclk;
const bool dma_enabled;
#if IS_ENABLED(CONFIG_CLOCK_CONTROL)
#if defined(CONFIG_CLOCK_CONTROL)
const struct device *clk_dev;
const clock_control_subsys_t clk_id;
#endif
#if IS_ENABLED(CONFIG_RESET)
#if defined(CONFIG_RESET)
const struct reset_dt_spec reset;
#endif
#if defined(CONFIG_PINCTRL)
@ -354,7 +354,7 @@ static int spi_pl022_configure(const struct device *dev,
return 0;
}
#if IS_ENABLED(CONFIG_CLOCK_CONTROL)
#if defined(CONFIG_CLOCK_CONTROL)
ret = clock_control_get_rate(cfg->clk_dev, cfg->clk_id, &pclk);
if (ret < 0 || pclk == 0) {
return -EINVAL;
@ -906,7 +906,7 @@ static int spi_pl022_init(const struct device *dev)
struct spi_pl022_data *data = dev->data;
int ret;
#if IS_ENABLED(CONFIG_CLOCK_CONTROL)
#if defined(CONFIG_CLOCK_CONTROL)
if (cfg->clk_dev) {
ret = clock_control_on(cfg->clk_dev, cfg->clk_id);
if (ret < 0) {
@ -916,7 +916,7 @@ static int spi_pl022_init(const struct device *dev)
}
#endif
#if IS_ENABLED(CONFIG_RESET)
#if defined(CONFIG_RESET)
if (cfg->reset.dev) {
ret = reset_line_toggle_dt(&cfg->reset);
if (ret < 0) {

View file

@ -128,7 +128,7 @@ extern "C" {
* @endcond
*/
#if !IS_ENABLED(_LINKER)
#if !defined(_LINKER)
#include <zephyr/sys/byteorder.h>
@ -264,10 +264,6 @@ extern "C" {
*/
#define BINDESC_GET_SIZE(name) BINDESC_NAME(name).len
/**
* @}
*/
/*
* An entry of the binary descriptor header. Each descriptor is
* described by one of these entries.
@ -291,107 +287,111 @@ BUILD_ASSERT(offsetof(struct bindesc_entry, tag) == 0, "Incorrect memory layout"
BUILD_ASSERT(offsetof(struct bindesc_entry, len) == 2, "Incorrect memory layout");
BUILD_ASSERT(offsetof(struct bindesc_entry, data) == 4, "Incorrect memory layout");
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_STRING)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_STRING)
extern const struct bindesc_entry BINDESC_NAME(kernel_version_string);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_STRING) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MAJOR)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_MAJOR)
extern const struct bindesc_entry BINDESC_NAME(kernel_version_major);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) */
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MINOR)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_MINOR)
extern const struct bindesc_entry BINDESC_NAME(kernel_version_minor);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MINOR) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_MINOR) */
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL)
extern const struct bindesc_entry BINDESC_NAME(kernel_version_patchlevel);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) */
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_NUMBER)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_NUMBER)
extern const struct bindesc_entry BINDESC_NAME(kernel_version_number);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_STRING)
#if defined(CONFIG_BINDESC_APP_VERSION_STRING)
extern const struct bindesc_entry BINDESC_NAME(app_version_string);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_STRING) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MAJOR)
#if defined(CONFIG_BINDESC_APP_VERSION_MAJOR)
extern const struct bindesc_entry BINDESC_NAME(app_version_major);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MAJOR) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_MAJOR) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MINOR)
#if defined(CONFIG_BINDESC_APP_VERSION_MINOR)
extern const struct bindesc_entry BINDESC_NAME(app_version_minor);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MINOR) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_MINOR) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL)
#if defined(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL)
extern const struct bindesc_entry BINDESC_NAME(app_version_patchlevel);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_NUMBER)
#if defined(CONFIG_BINDESC_APP_VERSION_NUMBER)
extern const struct bindesc_entry BINDESC_NAME(app_version_number);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_NUMBER) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_NUMBER) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR)
#if defined(CONFIG_BINDESC_BUILD_TIME_YEAR)
extern const struct bindesc_entry BINDESC_NAME(build_time_year);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_YEAR) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH)
#if defined(CONFIG_BINDESC_BUILD_TIME_MONTH)
extern const struct bindesc_entry BINDESC_NAME(build_time_month);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_MONTH) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY)
#if defined(CONFIG_BINDESC_BUILD_TIME_DAY)
extern const struct bindesc_entry BINDESC_NAME(build_time_day);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_DAY) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR)
#if defined(CONFIG_BINDESC_BUILD_TIME_HOUR)
extern const struct bindesc_entry BINDESC_NAME(build_time_hour);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_HOUR) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE)
#if defined(CONFIG_BINDESC_BUILD_TIME_MINUTE)
extern const struct bindesc_entry BINDESC_NAME(build_time_minute);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_MINUTE) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND)
#if defined(CONFIG_BINDESC_BUILD_TIME_SECOND)
extern const struct bindesc_entry BINDESC_NAME(build_time_second);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_SECOND) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX)
#if defined(CONFIG_BINDESC_BUILD_TIME_UNIX)
extern const struct bindesc_entry BINDESC_NAME(build_time_unix);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_UNIX) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING)
#if defined(CONFIG_BINDESC_BUILD_DATE_TIME_STRING)
extern const struct bindesc_entry BINDESC_NAME(build_date_time_string);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */
#endif /* defined(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING)
#if defined(CONFIG_BINDESC_BUILD_DATE_STRING)
extern const struct bindesc_entry BINDESC_NAME(build_date_string);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING) */
#endif /* defined(CONFIG_BINDESC_BUILD_DATE_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING)
#if defined(CONFIG_BINDESC_BUILD_TIME_STRING)
extern const struct bindesc_entry BINDESC_NAME(build_time_string);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_HOST_NAME)
#if defined(CONFIG_BINDESC_HOST_NAME)
extern const struct bindesc_entry BINDESC_NAME(host_name);
#endif /* IS_ENABLED(CONFIG_BINDESC_HOST_NAME) */
#endif /* defined(CONFIG_BINDESC_HOST_NAME) */
#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME)
#if defined(CONFIG_BINDESC_C_COMPILER_NAME)
extern const struct bindesc_entry BINDESC_NAME(c_compiler_name);
#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME) */
#endif /* defined(CONFIG_BINDESC_C_COMPILER_NAME) */
#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION)
#if defined(CONFIG_BINDESC_C_COMPILER_VERSION)
extern const struct bindesc_entry BINDESC_NAME(c_compiler_version);
#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION) */
#endif /* defined(CONFIG_BINDESC_C_COMPILER_VERSION) */
#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME)
#if defined(CONFIG_BINDESC_CXX_COMPILER_NAME)
extern const struct bindesc_entry BINDESC_NAME(cxx_compiler_name);
#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME) */
#endif /* defined(CONFIG_BINDESC_CXX_COMPILER_NAME) */
#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION)
#if defined(CONFIG_BINDESC_CXX_COMPILER_VERSION)
extern const struct bindesc_entry BINDESC_NAME(cxx_compiler_version);
#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION) */
#endif /* defined(CONFIG_BINDESC_CXX_COMPILER_VERSION) */
#endif /* !IS_ENABLED(_LINKER) */
#endif /* !defined(_LINKER) */
/**
* @}
*/
#ifdef __cplusplus
}

View file

@ -345,7 +345,7 @@ int img_mgmt_state_confirm(void);
*/
int img_mgmt_vercmp(const struct image_version *a, const struct image_version *b);
#if IS_ENABLED(CONFIG_MCUMGR_GRP_IMG_MUTEX)
#if defined(CONFIG_MCUMGR_GRP_IMG_MUTEX)
/*
* @brief Will reset the image management state back to default (no ongoing upload),
* requires that CONFIG_MCUMGR_GRP_IMG_MUTEX be enabled to allow for mutex

View file

@ -74,7 +74,7 @@ typedef int (*mgmt_handler_fn)(struct smp_streamer *ctxt);
struct mgmt_handler {
mgmt_handler_fn mh_read;
mgmt_handler_fn mh_write;
#if IS_ENABLED(CONFIG_MCUMGR_MGMT_HANDLER_USER_DATA)
#if defined(CONFIG_MCUMGR_MGMT_HANDLER_USER_DATA)
void *user_data;
#endif
};
@ -93,7 +93,7 @@ struct mgmt_group {
/** The numeric ID of this group. */
uint16_t mg_group_id;
#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
/** A function handler for translating version 2 SMP error codes to version 1 SMP error
* codes (optional)
*/
@ -152,7 +152,7 @@ const struct mgmt_group *mgmt_find_group(uint16_t group_id);
*/
const struct mgmt_handler *mgmt_get_handler(const struct mgmt_group *group, uint16_t command_id);
#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
/**
* @brief Finds a registered error translation function for converting from SMP
* version 2 error codes to legacy SMP version 1 error codes.

View file

@ -56,7 +56,7 @@ struct cbor_nb_writer {
struct net_buf *nb;
zcbor_state_t zs[CONFIG_MCUMGR_SMP_CBOR_MAX_ENCODING_LEVELS + 2];
#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
uint16_t error_group;
uint16_t error_ret;
#endif
@ -127,7 +127,7 @@ __deprecated inline bool smp_add_cmd_ret(zcbor_state_t *zse, uint16_t group, uin
return smp_add_cmd_err(zse, group, ret);
}
#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
/** @typedef smp_translate_error_fn
* @brief Translates a SMP version 2 error response to a legacy SMP version 1 error code.
*

View file

@ -33,7 +33,7 @@ extern "C" {
* @{
*/
#if IS_ENABLED(CONFIG_RETENTION_BOOTLOADER_INFO_OUTPUT_FUNCTION) || defined(__DOXYGEN__)
#if defined(CONFIG_RETENTION_BOOTLOADER_INFO_OUTPUT_FUNCTION) || defined(__DOXYGEN__)
/**
* @brief Returns bootinfo information.
*

View file

@ -183,7 +183,7 @@ extern struct z_shared_isr_table_entry z_shared_sw_isr_table[];
#define __MK_ISR_NAME(x, y) __isr_ ## x ## _irq_ ## y
#if IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
#if defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
#define _MK_ISR_ELEMENT_NAME(func, id) __MK_ISR_ELEMENT_NAME(func, id)
#define __MK_ISR_ELEMENT_NAME(func, id) __isr_table_entry_ ## func ## _irq_ ## id
@ -264,7 +264,7 @@ extern struct z_shared_isr_table_entry z_shared_sw_isr_table[];
Z_ISR_DECLARE_DIRECT_C(irq, flags, func, __COUNTER__)
#else /* IS_ENABLED(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */
#else /* defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) */
/* Create an instance of struct _isr_list which gets put in the .intList
* section. This gets consumed by gen_isr_tables.py which creates the vector

View file

@ -50,7 +50,7 @@ extern "C" {
* On SMP atomics *must* be used to ensure the pointers
* are updated in the correct order.
*/
#if IS_ENABLED(CONFIG_SMP)
#if defined(CONFIG_SMP)
typedef atomic_ptr_t mpsc_ptr_t;
@ -58,7 +58,7 @@ typedef atomic_ptr_t mpsc_ptr_t;
#define mpsc_ptr_set(ptr, val) atomic_ptr_set(&(ptr), val)
#define mpsc_ptr_set_get(ptr, val) atomic_ptr_set(&(ptr), val)
#else /* IS_ENABLED(CONFIG_SMP) */
#else /* defined(CONFIG_SMP) */
typedef struct mpsc_node *mpsc_ptr_t;
@ -71,7 +71,7 @@ typedef struct mpsc_node *mpsc_ptr_t;
tmp; \
})
#endif /* IS_ENABLED(CONFIG_SMP) */
#endif /* defined(CONFIG_SMP) */
/**
* @brief Queue member

View file

@ -28,10 +28,10 @@
#define FLASH_TEST_OFFSET2 0x41234
#define FLASH_TEST_PAGE_IDX 37
#if IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && \
IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && \
defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
#define FLASH_PE_RUNTIME_CHECK(cond) (cond)
#elif IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
#elif defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
#define FLASH_PE_RUNTIME_CHECK(cond) (true)
#else
/* Assumed IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE) */

View file

@ -312,7 +312,7 @@ static int littlefs_mount(struct fs_mount_t *mp)
#if defined(CONFIG_DISK_DRIVER_SDMMC)
#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC)
#elif defined(CONFIG_DISK_DRIVER_MMC)
#define DISK_NAME CONFIG_MMC_VOLUME_NAME
#else
#error "No disk device defined, is your board supported?"

View file

@ -106,7 +106,7 @@ static int enable_usb_device_next(void)
return 0;
}
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT) */
#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */
static void interrupt_handler(const struct device *dev, void *user_data)
{

View file

@ -34,7 +34,7 @@ static int enable_usb_device_next(void)
return 0;
}
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT) */
#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */
int main(void)
{

View file

@ -118,7 +118,7 @@ static int enable_usb_device_next(void)
return 0;
}
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT) */
#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */
int main(void)
{

View file

@ -70,7 +70,7 @@ static int enable_usb_device_next(void)
return 0;
}
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK_NEXT) */
#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */
static int setup_flash(struct fs_mount_t *mnt)
{

View file

@ -48,7 +48,7 @@ static const nrfx_timer_t feedback_timer_instance =
* the 4 least significant bits (does not use the bits for extra precision).
*/
#define FEEDBACK_K 10
#if IS_ENABLED(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)
#if defined(CONFIG_APP_USE_I2S_LRCLK_EDGES_COUNTER)
#define FEEDBACK_P 1
#else
#define FEEDBACK_P 5

View file

@ -10,43 +10,43 @@
/* Include generated header */
#include <bindesc_build_time.h>
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR)
#if defined(CONFIG_BINDESC_BUILD_TIME_YEAR)
BINDESC_UINT_DEFINE(build_time_year, BINDESC_ID_BUILD_TIME_YEAR, BUILD_TIME_YEAR);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_YEAR) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_YEAR) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH)
#if defined(CONFIG_BINDESC_BUILD_TIME_MONTH)
BINDESC_UINT_DEFINE(build_time_month, BINDESC_ID_BUILD_TIME_MONTH, BUILD_TIME_MONTH);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MONTH) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_MONTH) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY)
#if defined(CONFIG_BINDESC_BUILD_TIME_DAY)
BINDESC_UINT_DEFINE(build_time_day, BINDESC_ID_BUILD_TIME_DAY, BUILD_TIME_DAY);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_DAY) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_DAY) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR)
#if defined(CONFIG_BINDESC_BUILD_TIME_HOUR)
BINDESC_UINT_DEFINE(build_time_hour, BINDESC_ID_BUILD_TIME_HOUR, BUILD_TIME_HOUR);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_HOUR) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_HOUR) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE)
#if defined(CONFIG_BINDESC_BUILD_TIME_MINUTE)
BINDESC_UINT_DEFINE(build_time_minute, BINDESC_ID_BUILD_TIME_MINUTE, BUILD_TIME_MINUTE);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_MINUTE) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_MINUTE) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND)
#if defined(CONFIG_BINDESC_BUILD_TIME_SECOND)
BINDESC_UINT_DEFINE(build_time_second, BINDESC_ID_BUILD_TIME_SECOND, BUILD_TIME_SECOND);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_SECOND) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_SECOND) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX)
#if defined(CONFIG_BINDESC_BUILD_TIME_UNIX)
BINDESC_UINT_DEFINE(build_time_unix, BINDESC_ID_BUILD_TIME_UNIX, BUILD_TIME_UNIX);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_UNIX) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_UNIX) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING)
#if defined(CONFIG_BINDESC_BUILD_DATE_TIME_STRING)
BINDESC_STR_DEFINE(build_date_time_string, BINDESC_ID_BUILD_DATE_TIME_STRING,
BUILD_DATE_TIME_STRING);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */
#endif /* defined(CONFIG_BINDESC_BUILD_DATE_TIME_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING)
#if defined(CONFIG_BINDESC_BUILD_DATE_STRING)
BINDESC_STR_DEFINE(build_date_string, BINDESC_ID_BUILD_DATE_STRING, BUILD_DATE_STRING);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_DATE_STRING) */
#endif /* defined(CONFIG_BINDESC_BUILD_DATE_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING)
#if defined(CONFIG_BINDESC_BUILD_TIME_STRING)
BINDESC_STR_DEFINE(build_time_string, BINDESC_ID_BUILD_TIME_STRING, BUILD_TIME_STRING);
#endif /* IS_ENABLED(CONFIG_BINDESC_BUILD_TIME_STRING) */
#endif /* defined(CONFIG_BINDESC_BUILD_TIME_STRING) */

View file

@ -7,23 +7,23 @@
#include <zephyr/kernel.h>
#include <zephyr/bindesc.h>
#if IS_ENABLED(CONFIG_BINDESC_HOST_NAME)
#if defined(CONFIG_BINDESC_HOST_NAME)
BINDESC_STR_DEFINE(host_name, BINDESC_ID_HOST_NAME, HOST_NAME);
#endif /* IS_ENABLED(CONFIG_BINDESC_HOST_NAME) */
#endif /* defined(CONFIG_BINDESC_HOST_NAME) */
#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME)
#if defined(CONFIG_BINDESC_C_COMPILER_NAME)
BINDESC_STR_DEFINE(c_compiler_name, BINDESC_ID_C_COMPILER_NAME, C_COMPILER_NAME);
#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_NAME) */
#endif /* defined(CONFIG_BINDESC_C_COMPILER_NAME) */
#if IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION)
#if defined(CONFIG_BINDESC_C_COMPILER_VERSION)
BINDESC_STR_DEFINE(c_compiler_version, BINDESC_ID_C_COMPILER_VERSION, C_COMPILER_VERSION);
#endif /* IS_ENABLED(CONFIG_BINDESC_C_COMPILER_VERSION) */
#endif /* defined(CONFIG_BINDESC_C_COMPILER_VERSION) */
#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME)
#if defined(CONFIG_BINDESC_CXX_COMPILER_NAME)
BINDESC_STR_DEFINE(cxx_compiler_name, BINDESC_ID_CXX_COMPILER_NAME, CXX_COMPILER_NAME);
#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_NAME) */
#endif /* defined(CONFIG_BINDESC_CXX_COMPILER_NAME) */
#if IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION)
#if defined(CONFIG_BINDESC_CXX_COMPILER_VERSION)
BINDESC_STR_DEFINE(cxx_compiler_version, BINDESC_ID_CXX_COMPILER_VERSION,
CXX_COMPILER_VERSION);
#endif /* IS_ENABLED(CONFIG_BINDESC_CXX_COMPILER_VERSION) */
#endif /* defined(CONFIG_BINDESC_CXX_COMPILER_VERSION) */

View file

@ -8,57 +8,57 @@
#include <zephyr/bindesc.h>
#include <zephyr/version.h>
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_STRING)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_STRING)
BINDESC_STR_DEFINE(kernel_version_string, BINDESC_ID_KERNEL_VERSION_STRING,
KERNEL_VERSION_STRING);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_STRING) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MAJOR)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_MAJOR)
BINDESC_UINT_DEFINE(kernel_version_major, BINDESC_ID_KERNEL_VERSION_MAJOR,
KERNEL_VERSION_MAJOR);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_MAJOR) */
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MINOR)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_MINOR)
BINDESC_UINT_DEFINE(kernel_version_minor, BINDESC_ID_KERNEL_VERSION_MINOR,
KERNEL_VERSION_MINOR);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_MINOR) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_MINOR) */
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL)
BINDESC_UINT_DEFINE(kernel_version_patchlevel, BINDESC_ID_KERNEL_VERSION_PATCHLEVEL,
KERNEL_PATCHLEVEL);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_PATCHLEVEL) */
#if IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_NUMBER)
#if defined(CONFIG_BINDESC_KERNEL_VERSION_NUMBER)
BINDESC_UINT_DEFINE(kernel_version_number, BINDESC_ID_KERNEL_VERSION_NUMBER,
KERNEL_VERSION_NUMBER);
#endif /* IS_ENABLED(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) */
#endif /* defined(CONFIG_BINDESC_KERNEL_VERSION_NUMBER) */
#if IS_ENABLED(HAS_APP_VERSION)
#if defined(HAS_APP_VERSION)
#include <zephyr/app_version.h>
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_STRING)
#if defined(CONFIG_BINDESC_APP_VERSION_STRING)
BINDESC_STR_DEFINE(app_version_string, BINDESC_ID_APP_VERSION_STRING,
APP_VERSION_STRING);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_STRING) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_STRING) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MAJOR)
#if defined(CONFIG_BINDESC_APP_VERSION_MAJOR)
BINDESC_UINT_DEFINE(app_version_major, BINDESC_ID_APP_VERSION_MAJOR,
APP_VERSION_MAJOR);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MAJOR) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_MAJOR) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MINOR)
#if defined(CONFIG_BINDESC_APP_VERSION_MINOR)
BINDESC_UINT_DEFINE(app_version_minor, BINDESC_ID_APP_VERSION_MINOR,
APP_VERSION_MINOR);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_MINOR) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_MINOR) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL)
#if defined(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL)
BINDESC_UINT_DEFINE(app_version_patchlevel, BINDESC_ID_APP_VERSION_PATCHLEVEL,
APP_PATCHLEVEL);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_PATCHLEVEL) */
#if IS_ENABLED(CONFIG_BINDESC_APP_VERSION_NUMBER)
#if defined(CONFIG_BINDESC_APP_VERSION_NUMBER)
BINDESC_UINT_DEFINE(app_version_number, BINDESC_ID_APP_VERSION_NUMBER,
APP_VERSION_NUMBER);
#endif /* IS_ENABLED(CONFIG_BINDESC_APP_VERSION_NUMBER) */
#endif /* defined(CONFIG_BINDESC_APP_VERSION_NUMBER) */
#endif /* IS_ENABLED(HAS_APP_VERSION) */
#endif /* defined(HAS_APP_VERSION) */

View file

@ -84,7 +84,7 @@ struct gtbs_service_inst {
#else
#define READ_BUF_SIZE (CONFIG_BT_TBS_MAX_CALLS * \
sizeof(struct bt_tbs_current_call_item))
#endif /* IS_ENABLED(CONFIG_BT_GTBS) */
#endif /* defined(CONFIG_BT_GTBS) */
NET_BUF_SIMPLE_DEFINE_STATIC(read_buf, READ_BUF_SIZE);
static struct tbs_service_inst svc_insts[CONFIG_BT_TBS_BEARER_COUNT];

View file

@ -63,7 +63,7 @@ struct bt_tbs_server_inst {
#endif /* CONFIG_BT_TBS_CLIENT_TBS */
#if defined(CONFIG_BT_TBS_CLIENT_GTBS)
struct bt_tbs_instance gtbs_inst;
#endif /* IS_ENABLED(CONFIG_BT_TBS_CLIENT_GTBS) */
#endif /* defined(CONFIG_BT_TBS_CLIENT_GTBS) */
struct bt_gatt_discover_params discover_params;
struct bt_tbs_instance *current_inst;
};
@ -1748,7 +1748,7 @@ static int primary_discover_gtbs(struct bt_conn *conn)
return bt_gatt_discover(conn, params);
}
#endif /* IS_ENABLED(CONFIG_BT_TBS_CLIENT_GTBS) */
#endif /* defined(CONFIG_BT_TBS_CLIENT_GTBS) */
/****************************** PUBLIC API ******************************/

View file

@ -111,10 +111,10 @@ static const struct {
uint8_t page;
} comp_data_pages[] = {
{ "bt/mesh/cmp/0", 0, },
#if IS_ENABLED(CONFIG_BT_MESH_COMP_PAGE_1)
#if defined(CONFIG_BT_MESH_COMP_PAGE_1)
{ "bt/mesh/cmp/1", 1, },
#endif
#if IS_ENABLED(CONFIG_BT_MESH_COMP_PAGE_2)
#if defined(CONFIG_BT_MESH_COMP_PAGE_2)
{ "bt/mesh/cmp/2", 2, },
#endif
};
@ -2617,7 +2617,7 @@ void bt_mesh_comp_data_clear(void)
int bt_mesh_models_metadata_change_prepare(void)
{
#if IS_ENABLED(CONFIG_BT_MESH_LARGE_COMP_DATA_SRV)
#if defined(CONFIG_BT_MESH_LARGE_COMP_DATA_SRV)
return bt_mesh_models_metadata_store();
#else
return -ENOTSUP;

View file

@ -137,7 +137,7 @@ uint8_t bt_mesh_priv_beacon_update_interval_get(void)
int bt_mesh_od_priv_proxy_get(void)
{
#if IS_ENABLED(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV)
#if defined(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV)
return bt_mesh.on_demand_state;
#else
return -ENOTSUP;
@ -146,7 +146,7 @@ int bt_mesh_od_priv_proxy_get(void)
int bt_mesh_od_priv_proxy_set(uint8_t on_demand_proxy)
{
#if !IS_ENABLED(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV)
#if !defined(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV)
return -ENOTSUP;
#else

View file

@ -78,7 +78,7 @@
NET_BUF_SIMPLE_DEFINE(name, PROV_BEARER_BUF_HEADROOM + PDU_OP_LEN + len + \
PROV_BEARER_BUF_TAILROOM)
#if IS_ENABLED(CONFIG_BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM)
#if defined(CONFIG_BT_MESH_ECDH_P256_HMAC_SHA256_AES_CCM)
#define PROV_AUTH_MAX_LEN 32
#else
#define PROV_AUTH_MAX_LEN 16

View file

@ -24,7 +24,7 @@
*/
#if defined(CONFIG_BT_OTS)
LOG_MODULE_DECLARE(bt_ots, CONFIG_BT_OTS_LOG_LEVEL);
#elif IS_ENABLED(CONFIG_BT_OTS_CLIENT)
#elif defined(CONFIG_BT_OTS_CLIENT)
LOG_MODULE_REGISTER(bt_ots, CONFIG_BT_OTS_LOG_LEVEL);
#endif

View file

@ -66,7 +66,7 @@ fcb_elem_crc8(struct fcb *_fcb, struct fcb_entry *loc, uint8_t *c8p)
return 0;
}
#if IS_ENABLED(CONFIG_FCB_ALLOW_FIXED_ENDMARKER)
#if defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER)
/* Given the offset in flash sector, calculate the FCB entry data offset and size, and set
* the fixed endmarker.
*/
@ -97,7 +97,7 @@ fcb_elem_endmarker_fixed(struct fcb *_fcb, struct fcb_entry *loc, uint8_t *em)
*em = FCB_FIXED_ENDMARKER;
return 0;
}
#endif /* IS_ENABLED(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) */
#endif /* defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) */
/* Given the offset in flash sector, calculate the FCB entry data offset and size, and calculate
* the expected endmarker.
@ -105,11 +105,11 @@ fcb_elem_endmarker_fixed(struct fcb *_fcb, struct fcb_entry *loc, uint8_t *em)
int
fcb_elem_endmarker(struct fcb *_fcb, struct fcb_entry *loc, uint8_t *em)
{
#if IS_ENABLED(CONFIG_FCB_ALLOW_FIXED_ENDMARKER)
#if defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER)
if (_fcb->f_flags & FCB_FLAGS_CRC_DISABLED) {
return fcb_elem_endmarker_fixed(_fcb, loc, em);
}
#endif /* IS_ENABLED(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) */
#endif /* defined(CONFIG_FCB_ALLOW_FIXED_ENDMARKER) */
return fcb_elem_crc8(_fcb, loc, em);
}

View file

@ -19,7 +19,7 @@
static const uint8_t magic[] = {0x45, 0x6d, 0x31, 0x6c, 0x31, 0x4b,
0x30, 0x72, 0x6e, 0x33, 0x6c, 0x69, 0x34};
#if IS_ENABLED(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE)
#if defined(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE)
static K_THREAD_STACK_DEFINE(icmsg_stack, CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE);
static struct k_work_q icmsg_workq;
static struct k_work_q *const workq = &icmsg_workq;
@ -301,7 +301,7 @@ int icmsg_send(const struct icmsg_config_t *conf,
return sent_bytes;
}
#if IS_ENABLED(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE)
#if defined(CONFIG_IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE)
static int work_q_init(void)
{

View file

@ -423,19 +423,19 @@ os_mgmt_mcumgr_params(struct smp_streamer *ctxt)
#if defined(CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO)
#if IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP)
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP)
#define BOOTLOADER_MODE MCUBOOT_MODE_SINGLE_SLOT
#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH)
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH)
#define BOOTLOADER_MODE MCUBOOT_MODE_SWAP_USING_SCRATCH
#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY)
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY)
#define BOOTLOADER_MODE MCUBOOT_MODE_UPGRADE_ONLY
#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH)
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH)
#define BOOTLOADER_MODE MCUBOOT_MODE_SWAP_USING_MOVE
#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP)
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP)
#define BOOTLOADER_MODE MCUBOOT_MODE_DIRECT_XIP
#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT)
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT)
#define BOOTLOADER_MODE MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT
#elif IS_ENABLED(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER)
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER)
#define BOOTLOADER_MODE MCUBOOT_MODE_FIRMWARE_LOADER
#else
#define BOOTLOADER_MODE -1

View file

@ -103,7 +103,7 @@ mgmt_get_handler(const struct mgmt_group *group, uint16_t command_id)
return &group->mg_handlers[command_id];
}
#if IS_ENABLED(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
#if defined(CONFIG_MCUMGR_SMP_SUPPORT_ORIGINAL_PROTOCOL)
smp_translate_error_fn mgmt_find_error_translation_function(uint16_t group_id)
{
struct mgmt_group *group = NULL;

View file

@ -1246,7 +1246,7 @@ int net_pkt_alloc_buffer_raw(struct net_pkt *pkt, size_t size,
net_pkt_append_buffer(pkt, buf);
#if IS_ENABLED(CONFIG_NET_BUF_FIXED_DATA_SIZE)
#if defined(CONFIG_NET_BUF_FIXED_DATA_SIZE)
/* net_buf allocators shrink the buffer size to the requested size.
* We don't want this behavior here, so restore the real size of the
* last fragment.

View file

@ -106,7 +106,7 @@ void lwm2m_register_obj(struct lwm2m_engine_obj *obj)
k_mutex_lock(&registry_lock, K_FOREVER);
#if defined(CONFIG_LWM2M_ACCESS_CONTROL_ENABLE)
/* If bootstrap, then bootstrap server should create the ac obj instances */
#if !IS_ENABLED(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
#if !defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
int server_obj_inst_id = lwm2m_server_short_id_to_inst(CONFIG_LWM2M_SERVER_DEFAULT_SSID);
access_control_add_obj(obj->obj_id, server_obj_inst_id);
@ -169,7 +169,7 @@ static void engine_register_obj_inst(struct lwm2m_engine_obj_inst *obj_inst)
{
#if defined(CONFIG_LWM2M_ACCESS_CONTROL_ENABLE)
/* If bootstrap, then bootstrap server should create the ac obj instances */
#if !IS_ENABLED(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
#if !defined(CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP)
int server_obj_inst_id = lwm2m_server_short_id_to_inst(CONFIG_LWM2M_SERVER_DEFAULT_SSID);
access_control_add(obj_inst->obj->obj_id, obj_inst->obj_inst_id, server_obj_inst_id);

View file

@ -15,7 +15,7 @@
#define RTT_UNLOCK() \
COND_CODE_0(CONFIG_SHELL_BACKEND_RTT_BUFFER, (SEGGER_RTT_UNLOCK()), ())
#if IS_ENABLED(CONFIG_LOG_BACKEND_RTT)
#if defined(CONFIG_LOG_BACKEND_RTT)
BUILD_ASSERT(!(CONFIG_SHELL_BACKEND_RTT_BUFFER == CONFIG_LOG_BACKEND_RTT_BUFFER),
"Conflicting log RTT backend enabled on the same channel");
#endif

View file

@ -76,10 +76,10 @@ static int settings_direct_loader(const char *key, size_t len,
int stream_flash_erase_page(struct stream_flash_ctx *ctx, off_t off)
{
#if IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
int rc;
struct flash_pages_info page;
#if IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
#if defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
/* There are both types of devices */
const struct flash_parameters *fparams = flash_get_parameters(ctx->fdev);

View file

@ -1532,7 +1532,7 @@ static void test_tx_priv_beacon_cache(void)
PASS();
}
#if IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY)
#if defined(CONFIG_BT_MESH_GATT_PROXY)
static uint8_t test_net_key_3[16] = {0x12, 0x54, 0xab, 0x1e};

View file

@ -22,13 +22,13 @@
#if defined(CONFIG_DISK_DRIVER_SDMMC)
#define DISK_NAME_PHYS CONFIG_SDMMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC)
#elif defined(CONFIG_DISK_DRIVER_MMC)
#define DISK_NAME_PHYS CONFIG_MMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_FLASH)
#elif defined(CONFIG_DISK_DRIVER_FLASH)
#define DISK_NAME_PHYS "NAND"
#elif IS_ENABLED(CONFIG_NVME)
#elif defined(CONFIG_NVME)
#define DISK_NAME_PHYS "nvme0n0"
#elif IS_ENABLED(CONFIG_DISK_DRIVER_RAM)
#elif defined(CONFIG_DISK_DRIVER_RAM)
/* Since ramdisk is enabled by default on e.g. qemu boards, it needs to be checked last to not
* override other backends.
*/

View file

@ -14,9 +14,9 @@
#if defined(CONFIG_DISK_DRIVER_SDMMC)
#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC)
#elif defined(CONFIG_DISK_DRIVER_MMC)
#define DISK_NAME CONFIG_MMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_NVME)
#elif defined(CONFIG_NVME)
#define DISK_NAME "nvme0n0"
#else
#error "No disk device defined, is your board supported?"

View file

@ -44,8 +44,8 @@
#define EXPECTED_SIZE 512
#if !IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && \
!IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
#if !defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE) && \
!defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
#error There is no flash device enabled or it is missing Kconfig options
#endif

View file

@ -19,7 +19,7 @@
#ifdef CONFIG_DISK_DRIVER_SDMMC
#define DISK_NAME CONFIG_SDMMC_VOLUME_NAME
#elif IS_ENABLED(CONFIG_DISK_DRIVER_MMC)
#elif defined(CONFIG_DISK_DRIVER_MMC)
#define DISK_NAME CONFIG_MMC_VOLUME_NAME
#else
#error "No disk device defined, is your board supported?"

View file

@ -29,7 +29,7 @@
ZTEST(device_driver_init, test_device_driver_init)
{
#if IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)
#if defined(CONFIG_PM_DEVICE_RUNTIME)
enum pm_device_state state;
int rc;
state = -1;

View file

@ -21,7 +21,7 @@ LOG_MODULE_REGISTER(settings_basic_test);
#if DT_HAS_CHOSEN(zephyr_settings_partition)
#define TEST_FLASH_AREA_ID DT_FIXED_PARTITION_ID(DT_CHOSEN(zephyr_settings_partition))
#endif
#elif IS_ENABLED(CONFIG_SETTINGS_FILE)
#elif defined(CONFIG_SETTINGS_FILE)
#include <zephyr/fs/fs.h>
#include <zephyr/fs/littlefs.h>
#else
@ -38,7 +38,7 @@ LOG_MODULE_REGISTER(settings_basic_test);
*/
ZTEST(settings_functional, test_clear_settings)
{
#if !IS_ENABLED(CONFIG_SETTINGS_FILE)
#if !defined(CONFIG_SETTINGS_FILE)
const struct flash_area *fap;
int rc;

View file

@ -72,9 +72,9 @@ int stream_flash_callback(uint8_t *buf, size_t len, size_t offset)
static void erase_flash(void)
{
#if IS_ENABLED(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
#if defined(CONFIG_FLASH_HAS_EXPLICIT_ERASE)
int rc;
#if IS_ENABLED(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
#if defined(CONFIG_FLASH_HAS_NO_EXPLICIT_ERASE)
const struct flash_parameters *fparam = flash_get_parameters(fdev);
if (!(flash_params_get_erase_cap(fparam) & FLASH_ERASE_C_EXPLICIT)) {