sgi-xp: move xpc_allocate() into xpc_send()/xpc_send_notify()
Move xpc_allocate() functionality into xpc_send()/xpc_send_notify() so
xpc_allocate() no longer needs to be called by XPNET.
Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c
index 9c540eb..f9356ba 100644
--- a/drivers/misc/sgi-xp/xpnet.c
+++ b/drivers/misc/sgi-xp/xpnet.c
@@ -438,7 +438,8 @@
{
struct xpnet_pending_msg *queued_msg;
enum xp_retval ret;
- struct xpnet_message *msg;
+ u8 msg_buffer[XPNET_MSG_SIZE];
+ struct xpnet_message *msg = (struct xpnet_message *)&msg_buffer[0];
u64 start_addr, end_addr;
long dp;
u8 second_mac_octet;
@@ -524,11 +525,6 @@
/* found a partition to send to */
- ret = xpc_allocate(dest_partid, XPC_NET_CHANNEL,
- XPC_NOWAIT, (void **)&msg);
- if (unlikely(ret != xpSuccess))
- continue;
-
msg->embedded_bytes = embedded_bytes;
if (unlikely(embedded_bytes != 0)) {
msg->version = XPNET_VERSION_EMBED;
@@ -553,7 +549,8 @@
atomic_inc(&queued_msg->use_count);
- ret = xpc_send_notify(dest_partid, XPC_NET_CHANNEL, msg,
+ ret = xpc_send_notify(dest_partid, XPC_NET_CHANNEL, XPC_NOWAIT,
+ &msg, sizeof(msg) + embedded_bytes - 1,
xpnet_send_completed, queued_msg);
if (unlikely(ret != xpSuccess)) {
atomic_dec(&queued_msg->use_count);