Skip to content
This repository has been archived by the owner on Dec 29, 2017. It is now read-only.

Commit

Permalink
kbuild: trivial - use tabs for code indent where possible
Browse files Browse the repository at this point in the history
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
masahir0y authored and michal42 committed Jun 10, 2014
1 parent 7eb6e34 commit bb66fc6
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 91 deletions.
8 changes: 4 additions & 4 deletions scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ static void print_deps(void)
exit(2);
}
if (fstat(fd, &st) < 0) {
fprintf(stderr, "fixdep: error fstat'ing depfile: ");
perror(depfile);
exit(2);
}
fprintf(stderr, "fixdep: error fstat'ing depfile: ");
perror(depfile);
exit(2);
}
if (st.st_size == 0) {
fprintf(stderr,"fixdep: %s is empty\n",depfile);
close(fd);
Expand Down
56 changes: 28 additions & 28 deletions scripts/docproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int symfilecnt = 0;
static void add_new_symbol(struct symfile *sym, char * symname)
{
sym->symbollist =
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
sym->symbollist[sym->symbolcnt++].name = strdup(symname);
}

Expand Down Expand Up @@ -215,7 +215,7 @@ static void find_export_symbols(char * filename)
char *p;
char *e;
if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != NULL) ||
((p = strstr(line, "EXPORT_SYMBOL")) != NULL)) {
((p = strstr(line, "EXPORT_SYMBOL")) != NULL)) {
/* Skip EXPORT_SYMBOL{_GPL} */
while (isalnum(*p) || *p == '_')
p++;
Expand Down Expand Up @@ -291,28 +291,28 @@ static void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
static void singfunc(char * filename, char * line)
{
char *vec[200]; /* Enough for specific functions */
int i, idx = 0;
int startofsym = 1;
int i, idx = 0;
int startofsym = 1;
vec[idx++] = KERNELDOC;
vec[idx++] = DOCBOOK;
vec[idx++] = SHOWNOTFOUND;

/* Split line up in individual parameters preceded by FUNCTION */
for (i=0; line[i]; i++) {
if (isspace(line[i])) {
line[i] = '\0';
startofsym = 1;
continue;
}
if (startofsym) {
startofsym = 0;
vec[idx++] = FUNCTION;
vec[idx++] = &line[i];
}
}
/* Split line up in individual parameters preceded by FUNCTION */
for (i=0; line[i]; i++) {
if (isspace(line[i])) {
line[i] = '\0';
startofsym = 1;
continue;
}
if (startofsym) {
startofsym = 0;
vec[idx++] = FUNCTION;
vec[idx++] = &line[i];
}
}
for (i = 0; i < idx; i++) {
if (strcmp(vec[i], FUNCTION))
continue;
if (strcmp(vec[i], FUNCTION))
continue;
consume_symbol(vec[i + 1]);
}
vec[idx++] = filename;
Expand Down Expand Up @@ -460,14 +460,14 @@ static void parse_file(FILE *infile)
break;
case 'D':
while (*s && !isspace(*s)) s++;
*s = '\0';
symbolsonly(line+2);
break;
*s = '\0';
symbolsonly(line+2);
break;
case 'F':
/* filename */
while (*s && !isspace(*s)) s++;
*s++ = '\0';
/* function names */
/* function names */
while (isspace(*s))
s++;
singlefunctions(line +2, s);
Expand Down Expand Up @@ -515,11 +515,11 @@ int main(int argc, char *argv[])
}
/* Open file, exit on error */
infile = fopen(argv[2], "r");
if (infile == NULL) {
fprintf(stderr, "docproc: ");
perror(argv[2]);
exit(2);
}
if (infile == NULL) {
fprintf(stderr, "docproc: ");
perror(argv[2]);
exit(2);
}

if (strcmp("doc", argv[1]) == 0) {
/* Need to do this in two passes.
Expand Down
2 changes: 1 addition & 1 deletion scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static int read_symbol(FILE *in, struct sym_entry *s)
}
if (strlen(str) > KSYM_NAME_LEN) {
fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
"Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
str, strlen(str), KSYM_NAME_LEN);
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ int main(int ac, char **av)
} else if (input_mode == savedefconfig) {
if (conf_write_defconfig(defconfig_file)) {
fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"),
defconfig_file);
defconfig_file);
return 1;
}
} else if (input_mode != listnewconfig) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/gconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ static void display_tree(struct menu *menu)
&& (tree == tree2))
continue;
/*
if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT))
if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT))
|| (view_mode == FULL_VIEW)
|| (view_mode == SPLIT_VIEW))*/

Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/lxdialog/checklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ int dialog_checklist(const char *title, const char *prompt, int height,

/* create new window for the list */
list = subwin(dialog, list_height, list_width, y + box_y + 1,
x + box_x + 1);
x + box_x + 1);

keypad(list, TRUE);

/* draw a box around the list items */
draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2,
dlg.menubox_border.atr, dlg.menubox.atr);
dlg.menubox_border.atr, dlg.menubox.atr);

/* Find length of longest item in order to center checklist */
check_x = 0;
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/lxdialog/inputbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
* Display a dialog box for inputing a string
*/
int dialog_inputbox(const char *title, const char *prompt, int height, int width,
const char *init)
const char *init)
{
int i, x, y, box_y, box_x, box_width;
int input_x = 0, key = 0, button = -1;
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/lxdialog/menubox.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static int menu_width, item_x;
* Print menu item
*/
static void do_print_item(WINDOW * win, const char *item, int line_y,
int selected, int hotkey)
int selected, int hotkey)
{
int j;
char *menu_item = malloc(menu_width + 1);
Expand Down Expand Up @@ -182,7 +182,7 @@ static void do_scroll(WINDOW *win, int *scroll, int n)
* Display a menu for choosing among a number of options
*/
int dialog_menu(const char *title, const char *prompt,
const void *selected, int *s_scroll)
const void *selected, int *s_scroll)
{
int i, j, x, y, box_x, box_y;
int height, width, menu_height;
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/lxdialog/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ void item_make(const char *fmt, ...)
void item_add_str(const char *fmt, ...)
{
va_list ap;
size_t avail;
size_t avail;

avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str);

Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/mconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static void set_config_filename(const char *config_filename)
int size;

size = snprintf(menu_backtitle, sizeof(menu_backtitle),
"%s - %s", config_filename, rootmenu.prompt->text);
"%s - %s", config_filename, rootmenu.prompt->text);
if (size >= sizeof(menu_backtitle))
menu_backtitle[sizeof(menu_backtitle)-1] = '\0';
set_dialog_backtitle(menu_backtitle);
Expand Down
6 changes: 3 additions & 3 deletions scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ static void sym_check_prop(struct symbol *sym)
"config symbol '%s' uses select, but is "
"not boolean or tristate", sym->name);
else if (sym2->type != S_UNKNOWN &&
sym2->type != S_BOOLEAN &&
sym2->type != S_TRISTATE)
sym2->type != S_BOOLEAN &&
sym2->type != S_TRISTATE)
prop_warn(prop,
"'%s' has wrong type. 'select' only "
"accept arguments of boolean and "
Expand All @@ -268,7 +268,7 @@ static void sym_check_prop(struct symbol *sym)
case P_RANGE:
if (sym->type != S_INT && sym->type != S_HEX)
prop_warn(prop, "range is only allowed "
"for int or hex symbols");
"for int or hex symbols");
if (!menu_validate_number(sym, prop->expr->left.sym) ||
!menu_validate_number(sym, prop->expr->right.sym))
prop_warn(prop, "range is invalid");
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/zconf.l
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ static char *text;
static int text_size, text_asize;

struct buffer {
struct buffer *parent;
YY_BUFFER_STATE state;
struct buffer *parent;
YY_BUFFER_STATE state;
};

struct buffer *current_buf;
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/zconf.lex.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,8 @@ static char *text;
static int text_size, text_asize;

struct buffer {
struct buffer *parent;
YY_BUFFER_STATE state;
struct buffer *parent;
YY_BUFFER_STATE state;
};

struct buffer *current_buf;
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/zconf.tab.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,7 @@ void conf_parse(const char *name)
for_all_symbols(i, sym) {
if (sym_check_deps(sym))
zconfnerrs++;
}
}
if (zconfnerrs)
exit(1);
sym_set_change_count(1);
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/zconf.y
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ void conf_parse(const char *name)
for_all_symbols(i, sym) {
if (sym_check_deps(sym))
zconfnerrs++;
}
}
if (zconfnerrs)
exit(1);
sym_set_change_count(1);
Expand Down
42 changes: 20 additions & 22 deletions scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,28 +644,26 @@ ADD_TO_DEVTABLE("pcmcia", pcmcia_device_id, do_pcmcia_entry);

static int do_of_entry (const char *filename, void *symval, char *alias)
{
int len;
char *tmp;
DEF_FIELD_ADDR(symval, of_device_id, name);
DEF_FIELD_ADDR(symval, of_device_id, type);
DEF_FIELD_ADDR(symval, of_device_id, compatible);

len = sprintf (alias, "of:N%sT%s",
(*name)[0] ? *name : "*",
(*type)[0] ? *type : "*");

if (compatible[0])
sprintf (&alias[len], "%sC%s",
(*type)[0] ? "*" : "",
*compatible);

/* Replace all whitespace with underscores */
for (tmp = alias; tmp && *tmp; tmp++)
if (isspace (*tmp))
*tmp = '_';

add_wildcard(alias);
return 1;
int len;
char *tmp;
DEF_FIELD_ADDR(symval, of_device_id, name);
DEF_FIELD_ADDR(symval, of_device_id, type);
DEF_FIELD_ADDR(symval, of_device_id, compatible);

len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
(*type)[0] ? *type : "*");

if (compatible[0])
sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
*compatible);

/* Replace all whitespace with underscores */
for (tmp = alias; tmp && *tmp; tmp++)
if (isspace (*tmp))
*tmp = '_';

add_wildcard(alias);
return 1;
}
ADD_TO_DEVTABLE("of", of_device_id, do_of_entry);

Expand Down
Loading

0 comments on commit bb66fc6

Please sign in to comment.