Commit 9b2cae6d authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman

staging: unisys: visorbus: handle visorchannel_write errors in code

Catch and report back errors when visorchannel_write fails.
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarTim Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 04dbc09b
...@@ -328,27 +328,24 @@ static int ...@@ -328,27 +328,24 @@ static int
signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg) signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg)
{ {
struct signal_queue_header sig_hdr; struct signal_queue_header sig_hdr;
int error; int err;
error = sig_read_header(channel, queue, &sig_hdr); err = sig_read_header(channel, queue, &sig_hdr);
if (error) if (err)
return error; return err;
sig_hdr.head = (sig_hdr.head + 1) % sig_hdr.max_slots; sig_hdr.head = (sig_hdr.head + 1) % sig_hdr.max_slots;
if (sig_hdr.head == sig_hdr.tail) { if (sig_hdr.head == sig_hdr.tail) {
sig_hdr.num_overflows++; sig_hdr.num_overflows++;
visorchannel_write(channel, err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_overflows);
SIG_QUEUE_OFFSET(&channel->chan_hdr, queue) + if (err)
offsetof(struct signal_queue_header, return err;
num_overflows),
&sig_hdr.num_overflows,
sizeof(sig_hdr.num_overflows));
return -EIO; return -EIO;
} }
error = sig_write_data(channel, queue, &sig_hdr, sig_hdr.head, msg); err = sig_write_data(channel, queue, &sig_hdr, sig_hdr.head, msg);
if (error) if (err)
return error; return err;
sig_hdr.num_sent++; sig_hdr.num_sent++;
...@@ -358,12 +355,12 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg) ...@@ -358,12 +355,12 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg)
*/ */
mb(); /* required for channel synch */ mb(); /* required for channel synch */
error = SIG_WRITE_FIELD(channel, queue, &sig_hdr, head); err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, head);
if (error) if (err)
return error; return err;
error = SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_sent); err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_sent);
if (error) if (err)
return error; return err;
return 0; return 0;
} }
......
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