[RFC PATCH 02/11] misc: pci_endpoint_test: Remove an unused variable

From: Shunsuke Mie
Date: Fri Mar 17 2023 - 07:33:10 EST


The use_dma variables are used only once. Remove those.

Signed-off-by: Shunsuke Mie <mie@xxxxxxxxxx>
---
drivers/misc/pci_endpoint_test.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index 22e0cc0b75d3..55733dee95ad 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -363,7 +363,6 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test,
void *src_addr;
void *dst_addr;
u32 flags = 0;
- bool use_dma;
size_t size;
dma_addr_t src_phys_addr;
dma_addr_t dst_phys_addr;
@@ -392,8 +391,7 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test,

size = param.size;

- use_dma = !!(param.flags & PCITEST_FLAGS_USE_DMA);
- if (use_dma)
+ if (param.flags & PCITEST_FLAGS_USE_DMA)
flags |= FLAG_USE_DMA;

orig_src_addr = kzalloc(size + alignment, GFP_KERNEL);
@@ -496,7 +494,6 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test,
struct pci_endpoint_test_xfer_param param;
bool ret = false;
u32 flags = 0;
- bool use_dma;
u32 reg;
void *addr;
dma_addr_t phys_addr;
@@ -523,8 +520,7 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test,

size = param.size;

- use_dma = !!(param.flags & PCITEST_FLAGS_USE_DMA);
- if (use_dma)
+ if (param.flags & PCITEST_FLAGS_USE_DMA)
flags |= FLAG_USE_DMA;

orig_addr = kzalloc(size + alignment, GFP_KERNEL);
@@ -592,7 +588,6 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test,
struct pci_endpoint_test_xfer_param param;
bool ret = false;
u32 flags = 0;
- bool use_dma;
size_t size;
void *addr;
dma_addr_t phys_addr;
@@ -618,8 +613,7 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test,

size = param.size;

- use_dma = !!(param.flags & PCITEST_FLAGS_USE_DMA);
- if (use_dma)
+ if (param.flags & PCITEST_FLAGS_USE_DMA)
flags |= FLAG_USE_DMA;

orig_addr = kzalloc(size + alignment, GFP_KERNEL);
--
2.25.1