treewide: Clean up #includes
clang-tidy (as invoked by Zed editor) complains about various not-directly used #includes. Clean those up, though it does mean changing style a bit (no longer using dtc.h to #include anything that any .c file might need). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>main
parent
2ecd679909
commit
79ad3e321f
1
checks.c
1
checks.c
|
|
@ -2,6 +2,7 @@
|
|||
/*
|
||||
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2007.
|
||||
*/
|
||||
#include <ctype.h>
|
||||
|
||||
#include "dtc.h"
|
||||
#include "srcpos.h"
|
||||
|
|
|
|||
2
data.c
2
data.c
|
|
@ -2,8 +2,10 @@
|
|||
/*
|
||||
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
|
||||
*/
|
||||
#include <errno.h>
|
||||
|
||||
#include "dtc.h"
|
||||
#include "util.h"
|
||||
|
||||
void data_free(struct data d)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ COMMENT "/*"([^*]|\*+[^*/])*\*+"/"
|
|||
LINECOMMENT "//".*\n
|
||||
|
||||
%{
|
||||
#include <ctype.h>
|
||||
|
||||
#include "dtc.h"
|
||||
#include "srcpos.h"
|
||||
#include "dtc-parser.tab.h"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
%locations
|
||||
|
||||
%{
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
|
|
|
|||
1
dtc.c
1
dtc.c
|
|
@ -3,6 +3,7 @@
|
|||
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "dtc.h"
|
||||
|
|
|
|||
4
dtc.h
4
dtc.h
|
|
@ -13,16 +13,12 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <libfdt_env.h>
|
||||
#include <fdt.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define debug(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <libfdt.h>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/*
|
||||
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
|
||||
*/
|
||||
#include <errno.h>
|
||||
|
||||
#include "dtc.h"
|
||||
#include "srcpos.h"
|
||||
|
|
|
|||
6
fstree.c
6
fstree.c
|
|
@ -3,11 +3,13 @@
|
|||
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
|
||||
*/
|
||||
|
||||
#include "dtc.h"
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "dtc.h"
|
||||
#include "util.h"
|
||||
|
||||
static struct node *read_fstree(const char *dirname)
|
||||
{
|
||||
DIR *d;
|
||||
|
|
|
|||
1
srcpos.c
1
srcpos.c
|
|
@ -7,6 +7,7 @@
|
|||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "dtc.h"
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
static int expect_bad; /* = 0 */
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <libfdt.h>
|
||||
|
||||
#include "tests.h"
|
||||
#include "util.h"
|
||||
|
||||
static void *dtdup(void *dt)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <libfdt.h>
|
||||
|
||||
#include "tests.h"
|
||||
#include "util.h"
|
||||
|
||||
#define CHECK(code) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define CHECK(code) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define POISON ('\xff')
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define CHUNKSIZE 1024
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
static int nopulate_struct(char *buf, const char *fdt)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <libfdt.h>
|
||||
|
||||
#include "tests.h"
|
||||
#include "util.h"
|
||||
|
||||
#define CHECK(code) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <libfdt.h>
|
||||
|
||||
#include "tests.h"
|
||||
#include "util.h"
|
||||
|
||||
#define CHECK(code, expected) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
/* This is not derived programmatically. May require adjustment to changes. */
|
||||
#define SPACE 285
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
#define NEW_STRING "here is quite a long test string, blah blah blah"
|
||||
|
|
@ -78,6 +79,6 @@ int main(int argc, char *argv[])
|
|||
FAIL("Failed to set \"prop-u64\" to 0x%016llx: %s",
|
||||
TEST_VALUE64_1, fdt_strerror(err));
|
||||
check_getprop_64(fdt, 0, "prop-u64", TEST_VALUE64_1);
|
||||
|
||||
|
||||
PASS();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ static void realloc_fdt(void **fdt, size_t *size, bool created)
|
|||
fdt_strerror(err));
|
||||
} else {
|
||||
FAIL("Ran out of space");
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
case REALLOC:
|
||||
|
|
@ -128,7 +129,7 @@ int main(int argc, char *argv[])
|
|||
size = strtoul(argv[1], &endp, 0);
|
||||
if (*endp == '\0')
|
||||
alloc_mode = FIXED;
|
||||
else
|
||||
else
|
||||
CONFIG("Bad allocation mode \"%s\" specified",
|
||||
argv[1]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,6 +116,4 @@ void *load_blob_arg(int argc, char *argv[]);
|
|||
void save_blob(const char *filename, void *blob);
|
||||
void *open_blob_rw(const void *blob);
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#endif /* TESTS_H */
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#ifdef NO_VALGRIND
|
||||
static inline void VALGRIND_MAKE_MEM_UNDEFINED(void *p, size_t len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
#include <libfdt_env.h>
|
||||
#include <fdt.h>
|
||||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
/*
|
||||
* Buffer with write cursor. Emit helpers write at the cursor, advance it, and
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "tests.h"
|
||||
#include "testdata.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SPACE 65536
|
||||
|
||||
|
|
@ -57,7 +58,7 @@ int main(int argc, char *argv[])
|
|||
if (err != -FDT_ERR_TRUNCATED)
|
||||
FAIL("fdt_del_mem_rsv() returned %d instead of -FDT_ERR_TRUNCATED",
|
||||
err);
|
||||
|
||||
|
||||
buf = xmalloc(SPACE);
|
||||
err = fdt_open_into(fdt, buf, SPACE);
|
||||
if (err != -FDT_ERR_TRUNCATED)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/*
|
||||
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
|
||||
*/
|
||||
#include <ctype.h>
|
||||
|
||||
#include "dtc.h"
|
||||
#include "srcpos.h"
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@
|
|||
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <yaml.h>
|
||||
|
||||
#include "dtc.h"
|
||||
#include "srcpos.h"
|
||||
#include "util.h"
|
||||
|
||||
const char *yaml_error_name[] = {
|
||||
[YAML_NO_ERROR] = "no error",
|
||||
|
|
|
|||
Loading…
Reference in New Issue