From 0c3930ba11f2e7155f984928ed473d1ef9e098a6 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 10 Sep 2020 06:14:49 -0700 Subject: [PATCH] sched: Rename note_add to sched_note_add to better match other sched_note_* function Signed-off-by: Xiang Xiao --- drivers/note/note_driver.c | 7 ++++--- include/nuttx/sched_note.h | 4 ++-- sched/sched/sched_note.c | 30 +++++++++++++++--------------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c index 9207609262..6d917567cb 100644 --- a/drivers/note/note_driver.c +++ b/drivers/note/note_driver.c @@ -389,7 +389,7 @@ static ssize_t note_read(FAR struct file *filep, FAR char *buffer, ****************************************************************************/ /**************************************************************************** - * Name: note_add + * Name: sched_note_add * * Description: * Add the variable length note to the transport layer @@ -406,8 +406,9 @@ static ssize_t note_read(FAR struct file *filep, FAR char *buffer, * ****************************************************************************/ -void note_add(FAR const uint8_t *note, uint8_t notelen) +void sched_note_add(FAR const void *note, size_t notelen) { + FAR const char *buf = note; unsigned int head; unsigned int next; @@ -439,7 +440,7 @@ void note_add(FAR const uint8_t *note, uint8_t notelen) /* Save the next byte at the head index */ - g_note_info.ni_buffer[head] = *note++; + g_note_info.ni_buffer[head] = *buf++; head = next; notelen--; diff --git a/include/nuttx/sched_note.h b/include/nuttx/sched_note.h index 68c994682c..eed9435d65 100644 --- a/include/nuttx/sched_note.h +++ b/include/nuttx/sched_note.h @@ -338,7 +338,7 @@ void sched_note_irqhandler(int irq, FAR void *handler, bool enter); #endif /**************************************************************************** - * Name: note_add + * Name: sched_note_add * * Description: * Add the variable length note to the transport layer @@ -355,7 +355,7 @@ void sched_note_irqhandler(int irq, FAR void *handler, bool enter); * ****************************************************************************/ -void note_add(FAR const uint8_t *note, uint8_t notelen); +void sched_note_add(FAR const void *note, size_t notelen); #else /* CONFIG_SCHED_INSTRUMENTATION */ diff --git a/sched/sched/sched_note.c b/sched/sched/sched_note.c index 31cb20a557..efbc57abee 100644 --- a/sched/sched/sched_note.c +++ b/sched/sched/sched_note.c @@ -142,7 +142,7 @@ static void note_spincommon(FAR struct tcb_s *tcb, /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_spinlock_s)); + sched_note_add(¬e, sizeof(struct note_spinlock_s)); } #endif @@ -207,7 +207,7 @@ void sched_note_start(FAR struct tcb_s *tcb) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, length); + sched_note_add(¬e, length); } void sched_note_stop(FAR struct tcb_s *tcb) @@ -231,7 +231,7 @@ void sched_note_stop(FAR struct tcb_s *tcb) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_stop_s)); + sched_note_add(¬e, sizeof(struct note_stop_s)); } void sched_note_suspend(FAR struct tcb_s *tcb) @@ -257,7 +257,7 @@ void sched_note_suspend(FAR struct tcb_s *tcb) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_suspend_s)); + sched_note_add(¬e, sizeof(struct note_suspend_s)); } void sched_note_resume(FAR struct tcb_s *tcb) @@ -281,7 +281,7 @@ void sched_note_resume(FAR struct tcb_s *tcb) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_resume_s)); + sched_note_add(¬e, sizeof(struct note_resume_s)); } #ifdef CONFIG_SMP @@ -308,7 +308,7 @@ void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_start_s)); + sched_note_add(¬e, sizeof(struct note_cpu_start_s)); } void sched_note_cpu_started(FAR struct tcb_s *tcb) @@ -333,7 +333,7 @@ void sched_note_cpu_started(FAR struct tcb_s *tcb) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_started_s)); + sched_note_add(¬e, sizeof(struct note_cpu_started_s)); } void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu) @@ -359,7 +359,7 @@ void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_pause_s)); + sched_note_add(¬e, sizeof(struct note_cpu_pause_s)); } void sched_note_cpu_paused(FAR struct tcb_s *tcb) @@ -384,7 +384,7 @@ void sched_note_cpu_paused(FAR struct tcb_s *tcb) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_paused_s)); + sched_note_add(¬e, sizeof(struct note_cpu_paused_s)); } void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu) @@ -410,7 +410,7 @@ void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_resume_s)); + sched_note_add(¬e, sizeof(struct note_cpu_resume_s)); } void sched_note_cpu_resumed(FAR struct tcb_s *tcb) @@ -435,7 +435,7 @@ void sched_note_cpu_resumed(FAR struct tcb_s *tcb) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_cpu_resumed_s)); + sched_note_add(¬e, sizeof(struct note_cpu_resumed_s)); } #endif @@ -464,7 +464,7 @@ void sched_note_premption(FAR struct tcb_s *tcb, bool locked) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_preempt_s)); + sched_note_add(¬e, sizeof(struct note_preempt_s)); } #endif @@ -495,7 +495,7 @@ void sched_note_csection(FAR struct tcb_s *tcb, bool enter) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_csection_s)); + sched_note_add(¬e, sizeof(struct note_csection_s)); } #endif @@ -549,7 +549,7 @@ void sched_note_syscall_enter(int nr, int argc, ...) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_syscall_enter_s)); + sched_note_add(¬e, sizeof(struct note_syscall_enter_s)); } void sched_note_syscall_leave(int nr, uintptr_t result) @@ -578,7 +578,7 @@ void sched_note_syscall_leave(int nr, uintptr_t result) /* Add the note to circular buffer */ - note_add((FAR const uint8_t *)¬e, sizeof(struct note_syscall_leave_s)); + sched_note_add(¬e, sizeof(struct note_syscall_leave_s)); } #endif