/* Deliver a message's payload to its intended recipient.  */
void xpc_deliver_payload(struct xpc_channel *ch)
/* Deliver a message's payload to its intended recipient.  */
void xpc_deliver_payload(struct xpc_channel *ch)
{
	void *payload;
	payload = xpc_arch_ops.get_deliverable_payload(ch);
	if (payload != NULL) {
		xpc_msgqueue_ref(ch);
		atomic_inc(&ch->kthreads_active);
		if (ch->func != NULL) {
			dev_dbg(xpc_chan, "ch->func() called, payload=0x%p "
				"partid=%d channel=%d\n", payload, ch->partid,
				ch->number);
			ch->func(xpMsgReceived, ch->partid, ch->number, payload,
				 ch->key);
			dev_dbg(xpc_chan, "ch->func() returned, payload=0x%p "
				"partid=%d channel=%d\n", payload, ch->partid,
				ch->number);
		}
		atomic_dec(&ch->kthreads_active);
	}
}