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

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

commit 538582ede10a5c651010fc3d7eeb25724b58f2d1
Author: chenxiaoyi <[email protected]>
AuthorDate: Thu Jun 13 15:35:16 2024 +0800

    convert pointer string to number in base 16
    
    Co-authored-by: chenxiaoyi <[email protected]>
    Co-authored-by: xuxin19 <[email protected]>
---
 drivers/net/rpmsgdrv.c                 | 4 ++--
 drivers/sensors/goldfish_gps_uorb.c    | 2 +-
 drivers/sensors/goldfish_sensor_uorb.c | 2 +-
 sched/wqueue/kwork_thread.c            | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/rpmsgdrv.c b/drivers/net/rpmsgdrv.c
index 3f55c31584..bbd5b9e53f 100644
--- a/drivers/net/rpmsgdrv.c
+++ b/drivers/net/rpmsgdrv.c
@@ -330,8 +330,8 @@ static int net_rpmsg_drv_sockioctl_task(int argc, FAR char 
*argv[])
 
   /* Restore pointers from argv */
 
-  ept = (FAR struct rpmsg_endpoint *)strtoul(argv[1], NULL, 0);
-  msg = (FAR struct net_rpmsg_ioctl_s *)strtoul(argv[2], NULL, 0);
+  ept = (FAR struct rpmsg_endpoint *)strtoul(argv[1], NULL, 16);
+  msg = (FAR struct net_rpmsg_ioctl_s *)strtoul(argv[2], NULL, 16);
 
   /* We need a temporary sock for ioctl here */
 
diff --git a/drivers/sensors/goldfish_gps_uorb.c 
b/drivers/sensors/goldfish_gps_uorb.c
index 766d7faea0..a59cf0bf3d 100644
--- a/drivers/sensors/goldfish_gps_uorb.c
+++ b/drivers/sensors/goldfish_gps_uorb.c
@@ -142,7 +142,7 @@ static int goldfish_gps_activate(FAR struct gps_lowerhalf_s 
*gps,
 static int goldfish_gps_thread(int argc, FAR char** argv)
 {
   FAR struct goldfish_gps_s *priv = (FAR struct goldfish_gps_s *)
-                                ((uintptr_t)strtoul(argv[1], NULL, 0));
+                                ((uintptr_t)strtoul(argv[1], NULL, 16));
   ssize_t len;
   char buf[256];
 
diff --git a/drivers/sensors/goldfish_sensor_uorb.c 
b/drivers/sensors/goldfish_sensor_uorb.c
index 94b7550d99..a61f98cfe2 100644
--- a/drivers/sensors/goldfish_sensor_uorb.c
+++ b/drivers/sensors/goldfish_sensor_uorb.c
@@ -588,7 +588,7 @@ static int goldfish_sensor_activate(FAR struct 
sensor_lowerhalf_s *lower,
 static int goldfish_sensor_thread(int argc, FAR char** argv)
 {
   FAR struct goldfish_sensor_s *priv =
-    (FAR struct goldfish_sensor_s *)((uintptr_t)strtoul(argv[1], NULL, 0));
+    (FAR struct goldfish_sensor_s *)((uintptr_t)strtoul(argv[1], NULL, 16));
 
   while (true)
     {
diff --git a/sched/wqueue/kwork_thread.c b/sched/wqueue/kwork_thread.c
index a0a9ea5406..ef3be25b2f 100644
--- a/sched/wqueue/kwork_thread.c
+++ b/sched/wqueue/kwork_thread.c
@@ -136,9 +136,9 @@ static int work_thread(int argc, FAR char *argv[])
   /* Get the handle from argv */
 
   wqueue  = (FAR struct kwork_wqueue_s *)
-            ((uintptr_t)strtoul(argv[1], NULL, 0));
+            ((uintptr_t)strtoul(argv[1], NULL, 16));
   kworker = (FAR struct kworker_s *)
-            ((uintptr_t)strtoul(argv[2], NULL, 0));
+            ((uintptr_t)strtoul(argv[2], NULL, 16));
 
   flags = enter_critical_section();
 

Reply via email to