drivers/note: Fix the style issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-12-12 10:04:16 +08:00 committed by Petro Karashchenko
parent c36640e205
commit 03f07effc9
2 changed files with 19 additions and 31 deletions

View File

@ -191,7 +191,7 @@ static inline int note_isenabled(void)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* Ignore notes that are not in the set of monitored CPUs */ /* Ignore notes that are not in the set of monitored CPUs */
if ((g_note_filter.mode.cpuset & (1 << this_cpu())) == 0) if (CPU_ISSET(&g_note_filter.mode.cpuset, this_cpu()) == 0)
{ {
/* Not in the set of monitored CPUs. Do not log the note. */ /* Not in the set of monitored CPUs. Do not log the note. */
@ -268,11 +268,7 @@ static inline int note_isenabled_syscall(int nr)
if (up_interrupt_context()) if (up_interrupt_context())
{ {
#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
#ifdef CONFIG_SMP
int cpu = this_cpu(); int cpu = this_cpu();
#else
int cpu = 0;
#endif
if (g_note_disabled_irq_nest[cpu] > 0) if (g_note_disabled_irq_nest[cpu] > 0)
{ {
@ -330,11 +326,7 @@ static inline int note_isenabled_irq(int irq, bool enter)
if (!(g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_IRQ) || if (!(g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_IRQ) ||
NOTE_FILTER_IRQMASK_ISSET(irq, &g_note_filter.irq_mask)) NOTE_FILTER_IRQMASK_ISSET(irq, &g_note_filter.irq_mask))
{ {
#ifdef CONFIG_SMP
int cpu = this_cpu(); int cpu = this_cpu();
#else
int cpu = 0;
#endif
if (enter) if (enter)
{ {
@ -420,7 +412,7 @@ static void note_spincommon(FAR struct tcb_s *tcb,
note_common(tcb, &note.nsp_cmn, sizeof(struct note_spinlock_s), type); note_common(tcb, &note.nsp_cmn, sizeof(struct note_spinlock_s), type);
sched_note_flatten(note.nsp_spinlock, &spinlock, sizeof(spinlock)); sched_note_flatten(note.nsp_spinlock, &spinlock, sizeof(spinlock));
note.nsp_value = *(uint8_t *)spinlock; note.nsp_value = *(FAR uint8_t *)spinlock;
/* Add the note to circular buffer */ /* Add the note to circular buffer */
@ -742,8 +734,8 @@ void sched_note_syscall_enter(int nr, int argc, ...)
struct note_syscall_enter_s note; struct note_syscall_enter_s note;
FAR struct tcb_s *tcb = this_task(); FAR struct tcb_s *tcb = this_task();
unsigned int length; unsigned int length;
FAR uint8_t *args;
uintptr_t arg; uintptr_t arg;
uint8_t *args;
va_list ap; va_list ap;
int i; int i;
@ -893,9 +885,7 @@ void sched_note_dump(uintptr_t ip, uint8_t event,
/* Format the note */ /* Format the note */
note_common(tcb, &note->nbi_cmn, length, note_common(tcb, &note->nbi_cmn, length, NOTE_DUMP_BINARY);
NOTE_DUMP_BINARY);
sched_note_flatten(note->nbi_ip, &ip, sizeof(uintptr_t)); sched_note_flatten(note->nbi_ip, &ip, sizeof(uintptr_t));
note->nbi_event = event; note->nbi_event = event;
memcpy(note->nbi_data, buf, length - sizeof(struct note_binary_s) + 1); memcpy(note->nbi_data, buf, length - sizeof(struct note_binary_s) + 1);
@ -1132,9 +1122,7 @@ void sched_note_vbprintf(uintptr_t ip, uint8_t event,
/* Format the note */ /* Format the note */
note_common(tcb, &note->nbi_cmn, length, note_common(tcb, &note->nbi_cmn, length, NOTE_DUMP_BINARY);
NOTE_DUMP_BINARY);
sched_note_flatten(note->nbi_ip, &ip, sizeof(uintptr_t)); sched_note_flatten(note->nbi_ip, &ip, sizeof(uintptr_t));
note->nbi_event = event; note->nbi_event = event;
@ -1194,8 +1182,8 @@ void sched_note_end(uintptr_t ip)
* *
****************************************************************************/ ****************************************************************************/
void sched_note_filter_mode(struct note_filter_mode_s *oldm, void sched_note_filter_mode(FAR struct note_filter_mode_s *oldm,
struct note_filter_mode_s *newm) FAR struct note_filter_mode_s *newm)
{ {
irqstate_t irq_mask; irqstate_t irq_mask;
@ -1235,8 +1223,8 @@ void sched_note_filter_mode(struct note_filter_mode_s *oldm,
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
void sched_note_filter_syscall(struct note_filter_syscall_s *oldf, void sched_note_filter_syscall(FAR struct note_filter_syscall_s *oldf,
struct note_filter_syscall_s *newf) FAR struct note_filter_syscall_s *newf)
{ {
irqstate_t irq_mask; irqstate_t irq_mask;
@ -1281,8 +1269,8 @@ void sched_note_filter_syscall(struct note_filter_syscall_s *oldf,
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
void sched_note_filter_irq(struct note_filter_irq_s *oldf, void sched_note_filter_irq(FAR struct note_filter_irq_s *oldf,
struct note_filter_irq_s *newf) FAR struct note_filter_irq_s *newf)
{ {
irqstate_t irq_mask; irqstate_t irq_mask;

View File

@ -407,7 +407,7 @@ struct note_filter_mode_s
{ {
unsigned int flag; /* Filter mode flag */ unsigned int flag; /* Filter mode flag */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned int cpuset; /* The set of monitored CPUs */ cpu_set_t cpuset; /* The set of monitored CPUs */
#endif #endif
}; };
@ -609,8 +609,8 @@ void sched_note_add(FAR const void *note, size_t notelen);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER #ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
void sched_note_filter_mode(struct note_filter_mode_s *oldm, void sched_note_filter_mode(FAR struct note_filter_mode_s *oldm,
struct note_filter_mode_s *newm); FAR struct note_filter_mode_s *newm);
#endif #endif
/**************************************************************************** /****************************************************************************
@ -635,8 +635,8 @@ void sched_note_filter_mode(struct note_filter_mode_s *oldm,
#if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) && \ #if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) && \
defined(CONFIG_SCHED_INSTRUMENTATION_SYSCALL) defined(CONFIG_SCHED_INSTRUMENTATION_SYSCALL)
void sched_note_filter_syscall(struct note_filter_syscall_s *oldf, void sched_note_filter_syscall(FAR struct note_filter_syscall_s *oldf,
struct note_filter_syscall_s *newf); FAR struct note_filter_syscall_s *newf);
#endif #endif
/**************************************************************************** /****************************************************************************
@ -661,8 +661,8 @@ void sched_note_filter_syscall(struct note_filter_syscall_s *oldf,
#if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) && \ #if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) && \
defined(CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER) defined(CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER)
void sched_note_filter_irq(struct note_filter_irq_s *oldf, void sched_note_filter_irq(FAR struct note_filter_irq_s *oldf,
struct note_filter_irq_s *newf); FAR struct note_filter_irq_s *newf);
#endif #endif
#endif /* defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT) */ #endif /* defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT) */