dtc: Whitespace cleanup
Subsystems (2)
This large patch removes all trailing whitespace from dtc (including libfdt, the testsuite and documentation). It also removes a handful of redundant blank lines (at the end of functions, or when there are two blank lines together for no particular reason).
As well as anything else, this means that quilt won't whinge when I go to convert the whole of libfdt into a patch to apply to the kernel.
data.c +8 -8
@@ -1,7 +1,7 @@/* * (C) Copyright David Gibson <[email protected]>, 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 @@ val =strtol (x, &endx,8 );if ((endx - x) ==0 )fprintf (stderr,"Empty \\nnn escape\n" ); - + (*i) += endx - x;return val; }
@@ -125,7 +125,7 @@ val =strtol (x, &endx,16 );if ((endx - x) ==0 )fprintf (stderr,"Empty \\x escape\n" ); - + (*i) += endx - x;return val; }
treesource.c +6 -7
@@ -1,7 +1,7 @@/* * (C) Copyright David Gibson <[email protected]>, 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 @@return PROP_CELLS ; else return PROP_BYTES; - }
tests/root_node.c +1 -1
@@ -36,7 +36,7 @@test_init (argc, argv); fdt =load_blob_arg (argc, argv); - + nh =fdt_offset_ptr_typed (fdt,0 , nh);if (! nh)
tests/testutils.c +0 -1
@@ -104,7 +104,6 @@ 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,
tests/nop_property.c +1 -1
@@ -53,7 +53,7 @@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);
tests/notfound.c +1 -1
@@ -68,6 +68,6 @@ offset =fdt_path_offset (fdt,"/nonexistant-subnode" );check_error ("fdt_path_offset(\"/nonexistant-subnode\")" , offset); - +PASS (); }
tests/setprop.c +1 -1
@@ -62,7 +62,7 @@ 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 );
tests/setprop_inplace.c +2 -2
@@ -51,7 +51,7 @@ ~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 @@ 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 (); }
tests/trees.S +3 -3
@@ -65,7 +65,7 @@ #define STRING(tree, name, str) \ tree##_##name: \ .string str - + .data TREE_HDR(test_tree1)
@@ -77,7 +77,7 @@ 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 @@ 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:
flattree.c +13 -13
@@ -1,7 +1,7 @@/* * (C) Copyright David Gibson <[email protected]>, 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 @@ .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 @@ c = str[len]; str[len] ='\0' ; } - +fprintf (f,"\t.string\t\"%s\"\n" , str);if (len !=0 ) {
@@ -178,7 +178,7 @@ }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 @@ .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 @@if (!strneq (ppath, cpath, plen))return NULL ; - +return strdup (lslash+1 ); }
@@ -766,7 +766,7 @@ 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 @@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 {
ftdump.c +1 -1
@@ -81,7 +81,7 @@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);
Makefile +1 -1
@@ -13,7 +13,7 @@ SUBLEVEL = 0 EXTRAVERSION = LOCAL_VERSION = -CONFIG_LOCALVERSION = +CONFIG_LOCALVERSION = DTC_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) VERSION_FILE = version_gen.h
dtc.c +7 -7
@@ -1,7 +1,7 @@/* * (C) Copyright David Gibson <[email protected]>, 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 @@ }else {die ("Unknown output format \"%s\"\n" , outform); } - +exit (0 ); }
dtc-lexer.l +6 -6
@@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson <[email protected]>, 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
dtc-parser.y +6 -6
@@ -1,7 +1,7 @@ /* * (C) Copyright David Gibson <[email protected]>, 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
dtc.h +6 -6
@@ -4,7 +4,7 @@/* * (C) Copyright David Gibson <[email protected]>, 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 <stdio.h>
Documentation/dtc-paper.tex +1 -1
@@ -193,7 +193,7 @@ \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}
Documentation/manual.txt +1 -1
@@ -140,7 +140,7 @@ memreserve: label 'memreserve' ADDR ADDR ';' | label 'memreserve' ADDR '-' ADDR ';' - + devicetree: '/' nodedef nodedef: '{' list_of_property list_of_subnode '}' ';'
livetree.c +13 -14
@@ -1,7 +1,7 @@/* * (C) Copyright David Gibson <[email protected]>, 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 *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_phandle (struct node *tree,cell_t phandle) { -struct node *child, *node; +struct node *child, *node;assert ((phandle !=0 ) && (phandle !=-1 ));
@@ -333,13 +333,12 @@ 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 @@ (node)->fullpath, (propname), \ prop->val.val, (value)); \ } while (0) - +#define CHECK_HAVE_ONECELL (node, propname) \ do { \ CHECK_HAVE((node), (propname)); \
@@ -553,7 +552,7 @@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 @@return 0 ; } -return ok; +return ok; }static int check_chosen (struct node *root)
fstree.c +7 -7
@@ -1,7 +1,7 @@/* * (C) Copyright David Gibson <[email protected]>, 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 @@continue ; tmpnam =join_path (dirname, de->d_name); - +if (lstat (tmpnam, &st) <0 )die ("stat(%s): %s\n" , tmpnam,strerror (errno));
libfdt/fdt_ro.c +2 -2
@@ -166,7 +166,7 @@ p = q; } -return offset; +return offset; }const char *fdt_get_name (const void *fdt,int nodeoffset,int *len)
@@ -244,7 +244,7 @@if (lenp) *lenp = len; - +return prop; }break ;
Signature · 4 lines
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
Jon Loeliger
AppliedSo, like, the other day David Gibson mumbled:
Quoted 9 lines
This large patch removes all trailing whitespace from dtc (including libfdt, the testsuite and documentation). It also removes a handful of redundant blank lines (at the end of functions, or when there are two blank lines together for no particular reason).
As well as anything else, this means that quilt won't whinge when I go to convert the whole of libfdt into a patch to apply to the kernel.
Signed-off-by David Gibson <[email protected]>
Applied.
Thanks,
jdl