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
+1 -2
View File
@@ -629,8 +629,7 @@ static inline FAR struct usbhost_cdcmbim_s *usbhost_allocclass(void)
FAR struct usbhost_cdcmbim_s *priv;
DEBUGASSERT(!up_interrupt_context());
priv = (FAR struct usbhost_cdcmbim_s *)kmm_malloc(
sizeof(struct usbhost_cdcmbim_s));
priv = kmm_malloc(sizeof(struct usbhost_cdcmbim_s));
uinfo("Allocated: %p\n", priv);
return priv;
}
+1 -1
View File
@@ -773,7 +773,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport,
* configuration descriptor for each member class.
*/
cfgbuffer = (FAR uint8_t *)kmm_malloc(CUSTOM_CONFIG_BUFSIZE);
cfgbuffer = kmm_malloc(CUSTOM_CONFIG_BUFSIZE);
if (cfgbuffer == NULL)
{
uerr("ERROR: Failed to allocate configuration buffer");
+2 -2
View File
@@ -3781,7 +3781,7 @@ static int max3421e_alloc(FAR struct usbhost_driver_s *drvr,
/* There is no special memory requirement for the MAX3421E. */
alloc = (FAR uint8_t *)kmm_malloc(CONFIG_MAX3421E_DESCSIZE);
alloc = kmm_malloc(CONFIG_MAX3421E_DESCSIZE);
if (!alloc)
{
return -ENOMEM;
@@ -3866,7 +3866,7 @@ static int max3421e_ioalloc(FAR struct usbhost_driver_s *drvr,
/* There is no special memory requirement */
alloc = (FAR uint8_t *)kmm_malloc(buflen);
alloc = kmm_malloc(buflen);
if (!alloc)
{
return -ENOMEM;