From: trix@redhat.com
To: jerome.pouiller@silabs.com, gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Tom Rix <trix@redhat.com>
Subject: [PATCH] staging: wfx: simplify virt_addr_valid call
Date: Sat, 12 Sep 2020 07:47:19 -0700 [thread overview]
Message-ID: <20200912144719.13929-1-trix@redhat.com> (raw)
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;
}
--
2.18.1
next reply other threads:[~2020-09-12 14:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-12 14:47 trix [this message]
2020-09-16 11:11 ` [PATCH] staging: wfx: simplify virt_addr_valid call Greg KH
2020-09-16 12:22 ` Jérôme Pouiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200912144719.13929-1-trix@redhat.com \
--to=trix@redhat.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jerome.pouiller@silabs.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.