Skip to content

Commit

Permalink
kbuild: fixdep: drop meaningless hash table initialization
Browse files Browse the repository at this point in the history
The clear_config() is called just once at the beginning of this
program, but the global variable hashtab[] is already zero-filled
at the start-up.

Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
masahir0y authored and Michal Marek committed Aug 24, 2015
1 parent d721109 commit d179e22
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,23 +191,6 @@ static void define_config(const char *name, int len, unsigned int hash)
hashtab[hash % HASHSZ] = aux;
}

/*
* Clear the set of configuration strings.
*/
static void clear_config(void)
{
struct item *aux, *next;
unsigned int i;

for (i = 0; i < HASHSZ; i++) {
for (aux = hashtab[i]; aux; aux = next) {
next = aux->next;
free(aux);
}
hashtab[i] = NULL;
}
}

/*
* Record the use of a CONFIG_* word.
*/
Expand Down Expand Up @@ -325,8 +308,6 @@ static void parse_dep_file(void *map, size_t len)
int saw_any_target = 0;
int is_first_dep = 0;

clear_config();

while (m < end) {
/* Skip any "white space" */
while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
Expand Down

0 comments on commit d179e22

Please sign in to comment.