/* manipulate/lookup device names */
-typedef struct _name_specifier {
+typedef struct _name_specifier
+{
/* components in the full length name */
char *path;
/* an interrupt spec */
spec->property = NULL;
}
- else {
- chp = strrchr(spec->path, '/');
- if (chp == NULL)
- {
- spec->property = spec->path;
- spec->path = strchr(spec->property, '\0');
- }
- else {
- *chp = '\0';
- spec->property = chp+1;
+ else
+ {
+ chp = strrchr(spec->path, '/');
+ if (chp == NULL)
+ {
+ spec->property = spec->path;
+ spec->path = strchr(spec->property, '\0');
+ }
+ else
+ {
+ *chp = '\0';
+ spec->property = chp+1;
+ }
}
- }
/* and mark the rest as invalid */
spec->name = NULL;
pos = 0;
while (*chp != '\0' && *chp != '"')
{
- if (*chp == '\\' && *(chp+1) != '\0') {
- strings[nr_strings][pos] = *(chp+1);
- chp += 2;
- pos++;
- }
+ if (*chp == '\\' && *(chp+1) != '\0')
+ {
+ strings[nr_strings][pos] = *(chp+1);
+ chp += 2;
+ pos++;
+ }
else
{
strings[nr_strings][pos] = *chp;
\f
-struct printer {
+struct printer
+{
hw_tree_print_callback *print;
void *file;
};
for (i = 0; i < size->nr_cells; i++)
if (size->cells[i] != 0)
break;
- if (i < size->nr_cells) {
- p->print (p->file, " 0x%lx", (unsigned long) size->cells[i]);
- i++;
- for (; i < size->nr_cells; i++)
- p->print (p->file, ",0x%lx", (unsigned long) size->cells[i]);
- }
+ if (i < size->nr_cells)
+ {
+ p->print (p->file, " 0x%lx", (unsigned long) size->cells[i]);
+ i++;
+ for (; i < size->nr_cells; i++)
+ p->print (p->file, ",0x%lx", (unsigned long) size->cells[i]);
+ }
else
p->print (p->file, " 0");
}
reg_property_spec reg;
for (reg_nr = 0;
hw_find_reg_array_property (me, property->name, reg_nr, ®);
- reg_nr++) {
- print_address (hw_parent (me), ®.address, p);
- print_size (me, ®.size, p);
- }
+ reg_nr++)
+ {
+ print_address (hw_parent (me), ®.address, p);
+ print_size (me, ®.size, p);
+ }
}
static void
struct printer *p)
{
p->print (p->file, " \"");
- while (*string != '\0') {
- switch (*string) {
- case '"':
- p->print (p->file, "\\\"");
- break;
- case '\\':
- p->print (p->file, "\\\\");
- break;
- default:
- p->print (p->file, "%c", *string);
- break;
+ while (*string != '\0')
+ {
+ switch (*string)
+ {
+ case '"':
+ p->print (p->file, "\\\"");
+ break;
+ case '\\':
+ p->print (p->file, "\\\\");
+ break;
+ default:
+ p->print (p->file, "%c", *string);
+ break;
+ }
+ string++;
}
- string++;
- }
p->print (p->file, "\"");
}
{
unsigned8 *w = (unsigned8*)property->array;
p->print (p->file, " [");
- while ((char*)w - (char*)property->array < property->sizeof_array) {
- p->print (p->file, " 0x%2x", BE2H_1 (*w));
- w++;
- }
+ while ((char*)w - (char*)property->array < property->sizeof_array)
+ {
+ p->print (p->file, " 0x%2x", BE2H_1 (*w));
+ w++;
+ }
}
break;
}