Mimi Zohar <zohar@xxxxxxxxxxxxx> writes:
On Wed, 2019-09-18 at 10:15 -0400, Mimi Zohar wrote:of_get_property() is a thin wrapper around of_find_property(), so if
Sorry, my mistake. One calls of_get_property(), while the other calls+ uint64_t tmp_start, tmp_end;There seems to be quite a bit of code duplication in this function and
+
+ propStart = of_find_property(of_chosen, "linux,ima-kexec-buffer",
+ NULL);
+ if (propStart) {
+ tmp_start = fdt64_to_cpu(*((const fdt64_t *) propStart));
+ ret = of_remove_property(of_chosen, propStart);
+ if (!ret) {
+ return ret;
+ }
+
+ propEnd = of_find_property(of_chosen,
+ "linux,ima-kexec-buffer-end", NULL);
+ if (!propEnd) {
+ return -EINVAL;
+ }
+
+ tmp_end = fdt64_to_cpu(*((const fdt64_t *) propEnd));
+
+ ret = of_remove_property(of_chosen, propEnd);
+ if (!ret) {
+ return ret;
+ }
in ima_get_kexec_buffer(). It could probably be cleaned up with some
refactoring.
of_find_property().
that's the only difference I think they can still be merged.