diff --git a/Documentation/dtc-paper.tex b/Documentation/dtc-paper.tex index 91c4a49..4494226 100644 --- a/Documentation/dtc-paper.tex +++ b/Documentation/dtc-paper.tex @@ -193,7 +193,7 @@ particular, the following properties are desirable: \vdots & \multicolumn{1}{c|}{\vdots} & \\\cline{2-2} & \texttt{\dtendnode} \\\cline{2-2} & \texttt{\dtend} \\\cline{2-2} - \multicolumn{1}{r}{\vdots} & \multicolumn{1}{c}{\vdots} & \\\cline{2-2} + \multicolumn{1}{r}{\vdots} & \multicolumn{1}{c}{\vdots} & \\\cline{2-2} \multicolumn{1}{r}{\emph{totalsize}} \\ \end{tabular} \caption{Device tree blob layout} diff --git a/Documentation/manual.txt b/Documentation/manual.txt index 1f720e9..b957662 100644 --- a/Documentation/manual.txt +++ b/Documentation/manual.txt @@ -140,7 +140,7 @@ Here is a very rough overview of the layout of a DTS source file: memreserve: label 'memreserve' ADDR ADDR ';' | label 'memreserve' ADDR '-' ADDR ';' - + devicetree: '/' nodedef nodedef: '{' list_of_property list_of_subnode '}' ';' diff --git a/Makefile b/Makefile index 27e1499..e1f8987 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ PATCHLEVEL = 0 SUBLEVEL = 0 EXTRAVERSION = LOCAL_VERSION = -CONFIG_LOCALVERSION = +CONFIG_LOCALVERSION = DTC_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) VERSION_FILE = version_gen.h diff --git a/data.c b/data.c index f42ad58..2602249 100644 --- a/data.c +++ b/data.c @@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -11,11 +11,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ #include "dtc.h" @@ -106,7 +106,7 @@ static char get_oct_char(char *s, int *i) val = strtol(x, &endx, 8); if ((endx - x) == 0) fprintf(stderr, "Empty \\nnn escape\n"); - + (*i) += endx - x; return val; } @@ -125,7 +125,7 @@ static char get_hex_char(char *s, int *i) val = strtol(x, &endx, 16); if ((endx - x) == 0) fprintf(stderr, "Empty \\x escape\n"); - + (*i) += endx - x; return val; } diff --git a/dtc-lexer.l b/dtc-lexer.l index 384f848..08ed106 100644 --- a/dtc-lexer.l +++ b/dtc-lexer.l @@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -11,11 +11,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ %option noyywrap nounput yylineno diff --git a/dtc-parser.y b/dtc-parser.y index 19bc58e..54fd787 100644 --- a/dtc-parser.y +++ b/dtc-parser.y @@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -11,11 +11,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ %glr-parser diff --git a/dtc.c b/dtc.c index 8f5fe2f..92a338f 100644 --- a/dtc.c +++ b/dtc.c @@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -11,11 +11,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ #include "dtc.h" @@ -218,6 +218,6 @@ int main(int argc, char *argv[]) } else { die("Unknown output format \"%s\"\n", outform); } - + exit(0); } diff --git a/dtc.h b/dtc.h index 458403a..213e553 100644 --- a/dtc.h +++ b/dtc.h @@ -4,7 +4,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -14,11 +14,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ #include diff --git a/flattree.c b/flattree.c index d7dc6b0..664548d 100644 --- a/flattree.c +++ b/flattree.c @@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -11,11 +11,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ #include "dtc.h" @@ -111,7 +111,7 @@ static struct emitter bin_emitter = { .data = bin_emit_data, .beginnode = bin_emit_beginnode, .endnode = bin_emit_endnode, - .property = bin_emit_property, + .property = bin_emit_property, }; static void emit_label(FILE *f, char *prefix, char *label) @@ -144,7 +144,7 @@ static void asm_emit_string(void *e, char *str, int len) c = str[len]; str[len] = '\0'; } - + fprintf(f, "\t.string\t\"%s\"\n", str); if (len != 0) { @@ -178,7 +178,7 @@ static void asm_emit_data(void *e, struct data d) } if ((d.len - off) >= sizeof(u16)) { - fprintf(f, "\t.short\t0x%hx\n", + fprintf(f, "\t.short\t0x%hx\n", be16_to_cpu(*((u16 *)(d.val+off)))); off += sizeof(u16); } @@ -231,7 +231,7 @@ static struct emitter asm_emitter = { .data = asm_emit_data, .beginnode = asm_emit_beginnode, .endnode = asm_emit_endnode, - .property = asm_emit_property, + .property = asm_emit_property, }; static int stringtable_insert(struct data *d, char *str) @@ -717,7 +717,7 @@ static char *nodename_from_path(char *ppath, char *cpath) if (! strneq(ppath, cpath, plen)) return NULL; - + return strdup(lslash+1); } @@ -766,7 +766,7 @@ static struct node *unflatten_tree(struct inbuf *dtbuf, node->name = flat_read_string(dtbuf); node->fullpath = join_path(parent_path, node->name); } - + node->basenamelen = check_node_name(node->name); if (node->basenamelen < 0) { fprintf(stderr, "Warning \"%s\" has incorrect format\n", node->name); @@ -926,7 +926,7 @@ struct boot_info *dt_from_blob(FILE *f) if (off_dt+size_dt > totalsize) die("Structure block extends past total size\n"); } - + if (version < 16) { flags |= FTF_FULLPATH | FTF_NAMEPROPS | FTF_VARALIGN; } else { diff --git a/fstree.c b/fstree.c index a5bf9d3..28fd94c 100644 --- a/fstree.c +++ b/fstree.c @@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -11,11 +11,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ #include "dtc.h" @@ -44,7 +44,7 @@ static struct node *read_fstree(char *dirname) continue; tmpnam = join_path(dirname, de->d_name); - + if (lstat(tmpnam, &st) < 0) die("stat(%s): %s\n", tmpnam, strerror(errno)); diff --git a/ftdump.c b/ftdump.c index 55209b6..4792ecd 100644 --- a/ftdump.c +++ b/ftdump.c @@ -81,7 +81,7 @@ static void print_data(const void *data, int len) static void dump_blob(void *blob) { struct boot_param_header *bph = blob; - struct reserve_entry *p_rsvmap = + struct reserve_entry *p_rsvmap = (struct reserve_entry *)(blob + be32_to_cpu(bph->off_mem_rsvmap)); char *p_struct = blob + be32_to_cpu(bph->off_dt_struct); diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c index 0ee3f57..f358a20 100644 --- a/libfdt/fdt_ro.c +++ b/libfdt/fdt_ro.c @@ -166,7 +166,7 @@ int fdt_path_offset(const void *fdt, const char *path) p = q; } - return offset; + return offset; } const char *fdt_get_name(const void *fdt, int nodeoffset, int *len) @@ -244,7 +244,7 @@ const struct fdt_property *fdt_get_property(const void *fdt, if (lenp) *lenp = len; - + return prop; } break; diff --git a/livetree.c b/livetree.c index ce73f50..3b6542f 100644 --- a/livetree.c +++ b/livetree.c @@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -11,11 +11,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ #include "dtc.h" @@ -41,9 +41,9 @@ struct property *build_property(char *name, struct data val, char *label) struct property *chain_property(struct property *first, struct property *list) { assert(first->next == NULL); - + first->next = list; - return first; + return first; } struct node *build_node(struct property *proplist, struct node *children) @@ -232,7 +232,7 @@ static struct node *get_node_by_label(struct node *tree, const char *label) static struct node *get_node_by_phandle(struct node *tree, cell_t phandle) { - struct node *child, *node; + struct node *child, *node; assert((phandle != 0) && (phandle != -1)); @@ -333,13 +333,12 @@ static int check_properties(struct node *node) prop->name, node->fullpath); } } - /* check name length */ if (strlen(prop->name) > MAX_PROPNAME_LEN) WARNMSG("Property name %s is too long in %s\n", prop->name, node->fullpath); - + /* check this property */ for (i = 0; i < ARRAY_SIZE(prop_checker_table); i++) { if (streq(prop->name, prop_checker_table[i].propname)) @@ -426,7 +425,7 @@ static int check_structure(struct node *tree) (node)->fullpath, (propname), \ prop->val.val, (value)); \ } while (0) - + #define CHECK_HAVE_ONECELL(node, propname) \ do { \ CHECK_HAVE((node), (propname)); \ @@ -553,7 +552,7 @@ static int check_cpus(struct node *root, int outversion, int boot_cpuid_phys) WARNMSG("physical boot CPU not set. Use -b option to set\n"); } - return ok; + return ok; } static int check_memory(struct node *root) @@ -578,7 +577,7 @@ static int check_memory(struct node *root) return 0; } - return ok; + return ok; } static int check_chosen(struct node *root) diff --git a/tests/nop_property.c b/tests/nop_property.c index 56256c4..02371ac 100644 --- a/tests/nop_property.c +++ b/tests/nop_property.c @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) FAIL("prop-int still present after nopping"); if (lenerr != -FDT_ERR_NOTFOUND) FAIL("Unexpected error on second getprop: %s", fdt_strerror(err)); - + strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, TEST_STRING_1); verbose_printf("string value was \"%s\"\n", strp); diff --git a/tests/notfound.c b/tests/notfound.c index a93b605..e8d0582 100644 --- a/tests/notfound.c +++ b/tests/notfound.c @@ -68,6 +68,6 @@ int main(int argc, char *argv[]) offset = fdt_path_offset(fdt, "/nonexistant-subnode"); check_error("fdt_path_offset(\"/nonexistant-subnode\")", offset); - + PASS(); } diff --git a/tests/root_node.c b/tests/root_node.c index 6e2c391..fa2dc90 100644 --- a/tests/root_node.c +++ b/tests/root_node.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) test_init(argc, argv); fdt = load_blob_arg(argc, argv); - + nh = fdt_offset_ptr_typed(fdt, 0, nh); if (! nh) diff --git a/tests/setprop.c b/tests/setprop.c index 7f9be3e..d771954 100644 --- a/tests/setprop.c +++ b/tests/setprop.c @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) strp = check_getprop_string(fdt, 0, "prop-int", NEW_STRING); verbose_printf("New value is \"%s\"\n", strp); - + strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, TEST_STRING_1); diff --git a/tests/setprop_inplace.c b/tests/setprop_inplace.c index 59c1209..590dfeb 100644 --- a/tests/setprop_inplace.c +++ b/tests/setprop_inplace.c @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) ~TEST_VALUE_1, fdt_strerror(err)); intp = check_getprop_typed(fdt, 0, "prop-int", ~TEST_VALUE_1); verbose_printf("New int value is 0x%08x\n", *intp); - + strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, TEST_STRING_1); @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) xstr, fdt_strerror(err)); strp = check_getprop(fdt, 0, "prop-str", xlen+1, xstr); - verbose_printf("New string value is \"%s\"\n", strp); + verbose_printf("New string value is \"%s\"\n", strp); PASS(); } diff --git a/tests/testutils.c b/tests/testutils.c index fcb1c88..82aebc5 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -104,7 +104,6 @@ void check_property(void *fdt, int nodeoffset, const char *name, name, proplen, len); if (memcmp(val, prop->data, len) != 0) FAIL("Data mismatch on property \"%s\"", name); - } const void *check_getprop(void *fdt, int nodeoffset, const char *name, diff --git a/tests/trees.S b/tests/trees.S index 6057668..60e1b55 100644 --- a/tests/trees.S +++ b/tests/trees.S @@ -65,7 +65,7 @@ tree: \ #define STRING(tree, name, str) \ tree##_##name: \ .string str - + .data TREE_HDR(test_tree1) @@ -77,7 +77,7 @@ test_tree1_struct: BEGIN_NODE("") PROP_INT(test_tree1, prop_int, TEST_VALUE_1) PROP_STR(test_tree1, prop_str, TEST_STRING_1) - + BEGIN_NODE("subnode1") PROP_INT(test_tree1, prop_int, TEST_VALUE_1) @@ -110,7 +110,7 @@ truncated_property_struct: BEGIN_NODE("") PROPHDR(truncated_property, prop_truncated, 4) /* Oops, no actual property data here */ - + truncated_property_strings: STRING(truncated_property, prop_truncated, "truncated") truncated_property_end: diff --git a/treesource.c b/treesource.c index c067b20..a04c173 100644 --- a/treesource.c +++ b/treesource.c @@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson , IBM Corporation. 2005. * - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -11,11 +11,11 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA */ #include "dtc.h" @@ -77,7 +77,6 @@ static enum proptype guess_type(struct property *prop) return PROP_CELLS; else return PROP_BYTES; - }