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>
                tmp = buf;
        }
        ret = sram_buf_write(wdev, addr, tmp, len);
-       if (!virt_addr_valid(buf))
+       if (tmp != buf)
                kfree(tmp);
        return ret;
 }