Commit 34b479ae authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: unisys: Eliminate visor_memregion_write()

visorchannel's signal code should call visorchannel_write() directly.
This is more consistent and cleaner, and allows us to remove the last
memregion call.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3b5bd6cc
...@@ -250,8 +250,8 @@ visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch, ...@@ -250,8 +250,8 @@ visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
if (nbytes < thisbytes) if (nbytes < thisbytes)
thisbytes = nbytes; thisbytes = nbytes;
err = visor_memregion_write(&channel->memregion, err = visorchannel_write(channel, offset + written,
offset + written, buf, thisbytes); buf, thisbytes);
if (err) if (err)
goto cleanup; goto cleanup;
...@@ -290,12 +290,12 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header); ...@@ -290,12 +290,12 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header);
/** Write the contents of a specific field within a SIGNAL_QUEUE_HEADER back /** Write the contents of a specific field within a SIGNAL_QUEUE_HEADER back
* into host memory * into host memory
*/ */
#define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \ #define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \
(visor_memregion_write(&channel->memregion, \ (visorchannel_write(channel, \
SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+ \ SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+ \
offsetof(struct signal_queue_header, FIELD),\ offsetof(struct signal_queue_header, FIELD), \
&((sig_hdr)->FIELD), \ &((sig_hdr)->FIELD), \
sizeof((sig_hdr)->FIELD)) >= 0) sizeof((sig_hdr)->FIELD)) >= 0)
static BOOL static BOOL
sig_read_header(struct visorchannel *channel, u32 queue, sig_read_header(struct visorchannel *channel, u32 queue,
...@@ -340,9 +340,8 @@ sig_write_data(struct visorchannel *channel, u32 queue, ...@@ -340,9 +340,8 @@ sig_write_data(struct visorchannel *channel, u32 queue,
int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue, int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
sig_hdr, slot); sig_hdr, slot);
err = visor_memregion_write(&channel->memregion, err = visorchannel_write(channel, signal_data_offset,
signal_data_offset, data, sig_hdr->signal_size);
data, sig_hdr->signal_size);
if (err) if (err)
return FALSE; return FALSE;
...@@ -403,13 +402,12 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg) ...@@ -403,13 +402,12 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg)
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++;
visor_memregion_write(&channel->memregion, visorchannel_write(channel,
SIG_QUEUE_OFFSET(&channel->chan_hdr, SIG_QUEUE_OFFSET(&channel->chan_hdr, queue) +
queue) + offsetof(struct signal_queue_header,
offsetof(struct signal_queue_header, num_overflows),
num_overflows), &(sig_hdr.num_overflows),
&(sig_hdr.num_overflows), sizeof(sig_hdr.num_overflows));
sizeof(sig_hdr.num_overflows));
return FALSE; return FALSE;
} }
......
...@@ -29,8 +29,6 @@ struct memregion { ...@@ -29,8 +29,6 @@ struct memregion {
void __iomem *mapped; void __iomem *mapped;
}; };
int visor_memregion_write(struct memregion *memregion,
ulong offset, void *src, ulong nbytes);
void memregion_dump(struct memregion *memregion, char *s, void memregion_dump(struct memregion *memregion, char *s,
ulong off, ulong len, struct seq_file *seq); ulong off, ulong len, struct seq_file *seq);
......
...@@ -24,15 +24,3 @@ ...@@ -24,15 +24,3 @@
#include "memregion.h" #include "memregion.h"
#define MYDRVNAME "memregion" #define MYDRVNAME "memregion"
int
visor_memregion_write(struct memregion *memregion, ulong offset, void *src,
ulong nbytes)
{
if (offset + nbytes > memregion->nbytes)
return -EIO;
memcpy_toio(memregion->mapped + offset, src, nbytes);
return 0;
}
EXPORT_SYMBOL_GPL(visor_memregion_write);
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