You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/06/30 19:09:07 UTC

[incubator-nuttx] 03/03: sched: Remove "0x" prefix preceding "%p" specifier on format string

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 1416afc6b62c1391eec2e067f010dd323e163f41
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Thu Jun 30 14:34:24 2022 -0300

    sched: Remove "0x" prefix preceding "%p" specifier on format string
    
    The "p" format specifier already prepends the pointer address with
    "0x" when printing.
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 sched/pthread/pthread_completejoin.c    | 4 ++--
 sched/pthread/pthread_condbroadcast.c   | 2 +-
 sched/pthread/pthread_condclockwait.c   | 2 +-
 sched/pthread/pthread_condsignal.c      | 2 +-
 sched/pthread/pthread_condwait.c        | 2 +-
 sched/pthread/pthread_getschedparam.c   | 2 +-
 sched/pthread/pthread_join.c            | 4 ++--
 sched/pthread/pthread_mutexconsistent.c | 2 +-
 sched/pthread/pthread_mutexdestroy.c    | 2 +-
 sched/pthread/pthread_mutexinit.c       | 2 +-
 sched/pthread/pthread_mutextimedlock.c  | 2 +-
 sched/pthread/pthread_mutextrylock.c    | 2 +-
 sched/pthread/pthread_mutexunlock.c     | 2 +-
 sched/pthread/pthread_setschedparam.c   | 2 +-
 14 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/sched/pthread/pthread_completejoin.c b/sched/pthread/pthread_completejoin.c
index 3d66fe8a6a..1e76d555a7 100644
--- a/sched/pthread/pthread_completejoin.c
+++ b/sched/pthread/pthread_completejoin.c
@@ -54,7 +54,7 @@ static bool pthread_notifywaiters(FAR struct join_s *pjoin)
   int ntasks_waiting;
   int status;
 
-  sinfo("pjoin=0x%p\n", pjoin);
+  sinfo("pjoin=%p\n", pjoin);
 
   /* Are any tasks waiting for our exit value? */
 
@@ -257,7 +257,7 @@ int pthread_completejoin(pid_t pid, FAR void *exit_value)
 void pthread_destroyjoin(FAR struct task_group_s *group,
                          FAR struct join_s *pjoin)
 {
-  sinfo("pjoin=0x%p\n", pjoin);
+  sinfo("pjoin=%p\n", pjoin);
 
   /* Remove the join info from the set of joins */
 
diff --git a/sched/pthread/pthread_condbroadcast.c b/sched/pthread/pthread_condbroadcast.c
index f47b6a0d41..607d6757d2 100644
--- a/sched/pthread/pthread_condbroadcast.c
+++ b/sched/pthread/pthread_condbroadcast.c
@@ -56,7 +56,7 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond)
   int ret = OK;
   int sval;
 
-  sinfo("cond=0x%p\n", cond);
+  sinfo("cond=%p\n", cond);
 
   if (!cond)
     {
diff --git a/sched/pthread/pthread_condclockwait.c b/sched/pthread/pthread_condclockwait.c
index 2b847bd065..c8d0a8c603 100644
--- a/sched/pthread/pthread_condclockwait.c
+++ b/sched/pthread/pthread_condclockwait.c
@@ -78,7 +78,7 @@ int pthread_cond_clockwait(FAR pthread_cond_t *cond,
   int ret = OK;
   int status;
 
-  sinfo("cond=0x%p mutex=0x%p abstime=0x%p\n", cond, mutex, abstime);
+  sinfo("cond=%p mutex=%p abstime=%p\n", cond, mutex, abstime);
 
   /* pthread_cond_clockwait() is a cancellation point */
 
diff --git a/sched/pthread/pthread_condsignal.c b/sched/pthread/pthread_condsignal.c
index a7733bdf37..ba71ff2be9 100644
--- a/sched/pthread/pthread_condsignal.c
+++ b/sched/pthread/pthread_condsignal.c
@@ -55,7 +55,7 @@ int pthread_cond_signal(FAR pthread_cond_t *cond)
   int ret = OK;
   int sval;
 
-  sinfo("cond=0x%p\n", cond);
+  sinfo("cond=%p\n", cond);
 
   if (!cond)
     {
diff --git a/sched/pthread/pthread_condwait.c b/sched/pthread/pthread_condwait.c
index 2ec4b9909f..c4da0805ba 100644
--- a/sched/pthread/pthread_condwait.c
+++ b/sched/pthread/pthread_condwait.c
@@ -59,7 +59,7 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex)
   int status;
   int ret;
 
-  sinfo("cond=0x%p mutex=0x%p\n", cond, mutex);
+  sinfo("cond=%p mutex=%p\n", cond, mutex);
 
   /* pthread_cond_wait() is a cancellation point */
 
diff --git a/sched/pthread/pthread_getschedparam.c b/sched/pthread/pthread_getschedparam.c
index f2f6e8efa5..73511b3723 100644
--- a/sched/pthread/pthread_getschedparam.c
+++ b/sched/pthread/pthread_getschedparam.c
@@ -78,7 +78,7 @@ int pthread_getschedparam(pthread_t thread, FAR int *policy,
 {
   int ret;
 
-  sinfo("Thread ID=%d policy=0x%p param=0x%p\n", thread, policy, param);
+  sinfo("Thread ID=%d policy=%p param=%p\n", thread, policy, param);
 
   if (policy == NULL || param == NULL)
     {
diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c
index 682f9cd0d5..887cef5f92 100644
--- a/sched/pthread/pthread_join.c
+++ b/sched/pthread/pthread_join.c
@@ -176,7 +176,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value)
 
           if (pexit_value)
             {
-              sinfo("exit_value=0x%p\n", pjoin->exit_value);
+              sinfo("exit_value=%p\n", pjoin->exit_value);
               *pexit_value = pjoin->exit_value;
             }
         }
@@ -206,7 +206,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value)
           if (pexit_value)
             {
               *pexit_value = pjoin->exit_value;
-              sinfo("exit_value=0x%p\n", pjoin->exit_value);
+              sinfo("exit_value=%p\n", pjoin->exit_value);
             }
 
           /* Post the thread's data semaphore so that the exiting thread
diff --git a/sched/pthread/pthread_mutexconsistent.c b/sched/pthread/pthread_mutexconsistent.c
index f910510260..4cba0a0771 100644
--- a/sched/pthread/pthread_mutexconsistent.c
+++ b/sched/pthread/pthread_mutexconsistent.c
@@ -76,7 +76,7 @@ int pthread_mutex_consistent(FAR pthread_mutex_t *mutex)
   int ret = EINVAL;
   int status;
 
-  sinfo("mutex=0x%p\n", mutex);
+  sinfo("mutex=%p\n", mutex);
   DEBUGASSERT(mutex != NULL);
 
   if (mutex != NULL)
diff --git a/sched/pthread/pthread_mutexdestroy.c b/sched/pthread/pthread_mutexdestroy.c
index 354d5fdcdf..2a144dae8a 100644
--- a/sched/pthread/pthread_mutexdestroy.c
+++ b/sched/pthread/pthread_mutexdestroy.c
@@ -60,7 +60,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex)
   int ret = EINVAL;
   int status;
 
-  sinfo("mutex=0x%p\n", mutex);
+  sinfo("mutex=%p\n", mutex);
   DEBUGASSERT(mutex != NULL);
 
   if (mutex != NULL)
diff --git a/sched/pthread/pthread_mutexinit.c b/sched/pthread/pthread_mutexinit.c
index c1956a09ec..a5bd11d420 100644
--- a/sched/pthread/pthread_mutexinit.c
+++ b/sched/pthread/pthread_mutexinit.c
@@ -77,7 +77,7 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex,
   int ret = OK;
   int status;
 
-  sinfo("mutex=0x%p attr=0x%p\n", mutex, attr);
+  sinfo("mutex=%p attr=%p\n", mutex, attr);
 
   if (!mutex)
     {
diff --git a/sched/pthread/pthread_mutextimedlock.c b/sched/pthread/pthread_mutextimedlock.c
index af0698851d..f6d113b020 100644
--- a/sched/pthread/pthread_mutextimedlock.c
+++ b/sched/pthread/pthread_mutextimedlock.c
@@ -81,7 +81,7 @@ int pthread_mutex_timedlock(FAR pthread_mutex_t *mutex,
   pid_t mypid = getpid();
   int ret = EINVAL;
 
-  sinfo("mutex=0x%p\n", mutex);
+  sinfo("mutex=%p\n", mutex);
   DEBUGASSERT(mutex != NULL);
 
   if (mutex != NULL)
diff --git a/sched/pthread/pthread_mutextrylock.c b/sched/pthread/pthread_mutextrylock.c
index 84e2a5632c..25a41b4f72 100644
--- a/sched/pthread/pthread_mutextrylock.c
+++ b/sched/pthread/pthread_mutextrylock.c
@@ -71,7 +71,7 @@ int pthread_mutex_trylock(FAR pthread_mutex_t *mutex)
   int status;
   int ret = EINVAL;
 
-  sinfo("mutex=0x%p\n", mutex);
+  sinfo("mutex=%p\n", mutex);
   DEBUGASSERT(mutex != NULL);
 
   if (mutex != NULL)
diff --git a/sched/pthread/pthread_mutexunlock.c b/sched/pthread/pthread_mutexunlock.c
index 60ec293755..c4379d14e1 100644
--- a/sched/pthread/pthread_mutexunlock.c
+++ b/sched/pthread/pthread_mutexunlock.c
@@ -102,7 +102,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex)
 {
   int ret = EPERM;
 
-  sinfo("mutex=0x%p\n", mutex);
+  sinfo("mutex=%p\n", mutex);
   DEBUGASSERT(mutex != NULL);
   if (mutex == NULL)
     {
diff --git a/sched/pthread/pthread_setschedparam.c b/sched/pthread/pthread_setschedparam.c
index fc44c1162b..8ff53e01e8 100644
--- a/sched/pthread/pthread_setschedparam.c
+++ b/sched/pthread/pthread_setschedparam.c
@@ -91,7 +91,7 @@ int pthread_setschedparam(pthread_t thread, int policy,
 {
   int ret;
 
-  sinfo("thread ID=%d policy=%d param=0x%p\n", thread, policy, param);
+  sinfo("thread ID=%d policy=%d param=%p\n", thread, policy, param);
 
   /* Let nxsched_set_scheduler do all of the work */