[rtems commit] libfdt: De-inline fdt_header_size()

Sebastian Huber sebh at rtems.org
Mon Mar 2 06:52:34 UTC 2020


Module:    rtems
Branch:    master
Commit:    461c735406fbfa7264913a439d569c31eb3ab7a3
Changeset: http://git.rtems.org/rtems/commit/?id=461c735406fbfa7264913a439d569c31eb3ab7a3

Author:    Simon Glass <sjg at chromium.org>
Date:      Thu Feb 20 14:45:50 2020 -0700

libfdt: De-inline fdt_header_size()

There does not seem to be a strong reason to inline this function. Also
we are about to add some extra code to it which will increase its size.

Move it into fdt.c and use a simple declaration in libfdt.h

Signed-off-by: Simon Glass <sjg at chromium.org>
Message-Id: <20200220214557.176528-2-sjg at chromium.org>
Signed-off-by: David Gibson <david at gibson.dropbear.id.au>

---

 cpukit/dtc/libfdt/fdt.c | 5 +++++
 cpukit/include/libfdt.h | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/cpukit/dtc/libfdt/fdt.c b/cpukit/dtc/libfdt/fdt.c
index d6ce7c0..3e37a4b 100644
--- a/cpukit/dtc/libfdt/fdt.c
+++ b/cpukit/dtc/libfdt/fdt.c
@@ -70,6 +70,11 @@ size_t fdt_header_size_(uint32_t version)
 		return FDT_V17_SIZE;
 }
 
+size_t fdt_header_size(const void *fdt)
+{
+	return fdt_header_size_(fdt_version(fdt));
+}
+
 int fdt_check_header(const void *fdt)
 {
 	size_t hdrsize;
diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h
index fc4c496..48f375c 100644
--- a/cpukit/include/libfdt.h
+++ b/cpukit/include/libfdt.h
@@ -266,11 +266,12 @@ fdt_set_hdr_(size_dt_struct);
  * fdt_header_size - return the size of the tree's header
  * @fdt: pointer to a flattened device tree
  */
+size_t fdt_header_size(const void *fdt);
+
+/**
+ * fdt_header_size_ - internal function which takes a version number
+ */
 size_t fdt_header_size_(uint32_t version);
-static inline size_t fdt_header_size(const void *fdt)
-{
-	return fdt_header_size_(fdt_version(fdt));
-}
 
 /**
  * fdt_check_header - sanity check a device tree header



More information about the vc mailing list