git: 695d3e52ea8f - main - xdma: Inline variables with simple values used once in a KASSERT().
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 13 Apr 2022 23:10:05 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=695d3e52ea8f0c118274bb8f2389e052b922a683
commit 695d3e52ea8f0c118274bb8f2389e052b922a683
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-13 23:08:23 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-13 23:08:23 +0000
xdma: Inline variables with simple values used once in a KASSERT().
---
sys/dev/xdma/xdma.c | 8 ++------
sys/dev/xdma/xdma_bank.c | 4 +---
sys/dev/xdma/xdma_queue.c | 8 ++------
3 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/sys/dev/xdma/xdma.c b/sys/dev/xdma/xdma.c
index 74caf6cba61c..1598886eccd6 100644
--- a/sys/dev/xdma/xdma.c
+++ b/sys/dev/xdma/xdma.c
@@ -265,10 +265,8 @@ xdma_teardown_all_intr(xdma_channel_t *xchan)
{
struct xdma_intr_handler *ih_tmp;
struct xdma_intr_handler *ih;
- xdma_controller_t *xdma;
- xdma = xchan->xdma;
- KASSERT(xdma != NULL, ("xdma is NULL"));
+ KASSERT(xchan->xdma != NULL, ("xdma is NULL"));
TAILQ_FOREACH_SAFE(ih, &xchan->ie_handlers, ih_next, ih_tmp) {
TAILQ_REMOVE(&xchan->ie_handlers, ih, ih_next);
@@ -326,11 +324,9 @@ xdma_callback(xdma_channel_t *xchan, xdma_transfer_status_t *status)
{
struct xdma_intr_handler *ih_tmp;
struct xdma_intr_handler *ih;
- xdma_controller_t *xdma;
struct epoch_tracker et;
- xdma = xchan->xdma;
- KASSERT(xdma != NULL, ("xdma is NULL"));
+ KASSERT(xchan->xdma != NULL, ("xdma is NULL"));
TAILQ_FOREACH_SAFE(ih, &xchan->ie_handlers, ih_next, ih_tmp) {
if (ih->cb != NULL) {
diff --git a/sys/dev/xdma/xdma_bank.c b/sys/dev/xdma/xdma_bank.c
index 14cab1224b95..dc5c882ad909 100644
--- a/sys/dev/xdma/xdma_bank.c
+++ b/sys/dev/xdma/xdma_bank.c
@@ -48,11 +48,9 @@ void
xchan_bank_init(xdma_channel_t *xchan)
{
struct xdma_request *xr;
- xdma_controller_t *xdma;
int i;
- xdma = xchan->xdma;
- KASSERT(xdma != NULL, ("xdma is NULL"));
+ KASSERT(xchan->xdma != NULL, ("xdma is NULL"));
xchan->xr_mem = malloc(sizeof(struct xdma_request) * xchan->xr_num,
M_XDMA, M_WAITOK | M_ZERO);
diff --git a/sys/dev/xdma/xdma_queue.c b/sys/dev/xdma/xdma_queue.c
index 8e8f932fc8de..ef755747edc7 100644
--- a/sys/dev/xdma/xdma_queue.c
+++ b/sys/dev/xdma/xdma_queue.c
@@ -76,10 +76,8 @@ xdma_enqueue(xdma_channel_t *xchan, uintptr_t src, uintptr_t dst,
enum xdma_direction dir, void *user)
{
struct xdma_request *xr;
- xdma_controller_t *xdma;
- xdma = xchan->xdma;
- KASSERT(xdma != NULL, ("xdma is NULL"));
+ KASSERT(xchan->xdma != NULL, ("xdma is NULL"));
xr = xchan_bank_get(xchan);
if (xr == NULL)
@@ -107,11 +105,9 @@ xdma_enqueue(xdma_channel_t *xchan, uintptr_t src, uintptr_t dst,
int
xdma_queue_submit(xdma_channel_t *xchan)
{
- xdma_controller_t *xdma;
int ret;
- xdma = xchan->xdma;
- KASSERT(xdma != NULL, ("xdma is NULL"));
+ KASSERT(xchan->xdma != NULL, ("xdma is NULL"));
ret = 0;