# HG changeset patch # User Florian Pose # Date 1213259466 0 # Node ID 05a24788f3b2f2ca4d5a536cc2e4c4f6c4c72664 # Parent 652180478e95379372ebf2ebdd8ac77f17a7c3e6 Replaced a few GFP_ATOMIC allocations with GFP_KERNEL ones. diff -r 652180478e95 -r 05a24788f3b2 TODO --- a/TODO Thu Jun 12 08:12:02 2008 +0000 +++ b/TODO Thu Jun 12 08:31:06 2008 +0000 @@ -25,8 +25,6 @@ * List of commands that require a slave. * Remove configs_attached flag. * Remove EC_IOCTL_DOMAIN_COUNT. -* Remove ATOMIC allocations. -* Clear FMMU configs. * Rename master MODE to STATE. Future issues: diff -r 652180478e95 -r 05a24788f3b2 master/datagram.c --- a/master/datagram.c Thu Jun 12 08:12:02 2008 +0000 +++ b/master/datagram.c Thu Jun 12 08:31:06 2008 +0000 @@ -146,7 +146,7 @@ datagram->mem_size = 0; } - if (!(datagram->data = kmalloc(size, GFP_ATOMIC))) { + if (!(datagram->data = kmalloc(size, GFP_KERNEL))) { EC_ERR("Failed to allocate %u bytes of datagram memory!\n", size); return -1; } diff -r 652180478e95 -r 05a24788f3b2 master/fsm_coe.c --- a/master/fsm_coe.c Thu Jun 12 08:12:02 2008 +0000 +++ b/master/fsm_coe.c Thu Jun 12 08:31:06 2008 +0000 @@ -466,7 +466,7 @@ continue; } - if (!(sdo = (ec_sdo_t *) kmalloc(sizeof(ec_sdo_t), GFP_ATOMIC))) { + if (!(sdo = (ec_sdo_t *) kmalloc(sizeof(ec_sdo_t), GFP_KERNEL))) { EC_ERR("Failed to allocate memory for Sdo!\n"); fsm->state = ec_fsm_coe_error; return; @@ -689,7 +689,7 @@ name_size = rec_size - 12; if (name_size) { - if (!(sdo->name = kmalloc(name_size + 1, GFP_ATOMIC))) { + if (!(sdo->name = kmalloc(name_size + 1, GFP_KERNEL))) { EC_ERR("Failed to allocate Sdo name!\n"); fsm->state = ec_fsm_coe_error; return; @@ -904,7 +904,7 @@ data_size = rec_size - 16; if (!(entry = (ec_sdo_entry_t *) - kmalloc(sizeof(ec_sdo_entry_t), GFP_ATOMIC))) { + kmalloc(sizeof(ec_sdo_entry_t), GFP_KERNEL))) { EC_ERR("Failed to allocate entry!\n"); fsm->state = ec_fsm_coe_error; return; @@ -916,7 +916,7 @@ if (data_size) { uint8_t *desc; - if (!(desc = kmalloc(data_size + 1, GFP_ATOMIC))) { + if (!(desc = kmalloc(data_size + 1, GFP_KERNEL))) { EC_ERR("Failed to allocate Sdo entry name!\n"); fsm->state = ec_fsm_coe_error; return; diff -r 652180478e95 -r 05a24788f3b2 master/fsm_master.c --- a/master/fsm_master.c Thu Jun 12 08:12:02 2008 +0000 +++ b/master/fsm_master.c Thu Jun 12 08:31:06 2008 +0000 @@ -243,8 +243,8 @@ // init slaves for (i = 0; i < master->slave_count; i++) { - if (!(slave = (ec_slave_t *) kmalloc(sizeof(ec_slave_t), - GFP_ATOMIC))) { + if (!(slave = (ec_slave_t *) + kmalloc(sizeof(ec_slave_t), GFP_KERNEL))) { EC_ERR("Failed to allocate slave %u!\n", i); ec_master_clear_slaves(master); master->scan_busy = 0; diff -r 652180478e95 -r 05a24788f3b2 master/fsm_slave_scan.c --- a/master/fsm_slave_scan.c Thu Jun 12 08:12:02 2008 +0000 +++ b/master/fsm_slave_scan.c Thu Jun 12 08:31:06 2008 +0000 @@ -404,7 +404,7 @@ } if (!(slave->sii_words = - (uint16_t *) kmalloc(slave->sii_nwords * 2, GFP_ATOMIC))) { + (uint16_t *) kmalloc(slave->sii_nwords * 2, GFP_KERNEL))) { EC_ERR("Failed to allocate %u words of SII data for slave %u.\n", slave->sii_nwords, slave->ring_position); slave->sii_nwords = 0;