Commit b1d362f4 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Greg Kroah-Hartman

staging: vchi: Rework vchi_msg_hold() to match vchiq_msg_hold()

The services have access to struct vchiq_header's internals, so we can
let them get the data pointer. This pretty much makes both functions
exactly the same, which will allow us to make a switch to
vchiq_msg_hold() further down the road.
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20200629150945.10720-34-nsaenzjulienne@suse.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c018ed1
...@@ -54,10 +54,7 @@ extern int vchi_queue_kernel_message(unsigned handle, void *data, ...@@ -54,10 +54,7 @@ extern int vchi_queue_kernel_message(unsigned handle, void *data,
// Routine to look at a message in place. // Routine to look at a message in place.
// The message is dequeued, so the caller is left holding it; the descriptor is // The message is dequeued, so the caller is left holding it; the descriptor is
// filled in and must be released when the user has finished with the message. // filled in and must be released when the user has finished with the message.
extern int32_t vchi_msg_hold(unsigned handle, struct vchiq_header *vchi_msg_hold(unsigned handle);
void **data, // } may be NULL, as info can be
uint32_t *msg_size, // } obtained from HELD_MSG_T
struct vchiq_header **message);
/******************************************************************************* /*******************************************************************************
* Global service support API - operations on held messages * Global service support API - operations on held messages
......
...@@ -154,20 +154,9 @@ EXPORT_SYMBOL(vchi_held_msg_release); ...@@ -154,20 +154,9 @@ EXPORT_SYMBOL(vchi_held_msg_release);
* Returns: int32_t - success == 0 * Returns: int32_t - success == 0
* *
***********************************************************/ ***********************************************************/
int32_t vchi_msg_hold(unsigned handle, void **data, uint32_t *msg_size, struct vchiq_header *vchi_msg_hold(unsigned handle)
struct vchiq_header **message)
{ {
struct vchiq_header *header; return vchiq_msg_hold(handle);
header = vchiq_msg_hold(handle);
if (!header)
return -ENOENT;
*data = header->data;
*msg_size = header->size;
*message = header;
return 0;
} }
EXPORT_SYMBOL(vchi_msg_hold); EXPORT_SYMBOL(vchi_msg_hold);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment