mm/alloc: remove all unnecessary cast for alloc

Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-08-28 15:39:47 +08:00 committed by Xiang Xiao
parent db13d5e24c
commit 664927c86e
333 changed files with 485 additions and 566 deletions

View File

@ -164,9 +164,9 @@ may be used in the file provided that it is used consistently.
int short_name2; /* This is a very long comment describing subtle aspects of the short_name2 field */
};
struct some_medium_name_s *ptr = (struct some_medium_name_s *)malloc(sizeof(some_medium_name_s);
struct some_medium_name_s *ptr = malloc(sizeof(some_medium_name_s);
struct some_long_struct_name_s *ptr = (struct some_long_struct_name_s *)malloc(sizeof(some_long_struct_name_s);
struct some_long_struct_name_s *ptr = malloc(sizeof(some_long_struct_name_s);
ret = some_function_with_many parameters(long_parameter_name_1, long_parameter_name_2, long_parameter_name_3, long_parameter_name_4, long_parameter_name_5, long_parameter_name_6, long_parameter_name_7, long_parameter_name_8);
@ -195,15 +195,11 @@ may be used in the file provided that it is used consistently.
* aspects of the short_name2 field. */
};
FAR struct some_medium_name_s *ptr = (FAR struct some_medium_name_s *)
malloc(sizeof(some_medium_name_s);
FAR struct some_medium_name_s *ptr = malloc(sizeof(some_medium_name_s);
FAR struct some_medium_name_s *ptr =
(FAR struct some_medium_name_s *)malloc(sizeof(some_medium_name_s);
FAR struct some_medium_name_s *ptr = malloc(sizeof(some_medium_name_s);
FAR struct some_long_struct_name_s *ptr =
(FAR struct some_long_struct_name_s *)
malloc(sizeof(some_long_struct_name_s);
FAR struct some_long_struct_name_s *ptr = malloc(sizeof(some_long_struct_name_s);
ret = some_function_with_many parameters(long_parameter_name_1,
long_parameter_name_2,
@ -2279,7 +2275,7 @@ Use of ``goto``
goto errout;
}
...
ptr = (FAR struct some_struct_s *)malloc(sizeof(struct some_struct_s));
ptr = malloc(sizeof(struct some_struct_s));
if (!ptr)
{
ret = -ENOMEM;

View File

@ -136,7 +136,7 @@ int up_addrenv_kstackalloc(struct tcb_s *tcb)
/* Allocate the kernel stack */
tcb->xcp.kstack = (uint32_t *)kmm_memalign(8, ARCH_KERNEL_STACKSIZE);
tcb->xcp.kstack = kmm_memalign(8, ARCH_KERNEL_STACKSIZE);
if (!tcb->xcp.kstack)
{
berr("ERROR: Failed to allocate the kernel stack\n");

View File

@ -812,7 +812,7 @@ DMA_HANDLE cxd56_dmachannel(int ch, ssize_t maxsize)
n++;
}
dmach->list = (dmac_lli_t *)kmm_malloc(n * sizeof(dmac_lli_t));
dmach->list = kmm_malloc(n * sizeof(dmac_lli_t));
if (dmach->list == NULL)
{
dmainfo("Failed to kmm_malloc\n");

View File

@ -950,7 +950,7 @@ int cxd56_emmcinitialize(void)
return -EIO;
}
buf = (uint8_t *)kmm_malloc(SECTOR_SIZE);
buf = kmm_malloc(SECTOR_SIZE);
if (buf)
{
putreg32(SECTOR_SIZE, EMMC_BYTCNT);

View File

@ -631,8 +631,7 @@ static int cxd56_geofence_register(const char *devpath)
struct cxd56_geofence_dev_s *priv;
int ret;
priv = (struct cxd56_geofence_dev_s *)kmm_zalloc(
sizeof(struct cxd56_geofence_dev_s));
priv = kmm_zalloc(sizeof(struct cxd56_geofence_dev_s));
if (!priv)
{
gnsserr("Failed to allocate instance\n");

View File

@ -907,7 +907,7 @@ static int cxd56_gnss_save_backup_data(struct file *filep,
int n = 0;
int32_t offset = 0;
buf = (char *)kmm_malloc(CONFIG_CXD56_GNSS_BACKUP_BUFFER_SIZE);
buf = kmm_malloc(CONFIG_CXD56_GNSS_BACKUP_BUFFER_SIZE);
if (buf == NULL)
{
return -ENOMEM;
@ -1054,7 +1054,7 @@ static int cxd56_gnss_check_cep_data(struct file *filep, unsigned long arg)
if (g_ceplen > 0)
{
g_cepdata = (char *)kmm_malloc(g_ceplen);
g_cepdata = kmm_malloc(g_ceplen);
}
if (!g_cepdata)
@ -2267,7 +2267,7 @@ cxd56_gnss_read_cep_file(struct file *fp, int32_t offset,
goto err0;
}
buf = (char *)kmm_malloc(len);
buf = kmm_malloc(len);
if (buf == NULL)
{
ret = -ENOMEM;
@ -2326,7 +2326,7 @@ static void cxd56_gnss_read_backup_file(int *retval)
size_t n;
int ret = 0;
buf = (char *)kmm_malloc(CONFIG_CXD56_GNSS_BACKUP_BUFFER_SIZE);
buf = kmm_malloc(CONFIG_CXD56_GNSS_BACKUP_BUFFER_SIZE);
if (buf == NULL)
{
ret = -ENOMEM;
@ -3131,8 +3131,7 @@ static int cxd56_gnss_register(const char *devpath)
}
};
priv = (struct cxd56_gnss_dev_s *)kmm_zalloc(
sizeof(struct cxd56_gnss_dev_s));
priv = kmm_zalloc(sizeof(struct cxd56_gnss_dev_s));
if (!priv)
{
gnsserr("Failed to allocate instance\n");

View File

@ -392,8 +392,7 @@ static int hif_initialize(struct hostif_buff_s *buffer)
/* Setup driver structure */
drv->dev =
(struct cxd56_hifdev_s *)kmm_malloc(sizeof(struct cxd56_hifdev_s) * num);
drv->dev = kmm_malloc(sizeof(struct cxd56_hifdev_s) * num);
if (drv->dev == NULL)
{
hiferr("ERROR: hostif allocation failed\n");

View File

@ -339,7 +339,7 @@ static struct iccdev_s *icc_devnew(void)
struct iccdev_s *priv;
int i;
priv = (struct iccdev_s *)kmm_malloc(sizeof(struct iccdev_s));
priv = kmm_malloc(sizeof(struct iccdev_s));
if (!priv)
{
return NULL;

View File

@ -3783,7 +3783,7 @@ struct audio_lowerhalf_s *cxd56_initialize(
FAR struct cxd56_dev_s *priv;
audinfo("cxd56_initialize\n");
priv = (FAR struct cxd56_dev_s *)kmm_zalloc(sizeof(struct cxd56_dev_s));
priv = kmm_zalloc(sizeof(struct cxd56_dev_s));
if (priv)
{
priv->dev.ops = &g_audioops;

View File

@ -483,7 +483,7 @@ void *cxd56_pm_register_callback(uint32_t target,
nxmutex_lock(&g_regcblock);
entry = (struct pm_cbentry_s *)kmm_malloc(sizeof(struct pm_cbentry_s));
entry = kmm_malloc(sizeof(struct pm_cbentry_s));
if (entry == NULL)
{
nxmutex_unlock(&g_regcblock);

View File

@ -1778,7 +1778,7 @@ static struct seq_s *seq_new(void)
leave_critical_section(flags);
seq = (struct seq_s *)kmm_zalloc(sizeof(struct seq_s));
seq = kmm_zalloc(sizeof(struct seq_s));
if (!seq)
{
seq_free(sid);
@ -1818,7 +1818,7 @@ static struct seq_s *deci_new(void)
leave_critical_section(flags);
deci = (struct decimator_s *)kmm_zalloc(sizeof(struct decimator_s));
deci = kmm_zalloc(sizeof(struct decimator_s));
if (!deci)
{
deci_free(sid);
@ -1873,7 +1873,7 @@ static int seq_fifoinit(struct seq_s *seq, int fifoid, uint16_t fsize)
}
}
fifo = (struct scufifo_s *)kmm_zalloc(sizeof(struct scufifo_s));
fifo = kmm_zalloc(sizeof(struct scufifo_s));
if (!fifo)
{
return -ENOMEM;

View File

@ -274,7 +274,7 @@ struct mtd_dev_s *cxd56_sfc_initialize(void)
/* Allocate a buffer for the erase block cache */
priv->cache = (uint8_t *)kmm_malloc(SPIFI_BLKSIZE);
priv->cache = kmm_malloc(SPIFI_BLKSIZE);
if (!priv->cache)
{
/* Allocation failed! */

View File

@ -49,8 +49,7 @@
void *up_textheap_memalign(size_t align, size_t size)
{
void *ret;
ret = (void *)kmm_malloc(size);
void *ret = kmm_malloc(size);
#ifdef CONFIG_CXD56_USE_SYSBUS
if (ret)

View File

@ -2294,7 +2294,7 @@ static struct usbdev_req_s *cxd56_epallocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, ((struct cxd56_ep_s *)ep)->epphy);
privreq = (struct cxd56_req_s *)kmm_malloc(sizeof(struct cxd56_req_s));
privreq = kmm_malloc(sizeof(struct cxd56_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(CXD56_TRACEERR_ALLOCFAIL), 0);
@ -2590,8 +2590,7 @@ static int cxd56_allocepbuffer(struct cxd56_ep_s *privep)
DEBUGASSERT(!privep->desc && !privep->buffer);
DEBUGASSERT(privep->epphy); /* Do not use for EP0 */
privep->desc =
(struct cxd56_data_desc_s *)kmm_malloc(sizeof(struct cxd56_data_desc_s));
privep->desc = kmm_malloc(sizeof(struct cxd56_data_desc_s));
if (!privep->desc)
{
return -1;
@ -3394,8 +3393,7 @@ static int cxd56_usbdev_open(struct file *filep, const char *relpath,
/* Allocate the open file structure */
priv = (struct cxd56_usbdev_file_s *)kmm_zalloc(
sizeof(struct cxd56_usbdev_file_s));
priv = kmm_zalloc(sizeof(struct cxd56_usbdev_file_s));
if (!priv)
{
uerr("ERROR: Failed to allocate file attributes\n");
@ -3489,8 +3487,7 @@ static int cxd56_usbdev_dup(const struct file *oldp,
/* Allocate a new container to hold the task and attribute selection */
newattr = (struct cxd56_usbdev_file_s *)kmm_malloc(
sizeof(struct cxd56_usbdev_file_s));
newattr = kmm_malloc(sizeof(struct cxd56_usbdev_file_s));
if (!newattr)
{
uerr("ERROR: Failed to allocate file attributes\n");

View File

@ -677,10 +677,10 @@ static int dm320_allocvideomemory(void)
{
#ifndef CONFIG_DM320_VID0_DISABLE
#ifndef CONFIG_DM320_DISABLE_PINGPONG
g_vid0base = (void *)kmm_malloc(2 * DM320_VID0_FBLEN);
g_vid0base = kmm_malloc(2 * DM320_VID0_FBLEN);
g_vid0ppbase = (char *)g_vid0base + DM320_VID0_FBLEN;
#else
g_vid0base = (void *)kmm_malloc(DM320_VID0_FBLEN);
g_vid0base = kmm_malloc(DM320_VID0_FBLEN);
#endif
if (!g_vid0base)
{
@ -689,7 +689,7 @@ static int dm320_allocvideomemory(void)
#endif
#ifndef CONFIG_DM320_VID1_DISABLE
g_vid1base = (void *)kmm_malloc(DM320_VID1_FBLEN);
g_vid1base = kmm_malloc(DM320_VID1_FBLEN);
if (!g_vid1base)
{
goto errout;
@ -697,7 +697,7 @@ static int dm320_allocvideomemory(void)
#endif
#ifndef CONFIG_DM320_OSD0_DISABLE
g_osd0base = (void *)kmm_malloc(DM320_OSD0_FBLEN);
g_osd0base = kmm_malloc(DM320_OSD0_FBLEN);
if (!g_osd0base)
{
goto errout;
@ -705,7 +705,7 @@ static int dm320_allocvideomemory(void)
#endif
#ifndef CONFIG_DM320_OSD1_DISABLE
g_osd1base = (void *)kmm_malloc(DM320_OSD1_FBLEN);
g_osd1base = kmm_malloc(DM320_OSD1_FBLEN);
if (!g_osd1base)
{
goto errout;

View File

@ -2025,7 +2025,7 @@ static struct usbdev_req_s *dm320_epallocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct dm320_ep_s *)ep)->epphy);
privreq = (struct dm320_req_s *)kmm_malloc(sizeof(struct dm320_req_s));
privreq = kmm_malloc(sizeof(struct dm320_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(DM320_TRACEERR_ALLOCFAIL), 0);

View File

@ -4328,7 +4328,7 @@ static struct usbdev_req_s *efm32_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct efm32_ep_s *)ep)->epphy);
privreq = (struct efm32_req_s *)kmm_malloc(sizeof(struct efm32_req_s));
privreq = kmm_malloc(sizeof(struct efm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(EFM32_TRACEERR_ALLOCFAIL), 0);

View File

@ -4277,7 +4277,7 @@ static int efm32_alloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the EFM32. */
alloc = (uint8_t *)kmm_malloc(CONFIG_EFM32_OTGFS_DESCSIZE);
alloc = kmm_malloc(CONFIG_EFM32_OTGFS_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@ -4361,7 +4361,7 @@ static int efm32_ioalloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View File

@ -3955,8 +3955,7 @@ static int imxrt_epalloc(struct usbhost_driver_s *drvr,
/* Allocate a endpoint information structure */
epinfo = (struct imxrt_epinfo_s *)
kmm_zalloc(sizeof(struct imxrt_epinfo_s));
epinfo = kmm_zalloc(sizeof(struct imxrt_epinfo_s));
if (!epinfo)
{
usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0);
@ -4067,8 +4066,7 @@ static int imxrt_alloc(struct usbhost_driver_s *drvr,
* multiple of the cache line size in length.
*/
*buffer = (uint8_t *)kmm_memalign(ARMV7M_DCACHE_LINESIZE,
IMXRT_EHCI_BUFSIZE);
*buffer = kmm_memalign(ARMV7M_DCACHE_LINESIZE, IMXRT_EHCI_BUFSIZE);
if (*buffer)
{
*maxlen = IMXRT_EHCI_BUFSIZE;
@ -4155,7 +4153,7 @@ static int imxrt_ioalloc(struct usbhost_driver_s *drvr,
*/
buflen = (buflen + DCACHE_LINEMASK) & ~DCACHE_LINEMASK;
*buffer = (uint8_t *)kumm_memalign(ARMV7M_DCACHE_LINESIZE, buflen);
*buffer = kumm_memalign(ARMV7M_DCACHE_LINESIZE, buflen);
return *buffer ? OK : -ENOMEM;
}
@ -5058,10 +5056,8 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
# ifndef CONFIG_IMXRT_EHCI_PREALLOCATE
/* Allocate a pool of free Queue Head (QH) structures */
g_qhpool =
(struct imxrt_qh_s *)kmm_memalign(32,
CONFIG_IMXRT_EHCI_NQHS *
sizeof(struct imxrt_qh_s));
g_qhpool = kmm_memalign(32, CONFIG_IMXRT_EHCI_NQHS *
sizeof(struct imxrt_qh_s));
if (!g_qhpool)
{
usbhost_trace1(EHCI_TRACE1_QHPOOLALLOC_FAILED, 0);
@ -5081,10 +5077,8 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
# ifndef CONFIG_IMXRT_EHCI_PREALLOCATE
/* Allocate a pool of free Transfer Descriptor (qTD) structures */
g_qtdpool =
(struct imxrt_qtd_s *)kmm_memalign(32,
CONFIG_IMXRT_EHCI_NQTDS *
sizeof(struct imxrt_qtd_s));
g_qtdpool = kmm_memalign(32, CONFIG_IMXRT_EHCI_NQTDS *
sizeof(struct imxrt_qtd_s));
if (!g_qtdpool)
{
usbhost_trace1(EHCI_TRACE1_QTDPOOLALLOC_FAILED, 0);
@ -5096,8 +5090,7 @@ struct usbhost_connection_s *imxrt_ehci_initialize(int controller)
# if !defined(CONFIG_IMXRT_EHCI_PREALLOCATE) && !defined(CONFIG_USBHOST_INT_DISABLE)
/* Allocate the periodic framelist */
g_framelist = (uint32_t *)
kmm_memalign(4096, FRAME_LIST_SIZE * sizeof(uint32_t));
g_framelist = kmm_memalign(4096, FRAME_LIST_SIZE * sizeof(uint32_t));
if (!g_framelist)
{
usbhost_trace1(EHCI_TRACE1_PERFLALLOC_FAILED, 0);

View File

@ -2281,7 +2281,7 @@ static struct usbdev_req_s *imxrt_epallocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct imxrt_ep_s *)ep)->epphy);
privreq = (struct imxrt_req_s *)kmm_malloc(sizeof(struct imxrt_req_s));
privreq = kmm_malloc(sizeof(struct imxrt_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(IMXRT_TRACEERR_ALLOCFAIL), 0);

View File

@ -3563,7 +3563,7 @@ static struct usbdev_req_s *khci_epallocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct khci_req_s *)kmm_malloc(sizeof(struct khci_req_s));
privreq = kmm_malloc(sizeof(struct khci_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(KHCI_TRACEERR_ALLOCFAIL), 0);

View File

@ -4024,8 +4024,7 @@ static int kinetis_epalloc(struct usbhost_driver_s *drvr,
/* Allocate a endpoint information structure */
epinfo = (struct kinetis_epinfo_s *)
kmm_zalloc(sizeof(struct kinetis_epinfo_s));
epinfo = kmm_zalloc(sizeof(struct kinetis_epinfo_s));
if (!epinfo)
{
usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0);
@ -4136,8 +4135,7 @@ static int kinetis_alloc(struct usbhost_driver_s *drvr,
* multiple of the cache line size in length.
*/
*buffer = (uint8_t *)kmm_memalign(ARMV7M_DCACHE_LINESIZE,
KINETIS_EHCI_BUFSIZE);
*buffer = kmm_memalign(ARMV7M_DCACHE_LINESIZE, KINETIS_EHCI_BUFSIZE);
if (*buffer)
{
*maxlen = KINETIS_EHCI_BUFSIZE;
@ -4225,7 +4223,7 @@ static int kinetis_ioalloc(struct usbhost_driver_s *drvr,
*/
buflen = (buflen + DCACHE_LINEMASK) & ~DCACHE_LINEMASK;
*buffer = (uint8_t *)kumm_memalign(ARMV7M_DCACHE_LINESIZE, buflen);
*buffer = kumm_memalign(ARMV7M_DCACHE_LINESIZE, buflen);
return *buffer ? OK : -ENOMEM;
}
@ -5128,10 +5126,8 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
# ifndef CONFIG_KINETIS_EHCI_PREALLOCATE
/* Allocate a pool of free Queue Head (QH) structures */
g_qhpool =
(struct kinetis_qh_s *)kmm_memalign(32,
CONFIG_KINETIS_EHCI_NQHS *
sizeof(struct kinetis_qh_s));
g_qhpool = kmm_memalign(32, CONFIG_KINETIS_EHCI_NQHS *
sizeof(struct kinetis_qh_s));
if (!g_qhpool)
{
usbhost_trace1(EHCI_TRACE1_QHPOOLALLOC_FAILED, 0);
@ -5151,10 +5147,8 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
# ifndef CONFIG_KINETIS_EHCI_PREALLOCATE
/* Allocate a pool of free Transfer Descriptor (qTD) structures */
g_qtdpool =
(struct kinetis_qtd_s *)kmm_memalign(32,
CONFIG_KINETIS_EHCI_NQTDS *
sizeof(struct kinetis_qtd_s));
g_qtdpool = kmm_memalign(32, CONFIG_KINETIS_EHCI_NQTDS *
sizeof(struct kinetis_qtd_s));
if (!g_qtdpool)
{
usbhost_trace1(EHCI_TRACE1_QTDPOOLALLOC_FAILED, 0);
@ -5166,8 +5160,7 @@ struct usbhost_connection_s *kinetis_ehci_initialize(int controller)
# if !defined(CONFIG_KINETIS_EHCI_PREALLOCATE) && !defined(CONFIG_USBHOST_INT_DISABLE)
/* Allocate the periodic framelist */
g_framelist = (uint32_t *)
kmm_memalign(4096, FRAME_LIST_SIZE * sizeof(uint32_t));
g_framelist = kmm_memalign(4096, FRAME_LIST_SIZE * sizeof(uint32_t));
if (!g_framelist)
{
usbhost_trace1(EHCI_TRACE1_PERFLALLOC_FAILED, 0);

View File

@ -1010,7 +1010,7 @@ struct i2s_dev_s *lc823450_i2sdev_initialize(void)
* chip select structures.
*/
priv = (struct lc823450_i2s_s *)kmm_zalloc(sizeof(struct lc823450_i2s_s));
priv = kmm_zalloc(sizeof(struct lc823450_i2s_s));
if (!priv)
{
i2serr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -249,7 +249,7 @@ static struct mmcl_dev_s *mmcl_allocdev(int number,
/* Allocate a MMCL device structure */
dev = (struct mmcl_dev_s *)kmm_malloc(sizeof(struct mmcl_dev_s));
dev = kmm_malloc(sizeof(struct mmcl_dev_s));
if (dev)
{
/* Initialize the MMCL device structure */

View File

@ -131,7 +131,7 @@ static int dvfs_open(struct file *filep, const char *relpath,
/* Allocate a container to hold the task and attribute selection */
priv = (struct dvfs_file_s *)kmm_zalloc(sizeof(struct dvfs_file_s));
priv = kmm_zalloc(sizeof(struct dvfs_file_s));
if (!priv)
{
ferr("ERROR: Failed to allocate file attributes\n");
@ -314,7 +314,7 @@ static int dvfs_dup(const struct file *oldp, struct file *newp)
/* Allocate a new container to hold the task and attribute selection */
newpriv = (struct dvfs_file_s *)kmm_zalloc(sizeof(struct dvfs_file_s));
newpriv = kmm_zalloc(sizeof(struct dvfs_file_s));
if (!newpriv)
{
ferr("ERROR: Failed to allocate file attributes\n");

View File

@ -4175,7 +4175,7 @@ static int lpc31_ioalloc(struct usbhost_driver_s *drvr,
*/
buflen = (buflen + DCACHE_LINEMASK) & ~DCACHE_LINEMASK;
*buffer = (uint8_t *)kumm_memalign(ARM_DCACHE_LINESIZE, buflen);
*buffer = kumm_memalign(ARM_DCACHE_LINESIZE, buflen);
return *buffer ? OK : -ENOMEM;
}

View File

@ -2136,7 +2136,7 @@ static struct usbdev_req_s *lpc31_epallocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct lpc31_ep_s *)ep)->epphy);
privreq = (struct lpc31_req_s *)kmm_malloc(sizeof(struct lpc31_req_s));
privreq = kmm_malloc(sizeof(struct lpc31_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_ALLOCFAIL), 0);

View File

@ -3920,7 +3920,7 @@ static int lpc43_alloc(struct usbhost_driver_s *drvr,
/* There is no special requirements for transfer/descriptor buffers. */
*buffer = (uint8_t *)kmm_malloc(CONFIG_LPC43_EHCI_BUFSIZE);
*buffer = kmm_malloc(CONFIG_LPC43_EHCI_BUFSIZE);
if (*buffer)
{
*maxlen = CONFIG_LPC43_EHCI_BUFSIZE;
@ -4005,7 +4005,7 @@ static int lpc43_ioalloc(struct usbhost_driver_s *drvr,
* buffering).
*/
*buffer = (uint8_t *)kumm_malloc(buflen);
*buffer = kumm_malloc(buflen);
return *buffer ? OK : -ENOMEM;
}

View File

@ -1238,7 +1238,7 @@ struct mtd_dev_s *lpc43_spifi_initialize(void)
/* Allocate a buffer for the erase block cache */
priv->cache = (uint8_t *)kmm_malloc(SPIFI_BLKSIZE);
priv->cache = kmm_malloc(SPIFI_BLKSIZE);
if (!priv->cache)
{
/* Allocation failed!

View File

@ -2180,7 +2180,7 @@ usbdev_req_s *lpc43_epallocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct lpc43_ep_s *)ep)->epphy);
privreq = (struct lpc43_req_s *)kmm_malloc(sizeof(struct lpc43_req_s));
privreq = kmm_malloc(sizeof(struct lpc43_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(LPC43_TRACEERR_ALLOCFAIL), 0);

View File

@ -2422,7 +2422,7 @@ static struct usbdev_req_s *nrf52_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct nrf52_ep_s *)ep)->epphy);
privreq = (struct nrf52_req_s *)kmm_malloc(sizeof(struct nrf52_req_s));
privreq = kmm_malloc(sizeof(struct nrf52_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(NRF52_TRACEERR_ALLOCFAIL), 0);

View File

@ -2422,7 +2422,7 @@ static struct usbdev_req_s *nrf53_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct nrf53_ep_s *)ep)->epphy);
privreq = (struct nrf53_req_s *)kmm_malloc(sizeof(struct nrf53_req_s));
privreq = kmm_malloc(sizeof(struct nrf53_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(NRF53_TRACEERR_ALLOCFAIL), 0);

View File

@ -1291,7 +1291,7 @@ struct i2s_dev_s *rp2040_i2sbus_initialize(int port)
i2sinfo("port: %d\n", port);
priv = (struct rp2040_i2s_s *)kmm_zalloc(sizeof(struct rp2040_i2s_s));
priv = kmm_zalloc(sizeof(struct rp2040_i2s_s));
if (!priv)
{
i2serr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -1080,7 +1080,7 @@ static struct amebaz_dev_s *amebaz_allocate_device(int devnum)
{
struct amebaz_dev_s *priv;
priv = (struct amebaz_dev_s *)kmm_zalloc(sizeof(*priv));
priv = kmm_zalloc(sizeof(*priv));
if (!priv)
{
return NULL;

View File

@ -392,7 +392,7 @@ int s32k1xx_eeeprom_register(int minor, uint32_t size)
/* Allocate a eeeprom device structure */
dev = (struct eeed_struct_s *)kmm_zalloc(sizeof(struct eeed_struct_s));
dev = kmm_zalloc(sizeof(struct eeed_struct_s));
if (dev)
{
/* Initialize the eeeprom device structure */

View File

@ -598,7 +598,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
/* Allocate buffers */
allocsize = CONFIG_SAM34_EMAC_NTXBUFFERS * sizeof(struct emac_txdesc_s);
priv->txdesc = (struct emac_txdesc_s *)kmm_memalign(8, allocsize);
priv->txdesc = kmm_memalign(8, allocsize);
if (!priv->txdesc)
{
nerr("ERROR: Failed to allocate TX descriptors\n");
@ -608,7 +608,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
memset(priv->txdesc, 0, allocsize);
allocsize = CONFIG_SAM34_EMAC_NRXBUFFERS * sizeof(struct emac_rxdesc_s);
priv->rxdesc = (struct emac_rxdesc_s *)kmm_memalign(8, allocsize);
priv->rxdesc = kmm_memalign(8, allocsize);
if (!priv->rxdesc)
{
nerr("ERROR: Failed to allocate RX descriptors\n");
@ -619,7 +619,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
memset(priv->rxdesc, 0, allocsize);
allocsize = CONFIG_SAM34_EMAC_NTXBUFFERS * EMAC_TX_UNITSIZE;
priv->txbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->txbuffer = kmm_memalign(8, allocsize);
if (!priv->txbuffer)
{
nerr("ERROR: Failed to allocate TX buffer\n");
@ -628,7 +628,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
}
allocsize = CONFIG_SAM34_EMAC_NRXBUFFERS * EMAC_RX_UNITSIZE;
priv->rxbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->rxbuffer = kmm_memalign(8, allocsize);
if (!priv->rxbuffer)
{
nerr("ERROR: Failed to allocate RX buffer\n");

View File

@ -1730,7 +1730,7 @@ struct spi_dev_s *sam_spibus_initialize(int port)
* chip select structures.
*/
spics = (struct sam_spics_s *)kmm_zalloc(sizeof(struct sam_spics_s));
spics = kmm_zalloc(sizeof(struct sam_spics_s));
if (!spics)
{
spierr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -3047,7 +3047,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct sam_req_s *)kmm_malloc(sizeof(struct sam_req_s));
privreq = kmm_malloc(sizeof(struct sam_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);

View File

@ -3739,7 +3739,7 @@ static int sam_epalloc(struct usbhost_driver_s *drvr,
/* Allocate a endpoint information structure */
epinfo = (struct sam_epinfo_s *)kmm_zalloc(sizeof(struct sam_epinfo_s));
epinfo = kmm_zalloc(sizeof(struct sam_epinfo_s));
if (!epinfo)
{
usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0);
@ -3963,7 +3963,7 @@ static int sam_ioalloc(struct usbhost_driver_s *drvr,
*/
buflen = (buflen + DCACHE_LINEMASK) & ~DCACHE_LINEMASK;
*buffer = (uint8_t *)kumm_memalign(ARMV7A_DCACHE_LINESIZE, buflen);
*buffer = kumm_memalign(ARMV7A_DCACHE_LINESIZE, buflen);
return *buffer ? OK : -ENOMEM;
}

View File

@ -628,7 +628,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
/* Allocate buffers */
allocsize = CONFIG_SAMA5_EMAC_NTXBUFFERS * sizeof(struct emac_txdesc_s);
priv->txdesc = (struct emac_txdesc_s *)kmm_memalign(8, allocsize);
priv->txdesc = kmm_memalign(8, allocsize);
if (!priv->txdesc)
{
nerr("ERROR: Failed to allocate TX descriptors\n");
@ -638,7 +638,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
memset(priv->txdesc, 0, allocsize);
allocsize = CONFIG_SAMA5_EMAC_NRXBUFFERS * sizeof(struct emac_rxdesc_s);
priv->rxdesc = (struct emac_rxdesc_s *)kmm_memalign(8, allocsize);
priv->rxdesc = kmm_memalign(8, allocsize);
if (!priv->rxdesc)
{
nerr("ERROR: Failed to allocate RX descriptors\n");
@ -649,7 +649,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
memset(priv->rxdesc, 0, allocsize);
allocsize = CONFIG_SAMA5_EMAC_NTXBUFFERS * EMAC_TX_UNITSIZE;
priv->txbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->txbuffer = kmm_memalign(8, allocsize);
if (!priv->txbuffer)
{
nerr("ERROR: Failed to allocate TX buffer\n");
@ -658,7 +658,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
}
allocsize = CONFIG_SAMA5_EMAC_NRXBUFFERS * EMAC_RX_UNITSIZE;
priv->rxbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->rxbuffer = kmm_memalign(8, allocsize);
if (!priv->rxbuffer)
{
nerr("ERROR: Failed to allocate RX buffer\n");

View File

@ -941,7 +941,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
/* Allocate buffers */
allocsize = priv->attr->ntxbuffers * sizeof(struct emac_txdesc_s);
priv->txdesc = (struct emac_txdesc_s *)kmm_memalign(8, allocsize);
priv->txdesc = kmm_memalign(8, allocsize);
if (!priv->txdesc)
{
nerr("ERROR: Failed to allocate TX descriptors\n");
@ -951,7 +951,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
memset(priv->txdesc, 0, allocsize);
allocsize = priv->attr->nrxbuffers * sizeof(struct emac_rxdesc_s);
priv->rxdesc = (struct emac_rxdesc_s *)kmm_memalign(8, allocsize);
priv->rxdesc = kmm_memalign(8, allocsize);
if (!priv->rxdesc)
{
nerr("ERROR: Failed to allocate RX descriptors\n");
@ -962,7 +962,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
memset(priv->rxdesc, 0, allocsize);
allocsize = priv->attr->ntxbuffers * EMAC_TX_UNITSIZE;
priv->txbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->txbuffer = kmm_memalign(8, allocsize);
if (!priv->txbuffer)
{
nerr("ERROR: Failed to allocate TX buffer\n");
@ -971,7 +971,7 @@ static int sam_buffer_initialize(struct sam_emac_s *priv)
}
allocsize = priv->attr->nrxbuffers * EMAC_RX_UNITSIZE;
priv->rxbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->rxbuffer = kmm_memalign(8, allocsize);
if (!priv->rxbuffer)
{
nerr("ERROR: Failed to allocate RX buffer\n");

View File

@ -1857,8 +1857,7 @@ struct spi_dev_s *sam_flex_spibus_initialize(int port)
* chip select structures.
*/
flex_spics = (struct sam_flex_spics_s *)kmm_zalloc(
sizeof(struct sam_flex_spics_s));
flex_spics = kmm_zalloc(sizeof(struct sam_flex_spics_s));
if (!flex_spics)
{
spierr("ERROR: Failed to allocate a flexcom chip select structure\n");

View File

@ -560,7 +560,7 @@ static int sam_buffer_initialize(struct sam_gmac_s *priv)
/* Allocate buffers */
allocsize = CONFIG_SAMA5_GMAC_NTXBUFFERS * sizeof(struct gmac_txdesc_s);
priv->txdesc = (struct gmac_txdesc_s *)kmm_memalign(8, allocsize);
priv->txdesc = kmm_memalign(8, allocsize);
if (!priv->txdesc)
{
nerr("ERROR: Failed to allocate TX descriptors\n");
@ -570,7 +570,7 @@ static int sam_buffer_initialize(struct sam_gmac_s *priv)
memset(priv->txdesc, 0, allocsize);
allocsize = CONFIG_SAMA5_GMAC_NRXBUFFERS * sizeof(struct gmac_rxdesc_s);
priv->rxdesc = (struct gmac_rxdesc_s *)kmm_memalign(8, allocsize);
priv->rxdesc = kmm_memalign(8, allocsize);
if (!priv->rxdesc)
{
nerr("ERROR: Failed to allocate RX descriptors\n");
@ -581,7 +581,7 @@ static int sam_buffer_initialize(struct sam_gmac_s *priv)
memset(priv->rxdesc, 0, allocsize);
allocsize = CONFIG_SAMA5_GMAC_NTXBUFFERS * GMAC_TX_UNITSIZE;
priv->txbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->txbuffer = kmm_memalign(8, allocsize);
if (!priv->txbuffer)
{
nerr("ERROR: Failed to allocate TX buffer\n");
@ -590,7 +590,7 @@ static int sam_buffer_initialize(struct sam_gmac_s *priv)
}
allocsize = CONFIG_SAMA5_GMAC_NRXBUFFERS * GMAC_RX_UNITSIZE;
priv->rxbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->rxbuffer = kmm_memalign(8, allocsize);
if (!priv->rxbuffer)
{
nerr("ERROR: Failed to allocate RX buffer\n");

View File

@ -2672,7 +2672,7 @@ static int sam_epalloc(struct usbhost_driver_s *drvr,
/* Allocate a container for the endpoint data */
eplist = (struct sam_eplist_s *)kmm_zalloc(sizeof(struct sam_eplist_s));
eplist = kmm_zalloc(sizeof(struct sam_eplist_s));
if (!eplist)
{
usbhost_trace1(OHCI_TRACE1_EPLISTALLOC_FAILED, 0);

View File

@ -1831,7 +1831,7 @@ struct spi_dev_s *sam_spibus_initialize(int port)
* chip select structures.
*/
spics = (struct sam_spics_s *)kmm_zalloc(sizeof(struct sam_spics_s));
spics = kmm_zalloc(sizeof(struct sam_spics_s));
if (!spics)
{
spierr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -3336,7 +3336,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port)
* chip select structures.
*/
priv = (struct sam_ssc_s *)kmm_zalloc(sizeof(struct sam_ssc_s));
priv = kmm_zalloc(sizeof(struct sam_ssc_s));
if (!priv)
{
i2serr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -3518,7 +3518,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct sam_req_s *)kmm_malloc(sizeof(struct sam_req_s));
privreq = kmm_malloc(sizeof(struct sam_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);

View File

@ -469,7 +469,7 @@ struct adc_dev_s *sam_adcinitialize(int genclk)
g_sam_adc_dev.ad_ops = &sam_adc_ops;
priv->num_channels = BOARD_ADC_NUM_CHANNELS;
priv->channels = (int *)kmm_malloc(priv->num_channels * sizeof(int));
priv->channels = kmm_malloc(priv->num_channels * sizeof(int));
#if BOARD_ADC_REF == ADC_REFCTRL_REFSEL_VREFA
sam_configport(PORT_ADC_VREFA);

View File

@ -1644,7 +1644,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct sam_req_s *)kmm_malloc(sizeof(struct sam_req_s));
privreq = kmm_malloc(sizeof(struct sam_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);

View File

@ -557,7 +557,7 @@ static int sam_buffer_initialize(struct sam_gmac_s *priv)
/* Allocate buffers */
allocsize = CONFIG_SAMD5E5_GMAC_NTXBUFFERS * sizeof(struct gmac_txdesc_s);
priv->txdesc = (struct gmac_txdesc_s *)kmm_memalign(8, allocsize);
priv->txdesc = kmm_memalign(8, allocsize);
if (!priv->txdesc)
{
nerr("ERROR: Failed to allocate TX descriptors\n");
@ -567,7 +567,7 @@ static int sam_buffer_initialize(struct sam_gmac_s *priv)
memset(priv->txdesc, 0, allocsize);
allocsize = CONFIG_SAMD5E5_GMAC_NRXBUFFERS * sizeof(struct gmac_rxdesc_s);
priv->rxdesc = (struct gmac_rxdesc_s *)kmm_memalign(8, allocsize);
priv->rxdesc = kmm_memalign(8, allocsize);
if (!priv->rxdesc)
{
nerr("ERROR: Failed to allocate RX descriptors\n");
@ -578,7 +578,7 @@ static int sam_buffer_initialize(struct sam_gmac_s *priv)
memset(priv->rxdesc, 0, allocsize);
allocsize = CONFIG_SAMD5E5_GMAC_NTXBUFFERS * GMAC_TX_UNITSIZE;
priv->txbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->txbuffer = kmm_memalign(8, allocsize);
if (!priv->txbuffer)
{
nerr("ERROR: Failed to allocate TX buffer\n");
@ -587,7 +587,7 @@ static int sam_buffer_initialize(struct sam_gmac_s *priv)
}
allocsize = CONFIG_SAMD5E5_GMAC_NRXBUFFERS * GMAC_RX_UNITSIZE;
priv->rxbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->rxbuffer = kmm_memalign(8, allocsize);
if (!priv->rxbuffer)
{
nerr("ERROR: Failed to allocate RX buffer\n");

View File

@ -2316,7 +2316,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct sam_req_s *)kmm_zalloc(sizeof(struct sam_req_s));
privreq = kmm_zalloc(sizeof(struct sam_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);
@ -7138,7 +7138,7 @@ static int sam_alloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the SAM. */
alloc = (uint8_t *)kmm_malloc(CONFIG_SAM_DESCSIZE);
alloc = kmm_malloc(CONFIG_SAM_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@ -7225,7 +7225,7 @@ static int sam_ioalloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View File

@ -1141,7 +1141,7 @@ static int sam_buffer_allocate(struct sam_emac_s *priv)
priv->xfrq[0].nrxbuffers = priv->attr->nrxbuffers;
allocsize = priv->attr->ntxbuffers * EMAC_TX_UNITSIZE;
priv->xfrq[0].txbuffer = (uint8_t *)kmm_memalign(EMAC_ALIGN, allocsize);
priv->xfrq[0].txbuffer = kmm_memalign(EMAC_ALIGN, allocsize);
if (!priv->xfrq[0].txbuffer)
{
nerr("ERROR: Failed to allocate TX buffer\n");
@ -1152,7 +1152,7 @@ static int sam_buffer_allocate(struct sam_emac_s *priv)
priv->xfrq[0].txbufsize = EMAC_TX_UNITSIZE;
allocsize = priv->attr->nrxbuffers * EMAC_RX_UNITSIZE;
priv->xfrq[0].rxbuffer = (uint8_t *)kmm_memalign(EMAC_ALIGN, allocsize);
priv->xfrq[0].rxbuffer = kmm_memalign(EMAC_ALIGN, allocsize);
if (!priv->xfrq[0].rxbuffer)
{
nerr("ERROR: Failed to allocate RX buffer\n");
@ -1188,7 +1188,7 @@ static int sam_buffer_allocate(struct sam_emac_s *priv)
priv->xfrq[1].nrxbuffers = DUMMY_NBUFFERS;
allocsize = DUMMY_NBUFFERS * DUMMY_BUFSIZE;
priv->xfrq[1].txbuffer = (uint8_t *)kmm_memalign(EMAC_ALIGN, allocsize);
priv->xfrq[1].txbuffer = kmm_memalign(EMAC_ALIGN, allocsize);
if (!priv->xfrq[1].txbuffer)
{
nerr("ERROR: Failed to allocate TX buffer\n");
@ -1199,7 +1199,7 @@ static int sam_buffer_allocate(struct sam_emac_s *priv)
priv->xfrq[1].txbufsize = DUMMY_BUFSIZE;
allocsize = DUMMY_NBUFFERS * DUMMY_BUFSIZE;
priv->xfrq[1].rxbuffer = (uint8_t *)kmm_memalign(EMAC_ALIGN, allocsize);
priv->xfrq[1].rxbuffer = kmm_memalign(EMAC_ALIGN, allocsize);
if (!priv->xfrq[1].rxbuffer)
{
nerr("ERROR: Failed to allocate RX buffer\n");

View File

@ -775,7 +775,7 @@ struct spi_dev_s *sam_qspi_spi_initialize(int intf)
/* Allocate a new state structure for this chip select. */
spics = (struct sam_spics_s *)kmm_zalloc(sizeof(struct sam_spics_s));
spics = kmm_zalloc(sizeof(struct sam_spics_s));
if (!spics)
{
spierr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -2020,7 +2020,7 @@ struct spi_dev_s *sam_spibus_initialize(int port)
* chip select structures.
*/
spics = (struct sam_spics_s *)kmm_zalloc(sizeof(struct sam_spics_s));
spics = kmm_zalloc(sizeof(struct sam_spics_s));
if (!spics)
{
spierr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -3318,7 +3318,7 @@ struct i2s_dev_s *sam_ssc_initialize(int port)
* chip select structures.
*/
priv = (struct sam_ssc_s *)kmm_zalloc(sizeof(struct sam_ssc_s));
priv = kmm_zalloc(sizeof(struct sam_ssc_s));
if (!priv)
{
i2serr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -3928,7 +3928,7 @@ static struct usbdev_req_s *sam_ep_allocreq(struct usbdev_ep_s *ep)
DEBUGASSERT(ep != NULL);
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct sam_req_s *)kmm_malloc(sizeof(struct sam_req_s));
privreq = kmm_malloc(sizeof(struct sam_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(SAM_TRACEERR_ALLOCFAIL), 0);

View File

@ -2533,7 +2533,7 @@ struct i2s_dev_s *stm32_i2sbus_initialize(int port)
* chip select structures.
*/
priv = (struct stm32_i2s_s *)kmm_zalloc(sizeof(struct stm32_i2s_s));
priv = kmm_zalloc(sizeof(struct stm32_i2s_s));
if (!priv)
{
i2serr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -4412,7 +4412,7 @@ static struct usbdev_req_s *stm32_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct stm32_ep_s *)ep)->epphy);
privreq = (struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
privreq = kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);

View File

@ -4267,7 +4267,7 @@ static int stm32_alloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the STM32. */
alloc = (uint8_t *)kmm_malloc(CONFIG_STM32_OTGFS_DESCSIZE);
alloc = kmm_malloc(CONFIG_STM32_OTGFS_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@ -4351,7 +4351,7 @@ static int stm32_ioalloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View File

@ -4317,7 +4317,7 @@ static struct usbdev_req_s *stm32_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct stm32_ep_s *)ep)->epphy);
privreq = (struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
privreq = kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);

View File

@ -4268,7 +4268,7 @@ static int stm32_alloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the STM32. */
alloc = (uint8_t *)kmm_malloc(CONFIG_STM32_OTGHS_DESCSIZE);
alloc = kmm_malloc(CONFIG_STM32_OTGHS_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@ -4352,7 +4352,7 @@ static int stm32_ioalloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View File

@ -2997,7 +2997,7 @@ static struct usbdev_req_s *stm32_epallocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
privreq = kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);

View File

@ -2973,7 +2973,7 @@ static struct usbdev_req_s *stm32_epallocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
privreq = kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);

View File

@ -2921,7 +2921,7 @@ static struct usbdev_req_s *stm32_epallocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
privreq = kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);

View File

@ -4434,7 +4434,7 @@ static struct usbdev_req_s *stm32_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct stm32_ep_s *)ep)->epphy);
privreq = (struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
privreq = kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);

View File

@ -4243,7 +4243,7 @@ static int stm32_alloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the STM32. */
alloc = (uint8_t *)kmm_malloc(CONFIG_STM32F7_OTG_DESCSIZE);
alloc = kmm_malloc(CONFIG_STM32F7_OTG_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@ -4327,7 +4327,7 @@ static int stm32_ioalloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View File

@ -4373,7 +4373,7 @@ static struct usbdev_req_s *stm32_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((struct stm32_ep_s *)ep)->epphy);
privreq = (struct stm32_req_s *)kmm_malloc(sizeof(struct stm32_req_s));
privreq = kmm_malloc(sizeof(struct stm32_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0);

View File

@ -4272,7 +4272,7 @@ static int stm32_alloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the STM32. */
alloc = (uint8_t *)kmm_malloc(CONFIG_STM32H7_OTG_DESCSIZE);
alloc = kmm_malloc(CONFIG_STM32H7_OTG_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@ -4356,7 +4356,7 @@ static int stm32_ioalloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View File

@ -4272,7 +4272,7 @@ static int stm32l4_alloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the STM32. */
alloc = (uint8_t *)kmm_malloc(CONFIG_STM32L4_OTGFS_DESCSIZE);
alloc = kmm_malloc(CONFIG_STM32L4_OTGFS_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@ -4359,7 +4359,7 @@ static int stm32l4_ioalloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View File

@ -2956,7 +2956,7 @@ static struct usbdev_req_s *stm32l4_epallocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct stm32l4_req_s *)kmm_malloc(sizeof(struct stm32l4_req_s));
privreq = kmm_malloc(sizeof(struct stm32l4_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(STM32L4_TRACEERR_ALLOCFAIL), 0);

View File

@ -1793,7 +1793,7 @@ struct spi_dev_s *xmc4_spibus_initialize(int channel)
* chip select structures.
*/
spics = (struct xmc4_spics_s *)kmm_zalloc(sizeof(struct xmc4_spics_s));
spics = kmm_zalloc(sizeof(struct xmc4_spics_s));
if (!spics)
{
spierr("ERROR: Failed to allocate a chip select structure\n");

View File

@ -171,8 +171,7 @@ static int arm64_fpu_procfs_open(struct file *filep, const char *relpath,
/* Allocate the open file structure */
priv = (struct arm64_fpu_procfs_file_s *)kmm_zalloc(
sizeof(struct arm64_fpu_procfs_file_s));
priv = kmm_zalloc(sizeof(struct arm64_fpu_procfs_file_s));
if (priv == NULL)
{
uerr("ERROR: Failed to allocate file attributes\n");

View File

@ -2325,7 +2325,7 @@ static FAR struct usbdev_req_s *avr_epallocreq(FAR struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, ((FAR struct avr_ep_s *)ep)->ep.eplog);
privreq = (FAR struct avr_req_s *)kmm_malloc(sizeof(struct avr_req_s));
privreq = kmm_malloc(sizeof(struct avr_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(AVR_TRACEERR_ALLOCFAIL), 0);

View File

@ -3365,7 +3365,7 @@ static struct usbdev_req_s *pic32mx_epallocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct pic32mx_req_s *)kmm_malloc(sizeof(struct pic32mx_req_s));
privreq = kmm_malloc(sizeof(struct pic32mx_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(PIC32MX_TRACEERR_ALLOCFAIL), 0);

View File

@ -3025,7 +3025,7 @@ static struct usbdev_req_s *rx65n_epallocreq(struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct rx65n_req_s *)kmm_malloc(sizeof(struct rx65n_req_s));
privreq = kmm_malloc(sizeof(struct rx65n_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(RX65N_TRACEERR_ALLOCFAIL), 0);

View File

@ -6980,7 +6980,7 @@ static int rx65n_usbhost_ioalloc(struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;

View File

@ -366,9 +366,7 @@ struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
/* Allocate an instance of the lower half driver */
priv = (struct bl602_oneshot_lowerhalf_s *)kmm_zalloc(
sizeof(struct bl602_oneshot_lowerhalf_s));
priv = kmm_zalloc(sizeof(struct bl602_oneshot_lowerhalf_s));
if (priv == NULL)
{
tmrerr("ERROR: Failed to initialized state structure\n");

View File

@ -688,8 +688,7 @@ void *bl_os_mq_creat(uint32_t queue_len, uint32_t item_size)
struct mq_adpt *mq_adpt;
int ret;
mq_adpt = (struct mq_adpt *)kmm_malloc(sizeof(struct mq_adpt));
mq_adpt = kmm_malloc(sizeof(struct mq_adpt));
if (!mq_adpt)
{
wlerr("ERROR: Failed to kmm_malloc\n");
@ -931,10 +930,7 @@ static void bl_os_timer_callback(wdparm_t arg)
void *bl_os_timer_create(void *func, void *argv)
{
struct timer_adpt *timer;
timer = (struct timer_adpt *)kmm_malloc(sizeof(struct timer_adpt));
struct timer_adpt *timer = kmm_malloc(sizeof(struct timer_adpt));
if (!timer)
{
assert(0);
@ -1067,9 +1063,7 @@ int bl_os_timer_start_periodic(void *timerid, long t_sec, long t_nsec)
void *bl_os_workqueue_create(void)
{
struct work_s *work = NULL;
work = (struct work_s *)kmm_calloc(1, sizeof(struct work_s));
struct work_s *work = kmm_calloc(1, sizeof(struct work_s));
if (!work)
{
assert(0);
@ -1215,7 +1209,7 @@ void bl_os_irq_attach(int32_t n, void *f, void *arg)
wlinfo("INFO: n=%ld f=%p arg=%p\n", n, f, arg);
adapter = (struct irq_adpt *)kmm_malloc(sizeof(struct irq_adpt));
adapter = kmm_malloc(sizeof(struct irq_adpt));
if (!adapter)
{
@ -1286,7 +1280,7 @@ void *bl_os_mutex_create(void)
int tmp;
tmp = sizeof(mutex_t);
mutex = (mutex_t *)kmm_malloc(tmp);
mutex = kmm_malloc(tmp);
if (!mutex)
{
wlerr("ERROR: Failed to alloc %d memory\n", tmp);
@ -1404,7 +1398,7 @@ void *bl_os_sem_create(uint32_t init)
int tmp;
tmp = sizeof(sem_t);
sem = (sem_t *)kmm_malloc(tmp);
sem = kmm_malloc(tmp);
if (!sem)
{
wlerr("ERROR: Failed to alloc %d memory\n", tmp);

View File

@ -65,8 +65,7 @@ int up_addrenv_kstackalloc(struct tcb_s *tcb)
/* Allocate the kernel stack */
tcb->xcp.kstack = (uintptr_t *)kmm_memalign(STACK_ALIGNMENT,
ARCH_KERNEL_STACKSIZE);
tcb->xcp.kstack = kmm_memalign(STACK_ALIGNMENT, ARCH_KERNEL_STACKSIZE);
if (!tcb->xcp.kstack)
{
berr("ERROR: Failed to allocate the kernel stack\n");

View File

@ -1296,7 +1296,7 @@ int esp32c3_mpi_grow(struct esp32c3_mpi_s *X, size_t nblimbs)
if (X->n < nblimbs)
{
if ((p = (uint32_t *)calloc(nblimbs, CIL)) == NULL)
if ((p = calloc(nblimbs, CIL)) == NULL)
{
return ESP32C3_ERR_MPI_ALLOC_FAILED;
}
@ -1365,7 +1365,7 @@ int esp32c3_mpi_shrink(struct esp32c3_mpi_s *X, size_t nblimbs)
i = nblimbs;
}
if ((p = (uint32_t *)calloc(i, CIL)) == NULL)
if ((p = calloc(i, CIL)) == NULL)
{
return ESP32C3_ERR_MPI_ALLOC_FAILED;
}

View File

@ -348,9 +348,7 @@ struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
/* Allocate an instance of the lower half driver */
priv = (struct esp32c3_oneshot_lowerhalf_s *)kmm_zalloc(
sizeof(struct esp32c3_oneshot_lowerhalf_s));
priv = kmm_zalloc(sizeof(struct esp32c3_oneshot_lowerhalf_s));
if (priv == NULL)
{
tmrerr("ERROR: Failed to initialize oneshot state structure\n");

View File

@ -516,7 +516,7 @@ int rt_timer_create(const struct rt_timer_args_s *args,
{
struct rt_timer_s *timer;
timer = (struct rt_timer_s *)kmm_malloc(sizeof(*timer));
timer = kmm_malloc(sizeof(*timer));
if (!timer)
{
tmrerr("ERROR: Failed to allocate %d bytes\n", sizeof(*timer));

View File

@ -315,7 +315,7 @@ int esp_hr_timer_create(const struct esp_hr_timer_args_s *args,
{
struct esp_hr_timer_s *timer;
timer = (struct esp_hr_timer_s *)kmm_malloc(sizeof(*timer));
timer = kmm_malloc(sizeof(*timer));
if (timer == NULL)
{
tmrerr("Failed to allocate %d bytes\n", sizeof(*timer));

View File

@ -2708,7 +2708,7 @@ static int mpfs_buffer_initialize(struct mpfs_ethmac_s *priv,
memset(priv->queue[queue].rx_desc_tab, 0, allocsize);
allocsize = CONFIG_MPFS_ETHMAC_NTXBUFFERS * GMAC_TX_UNITSIZE;
priv->queue[queue].txbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->queue[queue].txbuffer = kmm_memalign(8, allocsize);
if (priv->queue[queue].txbuffer == NULL)
{
nerr("ERROR: Failed to allocate TX buffer\n");
@ -2717,7 +2717,7 @@ static int mpfs_buffer_initialize(struct mpfs_ethmac_s *priv,
}
allocsize = CONFIG_MPFS_ETHMAC_NRXBUFFERS * GMAC_RX_UNITSIZE;
priv->queue[queue].rxbuffer = (uint8_t *)kmm_memalign(8, allocsize);
priv->queue[queue].rxbuffer = kmm_memalign(8, allocsize);
if (priv->queue[queue].rxbuffer == NULL)
{
nerr("ERROR: Failed to allocate RX buffer\n");

View File

@ -1660,7 +1660,7 @@ static struct usbdev_req_s *mpfs_ep_allocreq(struct usbdev_ep_s *ep)
{
struct mpfs_req_s *privreq;
privreq = (struct mpfs_req_s *)kmm_malloc(sizeof(struct mpfs_req_s));
privreq = kmm_malloc(sizeof(struct mpfs_req_s));
if (privreq == NULL)
{
usbtrace(TRACE_DEVERROR(MPFS_TRACEERR_ALLOCFAIL), 0);

View File

@ -661,7 +661,7 @@ int rv32m1_gpio_irqattach(uint32_t cfgset, xcpt_t isr, void *arg)
e = sq_next(e);
}
priv = (struct rv32m1_isr_s *)kmm_malloc(sizeof(*priv));
priv = kmm_malloc(sizeof(*priv));
if (priv)
{
/* If it is the first time to attach an isr, the generic gpio

View File

@ -269,7 +269,7 @@ struct i2c_master_s *sim_i2cbus_initialize(int bus)
struct linux_i2cbus_master_s *priv;
char filename[20];
priv = (struct linux_i2cbus_master_s *)malloc(sizeof(*priv));
priv = malloc(sizeof(*priv));
if (priv == NULL)
{
ERROR("Failed to allocate private i2c master driver");

View File

@ -702,7 +702,7 @@ struct spi_dev_s *sim_spi_initialize(const char *filename)
{
struct linux_spi_dev_s *priv;
priv = (struct linux_spi_dev_s *)malloc(sizeof(*priv));
priv = malloc(sizeof(*priv));
if (priv == NULL)
{
ERROR("Failed to allocate private spi master driver");

View File

@ -231,7 +231,7 @@ static void host_raw_fifocreate(struct usb_raw_fifo_s *fifo,
fifo->read = 0;
fifo->elem_size = elem_size;
fifo->elem_num = elem_num;
fifo->elems = (uint8_t *)malloc(elem_size * elem_num);
fifo->elems = malloc(elem_size * elem_num);
}
static void host_raw_fifodelete(struct usb_raw_fifo_s *fifo)

View File

@ -322,7 +322,7 @@ shmerror:
#endif
b_useshm = 0;
g_framebuffer = (unsigned char *)malloc(fblen);
g_framebuffer = malloc(fblen);
g_image = XCreateImage(display, DefaultVisual(display, g_screen),
depth, ZPixmap, 0, (char *)g_framebuffer,

View File

@ -296,7 +296,7 @@ char *sim_deviceimage(void)
* reallocate this a few times to get the size right.
*/
pbuffer = (char *)kmm_malloc(bufsize);
pbuffer = kmm_malloc(bufsize);
/* Set up the input buffer */

View File

@ -180,7 +180,7 @@ static struct bthcisock_s *bthcisock_alloc(int dev_id)
struct bthcisock_s *dev;
struct bt_driver_s *drv;
dev = (struct bthcisock_s *)kmm_zalloc(sizeof(*dev));
dev = kmm_zalloc(sizeof(*dev));
if (dev == NULL)
{
return NULL;

View File

@ -660,7 +660,7 @@ static struct usbdev_req_s *sim_ep_allocreq(struct usbdev_ep_s *ep)
usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog));
privreq = (struct sim_req_s *)kmm_malloc(sizeof(struct sim_req_s));
privreq = kmm_malloc(sizeof(struct sim_req_s));
if (!privreq)
{
usbtrace(TRACE_DEVERROR(SIM_TRACEERR_ALLOCFAIL), 0);

View File

@ -386,7 +386,7 @@ static int sim_usbhost_epalloc(FAR struct usbhost_driver_s *drvr,
/* Allocate a endpoint information structure */
epinfo = (struct sim_epinfo_s *)kmm_zalloc(sizeof(struct sim_epinfo_s));
epinfo = kmm_zalloc(sizeof(struct sim_epinfo_s));
if (!epinfo)
{
return -ENOMEM;
@ -443,7 +443,7 @@ static int sim_usbhost_alloc(FAR struct usbhost_driver_s *drvr,
{
DEBUGASSERT(drvr && buffer && maxlen);
*buffer = (uint8_t *)kmm_malloc(SIM_USBHOST_BUFSIZE);
*buffer = kmm_malloc(SIM_USBHOST_BUFSIZE);
if (*buffer)
{
*maxlen = SIM_USBHOST_BUFSIZE;
@ -475,7 +475,7 @@ static int sim_usbhost_ioalloc(FAR struct usbhost_driver_s *drvr,
{
DEBUGASSERT(drvr && buffer && buflen > 0);
*buffer = (uint8_t *)kumm_malloc(buflen);
*buffer = kumm_malloc(buflen);
return *buffer ? OK : -ENOMEM;
}

View File

@ -182,8 +182,7 @@ static int xtensa_oneshot_interrupt(int irq, void *context, void *arg)
struct oneshot_lowerhalf_s *
xtensa_oneshot_initialize(uint32_t irq, uint32_t freq)
{
struct xoneshot_lowerhalf_s *lower =
(struct xoneshot_lowerhalf_s *)kmm_zalloc(sizeof(*lower));
struct xoneshot_lowerhalf_s *lower = kmm_zalloc(sizeof(*lower));
if (lower == NULL)
{

View File

@ -70,9 +70,9 @@ static struct file *g_mapped_filep; /* for multi device */
static int himem_chardev_open(struct file *filep)
{
struct himem_chardev_priv_s *priv;
struct himem_chardev_priv_s *priv =
kmm_malloc(sizeof(struct himem_chardev_priv_s));
priv = kmm_malloc(sizeof(struct himem_chardev_priv_s));
if (priv == NULL)
{
merr("Failed to malloc.\n");
@ -296,8 +296,8 @@ int himem_chardev_exit(void)
int himem_chardev_register(char *name, size_t size)
{
int ret = 0;
struct himem_chardev_s *dev;
dev = (struct himem_chardev_s *)kmm_malloc(sizeof(struct himem_chardev_s));
struct himem_chardev_s *dev =
kmm_malloc(sizeof(struct himem_chardev_s));
if (dev == NULL)
{
merr("Failed to malloc.\n");

View File

@ -348,9 +348,7 @@ struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
/* Allocate an instance of the lower half driver */
priv = (struct esp32_oneshot_lowerhalf_s *)kmm_zalloc(
sizeof(struct esp32_oneshot_lowerhalf_s));
priv = kmm_zalloc(sizeof(struct esp32_oneshot_lowerhalf_s));
if (priv == NULL)
{
tmrerr("ERROR: Failed to initialize oneshot state structure\n");

View File

@ -358,11 +358,8 @@ struct rmt_dev_s *esp32_rmtinitialize(void)
rmt_reset(rmtdev);
rmt_setup(rmtdev);
rmtdev->channels = kmm_zalloc(
sizeof(struct rmt_dev_channel_s)*
RMT_NUMBER_OF_CHANNELS
);
rmtdev->channels = kmm_zalloc(sizeof(struct rmt_dev_channel_s) *
RMT_NUMBER_OF_CHANNELS);
if (!rmtdev->channels)
{
rmterr("Failed to allocate memory for RMT Channels");

View File

@ -477,7 +477,7 @@ int rt_timer_create(const struct rt_timer_args_s *args,
{
struct rt_timer_s *timer;
timer = (struct rt_timer_s *)kmm_malloc(sizeof(*timer));
timer = kmm_malloc(sizeof(*timer));
if (!timer)
{
tmrerr("ERROR: Failed to allocate %d bytes\n", sizeof(*timer));

View File

@ -232,7 +232,7 @@ static void touch_init(void)
{
if (touch_mux == NULL)
{
touch_mux = (mutex_t *) kmm_zalloc(sizeof(mutex_t));
touch_mux = kmm_zalloc(sizeof(mutex_t));
if (touch_mux == NULL)
{

Some files were not shown because too many files have changed in this diff Show More