minor optimizations
This commit is contained in:
parent
9e286a567e
commit
b9664a0db4
1 changed files with 6 additions and 9 deletions
|
@ -104,8 +104,7 @@ static int iRCCE_mail_fetch(
|
|||
if( iRCCE_mail_garbage.first == NULL ) {
|
||||
iRCCE_mail_garbage.last = NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
header = (iRCCE_MAIL_HEADER*)kmalloc(sizeof(iRCCE_MAIL_HEADER));
|
||||
}
|
||||
|
||||
|
@ -120,8 +119,7 @@ static int iRCCE_mail_fetch(
|
|||
iRCCE_last_mail[rank] = 1;
|
||||
iRCCE_mailbox_close_one( rank, 0 ); // we can close respective mailbox
|
||||
iRCCE_mail_release( &header );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// check mail priority
|
||||
int prio = header->prio;
|
||||
|
||||
|
@ -163,7 +161,7 @@ static int iRCCE_mail_fetch(
|
|||
*
|
||||
*/
|
||||
//------------------------------------------------------------------------------
|
||||
const iRCCE_MAIL_HEADER dummy_header =
|
||||
const static iRCCE_MAIL_HEADER dummy_header =
|
||||
{0, 0, 0, NULL, 0, 0, 0, {[0 ... iRCCE_MAIL_HEADER_PAYLOAD-1] = 0} };
|
||||
|
||||
int iRCCE_mail_check(int sender) {
|
||||
|
@ -200,7 +198,7 @@ int iRCCE_mail_check(int sender) {
|
|||
}
|
||||
|
||||
// verify sender's ID
|
||||
if( (sender < 0) || (sender > RCCE_NP) || (sender == RCCE_IAM) ) {
|
||||
if(BUILTIN_EXPECT((sender < 0) || (sender > RCCE_NP) || (sender == RCCE_IAM), 0)) {
|
||||
return iRCCE_ERROR_SOURCE;
|
||||
}
|
||||
|
||||
|
@ -224,8 +222,7 @@ int iRCCE_mail_check(int sender) {
|
|||
irq_nested_enable(flags);
|
||||
|
||||
return iRCCE_SUCCESS;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return iRCCE_MAILBOX_EMPTY;
|
||||
}
|
||||
|
||||
|
@ -372,7 +369,7 @@ int iRCCE_mail_send(
|
|||
uint32_t flags;
|
||||
|
||||
// verify sender's ID
|
||||
if( (dest < 0) || (dest > RCCE_NP) || (dest == RCCE_IAM) ) {
|
||||
if(BUILTIN_EXPECT((dest < 0) || (dest > RCCE_NP) || (dest == RCCE_IAM),0)) {
|
||||
return iRCCE_ERROR_TARGET;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue