Skip to content

Commit 97b3bd1

Browse files
pflnashif
authored andcommitted
drivers: Rename reserved function names
Rename reserved function names in drivers/ subdirectory. Update function macros concatenatenating function names with '##'. As there is a conflict between the existing gpio_sch_manage_callback() and _gpio_sch_manage_callback() names, leave the latter unmodified. Signed-off-by: Patrik Flykt <[email protected]>
1 parent 14db4ee commit 97b3bd1

File tree

110 files changed

+544
-544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+544
-544
lines changed

arch/arm/core/cortex_m/nmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void z_NmiInit(void)
7373
* @return N/A
7474
*/
7575

76-
void _NmiHandlerSet(void (*pHandler)(void))
76+
void z_NmiHandlerSet(void (*pHandler)(void))
7777
{
7878
handler = pHandler;
7979
}

arch/xtensa/core/xt_zephyr.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
.extern _interrupt_stack
1212
.extern _kernel
1313
#ifdef CONFIG_SYS_CLOCK_EXISTS
14-
.extern _timer_int_handler
14+
.extern timer_int_handler
1515
#endif
1616
.set _interrupt_stack_top, _interrupt_stack + CONFIG_ISR_STACK_SIZE
1717

@@ -279,15 +279,15 @@ _zxt_timer_int:
279279
s32i a2, sp, 4
280280
s32i a3, sp, 8
281281
/* TODO: movi a2, _xt_interrupt_table */
282-
movi a3, _timer_int_handler
282+
movi a3, timer_int_handler
283283
/* TODO: l32i a2, a2, 0 */
284284
callx0 a3
285285
/* Restore a2 and a3. */
286286
l32i a2, sp, 4
287287
l32i a3, sp, 8
288288
#else
289289
/* TODO: movi a6, _xt_interrupt_table */
290-
movi a7, _timer_int_handler
290+
movi a7, timer_int_handler
291291
/* TODO: l32i a6, a6, 0 */
292292
callx4 a7
293293
#endif

drivers/adc/adc_context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ struct adc_context {
6161

6262
#ifdef ADC_CONTEXT_USES_KERNEL_TIMER
6363
#define ADC_CONTEXT_INIT_TIMER(_data, _ctx_name) \
64-
._ctx_name.timer = _K_TIMER_INITIALIZER(_data._ctx_name.timer, \
64+
._ctx_name.timer = Z_TIMER_INITIALIZER(_data._ctx_name.timer, \
6565
adc_context_on_timer_expired, \
6666
NULL)
6767
#endif /* ADC_CONTEXT_USES_KERNEL_TIMER */
6868

6969
#define ADC_CONTEXT_INIT_LOCK(_data, _ctx_name) \
70-
._ctx_name.lock = _K_SEM_INITIALIZER(_data._ctx_name.lock, 0, 1)
70+
._ctx_name.lock = Z_SEM_INITIALIZER(_data._ctx_name.lock, 0, 1)
7171

7272
#define ADC_CONTEXT_INIT_SYNC(_data, _ctx_name) \
73-
._ctx_name.sync = _K_SEM_INITIALIZER(_data._ctx_name.sync, 0, 1)
73+
._ctx_name.sync = Z_SEM_INITIALIZER(_data._ctx_name.sync, 0, 1)
7474

7575

7676
static inline void adc_context_request_next_sampling(struct adc_context *ctx)

drivers/bluetooth/hci/h4.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ static struct {
6060
u8_t hdr[4];
6161
};
6262
} rx = {
63-
.fifo = _K_FIFO_INITIALIZER(rx.fifo),
63+
.fifo = Z_FIFO_INITIALIZER(rx.fifo),
6464
};
6565

6666
static struct {
6767
u8_t type;
6868
struct net_buf *buf;
6969
struct k_fifo fifo;
7070
} tx = {
71-
.fifo = _K_FIFO_INITIALIZER(tx.fifo),
71+
.fifo = Z_FIFO_INITIALIZER(tx.fifo),
7272
};
7373

7474
static struct device *h4_dev;
@@ -456,7 +456,7 @@ static const struct bt_hci_driver drv = {
456456
.send = h4_send,
457457
};
458458

459-
static int _bt_uart_init(struct device *unused)
459+
static int bt_uart_init(struct device *unused)
460460
{
461461
ARG_UNUSED(unused);
462462

@@ -470,4 +470,4 @@ static int _bt_uart_init(struct device *unused)
470470
return 0;
471471
}
472472

473-
SYS_INIT(_bt_uart_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
473+
SYS_INIT(bt_uart_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

drivers/bluetooth/hci/h5.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ static const struct bt_hci_driver drv = {
761761
.send = h5_queue,
762762
};
763763

764-
static int _bt_uart_init(struct device *unused)
764+
static int bt_uart_init(struct device *unused)
765765
{
766766
ARG_UNUSED(unused);
767767

@@ -776,4 +776,4 @@ static int _bt_uart_init(struct device *unused)
776776
return 0;
777777
}
778778

779-
SYS_INIT(_bt_uart_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
779+
SYS_INIT(bt_uart_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

drivers/bluetooth/hci/spi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ static const struct bt_hci_driver drv = {
529529
.send = bt_spi_send,
530530
};
531531

532-
static int _bt_spi_init(struct device *unused)
532+
static int bt_spi_init(struct device *unused)
533533
{
534534
ARG_UNUSED(unused);
535535

@@ -568,4 +568,4 @@ static int _bt_spi_init(struct device *unused)
568568
return 0;
569569
}
570570

571-
SYS_INIT(_bt_spi_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
571+
SYS_INIT(bt_spi_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

drivers/bluetooth/hci/userchan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static const struct bt_hci_driver drv = {
213213
.send = uc_send,
214214
};
215215

216-
static int _bt_uc_init(struct device *unused)
216+
static int bt_uc_init(struct device *unused)
217217
{
218218
ARG_UNUSED(unused);
219219

@@ -222,7 +222,7 @@ static int _bt_uc_init(struct device *unused)
222222
return 0;
223223
}
224224

225-
SYS_INIT(_bt_uc_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
225+
SYS_INIT(bt_uc_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
226226

227227
static void cmd_bt_dev_found(char *argv, int offset)
228228
{

drivers/clock_control/nrf_power_clock.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static u8_t m16src_ref;
2121
static u8_t m16src_grd;
2222
static u8_t k32src_initialized;
2323

24-
static int _m16src_start(struct device *dev, clock_control_subsys_t sub_system)
24+
static int m16src_start(struct device *dev, clock_control_subsys_t sub_system)
2525
{
2626
bool blocking;
2727
u32_t imask;
@@ -103,7 +103,7 @@ static int _m16src_start(struct device *dev, clock_control_subsys_t sub_system)
103103
}
104104
}
105105

106-
static int _m16src_stop(struct device *dev, clock_control_subsys_t sub_system)
106+
static int m16src_stop(struct device *dev, clock_control_subsys_t sub_system)
107107
{
108108
u32_t imask;
109109

@@ -144,7 +144,7 @@ static int _m16src_stop(struct device *dev, clock_control_subsys_t sub_system)
144144
return 0;
145145
}
146146

147-
static int _k32src_start(struct device *dev, clock_control_subsys_t sub_system)
147+
static int k32src_start(struct device *dev, clock_control_subsys_t sub_system)
148148
{
149149
u32_t lf_clk_src;
150150
u32_t imask;
@@ -248,7 +248,7 @@ static int _k32src_start(struct device *dev, clock_control_subsys_t sub_system)
248248
*/
249249
nrf_clock_int_enable(NRF_CLOCK_INT_HF_STARTED_MASK);
250250

251-
err = _m16src_start(dev, false);
251+
err = m16src_start(dev, false);
252252
if (!err) {
253253
NVIC_SetPendingIRQ(DT_NORDIC_NRF_CLOCK_0_IRQ_0);
254254
} else {
@@ -390,7 +390,7 @@ void nrf_power_clock_isr(void *arg)
390390
NRF_CLOCK->EVENTS_DONE = 0;
391391

392392
/* Calibration done, stop 16M Xtal. */
393-
err = _m16src_stop(dev, NULL);
393+
err = m16src_stop(dev, NULL);
394394
__ASSERT_NO_MSG(!err || err == -EBUSY);
395395

396396
/* Start timer for next calibration. */
@@ -408,7 +408,7 @@ void nrf_power_clock_isr(void *arg)
408408
*/
409409
NRF_CLOCK->INTENSET = CLOCK_INTENSET_HFCLKSTARTED_Msk;
410410

411-
err = _m16src_start(dev, false);
411+
err = m16src_start(dev, false);
412412
if (!err) {
413413
NVIC_SetPendingIRQ(DT_NORDIC_NRF_CLOCK_0_IRQ_0);
414414
} else {
@@ -435,7 +435,7 @@ void nrf_power_clock_isr(void *arg)
435435
#endif
436436
}
437437

438-
static int _clock_control_init(struct device *dev)
438+
static int clock_control_init(struct device *dev)
439439
{
440440
/* TODO: Initialization will be called twice, once for 32KHz and then
441441
* for 16 MHz clock. The vector is also shared for other power related
@@ -453,26 +453,26 @@ static int _clock_control_init(struct device *dev)
453453
}
454454

455455
static const struct clock_control_driver_api _m16src_clock_control_api = {
456-
.on = _m16src_start,
457-
.off = _m16src_stop,
456+
.on = m16src_start,
457+
.off = m16src_stop,
458458
.get_rate = NULL,
459459
};
460460

461461
DEVICE_AND_API_INIT(clock_nrf5_m16src,
462462
DT_NORDIC_NRF_CLOCK_0_LABEL "_16M",
463-
_clock_control_init, NULL, NULL, PRE_KERNEL_1,
463+
clock_control_init, NULL, NULL, PRE_KERNEL_1,
464464
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
465465
&_m16src_clock_control_api);
466466

467467
static const struct clock_control_driver_api _k32src_clock_control_api = {
468-
.on = _k32src_start,
468+
.on = k32src_start,
469469
.off = NULL,
470470
.get_rate = NULL,
471471
};
472472

473473
DEVICE_AND_API_INIT(clock_nrf5_k32src,
474474
DT_NORDIC_NRF_CLOCK_0_LABEL "_32K",
475-
_clock_control_init, NULL, NULL, PRE_KERNEL_1,
475+
clock_control_init, NULL, NULL, PRE_KERNEL_1,
476476
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
477477
&_k32src_clock_control_api);
478478

drivers/clock_control/stm32_ll_clock.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@
1414
#include "stm32_ll_clock.h"
1515

1616
/* Macros to fill up prescaler values */
17-
#define _ahb_prescaler(v) LL_RCC_SYSCLK_DIV_ ## v
18-
#define ahb_prescaler(v) _ahb_prescaler(v)
17+
#define z_ahb_prescaler(v) LL_RCC_SYSCLK_DIV_ ## v
18+
#define ahb_prescaler(v) z_ahb_prescaler(v)
1919

20-
#define _apb1_prescaler(v) LL_RCC_APB1_DIV_ ## v
21-
#define apb1_prescaler(v) _apb1_prescaler(v)
20+
#define z_apb1_prescaler(v) LL_RCC_APB1_DIV_ ## v
21+
#define apb1_prescaler(v) z_apb1_prescaler(v)
2222

2323
#ifndef CONFIG_SOC_SERIES_STM32F0X
24-
#define _apb2_prescaler(v) LL_RCC_APB2_DIV_ ## v
25-
#define apb2_prescaler(v) _apb2_prescaler(v)
24+
#define z_apb2_prescaler(v) LL_RCC_APB2_DIV_ ## v
25+
#define apb2_prescaler(v) z_apb2_prescaler(v)
2626
#endif /* CONFIG_SOC_SERIES_STM32F0X */
2727

28-
#define _mco1_prescaler(v) LL_RCC_MCO1_DIV_ ## v
29-
#define mco1_prescaler(v) _mco1_prescaler(v)
28+
#define z_mco1_prescaler(v) LL_RCC_MCO1_DIV_ ## v
29+
#define mco1_prescaler(v) z_mco1_prescaler(v)
3030

31-
#define _mco2_prescaler(v) LL_RCC_MCO2_DIV_ ## v
32-
#define mco2_prescaler(v) _mco2_prescaler(v)
31+
#define z_mco2_prescaler(v) LL_RCC_MCO2_DIV_ ## v
32+
#define mco2_prescaler(v) z_mco2_prescaler(v)
3333

3434
/**
3535
* @brief fill in AHB/APB buses configuration structure

drivers/clock_control/stm32f2x_ll_clock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
#ifdef CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL
1818

1919
/* Macros to fill up division factors values */
20-
#define _pllm(v) LL_RCC_PLLM_DIV_ ## v
21-
#define pllm(v) _pllm(v)
20+
#define z_pllm(v) LL_RCC_PLLM_DIV_ ## v
21+
#define pllm(v) z_pllm(v)
2222

23-
#define _pllp(v) LL_RCC_PLLP_DIV_ ## v
24-
#define pllp(v) _pllp(v)
23+
#define z_pllp(v) LL_RCC_PLLP_DIV_ ## v
24+
#define pllp(v) z_pllp(v)
2525

2626
/**
2727
* @brief fill in pll configuration structure

0 commit comments

Comments
 (0)