* [PATCH] Use the libfdt.h include as the interface definition
@ 2013-01-28 2:35 Gerald Van Baren
[not found] ` <5105E3EA.2070306-He//nVnquyzQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Gerald Van Baren @ 2013-01-28 2:35 UTC (permalink / raw)
To: Devicetree Discuss, David Gibson, Jon Loeliger
libfdt.h is the libfdt interface definition. It includes fdt.h and
libfdt_env.h, so there is no reason to include those in the general code.
Signed-off-by: Gerald Van Baren <vanbaren-He//nVnquyzQT0dZR+AlfA@public.gmane.org>
---
No code changes, just cleaning up the #include situation WRT libfdt.h,
fdt.h, and libfdt_env.h (the later two being redundant).
I looked at moving the fdt64_t, fdt32_t, fdt16_t definitions from
libfdt_env.h to fdt.h. I'm not sure this is a Good Thing[tm], but will
send a separate patch for consideration and discussion.
dtc.h | 3 +--
fdtdump.c | 3 +--
libfdt/fdt.c | 3 ---
libfdt/fdt_empty_tree.c | 3 ---
libfdt/fdt_ro.c | 3 ---
libfdt/fdt_rw.c | 3 ---
libfdt/fdt_strerror.c | 3 ---
libfdt/fdt_sw.c | 3 ---
libfdt/fdt_wip.c | 3 ---
libfdt/libfdt_internal.h | 1 -
10 files changed, 2 insertions(+), 26 deletions(-)
diff --git a/dtc.h b/dtc.h
index 3e42a07..a032645 100644
--- a/dtc.h
+++ b/dtc.h
@@ -32,8 +32,7 @@
#include <errno.h>
#include <unistd.h>
-#include <libfdt_env.h>
-#include <fdt.h>
+#include <libfdt.h>
#include "util.h"
diff --git a/fdtdump.c b/fdtdump.c
index b2c5b37..3919490 100644
--- a/fdtdump.c
+++ b/fdtdump.c
@@ -8,8 +8,7 @@
#include <string.h>
#include <ctype.h>
-#include <libfdt_env.h>
-#include <fdt.h>
+#include <libfdt.h>
#include "util.h"
diff --git a/libfdt/fdt.c b/libfdt/fdt.c
index 57faba3..19b9043 100644
--- a/libfdt/fdt.c
+++ b/libfdt/fdt.c
@@ -48,11 +48,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libfdt_env.h"
-#include <fdt.h>
#include <libfdt.h>
-
#include "libfdt_internal.h"
int fdt_check_header(const void *fdt)
diff --git a/libfdt/fdt_empty_tree.c b/libfdt/fdt_empty_tree.c
index f72d13b..30c5525 100644
--- a/libfdt/fdt_empty_tree.c
+++ b/libfdt/fdt_empty_tree.c
@@ -48,11 +48,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libfdt_env.h"
-#include <fdt.h>
#include <libfdt.h>
-
#include "libfdt_internal.h"
int fdt_create_empty_tree(void *buf, int bufsize)
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 42da2bd..53c61ed 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -48,11 +48,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libfdt_env.h"
-#include <fdt.h>
#include <libfdt.h>
-
#include "libfdt_internal.h"
static int _fdt_nodename_eq(const void *fdt, int offset,
diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c
index fdba618..b6a8815 100644
--- a/libfdt/fdt_rw.c
+++ b/libfdt/fdt_rw.c
@@ -48,11 +48,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libfdt_env.h"
-#include <fdt.h>
#include <libfdt.h>
-
#include "libfdt_internal.h"
static int _fdt_blocks_misordered(const void *fdt,
diff --git a/libfdt/fdt_strerror.c b/libfdt/fdt_strerror.c
--- a/libfdt/fdt_strerror.c
+++ b/libfdt/fdt_strerror.c
@@ -48,11 +48,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libfdt_env.h"
-#include <fdt.h>
#include <libfdt.h>
-
#include "libfdt_internal.h"
struct fdt_errtabent {
diff --git a/libfdt/fdt_sw.c b/libfdt/fdt_sw.c
index f422754..85aaedf 100644
--- a/libfdt/fdt_sw.c
+++ b/libfdt/fdt_sw.c
@@ -48,11 +48,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libfdt_env.h"
-#include <fdt.h>
#include <libfdt.h>
-
#include "libfdt_internal.h"
static int _fdt_sw_check_header(void *fdt)
diff --git a/libfdt/fdt_wip.c b/libfdt/fdt_wip.c
index c5bbb68..67fa7ca 100644
--- a/libfdt/fdt_wip.c
+++ b/libfdt/fdt_wip.c
@@ -48,11 +48,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "libfdt_env.h"
-#include <fdt.h>
#include <libfdt.h>
-
#include "libfdt_internal.h"
int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
diff --git a/libfdt/libfdt_internal.h b/libfdt/libfdt_internal.h
index 381133b..a8b36f4 100644
--- a/libfdt/libfdt_internal.h
+++ b/libfdt/libfdt_internal.h
@@ -50,7 +50,6 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <fdt.h>
#define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
#define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Use the libfdt.h include as the interface definition
[not found] ` <5105E3EA.2070306-He//nVnquyzQT0dZR+AlfA@public.gmane.org>
@ 2013-01-29 1:20 ` David Gibson
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2013-01-29 1:20 UTC (permalink / raw)
To: Gerald Van Baren; +Cc: Devicetree Discuss
[-- Attachment #1.1: Type: text/plain, Size: 1986 bytes --]
On Sun, Jan 27, 2013 at 09:35:22PM -0500, Gerald Van Baren wrote:
> libfdt.h is the libfdt interface definition. It includes fdt.h and
> libfdt_env.h, so there is no reason to include those in the general code.
>
> Signed-off-by: Gerald Van Baren <vanbaren-He//nVnquyzQT0dZR+AlfA@public.gmane.org>
> ---
>
> No code changes, just cleaning up the #include situation WRT libfdt.h,
> fdt.h, and libfdt_env.h (the later two being redundant).
>
> I looked at moving the fdt64_t, fdt32_t, fdt16_t definitions from
> libfdt_env.h to fdt.h. I'm not sure this is a Good Thing[tm], but will
> send a separate patch for consideration and discussion.
>
> dtc.h | 3 +--
> fdtdump.c | 3 +--
> libfdt/fdt.c | 3 ---
> libfdt/fdt_empty_tree.c | 3 ---
> libfdt/fdt_ro.c | 3 ---
> libfdt/fdt_rw.c | 3 ---
> libfdt/fdt_strerror.c | 3 ---
> libfdt/fdt_sw.c | 3 ---
> libfdt/fdt_wip.c | 3 ---
> libfdt/libfdt_internal.h | 1 -
> 10 files changed, 2 insertions(+), 26 deletions(-)
>
> diff --git a/dtc.h b/dtc.h
> index 3e42a07..a032645 100644
> --- a/dtc.h
> +++ b/dtc.h
> @@ -32,8 +32,7 @@
> #include <errno.h>
> #include <unistd.h>
>
> -#include <libfdt_env.h>
> -#include <fdt.h>
> +#include <libfdt.h>
For dtc.h, this is wrong - dtc uses the structures in fdt.h, but
(deliberately) nothing in libfdt.h.
For the other cases, I'm a bit undecided. As you say, the individual
includes are redundant. In some cases the explicit inclusions kind of
document that the C code has direct dependencies on the stuff in
libfdt_env.h and fdt.h as well as the indirect dependencies from the
libfdt.h API. I'm not really sold either way.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-29 1:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-28 2:35 [PATCH] Use the libfdt.h include as the interface definition Gerald Van Baren
[not found] ` <5105E3EA.2070306-He//nVnquyzQT0dZR+AlfA@public.gmane.org>
2013-01-29 1:20 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).