lkml.org 
[lkml]   [2018]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 13/18] staging: gasket: gasket_enable_dev fixups
Date
From: Todd Poynor <toddpoynor@google.com>

Remove unnecessary variable.

Bail out if no physical device.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
drivers/staging/gasket/gasket_core.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 65aa7cf454fb..f7d8f66e8746 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -915,8 +915,6 @@ static int gasket_enable_dev(
{
int tbl_idx;
int ret;
- bool has_dma_ops;
- struct device *ddev;
const struct gasket_driver_desc *driver_desc =
internal_desc->driver_desc;

@@ -934,26 +932,21 @@ static int gasket_enable_dev(
return ret;
}

- has_dma_ops = true;
+ if (!gasket_dev->pci_dev) {
+ gasket_log_error(gasket_dev,
+ "%s: no physical device", __func__);
+ return -ENODEV;
+ }

for (tbl_idx = 0; tbl_idx < driver_desc->num_page_tables; tbl_idx++) {
gasket_log_debug(
gasket_dev, "Initializing page table %d.", tbl_idx);
- if (gasket_dev->pci_dev) {
- ddev = &gasket_dev->pci_dev->dev;
- } else {
- gasket_log_error(
- gasket_dev,
- "gasket_enable_dev with no physical device!!");
- WARN_ON(1);
- ddev = NULL;
- }
ret = gasket_page_table_init(
&gasket_dev->page_table[tbl_idx],
&gasket_dev->bar_data[
driver_desc->page_table_bar_index],
&driver_desc->page_table_configs[tbl_idx],
- ddev, gasket_dev->pci_dev, has_dma_ops);
+ &gasket_dev->pci_dev->dev, gasket_dev->pci_dev, true);
if (ret) {
gasket_log_error(
gasket_dev,
--
2.18.0.203.gfac676dfb9-goog
\
 
 \ /
  Last update: 2018-07-15 22:07    [W:0.233 / U:9.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site