diff --git a/arch/x86/scc/iRCCE_mailbox.c b/arch/x86/scc/iRCCE_mailbox.c index 5c5c4724..f968b6d1 100644 --- a/arch/x86/scc/iRCCE_mailbox.c +++ b/arch/x86/scc/iRCCE_mailbox.c @@ -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; }