@@ -81,14 +81,14 @@ static uint8_t acquire_empty_slot(struct ns_mailbox_queue_t *queue)
8181 tfm_ns_mailbox_os_spin_lock ();
8282 status = queue -> empty_slots ;
8383
84- if (! status ) {
84+ if (status == 0U ) {
8585 /* No empty slot */
8686 tfm_ns_mailbox_os_spin_unlock ();
8787 return NUM_MAILBOX_QUEUE_SLOT ;
8888 }
8989
9090 for (idx = 0 ; idx < NUM_MAILBOX_QUEUE_SLOT ; idx ++ ) {
91- if (status & (1 << idx )) {
91+ if (status & (( uint32_t )( 1U << idx ) )) {
9292 clear_queue_slot_empty (queue , idx );
9393 break ;
9494 }
@@ -181,11 +181,11 @@ int32_t tfm_ns_mailbox_client_call(uint32_t call_type,
181181 uint8_t slot_idx = NUM_MAILBOX_QUEUE_SLOT ;
182182 int32_t ret ;
183183
184- if (! mailbox_queue_ptr ) {
184+ if (mailbox_queue_ptr == NULL ) {
185185 return MAILBOX_INIT_ERROR ;
186186 }
187187
188- if (! params || ! reply ) {
188+ if (( params == NULL ) || ( reply == NULL ) ) {
189189 return MAILBOX_INVAL_PARAMS ;
190190 }
191191
@@ -219,15 +219,15 @@ int32_t tfm_ns_mailbox_wake_reply_owner_isr(void)
219219 mailbox_queue_status_t replied_status ;
220220 uint32_t critical_section ;
221221
222- if (! mailbox_queue_ptr ) {
222+ if (mailbox_queue_ptr == NULL ) {
223223 return MAILBOX_INIT_ERROR ;
224224 }
225225
226226 critical_section = tfm_ns_mailbox_hal_enter_critical_isr ();
227227 replied_status = clear_queue_slot_all_replied (mailbox_queue_ptr );
228228 tfm_ns_mailbox_hal_exit_critical_isr (critical_section );
229229
230- if (! replied_status ) {
230+ if (replied_status == 0U ) {
231231 return MAILBOX_NO_PEND_EVENT ;
232232 }
233233
@@ -236,7 +236,7 @@ int32_t tfm_ns_mailbox_wake_reply_owner_isr(void)
236236 * The reply has already received from SPE mailbox but
237237 * the wake-up signal is not sent yet.
238238 */
239- if (! (replied_status & (0x1UL << idx ))) {
239+ if ((replied_status & (0x1UL << idx )) == 0U ) {
240240 continue ;
241241 }
242242
@@ -249,7 +249,7 @@ int32_t tfm_ns_mailbox_wake_reply_owner_isr(void)
249249 mailbox_queue_ptr -> slots_ns [idx ].owner );
250250
251251 replied_status &= ~(0x1UL << idx );
252- if (! replied_status ) {
252+ if (replied_status == 0U ) {
253253 break ;
254254 }
255255 }
0 commit comments