summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2020-09-12 07:47:19 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-16 16:28:41 +0200
commit91bccf883e3cc4f3ab38db61538b68348a3ee9ee (patch)
tree8ce57cbc5c83e66066c815b84ea2ab6604581326 /drivers/staging/wfx
parente0a739f48ea33ae939009f2db28091e66024dbf9 (diff)
downloadlinux-stable-91bccf883e3cc4f3ab38db61538b68348a3ee9ee.tar.gz
linux-stable-91bccf883e3cc4f3ab38db61538b68348a3ee9ee.tar.bz2
linux-stable-91bccf883e3cc4f3ab38db61538b68348a3ee9ee.zip
staging: wfx: simplify virt_addr_valid call
Reviewing sram_write_dma_safe(), there are two identical calls to virt_addr_valid(). The second call can be simplified by a comparison of variables set from the first call. Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Signed-off-by: Tom Rix <trix@redhat.com> Link: https://lore.kernel.org/r/20200912144719.13929-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx')
-rw-r--r--drivers/staging/wfx/fwio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c
index 22d3b684f04f..c99adb0c99f1 100644
--- a/drivers/staging/wfx/fwio.c
+++ b/drivers/staging/wfx/fwio.c
@@ -94,7 +94,7 @@ static int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf,
tmp = buf;
}
ret = sram_buf_write(wdev, addr, tmp, len);
- if (!virt_addr_valid(buf))
+ if (tmp != buf)
kfree(tmp);
return ret;
}