aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchannel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/unisys/visorbus/visorchannel.c')
-rw-r--r--drivers/staging/unisys/visorbus/visorchannel.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c
index 891b8db7c5ec..b68a904ac617 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -73,7 +73,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
channel = kzalloc(sizeof(*channel), gfp);
if (!channel)
- goto cleanup;
+ return NULL;
channel->needs_lock = needs_lock;
spin_lock_init(&channel->insert_lock);
@@ -89,14 +89,14 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
if (!channel->requested) {
if (uuid_le_cmp(guid, spar_video_guid)) {
/* Not the video channel we care about this */
- goto cleanup;
+ goto err_destroy_channel;
}
}
channel->mapped = memremap(physaddr, size, MEMREMAP_WB);
if (!channel->mapped) {
release_mem_region(physaddr, size);
- goto cleanup;
+ goto err_destroy_channel;
}
channel->physaddr = physaddr;
@@ -105,7 +105,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
err = visorchannel_read(channel, 0, &channel->chan_hdr,
sizeof(struct channel_header));
if (err)
- goto cleanup;
+ goto err_destroy_channel;
/* we had better be a CLIENT of this channel */
if (channel_bytes == 0)
@@ -122,7 +122,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
if (!channel->requested) {
if (uuid_le_cmp(guid, spar_video_guid)) {
/* Different we care about this */
- goto cleanup;
+ goto err_destroy_channel;
}
}
@@ -130,7 +130,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
MEMREMAP_WB);
if (!channel->mapped) {
release_mem_region(channel->physaddr, channel_bytes);
- goto cleanup;
+ goto err_destroy_channel;
}
channel->nbytes = channel_bytes;
@@ -139,7 +139,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
channel->guid = guid;
return channel;
-cleanup:
+err_destroy_channel:
visorchannel_destroy(channel);
return NULL;
}
@@ -293,14 +293,14 @@ visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
err = visorchannel_write(channel, offset + written,
buf, thisbytes);
if (err)
- goto cleanup;
+ goto out_free_page;
written += thisbytes;
nbytes -= thisbytes;
}
err = 0;
-cleanup:
+out_free_page:
free_page((unsigned long)buf);
return err;
}
@@ -461,7 +461,7 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg)
if (!sig_read_header(channel, queue, &sig_hdr))
return false;
- 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) {
sig_hdr.num_overflows++;
visorchannel_write(channel,
@@ -521,7 +521,7 @@ visorchannel_signalqueue_slots_avail(struct visorchannel *channel, u32 queue)
tail = sig_hdr.tail;
if (head < tail)
head = head + sig_hdr.max_slots;
- slots_used = (head - tail);
+ slots_used = head - tail;
slots_avail = sig_hdr.max_signals - slots_used;
return (int)slots_avail;
}