lkml.org 
[lkml]   [2020]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: wfx: simplify virt_addr_valid call
On Sat, Sep 12, 2020 at 07:47:19AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
>
> 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.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> 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 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;
> }

Jerome, any thoughts?

thanks,

greg k-h

\
 
 \ /
  Last update: 2020-09-16 21:56    [W:0.173 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site