usnic: fix 'fls' warnings+errors
The old version caused compilation errors on Solaris. Thanks to Paul Hargrove for testing and reporting the bug: http://www.open-mpi.org/community/lists/devel/2013/12/13520.php cmr=v1.7.4:reviewer=jsquyres This commit was SVN r30025.
Этот коммит содержится в:
родитель
92fdbbd7b1
Коммит
bd901a68ed
@ -2020,7 +2020,7 @@ int ompi_btl_usnic_module_init(ompi_btl_usnic_module_t *module)
|
||||
* simply won't be used in that case.
|
||||
*/
|
||||
module->first_pool = 16; /* 64 kiB */
|
||||
module->last_pool = fls(module->super.btl_eager_limit-1);
|
||||
module->last_pool = usnic_fls(module->super.btl_eager_limit-1);
|
||||
module->module_recv_buffers = calloc(module->last_pool+1,
|
||||
sizeof(ompi_free_list_t));
|
||||
assert(module->module_recv_buffers != NULL);
|
||||
|
@ -211,7 +211,7 @@ void ompi_btl_usnic_recv_call(ompi_btl_usnic_module_t *module,
|
||||
/* See which data pool this should come from,
|
||||
* or if it should be malloc()ed
|
||||
*/
|
||||
pool = fls(chunk_hdr->ch_frag_size-1);
|
||||
pool = usnic_fls(chunk_hdr->ch_frag_size-1);
|
||||
if (pool >= module->first_pool &&
|
||||
pool <= module->last_pool) {
|
||||
ompi_free_list_item_t* item;
|
||||
|
@ -15,8 +15,11 @@
|
||||
#include "btl_usnic.h"
|
||||
#include "btl_usnic_module.h"
|
||||
|
||||
/* Linux kernel fls() */
|
||||
static __always_inline int fls(int x)
|
||||
/* avoid "defined but not used" warnings */
|
||||
static int __opal_attribute_always_inline__ usnic_fls(int x)
|
||||
__opal_attribute_unused__;
|
||||
|
||||
static int __opal_attribute_always_inline__ usnic_fls(int x)
|
||||
{
|
||||
int r = 32;
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user