mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user