Commit b1436fe3 authored by Sam Muhammed's avatar Sam Muhammed Committed by Greg Kroah-Hartman

Staging: kpc2000: kpc_dma: Remove unnecessary braces.

Remove braces of single statement blocks,
they are not really needed.
Signed-off-by: default avatarSam Muhammed <jane.pnx9@gmail.com>
Link: https://lore.kernel.org/r/0a3ec63321dce008fc8dd790f42ef8490135b307.1585143581.git.jane.pnx9@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5122be4f
......@@ -97,11 +97,10 @@ int setup_dma_engine(struct kpc_dma_device *eng, u32 desc_cnt)
if (WARN(!(caps & ENG_CAP_PRESENT), "%s() called for DMA Engine at %p which isn't present in hardware!\n", __func__, eng))
return -ENXIO;
if (caps & ENG_CAP_DIRECTION) {
if (caps & ENG_CAP_DIRECTION)
eng->dir = DMA_FROM_DEVICE;
} else {
else
eng->dir = DMA_TO_DEVICE;
}
eng->desc_pool_cnt = desc_cnt;
eng->desc_pool = dma_pool_create("KPC DMA Descriptors", &eng->pldev->dev, sizeof(struct kpc_dma_descriptor), DMA_DESC_ALIGNMENT, 4096);
......
......@@ -126,11 +126,11 @@ static int kpc_dma_transfer(struct dev_private_data *priv,
// Fill out the descriptor
BUG_ON(!desc);
clear_desc(desc);
if (p != pcnt-1) {
if (p != pcnt-1)
desc->DescByteCount = 0x80000;
} else {
else
desc->DescByteCount = sg_dma_len(sg) - (p * 0x80000);
}
desc->DescBufferByteCount = desc->DescByteCount;
desc->DescControlFlags |= DMA_DESC_CTL_IRQONERR;
......@@ -148,9 +148,9 @@ static int kpc_dma_transfer(struct dev_private_data *priv,
desc->DescSystemAddrMS = (dma_addr & 0xFFFFFFFF00000000UL) >> 32;
user_ctl = acd->priv->user_ctl;
if (i == acd->mapped_entry_count-1 && p == pcnt-1) {
if (i == acd->mapped_entry_count-1 && p == pcnt-1)
user_ctl = acd->priv->user_ctl_last;
}
desc->DescUserControlLS = (user_ctl & 0x00000000FFFFFFFFUL) >> 0;
desc->DescUserControlMS = (user_ctl & 0xFFFFFFFF00000000UL) >> 32;
......@@ -188,9 +188,9 @@ static int kpc_dma_transfer(struct dev_private_data *priv,
sg_free_table(&acd->sgt);
err_dma_map_sg:
err_alloc_sg_table:
for (i = 0 ; i < acd->page_count ; i++) {
for (i = 0 ; i < acd->page_count ; i++)
put_page(acd->user_pages[i]);
}
err_get_user_pages:
kfree(acd->user_pages);
err_alloc_userpages:
......@@ -210,16 +210,14 @@ void transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags)
BUG_ON(!acd->ldev->pldev);
for (i = 0 ; i < acd->page_count ; i++) {
if (!PageReserved(acd->user_pages[i])) {
if (!PageReserved(acd->user_pages[i]))
set_page_dirty(acd->user_pages[i]);
}
}
dma_unmap_sg(&acd->ldev->pldev->dev, acd->sgt.sgl, acd->sgt.nents, acd->ldev->dir);
for (i = 0 ; i < acd->page_count ; i++) {
for (i = 0 ; i < acd->page_count ; i++)
put_page(acd->user_pages[i]);
}
sg_free_table(&acd->sgt);
......
......@@ -26,10 +26,9 @@ struct kpc_dma_device *kpc_dma_lookup_device(int minor)
mutex_lock(&kpc_dma_mtx);
list_for_each_entry(c, &kpc_dma_list, list) {
if (c->pldev->id == minor) {
if (c->pldev->id == minor)
goto out;
}
}
c = NULL; // not-found case
out:
mutex_unlock(&kpc_dma_mtx);
......
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