Reanem kzalloc to kmm_zalloc for consistency

This commit is contained in:
Gregory Nutt
2014-08-31 17:34:44 -06:00
parent ff2442a02e
commit 205260d5e2
76 changed files with 116 additions and 116 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (ttype == TCB_FLAG_TTYPE_KERNEL) if (ttype == TCB_FLAG_TTYPE_KERNEL)
{ {
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) #if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
#else #else
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif #endif
+1 -1
View File
@@ -3617,7 +3617,7 @@ static int lpc31_epalloc(FAR struct usbhost_driver_s *drvr,
/* Allocate a endpoint information structure */ /* Allocate a endpoint information structure */
epinfo = (struct lpc31_epinfo_s *)kzalloc(sizeof(struct lpc31_epinfo_s)); epinfo = (struct lpc31_epinfo_s *)kmm_zalloc(sizeof(struct lpc31_epinfo_s));
if (!epinfo) if (!epinfo)
{ {
usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0); usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0);
+1 -1
View File
@@ -3457,7 +3457,7 @@ static int sam_epalloc(FAR struct usbhost_driver_s *drvr,
/* Allocate a endpoint information structure */ /* Allocate a endpoint information structure */
epinfo = (struct sam_epinfo_s *)kzalloc(sizeof(struct sam_epinfo_s)); epinfo = (struct sam_epinfo_s *)kmm_zalloc(sizeof(struct sam_epinfo_s));
if (!epinfo) if (!epinfo)
{ {
usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0); usbhost_trace1(EHCI_TRACE1_EPALLOC_FAILED, 0);
+1 -1
View File
@@ -2359,7 +2359,7 @@ static int sam_epalloc(FAR struct usbhost_driver_s *drvr,
/* Allocate a container for the endpoint data */ /* Allocate a container for the endpoint data */
eplist = (struct sam_eplist_s *)kzalloc(sizeof(struct sam_eplist_s)); eplist = (struct sam_eplist_s *)kmm_zalloc(sizeof(struct sam_eplist_s));
if (!eplist) if (!eplist)
{ {
usbhost_trace1(OHCI_TRACE1_EPLISTALLOC_FAILED, 0); usbhost_trace1(OHCI_TRACE1_EPLISTALLOC_FAILED, 0);
+2 -2
View File
@@ -165,7 +165,7 @@ static int ccm_open(FAR struct file *filep, FAR const char *relpath,
/* Allocate a container to hold the task and attribute selection */ /* Allocate a container to hold the task and attribute selection */
priv = (FAR struct ccm_file_s *)kzalloc(sizeof(struct ccm_file_s)); priv = (FAR struct ccm_file_s *)kmm_zalloc(sizeof(struct ccm_file_s));
if (!priv) if (!priv)
{ {
fdbg("ERROR: Failed to allocate file attributes\n"); fdbg("ERROR: Failed to allocate file attributes\n");
@@ -282,7 +282,7 @@ static int ccm_dup(FAR const struct file *oldp, FAR struct file *newp)
/* Allocate a new container to hold the task and attribute selection */ /* Allocate a new container to hold the task and attribute selection */
newpriv = (FAR struct ccm_file_s *)kzalloc(sizeof(struct ccm_file_s)); newpriv = (FAR struct ccm_file_s *)kmm_zalloc(sizeof(struct ccm_file_s));
if (!newpriv) if (!newpriv)
{ {
fdbg("ERROR: Failed to allocate file attributes\n"); fdbg("ERROR: Failed to allocate file attributes\n");
+1 -1
View File
@@ -130,7 +130,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (ttype == TCB_FLAG_TTYPE_KERNEL) if (ttype == TCB_FLAG_TTYPE_KERNEL)
{ {
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) #if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
#else #else
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif #endif
+1 -1
View File
@@ -127,7 +127,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (ttype == TCB_FLAG_TTYPE_KERNEL) if (ttype == TCB_FLAG_TTYPE_KERNEL)
{ {
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) #if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
#else #else
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif #endif
+1 -1
View File
@@ -148,7 +148,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (ttype == TCB_FLAG_TTYPE_KERNEL) if (ttype == TCB_FLAG_TTYPE_KERNEL)
{ {
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) #if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
#else #else
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif #endif
+2 -2
View File
@@ -174,11 +174,11 @@ static uart_dev_t *up_alloc_com(unsigned int base, int irq)
uart_dev_t *dev; uart_dev_t *dev;
struct up_dev_s *priv; struct up_dev_s *priv;
priv = kzalloc(sizeof(struct up_dev_s)); priv = kmm_zalloc(sizeof(struct up_dev_s));
if (priv == NULL) if (priv == NULL)
goto err0; goto err0;
dev = kzalloc(sizeof(uart_dev_t)); dev = kmm_zalloc(sizeof(uart_dev_t));
if (dev == NULL) if (dev == NULL)
goto err1; goto err1;
+1 -1
View File
@@ -127,7 +127,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (ttype == TCB_FLAG_TTYPE_KERNEL) if (ttype == TCB_FLAG_TTYPE_KERNEL)
{ {
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) #if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
#else #else
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif #endif
+1 -1
View File
@@ -129,7 +129,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (ttype == TCB_FLAG_TTYPE_KERNEL) if (ttype == TCB_FLAG_TTYPE_KERNEL)
{ {
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) #if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
#else #else
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif #endif
+1 -1
View File
@@ -127,7 +127,7 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (ttype == TCB_FLAG_TTYPE_KERNEL) if (ttype == TCB_FLAG_TTYPE_KERNEL)
{ {
#if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK) #if defined(CONFIG_DEBUG) && !defined(CONFIG_DEBUG_STACK)
tcb->stack_alloc_ptr = (uint32_t *)kzalloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_zalloc(stack_size);
#else #else
tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size); tcb->stack_alloc_ptr = (uint32_t *)kmm_malloc(stack_size);
#endif #endif
+2 -2
View File
@@ -882,14 +882,14 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev)
/* Allocate the upper-half data structure */ /* Allocate the upper-half data structure */
upper = (FAR struct audio_upperhalf_s *)kzalloc(sizeof(struct audio_upperhalf_s)); upper = (FAR struct audio_upperhalf_s *)kmm_zalloc(sizeof(struct audio_upperhalf_s));
if (!upper) if (!upper)
{ {
auddbg("Allocation failed\n"); auddbg("Allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
/* Initialize the Audio device structure (it was already zeroed by kzalloc()) */ /* Initialize the Audio device structure (it was already zeroed by kmm_zalloc()) */
sem_init(&upper->exclsem, 0, 1); sem_init(&upper->exclsem, 0, 1);
upper->dev = dev; upper->dev = dev;
+2 -2
View File
@@ -1375,14 +1375,14 @@ FAR struct audio_lowerhalf_s *
/* Allocate an instance of our private data structure */ /* Allocate an instance of our private data structure */
priv = (FAR struct pcm_decode_s *)kzalloc(sizeof(struct pcm_decode_s)); priv = (FAR struct pcm_decode_s *)kmm_zalloc(sizeof(struct pcm_decode_s));
if (!priv) if (!priv)
{ {
auddbg("ERROR: Failed to allocate driver structure\n"); auddbg("ERROR: Failed to allocate driver structure\n");
return NULL; return NULL;
} }
/* Initialize our private data structure. Since kzalloc() was used for /* Initialize our private data structure. Since kmm_zalloc() was used for
* the allocation, we need to initialize only non-zero, non-NULL, non- * the allocation, we need to initialize only non-zero, non-NULL, non-
* false fields. * false fields.
*/ */
+1 -1
View File
@@ -106,7 +106,7 @@ int exec(FAR const char *filename, FAR char * const *argv,
/* Allocate the load information */ /* Allocate the load information */
bin = (FAR struct binary_s *)kzalloc(sizeof(struct binary_s)); bin = (FAR struct binary_s *)kmm_zalloc(sizeof(struct binary_s));
if (!bin) if (!bin)
{ {
set_errno(ENOMEM); set_errno(ENOMEM);
+1 -1
View File
@@ -156,7 +156,7 @@ int exec_module(FAR const struct binary_s *binp)
/* Allocate a TCB for the new task. */ /* Allocate a TCB for the new task. */
tcb = (FAR struct task_tcb_s*)kzalloc(sizeof(struct task_tcb_s)); tcb = (FAR struct task_tcb_s*)kmm_zalloc(sizeof(struct task_tcb_s));
if (!tcb) if (!tcb)
{ {
err = ENOMEM; err = ENOMEM;
+1 -1
View File
@@ -265,7 +265,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo);
* *
* Description: * Description:
* Allocate memory for the ELF image (textalloc and dataalloc). If * Allocate memory for the ELF image (textalloc and dataalloc). If
* CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kzalloc() and * CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc() and
* dataalloc will be a offset from textalloc. If CONFIG_ARCH_ADDRENV-y, then * dataalloc will be a offset from textalloc. If CONFIG_ARCH_ADDRENV-y, then
* textalloc and dataalloc will be allocated using up_addrenv_create(). In * textalloc and dataalloc will be allocated using up_addrenv_create(). In
* either case, there will be a unique instance of textalloc and dataalloc * either case, there will be a unique instance of textalloc and dataalloc
+1 -1
View File
@@ -68,7 +68,7 @@
* *
* Description: * Description:
* Allocate memory for the ELF image (textalloc and dataalloc). If * Allocate memory for the ELF image (textalloc and dataalloc). If
* CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kzalloc() and * CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc() and
* dataalloc will be a offset from textalloc. If CONFIG_ARCH_ADDRENV-y, then * dataalloc will be a offset from textalloc. If CONFIG_ARCH_ADDRENV-y, then
* textalloc and dataalloc will be allocated using up_addrenv_create(). In * textalloc and dataalloc will be allocated using up_addrenv_create(). In
* either case, there will be a unique instance of textalloc and dataalloc * either case, there will be a unique instance of textalloc and dataalloc
+1 -1
View File
@@ -60,7 +60,7 @@
* *
* Description: * Description:
* Allocate data memory for the NXFLAT image. If CONFIG_ARCH_ADDRENV=n, * Allocate data memory for the NXFLAT image. If CONFIG_ARCH_ADDRENV=n,
* memory will be allocated using kzalloc(). If CONFIG_ARCH_ADDRENV-y, * memory will be allocated using kmm_zalloc(). If CONFIG_ARCH_ADDRENV-y,
* then memory will be allocated using up_addrenv_create(). * then memory will be allocated using up_addrenv_create().
* *
* Input Parameters: * Input Parameters:
+1 -1
View File
@@ -69,7 +69,7 @@
* *
* Description: * Description:
* Allocate data memory for the NXFLAT image. If CONFIG_ARCH_ADDRENV=n, * Allocate data memory for the NXFLAT image. If CONFIG_ARCH_ADDRENV=n,
* memory will be allocated using kzalloc(). If CONFIG_ARCH_ADDRENV-y, * memory will be allocated using kmm_zalloc(). If CONFIG_ARCH_ADDRENV-y,
* then memory will be allocated using up_addrenv_create(). * then memory will be allocated using up_addrenv_create().
* *
* Input Parameters: * Input Parameters:
+1 -1
View File
@@ -62,7 +62,7 @@
static int do_test_aes(FAR struct cipher_testvec* test, int mode, int encrypt) static int do_test_aes(FAR struct cipher_testvec* test, int mode, int encrypt)
{ {
FAR void *out = kzalloc(test->rlen); FAR void *out = kmm_zalloc(test->rlen);
int res = aes_cypher(out, test->input, test->ilen, test->iv, test->key, int res = aes_cypher(out, test->input, test->ilen, test->iv, test->key,
test->klen, mode, encrypt); test->klen, mode, encrypt);
if (res == OK) if (res == OK)
+2 -2
View File
@@ -831,10 +831,10 @@ FAR struct audio_lowerhalf_s *audio_null_initialize(void)
/* Allocate the null audio device structure */ /* Allocate the null audio device structure */
priv = (FAR struct null_dev_s *)kzalloc(sizeof(struct null_dev_s)); priv = (FAR struct null_dev_s *)kmm_zalloc(sizeof(struct null_dev_s));
if (priv) if (priv)
{ {
/* Initialize the null audio device structure. Since we used kzalloc, /* Initialize the null audio device structure. Since we used kmm_zalloc,
* only the non-zero elements of the structure need to be initialized. * only the non-zero elements of the structure need to be initialized.
*/ */
+1 -1
View File
@@ -413,7 +413,7 @@ int i2schar_register(FAR struct i2s_dev_s *i2s, int minor)
/* Allocate a I2S character device structure */ /* Allocate a I2S character device structure */
priv = (FAR struct i2schar_dev_s *)kzalloc(sizeof(struct i2schar_dev_s)); priv = (FAR struct i2schar_dev_s *)kmm_zalloc(sizeof(struct i2schar_dev_s));
if (priv) if (priv)
{ {
/* Initialize the I2S character device structure */ /* Initialize the I2S character device structure */
+2 -2
View File
@@ -2470,10 +2470,10 @@ FAR struct audio_lowerhalf_s *
/* Allocate a WM8904 device structure */ /* Allocate a WM8904 device structure */
priv = (FAR struct wm8904_dev_s *)kzalloc(sizeof(struct wm8904_dev_s)); priv = (FAR struct wm8904_dev_s *)kmm_zalloc(sizeof(struct wm8904_dev_s));
if (priv) if (priv)
{ {
/* Initialize the WM8904 device structure. Since we used kzalloc, /* Initialize the WM8904 device structure. Since we used kmm_zalloc,
* only the non-zero elements of the structure need to be initialized. * only the non-zero elements of the structure need to be initialized.
*/ */
+1 -1
View File
@@ -93,7 +93,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
/* Allocate the BCH state structure */ /* Allocate the BCH state structure */
bch = (FAR struct bchlib_s*)kzalloc(sizeof(struct bchlib_s)); bch = (FAR struct bchlib_s*)kmm_zalloc(sizeof(struct bchlib_s));
if (!bch) if (!bch)
{ {
fdbg("Failed to allocate BCH structure\n"); fdbg("Failed to allocate BCH structure\n");
+3 -3
View File
@@ -1745,7 +1745,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv)
/* Allocate memory for the object table */ /* Allocate memory for the object table */
priv->objtab = kzalloc(info->nobjects * sizeof(struct mxt_object_s)); priv->objtab = kmm_zalloc(info->nobjects * sizeof(struct mxt_object_s));
if (priv->objtab == NULL) if (priv->objtab == NULL)
{ {
idbg("ERROR: Failed to allocate object table\n"); idbg("ERROR: Failed to allocate object table\n");
@@ -1807,7 +1807,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv)
/* Allocate a place to hold sample data for each slot */ /* Allocate a place to hold sample data for each slot */
priv->sample = (FAR struct mxt_sample_s *) priv->sample = (FAR struct mxt_sample_s *)
kzalloc(nslots * sizeof(struct mxt_sample_s)); kmm_zalloc(nslots * sizeof(struct mxt_sample_s));
if (priv->sample == NULL) if (priv->sample == NULL)
{ {
idbg("ERROR: Failed to allocate object table\n"); idbg("ERROR: Failed to allocate object table\n");
@@ -1863,7 +1863,7 @@ int mxt_register(FAR struct i2c_dev_s *i2c,
/* Create and initialize a maXTouch device driver instance */ /* Create and initialize a maXTouch device driver instance */
priv = (FAR struct mxt_dev_s *)kzalloc(sizeof(struct mxt_dev_s)); priv = (FAR struct mxt_dev_s *)kmm_zalloc(sizeof(struct mxt_dev_s));
if (priv == NULL) if (priv == NULL)
{ {
idbg("ERROR: Failed allocate device structure\n"); idbg("ERROR: Failed allocate device structure\n");
+1 -1
View File
@@ -297,7 +297,7 @@ STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev,
/* Allocate the device state structure */ /* Allocate the device state structure */
#ifdef CONFIG_STMPE811_MULTIPLE #ifdef CONFIG_STMPE811_MULTIPLE
priv = (FAR struct stmpe811_dev_s *)kzalloc(sizeof(struct stmpe811_dev_s)); priv = (FAR struct stmpe811_dev_s *)kmm_zalloc(sizeof(struct stmpe811_dev_s));
if (!priv) if (!priv)
{ {
return NULL; return NULL;
+1 -1
View File
@@ -381,7 +381,7 @@ int losetup(const char *devname, const char *filename, uint16_t sectsize,
/* Allocate a loop device structure */ /* Allocate a loop device structure */
dev = (FAR struct loop_struct_s *)kzalloc(sizeof(struct loop_struct_s)); dev = (FAR struct loop_struct_s *)kmm_zalloc(sizeof(struct loop_struct_s));
if (!dev) if (!dev)
{ {
return -ENOMEM; return -ENOMEM;
+2 -2
View File
@@ -674,11 +674,11 @@ FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct at25_dev_s *)kzalloc(sizeof(struct at25_dev_s)); priv = (FAR struct at25_dev_s *)kmm_zalloc(sizeof(struct at25_dev_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure (unsupported methods were /* Initialize the allocated structure (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
priv->mtd.erase = at25_erase; priv->mtd.erase = at25_erase;
+2 -2
View File
@@ -827,11 +827,11 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *spi)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct at45db_dev_s *)kzalloc(sizeof(struct at45db_dev_s)); priv = (FAR struct at45db_dev_s *)kmm_zalloc(sizeof(struct at45db_dev_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure. (unsupported methods were /* Initialize the allocated structure. (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
priv->mtd.erase = at45db_erase; priv->mtd.erase = at45db_erase;
+2 -2
View File
@@ -998,11 +998,11 @@ FAR struct mtd_dev_s *m25p_initialize(FAR struct spi_dev_s *dev)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct m25p_dev_s *)kzalloc(sizeof(struct m25p_dev_s)); priv = (FAR struct m25p_dev_s *)kmm_zalloc(sizeof(struct m25p_dev_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure. (unsupported methods were /* Initialize the allocated structure. (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
priv->mtd.erase = m25p_erase; priv->mtd.erase = m25p_erase;
+1 -1
View File
@@ -952,7 +952,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw)
/* Allocate an NAND MTD device structure */ /* Allocate an NAND MTD device structure */
nand = (FAR struct nand_dev_s *)kzalloc(sizeof(struct nand_dev_s)); nand = (FAR struct nand_dev_s *)kmm_zalloc(sizeof(struct nand_dev_s));
if (!nand) if (!nand)
{ {
fdbg("ERROR: Failed to allocate the NAND MTD device structure\n"); fdbg("ERROR: Failed to allocate the NAND MTD device structure\n");
+4 -4
View File
@@ -495,7 +495,7 @@ static int part_procfs_open(FAR struct file *filep, FAR const char *relpath,
/* Allocate a container to hold the task and attribute selection */ /* Allocate a container to hold the task and attribute selection */
attr = (FAR struct part_procfs_file_s *)kzalloc(sizeof(struct part_procfs_file_s)); attr = (FAR struct part_procfs_file_s *)kmm_zalloc(sizeof(struct part_procfs_file_s));
if (!attr) if (!attr)
{ {
fdbg("ERROR: Failed to allocate file attributes\n"); fdbg("ERROR: Failed to allocate file attributes\n");
@@ -711,7 +711,7 @@ static int part_procfs_dup(FAR const struct file *oldp, FAR struct file *newp)
/* Allocate a new container to hold the task and attribute selection */ /* Allocate a new container to hold the task and attribute selection */
newattr = (FAR struct part_procfs_file_s *)kzalloc(sizeof(struct part_procfs_file_s)); newattr = (FAR struct part_procfs_file_s *)kmm_zalloc(sizeof(struct part_procfs_file_s));
if (!newattr) if (!newattr)
{ {
fdbg("ERROR: Failed to allocate file attributes\n"); fdbg("ERROR: Failed to allocate file attributes\n");
@@ -833,7 +833,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock,
/* Allocate a partition device structure */ /* Allocate a partition device structure */
part = (FAR struct mtd_partition_s *)kzalloc(sizeof(struct mtd_partition_s)); part = (FAR struct mtd_partition_s *)kmm_zalloc(sizeof(struct mtd_partition_s));
if (!part) if (!part)
{ {
fdbg("ERROR: Failed to allocate memory for the partition device\n"); fdbg("ERROR: Failed to allocate memory for the partition device\n");
@@ -841,7 +841,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, off_t firstblock,
} }
/* Initialize the partition device structure. (unsupported methods were /* Initialize the partition device structure. (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
part->child.erase = part_erase; part->child.erase = part_erase;
+2 -2
View File
@@ -156,7 +156,7 @@ static int mtd_open(FAR struct file *filep, FAR const char *relpath,
/* Allocate a context structure */ /* Allocate a context structure */
attr = (FAR struct mtd_file_s *)kzalloc(sizeof(struct mtd_file_s)); attr = (FAR struct mtd_file_s *)kmm_zalloc(sizeof(struct mtd_file_s));
if (!attr) if (!attr)
{ {
fdbg("ERROR: Failed to allocate file attributes\n"); fdbg("ERROR: Failed to allocate file attributes\n");
@@ -276,7 +276,7 @@ static int mtd_dup(FAR const struct file *oldp, FAR struct file *newp)
/* Allocate a new container to hold the task and attribute selection */ /* Allocate a new container to hold the task and attribute selection */
newattr = (FAR struct mtd_file_s *)kzalloc(sizeof(struct mtd_file_s)); newattr = (FAR struct mtd_file_s *)kmm_zalloc(sizeof(struct mtd_file_s));
if (!newattr) if (!newattr)
{ {
fdbg("ERROR: Failed to allocate file attributes\n"); fdbg("ERROR: Failed to allocate file attributes\n");
+2 -2
View File
@@ -356,11 +356,11 @@ FAR struct mtd_dev_s *mtd_rwb_initialize(FAR struct mtd_dev_s *mtd)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct mtd_rwbuffer_s *)kzalloc(sizeof(struct mtd_rwbuffer_s)); priv = (FAR struct mtd_rwbuffer_s *)kmm_zalloc(sizeof(struct mtd_rwbuffer_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure. (unsupported methods/fields /* Initialize the allocated structure. (unsupported methods/fields
* were already nullified by kzalloc). * were already nullified by kmm_zalloc).
*/ */
priv->mtd.erase = mtd_erase; /* Our MTD erase method */ priv->mtd.erase = mtd_erase; /* Our MTD erase method */
+2 -2
View File
@@ -443,7 +443,7 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size)
/* Create an instance of the RAM MTD device state structure */ /* Create an instance of the RAM MTD device state structure */
priv = (FAR struct ram_dev_s *)kzalloc(sizeof(struct ram_dev_s)); priv = (FAR struct ram_dev_s *)kmm_zalloc(sizeof(struct ram_dev_s));
if (!priv) if (!priv)
{ {
fdbg("Failed to allocate the RAM MTD state structure\n"); fdbg("Failed to allocate the RAM MTD state structure\n");
@@ -460,7 +460,7 @@ FAR struct mtd_dev_s *rammtd_initialize(FAR uint8_t *start, size_t size)
} }
/* Perform initialization as necessary. (unsupported methods were /* Perform initialization as necessary. (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
priv->mtd.erase = ram_erase; priv->mtd.erase = ram_erase;
+2 -2
View File
@@ -689,11 +689,11 @@ FAR struct mtd_dev_s *ramtron_initialize(FAR struct spi_dev_s *dev)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct ramtron_dev_s *)kzalloc(sizeof(struct ramtron_dev_s)); priv = (FAR struct ramtron_dev_s *)kmm_zalloc(sizeof(struct ramtron_dev_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure. (unsupported methods were /* Initialize the allocated structure. (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
priv->mtd.erase = ramtron_erase; priv->mtd.erase = ramtron_erase;
+2 -2
View File
@@ -603,11 +603,11 @@ FAR struct mtd_dev_s *s512_initialize(FAR struct mtd_dev_s *mtd)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct s512_dev_s *)kzalloc(sizeof(struct s512_dev_s)); priv = (FAR struct s512_dev_s *)kmm_zalloc(sizeof(struct s512_dev_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure. (unsupported methods/fields /* Initialize the allocated structure. (unsupported methods/fields
* were already nullified by kzalloc). * were already nullified by kmm_zalloc).
*/ */
priv->mtd.erase = s512_erase; priv->mtd.erase = s512_erase;
+2 -2
View File
@@ -1203,11 +1203,11 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct sst25_dev_s *)kzalloc(sizeof(struct sst25_dev_s)); priv = (FAR struct sst25_dev_s *)kmm_zalloc(sizeof(struct sst25_dev_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure. (unsupported methods were /* Initialize the allocated structure. (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
priv->mtd.erase = sst25_erase; priv->mtd.erase = sst25_erase;
+2 -2
View File
@@ -952,11 +952,11 @@ FAR struct mtd_dev_s *sst25xx_initialize(FAR struct spi_dev_s *dev)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct sst25xx_dev_s *)kzalloc(sizeof(struct sst25xx_dev_s)); priv = (FAR struct sst25xx_dev_s *)kmm_zalloc(sizeof(struct sst25xx_dev_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure. (unsupported methods were /* Initialize the allocated structure. (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
priv->mtd.erase = sst25xx_erase; priv->mtd.erase = sst25xx_erase;
+2 -2
View File
@@ -1135,11 +1135,11 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi)
* to be extended to handle multiple FLASH parts on the same SPI bus. * to be extended to handle multiple FLASH parts on the same SPI bus.
*/ */
priv = (FAR struct w25_dev_s *)kzalloc(sizeof(struct w25_dev_s)); priv = (FAR struct w25_dev_s *)kmm_zalloc(sizeof(struct w25_dev_s));
if (priv) if (priv)
{ {
/* Initialize the allocated structure (unsupported methods were /* Initialize the allocated structure (unsupported methods were
* nullified by kzalloc). * nullified by kmm_zalloc).
*/ */
priv->mtd.erase = w25_erase; priv->mtd.erase = w25_erase;
+1 -1
View File
@@ -982,7 +982,7 @@ static int e1000_probe(uint16_t addr, pci_id_t id)
/* alloc e1000_dev memory */ /* alloc e1000_dev memory */
if ((dev = kzalloc(sizeof(struct e1000_dev))) == NULL) if ((dev = kmm_zalloc(sizeof(struct e1000_dev))) == NULL)
{ {
return -1; return -1;
} }
+1 -1
View File
@@ -531,7 +531,7 @@ FAR struct battery_dev_s *max1704x_initialize(FAR struct i2c_dev_s *i2c,
/* Initialize the MAX1704x device structure */ /* Initialize the MAX1704x device structure */
priv = (FAR struct max1704x_dev_s *)kzalloc(sizeof(struct max1704x_dev_s)); priv = (FAR struct max1704x_dev_s *)kmm_zalloc(sizeof(struct max1704x_dev_s));
if (priv) if (priv)
{ {
/* Initialize the MAX1704x device structure */ /* Initialize the MAX1704x device structure */
+2 -2
View File
@@ -588,14 +588,14 @@ int pwm_register(FAR const char *path, FAR struct pwm_lowerhalf_s *dev)
/* Allocate the upper-half data structure */ /* Allocate the upper-half data structure */
upper = (FAR struct pwm_upperhalf_s *)kzalloc(sizeof(struct pwm_upperhalf_s)); upper = (FAR struct pwm_upperhalf_s *)kmm_zalloc(sizeof(struct pwm_upperhalf_s));
if (!upper) if (!upper)
{ {
pwmdbg("Allocation failed\n"); pwmdbg("Allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
/* Initialize the PWM device structure (it was already zeroed by kzalloc()) */ /* Initialize the PWM device structure (it was already zeroed by kmm_zalloc()) */
sem_init(&upper->exclsem, 0, 1); sem_init(&upper->exclsem, 0, 1);
#ifdef CONFIG_PWM_PULSECOUNT #ifdef CONFIG_PWM_PULSECOUNT
+2 -2
View File
@@ -382,14 +382,14 @@ int qe_register(FAR const char *devpath, FAR struct qe_lowerhalf_s *lower)
/* Allocate the upper-half data structure */ /* Allocate the upper-half data structure */
upper = (FAR struct qe_upperhalf_s *)kzalloc(sizeof(struct qe_upperhalf_s)); upper = (FAR struct qe_upperhalf_s *)kmm_zalloc(sizeof(struct qe_upperhalf_s));
if (!upper) if (!upper)
{ {
qedbg("Allocation failed\n"); qedbg("Allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
/* Initialize the PWM device structure (it was already zeroed by kzalloc()) */ /* Initialize the PWM device structure (it was already zeroed by kmm_zalloc()) */
sem_init(&upper->exclsem, 0, 1); sem_init(&upper->exclsem, 0, 1);
upper->lower = lower; upper->lower = lower;
+1 -1
View File
@@ -654,7 +654,7 @@ int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen)
/* Allocate a RAM logging device structure */ /* Allocate a RAM logging device structure */
priv = (struct ramlog_dev_s *)kzalloc(sizeof(struct ramlog_dev_s)); priv = (struct ramlog_dev_s *)kmm_zalloc(sizeof(struct ramlog_dev_s));
if (priv) if (priv)
{ {
/* Initialize the non-zero values in the RAM logging device structure */ /* Initialize the non-zero values in the RAM logging device structure */
+2 -2
View File
@@ -481,7 +481,7 @@ FAR void *timer_register(FAR const char *path,
/* Allocate the upper-half data structure */ /* Allocate the upper-half data structure */
upper = (FAR struct timer_upperhalf_s *) upper = (FAR struct timer_upperhalf_s *)
kzalloc(sizeof(struct timer_upperhalf_s)); kmm_zalloc(sizeof(struct timer_upperhalf_s));
if (!upper) if (!upper)
{ {
tmrdbg("Upper half allocation failed\n"); tmrdbg("Upper half allocation failed\n");
@@ -489,7 +489,7 @@ FAR void *timer_register(FAR const char *path,
} }
/* Initialize the timer device structure (it was already zeroed /* Initialize the timer device structure (it was already zeroed
* by kzalloc()). * by kmm_zalloc()).
*/ */
//sem_init(&upper->exclsem, 0, 1); //sem_init(&upper->exclsem, 0, 1);
+2 -2
View File
@@ -483,7 +483,7 @@ FAR void *watchdog_register(FAR const char *path,
/* Allocate the upper-half data structure */ /* Allocate the upper-half data structure */
upper = (FAR struct watchdog_upperhalf_s *) upper = (FAR struct watchdog_upperhalf_s *)
kzalloc(sizeof(struct watchdog_upperhalf_s)); kmm_zalloc(sizeof(struct watchdog_upperhalf_s));
if (!upper) if (!upper)
{ {
wddbg("Upper half allocation failed\n"); wddbg("Upper half allocation failed\n");
@@ -491,7 +491,7 @@ FAR void *watchdog_register(FAR const char *path,
} }
/* Initialize the watchdog timer device structure (it was already zeroed /* Initialize the watchdog timer device structure (it was already zeroed
* by kzalloc()). * by kmm_zalloc()).
*/ */
sem_init(&upper->exclsem, 0, 1); sem_init(&upper->exclsem, 0, 1);
+2 -2
View File
@@ -306,7 +306,7 @@ static int fat_open(FAR struct file *filep, const char *relpath,
* file. * file.
*/ */
ff = (struct fat_file_s *)kzalloc(sizeof(struct fat_file_s)); ff = (struct fat_file_s *)kmm_zalloc(sizeof(struct fat_file_s));
if (!ff) if (!ff)
{ {
ret = -ENOMEM; ret = -ENOMEM;
@@ -1756,7 +1756,7 @@ static int fat_bind(FAR struct inode *blkdriver, const void *data,
/* Create an instance of the mountpt state structure */ /* Create an instance of the mountpt state structure */
fs = (struct fat_mountpt_s *)kzalloc(sizeof(struct fat_mountpt_s)); fs = (struct fat_mountpt_s *)kmm_zalloc(sizeof(struct fat_mountpt_s));
if (!fs) if (!fs)
{ {
return -ENOMEM; return -ENOMEM;
+1 -1
View File
@@ -546,7 +546,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower)
/* Allocate an auto-mounter state structure */ /* Allocate an auto-mounter state structure */
priv = (FAR struct automounter_state_s *) priv = (FAR struct automounter_state_s *)
kzalloc(sizeof(struct automounter_state_s)); kmm_zalloc(sizeof(struct automounter_state_s));
if (!priv) if (!priv)
{ {

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