Commit 91bccf88 authored by Tom Rix's avatar Tom Rix Committed by Greg Kroah-Hartman

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: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20200912144719.13929-1-trix@redhat.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e0a739f4
......@@ -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;
}
......
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