Skip to content

Commit

Permalink
convert pointer string to number in base 16
Browse files Browse the repository at this point in the history
Co-authored-by: chenxiaoyi <[email protected]>
Co-authored-by: xuxin19 <[email protected]>
  • Loading branch information
chenxiaoyi and xuxin930 committed Aug 13, 2024
1 parent 5d9aa53 commit fa91193
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions drivers/net/rpmsgdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion drivers/sensors/goldfish_gps_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion drivers/sensors/goldfish_sensor_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions sched/wqueue/kwork_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit fa91193

Please sign in to comment.