static void sclp_conbuf_emit(void) { struct sclp_buffer* buffer; unsigned long flags; int rc; spin_lock_irqsave(&sclp_con_lock, flags); if (sclp_conbuf) list_add_tail(&sclp_conbuf->list, &sclp_con_outqueue); sclp_conbuf = NULL; if (sclp_con_queue_running || sclp_con_suspended) goto out_unlock; if (list_empty(&sclp_con_outqueue)) goto out_unlock; buffer = list_first_entry(&sclp_con_outqueue, struct sclp_buffer, list); sclp_con_queue_running = 1; spin_unlock_irqrestore(&sclp_con_lock, flags); rc = sclp_emit_buffer(buffer, sclp_conbuf_callback); if (rc) sclp_conbuf_callback(buffer, rc); return; out_unlock: spin_unlock_irqrestore(&sclp_con_lock, flags); }
static void sclp_conbuf_emit(void) { struct sclp_buffer* buffer; unsigned long flags; int count; int rc; spin_lock_irqsave(&sclp_con_lock, flags); buffer = sclp_conbuf; sclp_conbuf = NULL; if (buffer == NULL) { spin_unlock_irqrestore(&sclp_con_lock, flags); return; } list_add_tail(&buffer->list, &sclp_con_outqueue); count = sclp_con_buffer_count++; spin_unlock_irqrestore(&sclp_con_lock, flags); if (count) return; rc = sclp_emit_buffer(buffer, sclp_conbuf_callback); if (rc) sclp_conbuf_callback(buffer, rc); }