Skip to content

Commit 4aa4883

Browse files
pflnashif
authored andcommitted
subsystems: Rename reserved function names
Rename reserved function names in the subsys/ subdirectory except for static _mod_pub_set and _mod_unbind functions in bluetooth mesh cfg_srv.c which clash with the similarly named global functions. Signed-off-by: Patrik Flykt <[email protected]>
1 parent fd42bf7 commit 4aa4883

File tree

30 files changed

+207
-208
lines changed

30 files changed

+207
-208
lines changed

include/misc/printk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern __printf_like(3, 4) int snprintk(char *str, size_t size,
5252
extern __printf_like(3, 0) int vsnprintk(char *str, size_t size,
5353
const char *fmt, va_list ap);
5454

55-
extern __printf_like(3, 0) void _vprintk(int (*out)(int f, void *c), void *ctx,
55+
extern __printf_like(3, 0) void z_vprintk(int (*out)(int f, void *c), void *ctx,
5656
const char *fmt, va_list ap);
5757
#else
5858
static inline __printf_like(1, 2) void printk(const char *fmt, ...)

lib/libc/minimal/source/stdout/fprintf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#define DESC(d) ((void *)d)
1313

14-
extern int _prf(int (*func)(), void *dest,
14+
extern int z_prf(int (*func)(), void *dest,
1515
const char *format, va_list vargs);
1616

1717
int fprintf(FILE *_MLIBC_RESTRICT F, const char *_MLIBC_RESTRICT format, ...)
@@ -20,7 +20,7 @@ int fprintf(FILE *_MLIBC_RESTRICT F, const char *_MLIBC_RESTRICT format, ...)
2020
int r;
2121

2222
va_start(vargs, format);
23-
r = _prf(fputc, DESC(F), format, vargs);
23+
r = z_prf(fputc, DESC(F), format, vargs);
2424
va_end(vargs);
2525

2626
return r;
@@ -31,7 +31,7 @@ int vfprintf(FILE *_MLIBC_RESTRICT F, const char *_MLIBC_RESTRICT format,
3131
{
3232
int r;
3333

34-
r = _prf(fputc, DESC(F), format, vargs);
34+
r = z_prf(fputc, DESC(F), format, vargs);
3535

3636
return r;
3737
}
@@ -42,7 +42,7 @@ int printf(const char *_MLIBC_RESTRICT format, ...)
4242
int r;
4343

4444
va_start(vargs, format);
45-
r = _prf(fputc, DESC(stdout), format, vargs);
45+
r = z_prf(fputc, DESC(stdout), format, vargs);
4646
va_end(vargs);
4747

4848
return r;
@@ -52,7 +52,7 @@ int vprintf(const char *_MLIBC_RESTRICT format, va_list vargs)
5252
{
5353
int r;
5454

55-
r = _prf(fputc, DESC(stdout), format, vargs);
55+
r = z_prf(fputc, DESC(stdout), format, vargs);
5656

5757
return r;
5858
}

lib/libc/minimal/source/stdout/prf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static int _atoi(char **sptr)
429429
return i;
430430
}
431431

432-
int _prf(int (*func)(), void *dest, char *format, va_list vargs)
432+
int z_prf(int (*func)(), void *dest, char *format, va_list vargs)
433433
{
434434
/*
435435
* Due the fact that buffer is passed to functions in this file,

lib/libc/minimal/source/stdout/sprintf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <stdarg.h>
1010
#include <stdio.h>
1111

12-
extern int _prf(int (*func)(), void *dest,
12+
extern int z_prf(int (*func)(), void *dest,
1313
const char *format, va_list vargs);
1414

1515
struct emitter {
@@ -44,7 +44,7 @@ int snprintf(char *_MLIBC_RESTRICT s, size_t len,
4444
p.len = (int) len;
4545

4646
va_start(vargs, format);
47-
r = _prf(sprintf_out, (void *) (&p), format, vargs);
47+
r = z_prf(sprintf_out, (void *) (&p), format, vargs);
4848
va_end(vargs);
4949

5050
*(p.ptr) = 0;
@@ -62,7 +62,7 @@ int sprintf(char *_MLIBC_RESTRICT s, const char *_MLIBC_RESTRICT format, ...)
6262
p.len = (int) 0x7fffffff; /* allow up to "maxint" characters */
6363

6464
va_start(vargs, format);
65-
r = _prf(sprintf_out, (void *) (&p), format, vargs);
65+
r = z_prf(sprintf_out, (void *) (&p), format, vargs);
6666
va_end(vargs);
6767

6868
*(p.ptr) = 0;
@@ -83,7 +83,7 @@ int vsnprintf(char *_MLIBC_RESTRICT s, size_t len,
8383
p.ptr = s;
8484
p.len = (int) len;
8585

86-
r = _prf(sprintf_out, (void *) (&p), format, vargs);
86+
r = z_prf(sprintf_out, (void *) (&p), format, vargs);
8787

8888
*(p.ptr) = 0;
8989
return r;
@@ -98,7 +98,7 @@ int vsprintf(char *_MLIBC_RESTRICT s, const char *_MLIBC_RESTRICT format,
9898
p.ptr = s;
9999
p.len = (int) 0x7fffffff; /* allow up to "maxint" characters */
100100

101-
r = _prf(sprintf_out, (void *) (&p), format, vargs);
101+
r = z_prf(sprintf_out, (void *) (&p), format, vargs);
102102

103103
*(p.ptr) = 0;
104104
return r;

lib/os/printk.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static void print_err(out_func_t out, void *ctx)
9898
*
9999
* @return N/A
100100
*/
101-
void _vprintk(out_func_t out, void *ctx, const char *fmt, va_list ap)
101+
void z_vprintk(out_func_t out, void *ctx, const char *fmt, va_list ap)
102102
{
103103
int might_format = 0; /* 1 if encountered a '%' */
104104
enum pad_type padding = PAD_NONE;
@@ -316,23 +316,23 @@ void vprintk(const char *fmt, va_list ap)
316316
if (_is_user_context()) {
317317
struct buf_out_context ctx = { 0 };
318318

319-
_vprintk(buf_char_out, &ctx, fmt, ap);
319+
z_vprintk(buf_char_out, &ctx, fmt, ap);
320320

321321
if (ctx.buf_count) {
322322
buf_flush(&ctx);
323323
}
324324
} else {
325325
struct out_context ctx = { 0 };
326326

327-
_vprintk(char_out, &ctx, fmt, ap);
327+
z_vprintk(char_out, &ctx, fmt, ap);
328328
}
329329
}
330330
#else
331331
void vprintk(const char *fmt, va_list ap)
332332
{
333333
struct out_context ctx = { 0 };
334334

335-
_vprintk(char_out, &ctx, fmt, ap);
335+
z_vprintk(char_out, &ctx, fmt, ap);
336336
}
337337
#endif
338338

@@ -510,7 +510,7 @@ int snprintk(char *str, size_t size, const char *fmt, ...)
510510
va_list ap;
511511

512512
va_start(ap, fmt);
513-
_vprintk((out_func_t)str_out, &ctx, fmt, ap);
513+
z_vprintk((out_func_t)str_out, &ctx, fmt, ap);
514514
va_end(ap);
515515

516516
if (ctx.count < ctx.max) {
@@ -524,7 +524,7 @@ int vsnprintk(char *str, size_t size, const char *fmt, va_list ap)
524524
{
525525
struct str_context ctx = { str, size, 0 };
526526

527-
_vprintk((out_func_t)str_out, &ctx, fmt, ap);
527+
z_vprintk((out_func_t)str_out, &ctx, fmt, ap);
528528

529529
if (ctx.count < ctx.max) {
530530
str[ctx.count] = '\0';

subsys/bluetooth/controller/hci/hci_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static const struct bt_hci_driver drv = {
486486
.send = hci_driver_send,
487487
};
488488

489-
static int _hci_driver_init(struct device *unused)
489+
static int hci_driver_init(struct device *unused)
490490
{
491491
ARG_UNUSED(unused);
492492

@@ -495,4 +495,4 @@ static int _hci_driver_init(struct device *unused)
495495
return 0;
496496
}
497497

498-
SYS_INIT(_hci_driver_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
498+
SYS_INIT(hci_driver_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);

subsys/bluetooth/host/monitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static struct {
6666
atomic_t other;
6767
} drops;
6868

69-
extern int _prf(int (*func)(), void *dest,
69+
extern int z_prf(int (*func)(), void *dest,
7070
const char *format, va_list vargs);
7171

7272
static void monitor_send(const void *data, size_t len)

subsys/bluetooth/host/smp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,7 +2252,7 @@ static u8_t smp_master_ident(struct bt_smp *smp, struct net_buf *buf)
22522252
}
22532253
#endif /* !CONFIG_BT_SMP_SC_PAIR_ONLY */
22542254

2255-
static int _smp_init(struct bt_smp *smp)
2255+
static int smp_init(struct bt_smp *smp)
22562256
{
22572257
/* Initialize SMP context without clearing L2CAP channel context */
22582258
(void)memset((u8_t *)smp + sizeof(smp->chan), 0,
@@ -2355,7 +2355,7 @@ int bt_smp_send_security_req(struct bt_conn *conn)
23552355
return -EINVAL;
23562356
}
23572357

2358-
if (_smp_init(smp) != 0) {
2358+
if (smp_init(smp) != 0) {
23592359
return -ENOBUFS;
23602360
}
23612361

@@ -2394,7 +2394,7 @@ static u8_t smp_pairing_req(struct bt_smp *smp, struct net_buf *buf)
23942394
* is already initialized.
23952395
*/
23962396
if (!atomic_test_bit(smp->flags, SMP_FLAG_SEC_REQ)) {
2397-
int ret = _smp_init(smp);
2397+
int ret = smp_init(smp);
23982398

23992399
if (ret) {
24002400
return ret;
@@ -2533,7 +2533,7 @@ int bt_smp_send_pairing_req(struct bt_conn *conn)
25332533
return -EINVAL;
25342534
}
25352535

2536-
if (_smp_init(smp)) {
2536+
if (smp_init(smp)) {
25372537
return -ENOBUFS;
25382538
}
25392539

subsys/debug/tracing/include/tracing_sysview.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static inline int is_idle_thread(struct k_thread *thread)
2626
}
2727

2828

29-
static inline void _sys_trace_thread_switched_in(void)
29+
static inline void z_sys_trace_thread_switched_in(void)
3030
{
3131
struct k_thread *thread;
3232

@@ -39,7 +39,7 @@ static inline void _sys_trace_thread_switched_in(void)
3939
}
4040
}
4141

42-
#define sys_trace_thread_switched_in() _sys_trace_thread_switched_in()
42+
#define sys_trace_thread_switched_in() z_sys_trace_thread_switched_in()
4343

4444
#define sys_trace_thread_switched_out() SEGGER_SYSVIEW_OnTaskStopExec()
4545

subsys/debug/tracing/sysview_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <SEGGER_SYSVIEW.h>
88
#include "SEGGER_SYSVIEW_Zephyr.h"
99

10-
static void _cbSendSystemDesc(void)
10+
static void cbSendSystemDesc(void)
1111
{
1212
SEGGER_SYSVIEW_SendSysDesc("N=ZephyrSysView");
1313
SEGGER_SYSVIEW_SendSysDesc("D=" CONFIG_BOARD " "
@@ -19,7 +19,7 @@ void SEGGER_SYSVIEW_Conf(void)
1919
{
2020
SEGGER_SYSVIEW_Init(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,
2121
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,
22-
&SYSVIEW_X_OS_TraceAPI, _cbSendSystemDesc);
22+
&SYSVIEW_X_OS_TraceAPI, cbSendSystemDesc);
2323

2424
#if defined(DT_PHYS_RAM_ADDR) /* x86 */
2525
SEGGER_SYSVIEW_SetRAMBase(DT_PHYS_RAM_ADDR);

0 commit comments

Comments
 (0)