You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2022/10/18 06:51:50 UTC

[incubator-nuttx] branch master updated: Remove the unnecessary cast for main_t, NULL and argv

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6b31918b42 Remove the unnecessary cast for main_t, NULL and argv
6b31918b42 is described below

commit 6b31918b429e6b2351bfa03f005704d123cb70e9
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Oct 16 01:48:35 2022 +0800

    Remove the unnecessary cast for main_t, NULL and argv
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/arm/src/c5471/c5471_irq.c                               |  2 +-
 arch/arm/src/lpc54xx/lpc54_ethernet.c                        |  2 +-
 arch/arm/src/max326xx/max32660/max32660_dma.c                |  2 +-
 arch/arm/src/rtl8720c/ameba_uart.c                           |  6 ++----
 arch/arm/src/sama5/sam_dmac.c                                |  2 +-
 arch/arm/src/sama5/sam_xdmac.c                               |  2 +-
 arch/arm/src/tiva/common/tiva_timerlib.c                     | 10 +++++-----
 arch/renesas/src/rx65n/rx65n_eth.c                           |  4 ++--
 arch/renesas/src/rx65n/rx65n_rspi.c                          | 12 ++++++------
 arch/risc-v/src/mpfs/mpfs_mm_init.c                          |  2 +-
 arch/risc-v/src/mpfs/mpfs_userspace.c                        |  2 +-
 arch/risc-v/src/qemu-rv/qemu_rv_mm_init.c                    |  2 +-
 arch/xtensa/src/esp32/esp32_himem.c                          |  6 +++---
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c           | 12 ++++++------
 boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c           |  2 +-
 boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c      |  2 +-
 boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c      |  2 +-
 boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c           |  2 +-
 boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c      |  2 +-
 boards/arm/imxrt/imxrt1064-evk/src/imxrt_usbhost.c           |  2 +-
 boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c         |  2 +-
 boards/arm/kinetis/freedom-k28f/src/k28_usbhshost.c          |  2 +-
 .../arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c  |  2 +-
 .../lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c  |  2 +-
 .../arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c   |  2 +-
 .../lpc4088-quickstart/kernel/lpc17_40_userspace.c           |  2 +-
 .../lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c   |  2 +-
 boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c        |  2 +-
 boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c            |  2 +-
 boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c       |  2 +-
 .../lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c    |  2 +-
 boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c |  2 +-
 boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c      |  2 +-
 .../arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c   |  2 +-
 boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c                |  2 +-
 boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c      |  2 +-
 boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c     |  2 +-
 boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c             |  2 +-
 boards/arm/sam34/sam4s-xplained-pro/src/sam_wdt.c            |  2 +-
 boards/arm/sama5/giant-board/src/sam_usb.c                   |  4 ++--
 boards/arm/sama5/sama5d2-xult/src/sam_usb.c                  |  4 ++--
 boards/arm/sama5/sama5d3-xplained/src/sam_usb.c              |  4 ++--
 boards/arm/sama5/sama5d3x-ek/src/sam_usb.c                   |  4 ++--
 boards/arm/sama5/sama5d4-ek/src/sam_usb.c                    |  4 ++--
 boards/arm/samd5e5/metro-m4/src/sam_usbhost.c                |  2 +-
 boards/arm/samv7/same70-qmtech/kernel/sam_userspace.c        |  2 +-
 boards/arm/samv7/same70-xplained/kernel/sam_userspace.c      |  2 +-
 boards/arm/samv7/samv71-xult/kernel/sam_userspace.c          |  2 +-
 boards/arm/stm32/axoloti/src/stm32_usbhost.c                 |  2 +-
 boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c     |  2 +-
 boards/arm/stm32/cloudctrl/src/stm32_usb.c                   |  2 +-
 boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c     |  2 +-
 boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c              |  2 +-
 boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c               |  2 +-
 boards/arm/stm32/nucleo-f412zg/src/stm32_usb.c               |  2 +-
 boards/arm/stm32/nucleo-f429zi/src/stm32_usb.c               |  2 +-
 boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c           |  2 +-
 boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c           |  2 +-
 boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c           |  2 +-
 boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c  |  2 +-
 boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c           |  2 +-
 boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c          |  2 +-
 boards/arm/stm32/omnibusf4/src/stm32_usb.c                   |  2 +-
 boards/arm/stm32/photon/src/stm32_wdt.c                      |  2 +-
 boards/arm/stm32/shenzhou/src/stm32_usb.c                    |  2 +-
 boards/arm/stm32/stm3220g-eval/src/stm32_usb.c               |  2 +-
 boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c      |  2 +-
 boards/arm/stm32/stm3240g-eval/src/stm32_usb.c               |  2 +-
 boards/arm/stm32/stm32f411-minimum/src/stm32_usb.c           |  2 +-
 boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c            |  2 +-
 boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c            |  2 +-
 boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c   |  2 +-
 boards/arm/stm32/stm32f4discovery/src/stm32_usb.c            |  2 +-
 boards/arm/stm32f7/nucleo-144/src/stm32_usb.c                |  2 +-
 boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c              |  2 +-
 boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c |  2 +-
 boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c |  2 +-
 boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c    |  2 +-
 boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c             |  2 +-
 boards/arm/stm32h7/nucleo-h743zi2/src/stm32_usb.c            |  2 +-
 boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c |  2 +-
 boards/arm/stm32h7/stm32h747i-disco/src/stm32_usb.c          |  2 +-
 boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c             |  2 +-
 .../arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c |  2 +-
 boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c         |  2 +-
 .../arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c |  2 +-
 boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c         |  2 +-
 boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c            |  2 +-
 boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c |  2 +-
 boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c          |  2 +-
 boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c       |  2 +-
 boards/renesas/rx65n/rx65n-grrose/src/rx65n_bringup.c        |  2 +-
 boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_bringup.c        |  2 +-
 boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c       |  2 +-
 .../risc-v/esp32c3/esp32c3-devkit/kernel/esp32c3_userspace.c |  2 +-
 boards/risc-v/k210/maix-bit/kernel/k210_userspace.c          |  2 +-
 boards/risc-v/mpfs/common/kernel/mpfs_userspace.c            |  2 +-
 boards/sparc/bm3803/xx3803/src/bm3803_wdt.c                  |  2 +-
 boards/xtensa/esp32/common/kernel/esp32_userspace.c          |  2 +-
 drivers/audio/cxd56.c                                        | 10 +++++-----
 drivers/net/slip.c                                           |  6 ++----
 drivers/usbhost/usbhost_hidkbd.c                             |  3 +--
 drivers/usbhost/usbhost_hidmouse.c                           |  3 +--
 drivers/usbhost/usbhost_xboxcontroller.c                     |  3 +--
 drivers/usbmonitor/usbmonitor.c                              |  3 +--
 drivers/video/vnc/vnc_fbdev.c                                |  2 +-
 fs/inode/fs_files.c                                          |  4 ++--
 include/semaphore.h                                          |  2 +-
 include/sys/socket.h                                         |  5 ++---
 libs/libc/misc/lib_envpath.c                                 | 10 +++++-----
 libs/libc/wqueue/work_usrthread.c                            |  3 +--
 sched/init/nx_bringup.c                                      |  6 +++---
 sched/wqueue/kwork_thread.c                                  |  2 +-
 113 files changed, 149 insertions(+), 159 deletions(-)

diff --git a/arch/arm/src/c5471/c5471_irq.c b/arch/arm/src/c5471/c5471_irq.c
index b7d92f85e6..a5258d3238 100644
--- a/arch/arm/src/c5471/c5471_irq.c
+++ b/arch/arm/src/c5471/c5471_irq.c
@@ -55,7 +55,7 @@ extern up_vector_t _svectors[];
 
 static up_vector_t g_vectorinittab[] =
 {
-  (up_vector_t)NULL,
+  NULL,
   arm_vectorundefinsn,
   arm_vectorsvc,
   arm_vectorprefetch,
diff --git a/arch/arm/src/lpc54xx/lpc54_ethernet.c b/arch/arm/src/lpc54xx/lpc54_ethernet.c
index f6cf4c082a..15c7cf1a05 100644
--- a/arch/arm/src/lpc54xx/lpc54_ethernet.c
+++ b/arch/arm/src/lpc54xx/lpc54_ethernet.c
@@ -606,7 +606,7 @@ static int lpc54_eth_transmit(struct lpc54_ethdriver_s *priv,
       /* Prepare the Tx descriptor for transmission */
 
       txdesc->buffer1 = (uint32_t)buffer;
-      txdesc->buffer2 = (uint32_t)NULL;
+      txdesc->buffer2 = 0;
 
       /* One buffer, no timestamp, interrupt on completion */
 
diff --git a/arch/arm/src/max326xx/max32660/max32660_dma.c b/arch/arm/src/max326xx/max32660/max32660_dma.c
index 6a8614e0e7..f51fa5dffd 100644
--- a/arch/arm/src/max326xx/max32660/max32660_dma.c
+++ b/arch/arm/src/max326xx/max32660/max32660_dma.c
@@ -283,7 +283,7 @@ DMA_HANDLE max326_dma_channel(void)
     }
 
   spin_unlock_irqrestore(NULL, flags);
-  return (DMA_HANDLE)NULL;
+  return NULL;
 }
 
 /****************************************************************************
diff --git a/arch/arm/src/rtl8720c/ameba_uart.c b/arch/arm/src/rtl8720c/ameba_uart.c
index 9a35513196..cc629f8bf7 100644
--- a/arch/arm/src/rtl8720c/ameba_uart.c
+++ b/arch/arm/src/rtl8720c/ameba_uart.c
@@ -684,10 +684,8 @@ static int ameba_attach(struct uart_dev_s *dev)
 static void ameba_detach(struct uart_dev_s *dev)
 {
   struct ameba_s *priv = (struct ameba_s *)dev->priv;
-  hal_uart_stubs.hal_uart_txtd_hook(&priv->adapter,
-                                    NULL, (uintptr_t)NULL, 0);
-  hal_uart_stubs.hal_uart_rxind_hook(&priv->adapter,
-                                     NULL, (uintptr_t)NULL, 0);
+  hal_uart_stubs.hal_uart_txtd_hook(&priv->adapter, NULL, 0, 0);
+  hal_uart_stubs.hal_uart_rxind_hook(&priv->adapter, NULL, 0, 0);
 }
 
 /****************************************************************************
diff --git a/arch/arm/src/sama5/sam_dmac.c b/arch/arm/src/sama5/sam_dmac.c
index fc972665ca..0f698494b8 100644
--- a/arch/arm/src/sama5/sam_dmac.c
+++ b/arch/arm/src/sama5/sam_dmac.c
@@ -1964,7 +1964,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags)
     {
       dmaerr("ERROR: Bad DMAC number: %d\n", dmacno);
       DEBUGPANIC();
-      return (DMA_HANDLE)NULL;
+      return NULL;
     }
 
   /* Search for an available DMA channel with at least the requested FIFO
diff --git a/arch/arm/src/sama5/sam_xdmac.c b/arch/arm/src/sama5/sam_xdmac.c
index 4ab5e8b014..d6d4f9baf8 100644
--- a/arch/arm/src/sama5/sam_xdmac.c
+++ b/arch/arm/src/sama5/sam_xdmac.c
@@ -2095,7 +2095,7 @@ DMA_HANDLE sam_dmachannel(uint8_t dmacno, uint32_t chflags)
     {
       dmaerr("ERROR: Bad XDMAC number: %d\n", dmacno);
       DEBUGPANIC();
-      return (DMA_HANDLE)NULL;
+      return NULL;
     }
 
   /* Search for an available DMA channel with at least the requested FIFO
diff --git a/arch/arm/src/tiva/common/tiva_timerlib.c b/arch/arm/src/tiva/common/tiva_timerlib.c
index c0814cf69c..a520332939 100644
--- a/arch/arm/src/tiva/common/tiva_timerlib.c
+++ b/arch/arm/src/tiva/common/tiva_timerlib.c
@@ -1909,7 +1909,7 @@ TIMER_HANDLE tiva_gptm_configure(const struct tiva_gptmconfig_s *config)
 #endif
 
     default:
-      return (TIMER_HANDLE)NULL;
+      return NULL;
     }
 
   /* Initialize the state structure */
@@ -1989,7 +1989,7 @@ TIMER_HANDLE tiva_gptm_configure(const struct tiva_gptmconfig_s *config)
 #else
       tmrinfo("tiva_gptm_configure:");
       tmrinfo(" Error: alternate clock only available on TM4C129 devices\n");
-      return (TIMER_HANDLE)NULL;
+      return NULL;
 #endif /* CONFIG_ARCH_CHIP_TM4C129 */
     }
   else
@@ -2019,7 +2019,7 @@ TIMER_HANDLE tiva_gptm_configure(const struct tiva_gptmconfig_s *config)
           ret = tiva_timer32_configure(priv, &config32->config);
         }
 #else
-       return (TIMER_HANDLE)NULL;
+       return NULL;
 #endif
     }
   else
@@ -2061,13 +2061,13 @@ TIMER_HANDLE tiva_gptm_configure(const struct tiva_gptmconfig_s *config)
                                        TIMER16B);
         }
 #else
-       return (TIMER_HANDLE)NULL;
+       return NULL;
 #endif
     }
 
   /* Return the timer handler if successfully configured */
 
-  return ret < 0 ? (TIMER_HANDLE)NULL : (TIMER_HANDLE)priv;
+  return ret < 0 ? NULL : (TIMER_HANDLE)priv;
 }
 
 /****************************************************************************
diff --git a/arch/renesas/src/rx65n/rx65n_eth.c b/arch/renesas/src/rx65n/rx65n_eth.c
index 0c207ea192..2249dde644 100644
--- a/arch/renesas/src/rx65n/rx65n_eth.c
+++ b/arch/renesas/src/rx65n/rx65n_eth.c
@@ -1886,8 +1886,8 @@ static void rx65n_interrupt_work(FAR void *arg)
 
           if (phylinknotification.phandler != NULL)
             {
-              phylinknotification.phandler(irqno, (FAR void *)NULL,
-              (FAR void *)phylinknotification.pclient);
+              phylinknotification.phandler(irqno, NULL,
+                                           phylinknotification.pclient);
               priv->prevlinkstatus = regval;
             }
         }
diff --git a/arch/renesas/src/rx65n/rx65n_rspi.c b/arch/renesas/src/rx65n/rx65n_rspi.c
index cc6463b14a..5c43b3e7c8 100644
--- a/arch/renesas/src/rx65n/rx65n_rspi.c
+++ b/arch/renesas/src/rx65n/rx65n_rspi.c
@@ -457,9 +457,9 @@ dtc_static_transfer_data_cfg_t tx_cfg =
   .response_interrupt = DTC_INTERRUPT_AFTER_ALL_COMPLETE,
   .repeat_block_side = DTC_REPEAT_BLOCK_DESTINATION,
   .dest_addr_mode = DTC_DES_ADDR_FIXED,
-  .source_addr = (uint32_t)NULL, /* This will set dynamically */
-  .dest_addr = (uint32_t)NULL,   /* Set data register address */
-  .transfer_count = 0,           /* This will set dynamically */
+  .source_addr = 0,    /* This will set dynamically */
+  .dest_addr = 0,      /* Set data register address */
+  .transfer_count = 0, /* This will set dynamically */
 #if CONFIG_RX65N_RSPI_BUF_SIZE > 1
   .block_size = CONFIG_RX65N_RSPI_BUF_SIZE, /* Looks like tx fifo size */
 #else
@@ -486,9 +486,9 @@ dtc_static_transfer_data_cfg_t rx_cfg =
   .response_interrupt = DTC_INTERRUPT_AFTER_ALL_COMPLETE,
   .repeat_block_side = DTC_REPEAT_BLOCK_SOURCE,
   .dest_addr_mode = DTC_DES_ADDR_INCR,
-  .source_addr = (uint32_t)NULL,            /* Set data register address */
-  .dest_addr = (uint32_t)NULL,              /* This will set dynamically */
-  .transfer_count = 0,                      /* This will set dynamically */
+  .source_addr = 0,            /* Set data register address */
+  .dest_addr = 0,              /* This will set dynamically */
+  .transfer_count = 0,         /* This will set dynamically */
 #if CONFIG_RX65N_RSPI_BUF_SIZE > 1
   .block_size = CONFIG_RX65N_RSPI_BUF_SIZE, /* Looks like tx fifo size */
 #else
diff --git a/arch/risc-v/src/mpfs/mpfs_mm_init.c b/arch/risc-v/src/mpfs/mpfs_mm_init.c
index 7100178455..7737f3be3d 100644
--- a/arch/risc-v/src/mpfs/mpfs_mm_init.c
+++ b/arch/risc-v/src/mpfs/mpfs_mm_init.c
@@ -136,7 +136,7 @@ static void slab_init(uintptr_t start)
 static uintptr_t slab_alloc(void)
 {
   pgalloc_slab_t *slab = (pgalloc_slab_t *)sq_remfirst(&g_free_slabs);
-  return slab ? (uintptr_t)slab->memory : (uintptr_t)NULL;
+  return slab ? (uintptr_t)slab->memory : 0;
 }
 
 /****************************************************************************
diff --git a/arch/risc-v/src/mpfs/mpfs_userspace.c b/arch/risc-v/src/mpfs/mpfs_userspace.c
index 95950c1b4a..a4409e2dcb 100644
--- a/arch/risc-v/src/mpfs/mpfs_userspace.c
+++ b/arch/risc-v/src/mpfs/mpfs_userspace.c
@@ -293,7 +293,7 @@ static void slab_init(uintptr_t start)
 static uintptr_t slab_alloc(void)
 {
   pgalloc_slab_t *slab = (pgalloc_slab_t *)sq_remfirst(&g_free_slabs);
-  return slab ? (uintptr_t)slab->memory : (uintptr_t)NULL;
+  return slab ? (uintptr_t)slab->memory : 0;
 }
 
 /****************************************************************************
diff --git a/arch/risc-v/src/qemu-rv/qemu_rv_mm_init.c b/arch/risc-v/src/qemu-rv/qemu_rv_mm_init.c
index 5b4d35cd55..cdf32365ef 100644
--- a/arch/risc-v/src/qemu-rv/qemu_rv_mm_init.c
+++ b/arch/risc-v/src/qemu-rv/qemu_rv_mm_init.c
@@ -131,7 +131,7 @@ static void slab_init(uintptr_t start)
 static uintptr_t slab_alloc(void)
 {
   pgalloc_slab_t *slab = (pgalloc_slab_t *)sq_remfirst(&g_free_slabs);
-  return slab ? (uintptr_t)slab->memory : (uintptr_t)NULL;
+  return slab ? (uintptr_t)slab->memory : 0;
 }
 
 /****************************************************************************
diff --git a/arch/xtensa/src/esp32/esp32_himem.c b/arch/xtensa/src/esp32/esp32_himem.c
index 7559444880..31ba7fab6f 100644
--- a/arch/xtensa/src/esp32/esp32_himem.c
+++ b/arch/xtensa/src/esp32/esp32_himem.c
@@ -233,14 +233,14 @@ int esp_himem_init(void)
 
   /* Looks weird; last arg is empty so it expands to 'return ;' */
 
-  HIMEM_CHECK(g_ram_descriptor != NULL, "already initialized", (int) NULL);
+  HIMEM_CHECK(g_ram_descriptor != NULL, "already initialized", 0);
 
-  HIMEM_CHECK(g_range_descriptor != NULL, "already initialized", (int) NULL);
+  HIMEM_CHECK(g_range_descriptor != NULL, "already initialized", 0);
 
   /* need to have some reserved banks */
 
   HIMEM_CHECK(SPIRAM_BANKSWITCH_RESERVE == 0, "No banks reserved for \
-              himem", (int) NULL);
+              himem", 0);
 
   /* Start and end of physical reserved memory. Note it starts slightly under
    * the 4MiB mark as the reserved banks can't have an unity mapping to be
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c
index 421a7b5b22..7c6c1e1074 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c
@@ -621,7 +621,7 @@ void get_pwon_out_param(as_aca_pulco_out_param_t *param)
 
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void)
 {
-  if (fw_as_acacontrol(AS_ACA_CHECK_ID, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(AS_ACA_CHECK_ID, 0) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_CHKID;
     }
@@ -647,7 +647,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void)
 
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void)
 {
-  if (fw_as_acacontrol(AS_ACA_POWER_OFF_COMMON, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(AS_ACA_POWER_OFF_COMMON, 0) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_PWOFF;
     }
@@ -657,7 +657,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void)
 
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_micbias(void)
 {
-  if (fw_as_acacontrol(AS_ACA_POWER_ON_MICBIAS, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(AS_ACA_POWER_ON_MICBIAS, 0) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_PWON_MBIAS;
     }
@@ -712,7 +712,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void)
 
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void)
 {
-  if (fw_as_acacontrol(AS_ACA_POWER_OFF_INPUT, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(AS_ACA_POWER_OFF_INPUT, 0) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_PWOFF_INPUT;
     }
@@ -722,7 +722,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void)
 
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_output(void)
 {
-  if (fw_as_acacontrol(AS_ACA_POWER_OFF_OUTPUT, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(AS_ACA_POWER_OFF_OUTPUT, 0) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_PWOFF_OUTPUT;
     }
@@ -769,7 +769,7 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(
 
 CXD56_AUDIO_ECODE cxd56_audio_aca_notify_micbootdone(void)
 {
-  if (fw_as_acacontrol(AS_ACA_SET_AMIC_BOOT_DONE, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(AS_ACA_SET_AMIC_BOOT_DONE, 0) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_NOTIFY_MICBOOT;
     }
diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c
index 563984ace1..eb878bde66 100644
--- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c
+++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c
@@ -206,7 +206,7 @@ int imxrt_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
                        CONFIG_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c b/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c
index 61dfd3d195..8f89166dd3 100644
--- a/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c
+++ b/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c b/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c
index ab9c97deea..83407a4053 100644
--- a/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c
+++ b/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c
index 21a7c89a60..3b6fe08e61 100644
--- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c
+++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c
@@ -204,7 +204,7 @@ int imxrt_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
                        CONFIG_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c b/boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c
index 5ad42d2672..4193f03be0 100644
--- a/boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c
+++ b/boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_usbhost.c b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_usbhost.c
index 37094e18a3..d1fc7a4737 100644
--- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_usbhost.c
+++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_usbhost.c
@@ -204,7 +204,7 @@ int imxrt_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
                        CONFIG_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c b/boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c
index 7c00b5a008..ebae176799 100644
--- a/boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c
+++ b/boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_usbhshost.c b/boards/arm/kinetis/freedom-k28f/src/k28_usbhshost.c
index adb084f8af..a08f5fefc6 100644
--- a/boards/arm/kinetis/freedom-k28f/src/k28_usbhshost.c
+++ b/boards/arm/kinetis/freedom-k28f/src/k28_usbhshost.c
@@ -480,7 +480,7 @@ int k28_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
                        CONFIG_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c b/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c
index 29fd12614f..7cd61a15cb 100644
--- a/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c
+++ b/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c
index d2e7588556..32c9a6cb1a 100644
--- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c
+++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c
index 910bf987d8..93aeccf84a 100644
--- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c
+++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c
@@ -303,7 +303,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c
index 162c8c62e2..cc7dc0496d 100644
--- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c
+++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c
index 75d900d1b4..b8f95cc923 100644
--- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c
+++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c
@@ -339,7 +339,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c
index 4c5787b2b1..076f2f1141 100644
--- a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c
+++ b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_bringup.c
@@ -338,7 +338,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c
index 7405f3de86..f0840073fb 100644
--- a/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c
+++ b/boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_nsh.c
@@ -336,7 +336,7 @@ static int nsh_usbhostinitialize(void)
 
       pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                         CONFIG_USBHOST_STACKSIZE,
-                        (main_t)nsh_waiter, (char * const *)NULL);
+                        nsh_waiter, NULL);
       return pid < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c
index 1dfa83bd7e..bc175ef906 100644
--- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c
+++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c
@@ -295,7 +295,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_MCB1700_USBHOST_PRIO,
                            CONFIG_MCB1700_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c
index abe85424ab..9562d2422a 100644
--- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c
+++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c
@@ -314,7 +314,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_LPC1766STK_USBHOST_PRIO,
                            CONFIG_LPC1766STK_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c
index 968d0fa06d..5232a63fe5 100644
--- a/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c
+++ b/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c
index 158b091183..63688f8aa0 100644
--- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c
+++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c
@@ -338,7 +338,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c
index 1a6a6ff233..e540c3b5dc 100644
--- a/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c
+++ b/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c b/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c
index 7d714b9ae9..f8066e0a81 100644
--- a/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c
+++ b/boards/arm/lpc31xx/ea3131/src/lpc31_usbhost.c
@@ -219,7 +219,7 @@ int lpc31_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO,
                        CONFIG_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c
index 6d4eb745cf..e26125876d 100644
--- a/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c
+++ b/boards/arm/lpc31xx/olimex-lpc-h3131/src/lpc31_usbhost.c
@@ -219,7 +219,7 @@ int lpc31_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_USBHOST_DEFPRIO, i
                        CONFIG_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c b/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c
index 9fa5146fce..44ea610425 100644
--- a/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c
+++ b/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c b/boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c
index b41706aa9b..e6176e2b20 100644
--- a/boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c
+++ b/boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/sam34/sam4s-xplained-pro/src/sam_wdt.c b/boards/arm/sam34/sam4s-xplained-pro/src/sam_wdt.c
index f6952e95b5..3c45f823ed 100644
--- a/boards/arm/sam34/sam4s-xplained-pro/src/sam_wdt.c
+++ b/boards/arm/sam34/sam4s-xplained-pro/src/sam_wdt.c
@@ -188,7 +188,7 @@ int sam_watchdog_initialize(void)
   int taskid = kthread_create(CONFIG_WDT_THREAD_NAME,
                               CONFIG_WDT_THREAD_PRIORITY,
                               CONFIG_WDT_THREAD_STACKSIZE,
-                              (main_t)wdog_daemon, (char * const *)NULL);
+                              wdog_daemon, NULL);
 
   DEBUGASSERT(taskid > 0);
   UNUSED(taskid);
diff --git a/boards/arm/sama5/giant-board/src/sam_usb.c b/boards/arm/sama5/giant-board/src/sam_usb.c
index f02a54e30c..7265099b14 100644
--- a/boards/arm/sama5/giant-board/src/sam_usb.c
+++ b/boards/arm/sama5/giant-board/src/sam_usb.c
@@ -293,7 +293,7 @@ int sam_usbhost_initialize(void)
   ret = kthread_create("OHCI Monitor",
                        CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_PRIO,
                        CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_STACKSIZE,
-                       (main_t)ohci_waiter, (char * const *)NULL);
+                       ohci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
@@ -316,7 +316,7 @@ int sam_usbhost_initialize(void)
   ret = kthread_create("EHCI Monitor",
                        CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_PRIO,
                        CONFIG_SAMA5D27_GIANT_BOARD_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/sama5/sama5d2-xult/src/sam_usb.c b/boards/arm/sama5/sama5d2-xult/src/sam_usb.c
index 5f47460ab6..078017aa6c 100644
--- a/boards/arm/sama5/sama5d2-xult/src/sam_usb.c
+++ b/boards/arm/sama5/sama5d2-xult/src/sam_usb.c
@@ -340,7 +340,7 @@ int sam_usbhost_initialize(void)
 
   ret = kthread_create("OHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO,
                        CONFIG_SAMA5D2XULT_USBHOST_STACKSIZE,
-                       (main_t)ohci_waiter, (char * const *)NULL);
+                       ohci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
@@ -362,7 +362,7 @@ int sam_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D2XULT_USBHOST_PRIO,
                        CONFIG_SAMA5D2XULT_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c b/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c
index 870ed8b705..f15c79a1d8 100644
--- a/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c
+++ b/boards/arm/sama5/sama5d3-xplained/src/sam_usb.c
@@ -348,7 +348,7 @@ int sam_usbhost_initialize(void)
 
   ret = kthread_create("OHCI Monitor", CONFIG_SAMA5D3XPLAINED_USBHOST_PRIO,
                        CONFIG_SAMA5D3XPLAINED_USBHOST_STACKSIZE,
-                       (main_t)ohci_waiter, (char * const *)NULL);
+                       ohci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
@@ -370,7 +370,7 @@ int sam_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D3XPLAINED_USBHOST_PRIO,
                        CONFIG_SAMA5D3XPLAINED_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_usb.c b/boards/arm/sama5/sama5d3x-ek/src/sam_usb.c
index 3dcff48672..b1eb7e989e 100644
--- a/boards/arm/sama5/sama5d3x-ek/src/sam_usb.c
+++ b/boards/arm/sama5/sama5d3x-ek/src/sam_usb.c
@@ -347,7 +347,7 @@ int sam_usbhost_initialize(void)
   ret = kthread_create("OHCI Monitor",
                       CONFIG_SAMA5D3XEK_USBHOST_PRIO,
                       CONFIG_SAMA5D3XEK_USBHOST_STACKSIZE,
-                      (main_t)ohci_waiter, (char * const *)NULL);
+                      ohci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
@@ -369,7 +369,7 @@ int sam_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D3XEK_USBHOST_PRIO,
                        CONFIG_SAMA5D3XEK_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_usb.c b/boards/arm/sama5/sama5d4-ek/src/sam_usb.c
index 2a38275b35..46ba8cc031 100644
--- a/boards/arm/sama5/sama5d4-ek/src/sam_usb.c
+++ b/boards/arm/sama5/sama5d4-ek/src/sam_usb.c
@@ -346,7 +346,7 @@ int sam_usbhost_initialize(void)
 
   ret = kthread_create("OHCI Monitor", CONFIG_SAMA5D4EK_USBHOST_PRIO,
                        CONFIG_SAMA5D4EK_USBHOST_STACKSIZE,
-                       (main_t)ohci_waiter, (char * const *)NULL);
+                       ohci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ohci_waiter task: %d\n", ret);
@@ -368,7 +368,7 @@ int sam_usbhost_initialize(void)
 
   ret = kthread_create("EHCI Monitor", CONFIG_SAMA5D4EK_USBHOST_PRIO,
                        CONFIG_SAMA5D4EK_USBHOST_STACKSIZE,
-                       (main_t)ehci_waiter, (char * const *)NULL);
+                       ehci_waiter, NULL);
   if (ret < 0)
     {
       uerr("ERROR: Failed to create ehci_waiter task: %d\n", ret);
diff --git a/boards/arm/samd5e5/metro-m4/src/sam_usbhost.c b/boards/arm/samd5e5/metro-m4/src/sam_usbhost.c
index 796249b841..b7bd9e4ca4 100644
--- a/boards/arm/samd5e5/metro-m4/src/sam_usbhost.c
+++ b/boards/arm/samd5e5/metro-m4/src/sam_usbhost.c
@@ -220,7 +220,7 @@ int samd_usbhost_initialize(void)
       uinfo("Start usbhost_waiter\n");
       ret = kthread_create("usbhost", CONFIG_METRO_M4_USBHOST_PRIO,
                            CONFIG_METRO_M4_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char *const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/samv7/same70-qmtech/kernel/sam_userspace.c b/boards/arm/samv7/same70-qmtech/kernel/sam_userspace.c
index 27fa4d62c2..24e8f62b00 100644
--- a/boards/arm/samv7/same70-qmtech/kernel/sam_userspace.c
+++ b/boards/arm/samv7/same70-qmtech/kernel/sam_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c b/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c
index 453a51552c..3d9ec313ed 100644
--- a/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c
+++ b/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c b/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c
index 071d43f071..58af2e3c04 100644
--- a/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c
+++ b/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32/axoloti/src/stm32_usbhost.c b/boards/arm/stm32/axoloti/src/stm32_usbhost.c
index 10447bcff8..a358f3dcf3 100644
--- a/boards/arm/stm32/axoloti/src/stm32_usbhost.c
+++ b/boards/arm/stm32/axoloti/src/stm32_usbhost.c
@@ -252,7 +252,7 @@ int stm32_usbhost_initialize(void)
       uinfo("Start usbhost_waiter\n");
       ret = kthread_create("usbhost", CONFIG_AXOLOTI_USBHOST_PRIO,
                            CONFIG_AXOLOTI_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char *const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c b/boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c
index 953cfac774..cbfb7bb245 100644
--- a/boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c
+++ b/boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32/cloudctrl/src/stm32_usb.c b/boards/arm/stm32/cloudctrl/src/stm32_usb.c
index 66d4d249aa..524b1aaf69 100644
--- a/boards/arm/stm32/cloudctrl/src/stm32_usb.c
+++ b/boards/arm/stm32/cloudctrl/src/stm32_usb.c
@@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c b/boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c
index 3e4a1b23cc..9fa444c201 100644
--- a/boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c
+++ b/boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c b/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c
index f4d41f955a..4bb0455f91 100644
--- a/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c
+++ b/boards/arm/stm32/mikroe-stm32f4/src/stm32_usb.c
@@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c b/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c
index 4a51c56064..454f2b6202 100644
--- a/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c
+++ b/boards/arm/stm32/nucleo-f207zg/src/stm32_usb.c
@@ -227,7 +227,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_NUCLEOF207ZG_USBHOST_PRIO,
                            CONFIG_NUCLEOF207ZG_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/nucleo-f412zg/src/stm32_usb.c b/boards/arm/stm32/nucleo-f412zg/src/stm32_usb.c
index c418692f4e..1d2e7ee021 100644
--- a/boards/arm/stm32/nucleo-f412zg/src/stm32_usb.c
+++ b/boards/arm/stm32/nucleo-f412zg/src/stm32_usb.c
@@ -250,7 +250,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F411DISCO_USBHOST_PRIO,
                            CONFIG_STM32F411DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/nucleo-f429zi/src/stm32_usb.c b/boards/arm/stm32/nucleo-f429zi/src/stm32_usb.c
index 581cc87730..c8956e4c94 100644
--- a/boards/arm/stm32/nucleo-f429zi/src/stm32_usb.c
+++ b/boards/arm/stm32/nucleo-f429zi/src/stm32_usb.c
@@ -226,7 +226,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
                            CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c
index 205684d95b..8b83374bcd 100644
--- a/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c
+++ b/boards/arm/stm32/olimex-stm32-e407/src/stm32_usb.c
@@ -225,7 +225,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
                            CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c
index 6cc9d44759..8bfac1b672 100644
--- a/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c
+++ b/boards/arm/stm32/olimex-stm32-h407/src/stm32_usb.c
@@ -207,7 +207,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32H407_USBHOST_PRIO,
                            CONFIG_STM32H407_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c
index dc12d9f096..f4d2f25cb7 100644
--- a/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c
+++ b/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c
@@ -209,7 +209,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c b/boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c
index 2856b0151a..3f9664e835 100644
--- a/boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c
+++ b/boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c
index 28d5b89bff..11e27ab21e 100644
--- a/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c
+++ b/boards/arm/stm32/olimex-stm32-p407/src/stm32_usb.c
@@ -226,7 +226,7 @@ int stm32_usbhost_setup(void)
 
       ret = kthread_create("usbhost", CONFIG_OLIMEXP407_USBHOST_PRIO,
                            CONFIG_OLIMEXP407_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c b/boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c
index 2b88f43447..0566046a36 100644
--- a/boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c
+++ b/boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32/omnibusf4/src/stm32_usb.c b/boards/arm/stm32/omnibusf4/src/stm32_usb.c
index 2b34031e2e..0f04ec0e7b 100644
--- a/boards/arm/stm32/omnibusf4/src/stm32_usb.c
+++ b/boards/arm/stm32/omnibusf4/src/stm32_usb.c
@@ -234,7 +234,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_OMNIBUSF4_USBHOST_PRIO,
                            CONFIG_OMNIBUSF4_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/photon/src/stm32_wdt.c b/boards/arm/stm32/photon/src/stm32_wdt.c
index 64c3e292b8..e203cf3ce3 100644
--- a/boards/arm/stm32/photon/src/stm32_wdt.c
+++ b/boards/arm/stm32/photon/src/stm32_wdt.c
@@ -146,7 +146,7 @@ int photon_watchdog_initialize(void)
   int taskid = kthread_create(CONFIG_PHOTON_WDG_THREAD_NAME,
                               CONFIG_PHOTON_WDG_THREAD_PRIORITY,
                               CONFIG_PHOTON_WDG_THREAD_STACKSIZE,
-                              (main_t)wdog_daemon, (char * const *)NULL);
+                              wdog_daemon, NULL);
 
   if (taskid <= 0)
     {
diff --git a/boards/arm/stm32/shenzhou/src/stm32_usb.c b/boards/arm/stm32/shenzhou/src/stm32_usb.c
index fd31e732fe..408209291a 100644
--- a/boards/arm/stm32/shenzhou/src/stm32_usb.c
+++ b/boards/arm/stm32/shenzhou/src/stm32_usb.c
@@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c b/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c
index a960e621b0..8c4aa3f123 100644
--- a/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c
+++ b/boards/arm/stm32/stm3220g-eval/src/stm32_usb.c
@@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c b/boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c
index 4147c7422f..95772dfab7 100644
--- a/boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c
+++ b/boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c
@@ -64,7 +64,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c b/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c
index 8bca690e8f..817845a855 100644
--- a/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c
+++ b/boards/arm/stm32/stm3240g-eval/src/stm32_usb.c
@@ -200,7 +200,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/stm32f411-minimum/src/stm32_usb.c b/boards/arm/stm32/stm32f411-minimum/src/stm32_usb.c
index 0583cfb69f..29a0679131 100644
--- a/boards/arm/stm32/stm32f411-minimum/src/stm32_usb.c
+++ b/boards/arm/stm32/stm32f411-minimum/src/stm32_usb.c
@@ -232,7 +232,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F411MINIMUM_USBHOST_PRIO,
                            CONFIG_STM32F411MINIMUM_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c b/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c
index 8a6f7e899a..ad440ba823 100644
--- a/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c
+++ b/boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c
@@ -251,7 +251,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F411DISCO_USBHOST_PRIO,
                            CONFIG_STM32F411DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c
index 5f82cbea41..1ed3786d08 100644
--- a/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c
+++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_usb.c
@@ -206,7 +206,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F429IDISCO_USBHOST_PRIO,
                            CONFIG_STM32F429IDISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c b/boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c
index b8c241943e..44d721f088 100644
--- a/boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c
+++ b/boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c b/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c
index 7b8c718060..c153b2f6cb 100644
--- a/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c
+++ b/boards/arm/stm32/stm32f4discovery/src/stm32_usb.c
@@ -236,7 +236,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
                            CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c b/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c
index 05c69ba758..73e449b23a 100644
--- a/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c
+++ b/boards/arm/stm32f7/nucleo-144/src/stm32_usb.c
@@ -227,7 +227,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_NUCLEO144_USBHOST_PRIO,
                            CONFIG_NUCLEO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c b/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c
index 07ff019781..a55cb668ab 100644
--- a/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c
+++ b/boards/arm/stm32f7/stm32f746-ws/src/stm32_usb.c
@@ -229,7 +229,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F7F4DISCO_USBHOST_PRIO,
                         CONFIG_STM32F7F4DISCO_USBHOST_STACKSIZE,
-                        (main_t)usbhost_waiter, (char * const *)NULL);
+                        usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c b/boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c
index 9eb9f3bbae..75fe750365 100644
--- a/boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c
+++ b/boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c b/boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c
index c3e0fccc7a..7057d0e42e 100644
--- a/boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c
+++ b/boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c b/boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c
index 1f42751360..9934ce63b3 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c
+++ b/boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c
index 70b1b4a5f2..f03d70220b 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c
+++ b/boards/arm/stm32h7/nucleo-h743zi/src/stm32_usb.c
@@ -227,7 +227,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_NUCLEOH743ZI_USBHOST_PRIO,
                            CONFIG_NUCLEOH743ZI_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_usb.c b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_usb.c
index a6acd582e2..3b36e13929 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_usb.c
+++ b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_usb.c
@@ -227,7 +227,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c b/boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
index d4859c2bec..10a86cb3dc 100644
--- a/boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+++ b/boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32h7/stm32h747i-disco/src/stm32_usb.c b/boards/arm/stm32h7/stm32h747i-disco/src/stm32_usb.c
index 384f6c3d8e..d5a2adf04c 100644
--- a/boards/arm/stm32h7/stm32h747i-disco/src/stm32_usb.c
+++ b/boards/arm/stm32h7/stm32h747i-disco/src/stm32_usb.c
@@ -218,7 +218,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32H747XI_DISCO_USBHOST_PRIO,
                            CONFIG_STM32H747XI_DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c
index ce416b05a5..a3c4a7cf5f 100644
--- a/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c
+++ b/boards/arm/stm32l4/nucleo-l496zg/src/stm32_usb.c
@@ -227,7 +227,7 @@ int stm32_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32F4DISCO_USBHOST_PRIO,
                            CONFIG_STM32F4DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c b/boards/arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c
index 834810ff38..a57f31f8cf 100644
--- a/boards/arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c
+++ b/boards/arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c
index e01217601a..1f2bd0c680 100644
--- a/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c
+++ b/boards/arm/stm32l4/stm32l476vg-disco/src/stm32_usb.c
@@ -226,7 +226,7 @@ int stm32l4_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32L4DISCO_USBHOST_PRIO,
                            CONFIG_STM32L4DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c b/boards/arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c
index ba5d1e22ae..f67fc9669b 100644
--- a/boards/arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c
+++ b/boards/arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c
index 0dd8d272a6..6328d5493d 100644
--- a/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c
+++ b/boards/arm/stm32l4/stm32l4r9ai-disco/src/stm32_usb.c
@@ -226,7 +226,7 @@ int stm32l4_usbhost_initialize(void)
 
       ret = kthread_create("usbhost", CONFIG_STM32L4DISCO_USBHOST_PRIO,
                            CONFIG_STM32L4DISCO_USBHOST_STACKSIZE,
-                           (main_t)usbhost_waiter, (char * const *)NULL);
+                           usbhost_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c b/boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c
index 6bdc4093dd..18185bbd45 100644
--- a/boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c
+++ b/boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c b/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c
index 7d5dcdf0c1..5187ebb753 100644
--- a/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c
+++ b/boards/mips/pic32mx/pic32mx-starterkit/src/pic32mx_appinit.c
@@ -302,7 +302,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c
index 024a04bea5..f49a53007a 100644
--- a/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c
+++ b/boards/mips/pic32mx/pic32mx7mmb/src/pic32_bringup.c
@@ -315,7 +315,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c
index 3b75010daa..ac75651260 100644
--- a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c
+++ b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_appinit.c
@@ -315,7 +315,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (char * const *)NULL);
+                           nsh_waiter, NULL);
       return ret < 0 ? -ENOEXEC : OK;
     }
 
diff --git a/boards/renesas/rx65n/rx65n-grrose/src/rx65n_bringup.c b/boards/renesas/rx65n/rx65n-grrose/src/rx65n_bringup.c
index 88c7021203..ddca367e4f 100644
--- a/boards/renesas/rx65n/rx65n-grrose/src/rx65n_bringup.c
+++ b/boards/renesas/rx65n/rx65n-grrose/src/rx65n_bringup.c
@@ -211,7 +211,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (FAR char * const *)NULL);
+                           nsh_waiter, NULL);
       syslog(LOG_INFO, "USBHost: Created pid = %d\n", ret);
       return ret < 0 ? -ENOEXEC : OK;
     }
diff --git a/boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_bringup.c b/boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_bringup.c
index aaff33d9ad..d797b9ccd5 100644
--- a/boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_bringup.c
+++ b/boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_bringup.c
@@ -210,7 +210,7 @@ static int nsh_usbhostinitialize(void)
 
       ret = kthread_create("usbhost", CONFIG_USBHOST_DEFPRIO,
                            CONFIG_USBHOST_STACKSIZE,
-                           (main_t)nsh_waiter, (FAR char * const *)NULL);
+                           nsh_waiter, NULL);
       syslog(LOG_INFO, "USBHost: Created pid = %d\n", ret);
       return ret < 0 ? -ENOEXEC : OK;
     }
diff --git a/boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c b/boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c
index a1a92eb12c..a39c074a77 100644
--- a/boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c
+++ b/boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c
@@ -67,7 +67,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/kernel/esp32c3_userspace.c b/boards/risc-v/esp32c3/esp32c3-devkit/kernel/esp32c3_userspace.c
index 3c7e1dc9f5..837c8c7d5d 100644
--- a/boards/risc-v/esp32c3/esp32c3-devkit/kernel/esp32c3_userspace.c
+++ b/boards/risc-v/esp32c3/esp32c3-devkit/kernel/esp32c3_userspace.c
@@ -63,7 +63,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/risc-v/k210/maix-bit/kernel/k210_userspace.c b/boards/risc-v/k210/maix-bit/kernel/k210_userspace.c
index 3476ad6335..3b190952b4 100644
--- a/boards/risc-v/k210/maix-bit/kernel/k210_userspace.c
+++ b/boards/risc-v/k210/maix-bit/kernel/k210_userspace.c
@@ -65,7 +65,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/risc-v/mpfs/common/kernel/mpfs_userspace.c b/boards/risc-v/mpfs/common/kernel/mpfs_userspace.c
index 213b12662f..af81b1a5c9 100644
--- a/boards/risc-v/mpfs/common/kernel/mpfs_userspace.c
+++ b/boards/risc-v/mpfs/common/kernel/mpfs_userspace.c
@@ -63,7 +63,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/boards/sparc/bm3803/xx3803/src/bm3803_wdt.c b/boards/sparc/bm3803/xx3803/src/bm3803_wdt.c
index b51d185f1e..39bf3c32ee 100644
--- a/boards/sparc/bm3803/xx3803/src/bm3803_wdt.c
+++ b/boards/sparc/bm3803/xx3803/src/bm3803_wdt.c
@@ -149,7 +149,7 @@ int xx3803_watchdog_initialize(void)
   int taskid = kthread_create(CONFIG_XX3803_WDG_THREAD_NAME,
                               CONFIG_XX3803_WDG_THREAD_PRIORITY,
                               CONFIG_XX3803_WDG_THREAD_STACKSIZE,
-                              (main_t)wdog_daemon, (char * const *)NULL);
+                              wdog_daemon, NULL);
 
   DEBUGASSERT(taskid > 0);
   UNUSED(taskid);
diff --git a/boards/xtensa/esp32/common/kernel/esp32_userspace.c b/boards/xtensa/esp32/common/kernel/esp32_userspace.c
index 35ef9513e6..d477bd99fd 100644
--- a/boards/xtensa/esp32/common/kernel/esp32_userspace.c
+++ b/boards/xtensa/esp32/common/kernel/esp32_userspace.c
@@ -63,7 +63,7 @@ const struct userspace_s userspace locate_data(".userspace") =
 {
   /* General memory map */
 
-  .us_entrypoint    = (main_t)CONFIG_INIT_ENTRYPOINT,
+  .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   .us_textstart     = (uintptr_t)_stext,
   .us_textend       = (uintptr_t)_etext,
   .us_datasource    = (uintptr_t)_eronly,
diff --git a/drivers/audio/cxd56.c b/drivers/audio/cxd56.c
index 2f27645a4e..3e7961b01a 100644
--- a/drivers/audio/cxd56.c
+++ b/drivers/audio/cxd56.c
@@ -1819,7 +1819,7 @@ static int cxd56_power_on_aca(uint32_t samplerate)
   uint8_t mic_sel;
   uint8_t i;
 
-  if (fw_as_acacontrol(CXD56_ACA_CTL_CHECK_ID, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(CXD56_ACA_CTL_CHECK_ID, 0) != 0)
     {
       return -ENXIO;
     }
@@ -2047,7 +2047,7 @@ static int cxd56_power_on_micbias(FAR struct cxd56_dev_s *dev)
 {
   struct timespec start;
 
-  if (fw_as_acacontrol(CXD56_ACA_CTL_POWER_ON_MICBIAS, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(CXD56_ACA_CTL_POWER_ON_MICBIAS, 0) != 0)
     {
       return -EBUSY;
     }
@@ -2535,7 +2535,7 @@ static int cxd56_power_off(FAR struct cxd56_dev_s *dev)
 
   cxd56_audio_clock_disable();
 
-  if (fw_as_acacontrol(CXD56_ACA_CTL_POWER_OFF_COMMON, (uint32_t)NULL) != 0)
+  if (fw_as_acacontrol(CXD56_ACA_CTL_POWER_OFF_COMMON, 0) != 0)
     {
       return -EBUSY;
     }
@@ -2979,7 +2979,7 @@ static int cxd56_stop_dma(FAR struct cxd56_dev_s *priv)
           /* Disable input */
 
           if (fw_as_acacontrol(CXD56_ACA_CTL_POWER_OFF_INPUT,
-                             (uint32_t)NULL) != 0)
+                             0) != 0)
             {
               return -EBUSY;
             }
@@ -3003,7 +3003,7 @@ static int cxd56_stop_dma(FAR struct cxd56_dev_s *priv)
           write_reg(REG_AC_PDN_SMSTR, 1);
 
           if (fw_as_acacontrol(CXD56_ACA_CTL_POWER_OFF_OUTPUT,
-                               (uint32_t)NULL) != 0)
+                               0) != 0)
             {
               return -EBUSY;
             }
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index 3ef93196e8..937f816893 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -954,8 +954,7 @@ int slip_initialize(int intf, FAR const char *devname)
   argv[1] = NULL;
 
   ret = kthread_create("rxslip", CONFIG_NET_SLIP_DEFPRIO,
-                       CONFIG_NET_SLIP_STACKSIZE, slip_rxtask,
-                       (FAR char * const *)argv);
+                       CONFIG_NET_SLIP_STACKSIZE, slip_rxtask, argv);
   if (ret < 0)
     {
       nerr("ERROR: Failed to start receiver task\n");
@@ -971,8 +970,7 @@ int slip_initialize(int intf, FAR const char *devname)
   /* Start the SLIP transmitter kernel thread */
 
   ret = kthread_create("txslip", CONFIG_NET_SLIP_DEFPRIO,
-                       CONFIG_NET_SLIP_STACKSIZE, slip_txtask,
-                       (FAR char * const *)argv);
+                       CONFIG_NET_SLIP_STACKSIZE, slip_txtask, argv);
   if (ret < 0)
     {
       nerr("ERROR: Failed to start receiver task\n");
diff --git a/drivers/usbhost/usbhost_hidkbd.c b/drivers/usbhost/usbhost_hidkbd.c
index 6257dbd973..004eb8a83f 100644
--- a/drivers/usbhost/usbhost_hidkbd.c
+++ b/drivers/usbhost/usbhost_hidkbd.c
@@ -1665,8 +1665,7 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
   g_priv = priv;
 
   ret = kthread_create("kbdpoll", CONFIG_HIDKBD_DEFPRIO,
-                       CONFIG_HIDKBD_STACKSIZE, (main_t)usbhost_kbdpoll,
-                       (FAR char * const *)NULL);
+                       CONFIG_HIDKBD_STACKSIZE, usbhost_kbdpoll, NULL);
   if (ret < 0)
     {
       /* Failed to started the poll thread...
diff --git a/drivers/usbhost/usbhost_hidmouse.c b/drivers/usbhost/usbhost_hidmouse.c
index b7d51de5d5..f5f92b9a0e 100644
--- a/drivers/usbhost/usbhost_hidmouse.c
+++ b/drivers/usbhost/usbhost_hidmouse.c
@@ -1619,8 +1619,7 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
   g_priv = priv;
 
   ret = kthread_create("mouse", CONFIG_HIDMOUSE_DEFPRIO,
-                       CONFIG_HIDMOUSE_STACKSIZE, (main_t)usbhost_mouse_poll,
-                       (FAR char * const *)NULL);
+                       CONFIG_HIDMOUSE_STACKSIZE, usbhost_mouse_poll, NULL);
   if (ret < 0)
     {
       /* Failed to started the poll thread...
diff --git a/drivers/usbhost/usbhost_xboxcontroller.c b/drivers/usbhost/usbhost_xboxcontroller.c
index 6525b46058..d6395c3f66 100644
--- a/drivers/usbhost/usbhost_xboxcontroller.c
+++ b/drivers/usbhost/usbhost_xboxcontroller.c
@@ -1346,8 +1346,7 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
   uinfo("Starting thread\n");
   ret = kthread_create("xbox", CONFIG_XBOXCONTROLLER_DEFPRIO,
                        CONFIG_XBOXCONTROLLER_STACKSIZE,
-                       (main_t)usbhost_xboxcontroller_poll,
-                       (FAR char * const *)NULL);
+                       usbhost_xboxcontroller_poll, NULL);
   if (ret < 0)
     {
       /* Failed to started the poll thread... probably due to memory
diff --git a/drivers/usbmonitor/usbmonitor.c b/drivers/usbmonitor/usbmonitor.c
index 22298894df..421a518172 100644
--- a/drivers/usbmonitor/usbmonitor.c
+++ b/drivers/usbmonitor/usbmonitor.c
@@ -212,8 +212,7 @@ int usbmonitor_start(void)
 
       ret = kthread_create("USB Monitor", CONFIG_USBMONITOR_PRIORITY,
                            CONFIG_USBMONITOR_STACKSIZE,
-                           (main_t)usbmonitor_daemon,
-                           (FAR char * const *)NULL);
+                           usbmonitor_daemon, NULL);
       if (ret < 0)
         {
           uerr("ERROR: Failed to start the USB monitor: %d\n",
diff --git a/drivers/video/vnc/vnc_fbdev.c b/drivers/video/vnc/vnc_fbdev.c
index 57050652fc..49c2681840 100644
--- a/drivers/video/vnc/vnc_fbdev.c
+++ b/drivers/video/vnc/vnc_fbdev.c
@@ -519,7 +519,7 @@ static int vnc_start_server(int display)
 
   ret = kthread_create("vnc_server", CONFIG_VNCSERVER_PRIO,
                        CONFIG_VNCSERVER_STACKSIZE,
-                       (main_t)vnc_server, argv);
+                       vnc_server, argv);
   if (ret < 0)
     {
       gerr("ERROR: Failed to start the VNC server: %d\n", ret);
diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c
index 2549dfad52..87fe363939 100644
--- a/fs/inode/fs_files.c
+++ b/fs/inode/fs_files.c
@@ -330,7 +330,7 @@ int fs_getfilep(int fd, FAR struct file **filep)
   int ret;
 
   DEBUGASSERT(filep != NULL);
-  *filep = (FAR struct file *)NULL;
+  *filep = NULL;
 
   list = nxsched_get_files();
 
@@ -370,7 +370,7 @@ int fs_getfilep(int fd, FAR struct file **filep)
 
   if (!(*filep)->f_inode)
     {
-      *filep = (FAR struct file *)NULL;
+      *filep = NULL;
       ret = -EBADF;
     }
 
diff --git a/include/semaphore.h b/include/semaphore.h
index bfc6122818..346e8d2d39 100644
--- a/include/semaphore.h
+++ b/include/semaphore.h
@@ -44,7 +44,7 @@
 
 /* Value returned by sem_open() in the event of a failure. */
 
-#define SEM_FAILED ((FAR sem_t *)NULL)
+#define SEM_FAILED                NULL
 
 /* Bit definitions for the struct sem_s flags field */
 
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 5569630375..f7df0ce45a 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -258,8 +258,7 @@
   (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
 
 #define __CMSG_FIRSTHDR(ctl, len) \
-  ((len) >= sizeof(struct cmsghdr) ? (FAR struct cmsghdr *)(ctl) : \
-   (FAR struct cmsghdr *)NULL)
+  ((len) >= sizeof(struct cmsghdr) ? (FAR struct cmsghdr *)(ctl) : NULL)
 #define CMSG_FIRSTHDR(msg) \
   __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \
@@ -345,7 +344,7 @@ static inline FAR struct cmsghdr *__cmsg_nxthdr(FAR void *__ctl,
     (((FAR char *)__cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
   if ((unsigned long)((FAR char *)(__ptr + 1) - (FAR char *)__ctl) > __size)
     {
-      return (FAR struct cmsghdr *)NULL;
+      return NULL;
     }
 
   return __ptr;
diff --git a/libs/libc/misc/lib_envpath.c b/libs/libc/misc/lib_envpath.c
index 2d30d9d24a..a0259eee22 100644
--- a/libs/libc/misc/lib_envpath.c
+++ b/libs/libc/misc/lib_envpath.c
@@ -94,7 +94,7 @@ ENVPATH_HANDLE envpath_init(FAR const char *name)
        * exist in the environment.
        */
 
-      return (ENVPATH_HANDLE)NULL;
+      return NULL;
     }
 
   /* Allocate a container for the PATH variable contents */
@@ -106,7 +106,7 @@ ENVPATH_HANDLE envpath_init(FAR const char *name)
     {
       /* Ooops.. we are out of memory */
 
-      return (ENVPATH_HANDLE)NULL;
+      return NULL;
     }
 
   /* Populate the container */
@@ -116,7 +116,7 @@ ENVPATH_HANDLE envpath_init(FAR const char *name)
 
   /* And return the containing cast to an opaque handle */
 
-  return (ENVPATH_HANDLE)envpath;
+  return envpath;
 }
 
 /****************************************************************************
@@ -179,7 +179,7 @@ FAR char *envpath_next(ENVPATH_HANDLE handle, FAR const char *relpath)
            * paths in the path variable.
            */
 
-          return (FAR char *)NULL;
+          return NULL;
         }
 
       /* Okay... 'path' points to the beginning of the string.  The string
@@ -213,7 +213,7 @@ FAR char *envpath_next(ENVPATH_HANDLE handle, FAR const char *relpath)
         {
           /* Failed to allocate memory */
 
-          return (FAR char *)NULL;
+          return NULL;
         }
 
       /* Construct the full path */
diff --git a/libs/libc/wqueue/work_usrthread.c b/libs/libc/wqueue/work_usrthread.c
index 9b5e68cfa3..cdc3d4d6c4 100644
--- a/libs/libc/wqueue/work_usrthread.c
+++ b/libs/libc/wqueue/work_usrthread.c
@@ -296,8 +296,7 @@ int work_usrstart(void)
   ret = task_create("uwork",
                     CONFIG_LIBC_USRWORKPRIORITY,
                     CONFIG_LIBC_USRWORKSTACKSIZE,
-                    (main_t)work_usrthread,
-                    ((FAR char * const *)NULL));
+                    work_usrthread, NULL);
   if (ret < 0)
     {
       int errcode = get_errno();
diff --git a/sched/init/nx_bringup.c b/sched/init/nx_bringup.c
index 5391c3336a..94353210e0 100644
--- a/sched/init/nx_bringup.c
+++ b/sched/init/nx_bringup.c
@@ -144,7 +144,7 @@ static inline void nx_pgworker(void)
 
   g_pgworker = kthread_create("pgfill", CONFIG_PAGING_DEFPRIO,
                               CONFIG_PAGING_STACKSIZE,
-                              (main_t)pg_worker, (FAR char * const *)NULL);
+                              pg_worker, NULL);
   DEBUGASSERT(g_pgworker > 0);
 }
 
@@ -353,8 +353,8 @@ static inline void nx_create_initthread(void)
    */
 
   pid = kthread_create("AppBringUp", CONFIG_BOARD_INITTHREAD_PRIORITY,
-                      CONFIG_BOARD_INITTHREAD_STACKSIZE,
-                      (main_t)nx_start_task, (FAR char * const *)NULL);
+                       CONFIG_BOARD_INITTHREAD_STACKSIZE,
+                       nx_start_task, NULL);
   DEBUGASSERT(pid > 0);
   UNUSED(pid);
 #else
diff --git a/sched/wqueue/kwork_thread.c b/sched/wqueue/kwork_thread.c
index 4e5bbf185d..f3883726ed 100644
--- a/sched/wqueue/kwork_thread.c
+++ b/sched/wqueue/kwork_thread.c
@@ -226,7 +226,7 @@ static int work_thread_create(FAR const char *name, int priority,
   for (wndx = 0; wndx < nthread; wndx++)
     {
       pid = kthread_create(name, priority, stack_size,
-                           (main_t)work_thread, argv);
+                           work_thread, argv);
 
       DEBUGASSERT(pid > 0);
       if (pid < 0)