diff --git a/arch/arm/src/rtl8720c/amebaz_depend.c b/arch/arm/src/rtl8720c/amebaz_depend.c index a29a4cfa3d..71405ea308 100644 --- a/arch/arm/src/rtl8720c/amebaz_depend.c +++ b/arch/arm/src/rtl8720c/amebaz_depend.c @@ -601,7 +601,7 @@ static int nuttx_task_hook(int argc, char *argv[]) struct task_struct *task; struct nthread_wrapper *wrap; task = (struct task_struct *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + ((uintptr_t)strtoul(argv[1], NULL, 16)); if (!task || !task->priv) { return 0; @@ -624,7 +624,7 @@ int rtw_create_task(struct task_struct *task, const char *name, char *argv[2]; char arg1[16]; int pid; - snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)task); + snprintf(arg1, 16, "%p", task); argv[0] = arg1; argv[1] = NULL; wrap = malloc(sizeof(*wrap)); diff --git a/arch/risc-v/src/mpfs/mpfs_ihc.c b/arch/risc-v/src/mpfs/mpfs_ihc.c index 69e7ec4d2a..02bd8a2182 100644 --- a/arch/risc-v/src/mpfs/mpfs_ihc.c +++ b/arch/risc-v/src/mpfs/mpfs_ihc.c @@ -1269,8 +1269,8 @@ int mpfs_ihc_init(void) /* Thread initialization */ - snprintf(arg1, sizeof(arg1), "0x%" PRIxPTR, - (uintptr_t)g_mpfs_virtqueue_table); + snprintf(arg1, sizeof(arg1), "%p", + g_mpfs_virtqueue_table); argv[0] = "mpfs_ihc_thread"; argv[1] = arg1; argv[2] = NULL; diff --git a/boards/arm/sama5/jupiter-nano/src/sam_usb.c b/boards/arm/sama5/jupiter-nano/src/sam_usb.c index 9b0e63a595..e1a3df326e 100644 --- a/boards/arm/sama5/jupiter-nano/src/sam_usb.c +++ b/boards/arm/sama5/jupiter-nano/src/sam_usb.c @@ -340,7 +340,7 @@ int sam_usbhost_initialize(void) pid = kthread_create("OHCI Monitor", CONFIG_JUPITERNANO_USBHOST_PRIO, CONFIG_JUPITERNANO_USBHOST_STACKSIZE, - (main_t)ohci_waiter, (char * const *)NULL); + ohci_waiter, NULL); if (pid < 0) { uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret); @@ -362,7 +362,7 @@ int sam_usbhost_initialize(void) pid = kthread_create("EHCI Monitor", CONFIG_JUPITERNANO_USBHOST_PRIO, CONFIG_JUPITERNANO_USBHOST_STACKSIZE, - (main_t)ehci_waiter, (char * const *)NULL); + ehci_waiter, NULL); if (pid < 0) { uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret); diff --git a/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c b/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c index a55cb668ab..80c6f5d9f3 100644 --- a/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c +++ b/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c @@ -228,8 +228,8 @@ int stm32_usbhost_initialize(void) uinfo("Start usbhost_waiter\n"); ret = kthread_create("usbhost", CONFIG_STM32F7F4DISCO_USBHOST_PRIO, - CONFIG_STM32F7F4DISCO_USBHOST_STACKSIZE, - usbhost_waiter, NULL); + CONFIG_STM32F7F4DISCO_USBHOST_STACKSIZE, + usbhost_waiter, NULL); return ret < 0 ? -ENOEXEC : OK; } diff --git a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_usb.c b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_usb.c index ca7652c4ba..13ff648701 100644 --- a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_usb.c +++ b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_usb.c @@ -230,8 +230,8 @@ int stm32_usbhost_initialize(void) uinfo("Start usbhost_waiter\n"); ret = kthread_create("usbhost", CONFIG_STM32F7F4DISCO_USBHOST_PRIO, - CONFIG_STM32F7F4DISCO_USBHOST_STACKSIZE, - (main_t)usbhost_waiter, (char * const *)NULL); + CONFIG_STM32F7F4DISCO_USBHOST_STACKSIZE, + usbhost_waiter, NULL); return ret < 0 ? -ENOEXEC : OK; } diff --git a/boards/arm/stm32f7/stm32f777zit6-meadow/src/stm32_usb.c b/boards/arm/stm32f7/stm32f777zit6-meadow/src/stm32_usb.c index 34f44228a1..469bf5d00f 100644 --- a/boards/arm/stm32f7/stm32f777zit6-meadow/src/stm32_usb.c +++ b/boards/arm/stm32f7/stm32f777zit6-meadow/src/stm32_usb.c @@ -235,8 +235,8 @@ int stm32_usbhost_initialize(void) uinfo("Start usbhost_waiter\n"); ret = kthread_create("usbhost", CONFIG_STM32F7F4DISCO_USBHOST_PRIO, - CONFIG_STM32F7F4DISCO_USBHOST_STACKSIZE, - (main_t)usbhost_waiter, (char * const *)NULL); + CONFIG_STM32F7F4DISCO_USBHOST_STACKSIZE, + usbhost_waiter, NULL); return ret < 0 ? -ENOEXEC : OK; } diff --git a/boards/arm/stm32h7/stm32h745i-disco/src/stm32_usb.c b/boards/arm/stm32h7/stm32h745i-disco/src/stm32_usb.c index f904945d60..84040820a9 100644 --- a/boards/arm/stm32h7/stm32h745i-disco/src/stm32_usb.c +++ b/boards/arm/stm32h7/stm32h745i-disco/src/stm32_usb.c @@ -231,7 +231,7 @@ int stm32_usbhost_initialize(void) pid = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO, CONFIG_USBHOST_STACKSIZE, - (main_t)usbhost_waiter, (FAR char * const *)NULL); + usbhost_waiter, NULL); return pid < 0 ? -ENOEXEC : OK; } diff --git a/drivers/modem/alt1250/alt1250.c b/drivers/modem/alt1250/alt1250.c index dcd8a6db6d..e43a373118 100644 --- a/drivers/modem/alt1250/alt1250.c +++ b/drivers/modem/alt1250/alt1250.c @@ -1098,7 +1098,7 @@ static int alt1250_start_rxthread(FAR struct alt1250_dev_s *dev, SCHED_PRIORITY_DEFAULT, CONFIG_DEFAULT_TASK_STACKSIZE, altcom_recvthread, - (FAR char * const *)NULL); + NULL); if (ret < 0) { diff --git a/drivers/rptun/rptun.c b/drivers/rptun/rptun.c index a28d598d2a..ad5a0408a5 100644 --- a/drivers/rptun/rptun.c +++ b/drivers/rptun/rptun.c @@ -270,7 +270,7 @@ static int rptun_thread(int argc, FAR char *argv[]) { FAR struct rptun_priv_s *priv; - priv = (FAR struct rptun_priv_s *)((uintptr_t)strtoul(argv[2], NULL, 0)); + priv = (FAR struct rptun_priv_s *)((uintptr_t)strtoul(argv[2], NULL, 16)); priv->tid = nxsched_gettid(); while (1) @@ -1213,7 +1213,7 @@ int rptun_initialize(FAR struct rptun_dev_s *dev) nxsem_init(&priv->semrx, 0, 0); } - snprintf(arg1, sizeof(arg1), "0x%" PRIxPTR, (uintptr_t)priv); + snprintf(arg1, sizeof(arg1), "%p", priv); argv[0] = (void *)RPTUN_GET_CPUNAME(dev); argv[1] = arg1; argv[2] = NULL; diff --git a/drivers/sensors/ds18b20.c b/drivers/sensors/ds18b20.c index 0c768e5c3e..835e001b76 100644 --- a/drivers/sensors/ds18b20.c +++ b/drivers/sensors/ds18b20.c @@ -811,7 +811,7 @@ static int ds18b20_thread(int argc, char** argv) { uint16_t orawdata; FAR struct ds18b20_dev_s *priv = (FAR struct ds18b20_dev_s *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + ((uintptr_t)strtoul(argv[1], NULL, 16)); /* Set initial value to out of measurement range to ensure that the first * data read leads to an upper notification. @@ -971,7 +971,7 @@ int ds18b20_register(int devno, FAR struct onewire_master_s *onewire, /* Create thread for polling sensor data */ - snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)priv); + snprintf(arg1, 16, "%p", priv); argv[0] = arg1; argv[1] = NULL; ret = kthread_create("ds18b20_thread", SCHED_PRIORITY_DEFAULT, diff --git a/drivers/sensors/fakesensor.c b/drivers/sensors/fakesensor.c index 541ad8707e..abb208772a 100644 --- a/drivers/sensors/fakesensor.c +++ b/drivers/sensors/fakesensor.c @@ -304,7 +304,7 @@ void fakesensor_push_event(FAR struct sensor_lowerhalf_s *lower, static int fakesensor_thread(int argc, char** argv) { FAR struct fakesensor_s *sensor = (FAR struct fakesensor_s *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + ((uintptr_t)strtoul(argv[1], NULL, 16)); int ret; while (true) diff --git a/drivers/sensors/hyt271.c b/drivers/sensors/hyt271.c index fbf6ecc004..4b785f6a09 100644 --- a/drivers/sensors/hyt271.c +++ b/drivers/sensors/hyt271.c @@ -781,7 +781,7 @@ static int hyt271_set_interval(FAR struct sensor_lowerhalf_s *lower, static int hyt271_thread(int argc, char** argv) { FAR struct hyt271_dev_s *priv = (FAR struct hyt271_dev_s *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + ((uintptr_t)strtoul(argv[1], NULL, 16)); uint32_t orawdata = 0; while (true) @@ -954,7 +954,7 @@ int hyt271_register(int devno, FAR struct i2c_master_s *i2c, uint8_t addr, #ifdef CONFIG_SENSORS_HYT271_POLL /* Create thread for sensor */ - snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)priv); + snprintf(arg1, 16, "%p", priv); argv[0] = arg1; argv[1] = NULL; ret = kthread_create("hyt271_thread", SCHED_PRIORITY_DEFAULT, diff --git a/drivers/sensors/ltr308.c b/drivers/sensors/ltr308.c index 2e203a5976..eca19e3420 100644 --- a/drivers/sensors/ltr308.c +++ b/drivers/sensors/ltr308.c @@ -505,7 +505,7 @@ err_out: static int ltr308_thread(int argc, char** argv) { FAR struct ltr308_dev_s *priv = (FAR struct ltr308_dev_s *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + ((uintptr_t)strtoul(argv[1], NULL, 16)); struct sensor_light light; uint32_t data = 0; bool data_pending; @@ -628,7 +628,7 @@ int ltr308_register(int devno, FAR struct i2c_master_s *i2c) /* Create thread for polling sensor data */ - snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)priv); + snprintf(arg1, 16, "%p", priv); argv[0] = arg1; argv[1] = NULL; ret = kthread_create("ltr308_thread", SCHED_PRIORITY_DEFAULT, diff --git a/drivers/sensors/mpu9250.c b/drivers/sensors/mpu9250.c index d6855fe267..36bb898026 100644 --- a/drivers/sensors/mpu9250.c +++ b/drivers/sensors/mpu9250.c @@ -1849,7 +1849,7 @@ static void mpu9250_mag_data(FAR struct mpu9250_sensor_s *priv, static int mpu9250_thread(int argc, FAR char **argv) { FAR struct mpu9250_dev_s *dev = (FAR struct mpu9250_dev_s *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + ((uintptr_t)strtoul(argv[1], NULL, 16)); FAR struct mpu9250_sensor_s *accel = &dev->priv[MPU9250_ACCEL_IDX]; FAR struct mpu9250_sensor_s *gyro = &dev->priv[MPU9250_GYRO_IDX]; FAR struct mpu9250_sensor_s *mag = &dev->priv[MPU9250_MAG_IDX]; @@ -2019,7 +2019,7 @@ int mpu9250_register(int devno, FAR struct mpu9250_config_s *config) /* Create thread for polling sensor data */ - snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)dev); + snprintf(arg1, 16, "%p", dev); argv[0] = arg1; argv[1] = NULL; diff --git a/drivers/sensors/ms5611.c b/drivers/sensors/ms5611.c index 8cd533931b..f722b24ff6 100644 --- a/drivers/sensors/ms5611.c +++ b/drivers/sensors/ms5611.c @@ -370,7 +370,7 @@ static inline void baro_measure_read(FAR struct ms5611_dev_s *priv, static int ms5611_thread(int argc, char **argv) { FAR struct ms5611_dev_s *priv = (FAR struct ms5611_dev_s *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + ((uintptr_t)strtoul(argv[1], NULL, 16)); struct sensor_baro baro_data; @@ -687,7 +687,7 @@ int ms5611_register(FAR struct i2c_master_s *i2c, int devno, uint8_t addr) /* Create thread for polling sensor data */ - snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)priv); + snprintf(arg1, 16, "%p", priv); argv[0] = arg1; argv[1] = NULL; ret = kthread_create("ms5611_thread", SCHED_PRIORITY_DEFAULT, diff --git a/drivers/sensors/wtgahrs2.c b/drivers/sensors/wtgahrs2.c index cbc53d55be..337ea9cb00 100644 --- a/drivers/sensors/wtgahrs2.c +++ b/drivers/sensors/wtgahrs2.c @@ -391,7 +391,7 @@ static bool wtgahrs2_process_data(FAR struct wtgahrs2_dev_s *rtdata, static int wtgahrs2_thread(int argc, FAR char *argv[]) { FAR struct wtgahrs2_dev_s *rtdata = (FAR struct wtgahrs2_dev_s *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + (uintptr_t)strtoul(argv[1], NULL, 16); unsigned char buffer[8 * WTGAHRS2_RSP_LENGTH]; ssize_t count = 0; ssize_t pos; @@ -542,7 +542,7 @@ int wtgahrs2_initialize(FAR const char *path, int devno) wtgahrs2_sendcmd(rtdata, g_wtgahrs2_enable_sensor); - snprintf(arg1, sizeof(arg1), "0x%" PRIxPTR, (uintptr_t)rtdata); + snprintf(arg1, sizeof(arg1), "%p", rtdata); argv[0] = arg1; argv[1] = NULL; diff --git a/sched/wqueue/kwork_thread.c b/sched/wqueue/kwork_thread.c index df80969f7f..d31792494b 100644 --- a/sched/wqueue/kwork_thread.c +++ b/sched/wqueue/kwork_thread.c @@ -131,7 +131,7 @@ static int work_thread(int argc, FAR char *argv[]) FAR void *arg; wqueue = (FAR struct kwork_wqueue_s *) - ((uintptr_t)strtoul(argv[1], NULL, 0)); + ((uintptr_t)strtoul(argv[1], NULL, 16)); flags = enter_critical_section(); @@ -217,7 +217,7 @@ static int work_thread_create(FAR const char *name, int priority, int wndx; int pid; - snprintf(args, sizeof(args), "0x%" PRIxPTR, (uintptr_t)wqueue); + snprintf(args, sizeof(args), "%p", wqueue); argv[0] = args; argv[1] = NULL;