[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181015045927.156790-3-toddpoynor@gmail.com>
Date: Sun, 14 Oct 2018 21:59:18 -0700
From: Todd Poynor <toddpoynor@...il.com>
To: Rob Springer <rspringer@...gle.com>,
Ben Chan <benchan@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Todd Poynor <toddpoynor@...gle.com>
Subject: [PATCH 02/11] staging: gasket: page table: return valid error code on map fail
From: Todd Poynor <toddpoynor@...gle.com>
Return -EINVAL on mapping failures, instead of -1, which triggers a
checkpatch error.
Signed-off-by: Todd Poynor <toddpoynor@...gle.com>
---
drivers/staging/gasket/gasket_page_table.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c
index 964146f0df526..2e1de8ad4a2c6 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -514,13 +514,12 @@ static int gasket_perform_mapping(struct gasket_page_table *pg_tbl,
(void *)page_to_pfn(page),
(void *)page_to_phys(page));
- /* clean up */
if (gasket_release_page(ptes[i].page))
--pg_tbl->num_active_pages;
memset(&ptes[i], 0,
sizeof(struct gasket_page_table_entry));
- return -1;
+ return -EINVAL;
}
}
@@ -1165,7 +1164,7 @@ int gasket_page_table_lookup_page(
*ppage = NULL;
*poffset = 0;
mutex_unlock(&pg_tbl->mutex);
- return -1;
+ return -EINVAL;
}
/* See gasket_page_table.h for description. */
--
2.19.0.605.g01d371f741-goog
Powered by blists - more mailing lists