[PATCH v2 6/6] libfdt: Allow control of FDT_RO_PROBE

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



This macro performs santity checks used by read-only functions. Allow
these checks to be disabled to reduce code size.

Signed-off-by: Simon Glass <sjg@xxxxxxxxxxxx>
---

Changes in v2:
- Update to use new check functions

 libfdt/libfdt_internal.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libfdt/libfdt_internal.h b/libfdt/libfdt_internal.h
index 741eeb3..4a4700b 100644
--- a/libfdt/libfdt_internal.h
+++ b/libfdt/libfdt_internal.h
@@ -14,8 +14,11 @@ int fdt_ro_probe_(const void *fdt);
 #define FDT_RO_PROBE(fdt)					\
 	{							\
 		int totalsize_;					\
-		if ((totalsize_ = fdt_ro_probe_(fdt)) < 0)	\
-			return totalsize_;			\
+		if (fdt_chk_basic()) {				\
+			totalsize_ = fdt_ro_probe_(fdt);	\
+			if (totalsize_ < 0)			\
+				return totalsize_;		\
+		}						\
 	}
 
 int fdt_check_node_offset_(const void *fdt, int offset);
-- 
2.22.0.770.g0f2c4a37fd-goog




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

  Powered by Linux