From: Tom Rix Date: Sat, 12 Sep 2020 14:47:19 +0000 (-0700) Subject: staging: wfx: simplify virt_addr_valid call X-Git-Tag: v5.15~2674^2~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91bccf883e3cc4f3ab38db61538b68348a3ee9ee;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20200912144719.13929-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c index 22d3b68..c99adb0 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; }