WARN_ON(flags != VCHI_FLAGS_BLOCK_UNTIL_QUEUED);
 
-       status = vchiq_queue_message(service->handle, &element, 1);
+       while (1) {
+               status = vchiq_queue_message(service->handle, &element, 1);
+
+               /*
+                * vchiq_queue_message() may return VCHIQ_RETRY, so we need to
+                * implement a retry mechanism since this function is supposed
+                * to block until queued
+                */
+               if (status != VCHIQ_RETRY)
+                       break;
 
-       /* vchiq_queue_message() may return VCHIQ_RETRY, so we need to
-       ** implement a retry mechanism since this function is supposed
-       ** to block until queued
-       */
-       while (status == VCHIQ_RETRY) {
                msleep(1);
-               status = vchiq_queue_message(service->handle, &element, 1);
        }
 
        return vchiq_status_to_vchi(status);
                return vchiq_status_to_vchi(VCHIQ_ERROR);
        }
 
-       status = vchiq_bulk_receive(service->handle, data_dst, data_size,
-               bulk_handle, mode);
-
-       /* vchiq_bulk_receive() may return VCHIQ_RETRY, so we need to
-       ** implement a retry mechanism since this function is supposed
-       ** to block until queued
-       */
-       while (status == VCHIQ_RETRY) {
-               msleep(1);
+       while (1) {
                status = vchiq_bulk_receive(service->handle, data_dst,
                        data_size, bulk_handle, mode);
+               /*
+                * vchiq_bulk_receive() may return VCHIQ_RETRY, so we need to
+                * implement a retry mechanism since this function is supposed
+                * to block until queued
+                */
+               if (status != VCHIQ_RETRY)
+                       break;
+
+               msleep(1);
        }
 
        return vchiq_status_to_vchi(status);
                return vchiq_status_to_vchi(VCHIQ_ERROR);
        }
 
-       status = vchiq_bulk_transmit(service->handle, data_src, data_size,
-               bulk_handle, mode);
-
-       /* vchiq_bulk_transmit() may return VCHIQ_RETRY, so we need to
-       ** implement a retry mechanism since this function is supposed
-       ** to block until queued
-       */
-       while (status == VCHIQ_RETRY) {
-               msleep(1);
+       while (1) {
                status = vchiq_bulk_transmit(service->handle, data_src,
                        data_size, bulk_handle, mode);
+
+               /*
+                * vchiq_bulk_transmit() may return VCHIQ_RETRY, so we need to
+                * implement a retry mechanism since this function is supposed
+                * to block until queued
+                */
+               if (status != VCHIQ_RETRY)
+                       break;
+
+               msleep(1);
        }
 
        return vchiq_status_to_vchi(status);