[PATCH V3 3/6] Update function do_get_kexec_buffer to use of_* functions, and reducing wrapper functions.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Prakhar Srivastava <prsriva@xxxxxxxxxxxxxxxxxxx>
---
 security/integrity/ima/ima_kexec.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/security/integrity/ima/ima_kexec.c b/security/integrity/ima/ima_kexec.c
index 2fe2d3bf7bda..e47982e9bb67 100644
--- a/security/integrity/ima/ima_kexec.c
+++ b/security/integrity/ima/ima_kexec.c
@@ -15,31 +15,21 @@
 #include <linux/libfdt.h>
 #include "ima.h"
 
-static int get_addr_size_cells(int *addr_cells, int *size_cells)
+static int do_get_kexec_buffer(const void *prop, int len, unsigned long *addr,
+			       size_t *size)
 {
+	int addr_cells, size_cells;
 	struct device_node *root;
 
 	root = of_find_node_by_path("/");
 	if (!root)
 		return -EINVAL;
 
-	*addr_cells = of_n_addr_cells(root);
-	*size_cells = of_n_size_cells(root);
+	addr_cells = of_n_addr_cells(root);
+	size_cells = of_n_size_cells(root);
 
 	of_node_put(root);
 
-	return 0;
-}
-
-static int do_get_kexec_buffer(const void *prop, int len, unsigned long *addr,
-			       size_t *size)
-{
-	int ret, addr_cells, size_cells;
-
-	ret = get_addr_size_cells(&addr_cells, &size_cells);
-	if (ret)
-		return ret;
-
 	if (len < 4 * (addr_cells + size_cells))
 		return -ENOENT;
 
-- 
2.25.1




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux