From 91bccf883e3cc4f3ab38db61538b68348a3ee9ee Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Sat, 12 Sep 2020 07:47:19 -0700 Subject: [PATCH] staging: wfx: simplify virt_addr_valid call MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20200912144719.13929-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wfx/fwio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c index 22d3b684f04ff..c99adb0c99f12 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; } -- 2.30.2